adjust patches and config once again...
[openwrt.git] / target / linux / s3c24xx / patches-2.6.29 / 000-downgrade-to-rc3.patch
1 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/alpha/include/asm/bug.h linux-2.6.29-rc3.owrt/arch/alpha/include/asm/bug.h
2 --- linux-2.6.29.owrt/arch/alpha/include/asm/bug.h 2009-05-10 22:04:41.000000000 +0200
3 +++ linux-2.6.29-rc3.owrt/arch/alpha/include/asm/bug.h 2009-05-10 23:48:27.000000000 +0200
4 @@ -8,12 +8,17 @@
5
6 /* ??? Would be nice to use .gprel32 here, but we can't be sure that the
7 function loaded the GP, so this could fail in modules. */
8 -#define BUG() do { \
9 - __asm__ __volatile__( \
10 - "call_pal %0 # bugchk\n\t" \
11 - ".long %1\n\t.8byte %2" \
12 - : : "i"(PAL_bugchk), "i"(__LINE__), "i"(__FILE__)); \
13 - for ( ; ; ); } while (0)
14 +static inline void ATTRIB_NORET __BUG(const char *file, int line)
15 +{
16 + __asm__ __volatile__(
17 + "call_pal %0 # bugchk\n\t"
18 + ".long %1\n\t.8byte %2"
19 + : : "i" (PAL_bugchk), "i"(line), "i"(file));
20 + for ( ; ; )
21 + ;
22 +}
23 +
24 +#define BUG() __BUG(__FILE__, __LINE__)
25
26 #define HAVE_ARCH_BUG
27 #endif
28 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/alpha/include/asm/dma-mapping.h linux-2.6.29-rc3.owrt/arch/alpha/include/asm/dma-mapping.h
29 --- linux-2.6.29.owrt/arch/alpha/include/asm/dma-mapping.h 2009-05-10 22:04:41.000000000 +0200
30 +++ linux-2.6.29-rc3.owrt/arch/alpha/include/asm/dma-mapping.h 2009-05-10 23:48:27.000000000 +0200
31 @@ -29,8 +29,6 @@
32
33 #else /* no PCI - no IOMMU. */
34
35 -#include <asm/io.h> /* for virt_to_phys() */
36 -
37 struct scatterlist;
38 void *dma_alloc_coherent(struct device *dev, size_t size,
39 dma_addr_t *dma_handle, gfp_t gfp);
40 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/alpha/Kconfig linux-2.6.29-rc3.owrt/arch/alpha/Kconfig
41 --- linux-2.6.29.owrt/arch/alpha/Kconfig 2009-05-10 22:04:41.000000000 +0200
42 +++ linux-2.6.29-rc3.owrt/arch/alpha/Kconfig 2009-05-10 23:48:27.000000000 +0200
43 @@ -8,7 +8,6 @@
44 select HAVE_AOUT
45 select HAVE_IDE
46 select HAVE_OPROFILE
47 - select HAVE_SYSCALL_WRAPPERS
48 help
49 The Alpha is a 64-bit general-purpose processor designed and
50 marketed by the Digital Equipment Corporation of blessed memory,
51 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/alpha/kernel/entry.S linux-2.6.29-rc3.owrt/arch/alpha/kernel/entry.S
52 --- linux-2.6.29.owrt/arch/alpha/kernel/entry.S 2009-05-10 22:04:41.000000000 +0200
53 +++ linux-2.6.29-rc3.owrt/arch/alpha/kernel/entry.S 2009-05-10 23:48:27.000000000 +0200
54 @@ -933,7 +933,7 @@
55 osf_sigprocmask:
56 .prologue 0
57 mov $sp, $18
58 - jmp $31, sys_osf_sigprocmask
59 + jmp $31, do_osf_sigprocmask
60 .end osf_sigprocmask
61
62 .align 4
63 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/alpha/kernel/osf_sys.c linux-2.6.29-rc3.owrt/arch/alpha/kernel/osf_sys.c
64 --- linux-2.6.29.owrt/arch/alpha/kernel/osf_sys.c 2009-05-10 22:04:41.000000000 +0200
65 +++ linux-2.6.29-rc3.owrt/arch/alpha/kernel/osf_sys.c 2009-05-10 23:48:27.000000000 +0200
66 @@ -54,7 +54,8 @@
67 * identical to OSF as we don't return 0 on success, but doing otherwise
68 * would require changes to libc. Hopefully this is good enough.
69 */
70 -SYSCALL_DEFINE1(osf_brk, unsigned long, brk)
71 +asmlinkage unsigned long
72 +osf_brk(unsigned long brk)
73 {
74 unsigned long retval = sys_brk(brk);
75 if (brk && brk != retval)
76 @@ -65,9 +66,9 @@
77 /*
78 * This is pure guess-work..
79 */
80 -SYSCALL_DEFINE4(osf_set_program_attributes, unsigned long, text_start,
81 - unsigned long, text_len, unsigned long, bss_start,
82 - unsigned long, bss_len)
83 +asmlinkage int
84 +osf_set_program_attributes(unsigned long text_start, unsigned long text_len,
85 + unsigned long bss_start, unsigned long bss_len)
86 {
87 struct mm_struct *mm;
88
89 @@ -145,9 +146,9 @@
90 return -EFAULT;
91 }
92
93 -SYSCALL_DEFINE4(osf_getdirentries, unsigned int, fd,
94 - struct osf_dirent __user *, dirent, unsigned int, count,
95 - long __user *, basep)
96 +asmlinkage int
97 +osf_getdirentries(unsigned int fd, struct osf_dirent __user *dirent,
98 + unsigned int count, long __user *basep)
99 {
100 int error;
101 struct file *file;
102 @@ -176,9 +177,9 @@
103
104 #undef NAME_OFFSET
105
106 -SYSCALL_DEFINE6(osf_mmap, unsigned long, addr, unsigned long, len,
107 - unsigned long, prot, unsigned long, flags, unsigned long, fd,
108 - unsigned long, off)
109 +asmlinkage unsigned long
110 +osf_mmap(unsigned long addr, unsigned long len, unsigned long prot,
111 + unsigned long flags, unsigned long fd, unsigned long off)
112 {
113 struct file *file = NULL;
114 unsigned long ret = -EBADF;
115 @@ -253,8 +254,8 @@
116 return error;
117 }
118
119 -SYSCALL_DEFINE3(osf_statfs, char __user *, pathname,
120 - struct osf_statfs __user *, buffer, unsigned long, bufsiz)
121 +asmlinkage int
122 +osf_statfs(char __user *pathname, struct osf_statfs __user *buffer, unsigned long bufsiz)
123 {
124 struct path path;
125 int retval;
126 @@ -267,8 +268,8 @@
127 return retval;
128 }
129
130 -SYSCALL_DEFINE3(osf_fstatfs, unsigned long, fd,
131 - struct osf_statfs __user *, buffer, unsigned long, bufsiz)
132 +asmlinkage int
133 +osf_fstatfs(unsigned long fd, struct osf_statfs __user *buffer, unsigned long bufsiz)
134 {
135 struct file *file;
136 int retval;
137 @@ -367,8 +368,8 @@
138 return do_mount("", dirname, "proc", flags, NULL);
139 }
140
141 -SYSCALL_DEFINE4(osf_mount, unsigned long, typenr, char __user *, path,
142 - int, flag, void __user *, data)
143 +asmlinkage int
144 +osf_mount(unsigned long typenr, char __user *path, int flag, void __user *data)
145 {
146 int retval = -EINVAL;
147 char *name;
148 @@ -398,7 +399,8 @@
149 return retval;
150 }
151
152 -SYSCALL_DEFINE1(osf_utsname, char __user *, name)
153 +asmlinkage int
154 +osf_utsname(char __user *name)
155 {
156 int error;
157
158 @@ -421,12 +423,14 @@
159 return error;
160 }
161
162 -SYSCALL_DEFINE0(getpagesize)
163 +asmlinkage unsigned long
164 +sys_getpagesize(void)
165 {
166 return PAGE_SIZE;
167 }
168
169 -SYSCALL_DEFINE0(getdtablesize)
170 +asmlinkage unsigned long
171 +sys_getdtablesize(void)
172 {
173 return sysctl_nr_open;
174 }
175 @@ -434,7 +438,8 @@
176 /*
177 * For compatibility with OSF/1 only. Use utsname(2) instead.
178 */
179 -SYSCALL_DEFINE2(osf_getdomainname, char __user *, name, int, namelen)
180 +asmlinkage int
181 +osf_getdomainname(char __user *name, int namelen)
182 {
183 unsigned len;
184 int i;
185 @@ -522,8 +527,8 @@
186 PL_DEL = 5, PL_FDEL = 6
187 };
188
189 -SYSCALL_DEFINE2(osf_proplist_syscall, enum pl_code, code,
190 - union pl_args __user *, args)
191 +asmlinkage long
192 +osf_proplist_syscall(enum pl_code code, union pl_args __user *args)
193 {
194 long error;
195 int __user *min_buf_size_ptr;
196 @@ -562,8 +567,8 @@
197 return error;
198 }
199
200 -SYSCALL_DEFINE2(osf_sigstack, struct sigstack __user *, uss,
201 - struct sigstack __user *, uoss)
202 +asmlinkage int
203 +osf_sigstack(struct sigstack __user *uss, struct sigstack __user *uoss)
204 {
205 unsigned long usp = rdusp();
206 unsigned long oss_sp = current->sas_ss_sp + current->sas_ss_size;
207 @@ -603,7 +608,8 @@
208 return error;
209 }
210
211 -SYSCALL_DEFINE3(osf_sysinfo, int, command, char __user *, buf, long, count)
212 +asmlinkage long
213 +osf_sysinfo(int command, char __user *buf, long count)
214 {
215 char *sysinfo_table[] = {
216 utsname()->sysname,
217 @@ -641,8 +647,9 @@
218 return err;
219 }
220
221 -SYSCALL_DEFINE5(osf_getsysinfo, unsigned long, op, void __user *, buffer,
222 - unsigned long, nbytes, int __user *, start, void __user *, arg)
223 +asmlinkage unsigned long
224 +osf_getsysinfo(unsigned long op, void __user *buffer, unsigned long nbytes,
225 + int __user *start, void __user *arg)
226 {
227 unsigned long w;
228 struct percpu_struct *cpu;
229 @@ -698,8 +705,9 @@
230 return -EOPNOTSUPP;
231 }
232
233 -SYSCALL_DEFINE5(osf_setsysinfo, unsigned long, op, void __user *, buffer,
234 - unsigned long, nbytes, int __user *, start, void __user *, arg)
235 +asmlinkage unsigned long
236 +osf_setsysinfo(unsigned long op, void __user *buffer, unsigned long nbytes,
237 + int __user *start, void __user *arg)
238 {
239 switch (op) {
240 case SSI_IEEE_FP_CONTROL: {
241 @@ -872,8 +880,8 @@
242 value->tv_sec = jiffies / HZ;
243 }
244
245 -SYSCALL_DEFINE2(osf_gettimeofday, struct timeval32 __user *, tv,
246 - struct timezone __user *, tz)
247 +asmlinkage int
248 +osf_gettimeofday(struct timeval32 __user *tv, struct timezone __user *tz)
249 {
250 if (tv) {
251 struct timeval ktv;
252 @@ -888,8 +896,8 @@
253 return 0;
254 }
255
256 -SYSCALL_DEFINE2(osf_settimeofday, struct timeval32 __user *, tv,
257 - struct timezone __user *, tz)
258 +asmlinkage int
259 +osf_settimeofday(struct timeval32 __user *tv, struct timezone __user *tz)
260 {
261 struct timespec kts;
262 struct timezone ktz;
263 @@ -908,7 +916,8 @@
264 return do_sys_settimeofday(tv ? &kts : NULL, tz ? &ktz : NULL);
265 }
266
267 -SYSCALL_DEFINE2(osf_getitimer, int, which, struct itimerval32 __user *, it)
268 +asmlinkage int
269 +osf_getitimer(int which, struct itimerval32 __user *it)
270 {
271 struct itimerval kit;
272 int error;
273 @@ -920,8 +929,8 @@
274 return error;
275 }
276
277 -SYSCALL_DEFINE3(osf_setitimer, int, which, struct itimerval32 __user *, in,
278 - struct itimerval32 __user *, out)
279 +asmlinkage int
280 +osf_setitimer(int which, struct itimerval32 __user *in, struct itimerval32 __user *out)
281 {
282 struct itimerval kin, kout;
283 int error;
284 @@ -943,8 +952,8 @@
285
286 }
287
288 -SYSCALL_DEFINE2(osf_utimes, char __user *, filename,
289 - struct timeval32 __user *, tvs)
290 +asmlinkage int
291 +osf_utimes(char __user *filename, struct timeval32 __user *tvs)
292 {
293 struct timespec tv[2];
294
295 @@ -970,8 +979,9 @@
296 #define MAX_SELECT_SECONDS \
297 ((unsigned long) (MAX_SCHEDULE_TIMEOUT / HZ)-1)
298
299 -SYSCALL_DEFINE5(osf_select, int, n, fd_set __user *, inp, fd_set __user *, outp,
300 - fd_set __user *, exp, struct timeval32 __user *, tvp)
301 +asmlinkage int
302 +osf_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp,
303 + struct timeval32 __user *tvp)
304 {
305 struct timespec end_time, *to = NULL;
306 if (tvp) {
307 @@ -1016,7 +1026,8 @@
308 long ru_nivcsw; /* involuntary " */
309 };
310
311 -SYSCALL_DEFINE2(osf_getrusage, int, who, struct rusage32 __user *, ru)
312 +asmlinkage int
313 +osf_getrusage(int who, struct rusage32 __user *ru)
314 {
315 struct rusage32 r;
316
317 @@ -1042,8 +1053,9 @@
318 return copy_to_user(ru, &r, sizeof(r)) ? -EFAULT : 0;
319 }
320
321 -SYSCALL_DEFINE4(osf_wait4, pid_t, pid, int __user *, ustatus, int, options,
322 - struct rusage32 __user *, ur)
323 +asmlinkage long
324 +osf_wait4(pid_t pid, int __user *ustatus, int options,
325 + struct rusage32 __user *ur)
326 {
327 struct rusage r;
328 long ret, err;
329 @@ -1089,8 +1101,8 @@
330 * seems to be a timeval pointer, and I suspect the second
331 * one is the time remaining.. Ho humm.. No documentation.
332 */
333 -SYSCALL_DEFINE2(osf_usleep_thread, struct timeval32 __user *, sleep,
334 - struct timeval32 __user *, remain)
335 +asmlinkage int
336 +osf_usleep_thread(struct timeval32 __user *sleep, struct timeval32 __user *remain)
337 {
338 struct timeval tmp;
339 unsigned long ticks;
340 @@ -1143,7 +1155,8 @@
341 int :32; int :32; int :32; int :32;
342 };
343
344 -SYSCALL_DEFINE1(old_adjtimex, struct timex32 __user *, txc_p)
345 +asmlinkage int
346 +sys_old_adjtimex(struct timex32 __user *txc_p)
347 {
348 struct timex txc;
349 int ret;
350 @@ -1254,8 +1267,8 @@
351 return 0;
352 }
353
354 -SYSCALL_DEFINE3(osf_readv, unsigned long, fd,
355 - const struct iovec __user *, vector, unsigned long, count)
356 +asmlinkage ssize_t
357 +osf_readv(unsigned long fd, const struct iovec __user * vector, unsigned long count)
358 {
359 if (unlikely(personality(current->personality) == PER_OSF4))
360 if (osf_fix_iov_len(vector, count))
361 @@ -1263,8 +1276,8 @@
362 return sys_readv(fd, vector, count);
363 }
364
365 -SYSCALL_DEFINE3(osf_writev, unsigned long, fd,
366 - const struct iovec __user *, vector, unsigned long, count)
367 +asmlinkage ssize_t
368 +osf_writev(unsigned long fd, const struct iovec __user * vector, unsigned long count)
369 {
370 if (unlikely(personality(current->personality) == PER_OSF4))
371 if (osf_fix_iov_len(vector, count))
372 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/alpha/kernel/pci-noop.c linux-2.6.29-rc3.owrt/arch/alpha/kernel/pci-noop.c
373 --- linux-2.6.29.owrt/arch/alpha/kernel/pci-noop.c 2009-05-10 22:04:41.000000000 +0200
374 +++ linux-2.6.29-rc3.owrt/arch/alpha/kernel/pci-noop.c 2009-05-10 23:48:27.000000000 +0200
375 @@ -109,8 +109,7 @@
376 /* Stubs for the routines in pci_iommu.c: */
377
378 void *
379 -__pci_alloc_consistent(struct pci_dev *pdev, size_t size,
380 - dma_addr_t *dma_addrp, gfp_t gfp)
381 +pci_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr_t *dma_addrp)
382 {
383 return NULL;
384 }
385 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/alpha/kernel/process.c linux-2.6.29-rc3.owrt/arch/alpha/kernel/process.c
386 --- linux-2.6.29.owrt/arch/alpha/kernel/process.c 2009-05-10 22:04:41.000000000 +0200
387 +++ linux-2.6.29-rc3.owrt/arch/alpha/kernel/process.c 2009-05-10 23:48:27.000000000 +0200
388 @@ -93,8 +93,8 @@
389 if (cpuid != boot_cpuid) {
390 flags |= 0x00040000UL; /* "remain halted" */
391 *pflags = flags;
392 - set_cpu_present(cpuid, false);
393 - set_cpu_possible(cpuid, false);
394 + cpu_clear(cpuid, cpu_present_map);
395 + cpu_clear(cpuid, cpu_possible_map);
396 halt();
397 }
398 #endif
399 @@ -120,8 +120,8 @@
400
401 #ifdef CONFIG_SMP
402 /* Wait for the secondaries to halt. */
403 - set_cpu_present(boot_cpuid, false);
404 - set_cpu_possible(boot_cpuid, false);
405 + cpu_clear(boot_cpuid, cpu_present_map);
406 + cpu_clear(boot_cpuid, cpu_possible_map);
407 while (cpus_weight(cpu_present_map))
408 barrier();
409 #endif
410 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/alpha/kernel/signal.c linux-2.6.29-rc3.owrt/arch/alpha/kernel/signal.c
411 --- linux-2.6.29.owrt/arch/alpha/kernel/signal.c 2009-05-10 22:04:41.000000000 +0200
412 +++ linux-2.6.29-rc3.owrt/arch/alpha/kernel/signal.c 2009-05-10 23:48:27.000000000 +0200
413 @@ -19,7 +19,6 @@
414 #include <linux/tty.h>
415 #include <linux/binfmts.h>
416 #include <linux/bitops.h>
417 -#include <linux/syscalls.h>
418
419 #include <asm/uaccess.h>
420 #include <asm/sigcontext.h>
421 @@ -52,8 +51,8 @@
422 * Note that we don't need to acquire the kernel lock for SMP
423 * operation, as all of this is local to this thread.
424 */
425 -SYSCALL_DEFINE3(osf_sigprocmask, int, how, unsigned long, newmask,
426 - struct pt_regs *, regs)
427 +asmlinkage unsigned long
428 +do_osf_sigprocmask(int how, unsigned long newmask, struct pt_regs *regs)
429 {
430 unsigned long oldmask = -EINVAL;
431
432 @@ -82,9 +81,9 @@
433 return oldmask;
434 }
435
436 -SYSCALL_DEFINE3(osf_sigaction, int, sig,
437 - const struct osf_sigaction __user *, act,
438 - struct osf_sigaction __user *, oact)
439 +asmlinkage int
440 +osf_sigaction(int sig, const struct osf_sigaction __user *act,
441 + struct osf_sigaction __user *oact)
442 {
443 struct k_sigaction new_ka, old_ka;
444 int ret;
445 @@ -113,9 +112,10 @@
446 return ret;
447 }
448
449 -SYSCALL_DEFINE5(rt_sigaction, int, sig, const struct sigaction __user *, act,
450 - struct sigaction __user *, oact,
451 - size_t, sigsetsize, void __user *, restorer)
452 +asmlinkage long
453 +sys_rt_sigaction(int sig, const struct sigaction __user *act,
454 + struct sigaction __user *oact,
455 + size_t sigsetsize, void __user *restorer)
456 {
457 struct k_sigaction new_ka, old_ka;
458 int ret;
459 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/alpha/kernel/smp.c linux-2.6.29-rc3.owrt/arch/alpha/kernel/smp.c
460 --- linux-2.6.29.owrt/arch/alpha/kernel/smp.c 2009-05-10 22:04:41.000000000 +0200
461 +++ linux-2.6.29-rc3.owrt/arch/alpha/kernel/smp.c 2009-05-10 23:48:27.000000000 +0200
462 @@ -121,11 +121,10 @@
463 {
464 int cpuid = hard_smp_processor_id();
465
466 - if (cpu_online(cpuid)) {
467 + if (cpu_test_and_set(cpuid, cpu_online_map)) {
468 printk("??, cpu 0x%x already present??\n", cpuid);
469 BUG();
470 }
471 - set_cpu_online(cpuid, true);
472
473 /* Turn on machine checks. */
474 wrmces(7);
475 @@ -436,8 +435,8 @@
476 ((char *)cpubase + i*hwrpb->processor_size);
477 if ((cpu->flags & 0x1cc) == 0x1cc) {
478 smp_num_probed++;
479 - set_cpu_possible(i, true);
480 - set_cpu_present(i, true);
481 + cpu_set(i, cpu_possible_map);
482 + cpu_set(i, cpu_present_map);
483 cpu->pal_revision = boot_cpu_palrev;
484 }
485
486 @@ -470,8 +469,8 @@
487
488 /* Nothing to do on a UP box, or when told not to. */
489 if (smp_num_probed == 1 || max_cpus == 0) {
490 - init_cpu_possible(cpumask_of(boot_cpuid));
491 - init_cpu_present(cpumask_of(boot_cpuid));
492 + cpu_possible_map = cpumask_of_cpu(boot_cpuid);
493 + cpu_present_map = cpumask_of_cpu(boot_cpuid);
494 printk(KERN_INFO "SMP mode deactivated.\n");
495 return;
496 }
497 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/alpha/kernel/systbls.S linux-2.6.29-rc3.owrt/arch/alpha/kernel/systbls.S
498 --- linux-2.6.29.owrt/arch/alpha/kernel/systbls.S 2009-05-10 22:04:41.000000000 +0200
499 +++ linux-2.6.29-rc3.owrt/arch/alpha/kernel/systbls.S 2009-05-10 23:48:27.000000000 +0200
500 @@ -17,7 +17,7 @@
501 .quad sys_write
502 .quad alpha_ni_syscall /* 5 */
503 .quad sys_close
504 - .quad sys_osf_wait4
505 + .quad osf_wait4
506 .quad alpha_ni_syscall
507 .quad sys_link
508 .quad sys_unlink /* 10 */
509 @@ -27,11 +27,11 @@
510 .quad sys_mknod
511 .quad sys_chmod /* 15 */
512 .quad sys_chown
513 - .quad sys_osf_brk
514 + .quad osf_brk
515 .quad alpha_ni_syscall
516 .quad sys_lseek
517 .quad sys_getxpid /* 20 */
518 - .quad sys_osf_mount
519 + .quad osf_mount
520 .quad sys_umount
521 .quad sys_setuid
522 .quad sys_getxuid
523 @@ -53,7 +53,7 @@
524 .quad alpha_ni_syscall /* 40 */
525 .quad sys_dup
526 .quad sys_alpha_pipe
527 - .quad sys_osf_set_program_attributes
528 + .quad osf_set_program_attributes
529 .quad alpha_ni_syscall
530 .quad sys_open /* 45 */
531 .quad alpha_ni_syscall
532 @@ -81,7 +81,7 @@
533 .quad sys_newlstat
534 .quad alpha_ni_syscall
535 .quad alpha_ni_syscall /* 70 */
536 - .quad sys_osf_mmap
537 + .quad osf_mmap
538 .quad alpha_ni_syscall
539 .quad sys_munmap
540 .quad sys_mprotect
541 @@ -94,17 +94,17 @@
542 .quad sys_setgroups /* 80 */
543 .quad alpha_ni_syscall
544 .quad sys_setpgid
545 - .quad sys_osf_setitimer
546 + .quad osf_setitimer
547 .quad alpha_ni_syscall
548 .quad alpha_ni_syscall /* 85 */
549 - .quad sys_osf_getitimer
550 + .quad osf_getitimer
551 .quad sys_gethostname
552 .quad sys_sethostname
553 .quad sys_getdtablesize
554 .quad sys_dup2 /* 90 */
555 .quad sys_newfstat
556 .quad sys_fcntl
557 - .quad sys_osf_select
558 + .quad osf_select
559 .quad sys_poll
560 .quad sys_fsync /* 95 */
561 .quad sys_setpriority
562 @@ -123,22 +123,22 @@
563 .quad alpha_ni_syscall
564 .quad alpha_ni_syscall /* 110 */
565 .quad sys_sigsuspend
566 - .quad sys_osf_sigstack
567 + .quad osf_sigstack
568 .quad sys_recvmsg
569 .quad sys_sendmsg
570 .quad alpha_ni_syscall /* 115 */
571 - .quad sys_osf_gettimeofday
572 - .quad sys_osf_getrusage
573 + .quad osf_gettimeofday
574 + .quad osf_getrusage
575 .quad sys_getsockopt
576 .quad alpha_ni_syscall
577 #ifdef CONFIG_OSF4_COMPAT
578 - .quad sys_osf_readv /* 120 */
579 - .quad sys_osf_writev
580 + .quad osf_readv /* 120 */
581 + .quad osf_writev
582 #else
583 .quad sys_readv /* 120 */
584 .quad sys_writev
585 #endif
586 - .quad sys_osf_settimeofday
587 + .quad osf_settimeofday
588 .quad sys_fchown
589 .quad sys_fchmod
590 .quad sys_recvfrom /* 125 */
591 @@ -154,7 +154,7 @@
592 .quad sys_socketpair /* 135 */
593 .quad sys_mkdir
594 .quad sys_rmdir
595 - .quad sys_osf_utimes
596 + .quad osf_utimes
597 .quad alpha_ni_syscall
598 .quad alpha_ni_syscall /* 140 */
599 .quad sys_getpeername
600 @@ -172,16 +172,16 @@
601 .quad alpha_ni_syscall
602 .quad alpha_ni_syscall
603 .quad alpha_ni_syscall /* 155 */
604 - .quad sys_osf_sigaction
605 + .quad osf_sigaction
606 .quad alpha_ni_syscall
607 .quad alpha_ni_syscall
608 - .quad sys_osf_getdirentries
609 - .quad sys_osf_statfs /* 160 */
610 - .quad sys_osf_fstatfs
611 + .quad osf_getdirentries
612 + .quad osf_statfs /* 160 */
613 + .quad osf_fstatfs
614 .quad alpha_ni_syscall
615 .quad alpha_ni_syscall
616 .quad alpha_ni_syscall
617 - .quad sys_osf_getdomainname /* 165 */
618 + .quad osf_getdomainname /* 165 */
619 .quad sys_setdomainname
620 .quad alpha_ni_syscall
621 .quad alpha_ni_syscall
622 @@ -224,7 +224,7 @@
623 .quad sys_semctl
624 .quad sys_semget /* 205 */
625 .quad sys_semop
626 - .quad sys_osf_utsname
627 + .quad osf_utsname
628 .quad sys_lchown
629 .quad sys_shmat
630 .quad sys_shmctl /* 210 */
631 @@ -258,23 +258,23 @@
632 .quad alpha_ni_syscall
633 .quad alpha_ni_syscall
634 .quad alpha_ni_syscall /* 240 */
635 - .quad sys_osf_sysinfo
636 + .quad osf_sysinfo
637 .quad alpha_ni_syscall
638 .quad alpha_ni_syscall
639 - .quad sys_osf_proplist_syscall
640 + .quad osf_proplist_syscall
641 .quad alpha_ni_syscall /* 245 */
642 .quad alpha_ni_syscall
643 .quad alpha_ni_syscall
644 .quad alpha_ni_syscall
645 .quad alpha_ni_syscall
646 .quad alpha_ni_syscall /* 250 */
647 - .quad sys_osf_usleep_thread
648 + .quad osf_usleep_thread
649 .quad alpha_ni_syscall
650 .quad alpha_ni_syscall
651 .quad sys_sysfs
652 .quad alpha_ni_syscall /* 255 */
653 - .quad sys_osf_getsysinfo
654 - .quad sys_osf_setsysinfo
655 + .quad osf_getsysinfo
656 + .quad osf_setsysinfo
657 .quad alpha_ni_syscall
658 .quad alpha_ni_syscall
659 .quad alpha_ni_syscall /* 260 */
660 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/kernel/elf.c linux-2.6.29-rc3.owrt/arch/arm/kernel/elf.c
661 --- linux-2.6.29.owrt/arch/arm/kernel/elf.c 2009-05-10 22:04:41.000000000 +0200
662 +++ linux-2.6.29-rc3.owrt/arch/arm/kernel/elf.c 2009-05-10 23:48:27.000000000 +0200
663 @@ -74,9 +74,9 @@
664 */
665 int arm_elf_read_implies_exec(const struct elf32_hdr *x, int executable_stack)
666 {
667 - if (executable_stack != EXSTACK_DISABLE_X)
668 + if (executable_stack != EXSTACK_ENABLE_X)
669 return 1;
670 - if (cpu_architecture() < CPU_ARCH_ARMv6)
671 + if (cpu_architecture() <= CPU_ARCH_ARMv6)
672 return 1;
673 return 0;
674 }
675 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/kernel/entry-armv.S linux-2.6.29-rc3.owrt/arch/arm/kernel/entry-armv.S
676 --- linux-2.6.29.owrt/arch/arm/kernel/entry-armv.S 2009-05-10 22:04:41.000000000 +0200
677 +++ linux-2.6.29-rc3.owrt/arch/arm/kernel/entry-armv.S 2009-05-10 23:48:27.000000000 +0200
678 @@ -650,7 +650,6 @@
679 no_fp: mov pc, lr
680
681 __und_usr_unknown:
682 - enable_irq
683 mov r0, sp
684 adr lr, ret_from_exception
685 b do_undefinstr
686 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/kernel/entry-common.S linux-2.6.29-rc3.owrt/arch/arm/kernel/entry-common.S
687 --- linux-2.6.29.owrt/arch/arm/kernel/entry-common.S 2009-05-10 22:04:41.000000000 +0200
688 +++ linux-2.6.29-rc3.owrt/arch/arm/kernel/entry-common.S 2009-05-10 23:48:27.000000000 +0200
689 @@ -111,7 +111,6 @@
690 .globl mcount_call
691 mcount_call:
692 bl ftrace_stub
693 - ldr lr, [fp, #-4] @ restore lr
694 ldmia sp!, {r0-r3, pc}
695
696 ENTRY(ftrace_caller)
697 @@ -123,7 +122,6 @@
698 .globl ftrace_call
699 ftrace_call:
700 bl ftrace_stub
701 - ldr lr, [fp, #-4] @ restore lr
702 ldmia sp!, {r0-r3, pc}
703
704 #else
705 @@ -135,16 +133,14 @@
706 adr r0, ftrace_stub
707 cmp r0, r2
708 bne trace
709 - ldr lr, [fp, #-4] @ restore lr
710 ldmia sp!, {r0-r3, pc}
711
712 trace:
713 - ldr r1, [fp, #-4] @ lr of instrumented routine
714 + ldr r1, [fp, #-4]
715 mov r0, lr
716 sub r0, r0, #MCOUNT_INSN_SIZE
717 mov lr, pc
718 mov pc, r2
719 - mov lr, r1 @ restore lr
720 ldmia sp!, {r0-r3, pc}
721
722 #endif /* CONFIG_DYNAMIC_FTRACE */
723 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/kernel/fiq.c linux-2.6.29-rc3.owrt/arch/arm/kernel/fiq.c
724 --- linux-2.6.29.owrt/arch/arm/kernel/fiq.c 2009-05-10 22:04:41.000000000 +0200
725 +++ linux-2.6.29-rc3.owrt/arch/arm/kernel/fiq.c 2009-05-10 23:48:27.000000000 +0200
726 @@ -88,7 +88,7 @@
727 * disable irqs for the duration. Note - these functions are almost
728 * entirely coded in assembly.
729 */
730 -void __naked set_fiq_regs(struct pt_regs *regs)
731 +void __attribute__((naked)) set_fiq_regs(struct pt_regs *regs)
732 {
733 register unsigned long tmp;
734 asm volatile (
735 @@ -106,7 +106,7 @@
736 : "r" (&regs->ARM_r8), "I" (PSR_I_BIT | PSR_F_BIT | FIQ_MODE));
737 }
738
739 -void __naked get_fiq_regs(struct pt_regs *regs)
740 +void __attribute__((naked)) get_fiq_regs(struct pt_regs *regs)
741 {
742 register unsigned long tmp;
743 asm volatile (
744 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/kernel/irq.c linux-2.6.29-rc3.owrt/arch/arm/kernel/irq.c
745 --- linux-2.6.29.owrt/arch/arm/kernel/irq.c 2009-05-10 22:04:41.000000000 +0200
746 +++ linux-2.6.29-rc3.owrt/arch/arm/kernel/irq.c 2009-05-10 23:48:27.000000000 +0200
747 @@ -101,7 +101,7 @@
748 /* Handle bad interrupts */
749 static struct irq_desc bad_irq_desc = {
750 .handle_irq = handle_bad_irq,
751 - .lock = __SPIN_LOCK_UNLOCKED(bad_irq_desc.lock),
752 + .lock = SPIN_LOCK_UNLOCKED
753 };
754
755 /*
756 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/kernel/machine_kexec.c linux-2.6.29-rc3.owrt/arch/arm/kernel/machine_kexec.c
757 --- linux-2.6.29.owrt/arch/arm/kernel/machine_kexec.c 2009-05-10 22:04:41.000000000 +0200
758 +++ linux-2.6.29-rc3.owrt/arch/arm/kernel/machine_kexec.c 2009-05-10 23:48:27.000000000 +0200
759 @@ -13,8 +13,8 @@
760 #include <asm/cacheflush.h>
761 #include <asm/mach-types.h>
762
763 -extern const unsigned char relocate_new_kernel[];
764 -extern const unsigned int relocate_new_kernel_size;
765 +const extern unsigned char relocate_new_kernel[];
766 +const extern unsigned int relocate_new_kernel_size;
767
768 extern void setup_mm_for_reboot(char mode);
769
770 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/kernel/setup.c linux-2.6.29-rc3.owrt/arch/arm/kernel/setup.c
771 --- linux-2.6.29.owrt/arch/arm/kernel/setup.c 2009-05-10 22:04:41.000000000 +0200
772 +++ linux-2.6.29-rc3.owrt/arch/arm/kernel/setup.c 2009-05-10 23:48:27.000000000 +0200
773 @@ -233,13 +233,12 @@
774 unsigned int cachetype = read_cpuid_cachetype();
775 unsigned int arch = cpu_architecture();
776
777 - if (arch >= CPU_ARCH_ARMv6) {
778 - if ((cachetype & (7 << 29)) == 4 << 29) {
779 - /* ARMv7 register format */
780 - cacheid = CACHEID_VIPT_NONALIASING;
781 - if ((cachetype & (3 << 14)) == 1 << 14)
782 - cacheid |= CACHEID_ASID_TAGGED;
783 - } else if (cachetype & (1 << 23))
784 + if (arch >= CPU_ARCH_ARMv7) {
785 + cacheid = CACHEID_VIPT_NONALIASING;
786 + if ((cachetype & (3 << 14)) == 1 << 14)
787 + cacheid |= CACHEID_ASID_TAGGED;
788 + } else if (arch >= CPU_ARCH_ARMv6) {
789 + if (cachetype & (1 << 23))
790 cacheid = CACHEID_VIPT_ALIASING;
791 else
792 cacheid = CACHEID_VIPT_NONALIASING;
793 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-at91/at91cap9_devices.c linux-2.6.29-rc3.owrt/arch/arm/mach-at91/at91cap9_devices.c
794 --- linux-2.6.29.owrt/arch/arm/mach-at91/at91cap9_devices.c 2009-05-10 22:04:41.000000000 +0200
795 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-at91/at91cap9_devices.c 2009-05-10 23:48:27.000000000 +0200
796 @@ -697,7 +697,7 @@
797 * Watchdog
798 * -------------------------------------------------------------------- */
799
800 -#if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE)
801 +#if defined(CONFIG_AT91SAM9_WATCHDOG) || defined(CONFIG_AT91SAM9_WATCHDOG_MODULE)
802 static struct platform_device at91cap9_wdt_device = {
803 .name = "at91_wdt",
804 .id = -1,
805 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-at91/at91sam9260_devices.c linux-2.6.29-rc3.owrt/arch/arm/mach-at91/at91sam9260_devices.c
806 --- linux-2.6.29.owrt/arch/arm/mach-at91/at91sam9260_devices.c 2009-05-10 22:04:41.000000000 +0200
807 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-at91/at91sam9260_devices.c 2009-05-10 23:48:27.000000000 +0200
808 @@ -643,7 +643,7 @@
809 * Watchdog
810 * -------------------------------------------------------------------- */
811
812 -#if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE)
813 +#if defined(CONFIG_AT91SAM9_WATCHDOG) || defined(CONFIG_AT91SAM9_WATCHDOG_MODULE)
814 static struct platform_device at91sam9260_wdt_device = {
815 .name = "at91_wdt",
816 .id = -1,
817 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-at91/at91sam9261_devices.c linux-2.6.29-rc3.owrt/arch/arm/mach-at91/at91sam9261_devices.c
818 --- linux-2.6.29.owrt/arch/arm/mach-at91/at91sam9261_devices.c 2009-05-10 22:04:41.000000000 +0200
819 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-at91/at91sam9261_devices.c 2009-05-10 23:48:27.000000000 +0200
820 @@ -621,7 +621,7 @@
821 * Watchdog
822 * -------------------------------------------------------------------- */
823
824 -#if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE)
825 +#if defined(CONFIG_AT91SAM9_WATCHDOG) || defined(CONFIG_AT91SAM9_WATCHDOG_MODULE)
826 static struct platform_device at91sam9261_wdt_device = {
827 .name = "at91_wdt",
828 .id = -1,
829 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-at91/at91sam9263_devices.c linux-2.6.29-rc3.owrt/arch/arm/mach-at91/at91sam9263_devices.c
830 --- linux-2.6.29.owrt/arch/arm/mach-at91/at91sam9263_devices.c 2009-05-10 22:04:41.000000000 +0200
831 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-at91/at91sam9263_devices.c 2009-05-10 23:48:27.000000000 +0200
832 @@ -347,111 +347,6 @@
833 void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {}
834 #endif
835
836 -/* --------------------------------------------------------------------
837 - * Compact Flash (PCMCIA or IDE)
838 - * -------------------------------------------------------------------- */
839 -
840 -#if defined(CONFIG_AT91_CF) || defined(CONFIG_AT91_CF_MODULE) || \
841 - defined(CONFIG_BLK_DEV_IDE_AT91) || defined(CONFIG_BLK_DEV_IDE_AT91_MODULE)
842 -
843 -static struct at91_cf_data cf0_data;
844 -
845 -static struct resource cf0_resources[] = {
846 - [0] = {
847 - .start = AT91_CHIPSELECT_4,
848 - .end = AT91_CHIPSELECT_4 + SZ_256M - 1,
849 - .flags = IORESOURCE_MEM | IORESOURCE_MEM_8AND16BIT,
850 - }
851 -};
852 -
853 -static struct platform_device cf0_device = {
854 - .id = 0,
855 - .dev = {
856 - .platform_data = &cf0_data,
857 - },
858 - .resource = cf0_resources,
859 - .num_resources = ARRAY_SIZE(cf0_resources),
860 -};
861 -
862 -static struct at91_cf_data cf1_data;
863 -
864 -static struct resource cf1_resources[] = {
865 - [0] = {
866 - .start = AT91_CHIPSELECT_5,
867 - .end = AT91_CHIPSELECT_5 + SZ_256M - 1,
868 - .flags = IORESOURCE_MEM | IORESOURCE_MEM_8AND16BIT,
869 - }
870 -};
871 -
872 -static struct platform_device cf1_device = {
873 - .id = 1,
874 - .dev = {
875 - .platform_data = &cf1_data,
876 - },
877 - .resource = cf1_resources,
878 - .num_resources = ARRAY_SIZE(cf1_resources),
879 -};
880 -
881 -void __init at91_add_device_cf(struct at91_cf_data *data)
882 -{
883 - unsigned long ebi0_csa;
884 - struct platform_device *pdev;
885 -
886 - if (!data)
887 - return;
888 -
889 - /*
890 - * assign CS4 or CS5 to SMC with Compact Flash logic support,
891 - * we assume SMC timings are configured by board code,
892 - * except True IDE where timings are controlled by driver
893 - */
894 - ebi0_csa = at91_sys_read(AT91_MATRIX_EBI0CSA);
895 - switch (data->chipselect) {
896 - case 4:
897 - at91_set_A_periph(AT91_PIN_PD6, 0); /* EBI0_NCS4/CFCS0 */
898 - ebi0_csa |= AT91_MATRIX_EBI0_CS4A_SMC_CF1;
899 - cf0_data = *data;
900 - pdev = &cf0_device;
901 - break;
902 - case 5:
903 - at91_set_A_periph(AT91_PIN_PD7, 0); /* EBI0_NCS5/CFCS1 */
904 - ebi0_csa |= AT91_MATRIX_EBI0_CS5A_SMC_CF2;
905 - cf1_data = *data;
906 - pdev = &cf1_device;
907 - break;
908 - default:
909 - printk(KERN_ERR "AT91 CF: bad chip-select requested (%u)\n",
910 - data->chipselect);
911 - return;
912 - }
913 - at91_sys_write(AT91_MATRIX_EBI0CSA, ebi0_csa);
914 -
915 - if (data->det_pin) {
916 - at91_set_gpio_input(data->det_pin, 1);
917 - at91_set_deglitch(data->det_pin, 1);
918 - }
919 -
920 - if (data->irq_pin) {
921 - at91_set_gpio_input(data->irq_pin, 1);
922 - at91_set_deglitch(data->irq_pin, 1);
923 - }
924 -
925 - if (data->vcc_pin)
926 - /* initially off */
927 - at91_set_gpio_output(data->vcc_pin, 0);
928 -
929 - /* enable EBI controlled pins */
930 - at91_set_A_periph(AT91_PIN_PD5, 1); /* NWAIT */
931 - at91_set_A_periph(AT91_PIN_PD8, 0); /* CFCE1 */
932 - at91_set_A_periph(AT91_PIN_PD9, 0); /* CFCE2 */
933 - at91_set_A_periph(AT91_PIN_PD14, 0); /* CFNRW */
934 -
935 - pdev->name = (data->flags & AT91_CF_TRUE_IDE) ? "at91_ide" : "at91_cf";
936 - platform_device_register(pdev);
937 -}
938 -#else
939 -void __init at91_add_device_cf(struct at91_cf_data *data) {}
940 -#endif
941
942 /* --------------------------------------------------------------------
943 * NAND / SmartMedia
944 @@ -959,7 +854,7 @@
945 * Watchdog
946 * -------------------------------------------------------------------- */
947
948 -#if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE)
949 +#if defined(CONFIG_AT91SAM9_WATCHDOG) || defined(CONFIG_AT91SAM9_WATCHDOG_MODULE)
950 static struct platform_device at91sam9263_wdt_device = {
951 .name = "at91_wdt",
952 .id = -1,
953 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-at91/at91sam9rl_devices.c linux-2.6.29-rc3.owrt/arch/arm/mach-at91/at91sam9rl_devices.c
954 --- linux-2.6.29.owrt/arch/arm/mach-at91/at91sam9rl_devices.c 2009-05-10 22:04:41.000000000 +0200
955 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-at91/at91sam9rl_devices.c 2009-05-10 23:48:27.000000000 +0200
956 @@ -609,7 +609,7 @@
957 * Watchdog
958 * -------------------------------------------------------------------- */
959
960 -#if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE)
961 +#if defined(CONFIG_AT91SAM9_WATCHDOG) || defined(CONFIG_AT91SAM9_WATCHDOG_MODULE)
962 static struct platform_device at91sam9rl_wdt_device = {
963 .name = "at91_wdt",
964 .id = -1,
965 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-at91/gpio.c linux-2.6.29-rc3.owrt/arch/arm/mach-at91/gpio.c
966 --- linux-2.6.29.owrt/arch/arm/mach-at91/gpio.c 2009-05-10 22:04:41.000000000 +0200
967 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-at91/gpio.c 2009-05-10 23:48:27.000000000 +0200
968 @@ -490,8 +490,7 @@
969
970 /*--------------------------------------------------------------------------*/
971
972 -/*
973 - * This lock class tells lockdep that GPIO irqs are in a different
974 +/* This lock class tells lockdep that GPIO irqs are in a different
975 * category than their parents, so it won't report false recursion.
976 */
977 static struct lock_class_key gpio_lock_class;
978 @@ -510,6 +509,9 @@
979 unsigned id = this->id;
980 unsigned i;
981
982 + /* enable PIO controller's clock */
983 + clk_enable(this->clock);
984 +
985 __raw_writel(~0, this->regbase + PIO_IDR);
986
987 for (i = 0, pin = this->chipbase; i < 32; i++, pin++) {
988 @@ -554,14 +556,7 @@
989 data->chipbase = PIN_BASE + i * 32;
990 data->regbase = data->offset + (void __iomem *)AT91_VA_BASE_SYS;
991
992 - /* enable PIO controller's clock */
993 - clk_enable(data->clock);
994 -
995 - /*
996 - * Some processors share peripheral ID between multiple GPIO banks.
997 - * SAM9263 (PIOC, PIOD, PIOE)
998 - * CAP9 (PIOA, PIOB, PIOC, PIOD)
999 - */
1000 + /* AT91SAM9263_ID_PIOCDE groups PIOC, PIOD, PIOE */
1001 if (last && last->id == data->id)
1002 last->next = data;
1003 }
1004 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-at91/include/mach/board.h linux-2.6.29-rc3.owrt/arch/arm/mach-at91/include/mach/board.h
1005 --- linux-2.6.29.owrt/arch/arm/mach-at91/include/mach/board.h 2009-05-10 22:04:41.000000000 +0200
1006 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-at91/include/mach/board.h 2009-05-10 23:48:27.000000000 +0200
1007 @@ -56,9 +56,6 @@
1008 u8 vcc_pin; /* power switching */
1009 u8 rst_pin; /* card reset */
1010 u8 chipselect; /* EBI Chip Select number */
1011 - u8 flags;
1012 -#define AT91_CF_TRUE_IDE 0x01
1013 -#define AT91_IDE_SWAP_A0_A2 0x02
1014 };
1015 extern void __init at91_add_device_cf(struct at91_cf_data *data);
1016
1017 @@ -96,7 +93,6 @@
1018 u8 enable_pin; /* chip enable */
1019 u8 det_pin; /* card detect */
1020 u8 rdy_pin; /* ready/busy */
1021 - u8 rdy_pin_active_low; /* rdy_pin value is inverted */
1022 u8 ale; /* address line number connected to ALE */
1023 u8 cle; /* address line number connected to CLE */
1024 u8 bus_width_16; /* buswidth is 16 bit */
1025 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-at91/pm.c linux-2.6.29-rc3.owrt/arch/arm/mach-at91/pm.c
1026 --- linux-2.6.29.owrt/arch/arm/mach-at91/pm.c 2009-05-10 22:04:41.000000000 +0200
1027 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-at91/pm.c 2009-05-10 23:48:27.000000000 +0200
1028 @@ -332,6 +332,7 @@
1029 at91_sys_read(AT91_AIC_IPR) & at91_sys_read(AT91_AIC_IMR));
1030
1031 error:
1032 + sdram_selfrefresh_disable();
1033 target_state = PM_SUSPEND_ON;
1034 at91_irq_resume();
1035 at91_gpio_resume();
1036 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-davinci/board-evm.c linux-2.6.29-rc3.owrt/arch/arm/mach-davinci/board-evm.c
1037 --- linux-2.6.29.owrt/arch/arm/mach-davinci/board-evm.c 2009-05-10 22:04:41.000000000 +0200
1038 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-davinci/board-evm.c 2009-05-10 23:48:27.000000000 +0200
1039 @@ -311,9 +311,6 @@
1040 gpio_request(gpio + 7, "nCF_SEL");
1041 gpio_direction_output(gpio + 7, 1);
1042
1043 - /* irlml6401 sustains over 3A, switches 5V in under 8 msec */
1044 - setup_usb(500, 8);
1045 -
1046 return 0;
1047 }
1048
1049 @@ -420,6 +417,9 @@
1050 platform_add_devices(davinci_evm_devices,
1051 ARRAY_SIZE(davinci_evm_devices));
1052 evm_init_i2c();
1053 +
1054 + /* irlml6401 sustains over 3A, switches 5V in under 8 msec */
1055 + setup_usb(500, 8);
1056 }
1057
1058 static __init void davinci_evm_irq_init(void)
1059 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-davinci/clock.c linux-2.6.29-rc3.owrt/arch/arm/mach-davinci/clock.c
1060 --- linux-2.6.29.owrt/arch/arm/mach-davinci/clock.c 2009-05-10 22:04:41.000000000 +0200
1061 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-davinci/clock.c 2009-05-10 23:48:27.000000000 +0200
1062 @@ -231,11 +231,6 @@
1063 .lpsc = DAVINCI_LPSC_GPIO,
1064 },
1065 {
1066 - .name = "usb",
1067 - .rate = &commonrate,
1068 - .lpsc = DAVINCI_LPSC_USB,
1069 - },
1070 - {
1071 .name = "AEMIFCLK",
1072 .rate = &commonrate,
1073 .lpsc = DAVINCI_LPSC_AEMIF,
1074 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-davinci/usb.c linux-2.6.29-rc3.owrt/arch/arm/mach-davinci/usb.c
1075 --- linux-2.6.29.owrt/arch/arm/mach-davinci/usb.c 2009-05-10 22:04:41.000000000 +0200
1076 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-davinci/usb.c 2009-05-10 23:48:27.000000000 +0200
1077 @@ -47,7 +47,6 @@
1078 #elif defined(CONFIG_USB_MUSB_HOST)
1079 .mode = MUSB_HOST,
1080 #endif
1081 - .clock = "usb",
1082 .config = &musb_config,
1083 };
1084
1085 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-ep93xx/include/mach/gesbc9312.h linux-2.6.29-rc3.owrt/arch/arm/mach-ep93xx/include/mach/gesbc9312.h
1086 --- linux-2.6.29.owrt/arch/arm/mach-ep93xx/include/mach/gesbc9312.h 1970-01-01 01:00:00.000000000 +0100
1087 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-ep93xx/include/mach/gesbc9312.h 2009-05-10 23:48:27.000000000 +0200
1088 @@ -0,0 +1,3 @@
1089 +/*
1090 + * arch/arm/mach-ep93xx/include/mach/gesbc9312.h
1091 + */
1092 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-ep93xx/include/mach/hardware.h linux-2.6.29-rc3.owrt/arch/arm/mach-ep93xx/include/mach/hardware.h
1093 --- linux-2.6.29.owrt/arch/arm/mach-ep93xx/include/mach/hardware.h 2009-05-10 22:04:41.000000000 +0200
1094 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-ep93xx/include/mach/hardware.h 2009-05-10 23:48:27.000000000 +0200
1095 @@ -10,6 +10,7 @@
1096
1097 #include "platform.h"
1098
1099 +#include "gesbc9312.h"
1100 #include "ts72xx.h"
1101
1102 #endif
1103 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-ep93xx/include/mach/platform.h linux-2.6.29-rc3.owrt/arch/arm/mach-ep93xx/include/mach/platform.h
1104 --- linux-2.6.29.owrt/arch/arm/mach-ep93xx/include/mach/platform.h 2009-05-10 22:04:41.000000000 +0200
1105 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-ep93xx/include/mach/platform.h 2009-05-10 23:48:27.000000000 +0200
1106 @@ -4,8 +4,6 @@
1107
1108 #ifndef __ASSEMBLY__
1109
1110 -struct i2c_board_info;
1111 -
1112 struct ep93xx_eth_data
1113 {
1114 unsigned char dev_addr[6];
1115 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-kirkwood/irq.c linux-2.6.29-rc3.owrt/arch/arm/mach-kirkwood/irq.c
1116 --- linux-2.6.29.owrt/arch/arm/mach-kirkwood/irq.c 2009-05-10 22:04:41.000000000 +0200
1117 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-kirkwood/irq.c 2009-05-10 23:48:27.000000000 +0200
1118 @@ -42,7 +42,7 @@
1119 writel(0, GPIO_EDGE_CAUSE(32));
1120
1121 for (i = IRQ_KIRKWOOD_GPIO_START; i < NR_IRQS; i++) {
1122 - set_irq_chip(i, &orion_gpio_irq_chip);
1123 + set_irq_chip(i, &orion_gpio_irq_level_chip);
1124 set_irq_handler(i, handle_level_irq);
1125 irq_desc[i].status |= IRQ_LEVEL;
1126 set_irq_flags(i, IRQF_VALID);
1127 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-msm/board-halibut.c linux-2.6.29-rc3.owrt/arch/arm/mach-msm/board-halibut.c
1128 --- linux-2.6.29.owrt/arch/arm/mach-msm/board-halibut.c 2009-05-10 22:04:41.000000000 +0200
1129 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-msm/board-halibut.c 2009-05-10 23:48:27.000000000 +0200
1130 @@ -27,7 +27,6 @@
1131 #include <asm/mach/map.h>
1132 #include <asm/mach/flash.h>
1133
1134 -#include <mach/irqs.h>
1135 #include <mach/board.h>
1136 #include <mach/msm_iomap.h>
1137
1138 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-mv78xx0/irq.c linux-2.6.29-rc3.owrt/arch/arm/mach-mv78xx0/irq.c
1139 --- linux-2.6.29.owrt/arch/arm/mach-mv78xx0/irq.c 2009-05-10 22:04:41.000000000 +0200
1140 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-mv78xx0/irq.c 2009-05-10 23:48:27.000000000 +0200
1141 @@ -40,7 +40,7 @@
1142 writel(0, GPIO_EDGE_CAUSE(0));
1143
1144 for (i = IRQ_MV78XX0_GPIO_START; i < NR_IRQS; i++) {
1145 - set_irq_chip(i, &orion_gpio_irq_chip);
1146 + set_irq_chip(i, &orion_gpio_irq_level_chip);
1147 set_irq_handler(i, handle_level_irq);
1148 irq_desc[i].status |= IRQ_LEVEL;
1149 set_irq_flags(i, IRQF_VALID);
1150 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-mx1/devices.c linux-2.6.29-rc3.owrt/arch/arm/mach-mx1/devices.c
1151 --- linux-2.6.29.owrt/arch/arm/mach-mx1/devices.c 2009-05-10 22:04:41.000000000 +0200
1152 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-mx1/devices.c 2009-05-10 23:48:27.000000000 +0200
1153 @@ -23,8 +23,6 @@
1154 #include <linux/init.h>
1155 #include <linux/platform_device.h>
1156 #include <linux/gpio.h>
1157 -
1158 -#include <mach/irqs.h>
1159 #include <mach/hardware.h>
1160
1161 static struct resource imx_csi_resources[] = {
1162 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-mx1/mx1ads.c linux-2.6.29-rc3.owrt/arch/arm/mach-mx1/mx1ads.c
1163 --- linux-2.6.29.owrt/arch/arm/mach-mx1/mx1ads.c 2009-05-10 22:04:41.000000000 +0200
1164 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-mx1/mx1ads.c 2009-05-10 23:48:27.000000000 +0200
1165 @@ -21,7 +21,6 @@
1166 #include <asm/mach/arch.h>
1167 #include <asm/mach/time.h>
1168
1169 -#include <mach/irqs.h>
1170 #include <mach/hardware.h>
1171 #include <mach/common.h>
1172 #include <mach/imx-uart.h>
1173 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-omap1/devices.c linux-2.6.29-rc3.owrt/arch/arm/mach-omap1/devices.c
1174 --- linux-2.6.29.owrt/arch/arm/mach-omap1/devices.c 2009-05-10 22:04:41.000000000 +0200
1175 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-omap1/devices.c 2009-05-10 23:48:27.000000000 +0200
1176 @@ -181,7 +181,7 @@
1177 }
1178 size = OMAP1_MMC_SIZE;
1179
1180 - omap_mmc_add("mmci-omap", i, base, size, irq, mmc_data[i]);
1181 + omap_mmc_add(i, base, size, irq, mmc_data[i]);
1182 };
1183 }
1184
1185 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-omap1/mcbsp.c linux-2.6.29-rc3.owrt/arch/arm/mach-omap1/mcbsp.c
1186 --- linux-2.6.29.owrt/arch/arm/mach-omap1/mcbsp.c 2009-05-10 22:04:41.000000000 +0200
1187 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-omap1/mcbsp.c 2009-05-10 23:48:27.000000000 +0200
1188 @@ -28,8 +28,81 @@
1189 #define DPS_RSTCT2_PER_EN (1 << 0)
1190 #define DSP_RSTCT2_WD_PER_EN (1 << 1)
1191
1192 +struct mcbsp_internal_clk {
1193 + struct clk clk;
1194 + struct clk **childs;
1195 + int n_childs;
1196 +};
1197 +
1198 #if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX)
1199 -const char *clk_names[] = { "dsp_ck", "api_ck", "dspxor_ck" };
1200 +static void omap_mcbsp_clk_init(struct mcbsp_internal_clk *mclk)
1201 +{
1202 + const char *clk_names[] = { "dsp_ck", "api_ck", "dspxor_ck" };
1203 + int i;
1204 +
1205 + mclk->n_childs = ARRAY_SIZE(clk_names);
1206 + mclk->childs = kzalloc(mclk->n_childs * sizeof(struct clk *),
1207 + GFP_KERNEL);
1208 +
1209 + for (i = 0; i < mclk->n_childs; i++) {
1210 + /* We fake a platform device to get correct device id */
1211 + struct platform_device pdev;
1212 +
1213 + pdev.dev.bus = &platform_bus_type;
1214 + pdev.id = mclk->clk.id;
1215 + mclk->childs[i] = clk_get(&pdev.dev, clk_names[i]);
1216 + if (IS_ERR(mclk->childs[i]))
1217 + printk(KERN_ERR "Could not get clock %s (%d).\n",
1218 + clk_names[i], mclk->clk.id);
1219 + }
1220 +}
1221 +
1222 +static int omap_mcbsp_clk_enable(struct clk *clk)
1223 +{
1224 + struct mcbsp_internal_clk *mclk = container_of(clk,
1225 + struct mcbsp_internal_clk, clk);
1226 + int i;
1227 +
1228 + for (i = 0; i < mclk->n_childs; i++)
1229 + clk_enable(mclk->childs[i]);
1230 + return 0;
1231 +}
1232 +
1233 +static void omap_mcbsp_clk_disable(struct clk *clk)
1234 +{
1235 + struct mcbsp_internal_clk *mclk = container_of(clk,
1236 + struct mcbsp_internal_clk, clk);
1237 + int i;
1238 +
1239 + for (i = 0; i < mclk->n_childs; i++)
1240 + clk_disable(mclk->childs[i]);
1241 +}
1242 +
1243 +static struct mcbsp_internal_clk omap_mcbsp_clks[] = {
1244 + {
1245 + .clk = {
1246 + .name = "mcbsp_clk",
1247 + .id = 1,
1248 + .enable = omap_mcbsp_clk_enable,
1249 + .disable = omap_mcbsp_clk_disable,
1250 + },
1251 + },
1252 + {
1253 + .clk = {
1254 + .name = "mcbsp_clk",
1255 + .id = 3,
1256 + .enable = omap_mcbsp_clk_enable,
1257 + .disable = omap_mcbsp_clk_disable,
1258 + },
1259 + },
1260 +};
1261 +
1262 +#define omap_mcbsp_clks_size ARRAY_SIZE(omap_mcbsp_clks)
1263 +#else
1264 +#define omap_mcbsp_clks_size 0
1265 +static struct mcbsp_internal_clk __initdata *omap_mcbsp_clks;
1266 +static inline void omap_mcbsp_clk_init(struct mcbsp_internal_clk *mclk)
1267 +{ }
1268 #endif
1269
1270 static void omap1_mcbsp_request(unsigned int id)
1271 @@ -94,9 +167,8 @@
1272 .rx_irq = INT_McBSP1RX,
1273 .tx_irq = INT_McBSP1TX,
1274 .ops = &omap1_mcbsp_ops,
1275 - .clk_names = clk_names,
1276 - .num_clks = 3,
1277 - },
1278 + .clk_name = "mcbsp_clk",
1279 + },
1280 {
1281 .phys_base = OMAP1510_MCBSP2_BASE,
1282 .dma_rx_sync = OMAP_DMA_MCBSP2_RX,
1283 @@ -112,8 +184,7 @@
1284 .rx_irq = INT_McBSP3RX,
1285 .tx_irq = INT_McBSP3TX,
1286 .ops = &omap1_mcbsp_ops,
1287 - .clk_names = clk_names,
1288 - .num_clks = 3,
1289 + .clk_name = "mcbsp_clk",
1290 },
1291 };
1292 #define OMAP15XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap15xx_mcbsp_pdata)
1293 @@ -131,8 +202,7 @@
1294 .rx_irq = INT_McBSP1RX,
1295 .tx_irq = INT_McBSP1TX,
1296 .ops = &omap1_mcbsp_ops,
1297 - .clk_names = clk_names,
1298 - .num_clks = 3,
1299 + .clk_name = "mcbsp_clk",
1300 },
1301 {
1302 .phys_base = OMAP1610_MCBSP2_BASE,
1303 @@ -149,8 +219,7 @@
1304 .rx_irq = INT_McBSP3RX,
1305 .tx_irq = INT_McBSP3TX,
1306 .ops = &omap1_mcbsp_ops,
1307 - .clk_names = clk_names,
1308 - .num_clks = 3,
1309 + .clk_name = "mcbsp_clk",
1310 },
1311 };
1312 #define OMAP16XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap16xx_mcbsp_pdata)
1313 @@ -161,6 +230,15 @@
1314
1315 int __init omap1_mcbsp_init(void)
1316 {
1317 + int i;
1318 +
1319 + for (i = 0; i < omap_mcbsp_clks_size; i++) {
1320 + if (cpu_is_omap15xx() || cpu_is_omap16xx()) {
1321 + omap_mcbsp_clk_init(&omap_mcbsp_clks[i]);
1322 + clk_register(&omap_mcbsp_clks[i].clk);
1323 + }
1324 + }
1325 +
1326 if (cpu_is_omap730())
1327 omap_mcbsp_count = OMAP730_MCBSP_PDATA_SZ;
1328 if (cpu_is_omap15xx())
1329 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-omap2/board-ldp.c linux-2.6.29-rc3.owrt/arch/arm/mach-omap2/board-ldp.c
1330 --- linux-2.6.29.owrt/arch/arm/mach-omap2/board-ldp.c 2009-05-10 22:04:41.000000000 +0200
1331 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-omap2/board-ldp.c 2009-05-10 23:48:27.000000000 +0200
1332 @@ -81,7 +81,7 @@
1333 }
1334
1335 ldp_smc911x_resources[0].start = cs_mem_base + 0x0;
1336 - ldp_smc911x_resources[0].end = cs_mem_base + 0xff;
1337 + ldp_smc911x_resources[0].end = cs_mem_base + 0xf;
1338 udelay(100);
1339
1340 eth_gpio = LDP_SMC911X_GPIO;
1341 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-omap2/board-omap3beagle.c linux-2.6.29-rc3.owrt/arch/arm/mach-omap2/board-omap3beagle.c
1342 --- linux-2.6.29.owrt/arch/arm/mach-omap2/board-omap3beagle.c 2009-05-10 22:04:41.000000000 +0200
1343 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-omap2/board-omap3beagle.c 2009-05-10 23:48:27.000000000 +0200
1344 @@ -178,9 +178,7 @@
1345 #ifdef CONFIG_I2C2_OMAP_BEAGLE
1346 omap_register_i2c_bus(2, 400, NULL, 0);
1347 #endif
1348 - /* Bus 3 is attached to the DVI port where devices like the pico DLP
1349 - * projector don't work reliably with 400kHz */
1350 - omap_register_i2c_bus(3, 100, NULL, 0);
1351 + omap_register_i2c_bus(3, 400, NULL, 0);
1352 return 0;
1353 }
1354
1355 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-omap2/clock.c linux-2.6.29-rc3.owrt/arch/arm/mach-omap2/clock.c
1356 --- linux-2.6.29.owrt/arch/arm/mach-omap2/clock.c 2009-05-10 22:04:41.000000000 +0200
1357 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-omap2/clock.c 2009-05-10 23:48:27.000000000 +0200
1358 @@ -565,7 +565,7 @@
1359 *
1360 * Given a struct clk of a rate-selectable clksel clock, and a clock divisor,
1361 * find the corresponding register field value. The return register value is
1362 - * the value before left-shifting. Returns ~0 on error
1363 + * the value before left-shifting. Returns 0xffffffff on error
1364 */
1365 u32 omap2_divisor_to_clksel(struct clk *clk, u32 div)
1366 {
1367 @@ -577,7 +577,7 @@
1368
1369 clks = omap2_get_clksel_by_parent(clk, clk->parent);
1370 if (clks == NULL)
1371 - return ~0;
1372 + return 0;
1373
1374 for (clkr = clks->rates; clkr->div; clkr++) {
1375 if ((clkr->flags & cpu_mask) && (clkr->div == div))
1376 @@ -588,7 +588,7 @@
1377 printk(KERN_ERR "clock: Could not find divisor %d for "
1378 "clock %s parent %s\n", div, clk->name,
1379 clk->parent->name);
1380 - return ~0;
1381 + return 0;
1382 }
1383
1384 return clkr->val;
1385 @@ -708,7 +708,7 @@
1386 return 0;
1387
1388 for (clkr = clks->rates; clkr->div; clkr++) {
1389 - if (clkr->flags & cpu_mask && clkr->flags & DEFAULT_RATE)
1390 + if (clkr->flags & (cpu_mask | DEFAULT_RATE))
1391 break; /* Found the default rate for this platform */
1392 }
1393
1394 @@ -746,7 +746,7 @@
1395 return -EINVAL;
1396
1397 if (clk->usecount > 0)
1398 - omap2_clk_disable(clk);
1399 + _omap2_clk_disable(clk);
1400
1401 /* Set new source value (previous dividers if any in effect) */
1402 reg_val = __raw_readl(src_addr) & ~field_mask;
1403 @@ -759,10 +759,10 @@
1404 wmb();
1405 }
1406
1407 - clk->parent = new_parent;
1408 -
1409 if (clk->usecount > 0)
1410 - omap2_clk_enable(clk);
1411 + _omap2_clk_enable(clk);
1412 +
1413 + clk->parent = new_parent;
1414
1415 /* CLKSEL clocks follow their parents' rates, divided by a divisor */
1416 clk->rate = new_parent->rate;
1417 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-omap2/devices.c linux-2.6.29-rc3.owrt/arch/arm/mach-omap2/devices.c
1418 --- linux-2.6.29.owrt/arch/arm/mach-omap2/devices.c 2009-05-10 22:04:41.000000000 +0200
1419 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-omap2/devices.c 2009-05-10 23:48:27.000000000 +0200
1420 @@ -421,7 +421,6 @@
1421 int nr_controllers)
1422 {
1423 int i;
1424 - char *name;
1425
1426 for (i = 0; i < nr_controllers; i++) {
1427 unsigned long base, size;
1428 @@ -451,14 +450,12 @@
1429 continue;
1430 }
1431
1432 - if (cpu_is_omap2420()) {
1433 + if (cpu_is_omap2420())
1434 size = OMAP2420_MMC_SIZE;
1435 - name = "mmci-omap";
1436 - } else {
1437 + else
1438 size = HSMMC_SIZE;
1439 - name = "mmci-omap-hs";
1440 - }
1441 - omap_mmc_add(name, i, base, size, irq, mmc_data[i]);
1442 +
1443 + omap_mmc_add(i, base, size, irq, mmc_data[i]);
1444 };
1445 }
1446
1447 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-omap2/id.c linux-2.6.29-rc3.owrt/arch/arm/mach-omap2/id.c
1448 --- linux-2.6.29.owrt/arch/arm/mach-omap2/id.c 2009-05-10 22:04:41.000000000 +0200
1449 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-omap2/id.c 2009-05-10 23:48:27.000000000 +0200
1450 @@ -172,13 +172,9 @@
1451 omap_revision = OMAP3430_REV_ES3_0;
1452 rev_name = "ES3.0";
1453 break;
1454 - case 4:
1455 - omap_revision = OMAP3430_REV_ES3_1;
1456 - rev_name = "ES3.1";
1457 - break;
1458 default:
1459 /* Use the latest known revision as default */
1460 - omap_revision = OMAP3430_REV_ES3_1;
1461 + omap_revision = OMAP3430_REV_ES3_0;
1462 rev_name = "Unknown revision\n";
1463 }
1464 }
1465 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-omap2/irq.c linux-2.6.29-rc3.owrt/arch/arm/mach-omap2/irq.c
1466 --- linux-2.6.29.owrt/arch/arm/mach-omap2/irq.c 2009-05-10 22:04:41.000000000 +0200
1467 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-omap2/irq.c 2009-05-10 23:48:27.000000000 +0200
1468 @@ -134,7 +134,6 @@
1469 .ack = omap_mask_ack_irq,
1470 .mask = omap_mask_irq,
1471 .unmask = omap_unmask_irq,
1472 - .disable = omap_mask_irq,
1473 };
1474
1475 static void __init omap_irq_bank_init_one(struct omap_irq_bank *bank)
1476 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-omap2/mcbsp.c linux-2.6.29-rc3.owrt/arch/arm/mach-omap2/mcbsp.c
1477 --- linux-2.6.29.owrt/arch/arm/mach-omap2/mcbsp.c 2009-05-10 22:04:41.000000000 +0200
1478 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-omap2/mcbsp.c 2009-05-10 23:48:27.000000000 +0200
1479 @@ -24,7 +24,106 @@
1480 #include <mach/cpu.h>
1481 #include <mach/mcbsp.h>
1482
1483 -const char *clk_names[] = { "mcbsp_ick", "mcbsp_fck" };
1484 +struct mcbsp_internal_clk {
1485 + struct clk clk;
1486 + struct clk **childs;
1487 + int n_childs;
1488 +};
1489 +
1490 +#if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX)
1491 +static void omap_mcbsp_clk_init(struct mcbsp_internal_clk *mclk)
1492 +{
1493 + const char *clk_names[] = { "mcbsp_ick", "mcbsp_fck" };
1494 + int i;
1495 +
1496 + mclk->n_childs = ARRAY_SIZE(clk_names);
1497 + mclk->childs = kzalloc(mclk->n_childs * sizeof(struct clk *),
1498 + GFP_KERNEL);
1499 +
1500 + for (i = 0; i < mclk->n_childs; i++) {
1501 + /* We fake a platform device to get correct device id */
1502 + struct platform_device pdev;
1503 +
1504 + pdev.dev.bus = &platform_bus_type;
1505 + pdev.id = mclk->clk.id;
1506 + mclk->childs[i] = clk_get(&pdev.dev, clk_names[i]);
1507 + if (IS_ERR(mclk->childs[i]))
1508 + printk(KERN_ERR "Could not get clock %s (%d).\n",
1509 + clk_names[i], mclk->clk.id);
1510 + }
1511 +}
1512 +
1513 +static int omap_mcbsp_clk_enable(struct clk *clk)
1514 +{
1515 + struct mcbsp_internal_clk *mclk = container_of(clk,
1516 + struct mcbsp_internal_clk, clk);
1517 + int i;
1518 +
1519 + for (i = 0; i < mclk->n_childs; i++)
1520 + clk_enable(mclk->childs[i]);
1521 + return 0;
1522 +}
1523 +
1524 +static void omap_mcbsp_clk_disable(struct clk *clk)
1525 +{
1526 + struct mcbsp_internal_clk *mclk = container_of(clk,
1527 + struct mcbsp_internal_clk, clk);
1528 + int i;
1529 +
1530 + for (i = 0; i < mclk->n_childs; i++)
1531 + clk_disable(mclk->childs[i]);
1532 +}
1533 +
1534 +static struct mcbsp_internal_clk omap_mcbsp_clks[] = {
1535 + {
1536 + .clk = {
1537 + .name = "mcbsp_clk",
1538 + .id = 1,
1539 + .enable = omap_mcbsp_clk_enable,
1540 + .disable = omap_mcbsp_clk_disable,
1541 + },
1542 + },
1543 + {
1544 + .clk = {
1545 + .name = "mcbsp_clk",
1546 + .id = 2,
1547 + .enable = omap_mcbsp_clk_enable,
1548 + .disable = omap_mcbsp_clk_disable,
1549 + },
1550 + },
1551 + {
1552 + .clk = {
1553 + .name = "mcbsp_clk",
1554 + .id = 3,
1555 + .enable = omap_mcbsp_clk_enable,
1556 + .disable = omap_mcbsp_clk_disable,
1557 + },
1558 + },
1559 + {
1560 + .clk = {
1561 + .name = "mcbsp_clk",
1562 + .id = 4,
1563 + .enable = omap_mcbsp_clk_enable,
1564 + .disable = omap_mcbsp_clk_disable,
1565 + },
1566 + },
1567 + {
1568 + .clk = {
1569 + .name = "mcbsp_clk",
1570 + .id = 5,
1571 + .enable = omap_mcbsp_clk_enable,
1572 + .disable = omap_mcbsp_clk_disable,
1573 + },
1574 + },
1575 +};
1576 +
1577 +#define omap_mcbsp_clks_size ARRAY_SIZE(omap_mcbsp_clks)
1578 +#else
1579 +#define omap_mcbsp_clks_size 0
1580 +static struct mcbsp_internal_clk __initdata *omap_mcbsp_clks;
1581 +static inline void omap_mcbsp_clk_init(struct clk *clk)
1582 +{ }
1583 +#endif
1584
1585 static void omap2_mcbsp2_mux_setup(void)
1586 {
1587 @@ -57,8 +156,7 @@
1588 .rx_irq = INT_24XX_MCBSP1_IRQ_RX,
1589 .tx_irq = INT_24XX_MCBSP1_IRQ_TX,
1590 .ops = &omap2_mcbsp_ops,
1591 - .clk_names = clk_names,
1592 - .num_clks = 2,
1593 + .clk_name = "mcbsp_clk",
1594 },
1595 {
1596 .phys_base = OMAP24XX_MCBSP2_BASE,
1597 @@ -67,8 +165,7 @@
1598 .rx_irq = INT_24XX_MCBSP2_IRQ_RX,
1599 .tx_irq = INT_24XX_MCBSP2_IRQ_TX,
1600 .ops = &omap2_mcbsp_ops,
1601 - .clk_names = clk_names,
1602 - .num_clks = 2,
1603 + .clk_name = "mcbsp_clk",
1604 },
1605 };
1606 #define OMAP2420_MCBSP_PDATA_SZ ARRAY_SIZE(omap2420_mcbsp_pdata)
1607 @@ -86,8 +183,7 @@
1608 .rx_irq = INT_24XX_MCBSP1_IRQ_RX,
1609 .tx_irq = INT_24XX_MCBSP1_IRQ_TX,
1610 .ops = &omap2_mcbsp_ops,
1611 - .clk_names = clk_names,
1612 - .num_clks = 2,
1613 + .clk_name = "mcbsp_clk",
1614 },
1615 {
1616 .phys_base = OMAP24XX_MCBSP2_BASE,
1617 @@ -96,8 +192,7 @@
1618 .rx_irq = INT_24XX_MCBSP2_IRQ_RX,
1619 .tx_irq = INT_24XX_MCBSP2_IRQ_TX,
1620 .ops = &omap2_mcbsp_ops,
1621 - .clk_names = clk_names,
1622 - .num_clks = 2,
1623 + .clk_name = "mcbsp_clk",
1624 },
1625 {
1626 .phys_base = OMAP2430_MCBSP3_BASE,
1627 @@ -106,8 +201,7 @@
1628 .rx_irq = INT_24XX_MCBSP3_IRQ_RX,
1629 .tx_irq = INT_24XX_MCBSP3_IRQ_TX,
1630 .ops = &omap2_mcbsp_ops,
1631 - .clk_names = clk_names,
1632 - .num_clks = 2,
1633 + .clk_name = "mcbsp_clk",
1634 },
1635 {
1636 .phys_base = OMAP2430_MCBSP4_BASE,
1637 @@ -116,8 +210,7 @@
1638 .rx_irq = INT_24XX_MCBSP4_IRQ_RX,
1639 .tx_irq = INT_24XX_MCBSP4_IRQ_TX,
1640 .ops = &omap2_mcbsp_ops,
1641 - .clk_names = clk_names,
1642 - .num_clks = 2,
1643 + .clk_name = "mcbsp_clk",
1644 },
1645 {
1646 .phys_base = OMAP2430_MCBSP5_BASE,
1647 @@ -126,8 +219,7 @@
1648 .rx_irq = INT_24XX_MCBSP5_IRQ_RX,
1649 .tx_irq = INT_24XX_MCBSP5_IRQ_TX,
1650 .ops = &omap2_mcbsp_ops,
1651 - .clk_names = clk_names,
1652 - .num_clks = 2,
1653 + .clk_name = "mcbsp_clk",
1654 },
1655 };
1656 #define OMAP2430_MCBSP_PDATA_SZ ARRAY_SIZE(omap2430_mcbsp_pdata)
1657 @@ -145,8 +237,7 @@
1658 .rx_irq = INT_24XX_MCBSP1_IRQ_RX,
1659 .tx_irq = INT_24XX_MCBSP1_IRQ_TX,
1660 .ops = &omap2_mcbsp_ops,
1661 - .clk_names = clk_names,
1662 - .num_clks = 2,
1663 + .clk_name = "mcbsp_clk",
1664 },
1665 {
1666 .phys_base = OMAP34XX_MCBSP2_BASE,
1667 @@ -155,8 +246,7 @@
1668 .rx_irq = INT_24XX_MCBSP2_IRQ_RX,
1669 .tx_irq = INT_24XX_MCBSP2_IRQ_TX,
1670 .ops = &omap2_mcbsp_ops,
1671 - .clk_names = clk_names,
1672 - .num_clks = 2,
1673 + .clk_name = "mcbsp_clk",
1674 },
1675 {
1676 .phys_base = OMAP34XX_MCBSP3_BASE,
1677 @@ -165,8 +255,7 @@
1678 .rx_irq = INT_24XX_MCBSP3_IRQ_RX,
1679 .tx_irq = INT_24XX_MCBSP3_IRQ_TX,
1680 .ops = &omap2_mcbsp_ops,
1681 - .clk_names = clk_names,
1682 - .num_clks = 2,
1683 + .clk_name = "mcbsp_clk",
1684 },
1685 {
1686 .phys_base = OMAP34XX_MCBSP4_BASE,
1687 @@ -175,8 +264,7 @@
1688 .rx_irq = INT_24XX_MCBSP4_IRQ_RX,
1689 .tx_irq = INT_24XX_MCBSP4_IRQ_TX,
1690 .ops = &omap2_mcbsp_ops,
1691 - .clk_names = clk_names,
1692 - .num_clks = 2,
1693 + .clk_name = "mcbsp_clk",
1694 },
1695 {
1696 .phys_base = OMAP34XX_MCBSP5_BASE,
1697 @@ -185,8 +273,7 @@
1698 .rx_irq = INT_24XX_MCBSP5_IRQ_RX,
1699 .tx_irq = INT_24XX_MCBSP5_IRQ_TX,
1700 .ops = &omap2_mcbsp_ops,
1701 - .clk_names = clk_names,
1702 - .num_clks = 2,
1703 + .clk_name = "mcbsp_clk",
1704 },
1705 };
1706 #define OMAP34XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap34xx_mcbsp_pdata)
1707 @@ -197,6 +284,14 @@
1708
1709 static int __init omap2_mcbsp_init(void)
1710 {
1711 + int i;
1712 +
1713 + for (i = 0; i < omap_mcbsp_clks_size; i++) {
1714 + /* Once we call clk_get inside init, we do not register it */
1715 + omap_mcbsp_clk_init(&omap_mcbsp_clks[i]);
1716 + clk_register(&omap_mcbsp_clks[i].clk);
1717 + }
1718 +
1719 if (cpu_is_omap2420())
1720 omap_mcbsp_count = OMAP2420_MCBSP_PDATA_SZ;
1721 if (cpu_is_omap2430())
1722 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-omap2/sleep24xx.S linux-2.6.29-rc3.owrt/arch/arm/mach-omap2/sleep24xx.S
1723 --- linux-2.6.29.owrt/arch/arm/mach-omap2/sleep24xx.S 2009-05-10 22:04:41.000000000 +0200
1724 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-omap2/sleep24xx.S 2009-05-10 23:48:28.000000000 +0200
1725 @@ -93,8 +93,9 @@
1726 orr r4, r4, #0x40 @ enable self refresh on idle req
1727 mov r5, #0x2000 @ set delay (DPLL relock + DLL relock)
1728 str r4, [r2] @ make it so
1729 + mov r2, #0
1730 nop
1731 - mcr p15, 0, r3, c7, c0, 4 @ wait for interrupt
1732 + mcr p15, 0, r2, c7, c0, 4 @ wait for interrupt
1733 nop
1734 loop:
1735 subs r5, r5, #0x1 @ awake, wait just a bit
1736 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-omap2/timer-gp.c linux-2.6.29-rc3.owrt/arch/arm/mach-omap2/timer-gp.c
1737 --- linux-2.6.29.owrt/arch/arm/mach-omap2/timer-gp.c 2009-05-10 22:04:41.000000000 +0200
1738 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-omap2/timer-gp.c 2009-05-10 23:48:28.000000000 +0200
1739 @@ -118,8 +118,7 @@
1740 clockevent_gpt.max_delta_ns =
1741 clockevent_delta2ns(0xffffffff, &clockevent_gpt);
1742 clockevent_gpt.min_delta_ns =
1743 - clockevent_delta2ns(3, &clockevent_gpt);
1744 - /* Timer internal resynch latency. */
1745 + clockevent_delta2ns(1, &clockevent_gpt);
1746
1747 clockevent_gpt.cpumask = cpumask_of(0);
1748 clockevents_register_device(&clockevent_gpt);
1749 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-orion5x/common.c linux-2.6.29-rc3.owrt/arch/arm/mach-orion5x/common.c
1750 --- linux-2.6.29.owrt/arch/arm/mach-orion5x/common.c 2009-05-10 22:04:41.000000000 +0200
1751 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-orion5x/common.c 2009-05-10 23:48:28.000000000 +0200
1752 @@ -431,10 +431,6 @@
1753 /*****************************************************************************
1754 * XOR engine
1755 ****************************************************************************/
1756 -struct mv_xor_platform_shared_data orion5x_xor_shared_data = {
1757 - .dram = &orion5x_mbus_dram_info,
1758 -};
1759 -
1760 static struct resource orion5x_xor_shared_resources[] = {
1761 {
1762 .name = "xor low",
1763 @@ -452,9 +448,6 @@
1764 static struct platform_device orion5x_xor_shared = {
1765 .name = MV_XOR_SHARED_NAME,
1766 .id = 0,
1767 - .dev = {
1768 - .platform_data = &orion5x_xor_shared_data,
1769 - },
1770 .num_resources = ARRAY_SIZE(orion5x_xor_shared_resources),
1771 .resource = orion5x_xor_shared_resources,
1772 };
1773 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-orion5x/irq.c linux-2.6.29-rc3.owrt/arch/arm/mach-orion5x/irq.c
1774 --- linux-2.6.29.owrt/arch/arm/mach-orion5x/irq.c 2009-05-10 22:04:41.000000000 +0200
1775 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-orion5x/irq.c 2009-05-10 23:48:28.000000000 +0200
1776 @@ -44,7 +44,7 @@
1777 * User can use set_type() if he wants to use edge types handlers.
1778 */
1779 for (i = IRQ_ORION5X_GPIO_START; i < NR_IRQS; i++) {
1780 - set_irq_chip(i, &orion_gpio_irq_chip);
1781 + set_irq_chip(i, &orion_gpio_irq_level_chip);
1782 set_irq_handler(i, handle_level_irq);
1783 irq_desc[i].status |= IRQ_LEVEL;
1784 set_irq_flags(i, IRQF_VALID);
1785 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-pxa/dma.c linux-2.6.29-rc3.owrt/arch/arm/mach-pxa/dma.c
1786 --- linux-2.6.29.owrt/arch/arm/mach-pxa/dma.c 2009-05-10 22:04:41.000000000 +0200
1787 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-pxa/dma.c 2009-05-10 23:48:28.000000000 +0200
1788 @@ -121,16 +121,6 @@
1789 if (dma_channels == NULL)
1790 return -ENOMEM;
1791
1792 - /* dma channel priorities on pxa2xx processors:
1793 - * ch 0 - 3, 16 - 19 <--> (0) DMA_PRIO_HIGH
1794 - * ch 4 - 7, 20 - 23 <--> (1) DMA_PRIO_MEDIUM
1795 - * ch 8 - 15, 24 - 31 <--> (2) DMA_PRIO_LOW
1796 - */
1797 - for (i = 0; i < num_ch; i++) {
1798 - DCSR(i) = 0;
1799 - dma_channels[i].prio = min((i & 0xf) >> 2, DMA_PRIO_LOW);
1800 - }
1801 -
1802 ret = request_irq(IRQ_DMA, dma_irq_handler, IRQF_DISABLED, "DMA", NULL);
1803 if (ret) {
1804 printk (KERN_CRIT "Wow! Can't register IRQ for DMA\n");
1805 @@ -138,6 +128,14 @@
1806 return ret;
1807 }
1808
1809 + /* dma channel priorities on pxa2xx processors:
1810 + * ch 0 - 3, 16 - 19 <--> (0) DMA_PRIO_HIGH
1811 + * ch 4 - 7, 20 - 23 <--> (1) DMA_PRIO_MEDIUM
1812 + * ch 8 - 15, 24 - 31 <--> (2) DMA_PRIO_LOW
1813 + */
1814 + for (i = 0; i < num_ch; i++)
1815 + dma_channels[i].prio = min((i & 0xf) >> 2, DMA_PRIO_LOW);
1816 +
1817 num_dma_channels = num_ch;
1818 return 0;
1819 }
1820 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-pxa/include/mach/regs-ac97.h linux-2.6.29-rc3.owrt/arch/arm/mach-pxa/include/mach/regs-ac97.h
1821 --- linux-2.6.29.owrt/arch/arm/mach-pxa/include/mach/regs-ac97.h 2009-05-10 22:04:41.000000000 +0200
1822 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-pxa/include/mach/regs-ac97.h 2009-05-10 23:48:28.000000000 +0200
1823 @@ -1,8 +1,6 @@
1824 #ifndef __ASM_ARCH_REGS_AC97_H
1825 #define __ASM_ARCH_REGS_AC97_H
1826
1827 -#include <mach/hardware.h>
1828 -
1829 /*
1830 * AC97 Controller registers
1831 */
1832 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-pxa/include/mach/regs-ssp.h linux-2.6.29-rc3.owrt/arch/arm/mach-pxa/include/mach/regs-ssp.h
1833 --- linux-2.6.29.owrt/arch/arm/mach-pxa/include/mach/regs-ssp.h 2009-05-10 22:04:41.000000000 +0200
1834 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-pxa/include/mach/regs-ssp.h 2009-05-10 23:48:28.000000000 +0200
1835 @@ -41,9 +41,6 @@
1836 #elif defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
1837 #define SSCR0_SCR (0x000fff00) /* Serial Clock Rate (mask) */
1838 #define SSCR0_SerClkDiv(x) (((x) - 1) << 8) /* Divisor [1..4096] */
1839 -#endif
1840 -
1841 -#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
1842 #define SSCR0_EDSS (1 << 20) /* Extended data size select */
1843 #define SSCR0_NCS (1 << 21) /* Network clock select */
1844 #define SSCR0_RIM (1 << 22) /* Receive FIFO overrrun interrupt mask */
1845 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-pxa/pxa300.c linux-2.6.29-rc3.owrt/arch/arm/mach-pxa/pxa300.c
1846 --- linux-2.6.29.owrt/arch/arm/mach-pxa/pxa300.c 2009-05-10 22:04:41.000000000 +0200
1847 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-pxa/pxa300.c 2009-05-10 23:48:28.000000000 +0200
1848 @@ -88,13 +88,13 @@
1849 static DEFINE_PXA3_CKEN(common_nand, NAND, 156000000, 0);
1850
1851 static struct clk_lookup common_clkregs[] = {
1852 - INIT_CLKREG(&clk_common_nand, "pxa3xx-nand", NULL),
1853 + INIT_CLKREG(&clk_common_nand, "pxa3xx-nand", "NANDCLK"),
1854 };
1855
1856 static DEFINE_PXA3_CKEN(pxa310_mmc3, MMC3, 19500000, 0);
1857
1858 static struct clk_lookup pxa310_clkregs[] = {
1859 - INIT_CLKREG(&clk_pxa310_mmc3, "pxa2xx-mci.2", NULL),
1860 + INIT_CLKREG(&clk_pxa310_mmc3, "pxa2xx-mci.2", "MMCCLK"),
1861 };
1862
1863 static int __init pxa300_init(void)
1864 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-pxa/pxa320.c linux-2.6.29-rc3.owrt/arch/arm/mach-pxa/pxa320.c
1865 --- linux-2.6.29.owrt/arch/arm/mach-pxa/pxa320.c 2009-05-10 22:04:41.000000000 +0200
1866 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-pxa/pxa320.c 2009-05-10 23:48:28.000000000 +0200
1867 @@ -83,7 +83,7 @@
1868 static DEFINE_PXA3_CKEN(pxa320_nand, NAND, 104000000, 0);
1869
1870 static struct clk_lookup pxa320_clkregs[] = {
1871 - INIT_CLKREG(&clk_pxa320_nand, "pxa3xx-nand", NULL),
1872 + INIT_CLKREG(&clk_pxa320_nand, "pxa3xx-nand", "NANDCLK"),
1873 };
1874
1875 static int __init pxa320_init(void)
1876 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-rpc/riscpc.c linux-2.6.29-rc3.owrt/arch/arm/mach-rpc/riscpc.c
1877 --- linux-2.6.29.owrt/arch/arm/mach-rpc/riscpc.c 2009-05-10 22:04:41.000000000 +0200
1878 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-rpc/riscpc.c 2009-05-10 23:48:28.000000000 +0200
1879 @@ -19,7 +19,6 @@
1880 #include <linux/serial_8250.h>
1881 #include <linux/ata_platform.h>
1882 #include <linux/io.h>
1883 -#include <linux/i2c.h>
1884
1885 #include <asm/elf.h>
1886 #include <asm/mach-types.h>
1887 @@ -202,13 +201,8 @@
1888 &pata_device,
1889 };
1890
1891 -static struct i2c_board_info i2c_rtc = {
1892 - I2C_BOARD_INFO("pcf8583", 0x50)
1893 -};
1894 -
1895 static int __init rpc_init(void)
1896 {
1897 - i2c_register_board_info(0, &i2c_rtc, 1);
1898 return platform_add_devices(devs, ARRAY_SIZE(devs));
1899 }
1900
1901 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-s3c6410/mach-smdk6410.c linux-2.6.29-rc3.owrt/arch/arm/mach-s3c6410/mach-smdk6410.c
1902 --- linux-2.6.29.owrt/arch/arm/mach-s3c6410/mach-smdk6410.c 2009-05-10 22:04:41.000000000 +0200
1903 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-s3c6410/mach-smdk6410.c 2009-05-10 23:48:28.000000000 +0200
1904 @@ -129,7 +129,7 @@
1905 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
1906 };
1907
1908 -static struct map_desc smdk6410_iodesc[] = {};
1909 +struct map_desc smdk6410_iodesc[] = {};
1910
1911 static struct platform_device *smdk6410_devices[] __initdata = {
1912 #ifdef CONFIG_SMDK6410_SD_CH0
1913 @@ -146,7 +146,7 @@
1914
1915 static struct i2c_board_info i2c_devs0[] __initdata = {
1916 { I2C_BOARD_INFO("24c08", 0x50), },
1917 - { I2C_BOARD_INFO("wm8580", 0x1b), },
1918 + { I2C_BOARD_INFO("WM8580", 0X1b), },
1919 };
1920
1921 static struct i2c_board_info i2c_devs1[] __initdata = {
1922 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mach-sa1100/generic.c linux-2.6.29-rc3.owrt/arch/arm/mach-sa1100/generic.c
1923 --- linux-2.6.29.owrt/arch/arm/mach-sa1100/generic.c 2009-05-10 22:04:41.000000000 +0200
1924 +++ linux-2.6.29-rc3.owrt/arch/arm/mach-sa1100/generic.c 2009-05-10 23:48:28.000000000 +0200
1925 @@ -289,7 +289,7 @@
1926 };
1927
1928 static struct platform_device sa11x0mtd_device = {
1929 - .name = "sa1100-mtd",
1930 + .name = "flash",
1931 .id = -1,
1932 };
1933
1934 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mm/abort-ev6.S linux-2.6.29-rc3.owrt/arch/arm/mm/abort-ev6.S
1935 --- linux-2.6.29.owrt/arch/arm/mm/abort-ev6.S 2009-05-10 22:04:41.000000000 +0200
1936 +++ linux-2.6.29-rc3.owrt/arch/arm/mm/abort-ev6.S 2009-05-10 23:48:28.000000000 +0200
1937 @@ -23,8 +23,7 @@
1938 #ifdef CONFIG_CPU_32v6K
1939 clrex
1940 #else
1941 - sub r1, sp, #4 @ Get unused stack location
1942 - strex r0, r1, [r1] @ Clear the exclusive monitor
1943 + strex r0, r1, [sp] @ Clear the exclusive monitor
1944 #endif
1945 mrc p15, 0, r1, c5, c0, 0 @ get FSR
1946 mrc p15, 0, r0, c6, c0, 0 @ get FAR
1947 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mm/copypage-feroceon.c linux-2.6.29-rc3.owrt/arch/arm/mm/copypage-feroceon.c
1948 --- linux-2.6.29.owrt/arch/arm/mm/copypage-feroceon.c 2009-05-10 22:04:41.000000000 +0200
1949 +++ linux-2.6.29-rc3.owrt/arch/arm/mm/copypage-feroceon.c 2009-05-10 23:48:28.000000000 +0200
1950 @@ -13,7 +13,7 @@
1951 #include <linux/init.h>
1952 #include <linux/highmem.h>
1953
1954 -static void __naked
1955 +static void __attribute__((naked))
1956 feroceon_copy_user_page(void *kto, const void *kfrom)
1957 {
1958 asm("\
1959 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mm/copypage-v3.c linux-2.6.29-rc3.owrt/arch/arm/mm/copypage-v3.c
1960 --- linux-2.6.29.owrt/arch/arm/mm/copypage-v3.c 2009-05-10 22:04:41.000000000 +0200
1961 +++ linux-2.6.29-rc3.owrt/arch/arm/mm/copypage-v3.c 2009-05-10 23:48:28.000000000 +0200
1962 @@ -15,7 +15,7 @@
1963 *
1964 * FIXME: do we need to handle cache stuff...
1965 */
1966 -static void __naked
1967 +static void __attribute__((naked))
1968 v3_copy_user_page(void *kto, const void *kfrom)
1969 {
1970 asm("\n\
1971 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mm/copypage-v4mc.c linux-2.6.29-rc3.owrt/arch/arm/mm/copypage-v4mc.c
1972 --- linux-2.6.29.owrt/arch/arm/mm/copypage-v4mc.c 2009-05-10 22:04:41.000000000 +0200
1973 +++ linux-2.6.29-rc3.owrt/arch/arm/mm/copypage-v4mc.c 2009-05-10 23:48:28.000000000 +0200
1974 @@ -44,7 +44,7 @@
1975 * instruction. If your processor does not supply this, you have to write your
1976 * own copy_user_highpage that does the right thing.
1977 */
1978 -static void __naked
1979 +static void __attribute__((naked))
1980 mc_copy_user_page(void *from, void *to)
1981 {
1982 asm volatile(
1983 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mm/copypage-v4wb.c linux-2.6.29-rc3.owrt/arch/arm/mm/copypage-v4wb.c
1984 --- linux-2.6.29.owrt/arch/arm/mm/copypage-v4wb.c 2009-05-10 22:04:41.000000000 +0200
1985 +++ linux-2.6.29-rc3.owrt/arch/arm/mm/copypage-v4wb.c 2009-05-10 23:48:28.000000000 +0200
1986 @@ -22,7 +22,7 @@
1987 * instruction. If your processor does not supply this, you have to write your
1988 * own copy_user_highpage that does the right thing.
1989 */
1990 -static void __naked
1991 +static void __attribute__((naked))
1992 v4wb_copy_user_page(void *kto, const void *kfrom)
1993 {
1994 asm("\
1995 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mm/copypage-v4wt.c linux-2.6.29-rc3.owrt/arch/arm/mm/copypage-v4wt.c
1996 --- linux-2.6.29.owrt/arch/arm/mm/copypage-v4wt.c 2009-05-10 22:04:41.000000000 +0200
1997 +++ linux-2.6.29-rc3.owrt/arch/arm/mm/copypage-v4wt.c 2009-05-10 23:48:28.000000000 +0200
1998 @@ -20,7 +20,7 @@
1999 * dirty data in the cache. However, we do have to ensure that
2000 * subsequent reads are up to date.
2001 */
2002 -static void __naked
2003 +static void __attribute__((naked))
2004 v4wt_copy_user_page(void *kto, const void *kfrom)
2005 {
2006 asm("\
2007 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mm/copypage-xsc3.c linux-2.6.29-rc3.owrt/arch/arm/mm/copypage-xsc3.c
2008 --- linux-2.6.29.owrt/arch/arm/mm/copypage-xsc3.c 2009-05-10 22:04:41.000000000 +0200
2009 +++ linux-2.6.29-rc3.owrt/arch/arm/mm/copypage-xsc3.c 2009-05-10 23:48:28.000000000 +0200
2010 @@ -29,7 +29,7 @@
2011 * if we eventually end up using our copied page.
2012 *
2013 */
2014 -static void __naked
2015 +static void __attribute__((naked))
2016 xsc3_mc_copy_user_page(void *kto, const void *kfrom)
2017 {
2018 asm("\
2019 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mm/copypage-xscale.c linux-2.6.29-rc3.owrt/arch/arm/mm/copypage-xscale.c
2020 --- linux-2.6.29.owrt/arch/arm/mm/copypage-xscale.c 2009-05-10 22:04:41.000000000 +0200
2021 +++ linux-2.6.29-rc3.owrt/arch/arm/mm/copypage-xscale.c 2009-05-10 23:48:28.000000000 +0200
2022 @@ -42,7 +42,7 @@
2023 * Dcache aliasing issue. The writes will be forwarded to the write buffer,
2024 * and merged as appropriate.
2025 */
2026 -static void __naked
2027 +static void __attribute__((naked))
2028 mc_copy_user_page(void *from, void *to)
2029 {
2030 /*
2031 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mm/dma-mapping.c linux-2.6.29-rc3.owrt/arch/arm/mm/dma-mapping.c
2032 --- linux-2.6.29.owrt/arch/arm/mm/dma-mapping.c 2009-05-10 22:04:41.000000000 +0200
2033 +++ linux-2.6.29-rc3.owrt/arch/arm/mm/dma-mapping.c 2009-05-10 23:48:28.000000000 +0200
2034 @@ -490,30 +490,26 @@
2035 */
2036 void dma_cache_maint(const void *start, size_t size, int direction)
2037 {
2038 - void (*inner_op)(const void *, const void *);
2039 - void (*outer_op)(unsigned long, unsigned long);
2040 + const void *end = start + size;
2041
2042 - BUG_ON(!virt_addr_valid(start) || !virt_addr_valid(start + size - 1));
2043 + BUG_ON(!virt_addr_valid(start) || !virt_addr_valid(end - 1));
2044
2045 switch (direction) {
2046 case DMA_FROM_DEVICE: /* invalidate only */
2047 - inner_op = dmac_inv_range;
2048 - outer_op = outer_inv_range;
2049 + dmac_inv_range(start, end);
2050 + outer_inv_range(__pa(start), __pa(end));
2051 break;
2052 case DMA_TO_DEVICE: /* writeback only */
2053 - inner_op = dmac_clean_range;
2054 - outer_op = outer_clean_range;
2055 + dmac_clean_range(start, end);
2056 + outer_clean_range(__pa(start), __pa(end));
2057 break;
2058 case DMA_BIDIRECTIONAL: /* writeback and invalidate */
2059 - inner_op = dmac_flush_range;
2060 - outer_op = outer_flush_range;
2061 + dmac_flush_range(start, end);
2062 + outer_flush_range(__pa(start), __pa(end));
2063 break;
2064 default:
2065 BUG();
2066 }
2067 -
2068 - inner_op(start, start + size);
2069 - outer_op(__pa(start), __pa(start) + size);
2070 }
2071 EXPORT_SYMBOL(dma_cache_maint);
2072
2073 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mm/fault-armv.c linux-2.6.29-rc3.owrt/arch/arm/mm/fault-armv.c
2074 --- linux-2.6.29.owrt/arch/arm/mm/fault-armv.c 2009-05-10 22:04:41.000000000 +0200
2075 +++ linux-2.6.29-rc3.owrt/arch/arm/mm/fault-armv.c 2009-05-10 23:48:28.000000000 +0200
2076 @@ -66,10 +66,7 @@
2077 * fault (ie, is old), we can safely ignore any issues.
2078 */
2079 if (ret && (pte_val(entry) & L_PTE_MT_MASK) != shared_pte_mask) {
2080 - unsigned long pfn = pte_pfn(entry);
2081 - flush_cache_page(vma, address, pfn);
2082 - outer_flush_range((pfn << PAGE_SHIFT),
2083 - (pfn << PAGE_SHIFT) + PAGE_SIZE);
2084 + flush_cache_page(vma, address, pte_pfn(entry));
2085 pte_val(entry) &= ~L_PTE_MT_MASK;
2086 pte_val(entry) |= shared_pte_mask;
2087 set_pte_at(vma->vm_mm, address, pte, entry);
2088 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mm/init.c linux-2.6.29-rc3.owrt/arch/arm/mm/init.c
2089 --- linux-2.6.29.owrt/arch/arm/mm/init.c 2009-05-10 22:04:41.000000000 +0200
2090 +++ linux-2.6.29-rc3.owrt/arch/arm/mm/init.c 2009-05-10 23:48:28.000000000 +0200
2091 @@ -382,7 +382,7 @@
2092 for_each_node(node)
2093 bootmem_free_node(node, mi);
2094
2095 - high_memory = __va((memend_pfn << PAGE_SHIFT) - 1) + 1;
2096 + high_memory = __va(memend_pfn << PAGE_SHIFT);
2097
2098 /*
2099 * This doesn't seem to be used by the Linux memory manager any
2100 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mm/mmap.c linux-2.6.29-rc3.owrt/arch/arm/mm/mmap.c
2101 --- linux-2.6.29.owrt/arch/arm/mm/mmap.c 2009-05-10 22:04:41.000000000 +0200
2102 +++ linux-2.6.29-rc3.owrt/arch/arm/mm/mmap.c 2009-05-10 23:48:28.000000000 +0200
2103 @@ -124,7 +124,7 @@
2104 {
2105 if (addr < PHYS_OFFSET)
2106 return 0;
2107 - if (addr + size >= __pa(high_memory - 1))
2108 + if (addr + size > __pa(high_memory))
2109 return 0;
2110
2111 return 1;
2112 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/mm/mmu.c linux-2.6.29-rc3.owrt/arch/arm/mm/mmu.c
2113 --- linux-2.6.29.owrt/arch/arm/mm/mmu.c 2009-05-10 22:04:41.000000000 +0200
2114 +++ linux-2.6.29-rc3.owrt/arch/arm/mm/mmu.c 2009-05-10 23:48:28.000000000 +0200
2115 @@ -693,8 +693,7 @@
2116 * Check whether this memory bank would entirely overlap
2117 * the vmalloc area.
2118 */
2119 - if (__va(bank->start) >= VMALLOC_MIN ||
2120 - __va(bank->start) < PAGE_OFFSET) {
2121 + if (__va(bank->start) >= VMALLOC_MIN) {
2122 printk(KERN_NOTICE "Ignoring RAM at %.8lx-%.8lx "
2123 "(vmalloc region overlap).\n",
2124 bank->start, bank->start + bank->size - 1);
2125 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/plat-mxc/include/mach/mmc.h linux-2.6.29-rc3.owrt/arch/arm/plat-mxc/include/mach/mmc.h
2126 --- linux-2.6.29.owrt/arch/arm/plat-mxc/include/mach/mmc.h 2009-05-10 22:04:41.000000000 +0200
2127 +++ linux-2.6.29-rc3.owrt/arch/arm/plat-mxc/include/mach/mmc.h 1970-01-01 01:00:00.000000000 +0100
2128 @@ -1,36 +0,0 @@
2129 -#ifndef ASMARM_ARCH_MMC_H
2130 -#define ASMARM_ARCH_MMC_H
2131 -
2132 -#include <linux/mmc/host.h>
2133 -
2134 -struct device;
2135 -
2136 -/* board specific SDHC data, optional.
2137 - * If not present, a writable card with 3,3V is assumed.
2138 - */
2139 -struct imxmmc_platform_data {
2140 - /* Return values for the get_ro callback should be:
2141 - * 0 for a read/write card
2142 - * 1 for a read-only card
2143 - * -ENOSYS when not supported (equal to NULL callback)
2144 - * or a negative errno value when something bad happened
2145 - */
2146 - int (*get_ro)(struct device *);
2147 -
2148 - /* board specific hook to (de)initialize the SD slot.
2149 - * The board code can call 'handler' on a card detection
2150 - * change giving data as argument.
2151 - */
2152 - int (*init)(struct device *dev, irq_handler_t handler, void *data);
2153 - void (*exit)(struct device *dev, void *data);
2154 -
2155 - /* available voltages. If not given, assume
2156 - * MMC_VDD_32_33 | MMC_VDD_33_34
2157 - */
2158 - unsigned int ocr_avail;
2159 -
2160 - /* adjust slot voltage */
2161 - void (*setpower)(struct device *, unsigned int vdd);
2162 -};
2163 -
2164 -#endif
2165 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/plat-omap/common.c linux-2.6.29-rc3.owrt/arch/arm/plat-omap/common.c
2166 --- linux-2.6.29.owrt/arch/arm/plat-omap/common.c 2009-05-10 22:04:41.000000000 +0200
2167 +++ linux-2.6.29-rc3.owrt/arch/arm/plat-omap/common.c 2009-05-10 23:48:28.000000000 +0200
2168 @@ -200,16 +200,20 @@
2169 };
2170
2171 /*
2172 + * Rounds down to nearest nsec.
2173 + */
2174 +unsigned long long omap_32k_ticks_to_nsecs(unsigned long ticks_32k)
2175 +{
2176 + return cyc2ns(&clocksource_32k, ticks_32k);
2177 +}
2178 +
2179 +/*
2180 * Returns current time from boot in nsecs. It's OK for this to wrap
2181 * around for now, as it's just a relative time stamp.
2182 */
2183 unsigned long long sched_clock(void)
2184 {
2185 - unsigned long long ret;
2186 -
2187 - ret = (unsigned long long)omap_32k_read();
2188 - ret = (ret * clocksource_32k.mult_orig) >> clocksource_32k.shift;
2189 - return ret;
2190 + return omap_32k_ticks_to_nsecs(omap_32k_read());
2191 }
2192
2193 static int __init omap_init_clocksource_32k(void)
2194 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/plat-omap/devices.c linux-2.6.29-rc3.owrt/arch/arm/plat-omap/devices.c
2195 --- linux-2.6.29.owrt/arch/arm/plat-omap/devices.c 2009-05-10 22:04:41.000000000 +0200
2196 +++ linux-2.6.29-rc3.owrt/arch/arm/plat-omap/devices.c 2009-05-10 23:48:28.000000000 +0200
2197 @@ -200,15 +200,14 @@
2198 /*
2199 * Register MMC devices. Called from mach-omap1 and mach-omap2 device init.
2200 */
2201 -int __init omap_mmc_add(const char *name, int id, unsigned long base,
2202 - unsigned long size, unsigned int irq,
2203 - struct omap_mmc_platform_data *data)
2204 +int __init omap_mmc_add(int id, unsigned long base, unsigned long size,
2205 + unsigned int irq, struct omap_mmc_platform_data *data)
2206 {
2207 struct platform_device *pdev;
2208 struct resource res[OMAP_MMC_NR_RES];
2209 int ret;
2210
2211 - pdev = platform_device_alloc(name, id);
2212 + pdev = platform_device_alloc("mmci-omap", id);
2213 if (!pdev)
2214 return -ENOMEM;
2215
2216 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/plat-omap/dma.c linux-2.6.29-rc3.owrt/arch/arm/plat-omap/dma.c
2217 --- linux-2.6.29.owrt/arch/arm/plat-omap/dma.c 2009-05-10 22:04:41.000000000 +0200
2218 +++ linux-2.6.29-rc3.owrt/arch/arm/plat-omap/dma.c 2009-05-10 23:48:28.000000000 +0200
2219 @@ -709,7 +709,6 @@
2220 chan->dev_name = dev_name;
2221 chan->callback = callback;
2222 chan->data = data;
2223 - chan->flags = 0;
2224
2225 #ifndef CONFIG_ARCH_OMAP1
2226 if (cpu_class_is_omap2()) {
2227 @@ -1889,11 +1888,11 @@
2228 status = dma_read(CSR(ch));
2229 }
2230
2231 - dma_write(status, CSR(ch));
2232 -
2233 if (likely(dma_chan[ch].callback != NULL))
2234 dma_chan[ch].callback(ch, status, dma_chan[ch].data);
2235
2236 + dma_write(status, CSR(ch));
2237 +
2238 return 0;
2239 }
2240
2241 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/plat-omap/include/mach/common.h linux-2.6.29-rc3.owrt/arch/arm/plat-omap/include/mach/common.h
2242 --- linux-2.6.29.owrt/arch/arm/plat-omap/include/mach/common.h 2009-05-10 22:04:41.000000000 +0200
2243 +++ linux-2.6.29-rc3.owrt/arch/arm/plat-omap/include/mach/common.h 2009-05-10 23:48:28.000000000 +0200
2244 @@ -35,7 +35,7 @@
2245 extern struct sys_timer omap_timer;
2246 extern void omap_serial_init(void);
2247 extern void omap_serial_enable_clocks(int enable);
2248 -#if defined(CONFIG_I2C_OMAP) || defined(CONFIG_I2C_OMAP_MODULE)
2249 +#ifdef CONFIG_I2C_OMAP
2250 extern int omap_register_i2c_bus(int bus_id, u32 clkrate,
2251 struct i2c_board_info const *info,
2252 unsigned len);
2253 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/plat-omap/include/mach/cpu.h linux-2.6.29-rc3.owrt/arch/arm/plat-omap/include/mach/cpu.h
2254 --- linux-2.6.29.owrt/arch/arm/plat-omap/include/mach/cpu.h 2009-05-10 22:04:41.000000000 +0200
2255 +++ linux-2.6.29-rc3.owrt/arch/arm/plat-omap/include/mach/cpu.h 2009-05-10 23:48:28.000000000 +0200
2256 @@ -339,7 +339,6 @@
2257 #define OMAP3430_REV_ES2_0 0x34301034
2258 #define OMAP3430_REV_ES2_1 0x34302034
2259 #define OMAP3430_REV_ES3_0 0x34303034
2260 -#define OMAP3430_REV_ES3_1 0x34304034
2261
2262 /*
2263 * omap_chip bits
2264 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/plat-omap/include/mach/mcbsp.h linux-2.6.29-rc3.owrt/arch/arm/plat-omap/include/mach/mcbsp.h
2265 --- linux-2.6.29.owrt/arch/arm/plat-omap/include/mach/mcbsp.h 2009-05-10 22:04:41.000000000 +0200
2266 +++ linux-2.6.29-rc3.owrt/arch/arm/plat-omap/include/mach/mcbsp.h 2009-05-10 23:48:28.000000000 +0200
2267 @@ -344,8 +344,7 @@
2268 u8 dma_rx_sync, dma_tx_sync;
2269 u16 rx_irq, tx_irq;
2270 struct omap_mcbsp_ops *ops;
2271 - char const **clk_names;
2272 - int num_clks;
2273 + char const *clk_name;
2274 };
2275
2276 struct omap_mcbsp {
2277 @@ -377,8 +376,7 @@
2278 /* Protect the field .free, while checking if the mcbsp is in use */
2279 spinlock_t lock;
2280 struct omap_mcbsp_platform_data *pdata;
2281 - struct clk **clks;
2282 - int num_clks;
2283 + struct clk *clk;
2284 };
2285 extern struct omap_mcbsp **mcbsp_ptr;
2286 extern int omap_mcbsp_count;
2287 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/plat-omap/include/mach/mmc.h linux-2.6.29-rc3.owrt/arch/arm/plat-omap/include/mach/mmc.h
2288 --- linux-2.6.29.owrt/arch/arm/plat-omap/include/mach/mmc.h 2009-05-10 22:04:41.000000000 +0200
2289 +++ linux-2.6.29-rc3.owrt/arch/arm/plat-omap/include/mach/mmc.h 2009-05-10 23:48:28.000000000 +0200
2290 @@ -115,9 +115,8 @@
2291 int nr_controllers);
2292 void omap2_init_mmc(struct omap_mmc_platform_data **mmc_data,
2293 int nr_controllers);
2294 -int omap_mmc_add(const char *name, int id, unsigned long base,
2295 - unsigned long size, unsigned int irq,
2296 - struct omap_mmc_platform_data *data);
2297 +int omap_mmc_add(int id, unsigned long base, unsigned long size,
2298 + unsigned int irq, struct omap_mmc_platform_data *data);
2299 #else
2300 static inline void omap1_init_mmc(struct omap_mmc_platform_data **mmc_data,
2301 int nr_controllers)
2302 @@ -127,9 +126,8 @@
2303 int nr_controllers)
2304 {
2305 }
2306 -static inline int omap_mmc_add(const char *name, int id, unsigned long base,
2307 - unsigned long size, unsigned int irq,
2308 - struct omap_mmc_platform_data *data)
2309 +static inline int omap_mmc_add(int id, unsigned long base, unsigned long size,
2310 + unsigned int irq, struct omap_mmc_platform_data *data)
2311 {
2312 return 0;
2313 }
2314 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/plat-omap/include/mach/pm.h linux-2.6.29-rc3.owrt/arch/arm/plat-omap/include/mach/pm.h
2315 --- linux-2.6.29.owrt/arch/arm/plat-omap/include/mach/pm.h 2009-05-10 22:04:41.000000000 +0200
2316 +++ linux-2.6.29-rc3.owrt/arch/arm/plat-omap/include/mach/pm.h 2009-05-10 23:48:28.000000000 +0200
2317 @@ -108,7 +108,7 @@
2318 !defined(CONFIG_ARCH_OMAP15XX) && \
2319 !defined(CONFIG_ARCH_OMAP16XX) && \
2320 !defined(CONFIG_ARCH_OMAP24XX)
2321 -#warning "Power management for this processor not implemented yet"
2322 +#error "Power management for this processor not implemented yet"
2323 #endif
2324
2325 #ifndef __ASSEMBLER__
2326 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/plat-omap/Makefile linux-2.6.29-rc3.owrt/arch/arm/plat-omap/Makefile
2327 --- linux-2.6.29.owrt/arch/arm/plat-omap/Makefile 2009-05-10 22:04:41.000000000 +0200
2328 +++ linux-2.6.29-rc3.owrt/arch/arm/plat-omap/Makefile 2009-05-10 23:48:28.000000000 +0200
2329 @@ -18,8 +18,7 @@
2330 obj-$(CONFIG_OMAP_DM_TIMER) += dmtimer.o
2331 obj-$(CONFIG_OMAP_DEBUG_DEVICES) += debug-devices.o
2332 obj-$(CONFIG_OMAP_DEBUG_LEDS) += debug-leds.o
2333 -i2c-omap-$(CONFIG_I2C_OMAP) := i2c.o
2334 -obj-y += $(i2c-omap-m) $(i2c-omap-y)
2335 +obj-$(CONFIG_I2C_OMAP) += i2c.o
2336
2337 # OMAP mailbox framework
2338 obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox.o
2339 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/plat-omap/mcbsp.c linux-2.6.29-rc3.owrt/arch/arm/plat-omap/mcbsp.c
2340 --- linux-2.6.29.owrt/arch/arm/plat-omap/mcbsp.c 2009-05-10 22:04:41.000000000 +0200
2341 +++ linux-2.6.29-rc3.owrt/arch/arm/plat-omap/mcbsp.c 2009-05-10 23:48:28.000000000 +0200
2342 @@ -214,7 +214,6 @@
2343 int omap_mcbsp_request(unsigned int id)
2344 {
2345 struct omap_mcbsp *mcbsp;
2346 - int i;
2347 int err;
2348
2349 if (!omap_mcbsp_check_valid_id(id)) {
2350 @@ -226,8 +225,7 @@
2351 if (mcbsp->pdata && mcbsp->pdata->ops && mcbsp->pdata->ops->request)
2352 mcbsp->pdata->ops->request(id);
2353
2354 - for (i = 0; i < mcbsp->num_clks; i++)
2355 - clk_enable(mcbsp->clks[i]);
2356 + clk_enable(mcbsp->clk);
2357
2358 spin_lock(&mcbsp->lock);
2359 if (!mcbsp->free) {
2360 @@ -278,7 +276,6 @@
2361 void omap_mcbsp_free(unsigned int id)
2362 {
2363 struct omap_mcbsp *mcbsp;
2364 - int i;
2365
2366 if (!omap_mcbsp_check_valid_id(id)) {
2367 printk(KERN_ERR "%s: Invalid id (%d)\n", __func__, id + 1);
2368 @@ -289,8 +286,7 @@
2369 if (mcbsp->pdata && mcbsp->pdata->ops && mcbsp->pdata->ops->free)
2370 mcbsp->pdata->ops->free(id);
2371
2372 - for (i = mcbsp->num_clks - 1; i >= 0; i--)
2373 - clk_disable(mcbsp->clks[i]);
2374 + clk_disable(mcbsp->clk);
2375
2376 spin_lock(&mcbsp->lock);
2377 if (mcbsp->free) {
2378 @@ -876,7 +872,6 @@
2379 struct omap_mcbsp_platform_data *pdata = pdev->dev.platform_data;
2380 struct omap_mcbsp *mcbsp;
2381 int id = pdev->id - 1;
2382 - int i;
2383 int ret = 0;
2384
2385 if (!pdata) {
2386 @@ -921,25 +916,14 @@
2387 mcbsp->dma_rx_sync = pdata->dma_rx_sync;
2388 mcbsp->dma_tx_sync = pdata->dma_tx_sync;
2389
2390 - if (pdata->num_clks) {
2391 - mcbsp->num_clks = pdata->num_clks;
2392 - mcbsp->clks = kzalloc(mcbsp->num_clks * sizeof(struct clk *),
2393 - GFP_KERNEL);
2394 - if (!mcbsp->clks) {
2395 - ret = -ENOMEM;
2396 - goto exit;
2397 - }
2398 - for (i = 0; i < mcbsp->num_clks; i++) {
2399 - mcbsp->clks[i] = clk_get(&pdev->dev, pdata->clk_names[i]);
2400 - if (IS_ERR(mcbsp->clks[i])) {
2401 - dev_err(&pdev->dev,
2402 - "Invalid %s configuration for McBSP%d.\n",
2403 - pdata->clk_names[i], mcbsp->id);
2404 - ret = PTR_ERR(mcbsp->clks[i]);
2405 - goto err_clk;
2406 - }
2407 - }
2408 -
2409 + if (pdata->clk_name)
2410 + mcbsp->clk = clk_get(&pdev->dev, pdata->clk_name);
2411 + if (IS_ERR(mcbsp->clk)) {
2412 + dev_err(&pdev->dev,
2413 + "Invalid clock configuration for McBSP%d.\n",
2414 + mcbsp->id);
2415 + ret = PTR_ERR(mcbsp->clk);
2416 + goto err_clk;
2417 }
2418
2419 mcbsp->pdata = pdata;
2420 @@ -948,9 +932,6 @@
2421 return 0;
2422
2423 err_clk:
2424 - while (i--)
2425 - clk_put(mcbsp->clks[i]);
2426 - kfree(mcbsp->clks);
2427 iounmap(mcbsp->io_base);
2428 err_ioremap:
2429 mcbsp->free = 0;
2430 @@ -961,7 +942,6 @@
2431 static int __devexit omap_mcbsp_remove(struct platform_device *pdev)
2432 {
2433 struct omap_mcbsp *mcbsp = platform_get_drvdata(pdev);
2434 - int i;
2435
2436 platform_set_drvdata(pdev, NULL);
2437 if (mcbsp) {
2438 @@ -970,18 +950,12 @@
2439 mcbsp->pdata->ops->free)
2440 mcbsp->pdata->ops->free(mcbsp->id);
2441
2442 - for (i = mcbsp->num_clks - 1; i >= 0; i--) {
2443 - clk_disable(mcbsp->clks[i]);
2444 - clk_put(mcbsp->clks[i]);
2445 - }
2446 + clk_disable(mcbsp->clk);
2447 + clk_put(mcbsp->clk);
2448
2449 iounmap(mcbsp->io_base);
2450
2451 - if (mcbsp->num_clks) {
2452 - kfree(mcbsp->clks);
2453 - mcbsp->clks = NULL;
2454 - mcbsp->num_clks = 0;
2455 - }
2456 + mcbsp->clk = NULL;
2457 mcbsp->free = 0;
2458 mcbsp->dev = NULL;
2459 }
2460 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/plat-orion/gpio.c linux-2.6.29-rc3.owrt/arch/arm/plat-orion/gpio.c
2461 --- linux-2.6.29.owrt/arch/arm/plat-orion/gpio.c 2009-05-10 22:04:41.000000000 +0200
2462 +++ linux-2.6.29-rc3.owrt/arch/arm/plat-orion/gpio.c 2009-05-10 23:48:28.000000000 +0200
2463 @@ -265,36 +265,51 @@
2464 * polarity LEVEL mask
2465 *
2466 ****************************************************************************/
2467 +static void gpio_irq_edge_ack(u32 irq)
2468 +{
2469 + int pin = irq_to_gpio(irq);
2470 +
2471 + writel(~(1 << (pin & 31)), GPIO_EDGE_CAUSE(pin));
2472 +}
2473
2474 -static void gpio_irq_ack(u32 irq)
2475 +static void gpio_irq_edge_mask(u32 irq)
2476 {
2477 - int type = irq_desc[irq].status & IRQ_TYPE_SENSE_MASK;
2478 - if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) {
2479 - int pin = irq_to_gpio(irq);
2480 - writel(~(1 << (pin & 31)), GPIO_EDGE_CAUSE(pin));
2481 - }
2482 + int pin = irq_to_gpio(irq);
2483 + u32 u;
2484 +
2485 + u = readl(GPIO_EDGE_MASK(pin));
2486 + u &= ~(1 << (pin & 31));
2487 + writel(u, GPIO_EDGE_MASK(pin));
2488 +}
2489 +
2490 +static void gpio_irq_edge_unmask(u32 irq)
2491 +{
2492 + int pin = irq_to_gpio(irq);
2493 + u32 u;
2494 +
2495 + u = readl(GPIO_EDGE_MASK(pin));
2496 + u |= 1 << (pin & 31);
2497 + writel(u, GPIO_EDGE_MASK(pin));
2498 }
2499
2500 -static void gpio_irq_mask(u32 irq)
2501 +static void gpio_irq_level_mask(u32 irq)
2502 {
2503 int pin = irq_to_gpio(irq);
2504 - int type = irq_desc[irq].status & IRQ_TYPE_SENSE_MASK;
2505 - u32 reg = (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) ?
2506 - GPIO_EDGE_MASK(pin) : GPIO_LEVEL_MASK(pin);
2507 - u32 u = readl(reg);
2508 + u32 u;
2509 +
2510 + u = readl(GPIO_LEVEL_MASK(pin));
2511 u &= ~(1 << (pin & 31));
2512 - writel(u, reg);
2513 + writel(u, GPIO_LEVEL_MASK(pin));
2514 }
2515
2516 -static void gpio_irq_unmask(u32 irq)
2517 +static void gpio_irq_level_unmask(u32 irq)
2518 {
2519 int pin = irq_to_gpio(irq);
2520 - int type = irq_desc[irq].status & IRQ_TYPE_SENSE_MASK;
2521 - u32 reg = (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) ?
2522 - GPIO_EDGE_MASK(pin) : GPIO_LEVEL_MASK(pin);
2523 - u32 u = readl(reg);
2524 + u32 u;
2525 +
2526 + u = readl(GPIO_LEVEL_MASK(pin));
2527 u |= 1 << (pin & 31);
2528 - writel(u, reg);
2529 + writel(u, GPIO_LEVEL_MASK(pin));
2530 }
2531
2532 static int gpio_irq_set_type(u32 irq, u32 type)
2533 @@ -316,9 +331,9 @@
2534 * Set edge/level type.
2535 */
2536 if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) {
2537 - desc->handle_irq = handle_edge_irq;
2538 + desc->chip = &orion_gpio_irq_edge_chip;
2539 } else if (type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) {
2540 - desc->handle_irq = handle_level_irq;
2541 + desc->chip = &orion_gpio_irq_level_chip;
2542 } else {
2543 printk(KERN_ERR "failed to set irq=%d (type=%d)\n", irq, type);
2544 return -EINVAL;
2545 @@ -356,11 +371,19 @@
2546 return 0;
2547 }
2548
2549 -struct irq_chip orion_gpio_irq_chip = {
2550 - .name = "orion_gpio",
2551 - .ack = gpio_irq_ack,
2552 - .mask = gpio_irq_mask,
2553 - .unmask = gpio_irq_unmask,
2554 +struct irq_chip orion_gpio_irq_edge_chip = {
2555 + .name = "orion_gpio_irq_edge",
2556 + .ack = gpio_irq_edge_ack,
2557 + .mask = gpio_irq_edge_mask,
2558 + .unmask = gpio_irq_edge_unmask,
2559 + .set_type = gpio_irq_set_type,
2560 +};
2561 +
2562 +struct irq_chip orion_gpio_irq_level_chip = {
2563 + .name = "orion_gpio_irq_level",
2564 + .mask = gpio_irq_level_mask,
2565 + .mask_ack = gpio_irq_level_mask,
2566 + .unmask = gpio_irq_level_unmask,
2567 .set_type = gpio_irq_set_type,
2568 };
2569
2570 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/plat-orion/include/plat/gpio.h linux-2.6.29-rc3.owrt/arch/arm/plat-orion/include/plat/gpio.h
2571 --- linux-2.6.29.owrt/arch/arm/plat-orion/include/plat/gpio.h 2009-05-10 22:04:41.000000000 +0200
2572 +++ linux-2.6.29-rc3.owrt/arch/arm/plat-orion/include/plat/gpio.h 2009-05-10 23:48:28.000000000 +0200
2573 @@ -31,7 +31,8 @@
2574 /*
2575 * GPIO interrupt handling.
2576 */
2577 -extern struct irq_chip orion_gpio_irq_chip;
2578 +extern struct irq_chip orion_gpio_irq_edge_chip;
2579 +extern struct irq_chip orion_gpio_irq_level_chip;
2580 void orion_gpio_irq_handler(int irqoff);
2581
2582
2583 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/plat-s3c64xx/clock.c linux-2.6.29-rc3.owrt/arch/arm/plat-s3c64xx/clock.c
2584 --- linux-2.6.29.owrt/arch/arm/plat-s3c64xx/clock.c 2009-05-10 22:04:41.000000000 +0200
2585 +++ linux-2.6.29-rc3.owrt/arch/arm/plat-s3c64xx/clock.c 2009-05-10 23:48:28.000000000 +0200
2586 @@ -248,7 +248,7 @@
2587 &clk_48m,
2588 };
2589
2590 -void __init s3c64xx_register_clocks(void)
2591 +void s3c64xx_register_clocks(void)
2592 {
2593 struct clk *clkp;
2594 int ret;
2595 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/plat-s3c64xx/gpiolib.c linux-2.6.29-rc3.owrt/arch/arm/plat-s3c64xx/gpiolib.c
2596 --- linux-2.6.29.owrt/arch/arm/plat-s3c64xx/gpiolib.c 2009-05-10 22:04:41.000000000 +0200
2597 +++ linux-2.6.29-rc3.owrt/arch/arm/plat-s3c64xx/gpiolib.c 2009-05-10 23:48:28.000000000 +0200
2598 @@ -417,4 +417,4 @@
2599 return 0;
2600 }
2601
2602 -core_initcall(s3c64xx_gpiolib_init);
2603 +arch_initcall(s3c64xx_gpiolib_init);
2604 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/plat-s3c64xx/include/plat/irqs.h linux-2.6.29-rc3.owrt/arch/arm/plat-s3c64xx/include/plat/irqs.h
2605 --- linux-2.6.29.owrt/arch/arm/plat-s3c64xx/include/plat/irqs.h 2009-05-10 22:04:41.000000000 +0200
2606 +++ linux-2.6.29-rc3.owrt/arch/arm/plat-s3c64xx/include/plat/irqs.h 2009-05-10 23:48:28.000000000 +0200
2607 @@ -117,7 +117,7 @@
2608 #define IRQ_ONENAND1 S3C64XX_IRQ_VIC1(12)
2609 #define IRQ_NFC S3C64XX_IRQ_VIC1(13)
2610 #define IRQ_CFCON S3C64XX_IRQ_VIC1(14)
2611 -#define IRQ_USBH S3C64XX_IRQ_VIC1(15)
2612 +#define IRQ_UHOST S3C64XX_IRQ_VIC1(15)
2613 #define IRQ_SPI0 S3C64XX_IRQ_VIC1(16)
2614 #define IRQ_SPI1 S3C64XX_IRQ_VIC1(17)
2615 #define IRQ_IIC S3C64XX_IRQ_VIC1(18)
2616 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/plat-s3c64xx/irq.c linux-2.6.29-rc3.owrt/arch/arm/plat-s3c64xx/irq.c
2617 --- linux-2.6.29.owrt/arch/arm/plat-s3c64xx/irq.c 2009-05-10 22:04:41.000000000 +0200
2618 +++ linux-2.6.29-rc3.owrt/arch/arm/plat-s3c64xx/irq.c 2009-05-10 23:48:28.000000000 +0200
2619 @@ -207,7 +207,7 @@
2620
2621 static void __init s3c64xx_uart_irq(struct uart_irq *uirq)
2622 {
2623 - void __iomem *reg_base = uirq->regs;
2624 + void *reg_base = uirq->regs;
2625 unsigned int irq;
2626 int offs;
2627
2628 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/plat-s3c64xx/irq-eint.c linux-2.6.29-rc3.owrt/arch/arm/plat-s3c64xx/irq-eint.c
2629 --- linux-2.6.29.owrt/arch/arm/plat-s3c64xx/irq-eint.c 2009-05-10 22:04:41.000000000 +0200
2630 +++ linux-2.6.29-rc3.owrt/arch/arm/plat-s3c64xx/irq-eint.c 2009-05-10 23:48:28.000000000 +0200
2631 @@ -14,15 +14,12 @@
2632
2633 #include <linux/kernel.h>
2634 #include <linux/interrupt.h>
2635 -#include <linux/gpio.h>
2636 #include <linux/irq.h>
2637 #include <linux/io.h>
2638
2639 #include <asm/hardware/vic.h>
2640
2641 #include <plat/regs-irqtype.h>
2642 -#include <plat/regs-gpio.h>
2643 -#include <plat/gpio-cfg.h>
2644
2645 #include <mach/map.h>
2646 #include <plat/cpu.h>
2647 @@ -58,7 +55,7 @@
2648 u32 mask;
2649
2650 mask = __raw_readl(S3C64XX_EINT0MASK);
2651 - mask &= ~eint_irq_to_bit(irq);
2652 + mask |= eint_irq_to_bit(irq);
2653 __raw_writel(mask, S3C64XX_EINT0MASK);
2654 }
2655
2656 @@ -77,7 +74,6 @@
2657 static int s3c_irq_eint_set_type(unsigned int irq, unsigned int type)
2658 {
2659 int offs = eint_offset(irq);
2660 - int pin;
2661 int shift;
2662 u32 ctrl, mask;
2663 u32 newvalue = 0;
2664 @@ -129,15 +125,6 @@
2665 ctrl |= newvalue << shift;
2666 __raw_writel(ctrl, reg);
2667
2668 - /* set the GPIO pin appropriately */
2669 -
2670 - if (offs < 23)
2671 - pin = S3C64XX_GPN(offs);
2672 - else
2673 - pin = S3C64XX_GPM(offs - 23);
2674 -
2675 - s3c_gpio_cfgpin(pin, S3C_GPIO_SFN(2));
2676 -
2677 return 0;
2678 }
2679
2680 @@ -194,7 +181,7 @@
2681 s3c_irq_demux_eint(20, 27);
2682 }
2683
2684 -static int __init s3c64xx_init_irq_eint(void)
2685 +int __init s3c64xx_init_irq_eint(void)
2686 {
2687 int irq;
2688
2689 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/plat-s3c64xx/s3c6400-clock.c linux-2.6.29-rc3.owrt/arch/arm/plat-s3c64xx/s3c6400-clock.c
2690 --- linux-2.6.29.owrt/arch/arm/plat-s3c64xx/s3c6400-clock.c 2009-05-10 22:04:41.000000000 +0200
2691 +++ linux-2.6.29-rc3.owrt/arch/arm/plat-s3c64xx/s3c6400-clock.c 2009-05-10 23:48:28.000000000 +0200
2692 @@ -36,7 +36,7 @@
2693 * ext_xtal_mux for want of an actual name from the manual.
2694 */
2695
2696 -static struct clk clk_ext_xtal_mux = {
2697 +struct clk clk_ext_xtal_mux = {
2698 .name = "ext_xtal",
2699 .id = -1,
2700 };
2701 @@ -63,7 +63,7 @@
2702 void __iomem *reg_divider;
2703 };
2704
2705 -static struct clk clk_fout_apll = {
2706 +struct clk clk_fout_apll = {
2707 .name = "fout_apll",
2708 .id = -1,
2709 };
2710 @@ -78,7 +78,7 @@
2711 .nr_sources = ARRAY_SIZE(clk_src_apll_list),
2712 };
2713
2714 -static struct clksrc_clk clk_mout_apll = {
2715 +struct clksrc_clk clk_mout_apll = {
2716 .clk = {
2717 .name = "mout_apll",
2718 .id = -1,
2719 @@ -88,7 +88,7 @@
2720 .sources = &clk_src_apll,
2721 };
2722
2723 -static struct clk clk_fout_epll = {
2724 +struct clk clk_fout_epll = {
2725 .name = "fout_epll",
2726 .id = -1,
2727 };
2728 @@ -103,7 +103,7 @@
2729 .nr_sources = ARRAY_SIZE(clk_src_epll_list),
2730 };
2731
2732 -static struct clksrc_clk clk_mout_epll = {
2733 +struct clksrc_clk clk_mout_epll = {
2734 .clk = {
2735 .name = "mout_epll",
2736 .id = -1,
2737 @@ -123,7 +123,7 @@
2738 .nr_sources = ARRAY_SIZE(clk_src_mpll_list),
2739 };
2740
2741 -static struct clksrc_clk clk_mout_mpll = {
2742 +struct clksrc_clk clk_mout_mpll = {
2743 .clk = {
2744 .name = "mout_mpll",
2745 .id = -1,
2746 @@ -145,7 +145,7 @@
2747 return rate;
2748 }
2749
2750 -static struct clk clk_dout_mpll = {
2751 +struct clk clk_dout_mpll = {
2752 .name = "dout_mpll",
2753 .id = -1,
2754 .parent = &clk_mout_mpll.clk,
2755 @@ -189,10 +189,10 @@
2756 };
2757
2758 static struct clk *clkset_uhost_list[] = {
2759 - &clk_48m,
2760 &clk_mout_epll.clk,
2761 &clk_dout_mpll,
2762 &clk_fin_epll,
2763 + &clk_48m,
2764 };
2765
2766 static struct clk_sources clkset_uhost = {
2767 @@ -239,12 +239,10 @@
2768
2769 rate = clk_round_rate(clk, rate);
2770 div = clk_get_rate(clk->parent) / rate;
2771 - if (div > 16)
2772 - return -EINVAL;
2773
2774 val = __raw_readl(reg);
2775 - val &= ~(0xf << sclk->shift);
2776 - val |= (div - 1) << sclk->shift;
2777 + val &= ~sclk->mask;
2778 + val |= (rate - 1) << sclk->shift;
2779 __raw_writel(val, reg);
2780
2781 return 0;
2782 @@ -353,7 +351,7 @@
2783
2784 static struct clksrc_clk clk_usbhost = {
2785 .clk = {
2786 - .name = "usb-bus-host",
2787 + .name = "usb-host-bus",
2788 .id = -1,
2789 .ctrlbit = S3C_CLKCON_SCLK_UHOST,
2790 .enable = s3c64xx_sclk_ctrl,
2791 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/arm/tools/mach-types linux-2.6.29-rc3.owrt/arch/arm/tools/mach-types
2792 --- linux-2.6.29.owrt/arch/arm/tools/mach-types 2009-05-10 22:04:41.000000000 +0200
2793 +++ linux-2.6.29-rc3.owrt/arch/arm/tools/mach-types 2009-05-10 23:48:28.000000000 +0200
2794 @@ -12,7 +12,7 @@
2795 #
2796 # http://www.arm.linux.org.uk/developer/machines/?action=new
2797 #
2798 -# Last update: Thu Mar 12 18:01:45 2009
2799 +# Last update: Sun Nov 30 16:39:36 2008
2800 #
2801 # machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number
2802 #
2803 @@ -1811,7 +1811,7 @@
2804 jade MACH_JADE JADE 1821
2805 ks8695_softplc MACH_KS8695_SOFTPLC KS8695_SOFTPLC 1822
2806 gprisc3 MACH_GPRISC3 GPRISC3 1823
2807 -stamp9g20 MACH_STAMP9G20 STAMP9G20 1824
2808 +stamp9260 MACH_STAMP9260 STAMP9260 1824
2809 smdk6430 MACH_SMDK6430 SMDK6430 1825
2810 smdkc100 MACH_SMDKC100 SMDKC100 1826
2811 tavorevb MACH_TAVOREVB TAVOREVB 1827
2812 @@ -1993,134 +1993,4 @@
2813 benzina MACH_BENZINA BENZINA 2003
2814 blaze MACH_BLAZE BLAZE 2004
2815 linkstation_ls_hgl MACH_LINKSTATION_LS_HGL LINKSTATION_LS_HGL 2005
2816 -htckovsky MACH_HTCVENUS HTCVENUS 2006
2817 -sony_prs505 MACH_SONY_PRS505 SONY_PRS505 2007
2818 -hanlin_v3 MACH_HANLIN_V3 HANLIN_V3 2008
2819 -sapphira MACH_SAPPHIRA SAPPHIRA 2009
2820 -dack_sda_01 MACH_DACK_SDA_01 DACK_SDA_01 2010
2821 -armbox MACH_ARMBOX ARMBOX 2011
2822 -harris_rvp MACH_HARRIS_RVP HARRIS_RVP 2012
2823 -ribaldo MACH_RIBALDO RIBALDO 2013
2824 -agora MACH_AGORA AGORA 2014
2825 -omap3_mini MACH_OMAP3_MINI OMAP3_MINI 2015
2826 -a9sam6432_b MACH_A9SAM6432_B A9SAM6432_B 2016
2827 -usg2410 MACH_USG2410 USG2410 2017
2828 -pc72052_i10_revb MACH_PC72052_I10_REVB PC72052_I10_REVB 2018
2829 -mx35_exm32 MACH_MX35_EXM32 MX35_EXM32 2019
2830 -topas910 MACH_TOPAS910 TOPAS910 2020
2831 -hyena MACH_HYENA HYENA 2021
2832 -pospax MACH_POSPAX POSPAX 2022
2833 -hdl_gx MACH_HDL_GX HDL_GX 2023
2834 -ctera_4bay MACH_CTERA_4BAY CTERA_4BAY 2024
2835 -ctera_plug_c MACH_CTERA_PLUG_C CTERA_PLUG_C 2025
2836 -crwea_plug_i MACH_CRWEA_PLUG_I CRWEA_PLUG_I 2026
2837 -egauge2 MACH_EGAUGE2 EGAUGE2 2027
2838 -didj MACH_DIDJ DIDJ 2028
2839 -m_s3c2443 MACH_MEISTER MEISTER 2029
2840 -htcblackstone MACH_HTCBLACKSTONE HTCBLACKSTONE 2030
2841 -cpuat9g20 MACH_CPUAT9G20 CPUAT9G20 2031
2842 -smdk6440 MACH_SMDK6440 SMDK6440 2032
2843 -omap_35xx_mvp MACH_OMAP_35XX_MVP OMAP_35XX_MVP 2033
2844 -ctera_plug_i MACH_CTERA_PLUG_I CTERA_PLUG_I 2034
2845 -pvg610_100 MACH_PVG610 PVG610 2035
2846 -hprw6815 MACH_HPRW6815 HPRW6815 2036
2847 -omap3_oswald MACH_OMAP3_OSWALD OMAP3_OSWALD 2037
2848 -nas4220b MACH_NAS4220B NAS4220B 2038
2849 -htcraphael_cdma MACH_HTCRAPHAEL_CDMA HTCRAPHAEL_CDMA 2039
2850 -htcdiamond_cdma MACH_HTCDIAMOND_CDMA HTCDIAMOND_CDMA 2040
2851 -scaler MACH_SCALER SCALER 2041
2852 -zylonite2 MACH_ZYLONITE2 ZYLONITE2 2042
2853 -aspenite MACH_ASPENITE ASPENITE 2043
2854 -teton MACH_TETON TETON 2044
2855 -ttc_dkb MACH_TTC_DKB TTC_DKB 2045
2856 -bishop2 MACH_BISHOP2 BISHOP2 2046
2857 -ippv5 MACH_IPPV5 IPPV5 2047
2858 -farm926 MACH_FARM926 FARM926 2048
2859 -mmccpu MACH_MMCCPU MMCCPU 2049
2860 -sgmsfl MACH_SGMSFL SGMSFL 2050
2861 -tt8000 MACH_TT8000 TT8000 2051
2862 -zrn4300lp MACH_ZRN4300LP ZRN4300LP 2052
2863 -mptc MACH_MPTC MPTC 2053
2864 -h6051 MACH_H6051 H6051 2054
2865 -pvg610_101 MACH_PVG610_101 PVG610_101 2055
2866 -stamp9261_pc_evb MACH_STAMP9261_PC_EVB STAMP9261_PC_EVB 2056
2867 -pelco_odysseus MACH_PELCO_ODYSSEUS PELCO_ODYSSEUS 2057
2868 -tny_a9260 MACH_TNY_A9260 TNY_A9260 2058
2869 -tny_a9g20 MACH_TNY_A9G20 TNY_A9G20 2059
2870 -aesop_mp2530f MACH_AESOP_MP2530F AESOP_MP2530F 2060
2871 -dx900 MACH_DX900 DX900 2061
2872 -cpodc2 MACH_CPODC2 CPODC2 2062
2873 -tilt_8925 MACH_TILT_8925 TILT_8925 2063
2874 -davinci_dm357_evm MACH_DAVINCI_DM357_EVM DAVINCI_DM357_EVM 2064
2875 -swordfish MACH_SWORDFISH SWORDFISH 2065
2876 -corvus MACH_CORVUS CORVUS 2066
2877 -taurus MACH_TAURUS TAURUS 2067
2878 -axm MACH_AXM AXM 2068
2879 -axc MACH_AXC AXC 2069
2880 -baby MACH_BABY BABY 2070
2881 -mp200 MACH_MP200 MP200 2071
2882 -pcm043 MACH_PCM043 PCM043 2072
2883 -hanlin_v3c MACH_HANLIN_V3C HANLIN_V3C 2073
2884 -kbk9g20 MACH_KBK9G20 KBK9G20 2074
2885 -adsturbog5 MACH_ADSTURBOG5 ADSTURBOG5 2075
2886 -avenger_lite1 MACH_AVENGER_LITE1 AVENGER_LITE1 2076
2887 -suc82x MACH_SUC SUC 2077
2888 -at91sam7s256 MACH_AT91SAM7S256 AT91SAM7S256 2078
2889 -mendoza MACH_MENDOZA MENDOZA 2079
2890 -kira MACH_KIRA KIRA 2080
2891 -mx1hbm MACH_MX1HBM MX1HBM 2081
2892 -quatro43xx MACH_QUATRO43XX QUATRO43XX 2082
2893 -quatro4230 MACH_QUATRO4230 QUATRO4230 2083
2894 -nsb400 MACH_NSB400 NSB400 2084
2895 -drp255 MACH_DRP255 DRP255 2085
2896 -thoth MACH_THOTH THOTH 2086
2897 -firestone MACH_FIRESTONE FIRESTONE 2087
2898 -asusp750 MACH_ASUSP750 ASUSP750 2088
2899 -ctera_dl MACH_CTERA_DL CTERA_DL 2089
2900 -socr MACH_SOCR SOCR 2090
2901 -htcoxygen MACH_HTCOXYGEN HTCOXYGEN 2091
2902 -heroc MACH_HEROC HEROC 2092
2903 -zeno6800 MACH_ZENO6800 ZENO6800 2093
2904 -sc2mcs MACH_SC2MCS SC2MCS 2094
2905 -gene100 MACH_GENE100 GENE100 2095
2906 -as353x MACH_AS353X AS353X 2096
2907 -sheevaplug MACH_SHEEVAPLUG SHEEVAPLUG 2097
2908 -at91sam9g20 MACH_AT91SAM9G20 AT91SAM9G20 2098
2909 -mv88f6192gtw_fe MACH_MV88F6192GTW_FE MV88F6192GTW_FE 2099
2910 -cc9200 MACH_CC9200 CC9200 2100
2911 -sm9200 MACH_SM9200 SM9200 2101
2912 -tp9200 MACH_TP9200 TP9200 2102
2913 -snapperdv MACH_SNAPPERDV SNAPPERDV 2103
2914 -avengers_lite MACH_AVENGERS_LITE AVENGERS_LITE 2104
2915 -avengers_lite1 MACH_AVENGERS_LITE1 AVENGERS_LITE1 2105
2916 -omap3axon MACH_OMAP3AXON OMAP3AXON 2106
2917 -ma8xx MACH_MA8XX MA8XX 2107
2918 -mp201ek MACH_MP201EK MP201EK 2108
2919 -davinci_tux MACH_DAVINCI_TUX DAVINCI_TUX 2109
2920 -mpa1600 MACH_MPA1600 MPA1600 2110
2921 -pelco_troy MACH_PELCO_TROY PELCO_TROY 2111
2922 -nsb667 MACH_NSB667 NSB667 2112
2923 -rovers5_4mpix MACH_ROVERS5_4MPIX ROVERS5_4MPIX 2113
2924 -twocom MACH_TWOCOM TWOCOM 2114
2925 -ubisys_p9_rcu3r2 MACH_UBISYS_P9_RCU3R2 UBISYS_P9_RCU3R2 2115
2926 -hero_espresso MACH_HERO_ESPRESSO HERO_ESPRESSO 2116
2927 -afeusb MACH_AFEUSB AFEUSB 2117
2928 -t830 MACH_T830 T830 2118
2929 -spd8020_cc MACH_SPD8020_CC SPD8020_CC 2119
2930 -om_3d7k MACH_OM_3D7K OM_3D7K 2120
2931 -picocom2 MACH_PICOCOM2 PICOCOM2 2121
2932 -uwg4mx27 MACH_UWG4MX27 UWG4MX27 2122
2933 -uwg4mx31 MACH_UWG4MX31 UWG4MX31 2123
2934 -cherry MACH_CHERRY CHERRY 2124
2935 -mx51_babbage MACH_MX51_BABBAGE MX51_BABBAGE 2125
2936 -s3c2440turkiye MACH_S3C2440TURKIYE S3C2440TURKIYE 2126
2937 -tx37 MACH_TX37 TX37 2127
2938 -sbc2800_9g20 MACH_SBC2800_9G20 SBC2800_9G20 2128
2939 -benzglb MACH_BENZGLB BENZGLB 2129
2940 -benztd MACH_BENZTD BENZTD 2130
2941 -cartesio_plus MACH_CARTESIO_PLUS CARTESIO_PLUS 2131
2942 -solrad_g20 MACH_SOLRAD_G20 SOLRAD_G20 2132
2943 -mx27wallace MACH_MX27WALLACE MX27WALLACE 2133
2944 -fmzwebmodul MACH_FMZWEBMODUL FMZWEBMODUL 2134
2945 -rd78x00_masa MACH_RD78X00_MASA RD78X00_MASA 2135
2946 -smallogger MACH_SMALLOGGER SMALLOGGER 2136
2947 +htcvenus MACH_HTCVENUS HTCVENUS 2006
2948 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/avr32/mach-at32ap/include/mach/board.h linux-2.6.29-rc3.owrt/arch/avr32/mach-at32ap/include/mach/board.h
2949 --- linux-2.6.29.owrt/arch/avr32/mach-at32ap/include/mach/board.h 2009-05-10 22:04:40.000000000 +0200
2950 +++ linux-2.6.29-rc3.owrt/arch/avr32/mach-at32ap/include/mach/board.h 2009-05-10 23:48:28.000000000 +0200
2951 @@ -116,7 +116,6 @@
2952 int enable_pin; /* chip enable */
2953 int det_pin; /* card detect */
2954 int rdy_pin; /* ready/busy */
2955 - u8 rdy_pin_active_low; /* rdy_pin value is inverted */
2956 u8 ale; /* address line number connected to ALE */
2957 u8 cle; /* address line number connected to CLE */
2958 u8 bus_width_16; /* buswidth is 16 bit */
2959 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/include/asm/bfin_sport.h linux-2.6.29-rc3.owrt/arch/blackfin/include/asm/bfin_sport.h
2960 --- linux-2.6.29.owrt/arch/blackfin/include/asm/bfin_sport.h 2009-05-10 22:04:40.000000000 +0200
2961 +++ linux-2.6.29-rc3.owrt/arch/blackfin/include/asm/bfin_sport.h 2009-05-10 23:48:28.000000000 +0200
2962 @@ -1,9 +1,30 @@
2963 /*
2964 - * bfin_sport.h - userspace header for bfin sport driver
2965 + * File: include/asm-blackfin/bfin_sport.h
2966 + * Based on:
2967 + * Author: Roy Huang (roy.huang@analog.com)
2968 *
2969 - * Copyright 2004-2008 Analog Devices Inc.
2970 + * Created: Thu Aug. 24 2006
2971 + * Description:
2972 *
2973 - * Licensed under the GPL-2 or later.
2974 + * Modified:
2975 + * Copyright 2004-2006 Analog Devices Inc.
2976 + *
2977 + * Bugs: Enter bugs at http://blackfin.uclinux.org/
2978 + *
2979 + * This program is free software; you can redistribute it and/or modify
2980 + * it under the terms of the GNU General Public License as published by
2981 + * the Free Software Foundation; either version 2 of the License, or
2982 + * (at your option) any later version.
2983 + *
2984 + * This program is distributed in the hope that it will be useful,
2985 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2986 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2987 + * GNU General Public License for more details.
2988 + *
2989 + * You should have received a copy of the GNU General Public License
2990 + * along with this program; if not, see the file COPYING, or write
2991 + * to the Free Software Foundation, Inc.,
2992 + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2993 */
2994
2995 #ifndef __BFIN_SPORT_H__
2996 @@ -21,10 +42,11 @@
2997 #define NORM_FORMAT 0x0
2998 #define ALAW_FORMAT 0x2
2999 #define ULAW_FORMAT 0x3
3000 +struct sport_register;
3001
3002 /* Function driver which use sport must initialize the structure */
3003 struct sport_config {
3004 - /* TDM (multichannels), I2S or other mode */
3005 + /*TDM (multichannels), I2S or other mode */
3006 unsigned int mode:3;
3007
3008 /* if TDM mode is selected, channels must be set */
3009 @@ -50,18 +72,12 @@
3010 int serial_clk;
3011 int fsync_clk;
3012
3013 - unsigned int data_format:2; /* Normal, u-law or a-law */
3014 + unsigned int data_format:2; /*Normal, u-law or a-law */
3015
3016 int word_len; /* How length of the word in bits, 3-32 bits */
3017 int dma_enabled;
3018 };
3019
3020 -/* Userspace interface */
3021 -#define SPORT_IOC_MAGIC 'P'
3022 -#define SPORT_IOC_CONFIG _IOWR('P', 0x01, struct sport_config)
3023 -
3024 -#ifdef __KERNEL__
3025 -
3026 struct sport_register {
3027 unsigned short tcr1;
3028 unsigned short reserved0;
3029 @@ -101,6 +117,9 @@
3030 unsigned long mrcs3;
3031 };
3032
3033 +#define SPORT_IOC_MAGIC 'P'
3034 +#define SPORT_IOC_CONFIG _IOWR('P', 0x01, struct sport_config)
3035 +
3036 struct sport_dev {
3037 struct cdev cdev; /* Char device structure */
3038
3039 @@ -130,8 +149,6 @@
3040 struct sport_config config;
3041 };
3042
3043 -#endif
3044 -
3045 #define SPORT_TCR1 0
3046 #define SPORT_TCR2 1
3047 #define SPORT_TCLKDIV 2
3048 @@ -152,4 +169,4 @@
3049 #define SPORT_MRCS2 22
3050 #define SPORT_MRCS3 23
3051
3052 -#endif
3053 +#endif /*__BFIN_SPORT_H__*/
3054 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/include/asm/checksum.h linux-2.6.29-rc3.owrt/arch/blackfin/include/asm/checksum.h
3055 --- linux-2.6.29.owrt/arch/blackfin/include/asm/checksum.h 2009-05-10 22:04:40.000000000 +0200
3056 +++ linux-2.6.29-rc3.owrt/arch/blackfin/include/asm/checksum.h 2009-05-10 23:48:28.000000000 +0200
3057 @@ -63,23 +63,23 @@
3058 csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
3059 unsigned short proto, __wsum sum)
3060 {
3061 - unsigned int carry;
3062
3063 - __asm__ ("%0 = %0 + %2;\n\t"
3064 - "CC = AC0;\n\t"
3065 - "%1 = CC;\n\t"
3066 - "%0 = %0 + %1;\n\t"
3067 - "%0 = %0 + %3;\n\t"
3068 - "CC = AC0;\n\t"
3069 - "%1 = CC;\n\t"
3070 - "%0 = %0 + %1;\n\t"
3071 - "%0 = %0 + %4;\n\t"
3072 - "CC = AC0;\n\t"
3073 - "%1 = CC;\n\t"
3074 - "%0 = %0 + %1;\n\t"
3075 - : "=d" (sum), "=&d" (carry)
3076 - : "d" (daddr), "d" (saddr), "d" ((len + proto) << 8), "0"(sum)
3077 - : "CC");
3078 + __asm__ ("%0 = %0 + %1;\n\t"
3079 + "CC = AC0;\n\t"
3080 + "if !CC jump 4;\n\t"
3081 + "%0 = %0 + %4;\n\t"
3082 + "%0 = %0 + %2;\n\t"
3083 + "CC = AC0;\n\t"
3084 + "if !CC jump 4;\n\t"
3085 + "%0 = %0 + %4;\n\t"
3086 + "%0 = %0 + %3;\n\t"
3087 + "CC = AC0;\n\t"
3088 + "if !CC jump 4;\n\t"
3089 + "%0 = %0 + %4;\n\t"
3090 + "NOP;\n\t"
3091 + : "=d" (sum)
3092 + : "d" (daddr), "d" (saddr), "d" ((ntohs(len)<<16)+proto*256), "d" (1), "0"(sum)
3093 + : "CC");
3094
3095 return (sum);
3096 }
3097 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/include/asm/delay.h linux-2.6.29-rc3.owrt/arch/blackfin/include/asm/delay.h
3098 --- linux-2.6.29.owrt/arch/blackfin/include/asm/delay.h 2009-05-10 22:04:40.000000000 +0200
3099 +++ linux-2.6.29-rc3.owrt/arch/blackfin/include/asm/delay.h 2009-05-10 23:48:28.000000000 +0200
3100 @@ -13,7 +13,29 @@
3101
3102 static inline void __delay(unsigned long loops)
3103 {
3104 -__asm__ __volatile__ (
3105 + if (ANOMALY_05000312) {
3106 + /* Interrupted loads to loop registers -> bad */
3107 + unsigned long tmp;
3108 + __asm__ __volatile__(
3109 + "[--SP] = LC0;"
3110 + "[--SP] = LT0;"
3111 + "[--SP] = LB0;"
3112 + "LSETUP (1f,1f) LC0 = %1;"
3113 + "1: NOP;"
3114 + /* We take advantage of the fact that LC0 is 0 at
3115 + * the end of the loop. Otherwise we'd need some
3116 + * NOPs after the CLI here.
3117 + */
3118 + "CLI %0;"
3119 + "LB0 = [SP++];"
3120 + "LT0 = [SP++];"
3121 + "LC0 = [SP++];"
3122 + "STI %0;"
3123 + : "=d" (tmp)
3124 + : "a" (loops)
3125 + );
3126 + } else
3127 + __asm__ __volatile__ (
3128 "LSETUP(1f, 1f) LC0 = %0;"
3129 "1: NOP;"
3130 :
3131 @@ -25,15 +47,16 @@
3132 #include <linux/param.h> /* needed for HZ */
3133
3134 /*
3135 - * close approximation borrowed from m68knommu to avoid 64-bit math
3136 + * Use only for very small delays ( < 1 msec). Should probably use a
3137 + * lookup table, really, as the multiplications take much too long with
3138 + * short delays. This is a "reasonable" implementation, though (and the
3139 + * first constant multiplications gets optimized away if the delay is
3140 + * a constant)
3141 */
3142 -
3143 -#define HZSCALE (268435456 / (1000000/HZ))
3144 -
3145 static inline void udelay(unsigned long usecs)
3146 {
3147 extern unsigned long loops_per_jiffy;
3148 - __delay((((usecs * HZSCALE) >> 11) * (loops_per_jiffy >> 11)) >> 6);
3149 + __delay(usecs * loops_per_jiffy / (1000000 / HZ));
3150 }
3151
3152 #endif
3153 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/include/asm/gpio.h linux-2.6.29-rc3.owrt/arch/blackfin/include/asm/gpio.h
3154 --- linux-2.6.29.owrt/arch/blackfin/include/asm/gpio.h 2009-05-10 22:04:40.000000000 +0200
3155 +++ linux-2.6.29-rc3.owrt/arch/blackfin/include/asm/gpio.h 2009-05-10 23:48:28.000000000 +0200
3156 @@ -27,6 +27,60 @@
3157 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
3158 */
3159
3160 +/*
3161 +* Number BF537/6/4 BF561 BF533/2/1
3162 +* BF527/5/2
3163 +*
3164 +* GPIO_0 PF0 PF0 PF0
3165 +* GPIO_1 PF1 PF1 PF1
3166 +* GPIO_2 PF2 PF2 PF2
3167 +* GPIO_3 PF3 PF3 PF3
3168 +* GPIO_4 PF4 PF4 PF4
3169 +* GPIO_5 PF5 PF5 PF5
3170 +* GPIO_6 PF6 PF6 PF6
3171 +* GPIO_7 PF7 PF7 PF7
3172 +* GPIO_8 PF8 PF8 PF8
3173 +* GPIO_9 PF9 PF9 PF9
3174 +* GPIO_10 PF10 PF10 PF10
3175 +* GPIO_11 PF11 PF11 PF11
3176 +* GPIO_12 PF12 PF12 PF12
3177 +* GPIO_13 PF13 PF13 PF13
3178 +* GPIO_14 PF14 PF14 PF14
3179 +* GPIO_15 PF15 PF15 PF15
3180 +* GPIO_16 PG0 PF16
3181 +* GPIO_17 PG1 PF17
3182 +* GPIO_18 PG2 PF18
3183 +* GPIO_19 PG3 PF19
3184 +* GPIO_20 PG4 PF20
3185 +* GPIO_21 PG5 PF21
3186 +* GPIO_22 PG6 PF22
3187 +* GPIO_23 PG7 PF23
3188 +* GPIO_24 PG8 PF24
3189 +* GPIO_25 PG9 PF25
3190 +* GPIO_26 PG10 PF26
3191 +* GPIO_27 PG11 PF27
3192 +* GPIO_28 PG12 PF28
3193 +* GPIO_29 PG13 PF29
3194 +* GPIO_30 PG14 PF30
3195 +* GPIO_31 PG15 PF31
3196 +* GPIO_32 PH0 PF32
3197 +* GPIO_33 PH1 PF33
3198 +* GPIO_34 PH2 PF34
3199 +* GPIO_35 PH3 PF35
3200 +* GPIO_36 PH4 PF36
3201 +* GPIO_37 PH5 PF37
3202 +* GPIO_38 PH6 PF38
3203 +* GPIO_39 PH7 PF39
3204 +* GPIO_40 PH8 PF40
3205 +* GPIO_41 PH9 PF41
3206 +* GPIO_42 PH10 PF42
3207 +* GPIO_43 PH11 PF43
3208 +* GPIO_44 PH12 PF44
3209 +* GPIO_45 PH13 PF45
3210 +* GPIO_46 PH14 PF46
3211 +* GPIO_47 PH15 PF47
3212 +*/
3213 +
3214 #ifndef __ARCH_BLACKFIN_GPIO_H__
3215 #define __ARCH_BLACKFIN_GPIO_H__
3216
3217 @@ -241,6 +295,10 @@
3218 int bfin_gpio_get_value(unsigned gpio);
3219 void bfin_gpio_set_value(unsigned gpio, int value);
3220
3221 +#ifndef BF548_FAMILY
3222 +#define bfin_gpio_set_value(gpio, value) set_gpio_data(gpio, value)
3223 +#endif
3224 +
3225 #ifdef CONFIG_GPIOLIB
3226 #include <asm-generic/gpio.h> /* cansleep wrappers */
3227
3228 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/include/asm/ipipe_base.h linux-2.6.29-rc3.owrt/arch/blackfin/include/asm/ipipe_base.h
3229 --- linux-2.6.29.owrt/arch/blackfin/include/asm/ipipe_base.h 2009-05-10 22:04:40.000000000 +0200
3230 +++ linux-2.6.29-rc3.owrt/arch/blackfin/include/asm/ipipe_base.h 2009-05-10 23:48:28.000000000 +0200
3231 @@ -1,5 +1,5 @@
3232 /* -*- linux-c -*-
3233 - * include/asm-blackfin/ipipe_base.h
3234 + * include/asm-blackfin/_baseipipe.h
3235 *
3236 * Copyright (C) 2007 Philippe Gerum.
3237 *
3238 @@ -27,9 +27,8 @@
3239 #define IPIPE_NR_XIRQS NR_IRQS
3240 #define IPIPE_IRQ_ISHIFT 5 /* 2^5 for 32bits arch. */
3241
3242 -/* Blackfin-specific, per-cpu pipeline status */
3243 -#define IPIPE_SYNCDEFER_FLAG 15
3244 -#define IPIPE_SYNCDEFER_MASK (1L << IPIPE_SYNCDEFER_MASK)
3245 +/* Blackfin-specific, global domain flags */
3246 +#define IPIPE_ROOTLOCK_FLAG 1 /* Lock pipeline for root */
3247
3248 /* Blackfin traps -- i.e. exception vector numbers */
3249 #define IPIPE_NR_FAULTS 52 /* We leave a gap after VEC_ILL_RES. */
3250 @@ -49,6 +48,11 @@
3251
3252 #ifndef __ASSEMBLY__
3253
3254 +#include <linux/bitops.h>
3255 +
3256 +extern int test_bit(int nr, const void *addr);
3257 +
3258 +
3259 extern unsigned long __ipipe_root_status; /* Alias to ipipe_root_cpudom_var(status) */
3260
3261 static inline void __ipipe_stall_root(void)
3262 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/include/asm/ipipe.h linux-2.6.29-rc3.owrt/arch/blackfin/include/asm/ipipe.h
3263 --- linux-2.6.29.owrt/arch/blackfin/include/asm/ipipe.h 2009-05-10 22:04:40.000000000 +0200
3264 +++ linux-2.6.29-rc3.owrt/arch/blackfin/include/asm/ipipe.h 2009-05-10 23:48:28.000000000 +0200
3265 @@ -35,9 +35,9 @@
3266 #include <asm/atomic.h>
3267 #include <asm/traps.h>
3268
3269 -#define IPIPE_ARCH_STRING "1.9-00"
3270 +#define IPIPE_ARCH_STRING "1.8-00"
3271 #define IPIPE_MAJOR_NUMBER 1
3272 -#define IPIPE_MINOR_NUMBER 9
3273 +#define IPIPE_MINOR_NUMBER 8
3274 #define IPIPE_PATCH_NUMBER 0
3275
3276 #ifdef CONFIG_SMP
3277 @@ -83,9 +83,9 @@
3278 "%2 = CYCLES2\n" \
3279 "CC = %2 == %0\n" \
3280 "if ! CC jump 1b\n" \
3281 - : "=d,a" (((unsigned long *)&t)[1]), \
3282 - "=d,a" (((unsigned long *)&t)[0]), \
3283 - "=d,a" (__cy2) \
3284 + : "=r" (((unsigned long *)&t)[1]), \
3285 + "=r" (((unsigned long *)&t)[0]), \
3286 + "=r" (__cy2) \
3287 : /*no input*/ : "CC"); \
3288 t; \
3289 })
3290 @@ -118,40 +118,35 @@
3291
3292 #define __ipipe_disable_irq(irq) (irq_desc[irq].chip->mask(irq))
3293
3294 -static inline int __ipipe_check_tickdev(const char *devname)
3295 -{
3296 - return 1;
3297 -}
3298 +#define __ipipe_lock_root() \
3299 + set_bit(IPIPE_ROOTLOCK_FLAG, &ipipe_root_domain->flags)
3300
3301 -static inline void __ipipe_lock_root(void)
3302 -{
3303 - set_bit(IPIPE_SYNCDEFER_FLAG, &ipipe_root_cpudom_var(status));
3304 -}
3305 -
3306 -static inline void __ipipe_unlock_root(void)
3307 -{
3308 - clear_bit(IPIPE_SYNCDEFER_FLAG, &ipipe_root_cpudom_var(status));
3309 -}
3310 +#define __ipipe_unlock_root() \
3311 + clear_bit(IPIPE_ROOTLOCK_FLAG, &ipipe_root_domain->flags)
3312
3313 void __ipipe_enable_pipeline(void);
3314
3315 #define __ipipe_hook_critical_ipi(ipd) do { } while (0)
3316
3317 -#define __ipipe_sync_pipeline ___ipipe_sync_pipeline
3318 -void ___ipipe_sync_pipeline(unsigned long syncmask);
3319 +#define __ipipe_sync_pipeline(syncmask) \
3320 + do { \
3321 + struct ipipe_domain *ipd = ipipe_current_domain; \
3322 + if (likely(ipd != ipipe_root_domain || !test_bit(IPIPE_ROOTLOCK_FLAG, &ipd->flags))) \
3323 + __ipipe_sync_stage(syncmask); \
3324 + } while (0)
3325
3326 void __ipipe_handle_irq(unsigned irq, struct pt_regs *regs);
3327
3328 int __ipipe_get_irq_priority(unsigned irq);
3329
3330 +int __ipipe_get_irqthread_priority(unsigned irq);
3331 +
3332 void __ipipe_stall_root_raw(void);
3333
3334 void __ipipe_unstall_root_raw(void);
3335
3336 void __ipipe_serial_debug(const char *fmt, ...);
3337
3338 -asmlinkage void __ipipe_call_irqtail(unsigned long addr);
3339 -
3340 DECLARE_PER_CPU(struct pt_regs, __ipipe_tick_regs);
3341
3342 extern unsigned long __ipipe_core_clock;
3343 @@ -167,25 +162,42 @@
3344
3345 #define __ipipe_run_irqtail() /* Must be a macro */ \
3346 do { \
3347 + asmlinkage void __ipipe_call_irqtail(void); \
3348 unsigned long __pending; \
3349 - CSYNC(); \
3350 + CSYNC(); \
3351 __pending = bfin_read_IPEND(); \
3352 if (__pending & 0x8000) { \
3353 __pending &= ~0x8010; \
3354 if (__pending && (__pending & (__pending - 1)) == 0) \
3355 - __ipipe_call_irqtail(__ipipe_irq_tail_hook); \
3356 + __ipipe_call_irqtail(); \
3357 } \
3358 } while (0)
3359
3360 #define __ipipe_run_isr(ipd, irq) \
3361 do { \
3362 if (ipd == ipipe_root_domain) { \
3363 - local_irq_enable_hw(); \
3364 - if (ipipe_virtual_irq_p(irq)) \
3365 + /* \
3366 + * Note: the I-pipe implements a threaded interrupt model on \
3367 + * this arch for Linux external IRQs. The interrupt handler we \
3368 + * call here only wakes up the associated IRQ thread. \
3369 + */ \
3370 + if (ipipe_virtual_irq_p(irq)) { \
3371 + /* No irqtail here; virtual interrupts have no effect \
3372 + on IPEND so there is no need for processing \
3373 + deferral. */ \
3374 + local_irq_enable_nohead(ipd); \
3375 ipd->irqs[irq].handler(irq, ipd->irqs[irq].cookie); \
3376 - else \
3377 + local_irq_disable_nohead(ipd); \
3378 + } else \
3379 + /* \
3380 + * No need to run the irqtail here either; \
3381 + * we can't be preempted by hw IRQs, so \
3382 + * non-Linux IRQs cannot stack over the short \
3383 + * thread wakeup code. Which in turn means \
3384 + * that no irqtail condition could be pending \
3385 + * for domains above Linux in the pipeline. \
3386 + */ \
3387 ipd->irqs[irq].handler(irq, &__raw_get_cpu_var(__ipipe_tick_regs)); \
3388 - local_irq_disable_hw(); \
3389 } else { \
3390 __clear_bit(IPIPE_SYNC_FLAG, &ipipe_cpudom_var(ipd, status)); \
3391 local_irq_enable_nohead(ipd); \
3392 @@ -205,24 +217,42 @@
3393
3394 int ipipe_start_irq_thread(unsigned irq, struct irq_desc *desc);
3395
3396 -#ifdef CONFIG_GENERIC_CLOCKEVENTS
3397 -#define IRQ_SYSTMR IRQ_CORETMR
3398 -#define IRQ_PRIOTMR IRQ_CORETMR
3399 -#else
3400 +#define IS_SYSIRQ(irq) ((irq) > IRQ_CORETMR && (irq) <= SYS_IRQS)
3401 +#define IS_GPIOIRQ(irq) ((irq) >= GPIO_IRQ_BASE && (irq) < NR_IRQS)
3402 +
3403 #define IRQ_SYSTMR IRQ_TIMER0
3404 #define IRQ_PRIOTMR CONFIG_IRQ_TIMER0
3405 -#endif
3406
3407 -#ifdef CONFIG_BF561
3408 +#if defined(CONFIG_BF531) || defined(CONFIG_BF532) || defined(CONFIG_BF533)
3409 +#define PRIO_GPIODEMUX(irq) CONFIG_PFA
3410 +#elif defined(CONFIG_BF534) || defined(CONFIG_BF536) || defined(CONFIG_BF537)
3411 +#define PRIO_GPIODEMUX(irq) CONFIG_IRQ_PROG_INTA
3412 +#elif defined(CONFIG_BF52x)
3413 +#define PRIO_GPIODEMUX(irq) ((irq) == IRQ_PORTF_INTA ? CONFIG_IRQ_PORTF_INTA : \
3414 + (irq) == IRQ_PORTG_INTA ? CONFIG_IRQ_PORTG_INTA : \
3415 + (irq) == IRQ_PORTH_INTA ? CONFIG_IRQ_PORTH_INTA : \
3416 + -1)
3417 +#elif defined(CONFIG_BF561)
3418 +#define PRIO_GPIODEMUX(irq) ((irq) == IRQ_PROG0_INTA ? CONFIG_IRQ_PROG0_INTA : \
3419 + (irq) == IRQ_PROG1_INTA ? CONFIG_IRQ_PROG1_INTA : \
3420 + (irq) == IRQ_PROG2_INTA ? CONFIG_IRQ_PROG2_INTA : \
3421 + -1)
3422 #define bfin_write_TIMER_DISABLE(val) bfin_write_TMRS8_DISABLE(val)
3423 #define bfin_write_TIMER_ENABLE(val) bfin_write_TMRS8_ENABLE(val)
3424 #define bfin_write_TIMER_STATUS(val) bfin_write_TMRS8_STATUS(val)
3425 #define bfin_read_TIMER_STATUS() bfin_read_TMRS8_STATUS()
3426 #elif defined(CONFIG_BF54x)
3427 +#define PRIO_GPIODEMUX(irq) ((irq) == IRQ_PINT0 ? CONFIG_IRQ_PINT0 : \
3428 + (irq) == IRQ_PINT1 ? CONFIG_IRQ_PINT1 : \
3429 + (irq) == IRQ_PINT2 ? CONFIG_IRQ_PINT2 : \
3430 + (irq) == IRQ_PINT3 ? CONFIG_IRQ_PINT3 : \
3431 + -1)
3432 #define bfin_write_TIMER_DISABLE(val) bfin_write_TIMER_DISABLE0(val)
3433 #define bfin_write_TIMER_ENABLE(val) bfin_write_TIMER_ENABLE0(val)
3434 #define bfin_write_TIMER_STATUS(val) bfin_write_TIMER_STATUS0(val)
3435 #define bfin_read_TIMER_STATUS(val) bfin_read_TIMER_STATUS0(val)
3436 +#else
3437 +# error "no PRIO_GPIODEMUX() for this part"
3438 #endif
3439
3440 #define __ipipe_root_tick_p(regs) ((regs->ipend & 0x10) != 0)
3441 @@ -245,6 +275,4 @@
3442
3443 #endif /* !CONFIG_IPIPE */
3444
3445 -#define ipipe_update_tick_evtdev(evtdev) do { } while (0)
3446 -
3447 #endif /* !__ASM_BLACKFIN_IPIPE_H */
3448 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/include/asm/irq.h linux-2.6.29-rc3.owrt/arch/blackfin/include/asm/irq.h
3449 --- linux-2.6.29.owrt/arch/blackfin/include/asm/irq.h 2009-05-10 22:04:40.000000000 +0200
3450 +++ linux-2.6.29-rc3.owrt/arch/blackfin/include/asm/irq.h 2009-05-10 23:48:28.000000000 +0200
3451 @@ -61,38 +61,20 @@
3452 #define raw_irqs_disabled_flags(flags) (!irqs_enabled_from_flags_hw(flags))
3453 #define local_test_iflag_hw(x) irqs_enabled_from_flags_hw(x)
3454
3455 -#define local_save_flags(x) \
3456 - do { \
3457 - (x) = __ipipe_test_root() ? \
3458 - __all_masked_irq_flags : bfin_irq_flags; \
3459 - barrier(); \
3460 - } while (0)
3461 -
3462 -#define local_irq_save(x) \
3463 - do { \
3464 - (x) = __ipipe_test_and_stall_root() ? \
3465 +#define local_save_flags(x) \
3466 + do { \
3467 + (x) = __ipipe_test_root() ? \
3468 __all_masked_irq_flags : bfin_irq_flags; \
3469 - barrier(); \
3470 } while (0)
3471
3472 -static inline void local_irq_restore(unsigned long x)
3473 -{
3474 - barrier();
3475 - __ipipe_restore_root(x == __all_masked_irq_flags);
3476 -}
3477 -
3478 -#define local_irq_disable() \
3479 - do { \
3480 - __ipipe_stall_root(); \
3481 - barrier(); \
3482 +#define local_irq_save(x) \
3483 + do { \
3484 + (x) = __ipipe_test_and_stall_root(); \
3485 } while (0)
3486
3487 -static inline void local_irq_enable(void)
3488 -{
3489 - barrier();
3490 - __ipipe_unstall_root();
3491 -}
3492 -
3493 +#define local_irq_restore(x) __ipipe_restore_root(x)
3494 +#define local_irq_disable() __ipipe_stall_root()
3495 +#define local_irq_enable() __ipipe_unstall_root()
3496 #define irqs_disabled() __ipipe_test_root()
3497
3498 #define local_save_flags_hw(x) \
3499 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/include/asm/Kbuild linux-2.6.29-rc3.owrt/arch/blackfin/include/asm/Kbuild
3500 --- linux-2.6.29.owrt/arch/blackfin/include/asm/Kbuild 2009-05-10 22:04:40.000000000 +0200
3501 +++ linux-2.6.29-rc3.owrt/arch/blackfin/include/asm/Kbuild 2009-05-10 23:48:28.000000000 +0200
3502 @@ -1,4 +1,3 @@
3503 include include/asm-generic/Kbuild.asm
3504
3505 -unifdef-y += bfin_sport.h
3506 unifdef-y += fixed_code.h
3507 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/include/asm/kgdb.h linux-2.6.29-rc3.owrt/arch/blackfin/include/asm/kgdb.h
3508 --- linux-2.6.29.owrt/arch/blackfin/include/asm/kgdb.h 2009-05-10 22:04:40.000000000 +0200
3509 +++ linux-2.6.29-rc3.owrt/arch/blackfin/include/asm/kgdb.h 2009-05-10 23:48:28.000000000 +0200
3510 @@ -1,8 +1,32 @@
3511 -/* Blackfin KGDB header
3512 +/*
3513 + * File: include/asm-blackfin/kgdb.h
3514 + * Based on:
3515 + * Author: Sonic Zhang
3516 + *
3517 + * Created:
3518 + * Description:
3519 + *
3520 + * Rev: $Id: kgdb_bfin_linux-2.6.x.patch 4934 2007-02-13 09:32:11Z sonicz $
3521 + *
3522 + * Modified:
3523 + * Copyright 2005-2006 Analog Devices Inc.
3524 + *
3525 + * Bugs: Enter bugs at http://blackfin.uclinux.org/
3526 *
3527 - * Copyright 2005-2009 Analog Devices Inc.
3528 + * This program is free software; you can redistribute it and/or modify
3529 + * it under the terms of the GNU General Public License as published by
3530 + * the Free Software Foundation; either version 2 of the License, or
3531 + * (at your option) any later version.
3532 *
3533 - * Licensed under the GPL-2 or later.
3534 + * This program is distributed in the hope that it will be useful,
3535 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
3536 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3537 + * GNU General Public License for more details.
3538 + *
3539 + * You should have received a copy of the GNU General Public License
3540 + * along with this program; if not, see the file COPYING, or write
3541 + * to the Free Software Foundation, Inc.,
3542 + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
3543 */
3544
3545 #ifndef __ASM_BLACKFIN_KGDB_H__
3546 @@ -13,18 +37,17 @@
3547 /* gdb locks */
3548 #define KGDB_MAX_NO_CPUS 8
3549
3550 -/*
3551 - * BUFMAX defines the maximum number of characters in inbound/outbound buffers.
3552 - * At least NUMREGBYTES*2 are needed for register packets.
3553 - * Longer buffer is needed to list all threads.
3554 - */
3555 +/************************************************************************/
3556 +/* BUFMAX defines the maximum number of characters in inbound/outbound buffers*/
3557 +/* at least NUMREGBYTES*2 are needed for register packets */
3558 +/* Longer buffer is needed to list all threads */
3559 #define BUFMAX 2048
3560
3561 /*
3562 - * Note that this register image is different from
3563 - * the register image that Linux produces at interrupt time.
3564 - *
3565 - * Linux's register image is defined by struct pt_regs in ptrace.h.
3566 + * Note that this register image is different from
3567 + * the register image that Linux produces at interrupt time.
3568 + *
3569 + * Linux's register image is defined by struct pt_regs in ptrace.h.
3570 */
3571 enum regnames {
3572 /* Core Registers */
3573 @@ -81,14 +104,14 @@
3574 BFIN_RETX,
3575 BFIN_RETN,
3576 BFIN_RETE,
3577 -
3578 +
3579 /* Pseudo Registers */
3580 BFIN_PC,
3581 BFIN_CC,
3582 BFIN_EXTRA1, /* Address of .text section. */
3583 BFIN_EXTRA2, /* Address of .data section. */
3584 BFIN_EXTRA3, /* Address of .bss section. */
3585 - BFIN_FDPIC_EXEC,
3586 + BFIN_FDPIC_EXEC,
3587 BFIN_FDPIC_INTERP,
3588
3589 /* MMRs */
3590 @@ -103,7 +126,7 @@
3591
3592 static inline void arch_kgdb_breakpoint(void)
3593 {
3594 - asm("EXCPT 2;");
3595 + asm(" EXCPT 2;");
3596 }
3597 #define BREAK_INSTR_SIZE 2
3598 #define CACHE_FLUSH_IS_SAFE 1
3599 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/include/asm/mem_init.h linux-2.6.29-rc3.owrt/arch/blackfin/include/asm/mem_init.h
3600 --- linux-2.6.29.owrt/arch/blackfin/include/asm/mem_init.h 2009-05-10 22:04:40.000000000 +0200
3601 +++ linux-2.6.29-rc3.owrt/arch/blackfin/include/asm/mem_init.h 2009-05-10 23:48:28.000000000 +0200
3602 @@ -115,7 +115,7 @@
3603 #define mem_SDRRC (((CONFIG_SCLK_HZ / 1000) * SDRAM_Tref) / SDRAM_NRA) - (SDRAM_tRAS_num + SDRAM_tRP_num)
3604
3605 /* Enable SCLK Out */
3606 -#define mem_SDGCTL (SCTLE | SDRAM_CL | SDRAM_tRAS | SDRAM_tRP | SDRAM_tRCD | SDRAM_tWR | PSS)
3607 +#define mem_SDGCTL (0x80000000 | SCTLE | SDRAM_CL | SDRAM_tRAS | SDRAM_tRP | SDRAM_tRCD | SDRAM_tWR | PSS)
3608 #else
3609 #define mem_SDRRC CONFIG_MEM_SDRRC
3610 #define mem_SDGCTL CONFIG_MEM_SDGCTL
3611 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/include/asm/pda.h linux-2.6.29-rc3.owrt/arch/blackfin/include/asm/pda.h
3612 --- linux-2.6.29.owrt/arch/blackfin/include/asm/pda.h 2009-05-10 22:04:40.000000000 +0200
3613 +++ linux-2.6.29-rc3.owrt/arch/blackfin/include/asm/pda.h 2009-05-10 23:48:28.000000000 +0200
3614 @@ -59,7 +59,6 @@
3615 unsigned long icplb_fault_addr;
3616 unsigned long retx;
3617 unsigned long seqstat;
3618 - unsigned int __nmi_count; /* number of times NMI asserted on this CPU */
3619 };
3620
3621 extern struct blackfin_pda cpu_pda[];
3622 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/include/asm/reboot.h linux-2.6.29-rc3.owrt/arch/blackfin/include/asm/reboot.h
3623 --- linux-2.6.29.owrt/arch/blackfin/include/asm/reboot.h 2009-05-10 22:04:40.000000000 +0200
3624 +++ linux-2.6.29-rc3.owrt/arch/blackfin/include/asm/reboot.h 2009-05-10 23:48:28.000000000 +0200
3625 @@ -15,6 +15,6 @@
3626 extern void native_machine_power_off(void);
3627
3628 /* common reboot workarounds */
3629 -extern void bfin_reset_boot_spi_cs(unsigned short pin);
3630 +extern void bfin_gpio_reset_spi0_ssel1(void);
3631
3632 #endif
3633 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/include/asm/thread_info.h linux-2.6.29-rc3.owrt/arch/blackfin/include/asm/thread_info.h
3634 --- linux-2.6.29.owrt/arch/blackfin/include/asm/thread_info.h 2009-05-10 22:04:40.000000000 +0200
3635 +++ linux-2.6.29-rc3.owrt/arch/blackfin/include/asm/thread_info.h 2009-05-10 23:48:28.000000000 +0200
3636 @@ -122,7 +122,6 @@
3637 #define TIF_MEMDIE 4
3638 #define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */
3639 #define TIF_FREEZE 6 /* is freezing for suspend */
3640 -#define TIF_IRQ_SYNC 7 /* sync pipeline stage */
3641
3642 /* as above, but as bit values */
3643 #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
3644 @@ -131,7 +130,6 @@
3645 #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
3646 #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
3647 #define _TIF_FREEZE (1<<TIF_FREEZE)
3648 -#define _TIF_IRQ_SYNC (1<<TIF_IRQ_SYNC)
3649
3650 #define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
3651
3652 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/Kconfig linux-2.6.29-rc3.owrt/arch/blackfin/Kconfig
3653 --- linux-2.6.29.owrt/arch/blackfin/Kconfig 2009-05-10 22:04:40.000000000 +0200
3654 +++ linux-2.6.29-rc3.owrt/arch/blackfin/Kconfig 2009-05-10 23:48:28.000000000 +0200
3655 @@ -169,51 +169,26 @@
3656 help
3657 BF542 Processor Support.
3658
3659 -config BF542M
3660 - bool "BF542m"
3661 - help
3662 - BF542 Processor Support.
3663 -
3664 config BF544
3665 bool "BF544"
3666 help
3667 BF544 Processor Support.
3668
3669 -config BF544M
3670 - bool "BF544m"
3671 - help
3672 - BF544 Processor Support.
3673 -
3674 config BF547
3675 bool "BF547"
3676 help
3677 BF547 Processor Support.
3678
3679 -config BF547M
3680 - bool "BF547m"
3681 - help
3682 - BF547 Processor Support.
3683 -
3684 config BF548
3685 bool "BF548"
3686 help
3687 BF548 Processor Support.
3688
3689 -config BF548M
3690 - bool "BF548m"
3691 - help
3692 - BF548 Processor Support.
3693 -
3694 config BF549
3695 bool "BF549"
3696 help
3697 BF549 Processor Support.
3698
3699 -config BF549M
3700 - bool "BF549m"
3701 - help
3702 - BF549 Processor Support.
3703 -
3704 config BF561
3705 bool "BF561"
3706 help
3707 @@ -249,39 +224,39 @@
3708
3709 config BF_REV_MIN
3710 int
3711 - default 0 if (BF51x || BF52x || (BF54x && !BF54xM))
3712 + default 0 if (BF51x || BF52x || BF54x)
3713 default 2 if (BF537 || BF536 || BF534)
3714 - default 3 if (BF561 || BF533 || BF532 || BF531 || BF54xM)
3715 + default 3 if (BF561 ||BF533 || BF532 || BF531)
3716 default 4 if (BF538 || BF539)
3717
3718 config BF_REV_MAX
3719 int
3720 - default 2 if (BF51x || BF52x || (BF54x && !BF54xM))
3721 - default 3 if (BF537 || BF536 || BF534 || BF54xM)
3722 + default 2 if (BF51x || BF52x || BF54x)
3723 + default 3 if (BF537 || BF536 || BF534)
3724 default 5 if (BF561 || BF538 || BF539)
3725 default 6 if (BF533 || BF532 || BF531)
3726
3727 choice
3728 prompt "Silicon Rev"
3729 - default BF_REV_0_1 if (BF51x || BF52x || (BF54x && !BF54xM))
3730 + default BF_REV_0_1 if (BF51x || BF52x || BF54x)
3731 default BF_REV_0_2 if (BF534 || BF536 || BF537)
3732 - default BF_REV_0_3 if (BF531 || BF532 || BF533 || BF54xM || BF561)
3733 + default BF_REV_0_3 if (BF531 || BF532 || BF533 || BF561)
3734
3735 config BF_REV_0_0
3736 bool "0.0"
3737 - depends on (BF51x || BF52x || (BF54x && !BF54xM))
3738 + depends on (BF51x || BF52x || BF54x)
3739
3740 config BF_REV_0_1
3741 bool "0.1"
3742 - depends on (BF52x || (BF54x && !BF54xM))
3743 + depends on (BF52x || BF54x)
3744
3745 config BF_REV_0_2
3746 bool "0.2"
3747 - depends on (BF52x || BF537 || BF536 || BF534 || (BF54x && !BF54xM))
3748 + depends on (BF52x || BF537 || BF536 || BF534 || BF54x)
3749
3750 config BF_REV_0_3
3751 bool "0.3"
3752 - depends on (BF54xM || BF561 || BF537 || BF536 || BF534 || BF533 || BF532 || BF531)
3753 + depends on (BF561 || BF537 || BF536 || BF534 || BF533 || BF532 || BF531)
3754
3755 config BF_REV_0_4
3756 bool "0.4"
3757 @@ -318,14 +293,9 @@
3758 depends on (BF531 || BF532 || BF533 || BF534 || BF536 || BF537)
3759 default y
3760
3761 -config BF54xM
3762 - bool
3763 - depends on (BF542M || BF544M || BF547M || BF548M || BF549M)
3764 - default y
3765 -
3766 config BF54x
3767 bool
3768 - depends on (BF542 || BF544 || BF547 || BF548 || BF549 || BF54xM)
3769 + depends on (BF542 || BF544 || BF547 || BF548 || BF549)
3770 default y
3771
3772 config MEM_GENERIC_BOARD
3773 @@ -1129,7 +1099,6 @@
3774
3775 config PM_WAKEUP_BY_GPIO
3776 bool "Allow Wakeup from Standby by GPIO"
3777 - depends on PM && !BF54x
3778
3779 config PM_WAKEUP_GPIO_NUMBER
3780 int "GPIO number"
3781 @@ -1169,12 +1138,6 @@
3782 default n
3783 help
3784 Enable General-Purpose Wake-Up (Voltage Regulator Power-Up)
3785 - (all processors, except ADSP-BF549). This option sets
3786 - the general-purpose wake-up enable (GPWE) control bit to enable
3787 - wake-up upon detection of an active low signal on the /GPW (PH7) pin.
3788 - On ADSP-BF549 this option enables the the same functionality on the
3789 - /MRXON pin also PH7.
3790 -
3791 endmenu
3792
3793 menu "CPU Frequency scaling"
3794 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/Kconfig.debug linux-2.6.29-rc3.owrt/arch/blackfin/Kconfig.debug
3795 --- linux-2.6.29.owrt/arch/blackfin/Kconfig.debug 2009-05-10 22:04:41.000000000 +0200
3796 +++ linux-2.6.29-rc3.owrt/arch/blackfin/Kconfig.debug 2009-05-10 23:48:28.000000000 +0200
3797 @@ -21,6 +21,12 @@
3798 config HAVE_ARCH_KGDB
3799 def_bool y
3800
3801 +config KGDB_TESTCASE
3802 + tristate "KGDB: for test case in expect"
3803 + default n
3804 + help
3805 + This is a kgdb test case for automated testing.
3806 +
3807 config DEBUG_VERBOSE
3808 bool "Verbose fault messages"
3809 default y
3810 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/kernel/bfin_dma_5xx.c linux-2.6.29-rc3.owrt/arch/blackfin/kernel/bfin_dma_5xx.c
3811 --- linux-2.6.29.owrt/arch/blackfin/kernel/bfin_dma_5xx.c 2009-05-10 22:04:41.000000000 +0200
3812 +++ linux-2.6.29-rc3.owrt/arch/blackfin/kernel/bfin_dma_5xx.c 2009-05-10 23:48:28.000000000 +0200
3813 @@ -249,13 +249,6 @@
3814
3815 spin_lock_irqsave(&mdma_lock, flags);
3816
3817 - /* Force a sync in case a previous config reset on this channel
3818 - * occurred. This is needed so subsequent writes to DMA registers
3819 - * are not spuriously lost/corrupted. Do it under irq lock and
3820 - * without the anomaly version (because we are atomic already).
3821 - */
3822 - __builtin_bfin_ssync();
3823 -
3824 if (bfin_read_MDMA_S0_CONFIG())
3825 while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE))
3826 continue;
3827 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/kernel/bfin_gpio.c linux-2.6.29-rc3.owrt/arch/blackfin/kernel/bfin_gpio.c
3828 --- linux-2.6.29.owrt/arch/blackfin/kernel/bfin_gpio.c 2009-05-10 22:04:41.000000000 +0200
3829 +++ linux-2.6.29-rc3.owrt/arch/blackfin/kernel/bfin_gpio.c 2009-05-10 23:48:28.000000000 +0200
3830 @@ -27,6 +27,59 @@
3831 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
3832 */
3833
3834 +/*
3835 +* Number BF537/6/4 BF561 BF533/2/1 BF549/8/4/2
3836 +*
3837 +* GPIO_0 PF0 PF0 PF0 PA0...PJ13
3838 +* GPIO_1 PF1 PF1 PF1
3839 +* GPIO_2 PF2 PF2 PF2
3840 +* GPIO_3 PF3 PF3 PF3
3841 +* GPIO_4 PF4 PF4 PF4
3842 +* GPIO_5 PF5 PF5 PF5
3843 +* GPIO_6 PF6 PF6 PF6
3844 +* GPIO_7 PF7 PF7 PF7
3845 +* GPIO_8 PF8 PF8 PF8
3846 +* GPIO_9 PF9 PF9 PF9
3847 +* GPIO_10 PF10 PF10 PF10
3848 +* GPIO_11 PF11 PF11 PF11
3849 +* GPIO_12 PF12 PF12 PF12
3850 +* GPIO_13 PF13 PF13 PF13
3851 +* GPIO_14 PF14 PF14 PF14
3852 +* GPIO_15 PF15 PF15 PF15
3853 +* GPIO_16 PG0 PF16
3854 +* GPIO_17 PG1 PF17
3855 +* GPIO_18 PG2 PF18
3856 +* GPIO_19 PG3 PF19
3857 +* GPIO_20 PG4 PF20
3858 +* GPIO_21 PG5 PF21
3859 +* GPIO_22 PG6 PF22
3860 +* GPIO_23 PG7 PF23
3861 +* GPIO_24 PG8 PF24
3862 +* GPIO_25 PG9 PF25
3863 +* GPIO_26 PG10 PF26
3864 +* GPIO_27 PG11 PF27
3865 +* GPIO_28 PG12 PF28
3866 +* GPIO_29 PG13 PF29
3867 +* GPIO_30 PG14 PF30
3868 +* GPIO_31 PG15 PF31
3869 +* GPIO_32 PH0 PF32
3870 +* GPIO_33 PH1 PF33
3871 +* GPIO_34 PH2 PF34
3872 +* GPIO_35 PH3 PF35
3873 +* GPIO_36 PH4 PF36
3874 +* GPIO_37 PH5 PF37
3875 +* GPIO_38 PH6 PF38
3876 +* GPIO_39 PH7 PF39
3877 +* GPIO_40 PH8 PF40
3878 +* GPIO_41 PH9 PF41
3879 +* GPIO_42 PH10 PF42
3880 +* GPIO_43 PH11 PF43
3881 +* GPIO_44 PH12 PF44
3882 +* GPIO_45 PH13 PF45
3883 +* GPIO_46 PH14 PF46
3884 +* GPIO_47 PH15 PF47
3885 +*/
3886 +
3887 #include <linux/delay.h>
3888 #include <linux/module.h>
3889 #include <linux/err.h>
3890 @@ -66,61 +119,62 @@
3891 #define AWA_DUMMY_READ(...) do { } while (0)
3892 #endif
3893
3894 -static struct gpio_port_t * const gpio_array[] = {
3895 #if defined(BF533_FAMILY) || defined(BF538_FAMILY)
3896 +static struct gpio_port_t *gpio_bankb[] = {
3897 (struct gpio_port_t *) FIO_FLAG_D,
3898 -#elif defined(BF527_FAMILY) || defined(BF537_FAMILY) || defined(BF518_FAMILY)
3899 +};
3900 +#endif
3901 +
3902 +#if defined(BF527_FAMILY) || defined(BF537_FAMILY) || defined(BF518_FAMILY)
3903 +static struct gpio_port_t *gpio_bankb[] = {
3904 (struct gpio_port_t *) PORTFIO,
3905 (struct gpio_port_t *) PORTGIO,
3906 (struct gpio_port_t *) PORTHIO,
3907 -#elif defined(BF561_FAMILY)
3908 - (struct gpio_port_t *) FIO0_FLAG_D,
3909 - (struct gpio_port_t *) FIO1_FLAG_D,
3910 - (struct gpio_port_t *) FIO2_FLAG_D,
3911 -#elif defined(BF548_FAMILY)
3912 - (struct gpio_port_t *)PORTA_FER,
3913 - (struct gpio_port_t *)PORTB_FER,
3914 - (struct gpio_port_t *)PORTC_FER,
3915 - (struct gpio_port_t *)PORTD_FER,
3916 - (struct gpio_port_t *)PORTE_FER,
3917 - (struct gpio_port_t *)PORTF_FER,
3918 - (struct gpio_port_t *)PORTG_FER,
3919 - (struct gpio_port_t *)PORTH_FER,
3920 - (struct gpio_port_t *)PORTI_FER,
3921 - (struct gpio_port_t *)PORTJ_FER,
3922 -#else
3923 -# error no gpio arrays defined
3924 -#endif
3925 };
3926
3927 -#if defined(BF527_FAMILY) || defined(BF537_FAMILY) || defined(BF518_FAMILY)
3928 -static unsigned short * const port_fer[] = {
3929 +static unsigned short *port_fer[] = {
3930 (unsigned short *) PORTF_FER,
3931 (unsigned short *) PORTG_FER,
3932 (unsigned short *) PORTH_FER,
3933 };
3934 +#endif
3935
3936 -# if !defined(BF537_FAMILY)
3937 -static unsigned short * const port_mux[] = {
3938 +#if defined(BF527_FAMILY) || defined(BF518_FAMILY)
3939 +static unsigned short *port_mux[] = {
3940 (unsigned short *) PORTF_MUX,
3941 (unsigned short *) PORTG_MUX,
3942 (unsigned short *) PORTH_MUX,
3943 };
3944
3945 static const
3946 -u8 pmux_offset[][16] = {
3947 -# if defined(BF527_FAMILY)
3948 - { 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 4, 6, 8, 8, 10, 10 }, /* PORTF */
3949 - { 0, 0, 0, 0, 0, 2, 2, 4, 4, 6, 8, 10, 10, 10, 12, 12 }, /* PORTG */
3950 - { 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 4, 4, 4, 4, 4, 4 }, /* PORTH */
3951 -# elif defined(BF518_FAMILY)
3952 - { 0, 2, 2, 2, 2, 2, 2, 4, 6, 6, 6, 8, 8, 8, 8, 10 }, /* PORTF */
3953 - { 0, 0, 0, 2, 4, 6, 6, 6, 8, 10, 10, 12, 14, 14, 14, 14 }, /* PORTG */
3954 - { 0, 0, 0, 0, 2, 2, 4, 6, 10, 10, 10, 10, 10, 10, 10, 10 }, /* PORTH */
3955 -# endif
3956 +u8 pmux_offset[][16] =
3957 + {{ 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 4, 6, 8, 8, 10, 10 }, /* PORTF */
3958 + { 0, 0, 0, 0, 0, 2, 2, 4, 4, 6, 8, 10, 10, 10, 12, 12 }, /* PORTG */
3959 + { 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 4, 4, 4, 4, 4, 4 }, /* PORTH */
3960 + };
3961 +#endif
3962 +
3963 +#ifdef BF561_FAMILY
3964 +static struct gpio_port_t *gpio_bankb[] = {
3965 + (struct gpio_port_t *) FIO0_FLAG_D,
3966 + (struct gpio_port_t *) FIO1_FLAG_D,
3967 + (struct gpio_port_t *) FIO2_FLAG_D,
3968 };
3969 -# endif
3970 +#endif
3971
3972 +#ifdef BF548_FAMILY
3973 +static struct gpio_port_t *gpio_array[] = {
3974 + (struct gpio_port_t *)PORTA_FER,
3975 + (struct gpio_port_t *)PORTB_FER,
3976 + (struct gpio_port_t *)PORTC_FER,
3977 + (struct gpio_port_t *)PORTD_FER,
3978 + (struct gpio_port_t *)PORTE_FER,
3979 + (struct gpio_port_t *)PORTF_FER,
3980 + (struct gpio_port_t *)PORTG_FER,
3981 + (struct gpio_port_t *)PORTH_FER,
3982 + (struct gpio_port_t *)PORTI_FER,
3983 + (struct gpio_port_t *)PORTJ_FER,
3984 +};
3985 #endif
3986
3987 static unsigned short reserved_gpio_map[GPIO_BANK_NUM];
3988 @@ -134,9 +188,35 @@
3989 } str_ident[MAX_RESOURCES];
3990
3991 #if defined(CONFIG_PM)
3992 +#if defined(CONFIG_BF54x)
3993 +static struct gpio_port_s gpio_bank_saved[GPIO_BANK_NUM];
3994 +#else
3995 +static unsigned short wakeup_map[GPIO_BANK_NUM];
3996 +static unsigned char wakeup_flags_map[MAX_BLACKFIN_GPIOS];
3997 static struct gpio_port_s gpio_bank_saved[GPIO_BANK_NUM];
3998 +
3999 +#ifdef BF533_FAMILY
4000 +static unsigned int sic_iwr_irqs[] = {IRQ_PROG_INTB};
4001 +#endif
4002 +
4003 +#ifdef BF537_FAMILY
4004 +static unsigned int sic_iwr_irqs[] = {IRQ_PROG_INTB, IRQ_PORTG_INTB, IRQ_MAC_TX};
4005 +#endif
4006 +
4007 +#ifdef BF538_FAMILY
4008 +static unsigned int sic_iwr_irqs[] = {IRQ_PORTF_INTB};
4009 #endif
4010
4011 +#if defined(BF527_FAMILY) || defined(BF518_FAMILY)
4012 +static unsigned int sic_iwr_irqs[] = {IRQ_PORTF_INTB, IRQ_PORTG_INTB, IRQ_PORTH_INTB};
4013 +#endif
4014 +
4015 +#ifdef BF561_FAMILY
4016 +static unsigned int sic_iwr_irqs[] = {IRQ_PROG0_INTB, IRQ_PROG1_INTB, IRQ_PROG2_INTB};
4017 +#endif
4018 +#endif
4019 +#endif /* CONFIG_PM */
4020 +
4021 inline int check_gpio(unsigned gpio)
4022 {
4023 #if defined(BF548_FAMILY)
4024 @@ -250,10 +330,9 @@
4025 {.res = P_SPI0_SSEL3, .offset = 0},
4026 };
4027
4028 -static void portmux_setup(unsigned short per)
4029 +static void portmux_setup(unsigned short per, unsigned short function)
4030 {
4031 u16 y, offset, muxreg;
4032 - u16 function = P_FUNCT2MUX(per);
4033
4034 for (y = 0; y < ARRAY_SIZE(port_mux_lut); y++) {
4035 if (port_mux_lut[y].res == per) {
4036 @@ -274,33 +353,30 @@
4037 }
4038 }
4039 #elif defined(BF548_FAMILY)
4040 -inline void portmux_setup(unsigned short per)
4041 +inline void portmux_setup(unsigned short portno, unsigned short function)
4042 {
4043 u32 pmux;
4044 - u16 ident = P_IDENT(per);
4045 - u16 function = P_FUNCT2MUX(per);
4046
4047 - pmux = gpio_array[gpio_bank(ident)]->port_mux;
4048 + pmux = gpio_array[gpio_bank(portno)]->port_mux;
4049
4050 - pmux &= ~(0x3 << (2 * gpio_sub_n(ident)));
4051 - pmux |= (function & 0x3) << (2 * gpio_sub_n(ident));
4052 + pmux &= ~(0x3 << (2 * gpio_sub_n(portno)));
4053 + pmux |= (function & 0x3) << (2 * gpio_sub_n(portno));
4054
4055 - gpio_array[gpio_bank(ident)]->port_mux = pmux;
4056 + gpio_array[gpio_bank(portno)]->port_mux = pmux;
4057 }
4058
4059 -inline u16 get_portmux(unsigned short per)
4060 +inline u16 get_portmux(unsigned short portno)
4061 {
4062 u32 pmux;
4063 - u16 ident = P_IDENT(per);
4064
4065 - pmux = gpio_array[gpio_bank(ident)]->port_mux;
4066 + pmux = gpio_array[gpio_bank(portno)]->port_mux;
4067
4068 - return (pmux >> (2 * gpio_sub_n(ident)) & 0x3);
4069 + return (pmux >> (2 * gpio_sub_n(portno)) & 0x3);
4070 }
4071 #elif defined(BF527_FAMILY) || defined(BF518_FAMILY)
4072 -inline void portmux_setup(unsigned short per)
4073 +inline void portmux_setup(unsigned short portno, unsigned short function)
4074 {
4075 - u16 pmux, ident = P_IDENT(per), function = P_FUNCT2MUX(per);
4076 + u16 pmux, ident = P_IDENT(portno);
4077 u8 offset = pmux_offset[gpio_bank(ident)][gpio_sub_n(ident)];
4078
4079 pmux = *port_mux[gpio_bank(ident)];
4080 @@ -348,71 +424,90 @@
4081 unsigned long flags; \
4082 local_irq_save_hw(flags); \
4083 if (arg) \
4084 - gpio_array[gpio_bank(gpio)]->name |= gpio_bit(gpio); \
4085 + gpio_bankb[gpio_bank(gpio)]->name |= gpio_bit(gpio); \
4086 else \
4087 - gpio_array[gpio_bank(gpio)]->name &= ~gpio_bit(gpio); \
4088 + gpio_bankb[gpio_bank(gpio)]->name &= ~gpio_bit(gpio); \
4089 AWA_DUMMY_READ(name); \
4090 local_irq_restore_hw(flags); \
4091 } \
4092 EXPORT_SYMBOL(set_gpio_ ## name);
4093
4094 -SET_GPIO(dir) /* set_gpio_dir() */
4095 -SET_GPIO(inen) /* set_gpio_inen() */
4096 -SET_GPIO(polar) /* set_gpio_polar() */
4097 -SET_GPIO(edge) /* set_gpio_edge() */
4098 -SET_GPIO(both) /* set_gpio_both() */
4099 +SET_GPIO(dir)
4100 +SET_GPIO(inen)
4101 +SET_GPIO(polar)
4102 +SET_GPIO(edge)
4103 +SET_GPIO(both)
4104
4105
4106 +#if ANOMALY_05000311 || ANOMALY_05000323
4107 #define SET_GPIO_SC(name) \
4108 void set_gpio_ ## name(unsigned gpio, unsigned short arg) \
4109 { \
4110 unsigned long flags; \
4111 - if (ANOMALY_05000311 || ANOMALY_05000323) \
4112 - local_irq_save_hw(flags); \
4113 + local_irq_save_hw(flags); \
4114 if (arg) \
4115 - gpio_array[gpio_bank(gpio)]->name ## _set = gpio_bit(gpio); \
4116 + gpio_bankb[gpio_bank(gpio)]->name ## _set = gpio_bit(gpio); \
4117 else \
4118 - gpio_array[gpio_bank(gpio)]->name ## _clear = gpio_bit(gpio); \
4119 - if (ANOMALY_05000311 || ANOMALY_05000323) { \
4120 - AWA_DUMMY_READ(name); \
4121 - local_irq_restore_hw(flags); \
4122 - } \
4123 + gpio_bankb[gpio_bank(gpio)]->name ## _clear = gpio_bit(gpio); \
4124 + AWA_DUMMY_READ(name); \
4125 + local_irq_restore_hw(flags); \
4126 } \
4127 EXPORT_SYMBOL(set_gpio_ ## name);
4128 +#else
4129 +#define SET_GPIO_SC(name) \
4130 +void set_gpio_ ## name(unsigned gpio, unsigned short arg) \
4131 +{ \
4132 + if (arg) \
4133 + gpio_bankb[gpio_bank(gpio)]->name ## _set = gpio_bit(gpio); \
4134 + else \
4135 + gpio_bankb[gpio_bank(gpio)]->name ## _clear = gpio_bit(gpio); \
4136 +} \
4137 +EXPORT_SYMBOL(set_gpio_ ## name);
4138 +#endif
4139
4140 SET_GPIO_SC(maska)
4141 SET_GPIO_SC(maskb)
4142 SET_GPIO_SC(data)
4143
4144 +#if ANOMALY_05000311 || ANOMALY_05000323
4145 void set_gpio_toggle(unsigned gpio)
4146 {
4147 unsigned long flags;
4148 - if (ANOMALY_05000311 || ANOMALY_05000323)
4149 - local_irq_save_hw(flags);
4150 - gpio_array[gpio_bank(gpio)]->toggle = gpio_bit(gpio);
4151 - if (ANOMALY_05000311 || ANOMALY_05000323) {
4152 - AWA_DUMMY_READ(toggle);
4153 - local_irq_restore_hw(flags);
4154 - }
4155 + local_irq_save_hw(flags);
4156 + gpio_bankb[gpio_bank(gpio)]->toggle = gpio_bit(gpio);
4157 + AWA_DUMMY_READ(toggle);
4158 + local_irq_restore_hw(flags);
4159 +}
4160 +#else
4161 +void set_gpio_toggle(unsigned gpio)
4162 +{
4163 + gpio_bankb[gpio_bank(gpio)]->toggle = gpio_bit(gpio);
4164 }
4165 +#endif
4166 EXPORT_SYMBOL(set_gpio_toggle);
4167
4168
4169 /*Set current PORT date (16-bit word)*/
4170
4171 +#if ANOMALY_05000311 || ANOMALY_05000323
4172 #define SET_GPIO_P(name) \
4173 void set_gpiop_ ## name(unsigned gpio, unsigned short arg) \
4174 { \
4175 unsigned long flags; \
4176 - if (ANOMALY_05000311 || ANOMALY_05000323) \
4177 - local_irq_save_hw(flags); \
4178 - gpio_array[gpio_bank(gpio)]->name = arg; \
4179 - if (ANOMALY_05000311 || ANOMALY_05000323) { \
4180 - AWA_DUMMY_READ(name); \
4181 - local_irq_restore_hw(flags); \
4182 - } \
4183 + local_irq_save_hw(flags); \
4184 + gpio_bankb[gpio_bank(gpio)]->name = arg; \
4185 + AWA_DUMMY_READ(name); \
4186 + local_irq_restore_hw(flags); \
4187 +} \
4188 +EXPORT_SYMBOL(set_gpiop_ ## name);
4189 +#else
4190 +#define SET_GPIO_P(name) \
4191 +void set_gpiop_ ## name(unsigned gpio, unsigned short arg) \
4192 +{ \
4193 + gpio_bankb[gpio_bank(gpio)]->name = arg; \
4194 } \
4195 EXPORT_SYMBOL(set_gpiop_ ## name);
4196 +#endif
4197
4198 SET_GPIO_P(data)
4199 SET_GPIO_P(dir)
4200 @@ -424,21 +519,27 @@
4201 SET_GPIO_P(maskb)
4202
4203 /* Get a specific bit */
4204 +#if ANOMALY_05000311 || ANOMALY_05000323
4205 #define GET_GPIO(name) \
4206 unsigned short get_gpio_ ## name(unsigned gpio) \
4207 { \
4208 unsigned long flags; \
4209 unsigned short ret; \
4210 - if (ANOMALY_05000311 || ANOMALY_05000323) \
4211 - local_irq_save_hw(flags); \
4212 - ret = 0x01 & (gpio_array[gpio_bank(gpio)]->name >> gpio_sub_n(gpio)); \
4213 - if (ANOMALY_05000311 || ANOMALY_05000323) { \
4214 - AWA_DUMMY_READ(name); \
4215 - local_irq_restore_hw(flags); \
4216 - } \
4217 + local_irq_save_hw(flags); \
4218 + ret = 0x01 & (gpio_bankb[gpio_bank(gpio)]->name >> gpio_sub_n(gpio)); \
4219 + AWA_DUMMY_READ(name); \
4220 + local_irq_restore_hw(flags); \
4221 return ret; \
4222 } \
4223 EXPORT_SYMBOL(get_gpio_ ## name);
4224 +#else
4225 +#define GET_GPIO(name) \
4226 +unsigned short get_gpio_ ## name(unsigned gpio) \
4227 +{ \
4228 + return (0x01 & (gpio_bankb[gpio_bank(gpio)]->name >> gpio_sub_n(gpio))); \
4229 +} \
4230 +EXPORT_SYMBOL(get_gpio_ ## name);
4231 +#endif
4232
4233 GET_GPIO(data)
4234 GET_GPIO(dir)
4235 @@ -451,21 +552,27 @@
4236
4237 /*Get current PORT date (16-bit word)*/
4238
4239 +#if ANOMALY_05000311 || ANOMALY_05000323
4240 #define GET_GPIO_P(name) \
4241 unsigned short get_gpiop_ ## name(unsigned gpio) \
4242 { \
4243 unsigned long flags; \
4244 unsigned short ret; \
4245 - if (ANOMALY_05000311 || ANOMALY_05000323) \
4246 - local_irq_save_hw(flags); \
4247 - ret = (gpio_array[gpio_bank(gpio)]->name); \
4248 - if (ANOMALY_05000311 || ANOMALY_05000323) { \
4249 - AWA_DUMMY_READ(name); \
4250 - local_irq_restore_hw(flags); \
4251 - } \
4252 + local_irq_save_hw(flags); \
4253 + ret = (gpio_bankb[gpio_bank(gpio)]->name); \
4254 + AWA_DUMMY_READ(name); \
4255 + local_irq_restore_hw(flags); \
4256 return ret; \
4257 } \
4258 EXPORT_SYMBOL(get_gpiop_ ## name);
4259 +#else
4260 +#define GET_GPIO_P(name) \
4261 +unsigned short get_gpiop_ ## name(unsigned gpio) \
4262 +{ \
4263 + return (gpio_bankb[gpio_bank(gpio)]->name);\
4264 +} \
4265 +EXPORT_SYMBOL(get_gpiop_ ## name);
4266 +#endif
4267
4268 GET_GPIO_P(data)
4269 GET_GPIO_P(dir)
4270 @@ -478,26 +585,6 @@
4271
4272
4273 #ifdef CONFIG_PM
4274 -
4275 -static unsigned short wakeup_map[GPIO_BANK_NUM];
4276 -static unsigned char wakeup_flags_map[MAX_BLACKFIN_GPIOS];
4277 -
4278 -static const unsigned int sic_iwr_irqs[] = {
4279 -#if defined(BF533_FAMILY)
4280 - IRQ_PROG_INTB
4281 -#elif defined(BF537_FAMILY)
4282 - IRQ_PROG_INTB, IRQ_PORTG_INTB, IRQ_MAC_TX
4283 -#elif defined(BF538_FAMILY)
4284 - IRQ_PORTF_INTB
4285 -#elif defined(BF527_FAMILY) || defined(BF518_FAMILY)
4286 - IRQ_PORTF_INTB, IRQ_PORTG_INTB, IRQ_PORTH_INTB
4287 -#elif defined(BF561_FAMILY)
4288 - IRQ_PROG0_INTB, IRQ_PROG1_INTB, IRQ_PROG2_INTB
4289 -#else
4290 -# error no SIC_IWR defined
4291 -#endif
4292 -};
4293 -
4294 /***********************************************************
4295 *
4296 * FUNCTIONS: Blackfin PM Setup API
4297 @@ -582,18 +669,18 @@
4298 mask = wakeup_map[gpio_bank(i)];
4299 bank = gpio_bank(i);
4300
4301 - gpio_bank_saved[bank].maskb = gpio_array[bank]->maskb;
4302 - gpio_array[bank]->maskb = 0;
4303 + gpio_bank_saved[bank].maskb = gpio_bankb[bank]->maskb;
4304 + gpio_bankb[bank]->maskb = 0;
4305
4306 if (mask) {
4307 #if defined(BF527_FAMILY) || defined(BF537_FAMILY) || defined(BF518_FAMILY)
4308 gpio_bank_saved[bank].fer = *port_fer[bank];
4309 #endif
4310 - gpio_bank_saved[bank].inen = gpio_array[bank]->inen;
4311 - gpio_bank_saved[bank].polar = gpio_array[bank]->polar;
4312 - gpio_bank_saved[bank].dir = gpio_array[bank]->dir;
4313 - gpio_bank_saved[bank].edge = gpio_array[bank]->edge;
4314 - gpio_bank_saved[bank].both = gpio_array[bank]->both;
4315 + gpio_bank_saved[bank].inen = gpio_bankb[bank]->inen;
4316 + gpio_bank_saved[bank].polar = gpio_bankb[bank]->polar;
4317 + gpio_bank_saved[bank].dir = gpio_bankb[bank]->dir;
4318 + gpio_bank_saved[bank].edge = gpio_bankb[bank]->edge;
4319 + gpio_bank_saved[bank].both = gpio_bankb[bank]->both;
4320 gpio_bank_saved[bank].reserved =
4321 reserved_gpio_map[bank];
4322
4323 @@ -613,7 +700,7 @@
4324 }
4325
4326 bfin_internal_set_wake(sic_iwr_irqs[bank], 1);
4327 - gpio_array[bank]->maskb_set = wakeup_map[gpio_bank(i)];
4328 + gpio_bankb[bank]->maskb_set = wakeup_map[gpio_bank(i)];
4329 }
4330 }
4331
4332 @@ -634,18 +721,18 @@
4333 #if defined(BF527_FAMILY) || defined(BF537_FAMILY) || defined(BF518_FAMILY)
4334 *port_fer[bank] = gpio_bank_saved[bank].fer;
4335 #endif
4336 - gpio_array[bank]->inen = gpio_bank_saved[bank].inen;
4337 - gpio_array[bank]->dir = gpio_bank_saved[bank].dir;
4338 - gpio_array[bank]->polar = gpio_bank_saved[bank].polar;
4339 - gpio_array[bank]->edge = gpio_bank_saved[bank].edge;
4340 - gpio_array[bank]->both = gpio_bank_saved[bank].both;
4341 + gpio_bankb[bank]->inen = gpio_bank_saved[bank].inen;
4342 + gpio_bankb[bank]->dir = gpio_bank_saved[bank].dir;
4343 + gpio_bankb[bank]->polar = gpio_bank_saved[bank].polar;
4344 + gpio_bankb[bank]->edge = gpio_bank_saved[bank].edge;
4345 + gpio_bankb[bank]->both = gpio_bank_saved[bank].both;
4346
4347 reserved_gpio_map[bank] =
4348 gpio_bank_saved[bank].reserved;
4349 bfin_internal_set_wake(sic_iwr_irqs[bank], 0);
4350 }
4351
4352 - gpio_array[bank]->maskb = gpio_bank_saved[bank].maskb;
4353 + gpio_bankb[bank]->maskb = gpio_bank_saved[bank].maskb;
4354 }
4355 AWA_DUMMY_READ(maskb);
4356 }
4357 @@ -658,21 +745,21 @@
4358 bank = gpio_bank(i);
4359
4360 #if defined(BF527_FAMILY) || defined(BF537_FAMILY) || defined(BF518_FAMILY)
4361 - gpio_bank_saved[bank].fer = *port_fer[bank];
4362 + gpio_bank_saved[bank].fer = *port_fer[bank];
4363 #if defined(BF527_FAMILY) || defined(BF518_FAMILY)
4364 - gpio_bank_saved[bank].mux = *port_mux[bank];
4365 + gpio_bank_saved[bank].mux = *port_mux[bank];
4366 #else
4367 - if (bank == 0)
4368 - gpio_bank_saved[bank].mux = bfin_read_PORT_MUX();
4369 + if (bank == 0)
4370 + gpio_bank_saved[bank].mux = bfin_read_PORT_MUX();
4371 #endif
4372 #endif
4373 - gpio_bank_saved[bank].data = gpio_array[bank]->data;
4374 - gpio_bank_saved[bank].inen = gpio_array[bank]->inen;
4375 - gpio_bank_saved[bank].polar = gpio_array[bank]->polar;
4376 - gpio_bank_saved[bank].dir = gpio_array[bank]->dir;
4377 - gpio_bank_saved[bank].edge = gpio_array[bank]->edge;
4378 - gpio_bank_saved[bank].both = gpio_array[bank]->both;
4379 - gpio_bank_saved[bank].maska = gpio_array[bank]->maska;
4380 + gpio_bank_saved[bank].data = gpio_bankb[bank]->data;
4381 + gpio_bank_saved[bank].inen = gpio_bankb[bank]->inen;
4382 + gpio_bank_saved[bank].polar = gpio_bankb[bank]->polar;
4383 + gpio_bank_saved[bank].dir = gpio_bankb[bank]->dir;
4384 + gpio_bank_saved[bank].edge = gpio_bankb[bank]->edge;
4385 + gpio_bank_saved[bank].both = gpio_bankb[bank]->both;
4386 + gpio_bank_saved[bank].maska = gpio_bankb[bank]->maska;
4387 }
4388
4389 AWA_DUMMY_READ(maska);
4390 @@ -683,27 +770,27 @@
4391 int i, bank;
4392
4393 for (i = 0; i < MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE) {
4394 - bank = gpio_bank(i);
4395 + bank = gpio_bank(i);
4396
4397 #if defined(BF527_FAMILY) || defined(BF537_FAMILY) || defined(BF518_FAMILY)
4398 #if defined(BF527_FAMILY) || defined(BF518_FAMILY)
4399 - *port_mux[bank] = gpio_bank_saved[bank].mux;
4400 + *port_mux[bank] = gpio_bank_saved[bank].mux;
4401 #else
4402 - if (bank == 0)
4403 - bfin_write_PORT_MUX(gpio_bank_saved[bank].mux);
4404 + if (bank == 0)
4405 + bfin_write_PORT_MUX(gpio_bank_saved[bank].mux);
4406 #endif
4407 - *port_fer[bank] = gpio_bank_saved[bank].fer;
4408 + *port_fer[bank] = gpio_bank_saved[bank].fer;
4409 #endif
4410 - gpio_array[bank]->inen = gpio_bank_saved[bank].inen;
4411 - gpio_array[bank]->dir = gpio_bank_saved[bank].dir;
4412 - gpio_array[bank]->polar = gpio_bank_saved[bank].polar;
4413 - gpio_array[bank]->edge = gpio_bank_saved[bank].edge;
4414 - gpio_array[bank]->both = gpio_bank_saved[bank].both;
4415 + gpio_bankb[bank]->inen = gpio_bank_saved[bank].inen;
4416 + gpio_bankb[bank]->dir = gpio_bank_saved[bank].dir;
4417 + gpio_bankb[bank]->polar = gpio_bank_saved[bank].polar;
4418 + gpio_bankb[bank]->edge = gpio_bank_saved[bank].edge;
4419 + gpio_bankb[bank]->both = gpio_bank_saved[bank].both;
4420
4421 - gpio_array[bank]->data_set = gpio_bank_saved[bank].data
4422 - | gpio_bank_saved[bank].dir;
4423 + gpio_bankb[bank]->data_set = gpio_bank_saved[bank].data
4424 + | gpio_bank_saved[bank].dir;
4425
4426 - gpio_array[bank]->maska = gpio_bank_saved[bank].maska;
4427 + gpio_bankb[bank]->maska = gpio_bank_saved[bank].maska;
4428 }
4429 AWA_DUMMY_READ(maska);
4430 }
4431 @@ -730,12 +817,12 @@
4432 for (i = 0; i < MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE) {
4433 bank = gpio_bank(i);
4434
4435 - gpio_bank_saved[bank].fer = gpio_array[bank]->port_fer;
4436 - gpio_bank_saved[bank].mux = gpio_array[bank]->port_mux;
4437 - gpio_bank_saved[bank].data = gpio_array[bank]->data;
4438 - gpio_bank_saved[bank].data = gpio_array[bank]->data;
4439 - gpio_bank_saved[bank].inen = gpio_array[bank]->inen;
4440 - gpio_bank_saved[bank].dir = gpio_array[bank]->dir_set;
4441 + gpio_bank_saved[bank].fer = gpio_array[bank]->port_fer;
4442 + gpio_bank_saved[bank].mux = gpio_array[bank]->port_mux;
4443 + gpio_bank_saved[bank].data = gpio_array[bank]->port_data;
4444 + gpio_bank_saved[bank].data = gpio_array[bank]->port_data;
4445 + gpio_bank_saved[bank].inen = gpio_array[bank]->port_inen;
4446 + gpio_bank_saved[bank].dir = gpio_array[bank]->port_dir_set;
4447 }
4448 }
4449
4450 @@ -744,21 +831,21 @@
4451 int i, bank;
4452
4453 for (i = 0; i < MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE) {
4454 - bank = gpio_bank(i);
4455 + bank = gpio_bank(i);
4456
4457 - gpio_array[bank]->port_mux = gpio_bank_saved[bank].mux;
4458 - gpio_array[bank]->port_fer = gpio_bank_saved[bank].fer;
4459 - gpio_array[bank]->inen = gpio_bank_saved[bank].inen;
4460 - gpio_array[bank]->dir_set = gpio_bank_saved[bank].dir;
4461 - gpio_array[bank]->data_set = gpio_bank_saved[bank].data
4462 - | gpio_bank_saved[bank].dir;
4463 + gpio_array[bank]->port_mux = gpio_bank_saved[bank].mux;
4464 + gpio_array[bank]->port_fer = gpio_bank_saved[bank].fer;
4465 + gpio_array[bank]->port_inen = gpio_bank_saved[bank].inen;
4466 + gpio_array[bank]->port_dir_set = gpio_bank_saved[bank].dir;
4467 + gpio_array[bank]->port_set = gpio_bank_saved[bank].data
4468 + | gpio_bank_saved[bank].dir;
4469 }
4470 }
4471 #endif
4472
4473 unsigned short get_gpio_dir(unsigned gpio)
4474 {
4475 - return (0x01 & (gpio_array[gpio_bank(gpio)]->dir_clear >> gpio_sub_n(gpio)));
4476 + return (0x01 & (gpio_array[gpio_bank(gpio)]->port_dir_clear >> gpio_sub_n(gpio)));
4477 }
4478 EXPORT_SYMBOL(get_gpio_dir);
4479
4480 @@ -818,7 +905,9 @@
4481 */
4482
4483 #ifdef BF548_FAMILY
4484 - if (!((per & P_MAYSHARE) && get_portmux(per) == P_FUNCT2MUX(per))) {
4485 + u16 funct = get_portmux(ident);
4486 +
4487 + if (!((per & P_MAYSHARE) && (funct == P_FUNCT2MUX(per)))) {
4488 #else
4489 if (!(per & P_MAYSHARE)) {
4490 #endif
4491 @@ -842,7 +931,11 @@
4492 anyway:
4493 reserved_peri_map[gpio_bank(ident)] |= gpio_bit(ident);
4494
4495 - portmux_setup(per);
4496 +#ifdef BF548_FAMILY
4497 + portmux_setup(ident, P_FUNCT2MUX(per));
4498 +#else
4499 + portmux_setup(per, P_FUNCT2MUX(per));
4500 +#endif
4501 port_setup(ident, PERIPHERAL_USAGE);
4502
4503 local_irq_restore_hw(flags);
4504 @@ -884,6 +977,9 @@
4505 if (!(per & P_DEFINED))
4506 return;
4507
4508 + if (check_gpio(ident) < 0)
4509 + return;
4510 +
4511 local_irq_save_hw(flags);
4512
4513 if (unlikely(!(reserved_peri_map[gpio_bank(ident)] & gpio_bit(ident)))) {
4514 @@ -960,15 +1056,9 @@
4515 local_irq_restore_hw(flags);
4516 return -EBUSY;
4517 }
4518 - if (unlikely(reserved_gpio_irq_map[gpio_bank(gpio)] & gpio_bit(gpio))) {
4519 + if (unlikely(reserved_gpio_irq_map[gpio_bank(gpio)] & gpio_bit(gpio)))
4520 printk(KERN_NOTICE "bfin-gpio: GPIO %d is already reserved as gpio-irq!"
4521 " (Documentation/blackfin/bfin-gpio-notes.txt)\n", gpio);
4522 - }
4523 -#ifndef BF548_FAMILY
4524 - else { /* Reset POLAR setting when acquiring a gpio for the first time */
4525 - set_gpio_polar(gpio, 0);
4526 - }
4527 -#endif
4528
4529 reserved_gpio_map[gpio_bank(gpio)] |= gpio_bit(gpio);
4530 set_label(gpio, label);
4531 @@ -988,8 +1078,6 @@
4532 if (check_gpio(gpio) < 0)
4533 return;
4534
4535 - might_sleep();
4536 -
4537 local_irq_save_hw(flags);
4538
4539 if (unlikely(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio)))) {
4540 @@ -1070,16 +1158,8 @@
4541 local_irq_restore_hw(flags);
4542 }
4543
4544 -static inline void __bfin_gpio_direction_input(unsigned gpio)
4545 -{
4546 -#ifdef BF548_FAMILY
4547 - gpio_array[gpio_bank(gpio)]->dir_clear = gpio_bit(gpio);
4548 -#else
4549 - gpio_array[gpio_bank(gpio)]->dir &= ~gpio_bit(gpio);
4550 -#endif
4551 - gpio_array[gpio_bank(gpio)]->inen |= gpio_bit(gpio);
4552 -}
4553
4554 +#ifdef BF548_FAMILY
4555 int bfin_gpio_direction_input(unsigned gpio)
4556 {
4557 unsigned long flags;
4558 @@ -1090,85 +1170,125 @@
4559 }
4560
4561 local_irq_save_hw(flags);
4562 - __bfin_gpio_direction_input(gpio);
4563 - AWA_DUMMY_READ(inen);
4564 + gpio_array[gpio_bank(gpio)]->port_dir_clear = gpio_bit(gpio);
4565 + gpio_array[gpio_bank(gpio)]->port_inen |= gpio_bit(gpio);
4566 local_irq_restore_hw(flags);
4567
4568 return 0;
4569 }
4570 EXPORT_SYMBOL(bfin_gpio_direction_input);
4571
4572 -void bfin_gpio_irq_prepare(unsigned gpio)
4573 +int bfin_gpio_direction_output(unsigned gpio, int value)
4574 {
4575 -#ifdef BF548_FAMILY
4576 unsigned long flags;
4577 -#endif
4578
4579 - port_setup(gpio, GPIO_USAGE);
4580 + if (!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))) {
4581 + gpio_error(gpio);
4582 + return -EINVAL;
4583 + }
4584
4585 -#ifdef BF548_FAMILY
4586 local_irq_save_hw(flags);
4587 - __bfin_gpio_direction_input(gpio);
4588 + gpio_array[gpio_bank(gpio)]->port_inen &= ~gpio_bit(gpio);
4589 + gpio_set_value(gpio, value);
4590 + gpio_array[gpio_bank(gpio)]->port_dir_set = gpio_bit(gpio);
4591 local_irq_restore_hw(flags);
4592 -#endif
4593 +
4594 + return 0;
4595 }
4596 +EXPORT_SYMBOL(bfin_gpio_direction_output);
4597
4598 void bfin_gpio_set_value(unsigned gpio, int arg)
4599 {
4600 if (arg)
4601 - gpio_array[gpio_bank(gpio)]->data_set = gpio_bit(gpio);
4602 + gpio_array[gpio_bank(gpio)]->port_set = gpio_bit(gpio);
4603 else
4604 - gpio_array[gpio_bank(gpio)]->data_clear = gpio_bit(gpio);
4605 + gpio_array[gpio_bank(gpio)]->port_clear = gpio_bit(gpio);
4606 }
4607 EXPORT_SYMBOL(bfin_gpio_set_value);
4608
4609 -int bfin_gpio_direction_output(unsigned gpio, int value)
4610 +int bfin_gpio_get_value(unsigned gpio)
4611 +{
4612 + return (1 & (gpio_array[gpio_bank(gpio)]->port_data >> gpio_sub_n(gpio)));
4613 +}
4614 +EXPORT_SYMBOL(bfin_gpio_get_value);
4615 +
4616 +void bfin_gpio_irq_prepare(unsigned gpio)
4617 {
4618 unsigned long flags;
4619
4620 - if (!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))) {
4621 - gpio_error(gpio);
4622 - return -EINVAL;
4623 - }
4624 + port_setup(gpio, GPIO_USAGE);
4625
4626 local_irq_save_hw(flags);
4627 -
4628 - gpio_array[gpio_bank(gpio)]->inen &= ~gpio_bit(gpio);
4629 - gpio_set_value(gpio, value);
4630 -#ifdef BF548_FAMILY
4631 - gpio_array[gpio_bank(gpio)]->dir_set = gpio_bit(gpio);
4632 -#else
4633 - gpio_array[gpio_bank(gpio)]->dir |= gpio_bit(gpio);
4634 -#endif
4635 -
4636 - AWA_DUMMY_READ(dir);
4637 + gpio_array[gpio_bank(gpio)]->port_dir_clear = gpio_bit(gpio);
4638 + gpio_array[gpio_bank(gpio)]->port_inen |= gpio_bit(gpio);
4639 local_irq_restore_hw(flags);
4640 -
4641 - return 0;
4642 }
4643 -EXPORT_SYMBOL(bfin_gpio_direction_output);
4644 +
4645 +#else
4646
4647 int bfin_gpio_get_value(unsigned gpio)
4648 {
4649 -#ifdef BF548_FAMILY
4650 - return (1 & (gpio_array[gpio_bank(gpio)]->data >> gpio_sub_n(gpio)));
4651 -#else
4652 unsigned long flags;
4653 + int ret;
4654
4655 if (unlikely(get_gpio_edge(gpio))) {
4656 - int ret;
4657 local_irq_save_hw(flags);
4658 set_gpio_edge(gpio, 0);
4659 ret = get_gpio_data(gpio);
4660 set_gpio_edge(gpio, 1);
4661 local_irq_restore_hw(flags);
4662 +
4663 return ret;
4664 } else
4665 return get_gpio_data(gpio);
4666 -#endif
4667 }
4668 EXPORT_SYMBOL(bfin_gpio_get_value);
4669
4670 +
4671 +int bfin_gpio_direction_input(unsigned gpio)
4672 +{
4673 + unsigned long flags;
4674 +
4675 + if (!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))) {
4676 + gpio_error(gpio);
4677 + return -EINVAL;
4678 + }
4679 +
4680 + local_irq_save_hw(flags);
4681 + gpio_bankb[gpio_bank(gpio)]->dir &= ~gpio_bit(gpio);
4682 + gpio_bankb[gpio_bank(gpio)]->inen |= gpio_bit(gpio);
4683 + AWA_DUMMY_READ(inen);
4684 + local_irq_restore_hw(flags);
4685 +
4686 + return 0;
4687 +}
4688 +EXPORT_SYMBOL(bfin_gpio_direction_input);
4689 +
4690 +int bfin_gpio_direction_output(unsigned gpio, int value)
4691 +{
4692 + unsigned long flags;
4693 +
4694 + if (!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))) {
4695 + gpio_error(gpio);
4696 + return -EINVAL;
4697 + }
4698 +
4699 + local_irq_save_hw(flags);
4700 + gpio_bankb[gpio_bank(gpio)]->inen &= ~gpio_bit(gpio);
4701 +
4702 + if (value)
4703 + gpio_bankb[gpio_bank(gpio)]->data_set = gpio_bit(gpio);
4704 + else
4705 + gpio_bankb[gpio_bank(gpio)]->data_clear = gpio_bit(gpio);
4706 +
4707 + gpio_bankb[gpio_bank(gpio)]->dir |= gpio_bit(gpio);
4708 + AWA_DUMMY_READ(dir);
4709 + local_irq_restore_hw(flags);
4710 +
4711 + return 0;
4712 +}
4713 +EXPORT_SYMBOL(bfin_gpio_direction_output);
4714 +
4715 /* If we are booting from SPI and our board lacks a strong enough pull up,
4716 * the core can reset and execute the bootrom faster than the resistor can
4717 * pull the signal logically high. To work around this (common) error in
4718 @@ -1179,15 +1299,23 @@
4719 * lives here as we need to force all the GPIO states w/out going through
4720 * BUG() checks and such.
4721 */
4722 -void bfin_reset_boot_spi_cs(unsigned short pin)
4723 +void bfin_gpio_reset_spi0_ssel1(void)
4724 {
4725 - unsigned short gpio = P_IDENT(pin);
4726 + u16 gpio = P_IDENT(P_SPI0_SSEL1);
4727 +
4728 port_setup(gpio, GPIO_USAGE);
4729 - gpio_array[gpio_bank(gpio)]->data_set = gpio_bit(gpio);
4730 + gpio_bankb[gpio_bank(gpio)]->data_set = gpio_bit(gpio);
4731 AWA_DUMMY_READ(data_set);
4732 udelay(1);
4733 }
4734
4735 +void bfin_gpio_irq_prepare(unsigned gpio)
4736 +{
4737 + port_setup(gpio, GPIO_USAGE);
4738 +}
4739 +
4740 +#endif /*BF548_FAMILY */
4741 +
4742 #if defined(CONFIG_PROC_FS)
4743 static int gpio_proc_read(char *buf, char **start, off_t offset,
4744 int len, int *unused_i, void *unused_v)
4745 @@ -1241,7 +1369,11 @@
4746
4747 void bfin_gpiolib_set_value(struct gpio_chip *chip, unsigned gpio, int value)
4748 {
4749 +#ifdef BF548_FAMILY
4750 return bfin_gpio_set_value(gpio, value);
4751 +#else
4752 + return set_gpio_data(gpio, value);
4753 +#endif
4754 }
4755
4756 int bfin_gpiolib_gpio_request(struct gpio_chip *chip, unsigned gpio)
4757 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/kernel/cplb-mpu/cplbinit.c linux-2.6.29-rc3.owrt/arch/blackfin/kernel/cplb-mpu/cplbinit.c
4758 --- linux-2.6.29.owrt/arch/blackfin/kernel/cplb-mpu/cplbinit.c 2009-05-10 22:04:41.000000000 +0200
4759 +++ linux-2.6.29-rc3.owrt/arch/blackfin/kernel/cplb-mpu/cplbinit.c 2009-05-10 23:48:28.000000000 +0200
4760 @@ -63,8 +63,10 @@
4761 dcplb_tbl[cpu][i_d].addr = 0;
4762 dcplb_tbl[cpu][i_d++].data = SDRAM_OOPS | PAGE_SIZE_1KB;
4763
4764 +#if 0
4765 icplb_tbl[cpu][i_i].addr = 0;
4766 - icplb_tbl[cpu][i_i++].data = i_cache | CPLB_USER_RD | PAGE_SIZE_1KB;
4767 + icplb_tbl[cpu][i_i++].data = i_cache | CPLB_USER_RD | PAGE_SIZE_4KB;
4768 +#endif
4769
4770 /* Cover kernel memory with 4M pages. */
4771 addr = 0;
4772 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/kernel/cplb-nompu/cplbinit.c linux-2.6.29-rc3.owrt/arch/blackfin/kernel/cplb-nompu/cplbinit.c
4773 --- linux-2.6.29.owrt/arch/blackfin/kernel/cplb-nompu/cplbinit.c 2009-05-10 22:04:41.000000000 +0200
4774 +++ linux-2.6.29-rc3.owrt/arch/blackfin/kernel/cplb-nompu/cplbinit.c 2009-05-10 23:48:28.000000000 +0200
4775 @@ -53,13 +53,9 @@
4776
4777 i_d = i_i = 0;
4778
4779 -#ifdef CONFIG_DEBUG_HUNT_FOR_ZERO
4780 /* Set up the zero page. */
4781 d_tbl[i_d].addr = 0;
4782 d_tbl[i_d++].data = SDRAM_OOPS | PAGE_SIZE_1KB;
4783 - i_tbl[i_i].addr = 0;
4784 - i_tbl[i_i++].data = SDRAM_OOPS | PAGE_SIZE_1KB;
4785 -#endif
4786
4787 /* Cover kernel memory with 4M pages. */
4788 addr = 0;
4789 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/kernel/cplb-nompu/cplbmgr.c linux-2.6.29-rc3.owrt/arch/blackfin/kernel/cplb-nompu/cplbmgr.c
4790 --- linux-2.6.29.owrt/arch/blackfin/kernel/cplb-nompu/cplbmgr.c 2009-05-10 22:04:41.000000000 +0200
4791 +++ linux-2.6.29-rc3.owrt/arch/blackfin/kernel/cplb-nompu/cplbmgr.c 2009-05-10 23:48:28.000000000 +0200
4792 @@ -163,14 +163,12 @@
4793 nr_icplb_supv_miss[cpu]++;
4794
4795 base = 0;
4796 - idx = 0;
4797 - do {
4798 + for (idx = 0; idx < icplb_nr_bounds; idx++) {
4799 eaddr = icplb_bounds[idx].eaddr;
4800 if (addr < eaddr)
4801 break;
4802 base = eaddr;
4803 - } while (++idx < icplb_nr_bounds);
4804 -
4805 + }
4806 if (unlikely(idx == icplb_nr_bounds))
4807 return CPLB_NO_ADDR_MATCH;
4808
4809 @@ -210,14 +208,12 @@
4810 nr_dcplb_supv_miss[cpu]++;
4811
4812 base = 0;
4813 - idx = 0;
4814 - do {
4815 + for (idx = 0; idx < dcplb_nr_bounds; idx++) {
4816 eaddr = dcplb_bounds[idx].eaddr;
4817 if (addr < eaddr)
4818 break;
4819 base = eaddr;
4820 - } while (++idx < dcplb_nr_bounds);
4821 -
4822 + }
4823 if (unlikely(idx == dcplb_nr_bounds))
4824 return CPLB_NO_ADDR_MATCH;
4825
4826 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/kernel/ipipe.c linux-2.6.29-rc3.owrt/arch/blackfin/kernel/ipipe.c
4827 --- linux-2.6.29.owrt/arch/blackfin/kernel/ipipe.c 2009-05-10 22:04:41.000000000 +0200
4828 +++ linux-2.6.29-rc3.owrt/arch/blackfin/kernel/ipipe.c 2009-05-10 23:48:28.000000000 +0200
4829 @@ -35,8 +35,14 @@
4830 #include <asm/atomic.h>
4831 #include <asm/io.h>
4832
4833 +static int create_irq_threads;
4834 +
4835 DEFINE_PER_CPU(struct pt_regs, __ipipe_tick_regs);
4836
4837 +static DEFINE_PER_CPU(unsigned long, pending_irqthread_mask);
4838 +
4839 +static DEFINE_PER_CPU(int [IVG13 + 1], pending_irq_count);
4840 +
4841 asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs);
4842
4843 static void __ipipe_no_irqtail(void);
4844 @@ -87,7 +93,6 @@
4845 */
4846 void __ipipe_handle_irq(unsigned irq, struct pt_regs *regs)
4847 {
4848 - struct ipipe_percpu_domain_data *p = ipipe_root_cpudom_ptr();
4849 struct ipipe_domain *this_domain, *next_domain;
4850 struct list_head *head, *pos;
4851 int m_ack, s = -1;
4852 @@ -99,6 +104,7 @@
4853 * interrupt.
4854 */
4855 m_ack = (regs == NULL || irq == IRQ_SYSTMR || irq == IRQ_CORETMR);
4856 +
4857 this_domain = ipipe_current_domain;
4858
4859 if (unlikely(test_bit(IPIPE_STICKY_FLAG, &this_domain->irqs[irq].control)))
4860 @@ -108,28 +114,49 @@
4861 next_domain = list_entry(head, struct ipipe_domain, p_link);
4862 if (likely(test_bit(IPIPE_WIRED_FLAG, &next_domain->irqs[irq].control))) {
4863 if (!m_ack && next_domain->irqs[irq].acknowledge != NULL)
4864 - next_domain->irqs[irq].acknowledge(irq, irq_to_desc(irq));
4865 - if (test_bit(IPIPE_SYNCDEFER_FLAG, &p->status))
4866 - s = __test_and_set_bit(IPIPE_STALL_FLAG, &p->status);
4867 + next_domain->irqs[irq].acknowledge(irq, irq_desc + irq);
4868 + if (test_bit(IPIPE_ROOTLOCK_FLAG, &ipipe_root_domain->flags))
4869 + s = __test_and_set_bit(IPIPE_STALL_FLAG,
4870 + &ipipe_root_cpudom_var(status));
4871 __ipipe_dispatch_wired(next_domain, irq);
4872 - goto out;
4873 + goto finalize;
4874 + return;
4875 }
4876 }
4877
4878 /* Ack the interrupt. */
4879
4880 pos = head;
4881 +
4882 while (pos != &__ipipe_pipeline) {
4883 next_domain = list_entry(pos, struct ipipe_domain, p_link);
4884 + /*
4885 + * For each domain handling the incoming IRQ, mark it
4886 + * as pending in its log.
4887 + */
4888 if (test_bit(IPIPE_HANDLE_FLAG, &next_domain->irqs[irq].control)) {
4889 + /*
4890 + * Domains that handle this IRQ are polled for
4891 + * acknowledging it by decreasing priority
4892 + * order. The interrupt must be made pending
4893 + * _first_ in the domain's status flags before
4894 + * the PIC is unlocked.
4895 + */
4896 __ipipe_set_irq_pending(next_domain, irq);
4897 +
4898 if (!m_ack && next_domain->irqs[irq].acknowledge != NULL) {
4899 - next_domain->irqs[irq].acknowledge(irq, irq_to_desc(irq));
4900 + next_domain->irqs[irq].acknowledge(irq, irq_desc + irq);
4901 m_ack = 1;
4902 }
4903 }
4904 +
4905 + /*
4906 + * If the domain does not want the IRQ to be passed
4907 + * down the interrupt pipe, exit the loop now.
4908 + */
4909 if (!test_bit(IPIPE_PASS_FLAG, &next_domain->irqs[irq].control))
4910 break;
4911 +
4912 pos = next_domain->p_link.next;
4913 }
4914
4915 @@ -139,24 +166,18 @@
4916 * immediately to the current domain if the interrupt has been
4917 * marked as 'sticky'. This search does not go beyond the
4918 * current domain in the pipeline. We also enforce the
4919 - * additional root stage lock (blackfin-specific).
4920 - */
4921 - if (test_bit(IPIPE_SYNCDEFER_FLAG, &p->status))
4922 - s = __test_and_set_bit(IPIPE_STALL_FLAG, &p->status);
4923 + * additional root stage lock (blackfin-specific). */
4924
4925 - /*
4926 - * If the interrupt preempted the head domain, then do not
4927 - * even try to walk the pipeline, unless an interrupt is
4928 - * pending for it.
4929 - */
4930 - if (test_bit(IPIPE_AHEAD_FLAG, &this_domain->flags) &&
4931 - ipipe_head_cpudom_var(irqpend_himask) == 0)
4932 - goto out;
4933 + if (test_bit(IPIPE_ROOTLOCK_FLAG, &ipipe_root_domain->flags))
4934 + s = __test_and_set_bit(IPIPE_STALL_FLAG,
4935 + &ipipe_root_cpudom_var(status));
4936 +finalize:
4937
4938 __ipipe_walk_pipeline(head);
4939 -out:
4940 +
4941 if (!s)
4942 - __clear_bit(IPIPE_STALL_FLAG, &p->status);
4943 + __clear_bit(IPIPE_STALL_FLAG,
4944 + &ipipe_root_cpudom_var(status));
4945 }
4946
4947 int __ipipe_check_root(void)
4948 @@ -166,7 +187,7 @@
4949
4950 void __ipipe_enable_irqdesc(struct ipipe_domain *ipd, unsigned irq)
4951 {
4952 - struct irq_desc *desc = irq_to_desc(irq);
4953 + struct irq_desc *desc = irq_desc + irq;
4954 int prio = desc->ic_prio;
4955
4956 desc->depth = 0;
4957 @@ -178,7 +199,7 @@
4958
4959 void __ipipe_disable_irqdesc(struct ipipe_domain *ipd, unsigned irq)
4960 {
4961 - struct irq_desc *desc = irq_to_desc(irq);
4962 + struct irq_desc *desc = irq_desc + irq;
4963 int prio = desc->ic_prio;
4964
4965 if (ipd != &ipipe_root &&
4966 @@ -215,18 +236,15 @@
4967 {
4968 unsigned long flags;
4969
4970 - /*
4971 - * We need to run the IRQ tail hook whenever we don't
4972 + /* We need to run the IRQ tail hook whenever we don't
4973 * propagate a syscall to higher domains, because we know that
4974 * important operations might be pending there (e.g. Xenomai
4975 - * deferred rescheduling).
4976 - */
4977 + * deferred rescheduling). */
4978
4979 - if (regs->orig_p0 < NR_syscalls) {
4980 + if (!__ipipe_syscall_watched_p(current, regs->orig_p0)) {
4981 void (*hook)(void) = (void (*)(void))__ipipe_irq_tail_hook;
4982 hook();
4983 - if ((current->flags & PF_EVNOTIFY) == 0)
4984 - return 0;
4985 + return 0;
4986 }
4987
4988 /*
4989 @@ -294,46 +312,112 @@
4990 {
4991 unsigned long flags;
4992
4993 -#ifdef CONFIG_IPIPE_DEBUG
4994 if (irq >= IPIPE_NR_IRQS ||
4995 (ipipe_virtual_irq_p(irq)
4996 && !test_bit(irq - IPIPE_VIRQ_BASE, &__ipipe_virtual_irq_map)))
4997 return -EINVAL;
4998 -#endif
4999
5000 local_irq_save_hw(flags);
5001 +
5002 __ipipe_handle_irq(irq, NULL);
5003 +
5004 local_irq_restore_hw(flags);
5005
5006 return 1;
5007 }
5008
5009 -asmlinkage void __ipipe_sync_root(void)
5010 +/* Move Linux IRQ to threads. */
5011 +
5012 +static int do_irqd(void *__desc)
5013 {
5014 - unsigned long flags;
5015 + struct irq_desc *desc = __desc;
5016 + unsigned irq = desc - irq_desc;
5017 + int thrprio = desc->thr_prio;
5018 + int thrmask = 1 << thrprio;
5019 + int cpu = smp_processor_id();
5020 + cpumask_t cpumask;
5021 +
5022 + sigfillset(&current->blocked);
5023 + current->flags |= PF_NOFREEZE;
5024 + cpumask = cpumask_of_cpu(cpu);
5025 + set_cpus_allowed(current, cpumask);
5026 + ipipe_setscheduler_root(current, SCHED_FIFO, 50 + thrprio);
5027 +
5028 + while (!kthread_should_stop()) {
5029 + local_irq_disable();
5030 + if (!(desc->status & IRQ_SCHEDULED)) {
5031 + set_current_state(TASK_INTERRUPTIBLE);
5032 +resched:
5033 + local_irq_enable();
5034 + schedule();
5035 + local_irq_disable();
5036 + }
5037 + __set_current_state(TASK_RUNNING);
5038 + /*
5039 + * If higher priority interrupt servers are ready to
5040 + * run, reschedule immediately. We need this for the
5041 + * GPIO demux IRQ handler to unmask the interrupt line
5042 + * _last_, after all GPIO IRQs have run.
5043 + */
5044 + if (per_cpu(pending_irqthread_mask, cpu) & ~(thrmask|(thrmask-1)))
5045 + goto resched;
5046 + if (--per_cpu(pending_irq_count[thrprio], cpu) == 0)
5047 + per_cpu(pending_irqthread_mask, cpu) &= ~thrmask;
5048 + desc->status &= ~IRQ_SCHEDULED;
5049 + desc->thr_handler(irq, &__raw_get_cpu_var(__ipipe_tick_regs));
5050 + local_irq_enable();
5051 + }
5052 + __set_current_state(TASK_RUNNING);
5053 + return 0;
5054 +}
5055
5056 - BUG_ON(irqs_disabled());
5057 +static void kick_irqd(unsigned irq, void *cookie)
5058 +{
5059 + struct irq_desc *desc = irq_desc + irq;
5060 + int thrprio = desc->thr_prio;
5061 + int thrmask = 1 << thrprio;
5062 + int cpu = smp_processor_id();
5063 +
5064 + if (!(desc->status & IRQ_SCHEDULED)) {
5065 + desc->status |= IRQ_SCHEDULED;
5066 + per_cpu(pending_irqthread_mask, cpu) |= thrmask;
5067 + ++per_cpu(pending_irq_count[thrprio], cpu);
5068 + wake_up_process(desc->thread);
5069 + }
5070 +}
5071
5072 - local_irq_save_hw(flags);
5073 +int ipipe_start_irq_thread(unsigned irq, struct irq_desc *desc)
5074 +{
5075 + if (desc->thread || !create_irq_threads)
5076 + return 0;
5077
5078 - clear_thread_flag(TIF_IRQ_SYNC);
5079 + desc->thread = kthread_create(do_irqd, desc, "IRQ %d", irq);
5080 + if (desc->thread == NULL) {
5081 + printk(KERN_ERR "irqd: could not create IRQ thread %d!\n", irq);
5082 + return -ENOMEM;
5083 + }
5084
5085 - if (ipipe_root_cpudom_var(irqpend_himask) != 0)
5086 - __ipipe_sync_pipeline(IPIPE_IRQMASK_ANY);
5087 + wake_up_process(desc->thread);
5088
5089 - local_irq_restore_hw(flags);
5090 + desc->thr_handler = ipipe_root_domain->irqs[irq].handler;
5091 + ipipe_root_domain->irqs[irq].handler = &kick_irqd;
5092 +
5093 + return 0;
5094 }
5095
5096 -void ___ipipe_sync_pipeline(unsigned long syncmask)
5097 +void __init ipipe_init_irq_threads(void)
5098 {
5099 - struct ipipe_domain *ipd = ipipe_current_domain;
5100 + unsigned irq;
5101 + struct irq_desc *desc;
5102
5103 - if (ipd == ipipe_root_domain) {
5104 - if (test_bit(IPIPE_SYNCDEFER_FLAG, &ipipe_root_cpudom_var(status)))
5105 - return;
5106 - }
5107 + create_irq_threads = 1;
5108
5109 - __ipipe_sync_stage(syncmask);
5110 + for (irq = 0; irq < NR_IRQS; irq++) {
5111 + desc = irq_desc + irq;
5112 + if (desc->action != NULL ||
5113 + (desc->status & IRQ_NOREQUEST) != 0)
5114 + ipipe_start_irq_thread(irq, desc);
5115 + }
5116 }
5117
5118 EXPORT_SYMBOL(show_stack);
5119 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/kernel/irqchip.c linux-2.6.29-rc3.owrt/arch/blackfin/kernel/irqchip.c
5120 --- linux-2.6.29.owrt/arch/blackfin/kernel/irqchip.c 2009-05-10 22:04:41.000000000 +0200
5121 +++ linux-2.6.29-rc3.owrt/arch/blackfin/kernel/irqchip.c 2009-05-10 23:48:28.000000000 +0200
5122 @@ -35,7 +35,6 @@
5123 #include <linux/interrupt.h>
5124 #include <linux/irq.h>
5125 #include <asm/trace.h>
5126 -#include <asm/pda.h>
5127
5128 static atomic_t irq_err_count;
5129 static spinlock_t irq_controller_lock;
5130 @@ -92,13 +91,8 @@
5131 seq_putc(p, '\n');
5132 skip:
5133 spin_unlock_irqrestore(&irq_desc[i].lock, flags);
5134 - } else if (i == NR_IRQS) {
5135 - seq_printf(p, "NMI: ");
5136 - for_each_online_cpu(j)
5137 - seq_printf(p, "%10u ", cpu_pda[j].__nmi_count);
5138 - seq_printf(p, " CORE Non Maskable Interrupt\n");
5139 + } else if (i == NR_IRQS)
5140 seq_printf(p, "Err: %10u\n", atomic_read(&irq_err_count));
5141 - }
5142 return 0;
5143 }
5144
5145 @@ -144,15 +138,11 @@
5146 #endif
5147 generic_handle_irq(irq);
5148
5149 -#ifndef CONFIG_IPIPE
5150 - /*
5151 - * If we're the only interrupt running (ignoring IRQ15 which
5152 - * is for syscalls), lower our priority to IRQ14 so that
5153 - * softirqs run at that level. If there's another,
5154 - * lower-level interrupt, irq_exit will defer softirqs to
5155 - * that. If the interrupt pipeline is enabled, we are already
5156 - * running at IRQ14 priority, so we don't need this code.
5157 - */
5158 +#ifndef CONFIG_IPIPE /* Useless and bugous over the I-pipe: IRQs are threaded. */
5159 + /* If we're the only interrupt running (ignoring IRQ15 which is for
5160 + syscalls), lower our priority to IRQ14 so that softirqs run at
5161 + that level. If there's another, lower-level interrupt, irq_exit
5162 + will defer softirqs to that. */
5163 CSYNC();
5164 pending = bfin_read_IPEND() & ~0x8000;
5165 other_ints = pending & (pending - 1);
5166 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/kernel/kgdb_test.c linux-2.6.29-rc3.owrt/arch/blackfin/kernel/kgdb_test.c
5167 --- linux-2.6.29.owrt/arch/blackfin/kernel/kgdb_test.c 2009-05-10 22:04:41.000000000 +0200
5168 +++ linux-2.6.29-rc3.owrt/arch/blackfin/kernel/kgdb_test.c 2009-05-10 23:48:28.000000000 +0200
5169 @@ -20,7 +20,6 @@
5170 static char cmdline[256];
5171 static unsigned long len;
5172
5173 -#ifndef CONFIG_SMP
5174 static int num1 __attribute__((l1_data));
5175
5176 void kgdb_l1_test(void) __attribute__((l1_text));
5177 @@ -33,8 +32,6 @@
5178 printk(KERN_ALERT "L1(after change) : data variable addr = 0x%p, data value is %d\n", &num1, num1);
5179 return ;
5180 }
5181 -#endif
5182 -
5183 #if L2_LENGTH
5184
5185 static int num2 __attribute__((l2));
5186 @@ -62,12 +59,10 @@
5187 static int test_proc_output(char *buf)
5188 {
5189 kgdb_test("hello world!", 12, 0x55, 0x10);
5190 -#ifndef CONFIG_SMP
5191 kgdb_l1_test();
5192 -#endif
5193 -#if L2_LENGTH
5194 + #if L2_LENGTH
5195 kgdb_l2_test();
5196 -#endif
5197 + #endif
5198
5199 return 0;
5200 }
5201 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/kernel/Makefile linux-2.6.29-rc3.owrt/arch/blackfin/kernel/Makefile
5202 --- linux-2.6.29.owrt/arch/blackfin/kernel/Makefile 2009-05-10 22:04:41.000000000 +0200
5203 +++ linux-2.6.29-rc3.owrt/arch/blackfin/kernel/Makefile 2009-05-10 23:48:28.000000000 +0200
5204 @@ -21,9 +21,5 @@
5205 obj-$(CONFIG_CPLB_INFO) += cplbinfo.o
5206 obj-$(CONFIG_MODULES) += module.o
5207 obj-$(CONFIG_KGDB) += kgdb.o
5208 -obj-$(CONFIG_KGDB_TESTS) += kgdb_test.o
5209 +obj-$(CONFIG_KGDB_TESTCASE) += kgdb_test.o
5210 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
5211 -
5212 -# the kgdb test puts code into L2 and without linker
5213 -# relaxation, we need to force long calls to/from it
5214 -CFLAGS_kgdb_test.o := -mlong-calls -O0
5215 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/kernel/ptrace.c linux-2.6.29-rc3.owrt/arch/blackfin/kernel/ptrace.c
5216 --- linux-2.6.29.owrt/arch/blackfin/kernel/ptrace.c 2009-05-10 22:04:41.000000000 +0200
5217 +++ linux-2.6.29-rc3.owrt/arch/blackfin/kernel/ptrace.c 2009-05-10 23:48:28.000000000 +0200
5218 @@ -45,7 +45,6 @@
5219 #include <asm/asm-offsets.h>
5220 #include <asm/dma.h>
5221 #include <asm/fixed_code.h>
5222 -#include <asm/cacheflush.h>
5223 #include <asm/mem_map.h>
5224
5225 #define TEXT_OFFSET 0
5226 @@ -241,7 +240,7 @@
5227
5228 } else if (addr >= FIXED_CODE_START
5229 && addr + sizeof(tmp) <= FIXED_CODE_END) {
5230 - copy_from_user_page(0, 0, 0, &tmp, (const void *)(addr), sizeof(tmp));
5231 + memcpy(&tmp, (const void *)(addr), sizeof(tmp));
5232 copied = sizeof(tmp);
5233
5234 } else
5235 @@ -321,7 +320,7 @@
5236
5237 } else if (addr >= FIXED_CODE_START
5238 && addr + sizeof(data) <= FIXED_CODE_END) {
5239 - copy_to_user_page(0, 0, 0, (void *)(addr), &data, sizeof(data));
5240 + memcpy((void *)(addr), &data, sizeof(data));
5241 copied = sizeof(data);
5242
5243 } else
5244 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/kernel/reboot.c linux-2.6.29-rc3.owrt/arch/blackfin/kernel/reboot.c
5245 --- linux-2.6.29.owrt/arch/blackfin/kernel/reboot.c 2009-05-10 22:04:41.000000000 +0200
5246 +++ linux-2.6.29-rc3.owrt/arch/blackfin/kernel/reboot.c 2009-05-10 23:48:28.000000000 +0200
5247 @@ -20,8 +20,8 @@
5248 * reset while the Core B bit (on dual core parts) is cleared by
5249 * the core reset.
5250 */
5251 -__attribute__ ((__l1_text__, __noreturn__))
5252 -static void bfin_reset(void)
5253 +__attribute__((l1_text))
5254 +static void _bfin_reset(void)
5255 {
5256 /* Wait for completion of "system" events such as cache line
5257 * line fills so that we avoid infinite stalls later on as
5258 @@ -30,11 +30,7 @@
5259 */
5260 __builtin_bfin_ssync();
5261
5262 - /* The bootrom checks to see how it was reset and will
5263 - * automatically perform a software reset for us when
5264 - * it starts executing after the core reset.
5265 - */
5266 - if (ANOMALY_05000353 || ANOMALY_05000386) {
5267 + while (1) {
5268 /* Initiate System software reset. */
5269 bfin_write_SWRST(0x7);
5270
5271 @@ -54,11 +50,6 @@
5272 /* Clear System software reset */
5273 bfin_write_SWRST(0);
5274
5275 - /* The BF526 ROM will crash during reset */
5276 -#if defined(__ADSPBF522__) || defined(__ADSPBF524__) || defined(__ADSPBF526__)
5277 - bfin_read_SWRST();
5278 -#endif
5279 -
5280 /* Wait for the SWRST write to complete. Cannot rely on SSYNC
5281 * though as the System state is all reset now.
5282 */
5283 @@ -69,11 +60,22 @@
5284 : "a" (15 * 1)
5285 : "LC1", "LB1", "LT1"
5286 );
5287 - }
5288
5289 - while (1)
5290 /* Issue core reset */
5291 asm("raise 1");
5292 + }
5293 +}
5294 +
5295 +static void bfin_reset(void)
5296 +{
5297 + if (ANOMALY_05000353 || ANOMALY_05000386)
5298 + _bfin_reset();
5299 + else
5300 + /* the bootrom checks to see how it was reset and will
5301 + * automatically perform a software reset for us when
5302 + * it starts executing boot
5303 + */
5304 + asm("raise 1;");
5305 }
5306
5307 __attribute__((weak))
5308 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/kernel/setup.c linux-2.6.29-rc3.owrt/arch/blackfin/kernel/setup.c
5309 --- linux-2.6.29.owrt/arch/blackfin/kernel/setup.c 2009-05-10 22:04:41.000000000 +0200
5310 +++ linux-2.6.29-rc3.owrt/arch/blackfin/kernel/setup.c 2009-05-10 23:48:28.000000000 +0200
5311 @@ -60,7 +60,7 @@
5312 #define BFIN_MEMMAP_MAX 128 /* number of entries in bfin_memmap */
5313 #define BFIN_MEMMAP_RAM 1
5314 #define BFIN_MEMMAP_RESERVED 2
5315 -static struct bfin_memmap {
5316 +struct bfin_memmap {
5317 int nr_map;
5318 struct bfin_memmap_entry {
5319 unsigned long long addr; /* start of memory segment */
5320 @@ -824,15 +824,7 @@
5321 flash_probe();
5322 #endif
5323
5324 - printk(KERN_INFO "Boot Mode: %i\n", bfin_read_SYSCR() & 0xF);
5325 -
5326 - /* Newer parts mirror SWRST bits in SYSCR */
5327 -#if defined(CONFIG_BF53x) || defined(CONFIG_BF561) || \
5328 - defined(CONFIG_BF538) || defined(CONFIG_BF539)
5329 _bfin_swrst = bfin_read_SWRST();
5330 -#else
5331 - _bfin_swrst = bfin_read_SYSCR();
5332 -#endif
5333
5334 #ifdef CONFIG_DEBUG_DOUBLEFAULT_PRINT
5335 bfin_write_SWRST(_bfin_swrst & ~DOUBLE_FAULT);
5336 @@ -861,7 +853,7 @@
5337 else if (_bfin_swrst & RESET_SOFTWARE)
5338 printk(KERN_NOTICE "Reset caused by Software reset\n");
5339
5340 - printk(KERN_INFO "Blackfin support (C) 2004-2009 Analog Devices, Inc.\n");
5341 + printk(KERN_INFO "Blackfin support (C) 2004-2008 Analog Devices, Inc.\n");
5342 if (bfin_compiled_revid() == 0xffff)
5343 printk(KERN_INFO "Compiled for ADSP-%s Rev any\n", CPU);
5344 else if (bfin_compiled_revid() == -1)
5345 @@ -889,10 +881,6 @@
5346 CPU, bfin_revid());
5347 }
5348
5349 - /* We can't run on BF548-0.1 due to ANOMALY 05000448 */
5350 - if (bfin_cpuid() == 0x27de && bfin_revid() == 1)
5351 - panic("You can't run on this processor due to 05000448\n");
5352 -
5353 printk(KERN_INFO "Blackfin Linux support by http://blackfin.uclinux.org/\n");
5354
5355 printk(KERN_INFO "Processor Speed: %lu MHz core clock and %lu MHz System Clock\n",
5356 @@ -1145,12 +1133,12 @@
5357 icache_size = 0;
5358
5359 seq_printf(m, "cache size\t: %d KB(L1 icache) "
5360 - "%d KB(L1 dcache%s) %d KB(L2 cache)\n",
5361 + "%d KB(L1 dcache-%s) %d KB(L2 cache)\n",
5362 icache_size, dcache_size,
5363 #if defined CONFIG_BFIN_WB
5364 - "-wb"
5365 + "wb"
5366 #elif defined CONFIG_BFIN_WT
5367 - "-wt"
5368 + "wt"
5369 #endif
5370 "", 0);
5371
5372 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/kernel/time.c linux-2.6.29-rc3.owrt/arch/blackfin/kernel/time.c
5373 --- linux-2.6.29.owrt/arch/blackfin/kernel/time.c 2009-05-10 22:04:41.000000000 +0200
5374 +++ linux-2.6.29-rc3.owrt/arch/blackfin/kernel/time.c 2009-05-10 23:48:28.000000000 +0200
5375 @@ -134,10 +134,7 @@
5376
5377 write_seqlock(&xtime_lock);
5378 #if defined(CONFIG_TICK_SOURCE_SYSTMR0) && !defined(CONFIG_IPIPE)
5379 - /*
5380 - * TIMIL0 is latched in __ipipe_grab_irq() when the I-Pipe is
5381 - * enabled.
5382 - */
5383 +/* FIXME: Here TIMIL0 is not set when IPIPE enabled, why? */
5384 if (get_gptimer_status(0) & TIMER_STATUS_TIMIL0) {
5385 #endif
5386 do_timer(1);
5387 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/kernel/traps.c linux-2.6.29-rc3.owrt/arch/blackfin/kernel/traps.c
5388 --- linux-2.6.29.owrt/arch/blackfin/kernel/traps.c 2009-05-10 22:04:41.000000000 +0200
5389 +++ linux-2.6.29-rc3.owrt/arch/blackfin/kernel/traps.c 2009-05-10 23:48:28.000000000 +0200
5390 @@ -673,14 +673,6 @@
5391 verbose_printk("RTI");
5392 else if (opcode == 0x0012)
5393 verbose_printk("RTX");
5394 - else if (opcode == 0x0013)
5395 - verbose_printk("RTN");
5396 - else if (opcode == 0x0014)
5397 - verbose_printk("RTE");
5398 - else if (opcode == 0x0025)
5399 - verbose_printk("EMUEXCPT");
5400 - else if (opcode == 0x0040 && opcode <= 0x0047)
5401 - verbose_printk("STI R%i", opcode & 7);
5402 else if (opcode >= 0x0050 && opcode <= 0x0057)
5403 verbose_printk("JUMP (P%i)", opcode & 7);
5404 else if (opcode >= 0x0060 && opcode <= 0x0067)
5405 @@ -689,10 +681,6 @@
5406 verbose_printk("CALL (PC+P%i)", opcode & 7);
5407 else if (opcode >= 0x0080 && opcode <= 0x0087)
5408 verbose_printk("JUMP (PC+P%i)", opcode & 7);
5409 - else if (opcode >= 0x0090 && opcode <= 0x009F)
5410 - verbose_printk("RAISE 0x%x", opcode & 0xF);
5411 - else if (opcode >= 0x00A0 && opcode <= 0x00AF)
5412 - verbose_printk("EXCPT 0x%x", opcode & 0xF);
5413 else if ((opcode >= 0x1000 && opcode <= 0x13FF) || (opcode >= 0x1800 && opcode <= 0x1BFF))
5414 verbose_printk("IF !CC JUMP");
5415 else if ((opcode >= 0x1400 && opcode <= 0x17ff) || (opcode >= 0x1c00 && opcode <= 0x1fff))
5416 @@ -832,8 +820,11 @@
5417 decode_address(buf, (unsigned int)stack);
5418 printk(KERN_NOTICE " SP: [0x%p] %s\n", stack, buf);
5419
5420 + addr = (unsigned int *)((unsigned int)stack & ~0x3F);
5421 +
5422 /* First thing is to look for a frame pointer */
5423 - for (addr = (unsigned int *)((unsigned int)stack & ~0xF); addr < endstack; addr++) {
5424 + for (addr = (unsigned int *)((unsigned int)stack & ~0xF), i = 0;
5425 + addr < endstack; addr++, i++) {
5426 if (*addr & 0x1)
5427 continue;
5428 ins_addr = (unsigned short *)*addr;
5429 @@ -843,8 +834,7 @@
5430
5431 if (fp) {
5432 /* Let's check to see if it is a frame pointer */
5433 - while (fp >= (addr - 1) && fp < endstack
5434 - && fp && ((unsigned int) fp & 0x3) == 0)
5435 + while (fp >= (addr - 1) && fp < endstack && fp)
5436 fp = (unsigned int *)*fp;
5437 if (fp == 0 || fp == endstack) {
5438 fp = addr - 1;
5439 @@ -1062,9 +1052,8 @@
5440 char buf [150];
5441 struct irqaction *action;
5442 unsigned int i;
5443 - unsigned long flags = 0;
5444 + unsigned long flags;
5445 unsigned int cpu = smp_processor_id();
5446 - unsigned char in_atomic = (bfin_read_IPEND() & 0x10) || in_atomic();
5447
5448 verbose_printk(KERN_NOTICE "\n" KERN_NOTICE "SEQUENCER STATUS:\t\t%s\n", print_tainted());
5449 verbose_printk(KERN_NOTICE " SEQSTAT: %08lx IPEND: %04lx SYSCFG: %04lx\n",
5450 @@ -1084,22 +1073,17 @@
5451 }
5452 verbose_printk(KERN_NOTICE " EXCAUSE : 0x%lx\n",
5453 fp->seqstat & SEQSTAT_EXCAUSE);
5454 - for (i = 2; i <= 15 ; i++) {
5455 + for (i = 6; i <= 15 ; i++) {
5456 if (fp->ipend & (1 << i)) {
5457 - if (i != 4) {
5458 - decode_address(buf, bfin_read32(EVT0 + 4*i));
5459 - verbose_printk(KERN_NOTICE " physical IVG%i asserted : %s\n", i, buf);
5460 - } else
5461 - verbose_printk(KERN_NOTICE " interrupts disabled\n");
5462 + decode_address(buf, bfin_read32(EVT0 + 4*i));
5463 + verbose_printk(KERN_NOTICE " physical IVG%i asserted : %s\n", i, buf);
5464 }
5465 }
5466
5467 /* if no interrupts are going off, don't print this out */
5468 if (fp->ipend & ~0x3F) {
5469 for (i = 0; i < (NR_IRQS - 1); i++) {
5470 - if (!in_atomic)
5471 - spin_lock_irqsave(&irq_desc[i].lock, flags);
5472 -
5473 + spin_lock_irqsave(&irq_desc[i].lock, flags);
5474 action = irq_desc[i].action;
5475 if (!action)
5476 goto unlock;
5477 @@ -1112,8 +1096,7 @@
5478 }
5479 verbose_printk("\n");
5480 unlock:
5481 - if (!in_atomic)
5482 - spin_unlock_irqrestore(&irq_desc[i].lock, flags);
5483 + spin_unlock_irqrestore(&irq_desc[i].lock, flags);
5484 }
5485 }
5486
5487 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf518/boards/ezbrd.c linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf518/boards/ezbrd.c
5488 --- linux-2.6.29.owrt/arch/blackfin/mach-bf518/boards/ezbrd.c 2009-05-10 22:04:41.000000000 +0200
5489 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf518/boards/ezbrd.c 2009-05-10 23:48:28.000000000 +0200
5490 @@ -46,7 +46,6 @@
5491 #include <asm/dpmc.h>
5492 #include <asm/bfin_sdh.h>
5493 #include <linux/spi/ad7877.h>
5494 -#include <net/dsa.h>
5495
5496 /*
5497 * Name the Board for the /proc/cpuinfo
5498 @@ -105,33 +104,10 @@
5499 #endif
5500
5501 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
5502 -static struct platform_device bfin_mii_bus = {
5503 - .name = "bfin_mii_bus",
5504 -};
5505 -
5506 static struct platform_device bfin_mac_device = {
5507 .name = "bfin_mac",
5508 - .dev.platform_data = &bfin_mii_bus,
5509 -};
5510 -
5511 -#if defined(CONFIG_NET_DSA_KSZ8893M) || defined(CONFIG_NET_DSA_KSZ8893M_MODULE)
5512 -static struct dsa_platform_data ksz8893m_switch_data = {
5513 - .mii_bus = &bfin_mii_bus.dev,
5514 - .netdev = &bfin_mac_device.dev,
5515 - .port_names[0] = NULL,
5516 - .port_names[1] = "eth%d",
5517 - .port_names[2] = "eth%d",
5518 - .port_names[3] = "cpu",
5519 -};
5520 -
5521 -static struct platform_device ksz8893m_switch_device = {
5522 - .name = "dsa",
5523 - .id = 0,
5524 - .num_resources = 0,
5525 - .dev.platform_data = &ksz8893m_switch_data,
5526 };
5527 #endif
5528 -#endif
5529
5530 #if defined(CONFIG_MTD_M25P80) \
5531 || defined(CONFIG_MTD_M25P80_MODULE)
5532 @@ -171,20 +147,9 @@
5533 };
5534 #endif
5535
5536 -#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
5537 -#if defined(CONFIG_NET_DSA_KSZ8893M) \
5538 - || defined(CONFIG_NET_DSA_KSZ8893M_MODULE)
5539 -/* SPI SWITCH CHIP */
5540 -static struct bfin5xx_spi_chip spi_switch_info = {
5541 - .enable_dma = 0,
5542 - .bits_per_word = 8,
5543 -};
5544 -#endif
5545 -#endif
5546 -
5547 -#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
5548 -static struct bfin5xx_spi_chip mmc_spi_chip_info = {
5549 - .enable_dma = 0,
5550 +#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
5551 +static struct bfin5xx_spi_chip spi_mmc_chip_info = {
5552 + .enable_dma = 1,
5553 .bits_per_word = 8,
5554 };
5555 #endif
5556 @@ -261,28 +226,23 @@
5557 },
5558 #endif
5559
5560 -#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
5561 -#if defined(CONFIG_NET_DSA_KSZ8893M) \
5562 - || defined(CONFIG_NET_DSA_KSZ8893M_MODULE)
5563 +#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
5564 {
5565 - .modalias = "ksz8893m",
5566 - .max_speed_hz = 5000000,
5567 + .modalias = "spi_mmc_dummy",
5568 + .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
5569 .bus_num = 0,
5570 - .chip_select = 1,
5571 + .chip_select = 0,
5572 .platform_data = NULL,
5573 - .controller_data = &spi_switch_info,
5574 + .controller_data = &spi_mmc_chip_info,
5575 .mode = SPI_MODE_3,
5576 },
5577 -#endif
5578 -#endif
5579 -
5580 -#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
5581 {
5582 - .modalias = "mmc_spi",
5583 + .modalias = "spi_mmc",
5584 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
5585 .bus_num = 0,
5586 - .chip_select = 5,
5587 - .controller_data = &mmc_spi_chip_info,
5588 + .chip_select = CONFIG_SPI_MMC_CS_CHAN,
5589 + .platform_data = NULL,
5590 + .controller_data = &spi_mmc_chip_info,
5591 .mode = SPI_MODE_3,
5592 },
5593 #endif
5594 @@ -513,6 +473,7 @@
5595 };
5596 #endif
5597
5598 +#ifdef CONFIG_I2C_BOARDINFO
5599 static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
5600 #if defined(CONFIG_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE)
5601 {
5602 @@ -526,6 +487,7 @@
5603 },
5604 #endif
5605 };
5606 +#endif
5607
5608 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
5609 static struct platform_device bfin_sport0_uart_device = {
5610 @@ -622,11 +584,7 @@
5611 #endif
5612
5613 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
5614 - &bfin_mii_bus,
5615 &bfin_mac_device,
5616 -#if defined(CONFIG_NET_DSA_KSZ8893M) || defined(CONFIG_NET_DSA_KSZ8893M_MODULE)
5617 - &ksz8893m_switch_device,
5618 -#endif
5619 #endif
5620
5621 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
5622 @@ -674,8 +632,12 @@
5623 static int __init ezbrd_init(void)
5624 {
5625 printk(KERN_INFO "%s(): registering device resources\n", __func__);
5626 +
5627 +#ifdef CONFIG_I2C_BOARDINFO
5628 i2c_register_board_info(0, bfin_i2c_board_info,
5629 ARRAY_SIZE(bfin_i2c_board_info));
5630 +#endif
5631 +
5632 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
5633 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
5634 return 0;
5635 @@ -687,7 +649,7 @@
5636 {
5637 /* workaround reboot hang when booting from SPI */
5638 if ((bfin_read_SYSCR() & 0x7) == 0x3)
5639 - bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
5640 + bfin_gpio_reset_spi0_ssel1();
5641 }
5642
5643 void bfin_get_ether_addr(char *addr)
5644 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf518/include/mach/anomaly.h linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf518/include/mach/anomaly.h
5645 --- linux-2.6.29.owrt/arch/blackfin/mach-bf518/include/mach/anomaly.h 2009-05-10 22:04:41.000000000 +0200
5646 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf518/include/mach/anomaly.h 2009-05-10 23:48:28.000000000 +0200
5647 @@ -2,12 +2,12 @@
5648 * File: include/asm-blackfin/mach-bf518/anomaly.h
5649 * Bugs: Enter bugs at http://blackfin.uclinux.org/
5650 *
5651 - * Copyright (C) 2004-2009 Analog Devices Inc.
5652 + * Copyright (C) 2004-2008 Analog Devices Inc.
5653 * Licensed under the GPL-2 or later.
5654 */
5655
5656 /* This file shoule be up to date with:
5657 - * - Revision B, 02/03/2009; ADSP-BF512/BF514/BF516/BF518 Blackfin Processor Anomaly List
5658 + * - ????
5659 */
5660
5661 #ifndef _MACH_ANOMALY_H_
5662 @@ -19,8 +19,6 @@
5663 #define ANOMALY_05000122 (1)
5664 /* False Hardware Error from an Access in the Shadow of a Conditional Branch */
5665 #define ANOMALY_05000245 (1)
5666 -/* Incorrect Timer Pulse Width in Single-Shot PWM_OUT Mode with External Clock */
5667 -#define ANOMALY_05000254 (1)
5668 /* Sensitivity To Noise with Slow Input Edge Rates on External SPORT TX and RX Clocks */
5669 #define ANOMALY_05000265 (1)
5670 /* False Hardware Errors Caused by Fetches at the Boundary of Reserved Memory */
5671 @@ -55,12 +53,6 @@
5672 #define ANOMALY_05000443 (1)
5673 /* Incorrect L1 Instruction Bank B Memory Map Location */
5674 #define ANOMALY_05000444 (1)
5675 -/* Incorrect Default Hysteresis Setting for RESET, NMI, and BMODE Signals */
5676 -#define ANOMALY_05000452 (1)
5677 -/* PWM_TRIPB Signal Not Available on PG10 */
5678 -#define ANOMALY_05000453 (1)
5679 -/* PPI_FS3 is Driven One Half Cycle Later Than PPI Data */
5680 -#define ANOMALY_05000455 (1)
5681
5682 /* Anomalies that don't exist on this proc */
5683 #define ANOMALY_05000125 (0)
5684 @@ -73,20 +65,15 @@
5685 #define ANOMALY_05000263 (0)
5686 #define ANOMALY_05000266 (0)
5687 #define ANOMALY_05000273 (0)
5688 -#define ANOMALY_05000278 (0)
5689 #define ANOMALY_05000285 (0)
5690 -#define ANOMALY_05000305 (0)
5691 #define ANOMALY_05000307 (0)
5692 #define ANOMALY_05000311 (0)
5693 #define ANOMALY_05000312 (0)
5694 #define ANOMALY_05000323 (0)
5695 #define ANOMALY_05000353 (0)
5696 #define ANOMALY_05000363 (0)
5697 -#define ANOMALY_05000380 (0)
5698 #define ANOMALY_05000386 (0)
5699 #define ANOMALY_05000412 (0)
5700 #define ANOMALY_05000432 (0)
5701 -#define ANOMALY_05000447 (0)
5702 -#define ANOMALY_05000448 (0)
5703
5704 #endif
5705 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf518/include/mach/bfin_serial_5xx.h linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf518/include/mach/bfin_serial_5xx.h
5706 --- linux-2.6.29.owrt/arch/blackfin/mach-bf518/include/mach/bfin_serial_5xx.h 2009-05-10 22:04:41.000000000 +0200
5707 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf518/include/mach/bfin_serial_5xx.h 2009-05-10 23:48:28.000000000 +0200
5708 @@ -144,7 +144,7 @@
5709 CH_UART0_TX,
5710 CH_UART0_RX,
5711 #endif
5712 -#ifdef CONFIG_SERIAL_BFIN_CTSRTS
5713 +#ifdef CONFIG_BFIN_UART0_CTSRTS
5714 CONFIG_UART0_CTS_PIN,
5715 CONFIG_UART0_RTS_PIN,
5716 #endif
5717 @@ -158,7 +158,7 @@
5718 CH_UART1_TX,
5719 CH_UART1_RX,
5720 #endif
5721 -#ifdef CONFIG_SERIAL_BFIN_CTSRTS
5722 +#ifdef CONFIG_BFIN_UART1_CTSRTS
5723 CONFIG_UART1_CTS_PIN,
5724 CONFIG_UART1_RTS_PIN,
5725 #endif
5726 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf518/include/mach/portmux.h linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf518/include/mach/portmux.h
5727 --- linux-2.6.29.owrt/arch/blackfin/mach-bf518/include/mach/portmux.h 2009-05-10 22:04:41.000000000 +0200
5728 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf518/include/mach/portmux.h 2009-05-10 23:48:28.000000000 +0200
5729 @@ -103,8 +103,6 @@
5730 #define P_SPI1_SSEL4 (P_DEFINED | P_IDENT(GPIO_PF8) | P_FUNCT(2))
5731 #define P_SPI1_SSEL5 (P_DEFINED | P_IDENT(GPIO_PG11) | P_FUNCT(2))
5732
5733 -#define P_DEFAULT_BOOT_SPI_CS P_SPI0_SSEL2
5734 -
5735 /* SPORT Port Mux */
5736 #define P_SPORT0_DRPRI (P_DEFINED | P_IDENT(GPIO_PG3) | P_FUNCT(0))
5737 #define P_SPORT0_RSCLK (P_DEFINED | P_IDENT(GPIO_PG4) | P_FUNCT(0))
5738 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf527/boards/cm_bf527.c linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf527/boards/cm_bf527.c
5739 --- linux-2.6.29.owrt/arch/blackfin/mach-bf527/boards/cm_bf527.c 2009-05-10 22:04:41.000000000 +0200
5740 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf527/boards/cm_bf527.c 2009-05-10 23:48:28.000000000 +0200
5741 @@ -403,13 +403,8 @@
5742 #endif
5743
5744 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
5745 -static struct platform_device bfin_mii_bus = {
5746 - .name = "bfin_mii_bus",
5747 -};
5748 -
5749 static struct platform_device bfin_mac_device = {
5750 .name = "bfin_mac",
5751 - .dev.platform_data = &bfin_mii_bus,
5752 };
5753 #endif
5754
5755 @@ -487,9 +482,9 @@
5756 };
5757 #endif
5758
5759 -#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
5760 -static struct bfin5xx_spi_chip mmc_spi_chip_info = {
5761 - .enable_dma = 0,
5762 +#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
5763 +static struct bfin5xx_spi_chip spi_mmc_chip_info = {
5764 + .enable_dma = 1,
5765 .bits_per_word = 8,
5766 };
5767 #endif
5768 @@ -585,13 +580,23 @@
5769 .controller_data = &ad9960_spi_chip_info,
5770 },
5771 #endif
5772 -#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
5773 +#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
5774 {
5775 - .modalias = "mmc_spi",
5776 - .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
5777 + .modalias = "spi_mmc_dummy",
5778 + .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
5779 .bus_num = 0,
5780 - .chip_select = 5,
5781 - .controller_data = &mmc_spi_chip_info,
5782 + .chip_select = 0,
5783 + .platform_data = NULL,
5784 + .controller_data = &spi_mmc_chip_info,
5785 + .mode = SPI_MODE_3,
5786 + },
5787 + {
5788 + .modalias = "spi_mmc",
5789 + .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
5790 + .bus_num = 0,
5791 + .chip_select = CONFIG_SPI_MMC_CS_CHAN,
5792 + .platform_data = NULL,
5793 + .controller_data = &spi_mmc_chip_info,
5794 .mode = SPI_MODE_3,
5795 },
5796 #endif
5797 @@ -788,6 +793,7 @@
5798 };
5799 #endif
5800
5801 +#ifdef CONFIG_I2C_BOARDINFO
5802 static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
5803 #if defined(CONFIG_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE)
5804 {
5805 @@ -803,6 +809,7 @@
5806 },
5807 #endif
5808 };
5809 +#endif
5810
5811 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
5812 static struct platform_device bfin_sport0_uart_device = {
5813 @@ -913,7 +920,6 @@
5814 #endif
5815
5816 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
5817 - &bfin_mii_bus,
5818 &bfin_mac_device,
5819 #endif
5820
5821 @@ -962,23 +968,27 @@
5822 &bfin_gpios_device,
5823 };
5824
5825 -static int __init cm_init(void)
5826 +static int __init stamp_init(void)
5827 {
5828 printk(KERN_INFO "%s(): registering device resources\n", __func__);
5829 +
5830 +#ifdef CONFIG_I2C_BOARDINFO
5831 i2c_register_board_info(0, bfin_i2c_board_info,
5832 ARRAY_SIZE(bfin_i2c_board_info));
5833 +#endif
5834 +
5835 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
5836 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
5837 return 0;
5838 }
5839
5840 -arch_initcall(cm_init);
5841 +arch_initcall(stamp_init);
5842
5843 void native_machine_restart(char *cmd)
5844 {
5845 /* workaround reboot hang when booting from SPI */
5846 if ((bfin_read_SYSCR() & 0x7) == 0x3)
5847 - bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
5848 + bfin_gpio_reset_spi0_ssel1();
5849 }
5850
5851 void bfin_get_ether_addr(char *addr)
5852 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf527/boards/ezbrd.c linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf527/boards/ezbrd.c
5853 --- linux-2.6.29.owrt/arch/blackfin/mach-bf527/boards/ezbrd.c 2009-05-10 22:04:41.000000000 +0200
5854 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf527/boards/ezbrd.c 2009-05-10 23:48:28.000000000 +0200
5855 @@ -208,13 +208,8 @@
5856
5857
5858 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
5859 -static struct platform_device bfin_mii_bus = {
5860 - .name = "bfin_mii_bus",
5861 -};
5862 -
5863 static struct platform_device bfin_mac_device = {
5864 .name = "bfin_mac",
5865 - .dev.platform_data = &bfin_mii_bus,
5866 };
5867 #endif
5868
5869 @@ -256,9 +251,9 @@
5870 };
5871 #endif
5872
5873 -#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
5874 -static struct bfin5xx_spi_chip mmc_spi_chip_info = {
5875 - .enable_dma = 0,
5876 +#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
5877 +static struct bfin5xx_spi_chip spi_mmc_chip_info = {
5878 + .enable_dma = 1,
5879 .bits_per_word = 8,
5880 };
5881 #endif
5882 @@ -366,13 +361,23 @@
5883 },
5884 #endif
5885
5886 -#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
5887 +#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
5888 {
5889 - .modalias = "mmc_spi",
5890 + .modalias = "spi_mmc_dummy",
5891 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
5892 .bus_num = 0,
5893 - .chip_select = 5,
5894 - .controller_data = &mmc_spi_chip_info,
5895 + .chip_select = 0,
5896 + .platform_data = NULL,
5897 + .controller_data = &spi_mmc_chip_info,
5898 + .mode = SPI_MODE_3,
5899 + },
5900 + {
5901 + .modalias = "spi_mmc",
5902 + .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
5903 + .bus_num = 0,
5904 + .chip_select = CONFIG_SPI_MMC_CS_CHAN,
5905 + .platform_data = NULL,
5906 + .controller_data = &spi_mmc_chip_info,
5907 .mode = SPI_MODE_3,
5908 },
5909 #endif
5910 @@ -585,6 +590,7 @@
5911 };
5912 #endif
5913
5914 +#ifdef CONFIG_I2C_BOARDINFO
5915 static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
5916 #if defined(CONFIG_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE)
5917 {
5918 @@ -598,6 +604,7 @@
5919 },
5920 #endif
5921 };
5922 +#endif
5923
5924 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
5925 static struct platform_device bfin_sport0_uart_device = {
5926 @@ -713,7 +720,6 @@
5927 #endif
5928
5929 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
5930 - &bfin_mii_bus,
5931 &bfin_mac_device,
5932 #endif
5933
5934 @@ -758,23 +764,27 @@
5935 &bfin_gpios_device,
5936 };
5937
5938 -static int __init ezbrd_init(void)
5939 +static int __init stamp_init(void)
5940 {
5941 printk(KERN_INFO "%s(): registering device resources\n", __func__);
5942 +
5943 +#ifdef CONFIG_I2C_BOARDINFO
5944 i2c_register_board_info(0, bfin_i2c_board_info,
5945 ARRAY_SIZE(bfin_i2c_board_info));
5946 +#endif
5947 +
5948 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
5949 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
5950 return 0;
5951 }
5952
5953 -arch_initcall(ezbrd_init);
5954 +arch_initcall(stamp_init);
5955
5956 void native_machine_restart(char *cmd)
5957 {
5958 /* workaround reboot hang when booting from SPI */
5959 if ((bfin_read_SYSCR() & 0x7) == 0x3)
5960 - bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
5961 + bfin_gpio_reset_spi0_ssel1();
5962 }
5963
5964 void bfin_get_ether_addr(char *addr)
5965 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf527/boards/ezkit.c linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf527/boards/ezkit.c
5966 --- linux-2.6.29.owrt/arch/blackfin/mach-bf527/boards/ezkit.c 2009-05-10 22:04:41.000000000 +0200
5967 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf527/boards/ezkit.c 2009-05-10 23:48:28.000000000 +0200
5968 @@ -425,13 +425,8 @@
5969 #endif
5970
5971 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
5972 -static struct platform_device bfin_mii_bus = {
5973 - .name = "bfin_mii_bus",
5974 -};
5975 -
5976 static struct platform_device bfin_mac_device = {
5977 .name = "bfin_mac",
5978 - .dev.platform_data = &bfin_mii_bus,
5979 };
5980 #endif
5981
5982 @@ -835,6 +830,7 @@
5983 };
5984 #endif
5985
5986 +#ifdef CONFIG_I2C_BOARDINFO
5987 static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
5988 #if defined(CONFIG_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE)
5989 {
5990 @@ -848,6 +844,7 @@
5991 },
5992 #endif
5993 };
5994 +#endif
5995
5996 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
5997 static struct platform_device bfin_sport0_uart_device = {
5998 @@ -991,7 +988,6 @@
5999 #endif
6000
6001 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
6002 - &bfin_mii_bus,
6003 &bfin_mac_device,
6004 #endif
6005
6006 @@ -1052,23 +1048,27 @@
6007 &bfin_gpios_device,
6008 };
6009
6010 -static int __init ezkit_init(void)
6011 +static int __init stamp_init(void)
6012 {
6013 printk(KERN_INFO "%s(): registering device resources\n", __func__);
6014 +
6015 +#ifdef CONFIG_I2C_BOARDINFO
6016 i2c_register_board_info(0, bfin_i2c_board_info,
6017 ARRAY_SIZE(bfin_i2c_board_info));
6018 +#endif
6019 +
6020 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
6021 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
6022 return 0;
6023 }
6024
6025 -arch_initcall(ezkit_init);
6026 +arch_initcall(stamp_init);
6027
6028 void native_machine_restart(char *cmd)
6029 {
6030 /* workaround reboot hang when booting from SPI */
6031 if ((bfin_read_SYSCR() & 0x7) == 0x3)
6032 - bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
6033 + bfin_gpio_reset_spi0_ssel1();
6034 }
6035
6036 void bfin_get_ether_addr(char *addr)
6037 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf527/include/mach/anomaly.h linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf527/include/mach/anomaly.h
6038 --- linux-2.6.29.owrt/arch/blackfin/mach-bf527/include/mach/anomaly.h 2009-05-10 22:04:41.000000000 +0200
6039 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf527/include/mach/anomaly.h 2009-05-10 23:48:28.000000000 +0200
6040 @@ -2,7 +2,7 @@
6041 * File: include/asm-blackfin/mach-bf527/anomaly.h
6042 * Bugs: Enter bugs at http://blackfin.uclinux.org/
6043 *
6044 - * Copyright (C) 2004-2009 Analog Devices Inc.
6045 + * Copyright (C) 2004-2008 Analog Devices Inc.
6046 * Licensed under the GPL-2 or later.
6047 */
6048
6049 @@ -167,16 +167,12 @@
6050 #define ANOMALY_05000263 (0)
6051 #define ANOMALY_05000266 (0)
6052 #define ANOMALY_05000273 (0)
6053 -#define ANOMALY_05000278 (0)
6054 #define ANOMALY_05000285 (0)
6055 -#define ANOMALY_05000305 (0)
6056 #define ANOMALY_05000307 (0)
6057 #define ANOMALY_05000311 (0)
6058 #define ANOMALY_05000312 (0)
6059 #define ANOMALY_05000323 (0)
6060 #define ANOMALY_05000363 (0)
6061 #define ANOMALY_05000412 (0)
6062 -#define ANOMALY_05000447 (0)
6063 -#define ANOMALY_05000448 (0)
6064
6065 #endif
6066 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf527/include/mach/bfin_serial_5xx.h linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf527/include/mach/bfin_serial_5xx.h
6067 --- linux-2.6.29.owrt/arch/blackfin/mach-bf527/include/mach/bfin_serial_5xx.h 2009-05-10 22:04:41.000000000 +0200
6068 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf527/include/mach/bfin_serial_5xx.h 2009-05-10 23:48:28.000000000 +0200
6069 @@ -144,7 +144,7 @@
6070 CH_UART0_TX,
6071 CH_UART0_RX,
6072 #endif
6073 -#ifdef CONFIG_SERIAL_BFIN_CTSRTS
6074 +#ifdef CONFIG_BFIN_UART0_CTSRTS
6075 CONFIG_UART0_CTS_PIN,
6076 CONFIG_UART0_RTS_PIN,
6077 #endif
6078 @@ -158,7 +158,7 @@
6079 CH_UART1_TX,
6080 CH_UART1_RX,
6081 #endif
6082 -#ifdef CONFIG_SERIAL_BFIN_CTSRTS
6083 +#ifdef CONFIG_BFIN_UART1_CTSRTS
6084 CONFIG_UART1_CTS_PIN,
6085 CONFIG_UART1_RTS_PIN,
6086 #endif
6087 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf527/include/mach/portmux.h linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf527/include/mach/portmux.h
6088 --- linux-2.6.29.owrt/arch/blackfin/mach-bf527/include/mach/portmux.h 2009-05-10 22:04:41.000000000 +0200
6089 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf527/include/mach/portmux.h 2009-05-10 23:48:28.000000000 +0200
6090 @@ -73,8 +73,6 @@
6091
6092 #define P_HWAIT (P_DONTCARE)
6093
6094 -#define P_DEFAULT_BOOT_SPI_CS P_SPI0_SSEL1
6095 -
6096 #define P_SPI0_SS (P_DEFINED | P_IDENT(GPIO_PG1) | P_FUNCT(0))
6097 #define P_SPI0_SSEL1 (P_DEFINED | P_IDENT(GPIO_PG1) | P_FUNCT(2))
6098 #define P_SPI0_SCK (P_DEFINED | P_IDENT(GPIO_PG2) | P_FUNCT(2))
6099 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf533/boards/blackstamp.c linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf533/boards/blackstamp.c
6100 --- linux-2.6.29.owrt/arch/blackfin/mach-bf533/boards/blackstamp.c 2009-05-10 22:04:41.000000000 +0200
6101 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf533/boards/blackstamp.c 2009-05-10 23:48:28.000000000 +0200
6102 @@ -101,9 +101,9 @@
6103 };
6104 #endif
6105
6106 -#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
6107 -static struct bfin5xx_spi_chip mmc_spi_chip_info = {
6108 - .enable_dma = 0,
6109 +#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
6110 +static struct bfin5xx_spi_chip spi_mmc_chip_info = {
6111 + .enable_dma = 1,
6112 .bits_per_word = 8,
6113 };
6114 #endif
6115 @@ -129,13 +129,23 @@
6116 },
6117 #endif
6118
6119 -#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
6120 +#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
6121 + {
6122 + .modalias = "spi_mmc_dummy",
6123 + .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
6124 + .bus_num = 0,
6125 + .chip_select = 0,
6126 + .platform_data = NULL,
6127 + .controller_data = &spi_mmc_chip_info,
6128 + .mode = SPI_MODE_3,
6129 + },
6130 {
6131 - .modalias = "mmc_spi",
6132 + .modalias = "spi_mmc",
6133 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
6134 .bus_num = 0,
6135 - .chip_select = 5,
6136 - .controller_data = &mmc_spi_chip_info,
6137 + .chip_select = CONFIG_SPI_MMC_CS_CHAN,
6138 + .platform_data = NULL,
6139 + .controller_data = &spi_mmc_chip_info,
6140 .mode = SPI_MODE_3,
6141 },
6142 #endif
6143 @@ -299,8 +309,10 @@
6144 };
6145 #endif
6146
6147 +#ifdef CONFIG_I2C_BOARDINFO
6148 static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
6149 };
6150 +#endif
6151
6152 static const unsigned int cclk_vlev_datasheet[] =
6153 {
6154 @@ -378,8 +390,10 @@
6155
6156 printk(KERN_INFO "%s(): registering device resources\n", __func__);
6157
6158 +#ifdef CONFIG_I2C_BOARDINFO
6159 i2c_register_board_info(0, bfin_i2c_board_info,
6160 ARRAY_SIZE(bfin_i2c_board_info));
6161 +#endif
6162
6163 ret = platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
6164 if (ret < 0)
6165 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf533/boards/cm_bf533.c linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf533/boards/cm_bf533.c
6166 --- linux-2.6.29.owrt/arch/blackfin/mach-bf533/boards/cm_bf533.c 2009-05-10 22:04:41.000000000 +0200
6167 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf533/boards/cm_bf533.c 2009-05-10 23:48:28.000000000 +0200
6168 @@ -96,9 +96,9 @@
6169 };
6170 #endif
6171
6172 -#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
6173 -static struct bfin5xx_spi_chip mmc_spi_chip_info = {
6174 - .enable_dma = 0,
6175 +#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
6176 +static struct bfin5xx_spi_chip spi_mmc_chip_info = {
6177 + .enable_dma = 1,
6178 .bits_per_word = 8,
6179 };
6180 #endif
6181 @@ -138,13 +138,23 @@
6182 },
6183 #endif
6184
6185 -#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
6186 +#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
6187 {
6188 - .modalias = "mmc_spi",
6189 + .modalias = "spi_mmc_dummy",
6190 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
6191 .bus_num = 0,
6192 - .chip_select = 5,
6193 - .controller_data = &mmc_spi_chip_info,
6194 + .chip_select = 0,
6195 + .platform_data = NULL,
6196 + .controller_data = &spi_mmc_chip_info,
6197 + .mode = SPI_MODE_3,
6198 + },
6199 + {
6200 + .modalias = "spi_mmc",
6201 + .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
6202 + .bus_num = 0,
6203 + .chip_select = CONFIG_SPI_MMC_CS_CHAN,
6204 + .platform_data = NULL,
6205 + .controller_data = &spi_mmc_chip_info,
6206 .mode = SPI_MODE_3,
6207 },
6208 #endif
6209 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf533/boards/generic_board.c linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf533/boards/generic_board.c
6210 --- linux-2.6.29.owrt/arch/blackfin/mach-bf533/boards/generic_board.c 1970-01-01 01:00:00.000000000 +0100
6211 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf533/boards/generic_board.c 2009-05-10 23:48:28.000000000 +0200
6212 @@ -0,0 +1,126 @@
6213 +/*
6214 + * File: arch/blackfin/mach-bf533/generic_board.c
6215 + * Based on: arch/blackfin/mach-bf533/ezkit.c
6216 + * Author: Aidan Williams <aidan@nicta.com.au>
6217 + *
6218 + * Created: 2005
6219 + * Description:
6220 + *
6221 + * Modified:
6222 + * Copyright 2005 National ICT Australia (NICTA)
6223 + * Copyright 2004-2006 Analog Devices Inc.
6224 + *
6225 + * Bugs: Enter bugs at http://blackfin.uclinux.org/
6226 + *
6227 + * This program is free software; you can redistribute it and/or modify
6228 + * it under the terms of the GNU General Public License as published by
6229 + * the Free Software Foundation; either version 2 of the License, or
6230 + * (at your option) any later version.
6231 + *
6232 + * This program is distributed in the hope that it will be useful,
6233 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
6234 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6235 + * GNU General Public License for more details.
6236 + *
6237 + * You should have received a copy of the GNU General Public License
6238 + * along with this program; if not, see the file COPYING, or write
6239 + * to the Free Software Foundation, Inc.,
6240 + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
6241 + */
6242 +
6243 +#include <linux/device.h>
6244 +#include <linux/platform_device.h>
6245 +#include <linux/irq.h>
6246 +
6247 +/*
6248 + * Name the Board for the /proc/cpuinfo
6249 + */
6250 +const char bfin_board_name[] = "UNKNOWN BOARD";
6251 +
6252 +#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
6253 +static struct platform_device rtc_device = {
6254 + .name = "rtc-bfin",
6255 + .id = -1,
6256 +};
6257 +#endif
6258 +
6259 +/*
6260 + * Driver needs to know address, irq and flag pin.
6261 + */
6262 +#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
6263 +static struct resource smc91x_resources[] = {
6264 + {
6265 + .start = 0x20300300,
6266 + .end = 0x20300300 + 16,
6267 + .flags = IORESOURCE_MEM,
6268 + }, {
6269 + .start = IRQ_PROG_INTB,
6270 + .end = IRQ_PROG_INTB,
6271 + .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
6272 + }, {
6273 + .start = IRQ_PF7,
6274 + .end = IRQ_PF7,
6275 + .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
6276 + },
6277 +};
6278 +
6279 +static struct platform_device smc91x_device = {
6280 + .name = "smc91x",
6281 + .id = 0,
6282 + .num_resources = ARRAY_SIZE(smc91x_resources),
6283 + .resource = smc91x_resources,
6284 +};
6285 +#endif
6286 +
6287 +#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
6288 +#ifdef CONFIG_BFIN_SIR0
6289 +static struct resource bfin_sir0_resources[] = {
6290 + {
6291 + .start = 0xFFC00400,
6292 + .end = 0xFFC004FF,
6293 + .flags = IORESOURCE_MEM,
6294 + },
6295 + {
6296 + .start = IRQ_UART0_RX,
6297 + .end = IRQ_UART0_RX+1,
6298 + .flags = IORESOURCE_IRQ,
6299 + },
6300 + {
6301 + .start = CH_UART0_RX,
6302 + .end = CH_UART0_RX+1,
6303 + .flags = IORESOURCE_DMA,
6304 + },
6305 +};
6306 +
6307 +static struct platform_device bfin_sir0_device = {
6308 + .name = "bfin_sir",
6309 + .id = 0,
6310 + .num_resources = ARRAY_SIZE(bfin_sir0_resources),
6311 + .resource = bfin_sir0_resources,
6312 +};
6313 +#endif
6314 +#endif
6315 +
6316 +static struct platform_device *generic_board_devices[] __initdata = {
6317 +#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
6318 + &rtc_device,
6319 +#endif
6320 +
6321 +#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
6322 + &smc91x_device,
6323 +#endif
6324 +
6325 +#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
6326 +#ifdef CONFIG_BFIN_SIR0
6327 + &bfin_sir0_device,
6328 +#endif
6329 +#endif
6330 +};
6331 +
6332 +static int __init generic_board_init(void)
6333 +{
6334 + printk(KERN_INFO "%s(): registering device resources\n", __func__);
6335 + return platform_add_devices(generic_board_devices, ARRAY_SIZE(generic_board_devices));
6336 +}
6337 +
6338 +arch_initcall(generic_board_init);
6339 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf533/boards/ip0x.c linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf533/boards/ip0x.c
6340 --- linux-2.6.29.owrt/arch/blackfin/mach-bf533/boards/ip0x.c 2009-05-10 22:04:41.000000000 +0200
6341 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf533/boards/ip0x.c 2009-05-10 23:48:28.000000000 +0200
6342 @@ -127,8 +127,8 @@
6343 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
6344 /* all SPI peripherals info goes here */
6345
6346 -#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
6347 -static struct bfin5xx_spi_chip mmc_spi_chip_info = {
6348 +#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
6349 +static struct bfin5xx_spi_chip spi_mmc_chip_info = {
6350 /*
6351 * CPOL (Clock Polarity)
6352 * 0 - Active high SCK
6353 @@ -152,13 +152,14 @@
6354 /* Notice: for blackfin, the speed_hz is the value of register
6355 * SPI_BAUD, not the real baudrate */
6356 static struct spi_board_info bfin_spi_board_info[] __initdata = {
6357 -#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
6358 +#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
6359 {
6360 - .modalias = "mmc_spi",
6361 + .modalias = "spi_mmc",
6362 .max_speed_hz = 2,
6363 .bus_num = 1,
6364 - .chip_select = 5,
6365 - .controller_data = &mmc_spi_chip_info,
6366 + .chip_select = CONFIG_SPI_MMC_CS_CHAN,
6367 + .platform_data = NULL,
6368 + .controller_data = &spi_mmc_chip_info,
6369 },
6370 #endif
6371 };
6372 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf533/boards/Kconfig linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf533/boards/Kconfig
6373 --- linux-2.6.29.owrt/arch/blackfin/mach-bf533/boards/Kconfig 2009-05-10 22:04:41.000000000 +0200
6374 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf533/boards/Kconfig 2009-05-10 23:48:28.000000000 +0200
6375 @@ -38,4 +38,9 @@
6376 help
6377 Core support for IP04/IP04 open hardware IP-PBX.
6378
6379 +config GENERIC_BF533_BOARD
6380 + bool "Generic"
6381 + help
6382 + Generic or Custom board support.
6383 +
6384 endchoice
6385 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf533/boards/Makefile linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf533/boards/Makefile
6386 --- linux-2.6.29.owrt/arch/blackfin/mach-bf533/boards/Makefile 2009-05-10 22:04:41.000000000 +0200
6387 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf533/boards/Makefile 2009-05-10 23:48:28.000000000 +0200
6388 @@ -2,6 +2,7 @@
6389 # arch/blackfin/mach-bf533/boards/Makefile
6390 #
6391
6392 +obj-$(CONFIG_GENERIC_BF533_BOARD) += generic_board.o
6393 obj-$(CONFIG_BFIN533_STAMP) += stamp.o
6394 obj-$(CONFIG_BFIN532_IP0X) += ip0x.o
6395 obj-$(CONFIG_BFIN533_EZKIT) += ezkit.o
6396 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf533/boards/stamp.c linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf533/boards/stamp.c
6397 --- linux-2.6.29.owrt/arch/blackfin/mach-bf533/boards/stamp.c 2009-05-10 22:04:41.000000000 +0200
6398 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf533/boards/stamp.c 2009-05-10 23:48:28.000000000 +0200
6399 @@ -441,6 +441,7 @@
6400 };
6401 #endif
6402
6403 +#ifdef CONFIG_I2C_BOARDINFO
6404 static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
6405 #if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE)
6406 {
6407 @@ -460,6 +461,7 @@
6408 },
6409 #endif
6410 };
6411 +#endif
6412
6413 static const unsigned int cclk_vlev_datasheet[] =
6414 {
6415 @@ -548,8 +550,10 @@
6416
6417 printk(KERN_INFO "%s(): registering device resources\n", __func__);
6418
6419 +#ifdef CONFIG_I2C_BOARDINFO
6420 i2c_register_board_info(0, bfin_i2c_board_info,
6421 ARRAY_SIZE(bfin_i2c_board_info));
6422 +#endif
6423
6424 ret = platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
6425 if (ret < 0)
6426 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf533/include/mach/anomaly.h linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf533/include/mach/anomaly.h
6427 --- linux-2.6.29.owrt/arch/blackfin/mach-bf533/include/mach/anomaly.h 2009-05-10 22:04:41.000000000 +0200
6428 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf533/include/mach/anomaly.h 2009-05-10 23:48:28.000000000 +0200
6429 @@ -2,7 +2,7 @@
6430 * File: include/asm-blackfin/mach-bf533/anomaly.h
6431 * Bugs: Enter bugs at http://blackfin.uclinux.org/
6432 *
6433 - * Copyright (C) 2004-2009 Analog Devices Inc.
6434 + * Copyright (C) 2004-2008 Analog Devices Inc.
6435 * Licensed under the GPL-2 or later.
6436 */
6437
6438 @@ -160,7 +160,7 @@
6439 #define ANOMALY_05000301 (__SILICON_REVISION__ < 6)
6440 /* SSYNCs After Writes To DMA MMR Registers May Not Be Handled Correctly */
6441 #define ANOMALY_05000302 (__SILICON_REVISION__ < 5)
6442 -/* SPORT_HYS Bit in PLL_CTL Register Is Not Functional */
6443 +/* New Feature: Additional Hysteresis on SPORT Input Pins (Not Available On Older Silicon) */
6444 #define ANOMALY_05000305 (__SILICON_REVISION__ < 5)
6445 /* New Feature: Additional PPI Frame Sync Sampling Options (Not Available On Older Silicon) */
6446 #define ANOMALY_05000306 (__SILICON_REVISION__ < 5)
6447 @@ -278,12 +278,9 @@
6448 #define ANOMALY_05000266 (0)
6449 #define ANOMALY_05000323 (0)
6450 #define ANOMALY_05000353 (1)
6451 -#define ANOMALY_05000380 (0)
6452 #define ANOMALY_05000386 (1)
6453 #define ANOMALY_05000412 (0)
6454 #define ANOMALY_05000432 (0)
6455 #define ANOMALY_05000435 (0)
6456 -#define ANOMALY_05000447 (0)
6457 -#define ANOMALY_05000448 (0)
6458
6459 #endif
6460 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf533/include/mach/bfin_serial_5xx.h linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf533/include/mach/bfin_serial_5xx.h
6461 --- linux-2.6.29.owrt/arch/blackfin/mach-bf533/include/mach/bfin_serial_5xx.h 2009-05-10 22:04:41.000000000 +0200
6462 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf533/include/mach/bfin_serial_5xx.h 2009-05-10 23:48:28.000000000 +0200
6463 @@ -134,7 +134,7 @@
6464 CH_UART_TX,
6465 CH_UART_RX,
6466 #endif
6467 -#ifdef CONFIG_SERIAL_BFIN_CTSRTS
6468 +#ifdef CONFIG_BFIN_UART0_CTSRTS
6469 CONFIG_UART0_CTS_PIN,
6470 CONFIG_UART0_RTS_PIN,
6471 #endif
6472 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf533/include/mach/portmux.h linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf533/include/mach/portmux.h
6473 --- linux-2.6.29.owrt/arch/blackfin/mach-bf533/include/mach/portmux.h 2009-05-10 22:04:41.000000000 +0200
6474 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf533/include/mach/portmux.h 2009-05-10 23:48:28.000000000 +0200
6475 @@ -54,11 +54,14 @@
6476 #define P_SPI0_SSEL2 (P_DEFINED | P_IDENT(GPIO_PF2))
6477 #define P_SPI0_SSEL1 (P_DEFINED | P_IDENT(GPIO_PF1))
6478 #define P_SPI0_SS (P_DEFINED | P_IDENT(GPIO_PF0))
6479 -#define P_DEFAULT_BOOT_SPI_CS P_SPI0_SSEL2
6480
6481 #define P_TMR2 (P_DONTCARE)
6482 #define P_TMR1 (P_DONTCARE)
6483 #define P_TMR0 (P_DONTCARE)
6484 #define P_TMRCLK (P_DEFINED | P_IDENT(GPIO_PF1))
6485
6486 +
6487 +
6488 +
6489 +
6490 #endif /* _MACH_PORTMUX_H_ */
6491 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf537/boards/cm_bf537.c linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf537/boards/cm_bf537.c
6492 --- linux-2.6.29.owrt/arch/blackfin/mach-bf537/boards/cm_bf537.c 2009-05-10 22:04:40.000000000 +0200
6493 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf537/boards/cm_bf537.c 2009-05-10 23:48:28.000000000 +0200
6494 @@ -108,9 +108,9 @@
6495 };
6496 #endif
6497
6498 -#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
6499 -static struct bfin5xx_spi_chip mmc_spi_chip_info = {
6500 - .enable_dma = 0,
6501 +#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
6502 +static struct bfin5xx_spi_chip spi_mmc_chip_info = {
6503 + .enable_dma = 1,
6504 .bits_per_word = 8,
6505 };
6506 #endif
6507 @@ -160,13 +160,23 @@
6508 },
6509 #endif
6510
6511 -#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
6512 +#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
6513 {
6514 - .modalias = "mmc_spi",
6515 - .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
6516 + .modalias = "spi_mmc_dummy",
6517 + .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
6518 .bus_num = 0,
6519 - .chip_select = 1,
6520 - .controller_data = &mmc_spi_chip_info,
6521 + .chip_select = 7,
6522 + .platform_data = NULL,
6523 + .controller_data = &spi_mmc_chip_info,
6524 + .mode = SPI_MODE_3,
6525 + },
6526 + {
6527 + .modalias = "spi_mmc",
6528 + .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
6529 + .bus_num = 0,
6530 + .chip_select = CONFIG_SPI_MMC_CS_CHAN,
6531 + .platform_data = NULL,
6532 + .controller_data = &spi_mmc_chip_info,
6533 .mode = SPI_MODE_3,
6534 },
6535 #endif
6536 @@ -469,13 +479,8 @@
6537 #endif
6538
6539 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
6540 -static struct platform_device bfin_mii_bus = {
6541 - .name = "bfin_mii_bus",
6542 -};
6543 -
6544 static struct platform_device bfin_mac_device = {
6545 .name = "bfin_mac",
6546 - .dev.platform_data = &bfin_mii_bus,
6547 };
6548 #endif
6549
6550 @@ -586,7 +591,6 @@
6551 #endif
6552
6553 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
6554 - &bfin_mii_bus,
6555 &bfin_mac_device,
6556 #endif
6557
6558 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf537/boards/generic_board.c linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf537/boards/generic_board.c
6559 --- linux-2.6.29.owrt/arch/blackfin/mach-bf537/boards/generic_board.c 1970-01-01 01:00:00.000000000 +0100
6560 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf537/boards/generic_board.c 2009-05-10 23:48:28.000000000 +0200
6561 @@ -0,0 +1,739 @@
6562 +/*
6563 + * File: arch/blackfin/mach-bf537/boards/generic_board.c
6564 + * Based on: arch/blackfin/mach-bf533/boards/ezkit.c
6565 + * Author: Aidan Williams <aidan@nicta.com.au>
6566 + *
6567 + * Created:
6568 + * Description:
6569 + *
6570 + * Modified:
6571 + * Copyright 2005 National ICT Australia (NICTA)
6572 + * Copyright 2004-2008 Analog Devices Inc.
6573 + *
6574 + * Bugs: Enter bugs at http://blackfin.uclinux.org/
6575 + *
6576 + * This program is free software; you can redistribute it and/or modify
6577 + * it under the terms of the GNU General Public License as published by
6578 + * the Free Software Foundation; either version 2 of the License, or
6579 + * (at your option) any later version.
6580 + *
6581 + * This program is distributed in the hope that it will be useful,
6582 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
6583 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6584 + * GNU General Public License for more details.
6585 + *
6586 + * You should have received a copy of the GNU General Public License
6587 + * along with this program; if not, see the file COPYING, or write
6588 + * to the Free Software Foundation, Inc.,
6589 + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
6590 + */
6591 +
6592 +#include <linux/device.h>
6593 +#include <linux/etherdevice.h>
6594 +#include <linux/platform_device.h>
6595 +#include <linux/mtd/mtd.h>
6596 +#include <linux/mtd/partitions.h>
6597 +#include <linux/spi/spi.h>
6598 +#include <linux/spi/flash.h>
6599 +#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
6600 +#include <linux/usb/isp1362.h>
6601 +#endif
6602 +#include <linux/irq.h>
6603 +#include <linux/interrupt.h>
6604 +#include <linux/usb/sl811.h>
6605 +#include <asm/dma.h>
6606 +#include <asm/bfin5xx_spi.h>
6607 +#include <asm/reboot.h>
6608 +#include <asm/portmux.h>
6609 +#include <linux/spi/ad7877.h>
6610 +
6611 +/*
6612 + * Name the Board for the /proc/cpuinfo
6613 + */
6614 +const char bfin_board_name[] = "UNKNOWN BOARD";
6615 +
6616 +/*
6617 + * Driver needs to know address, irq and flag pin.
6618 + */
6619 +
6620 +#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
6621 +#include <linux/usb/isp1760.h>
6622 +static struct resource bfin_isp1760_resources[] = {
6623 + [0] = {
6624 + .start = 0x203C0000,
6625 + .end = 0x203C0000 + 0x000fffff,
6626 + .flags = IORESOURCE_MEM,
6627 + },
6628 + [1] = {
6629 + .start = IRQ_PF7,
6630 + .end = IRQ_PF7,
6631 + .flags = IORESOURCE_IRQ,
6632 + },
6633 +};
6634 +
6635 +static struct isp1760_platform_data isp1760_priv = {
6636 + .is_isp1761 = 0,
6637 + .port1_disable = 0,
6638 + .bus_width_16 = 1,
6639 + .port1_otg = 0,
6640 + .analog_oc = 0,
6641 + .dack_polarity_high = 0,
6642 + .dreq_polarity_high = 0,
6643 +};
6644 +
6645 +static struct platform_device bfin_isp1760_device = {
6646 + .name = "isp1760-hcd",
6647 + .id = 0,
6648 + .dev = {
6649 + .platform_data = &isp1760_priv,
6650 + },
6651 + .num_resources = ARRAY_SIZE(bfin_isp1760_resources),
6652 + .resource = bfin_isp1760_resources,
6653 +};
6654 +#endif
6655 +
6656 +#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
6657 +static struct resource bfin_pcmcia_cf_resources[] = {
6658 + {
6659 + .start = 0x20310000, /* IO PORT */
6660 + .end = 0x20312000,
6661 + .flags = IORESOURCE_MEM,
6662 + }, {
6663 + .start = 0x20311000, /* Attribute Memory */
6664 + .end = 0x20311FFF,
6665 + .flags = IORESOURCE_MEM,
6666 + }, {
6667 + .start = IRQ_PF4,
6668 + .end = IRQ_PF4,
6669 + .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
6670 + }, {
6671 + .start = 6, /* Card Detect PF6 */
6672 + .end = 6,
6673 + .flags = IORESOURCE_IRQ,
6674 + },
6675 +};
6676 +
6677 +static struct platform_device bfin_pcmcia_cf_device = {
6678 + .name = "bfin_cf_pcmcia",
6679 + .id = -1,
6680 + .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources),
6681 + .resource = bfin_pcmcia_cf_resources,
6682 +};
6683 +#endif
6684 +
6685 +#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
6686 +static struct platform_device rtc_device = {
6687 + .name = "rtc-bfin",
6688 + .id = -1,
6689 +};
6690 +#endif
6691 +
6692 +#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
6693 +static struct resource smc91x_resources[] = {
6694 + {
6695 + .name = "smc91x-regs",
6696 + .start = 0x20300300,
6697 + .end = 0x20300300 + 16,
6698 + .flags = IORESOURCE_MEM,
6699 + }, {
6700 +
6701 + .start = IRQ_PF7,
6702 + .end = IRQ_PF7,
6703 + .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
6704 + },
6705 +};
6706 +static struct platform_device smc91x_device = {
6707 + .name = "smc91x",
6708 + .id = 0,
6709 + .num_resources = ARRAY_SIZE(smc91x_resources),
6710 + .resource = smc91x_resources,
6711 +};
6712 +#endif
6713 +
6714 +#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
6715 +static struct resource dm9000_resources[] = {
6716 + [0] = {
6717 + .start = 0x203FB800,
6718 + .end = 0x203FB800 + 1,
6719 + .flags = IORESOURCE_MEM,
6720 + },
6721 + [1] = {
6722 + .start = 0x203FB800 + 4,
6723 + .end = 0x203FB800 + 5,
6724 + .flags = IORESOURCE_MEM,
6725 + },
6726 + [2] = {
6727 + .start = IRQ_PF9,
6728 + .end = IRQ_PF9,
6729 + .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE),
6730 + },
6731 +};
6732 +
6733 +static struct platform_device dm9000_device = {
6734 + .name = "dm9000",
6735 + .id = -1,
6736 + .num_resources = ARRAY_SIZE(dm9000_resources),
6737 + .resource = dm9000_resources,
6738 +};
6739 +#endif
6740 +
6741 +#if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
6742 +static struct resource sl811_hcd_resources[] = {
6743 + {
6744 + .start = 0x20340000,
6745 + .end = 0x20340000,
6746 + .flags = IORESOURCE_MEM,
6747 + }, {
6748 + .start = 0x20340004,
6749 + .end = 0x20340004,
6750 + .flags = IORESOURCE_MEM,
6751 + }, {
6752 + .start = CONFIG_USB_SL811_BFIN_IRQ,
6753 + .end = CONFIG_USB_SL811_BFIN_IRQ,
6754 + .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
6755 + },
6756 +};
6757 +
6758 +#if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
6759 +void sl811_port_power(struct device *dev, int is_on)
6760 +{
6761 + gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS");
6762 + gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS, is_on);
6763 +
6764 +}
6765 +#endif
6766 +
6767 +static struct sl811_platform_data sl811_priv = {
6768 + .potpg = 10,
6769 + .power = 250, /* == 500mA */
6770 +#if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
6771 + .port_power = &sl811_port_power,
6772 +#endif
6773 +};
6774 +
6775 +static struct platform_device sl811_hcd_device = {
6776 + .name = "sl811-hcd",
6777 + .id = 0,
6778 + .dev = {
6779 + .platform_data = &sl811_priv,
6780 + },
6781 + .num_resources = ARRAY_SIZE(sl811_hcd_resources),
6782 + .resource = sl811_hcd_resources,
6783 +};
6784 +#endif
6785 +
6786 +#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
6787 +static struct resource isp1362_hcd_resources[] = {
6788 + {
6789 + .start = 0x20360000,
6790 + .end = 0x20360000,
6791 + .flags = IORESOURCE_MEM,
6792 + }, {
6793 + .start = 0x20360004,
6794 + .end = 0x20360004,
6795 + .flags = IORESOURCE_MEM,
6796 + }, {
6797 + .start = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
6798 + .end = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
6799 + .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
6800 + },
6801 +};
6802 +
6803 +static struct isp1362_platform_data isp1362_priv = {
6804 + .sel15Kres = 1,
6805 + .clknotstop = 0,
6806 + .oc_enable = 0,
6807 + .int_act_high = 0,
6808 + .int_edge_triggered = 0,
6809 + .remote_wakeup_connected = 0,
6810 + .no_power_switching = 1,
6811 + .power_switching_mode = 0,
6812 +};
6813 +
6814 +static struct platform_device isp1362_hcd_device = {
6815 + .name = "isp1362-hcd",
6816 + .id = 0,
6817 + .dev = {
6818 + .platform_data = &isp1362_priv,
6819 + },
6820 + .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
6821 + .resource = isp1362_hcd_resources,
6822 +};
6823 +#endif
6824 +
6825 +#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
6826 +static struct platform_device bfin_mac_device = {
6827 + .name = "bfin_mac",
6828 +};
6829 +#endif
6830 +
6831 +#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
6832 +static struct resource net2272_bfin_resources[] = {
6833 + {
6834 + .start = 0x20300000,
6835 + .end = 0x20300000 + 0x100,
6836 + .flags = IORESOURCE_MEM,
6837 + }, {
6838 + .start = IRQ_PF7,
6839 + .end = IRQ_PF7,
6840 + .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
6841 + },
6842 +};
6843 +
6844 +static struct platform_device net2272_bfin_device = {
6845 + .name = "net2272",
6846 + .id = -1,
6847 + .num_resources = ARRAY_SIZE(net2272_bfin_resources),
6848 + .resource = net2272_bfin_resources,
6849 +};
6850 +#endif
6851 +
6852 +#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
6853 +/* all SPI peripherals info goes here */
6854 +
6855 +#if defined(CONFIG_MTD_M25P80) \
6856 + || defined(CONFIG_MTD_M25P80_MODULE)
6857 +static struct mtd_partition bfin_spi_flash_partitions[] = {
6858 + {
6859 + .name = "bootloader(spi)",
6860 + .size = 0x00020000,
6861 + .offset = 0,
6862 + .mask_flags = MTD_CAP_ROM
6863 + }, {
6864 + .name = "linux kernel(spi)",
6865 + .size = 0xe0000,
6866 + .offset = 0x20000
6867 + }, {
6868 + .name = "file system(spi)",
6869 + .size = 0x700000,
6870 + .offset = 0x00100000,
6871 + }
6872 +};
6873 +
6874 +static struct flash_platform_data bfin_spi_flash_data = {
6875 + .name = "m25p80",
6876 + .parts = bfin_spi_flash_partitions,
6877 + .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
6878 + .type = "m25p64",
6879 +};
6880 +
6881 +/* SPI flash chip (m25p64) */
6882 +static struct bfin5xx_spi_chip spi_flash_chip_info = {
6883 + .enable_dma = 0, /* use dma transfer with this chip*/
6884 + .bits_per_word = 8,
6885 +};
6886 +#endif
6887 +
6888 +#if defined(CONFIG_SPI_ADC_BF533) \
6889 + || defined(CONFIG_SPI_ADC_BF533_MODULE)
6890 +/* SPI ADC chip */
6891 +static struct bfin5xx_spi_chip spi_adc_chip_info = {
6892 + .enable_dma = 1, /* use dma transfer with this chip*/
6893 + .bits_per_word = 16,
6894 +};
6895 +#endif
6896 +
6897 +#if defined(CONFIG_SND_BLACKFIN_AD1836) \
6898 + || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
6899 +static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
6900 + .enable_dma = 0,
6901 + .bits_per_word = 16,
6902 +};
6903 +#endif
6904 +
6905 +#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
6906 +static struct bfin5xx_spi_chip ad9960_spi_chip_info = {
6907 + .enable_dma = 0,
6908 + .bits_per_word = 16,
6909 +};
6910 +#endif
6911 +
6912 +#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
6913 +static struct bfin5xx_spi_chip spi_mmc_chip_info = {
6914 + .enable_dma = 1,
6915 + .bits_per_word = 8,
6916 +};
6917 +#endif
6918 +
6919 +#if defined(CONFIG_PBX)
6920 +static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
6921 + .ctl_reg = 0x4, /* send zero */
6922 + .enable_dma = 0,
6923 + .bits_per_word = 8,
6924 + .cs_change_per_word = 1,
6925 +};
6926 +#endif
6927 +
6928 +#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
6929 +static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
6930 + .enable_dma = 0,
6931 + .bits_per_word = 16,
6932 +};
6933 +
6934 +static const struct ad7877_platform_data bfin_ad7877_ts_info = {
6935 + .model = 7877,
6936 + .vref_delay_usecs = 50, /* internal, no capacitor */
6937 + .x_plate_ohms = 419,
6938 + .y_plate_ohms = 486,
6939 + .pressure_max = 1000,
6940 + .pressure_min = 0,
6941 + .stopacq_polarity = 1,
6942 + .first_conversion_delay = 3,
6943 + .acquisition_time = 1,
6944 + .averaging = 1,
6945 + .pen_down_acc_interval = 1,
6946 +};
6947 +#endif
6948 +
6949 +static struct spi_board_info bfin_spi_board_info[] __initdata = {
6950 +#if defined(CONFIG_MTD_M25P80) \
6951 + || defined(CONFIG_MTD_M25P80_MODULE)
6952 + {
6953 + /* the modalias must be the same as spi device driver name */
6954 + .modalias = "m25p80", /* Name of spi_driver for this device */
6955 + .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
6956 + .bus_num = 0, /* Framework bus number */
6957 + .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
6958 + .platform_data = &bfin_spi_flash_data,
6959 + .controller_data = &spi_flash_chip_info,
6960 + .mode = SPI_MODE_3,
6961 + },
6962 +#endif
6963 +
6964 +#if defined(CONFIG_SPI_ADC_BF533) \
6965 + || defined(CONFIG_SPI_ADC_BF533_MODULE)
6966 + {
6967 + .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
6968 + .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
6969 + .bus_num = 0, /* Framework bus number */
6970 + .chip_select = 1, /* Framework chip select. */
6971 + .platform_data = NULL, /* No spi_driver specific config */
6972 + .controller_data = &spi_adc_chip_info,
6973 + },
6974 +#endif
6975 +
6976 +#if defined(CONFIG_SND_BLACKFIN_AD1836) \
6977 + || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
6978 + {
6979 + .modalias = "ad1836-spi",
6980 + .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
6981 + .bus_num = 0,
6982 + .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
6983 + .controller_data = &ad1836_spi_chip_info,
6984 + },
6985 +#endif
6986 +#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
6987 + {
6988 + .modalias = "ad9960-spi",
6989 + .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */
6990 + .bus_num = 0,
6991 + .chip_select = 1,
6992 + .controller_data = &ad9960_spi_chip_info,
6993 + },
6994 +#endif
6995 +#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
6996 + {
6997 + .modalias = "spi_mmc_dummy",
6998 + .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
6999 + .bus_num = 0,
7000 + .chip_select = 0,
7001 + .platform_data = NULL,
7002 + .controller_data = &spi_mmc_chip_info,
7003 + .mode = SPI_MODE_3,
7004 + },
7005 + {
7006 + .modalias = "spi_mmc",
7007 + .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
7008 + .bus_num = 0,
7009 + .chip_select = CONFIG_SPI_MMC_CS_CHAN,
7010 + .platform_data = NULL,
7011 + .controller_data = &spi_mmc_chip_info,
7012 + .mode = SPI_MODE_3,
7013 + },
7014 +#endif
7015 +#if defined(CONFIG_PBX)
7016 + {
7017 + .modalias = "fxs-spi",
7018 + .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
7019 + .bus_num = 0,
7020 + .chip_select = 8 - CONFIG_J11_JUMPER,
7021 + .controller_data = &spi_si3xxx_chip_info,
7022 + .mode = SPI_MODE_3,
7023 + },
7024 + {
7025 + .modalias = "fxo-spi",
7026 + .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
7027 + .bus_num = 0,
7028 + .chip_select = 8 - CONFIG_J19_JUMPER,
7029 + .controller_data = &spi_si3xxx_chip_info,
7030 + .mode = SPI_MODE_3,
7031 + },
7032 +#endif
7033 +#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
7034 + {
7035 + .modalias = "ad7877",
7036 + .platform_data = &bfin_ad7877_ts_info,
7037 + .irq = IRQ_PF6,
7038 + .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
7039 + .bus_num = 0,
7040 + .chip_select = 1,
7041 + .controller_data = &spi_ad7877_chip_info,
7042 + },
7043 +#endif
7044 +};
7045 +
7046 +/* SPI controller data */
7047 +static struct bfin5xx_spi_master bfin_spi0_info = {
7048 + .num_chipselect = 8,
7049 + .enable_dma = 1, /* master has the ability to do dma transfer */
7050 + .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
7051 +};
7052 +
7053 +/* SPI (0) */
7054 +static struct resource bfin_spi0_resource[] = {
7055 + [0] = {
7056 + .start = SPI0_REGBASE,
7057 + .end = SPI0_REGBASE + 0xFF,
7058 + .flags = IORESOURCE_MEM,
7059 + },
7060 + [1] = {
7061 + .start = CH_SPI,
7062 + .end = CH_SPI,
7063 + .flags = IORESOURCE_IRQ,
7064 + },
7065 +};
7066 +
7067 +static struct platform_device bfin_spi0_device = {
7068 + .name = "bfin-spi",
7069 + .id = 0, /* Bus number */
7070 + .num_resources = ARRAY_SIZE(bfin_spi0_resource),
7071 + .resource = bfin_spi0_resource,
7072 + .dev = {
7073 + .platform_data = &bfin_spi0_info, /* Passed to driver */
7074 + },
7075 +};
7076 +#endif /* spi master and devices */
7077 +
7078 +#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
7079 +static struct platform_device bfin_fb_device = {
7080 + .name = "bf537-lq035",
7081 +};
7082 +#endif
7083 +
7084 +#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
7085 +static struct platform_device bfin_fb_adv7393_device = {
7086 + .name = "bfin-adv7393",
7087 +};
7088 +#endif
7089 +
7090 +#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
7091 +static struct resource bfin_uart_resources[] = {
7092 + {
7093 + .start = 0xFFC00400,
7094 + .end = 0xFFC004FF,
7095 + .flags = IORESOURCE_MEM,
7096 + }, {
7097 + .start = 0xFFC02000,
7098 + .end = 0xFFC020FF,
7099 + .flags = IORESOURCE_MEM,
7100 + },
7101 +};
7102 +
7103 +static struct platform_device bfin_uart_device = {
7104 + .name = "bfin-uart",
7105 + .id = 1,
7106 + .num_resources = ARRAY_SIZE(bfin_uart_resources),
7107 + .resource = bfin_uart_resources,
7108 +};
7109 +#endif
7110 +
7111 +#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
7112 +#ifdef CONFIG_BFIN_SIR0
7113 +static struct resource bfin_sir0_resources[] = {
7114 + {
7115 + .start = 0xFFC00400,
7116 + .end = 0xFFC004FF,
7117 + .flags = IORESOURCE_MEM,
7118 + },
7119 + {
7120 + .start = IRQ_UART0_RX,
7121 + .end = IRQ_UART0_RX+1,
7122 + .flags = IORESOURCE_IRQ,
7123 + },
7124 + {
7125 + .start = CH_UART0_RX,
7126 + .end = CH_UART0_RX+1,
7127 + .flags = IORESOURCE_DMA,
7128 + },
7129 +};
7130 +
7131 +static struct platform_device bfin_sir0_device = {
7132 + .name = "bfin_sir",
7133 + .id = 0,
7134 + .num_resources = ARRAY_SIZE(bfin_sir0_resources),
7135 + .resource = bfin_sir0_resources,
7136 +};
7137 +#endif
7138 +#ifdef CONFIG_BFIN_SIR1
7139 +static struct resource bfin_sir1_resources[] = {
7140 + {
7141 + .start = 0xFFC02000,
7142 + .end = 0xFFC020FF,
7143 + .flags = IORESOURCE_MEM,
7144 + },
7145 + {
7146 + .start = IRQ_UART1_RX,
7147 + .end = IRQ_UART1_RX+1,
7148 + .flags = IORESOURCE_IRQ,
7149 + },
7150 + {
7151 + .start = CH_UART1_RX,
7152 + .end = CH_UART1_RX+1,
7153 + .flags = IORESOURCE_DMA,
7154 + },
7155 +};
7156 +
7157 +static struct platform_device bfin_sir1_device = {
7158 + .name = "bfin_sir",
7159 + .id = 1,
7160 + .num_resources = ARRAY_SIZE(bfin_sir1_resources),
7161 + .resource = bfin_sir1_resources,
7162 +};
7163 +#endif
7164 +#endif
7165 +
7166 +#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
7167 +static struct resource bfin_twi0_resource[] = {
7168 + [0] = {
7169 + .start = TWI0_REGBASE,
7170 + .end = TWI0_REGBASE + 0xFF,
7171 + .flags = IORESOURCE_MEM,
7172 + },
7173 + [1] = {
7174 + .start = IRQ_TWI,
7175 + .end = IRQ_TWI,
7176 + .flags = IORESOURCE_IRQ,
7177 + },
7178 +};
7179 +
7180 +static struct platform_device i2c_bfin_twi_device = {
7181 + .name = "i2c-bfin-twi",
7182 + .id = 0,
7183 + .num_resources = ARRAY_SIZE(bfin_twi0_resource),
7184 + .resource = bfin_twi0_resource,
7185 +};
7186 +#endif
7187 +
7188 +#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
7189 +static struct platform_device bfin_sport0_uart_device = {
7190 + .name = "bfin-sport-uart",
7191 + .id = 0,
7192 +};
7193 +
7194 +static struct platform_device bfin_sport1_uart_device = {
7195 + .name = "bfin-sport-uart",
7196 + .id = 1,
7197 +};
7198 +#endif
7199 +
7200 +static struct platform_device *stamp_devices[] __initdata = {
7201 +#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
7202 + &bfin_pcmcia_cf_device,
7203 +#endif
7204 +
7205 +#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
7206 + &rtc_device,
7207 +#endif
7208 +
7209 +#if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
7210 + &sl811_hcd_device,
7211 +#endif
7212 +
7213 +#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
7214 + &isp1362_hcd_device,
7215 +#endif
7216 +
7217 +#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
7218 + &smc91x_device,
7219 +#endif
7220 +
7221 +#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
7222 + &dm9000_device,
7223 +#endif
7224 +
7225 +#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
7226 + &bfin_mac_device,
7227 +#endif
7228 +
7229 +#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
7230 + &net2272_bfin_device,
7231 +#endif
7232 +
7233 +#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
7234 + &bfin_isp1760_device,
7235 +#endif
7236 +
7237 +#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
7238 + &bfin_spi0_device,
7239 +#endif
7240 +
7241 +#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
7242 + &bfin_fb_device,
7243 +#endif
7244 +
7245 +#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
7246 + &bfin_fb_adv7393_device,
7247 +#endif
7248 +
7249 +#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
7250 + &bfin_uart_device,
7251 +#endif
7252 +
7253 +#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
7254 +#ifdef CONFIG_BFIN_SIR0
7255 + &bfin_sir0_device,
7256 +#endif
7257 +#ifdef CONFIG_BFIN_SIR1
7258 + &bfin_sir1_device,
7259 +#endif
7260 +#endif
7261 +
7262 +#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
7263 + &i2c_bfin_twi_device,
7264 +#endif
7265 +
7266 +#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
7267 + &bfin_sport0_uart_device,
7268 + &bfin_sport1_uart_device,
7269 +#endif
7270 +};
7271 +
7272 +static int __init stamp_init(void)
7273 +{
7274 + printk(KERN_INFO "%s(): registering device resources\n", __func__);
7275 + platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
7276 +#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
7277 + spi_register_board_info(bfin_spi_board_info,
7278 + ARRAY_SIZE(bfin_spi_board_info));
7279 +#endif
7280 +
7281 + return 0;
7282 +}
7283 +
7284 +arch_initcall(stamp_init);
7285 +
7286 +void native_machine_restart(char *cmd)
7287 +{
7288 + /* workaround reboot hang when booting from SPI */
7289 + if ((bfin_read_SYSCR() & 0x7) == 0x3)
7290 + bfin_gpio_reset_spi0_ssel1();
7291 +}
7292 +
7293 +#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
7294 +void bfin_get_ether_addr(char *addr)
7295 +{
7296 + random_ether_addr(addr);
7297 + printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__);
7298 +}
7299 +EXPORT_SYMBOL(bfin_get_ether_addr);
7300 +#endif
7301 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf537/boards/Kconfig linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf537/boards/Kconfig
7302 --- linux-2.6.29.owrt/arch/blackfin/mach-bf537/boards/Kconfig 2009-05-10 22:04:40.000000000 +0200
7303 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf537/boards/Kconfig 2009-05-10 23:48:28.000000000 +0200
7304 @@ -33,4 +33,9 @@
7305 help
7306 Board supply package for CSP Minotaur
7307
7308 +config GENERIC_BF537_BOARD
7309 + bool "Generic"
7310 + help
7311 + Generic or Custom board support.
7312 +
7313 endchoice
7314 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf537/boards/Makefile linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf537/boards/Makefile
7315 --- linux-2.6.29.owrt/arch/blackfin/mach-bf537/boards/Makefile 2009-05-10 22:04:40.000000000 +0200
7316 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf537/boards/Makefile 2009-05-10 23:48:28.000000000 +0200
7317 @@ -2,6 +2,7 @@
7318 # arch/blackfin/mach-bf537/boards/Makefile
7319 #
7320
7321 +obj-$(CONFIG_GENERIC_BF537_BOARD) += generic_board.o
7322 obj-$(CONFIG_BFIN537_STAMP) += stamp.o
7323 obj-$(CONFIG_BFIN537_BLUETECHNIX_CM) += cm_bf537.o
7324 obj-$(CONFIG_BFIN537_BLUETECHNIX_TCM) += tcm_bf537.o
7325 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf537/boards/minotaur.c linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf537/boards/minotaur.c
7326 --- linux-2.6.29.owrt/arch/blackfin/mach-bf537/boards/minotaur.c 2009-05-10 22:04:40.000000000 +0200
7327 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf537/boards/minotaur.c 2009-05-10 23:48:28.000000000 +0200
7328 @@ -61,13 +61,8 @@
7329 #endif
7330
7331 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
7332 -static struct platform_device bfin_mii_bus = {
7333 - .name = "bfin_mii_bus",
7334 -};
7335 -
7336 static struct platform_device bfin_mac_device = {
7337 .name = "bfin_mac",
7338 - .dev.platform_data = &bfin_mii_bus,
7339 };
7340 #endif
7341
7342 @@ -134,9 +129,9 @@
7343 };
7344 #endif
7345
7346 -#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
7347 -static struct bfin5xx_spi_chip mmc_spi_chip_info = {
7348 - .enable_dma = 0,
7349 +#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
7350 +static struct bfin5xx_spi_chip spi_mmc_chip_info = {
7351 + .enable_dma = 1,
7352 .bits_per_word = 8,
7353 };
7354 #endif
7355 @@ -156,13 +151,23 @@
7356 },
7357 #endif
7358
7359 -#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
7360 +#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
7361 + {
7362 + .modalias = "spi_mmc_dummy",
7363 + .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
7364 + .bus_num = 0,
7365 + .chip_select = 0,
7366 + .platform_data = NULL,
7367 + .controller_data = &spi_mmc_chip_info,
7368 + .mode = SPI_MODE_3,
7369 + },
7370 {
7371 - .modalias = "mmc_spi",
7372 + .modalias = "spi_mmc",
7373 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
7374 .bus_num = 0,
7375 - .chip_select = 5,
7376 - .controller_data = &mmc_spi_chip_info,
7377 + .chip_select = CONFIG_SPI_MMC_CS_CHAN,
7378 + .platform_data = NULL,
7379 + .controller_data = &spi_mmc_chip_info,
7380 .mode = SPI_MODE_3,
7381 },
7382 #endif
7383 @@ -319,7 +324,6 @@
7384 #endif
7385
7386 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
7387 - &bfin_mii_bus,
7388 &bfin_mac_device,
7389 #endif
7390
7391 @@ -373,5 +377,5 @@
7392 {
7393 /* workaround reboot hang when booting from SPI */
7394 if ((bfin_read_SYSCR() & 0x7) == 0x3)
7395 - bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
7396 + bfin_gpio_reset_spi0_ssel1();
7397 }
7398 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf537/boards/pnav10.c linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf537/boards/pnav10.c
7399 --- linux-2.6.29.owrt/arch/blackfin/mach-bf537/boards/pnav10.c 2009-05-10 22:04:40.000000000 +0200
7400 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf537/boards/pnav10.c 2009-05-10 23:48:28.000000000 +0200
7401 @@ -198,13 +198,8 @@
7402 #endif
7403
7404 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
7405 -static struct platform_device bfin_mii_bus = {
7406 - .name = "bfin_mii_bus",
7407 -};
7408 -
7409 static struct platform_device bfin_mac_device = {
7410 .name = "bfin_mac",
7411 - .dev.platform_data = &bfin_mii_bus,
7412 };
7413 #endif
7414
7415 @@ -289,9 +284,9 @@
7416 };
7417 #endif
7418
7419 -#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
7420 -static struct bfin5xx_spi_chip mmc_spi_chip_info = {
7421 - .enable_dma = 0,
7422 +#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
7423 +static struct bfin5xx_spi_chip spi_mmc_chip_info = {
7424 + .enable_dma = 1,
7425 .bits_per_word = 8,
7426 };
7427 #endif
7428 @@ -364,13 +359,23 @@
7429 .controller_data = &ad9960_spi_chip_info,
7430 },
7431 #endif
7432 -#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
7433 +#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
7434 + {
7435 + .modalias = "spi_mmc_dummy",
7436 + .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
7437 + .bus_num = 0,
7438 + .chip_select = 7,
7439 + .platform_data = NULL,
7440 + .controller_data = &spi_mmc_chip_info,
7441 + .mode = SPI_MODE_3,
7442 + },
7443 {
7444 - .modalias = "mmc_spi",
7445 + .modalias = "spi_mmc",
7446 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
7447 .bus_num = 0,
7448 - .chip_select = 5,
7449 - .controller_data = &mmc_spi_chip_info,
7450 + .chip_select = CONFIG_SPI_MMC_CS_CHAN,
7451 + .platform_data = NULL,
7452 + .controller_data = &spi_mmc_chip_info,
7453 .mode = SPI_MODE_3,
7454 },
7455 #endif
7456 @@ -524,7 +529,6 @@
7457 #endif
7458
7459 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
7460 - &bfin_mii_bus,
7461 &bfin_mac_device,
7462 #endif
7463
7464 @@ -554,7 +558,7 @@
7465 #endif
7466 };
7467
7468 -static int __init pnav_init(void)
7469 +static int __init stamp_init(void)
7470 {
7471 printk(KERN_INFO "%s(): registering device resources\n", __func__);
7472 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
7473 @@ -565,7 +569,7 @@
7474 return 0;
7475 }
7476
7477 -arch_initcall(pnav_init);
7478 +arch_initcall(stamp_init);
7479
7480 void bfin_get_ether_addr(char *addr)
7481 {
7482 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf537/boards/stamp.c linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf537/boards/stamp.c
7483 --- linux-2.6.29.owrt/arch/blackfin/mach-bf537/boards/stamp.c 2009-05-10 22:04:40.000000000 +0200
7484 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf537/boards/stamp.c 2009-05-10 23:48:28.000000000 +0200
7485 @@ -321,13 +321,8 @@
7486 #endif
7487
7488 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
7489 -static struct platform_device bfin_mii_bus = {
7490 - .name = "bfin_mii_bus",
7491 -};
7492 -
7493 static struct platform_device bfin_mac_device = {
7494 .name = "bfin_mac",
7495 - .dev.platform_data = &bfin_mii_bus,
7496 };
7497 #endif
7498
7499 @@ -1073,6 +1068,7 @@
7500 };
7501 #endif
7502
7503 +#ifdef CONFIG_I2C_BOARDINFO
7504 static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
7505 #if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE)
7506 {
7507 @@ -1106,6 +1102,7 @@
7508 },
7509 #endif
7510 };
7511 +#endif
7512
7513 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
7514 static struct platform_device bfin_sport0_uart_device = {
7515 @@ -1220,7 +1217,6 @@
7516 #endif
7517
7518 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
7519 - &bfin_mii_bus,
7520 &bfin_mac_device,
7521 #endif
7522
7523 @@ -1288,8 +1284,12 @@
7524 static int __init stamp_init(void)
7525 {
7526 printk(KERN_INFO "%s(): registering device resources\n", __func__);
7527 +
7528 +#ifdef CONFIG_I2C_BOARDINFO
7529 i2c_register_board_info(0, bfin_i2c_board_info,
7530 ARRAY_SIZE(bfin_i2c_board_info));
7531 +#endif
7532 +
7533 bfin_plat_nand_init();
7534 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
7535 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
7536 @@ -1307,7 +1307,7 @@
7537 {
7538 /* workaround reboot hang when booting from SPI */
7539 if ((bfin_read_SYSCR() & 0x7) == 0x3)
7540 - bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
7541 + bfin_gpio_reset_spi0_ssel1();
7542 }
7543
7544 /*
7545 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf537/boards/tcm_bf537.c linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf537/boards/tcm_bf537.c
7546 --- linux-2.6.29.owrt/arch/blackfin/mach-bf537/boards/tcm_bf537.c 2009-05-10 22:04:40.000000000 +0200
7547 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf537/boards/tcm_bf537.c 2009-05-10 23:48:28.000000000 +0200
7548 @@ -108,9 +108,9 @@
7549 };
7550 #endif
7551
7552 -#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
7553 -static struct bfin5xx_spi_chip mmc_spi_chip_info = {
7554 - .enable_dma = 0,
7555 +#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
7556 +static struct bfin5xx_spi_chip spi_mmc_chip_info = {
7557 + .enable_dma = 1,
7558 .bits_per_word = 8,
7559 };
7560 #endif
7561 @@ -160,13 +160,23 @@
7562 },
7563 #endif
7564
7565 -#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
7566 +#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
7567 {
7568 - .modalias = "mmc_spi",
7569 + .modalias = "spi_mmc_dummy",
7570 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
7571 .bus_num = 0,
7572 - .chip_select = 5,
7573 - .controller_data = &mmc_spi_chip_info,
7574 + .chip_select = 7,
7575 + .platform_data = NULL,
7576 + .controller_data = &spi_mmc_chip_info,
7577 + .mode = SPI_MODE_3,
7578 + },
7579 + {
7580 + .modalias = "spi_mmc",
7581 + .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
7582 + .bus_num = 0,
7583 + .chip_select = CONFIG_SPI_MMC_CS_CHAN,
7584 + .platform_data = NULL,
7585 + .controller_data = &spi_mmc_chip_info,
7586 .mode = SPI_MODE_3,
7587 },
7588 #endif
7589 @@ -471,13 +481,8 @@
7590 #endif
7591
7592 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
7593 -static struct platform_device bfin_mii_bus = {
7594 - .name = "bfin_mii_bus",
7595 -};
7596 -
7597 static struct platform_device bfin_mac_device = {
7598 .name = "bfin_mac",
7599 - .dev.platform_data = &bfin_mii_bus,
7600 };
7601 #endif
7602
7603 @@ -588,7 +593,6 @@
7604 #endif
7605
7606 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
7607 - &bfin_mii_bus,
7608 &bfin_mac_device,
7609 #endif
7610
7611 @@ -611,7 +615,7 @@
7612 &bfin_gpios_device,
7613 };
7614
7615 -static int __init tcm_bf537_init(void)
7616 +static int __init cm_bf537_init(void)
7617 {
7618 printk(KERN_INFO "%s(): registering device resources\n", __func__);
7619 platform_add_devices(cm_bf537_devices, ARRAY_SIZE(cm_bf537_devices));
7620 @@ -625,7 +629,7 @@
7621 return 0;
7622 }
7623
7624 -arch_initcall(tcm_bf537_init);
7625 +arch_initcall(cm_bf537_init);
7626
7627 void bfin_get_ether_addr(char *addr)
7628 {
7629 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf537/include/mach/anomaly.h linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf537/include/mach/anomaly.h
7630 --- linux-2.6.29.owrt/arch/blackfin/mach-bf537/include/mach/anomaly.h 2009-05-10 22:04:40.000000000 +0200
7631 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf537/include/mach/anomaly.h 2009-05-10 23:48:28.000000000 +0200
7632 @@ -2,7 +2,7 @@
7633 * File: include/asm-blackfin/mach-bf537/anomaly.h
7634 * Bugs: Enter bugs at http://blackfin.uclinux.org/
7635 *
7636 - * Copyright (C) 2004-2009 Analog Devices Inc.
7637 + * Copyright (C) 2004-2008 Analog Devices Inc.
7638 * Licensed under the GPL-2 or later.
7639 */
7640
7641 @@ -110,7 +110,7 @@
7642 #define ANOMALY_05000301 (1)
7643 /* SSYNCs After Writes To CAN/DMA MMR Registers Are Not Always Handled Correctly */
7644 #define ANOMALY_05000304 (__SILICON_REVISION__ < 3)
7645 -/* SPORT_HYS Bit in PLL_CTL Register Is Not Functional */
7646 +/* New Feature: Additional Hysteresis on SPORT Input Pins (Not Available On Older Silicon) */
7647 #define ANOMALY_05000305 (__SILICON_REVISION__ < 3)
7648 /* SCKELOW Bit Does Not Maintain State Through Hibernate */
7649 #define ANOMALY_05000307 (__SILICON_REVISION__ < 3)
7650 @@ -168,12 +168,9 @@
7651 #define ANOMALY_05000323 (0)
7652 #define ANOMALY_05000353 (1)
7653 #define ANOMALY_05000363 (0)
7654 -#define ANOMALY_05000380 (0)
7655 #define ANOMALY_05000386 (1)
7656 #define ANOMALY_05000412 (0)
7657 #define ANOMALY_05000432 (0)
7658 #define ANOMALY_05000435 (0)
7659 -#define ANOMALY_05000447 (0)
7660 -#define ANOMALY_05000448 (0)
7661
7662 #endif
7663 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf537/include/mach/bfin_serial_5xx.h linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf537/include/mach/bfin_serial_5xx.h
7664 --- linux-2.6.29.owrt/arch/blackfin/mach-bf537/include/mach/bfin_serial_5xx.h 2009-05-10 22:04:40.000000000 +0200
7665 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf537/include/mach/bfin_serial_5xx.h 2009-05-10 23:48:28.000000000 +0200
7666 @@ -144,7 +144,7 @@
7667 CH_UART0_TX,
7668 CH_UART0_RX,
7669 #endif
7670 -#ifdef CONFIG_SERIAL_BFIN_CTSRTS
7671 +#ifdef CONFIG_BFIN_UART0_CTSRTS
7672 CONFIG_UART0_CTS_PIN,
7673 CONFIG_UART0_RTS_PIN,
7674 #endif
7675 @@ -158,7 +158,7 @@
7676 CH_UART1_TX,
7677 CH_UART1_RX,
7678 #endif
7679 -#ifdef CONFIG_SERIAL_BFIN_CTSRTS
7680 +#ifdef CONFIG_BFIN_UART1_CTSRTS
7681 CONFIG_UART1_CTS_PIN,
7682 CONFIG_UART1_RTS_PIN,
7683 #endif
7684 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf537/include/mach/portmux.h linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf537/include/mach/portmux.h
7685 --- linux-2.6.29.owrt/arch/blackfin/mach-bf537/include/mach/portmux.h 2009-05-10 22:04:40.000000000 +0200
7686 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf537/include/mach/portmux.h 2009-05-10 23:48:28.000000000 +0200
7687 @@ -31,7 +31,6 @@
7688 #define P_PPI0_FS1 (P_DEFINED | P_IDENT(GPIO_PF9) | P_FUNCT(1))
7689 #define P_TACLK0 (P_DEFINED | P_IDENT(GPIO_PF14) | P_FUNCT(1))
7690 #define P_TMRCLK (P_DEFINED | P_IDENT(GPIO_PF15) | P_FUNCT(1))
7691 -#define P_DEFAULT_BOOT_SPI_CS P_SPI0_SSEL1
7692
7693 #define P_PPI0_D0 (P_DEFINED | P_IDENT(GPIO_PG0) | P_FUNCT(0))
7694 #define P_PPI0_D1 (P_DEFINED | P_IDENT(GPIO_PG1) | P_FUNCT(0))
7695 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf538/include/mach/anomaly.h linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf538/include/mach/anomaly.h
7696 --- linux-2.6.29.owrt/arch/blackfin/mach-bf538/include/mach/anomaly.h 2009-05-10 22:04:40.000000000 +0200
7697 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf538/include/mach/anomaly.h 2009-05-10 23:48:28.000000000 +0200
7698 @@ -2,7 +2,7 @@
7699 * File: include/asm-blackfin/mach-bf538/anomaly.h
7700 * Bugs: Enter bugs at http://blackfin.uclinux.org/
7701 *
7702 - * Copyright (C) 2004-2009 Analog Devices Inc.
7703 + * Copyright (C) 2004-2008 Analog Devices Inc.
7704 * Licensed under the GPL-2 or later.
7705 */
7706
7707 @@ -120,17 +120,13 @@
7708 #define ANOMALY_05000198 (0)
7709 #define ANOMALY_05000230 (0)
7710 #define ANOMALY_05000263 (0)
7711 -#define ANOMALY_05000305 (0)
7712 #define ANOMALY_05000311 (0)
7713 #define ANOMALY_05000323 (0)
7714 #define ANOMALY_05000353 (1)
7715 #define ANOMALY_05000363 (0)
7716 -#define ANOMALY_05000380 (0)
7717 #define ANOMALY_05000386 (1)
7718 #define ANOMALY_05000412 (0)
7719 #define ANOMALY_05000432 (0)
7720 #define ANOMALY_05000435 (0)
7721 -#define ANOMALY_05000447 (0)
7722 -#define ANOMALY_05000448 (0)
7723
7724 #endif
7725 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf538/include/mach/bfin_serial_5xx.h linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf538/include/mach/bfin_serial_5xx.h
7726 --- linux-2.6.29.owrt/arch/blackfin/mach-bf538/include/mach/bfin_serial_5xx.h 2009-05-10 22:04:40.000000000 +0200
7727 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf538/include/mach/bfin_serial_5xx.h 2009-05-10 23:48:28.000000000 +0200
7728 @@ -144,7 +144,7 @@
7729 CH_UART0_TX,
7730 CH_UART0_RX,
7731 #endif
7732 -#ifdef CONFIG_SERIAL_BFIN_CTSRTS
7733 +#ifdef CONFIG_BFIN_UART0_CTSRTS
7734 CONFIG_UART0_CTS_PIN,
7735 CONFIG_UART0_RTS_PIN,
7736 #endif
7737 @@ -158,7 +158,7 @@
7738 CH_UART1_TX,
7739 CH_UART1_RX,
7740 #endif
7741 -#ifdef CONFIG_SERIAL_BFIN_CTSRTS
7742 +#ifdef CONFIG_BFIN_UART1_CTSRTS
7743 CONFIG_UART1_CTS_PIN,
7744 CONFIG_UART1_RTS_PIN,
7745 #endif
7746 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf538/include/mach/portmux.h linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf538/include/mach/portmux.h
7747 --- linux-2.6.29.owrt/arch/blackfin/mach-bf538/include/mach/portmux.h 2009-05-10 22:04:40.000000000 +0200
7748 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf538/include/mach/portmux.h 2009-05-10 23:48:28.000000000 +0200
7749 @@ -102,6 +102,5 @@
7750 #define P_SPI0_SSEL2 (P_DEFINED | P_IDENT(GPIO_PF2))
7751 #define P_SPI0_SSEL1 (P_DEFINED | P_IDENT(GPIO_PF1))
7752 #define P_SPI0_SS (P_DEFINED | P_IDENT(GPIO_PF0))
7753 -#define P_DEFAULT_BOOT_SPI_CS P_SPI0_SSEL2
7754
7755 #endif /* _MACH_PORTMUX_H_ */
7756 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf548/boards/ezkit.c linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf548/boards/ezkit.c
7757 --- linux-2.6.29.owrt/arch/blackfin/mach-bf548/boards/ezkit.c 2009-05-10 22:04:41.000000000 +0200
7758 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf548/boards/ezkit.c 2009-05-10 23:48:28.000000000 +0200
7759 @@ -781,6 +781,7 @@
7760 #endif
7761 #endif
7762
7763 +#ifdef CONFIG_I2C_BOARDINFO
7764 static struct i2c_board_info __initdata bfin_i2c_board_info0[] = {
7765 };
7766
7767 @@ -799,6 +800,7 @@
7768 #endif
7769 };
7770 #endif
7771 +#endif
7772
7773 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
7774 #include <linux/gpio_keys.h>
7775 @@ -954,12 +956,14 @@
7776 {
7777 printk(KERN_INFO "%s(): registering device resources\n", __func__);
7778
7779 +#ifdef CONFIG_I2C_BOARDINFO
7780 i2c_register_board_info(0, bfin_i2c_board_info0,
7781 ARRAY_SIZE(bfin_i2c_board_info0));
7782 #if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
7783 i2c_register_board_info(1, bfin_i2c_board_info1,
7784 ARRAY_SIZE(bfin_i2c_board_info1));
7785 #endif
7786 +#endif
7787
7788 platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices));
7789
7790 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf548/include/mach/anomaly.h linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf548/include/mach/anomaly.h
7791 --- linux-2.6.29.owrt/arch/blackfin/mach-bf548/include/mach/anomaly.h 2009-05-10 22:04:40.000000000 +0200
7792 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf548/include/mach/anomaly.h 2009-05-10 23:48:28.000000000 +0200
7793 @@ -2,12 +2,12 @@
7794 * File: include/asm-blackfin/mach-bf548/anomaly.h
7795 * Bugs: Enter bugs at http://blackfin.uclinux.org/
7796 *
7797 - * Copyright (C) 2004-2009 Analog Devices Inc.
7798 + * Copyright (C) 2004-2008 Analog Devices Inc.
7799 * Licensed under the GPL-2 or later.
7800 */
7801
7802 /* This file shoule be up to date with:
7803 - * - Revision H, 01/16/2009; ADSP-BF542/BF544/BF547/BF548/BF549 Blackfin Processor Anomaly List
7804 + * - Revision G, 08/07/2008; ADSP-BF542/BF544/BF547/BF548/BF549 Blackfin Processor Anomaly List
7805 */
7806
7807 #ifndef _MACH_ANOMALY_H_
7808 @@ -91,6 +91,8 @@
7809 #define ANOMALY_05000371 (__SILICON_REVISION__ < 2)
7810 /* USB DP/DM Data Pins May Lose State When Entering Hibernate */
7811 #define ANOMALY_05000372 (__SILICON_REVISION__ < 1)
7812 +/* Mobile DDR Operation Not Functional */
7813 +#define ANOMALY_05000377 (1)
7814 /* Security/Authentication Speedpath Causes Authentication To Fail To Initiate */
7815 #define ANOMALY_05000378 (__SILICON_REVISION__ < 2)
7816 /* 16-Bit NAND FLASH Boot Mode Is Not Functional */
7817 @@ -155,22 +157,8 @@
7818 #define ANOMALY_05000429 (__SILICON_REVISION__ < 2)
7819 /* Software System Reset Corrupts PLL_LOCKCNT Register */
7820 #define ANOMALY_05000430 (__SILICON_REVISION__ >= 2)
7821 -/* Incorrect Use of Stack in Lockbox Firmware During Authentication */
7822 -#define ANOMALY_05000431 (__SILICON_REVISION__ < 3)
7823 -/* OTP Write Accesses Not Supported */
7824 -#define ANOMALY_05000442 (__SILICON_REVISION__ < 1)
7825 /* IFLUSH Instruction at End of Hardware Loop Causes Infinite Stall */
7826 #define ANOMALY_05000443 (1)
7827 -/* CDMAPRIO and L2DMAPRIO Bits in the SYSCR Register Are Not Functional */
7828 -#define ANOMALY_05000446 (1)
7829 -/* UART IrDA Receiver Fails on Extended Bit Pulses */
7830 -#define ANOMALY_05000447 (1)
7831 -/* DDR Clock Duty Cycle Spec Violation (tCH, tCL) */
7832 -#define ANOMALY_05000448 (__SILICON_REVISION__ == 1)
7833 -/* Reduced Timing Margins on DDR Output Setup and Hold (tDS and tDH) */
7834 -#define ANOMALY_05000449 (__SILICON_REVISION__ == 1)
7835 -/* USB DMA Mode 1 Short Packet Data Corruption */
7836 -#define ANOMALY_05000450 (1
7837
7838 /* Anomalies that don't exist on this proc */
7839 #define ANOMALY_05000125 (0)
7840 @@ -183,13 +171,10 @@
7841 #define ANOMALY_05000263 (0)
7842 #define ANOMALY_05000266 (0)
7843 #define ANOMALY_05000273 (0)
7844 -#define ANOMALY_05000278 (0)
7845 -#define ANOMALY_05000305 (0)
7846 #define ANOMALY_05000307 (0)
7847 #define ANOMALY_05000311 (0)
7848 #define ANOMALY_05000323 (0)
7849 #define ANOMALY_05000363 (0)
7850 -#define ANOMALY_05000380 (0)
7851 #define ANOMALY_05000412 (0)
7852 #define ANOMALY_05000432 (0)
7853 #define ANOMALY_05000435 (0)
7854 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf548/include/mach/bf548.h linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf548/include/mach/bf548.h
7855 --- linux-2.6.29.owrt/arch/blackfin/mach-bf548/include/mach/bf548.h 2009-05-10 22:04:41.000000000 +0200
7856 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf548/include/mach/bf548.h 2009-05-10 23:48:28.000000000 +0200
7857 @@ -104,18 +104,6 @@
7858
7859 #define AMGCTLVAL (V_AMBEN | V_AMCKEN)
7860
7861 -#if defined(CONFIG_BF542M)
7862 -# define CONFIG_BF542
7863 -#elif defined(CONFIG_BF544M)
7864 -# define CONFIG_BF544
7865 -#elif defined(CONFIG_BF547M)
7866 -# define CONFIG_BF547
7867 -#elif defined(CONFIG_BF548M)
7868 -# define CONFIG_BF548
7869 -#elif defined(CONFIG_BF549M)
7870 -# define CONFIG_BF549
7871 -#endif
7872 -
7873 #if defined(CONFIG_BF542)
7874 # define CPU "BF542"
7875 # define CPUID 0x27de
7876 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf548/include/mach/bfin_serial_5xx.h linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf548/include/mach/bfin_serial_5xx.h
7877 --- linux-2.6.29.owrt/arch/blackfin/mach-bf548/include/mach/bfin_serial_5xx.h 2009-05-10 22:04:40.000000000 +0200
7878 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf548/include/mach/bfin_serial_5xx.h 2009-05-10 23:48:28.000000000 +0200
7879 @@ -63,7 +63,7 @@
7880 #define UART_ENABLE_INTS(x, v) UART_SET_IER(x, v)
7881 #define UART_DISABLE_INTS(x) UART_CLEAR_IER(x, 0xF)
7882
7883 -#if defined(CONFIG_BFIN_UART0_CTSRTS) || defined(CONFIG_BFIN_UART2_CTSRTS)
7884 +#if defined(CONFIG_BFIN_UART0_CTSRTS) || defined(CONFIG_BFIN_UART1_CTSRTS)
7885 # define CONFIG_SERIAL_BFIN_CTSRTS
7886
7887 # ifndef CONFIG_UART0_CTS_PIN
7888 @@ -74,12 +74,12 @@
7889 # define CONFIG_UART0_RTS_PIN -1
7890 # endif
7891
7892 -# ifndef CONFIG_UART2_CTS_PIN
7893 -# define CONFIG_UART2_CTS_PIN -1
7894 +# ifndef CONFIG_UART1_CTS_PIN
7895 +# define CONFIG_UART1_CTS_PIN -1
7896 # endif
7897
7898 -# ifndef CONFIG_UART2_RTS_PIN
7899 -# define CONFIG_UART2_RTS_PIN -1
7900 +# ifndef CONFIG_UART1_RTS_PIN
7901 +# define CONFIG_UART1_RTS_PIN -1
7902 # endif
7903 #endif
7904
7905 @@ -130,7 +130,7 @@
7906 CH_UART0_TX,
7907 CH_UART0_RX,
7908 #endif
7909 -#ifdef CONFIG_SERIAL_BFIN_CTSRTS
7910 +#ifdef CONFIG_BFIN_UART0_CTSRTS
7911 CONFIG_UART0_CTS_PIN,
7912 CONFIG_UART0_RTS_PIN,
7913 #endif
7914 @@ -144,10 +144,6 @@
7915 CH_UART1_TX,
7916 CH_UART1_RX,
7917 #endif
7918 -#ifdef CONFIG_SERIAL_BFIN_CTSRTS
7919 - 0,
7920 - 0,
7921 -#endif
7922 },
7923 #endif
7924 #ifdef CONFIG_SERIAL_BFIN_UART2
7925 @@ -158,7 +154,7 @@
7926 CH_UART2_TX,
7927 CH_UART2_RX,
7928 #endif
7929 -#ifdef CONFIG_SERIAL_BFIN_CTSRTS
7930 +#ifdef CONFIG_BFIN_UART2_CTSRTS
7931 CONFIG_UART2_CTS_PIN,
7932 CONFIG_UART2_RTS_PIN,
7933 #endif
7934 @@ -172,10 +168,6 @@
7935 CH_UART3_TX,
7936 CH_UART3_RX,
7937 #endif
7938 -#ifdef CONFIG_SERIAL_BFIN_CTSRTS
7939 - 0,
7940 - 0,
7941 -#endif
7942 },
7943 #endif
7944 };
7945 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf548/include/mach/gpio.h linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf548/include/mach/gpio.h
7946 --- linux-2.6.29.owrt/arch/blackfin/mach-bf548/include/mach/gpio.h 2009-05-10 22:04:41.000000000 +0200
7947 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf548/include/mach/gpio.h 2009-05-10 23:48:28.000000000 +0200
7948 @@ -195,17 +195,17 @@
7949 struct gpio_port_t {
7950 unsigned short port_fer;
7951 unsigned short dummy1;
7952 - unsigned short data;
7953 + unsigned short port_data;
7954 unsigned short dummy2;
7955 - unsigned short data_set;
7956 + unsigned short port_set;
7957 unsigned short dummy3;
7958 - unsigned short data_clear;
7959 + unsigned short port_clear;
7960 unsigned short dummy4;
7961 - unsigned short dir_set;
7962 + unsigned short port_dir_set;
7963 unsigned short dummy5;
7964 - unsigned short dir_clear;
7965 + unsigned short port_dir_clear;
7966 unsigned short dummy6;
7967 - unsigned short inen;
7968 + unsigned short port_inen;
7969 unsigned short dummy7;
7970 unsigned int port_mux;
7971 };
7972 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf548/include/mach/irq.h linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf548/include/mach/irq.h
7973 --- linux-2.6.29.owrt/arch/blackfin/mach-bf548/include/mach/irq.h 2009-05-10 22:04:41.000000000 +0200
7974 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf548/include/mach/irq.h 2009-05-10 23:48:28.000000000 +0200
7975 @@ -123,8 +123,8 @@
7976 #define IRQ_MXVR_ERROR BFIN_IRQ(51) /* MXVR Status (Error) Interrupt */
7977 #define IRQ_MXVR_MSG BFIN_IRQ(52) /* MXVR Message Interrupt */
7978 #define IRQ_MXVR_PKT BFIN_IRQ(53) /* MXVR Packet Interrupt */
7979 -#define IRQ_EPPI1_ERROR BFIN_IRQ(54) /* EPPI1 Error Interrupt */
7980 -#define IRQ_EPPI2_ERROR BFIN_IRQ(55) /* EPPI2 Error Interrupt */
7981 +#define IRQ_EPP1_ERROR BFIN_IRQ(54) /* EPPI1 Error Interrupt */
7982 +#define IRQ_EPP2_ERROR BFIN_IRQ(55) /* EPPI2 Error Interrupt */
7983 #define IRQ_UART3_ERROR BFIN_IRQ(56) /* UART3 Status (Error) Interrupt */
7984 #define IRQ_HOST_ERROR BFIN_IRQ(57) /* HOST Status (Error) Interrupt */
7985 #define IRQ_PIXC_ERROR BFIN_IRQ(59) /* PIXC Status (Error) Interrupt */
7986 @@ -361,8 +361,8 @@
7987 #define IRQ_UART2_ERR IRQ_UART2_ERROR
7988 #define IRQ_CAN0_ERR IRQ_CAN0_ERROR
7989 #define IRQ_MXVR_ERR IRQ_MXVR_ERROR
7990 -#define IRQ_EPPI1_ERR IRQ_EPPI1_ERROR
7991 -#define IRQ_EPPI2_ERR IRQ_EPPI2_ERROR
7992 +#define IRQ_EPP1_ERR IRQ_EPP1_ERROR
7993 +#define IRQ_EPP2_ERR IRQ_EPP2_ERROR
7994 #define IRQ_UART3_ERR IRQ_UART3_ERROR
7995 #define IRQ_HOST_ERR IRQ_HOST_ERROR
7996 #define IRQ_PIXC_ERR IRQ_PIXC_ERROR
7997 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf548/include/mach/portmux.h linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf548/include/mach/portmux.h
7998 --- linux-2.6.29.owrt/arch/blackfin/mach-bf548/include/mach/portmux.h 2009-05-10 22:04:41.000000000 +0200
7999 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf548/include/mach/portmux.h 2009-05-10 23:48:28.000000000 +0200
8000 @@ -125,7 +125,6 @@
8001 #define P_KEY_COL2 (P_DEFINED | P_IDENT(GPIO_PD14) | P_FUNCT(3))
8002 #define P_KEY_COL3 (P_DEFINED | P_IDENT(GPIO_PD15) | P_FUNCT(3))
8003
8004 -#define P_DEFAULT_BOOT_SPI_CS P_SPI0_SSEL1
8005 #define P_SPI0_SCK (P_DEFINED | P_IDENT(GPIO_PE0) | P_FUNCT(0))
8006 #define P_SPI0_MISO (P_DEFINED | P_IDENT(GPIO_PE1) | P_FUNCT(0))
8007 #define P_SPI0_MOSI (P_DEFINED | P_IDENT(GPIO_PE2) | P_FUNCT(0))
8008 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf561/boards/cm_bf561.c linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf561/boards/cm_bf561.c
8009 --- linux-2.6.29.owrt/arch/blackfin/mach-bf561/boards/cm_bf561.c 2009-05-10 22:04:40.000000000 +0200
8010 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf561/boards/cm_bf561.c 2009-05-10 23:48:28.000000000 +0200
8011 @@ -105,9 +105,9 @@
8012 };
8013 #endif
8014
8015 -#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
8016 -static struct bfin5xx_spi_chip mmc_spi_chip_info = {
8017 - .enable_dma = 0,
8018 +#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
8019 +static struct bfin5xx_spi_chip spi_mmc_chip_info = {
8020 + .enable_dma = 1,
8021 .bits_per_word = 8,
8022 };
8023 #endif
8024 @@ -155,13 +155,14 @@
8025 .controller_data = &ad9960_spi_chip_info,
8026 },
8027 #endif
8028 -#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
8029 +#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
8030 {
8031 - .modalias = "mmc_spi",
8032 + .modalias = "spi_mmc",
8033 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
8034 .bus_num = 0,
8035 - .chip_select = 5,
8036 - .controller_data = &mmc_spi_chip_info,
8037 + .chip_select = CONFIG_SPI_MMC_CS_CHAN,
8038 + .platform_data = NULL,
8039 + .controller_data = &spi_mmc_chip_info,
8040 .mode = SPI_MODE_3,
8041 },
8042 #endif
8043 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf561/boards/generic_board.c linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf561/boards/generic_board.c
8044 --- linux-2.6.29.owrt/arch/blackfin/mach-bf561/boards/generic_board.c 1970-01-01 01:00:00.000000000 +0100
8045 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf561/boards/generic_board.c 2009-05-10 23:48:28.000000000 +0200
8046 @@ -0,0 +1,113 @@
8047 +/*
8048 + * File: arch/blackfin/mach-bf561/generic_board.c
8049 + * Based on: arch/blackfin/mach-bf533/ezkit.c
8050 + * Author: Aidan Williams <aidan@nicta.com.au>
8051 + *
8052 + * Created:
8053 + * Description:
8054 + *
8055 + * Modified:
8056 + * Copyright 2005 National ICT Australia (NICTA)
8057 + * Copyright 2004-2006 Analog Devices Inc.
8058 + *
8059 + * Bugs: Enter bugs at http://blackfin.uclinux.org/
8060 + *
8061 + * This program is free software; you can redistribute it and/or modify
8062 + * it under the terms of the GNU General Public License as published by
8063 + * the Free Software Foundation; either version 2 of the License, or
8064 + * (at your option) any later version.
8065 + *
8066 + * This program is distributed in the hope that it will be useful,
8067 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
8068 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8069 + * GNU General Public License for more details.
8070 + *
8071 + * You should have received a copy of the GNU General Public License
8072 + * along with this program; if not, see the file COPYING, or write
8073 + * to the Free Software Foundation, Inc.,
8074 + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
8075 + */
8076 +
8077 +#include <linux/device.h>
8078 +#include <linux/platform_device.h>
8079 +#include <linux/irq.h>
8080 +
8081 +const char bfin_board_name[] = "UNKNOWN BOARD";
8082 +
8083 +/*
8084 + * Driver needs to know address, irq and flag pin.
8085 + */
8086 +#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
8087 +static struct resource smc91x_resources[] = {
8088 + {
8089 + .start = 0x2C010300,
8090 + .end = 0x2C010300 + 16,
8091 + .flags = IORESOURCE_MEM,
8092 + }, {
8093 + .start = IRQ_PROG_INTB,
8094 + .end = IRQ_PROG_INTB,
8095 + .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
8096 + }, {
8097 + .start = IRQ_PF9,
8098 + .end = IRQ_PF9,
8099 + .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
8100 + },
8101 +};
8102 +
8103 +static struct platform_device smc91x_device = {
8104 + .name = "smc91x",
8105 + .id = 0,
8106 + .num_resources = ARRAY_SIZE(smc91x_resources),
8107 + .resource = smc91x_resources,
8108 +};
8109 +#endif
8110 +
8111 +#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
8112 +#ifdef CONFIG_BFIN_SIR0
8113 +static struct resource bfin_sir0_resources[] = {
8114 + {
8115 + .start = 0xFFC00400,
8116 + .end = 0xFFC004FF,
8117 + .flags = IORESOURCE_MEM,
8118 + },
8119 + {
8120 + .start = IRQ_UART0_RX,
8121 + .end = IRQ_UART0_RX+1,
8122 + .flags = IORESOURCE_IRQ,
8123 + },
8124 + {
8125 + .start = CH_UART0_RX,
8126 + .end = CH_UART0_RX+1,
8127 + .flags = IORESOURCE_DMA,
8128 + },
8129 +};
8130 +
8131 +static struct platform_device bfin_sir0_device = {
8132 + .name = "bfin_sir",
8133 + .id = 0,
8134 + .num_resources = ARRAY_SIZE(bfin_sir0_resources),
8135 + .resource = bfin_sir0_resources,
8136 +};
8137 +#endif
8138 +#endif
8139 +
8140 +static struct platform_device *generic_board_devices[] __initdata = {
8141 +#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
8142 + &smc91x_device,
8143 +#endif
8144 +
8145 +#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
8146 +#ifdef CONFIG_BFIN_SIR0
8147 + &bfin_sir0_device,
8148 +#endif
8149 +#endif
8150 +};
8151 +
8152 +static int __init generic_board_init(void)
8153 +{
8154 + printk(KERN_INFO "%s(): registering device resources\n", __func__);
8155 + return platform_add_devices(generic_board_devices,
8156 + ARRAY_SIZE(generic_board_devices));
8157 +}
8158 +
8159 +arch_initcall(generic_board_init);
8160 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf561/boards/Kconfig linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf561/boards/Kconfig
8161 --- linux-2.6.29.owrt/arch/blackfin/mach-bf561/boards/Kconfig 2009-05-10 22:04:40.000000000 +0200
8162 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf561/boards/Kconfig 2009-05-10 23:48:28.000000000 +0200
8163 @@ -19,4 +19,9 @@
8164 help
8165 CM-BF561 support for EVAL- and DEV-Board.
8166
8167 +config GENERIC_BF561_BOARD
8168 + bool "Generic"
8169 + help
8170 + Generic or Custom board support.
8171 +
8172 endchoice
8173 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf561/boards/Makefile linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf561/boards/Makefile
8174 --- linux-2.6.29.owrt/arch/blackfin/mach-bf561/boards/Makefile 2009-05-10 22:04:40.000000000 +0200
8175 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf561/boards/Makefile 2009-05-10 23:48:28.000000000 +0200
8176 @@ -2,6 +2,7 @@
8177 # arch/blackfin/mach-bf561/boards/Makefile
8178 #
8179
8180 +obj-$(CONFIG_GENERIC_BF561_BOARD) += generic_board.o
8181 obj-$(CONFIG_BFIN561_BLUETECHNIX_CM) += cm_bf561.o
8182 obj-$(CONFIG_BFIN561_EZKIT) += ezkit.o
8183 obj-$(CONFIG_BFIN561_TEPLA) += tepla.o
8184 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf561/include/mach/anomaly.h linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf561/include/mach/anomaly.h
8185 --- linux-2.6.29.owrt/arch/blackfin/mach-bf561/include/mach/anomaly.h 2009-05-10 22:04:40.000000000 +0200
8186 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf561/include/mach/anomaly.h 2009-05-10 23:48:28.000000000 +0200
8187 @@ -2,7 +2,7 @@
8188 * File: include/asm-blackfin/mach-bf561/anomaly.h
8189 * Bugs: Enter bugs at http://blackfin.uclinux.org/
8190 *
8191 - * Copyright (C) 2004-2009 Analog Devices Inc.
8192 + * Copyright (C) 2004-2008 Analog Devices Inc.
8193 * Licensed under the GPL-2 or later.
8194 */
8195
8196 @@ -224,7 +224,7 @@
8197 #define ANOMALY_05000301 (1)
8198 /* SSYNCs After Writes To DMA MMR Registers May Not Be Handled Correctly */
8199 #define ANOMALY_05000302 (1)
8200 -/* SPORT_HYS Bit in PLL_CTL Register Is Not Functional */
8201 +/* New Feature: Additional Hysteresis on SPORT Input Pins (Not Available On Older Silicon) */
8202 #define ANOMALY_05000305 (__SILICON_REVISION__ < 5)
8203 /* SCKELOW Bit Does Not Maintain State Through Hibernate */
8204 #define ANOMALY_05000307 (__SILICON_REVISION__ < 5)
8205 @@ -283,11 +283,8 @@
8206 #define ANOMALY_05000273 (0)
8207 #define ANOMALY_05000311 (0)
8208 #define ANOMALY_05000353 (1)
8209 -#define ANOMALY_05000380 (0)
8210 #define ANOMALY_05000386 (1)
8211 #define ANOMALY_05000432 (0)
8212 #define ANOMALY_05000435 (0)
8213 -#define ANOMALY_05000447 (0)
8214 -#define ANOMALY_05000448 (0)
8215
8216 #endif
8217 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf561/include/mach/bfin_serial_5xx.h linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf561/include/mach/bfin_serial_5xx.h
8218 --- linux-2.6.29.owrt/arch/blackfin/mach-bf561/include/mach/bfin_serial_5xx.h 2009-05-10 22:04:40.000000000 +0200
8219 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf561/include/mach/bfin_serial_5xx.h 2009-05-10 23:48:28.000000000 +0200
8220 @@ -134,7 +134,7 @@
8221 CH_UART_TX,
8222 CH_UART_RX,
8223 #endif
8224 -#ifdef CONFIG_SERIAL_BFIN_CTSRTS
8225 +#ifdef CONFIG_BFIN_UART0_CTSRTS
8226 CONFIG_UART0_CTS_PIN,
8227 CONFIG_UART0_RTS_PIN,
8228 #endif
8229 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf561/include/mach/defBF561.h linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf561/include/mach/defBF561.h
8230 --- linux-2.6.29.owrt/arch/blackfin/mach-bf561/include/mach/defBF561.h 2009-05-10 22:04:40.000000000 +0200
8231 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf561/include/mach/defBF561.h 2009-05-10 23:48:28.000000000 +0200
8232 @@ -1106,8 +1106,6 @@
8233 #define DLEN_8 0x0 /* PPI Data Length mask for DLEN=8 */
8234 #define DLEN(x) (((x-9) & 0x07) << 11) /* PPI Data Length (only works for x=10-->x=16) */
8235 #define POL 0x0000C000 /* PPI Signal Polarities */
8236 -#define POLC 0x4000 /* PPI Clock Polarity */
8237 -#define POLS 0x8000 /* PPI Frame Sync Polarity */
8238
8239 /* PPI_STATUS Masks */
8240 #define FLD 0x00000400 /* Field Indicator */
8241 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-bf561/include/mach/portmux.h linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf561/include/mach/portmux.h
8242 --- linux-2.6.29.owrt/arch/blackfin/mach-bf561/include/mach/portmux.h 2009-05-10 22:04:40.000000000 +0200
8243 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-bf561/include/mach/portmux.h 2009-05-10 23:48:28.000000000 +0200
8244 @@ -85,6 +85,5 @@
8245 #define P_SPI0_MOSI (P_DONTCARE)
8246 #define P_SPI0_MISO (P_DONTCARE)
8247 #define P_SPI0_SCK (P_DONTCARE)
8248 -#define P_DEFAULT_BOOT_SPI_CS P_SPI0_SSEL2
8249
8250 #endif /* _MACH_PORTMUX_H_ */
8251 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-common/arch_checks.c linux-2.6.29-rc3.owrt/arch/blackfin/mach-common/arch_checks.c
8252 --- linux-2.6.29.owrt/arch/blackfin/mach-common/arch_checks.c 2009-05-10 22:04:40.000000000 +0200
8253 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-common/arch_checks.c 2009-05-10 23:48:28.000000000 +0200
8254 @@ -62,12 +62,3 @@
8255 #if (CONFIG_BOOT_LOAD & 0x3)
8256 # error "The kernel load address must be 4 byte aligned"
8257 #endif
8258 -
8259 -/* The entire kernel must be able to make a 24bit pcrel call to start of L1 */
8260 -#if ((0xffffffff - L1_CODE_START + 1) + CONFIG_BOOT_LOAD) > 0x1000000
8261 -# error "The kernel load address is too high; keep it below 10meg for safety"
8262 -#endif
8263 -
8264 -#if ANOMALY_05000448
8265 -# error You are using a part with anomaly 05000448, this issue causes random memory read/write failures - that means random crashes.
8266 -#endif
8267 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-common/cache.S linux-2.6.29-rc3.owrt/arch/blackfin/mach-common/cache.S
8268 --- linux-2.6.29.owrt/arch/blackfin/mach-common/cache.S 2009-05-10 22:04:40.000000000 +0200
8269 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-common/cache.S 2009-05-10 23:48:28.000000000 +0200
8270 @@ -66,33 +66,11 @@
8271
8272 /* Invalidate all instruction cache lines assocoiated with this memory area */
8273 ENTRY(_blackfin_icache_flush_range)
8274 -/*
8275 - * Walkaround to avoid loading wrong instruction after invalidating icache
8276 - * and following sequence is met.
8277 - *
8278 - * 1) One instruction address is cached in the instruction cache.
8279 - * 2) This instruction in SDRAM is changed.
8280 - * 3) IFLASH[P0] is executed only once in blackfin_icache_flush_range().
8281 - * 4) This instruction is executed again, but the old one is loaded.
8282 - */
8283 - P0 = R0;
8284 - IFLUSH[P0];
8285 do_flush IFLUSH, , nop
8286 ENDPROC(_blackfin_icache_flush_range)
8287
8288 /* Flush all cache lines assocoiated with this area of memory. */
8289 ENTRY(_blackfin_icache_dcache_flush_range)
8290 -/*
8291 - * Walkaround to avoid loading wrong instruction after invalidating icache
8292 - * and following sequence is met.
8293 - *
8294 - * 1) One instruction address is cached in the instruction cache.
8295 - * 2) This instruction in SDRAM is changed.
8296 - * 3) IFLASH[P0] is executed only once in blackfin_icache_flush_range().
8297 - * 4) This instruction is executed again, but the old one is loaded.
8298 - */
8299 - P0 = R0;
8300 - IFLUSH[P0];
8301 do_flush FLUSH, IFLUSH
8302 ENDPROC(_blackfin_icache_dcache_flush_range)
8303
8304 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-common/clocks-init.c linux-2.6.29-rc3.owrt/arch/blackfin/mach-common/clocks-init.c
8305 --- linux-2.6.29.owrt/arch/blackfin/mach-common/clocks-init.c 2009-05-10 22:04:40.000000000 +0200
8306 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-common/clocks-init.c 2009-05-10 23:48:28.000000000 +0200
8307 @@ -14,10 +14,9 @@
8308 #include <asm/clocks.h>
8309 #include <asm/mem_init.h>
8310
8311 -#define SDGCTL_WIDTH (1 << 31) /* SDRAM external data path width */
8312 #define PLL_CTL_VAL \
8313 (((CONFIG_VCO_MULT & 63) << 9) | CLKIN_HALF | \
8314 - (PLL_BYPASS << 8) | (ANOMALY_05000305 ? 0 : 0x8000))
8315 + (PLL_BYPASS << 8) | (ANOMALY_05000265 ? 0x8000 : 0))
8316
8317 __attribute__((l1_text))
8318 static void do_sync(void)
8319 @@ -77,7 +76,7 @@
8320 bfin_write_PLL_DIV(CONFIG_CCLK_ACT_DIV | CONFIG_SCLK_DIV);
8321 #ifdef EBIU_SDGCTL
8322 bfin_write_EBIU_SDRRC(mem_SDRRC);
8323 - bfin_write_EBIU_SDGCTL((bfin_read_EBIU_SDGCTL() & SDGCTL_WIDTH) | mem_SDGCTL);
8324 + bfin_write_EBIU_SDGCTL(mem_SDGCTL);
8325 #else
8326 bfin_write_EBIU_RSTCTL(bfin_read_EBIU_RSTCTL() & ~(SRREQ));
8327 do_sync();
8328 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-common/dpmc_modes.S linux-2.6.29-rc3.owrt/arch/blackfin/mach-common/dpmc_modes.S
8329 --- linux-2.6.29.owrt/arch/blackfin/mach-common/dpmc_modes.S 2009-05-10 22:04:40.000000000 +0200
8330 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-common/dpmc_modes.S 2009-05-10 23:48:28.000000000 +0200
8331 @@ -376,22 +376,10 @@
8332 #endif
8333
8334 #ifdef PINT0_ASSIGN
8335 - PM_SYS_PUSH(PINT0_MASK_SET)
8336 - PM_SYS_PUSH(PINT1_MASK_SET)
8337 - PM_SYS_PUSH(PINT2_MASK_SET)
8338 - PM_SYS_PUSH(PINT3_MASK_SET)
8339 PM_SYS_PUSH(PINT0_ASSIGN)
8340 PM_SYS_PUSH(PINT1_ASSIGN)
8341 PM_SYS_PUSH(PINT2_ASSIGN)
8342 PM_SYS_PUSH(PINT3_ASSIGN)
8343 - PM_SYS_PUSH(PINT0_INVERT_SET)
8344 - PM_SYS_PUSH(PINT1_INVERT_SET)
8345 - PM_SYS_PUSH(PINT2_INVERT_SET)
8346 - PM_SYS_PUSH(PINT3_INVERT_SET)
8347 - PM_SYS_PUSH(PINT0_EDGE_SET)
8348 - PM_SYS_PUSH(PINT1_EDGE_SET)
8349 - PM_SYS_PUSH(PINT2_EDGE_SET)
8350 - PM_SYS_PUSH(PINT3_EDGE_SET)
8351 #endif
8352
8353 PM_SYS_PUSH(EBIU_AMBCTL0)
8354 @@ -726,22 +714,10 @@
8355 PM_SYS_POP(EBIU_AMBCTL0)
8356
8357 #ifdef PINT0_ASSIGN
8358 - PM_SYS_POP(PINT3_EDGE_SET)
8359 - PM_SYS_POP(PINT2_EDGE_SET)
8360 - PM_SYS_POP(PINT1_EDGE_SET)
8361 - PM_SYS_POP(PINT0_EDGE_SET)
8362 - PM_SYS_POP(PINT3_INVERT_SET)
8363 - PM_SYS_POP(PINT2_INVERT_SET)
8364 - PM_SYS_POP(PINT1_INVERT_SET)
8365 - PM_SYS_POP(PINT0_INVERT_SET)
8366 PM_SYS_POP(PINT3_ASSIGN)
8367 PM_SYS_POP(PINT2_ASSIGN)
8368 PM_SYS_POP(PINT1_ASSIGN)
8369 PM_SYS_POP(PINT0_ASSIGN)
8370 - PM_SYS_POP(PINT3_MASK_SET)
8371 - PM_SYS_POP(PINT2_MASK_SET)
8372 - PM_SYS_POP(PINT1_MASK_SET)
8373 - PM_SYS_POP(PINT0_MASK_SET)
8374 #endif
8375
8376 #ifdef SICA_IWR1
8377 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-common/entry.S linux-2.6.29-rc3.owrt/arch/blackfin/mach-common/entry.S
8378 --- linux-2.6.29.owrt/arch/blackfin/mach-common/entry.S 2009-05-10 22:04:40.000000000 +0200
8379 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-common/entry.S 2009-05-10 23:48:28.000000000 +0200
8380 @@ -151,6 +151,13 @@
8381 jump.s _bfin_return_from_exception;
8382 ENDPROC(_ex_syscall)
8383
8384 +ENTRY(_ex_soft_bp)
8385 + r7 = retx;
8386 + r7 += -2;
8387 + retx = r7;
8388 + jump.s _ex_trap_c;
8389 +ENDPROC(_ex_soft_bp)
8390 +
8391 ENTRY(_ex_single_step)
8392 /* If we just returned from an interrupt, the single step event is
8393 for the RTI instruction. */
8394 @@ -600,19 +607,6 @@
8395 p2 = [p2];
8396
8397 [p2+(TASK_THREAD+THREAD_KSP)] = sp;
8398 -#ifdef CONFIG_IPIPE
8399 - r0 = sp;
8400 - SP += -12;
8401 - call ___ipipe_syscall_root;
8402 - SP += 12;
8403 - cc = r0 == 1;
8404 - if cc jump .Lsyscall_really_exit;
8405 - cc = r0 == -1;
8406 - if cc jump .Lresume_userspace;
8407 - r3 = [sp + PT_R3];
8408 - r4 = [sp + PT_R4];
8409 - p0 = [sp + PT_ORIG_P0];
8410 -#endif /* CONFIG_IPIPE */
8411
8412 /* Check the System Call */
8413 r7 = __NR_syscall;
8414 @@ -667,17 +661,6 @@
8415 r7 = r7 & r4;
8416
8417 .Lsyscall_resched:
8418 -#ifdef CONFIG_IPIPE
8419 - cc = BITTST(r7, TIF_IRQ_SYNC);
8420 - if !cc jump .Lsyscall_no_irqsync;
8421 - [--sp] = reti;
8422 - r0 = [sp++];
8423 - SP += -12;
8424 - call ___ipipe_sync_root;
8425 - SP += 12;
8426 - jump .Lresume_userspace_1;
8427 -.Lsyscall_no_irqsync:
8428 -#endif
8429 cc = BITTST(r7, TIF_NEED_RESCHED);
8430 if !cc jump .Lsyscall_sigpending;
8431
8432 @@ -709,10 +692,6 @@
8433 .Lsyscall_really_exit:
8434 r5 = [sp + PT_RESERVED];
8435 rets = r5;
8436 -#ifdef CONFIG_IPIPE
8437 - [--sp] = reti;
8438 - r5 = [sp++];
8439 -#endif /* CONFIG_IPIPE */
8440 rts;
8441 ENDPROC(_system_call)
8442
8443 @@ -799,15 +778,6 @@
8444 ENDPROC(_resume)
8445
8446 ENTRY(_ret_from_exception)
8447 -#ifdef CONFIG_IPIPE
8448 - [--sp] = rets;
8449 - SP += -12;
8450 - call ___ipipe_check_root
8451 - SP += 12
8452 - rets = [sp++];
8453 - cc = r0 == 0;
8454 - if cc jump 4f; /* not on behalf of Linux, get out */
8455 -#endif /* CONFIG_IPIPE */
8456 p2.l = lo(IPEND);
8457 p2.h = hi(IPEND);
8458
8459 @@ -864,28 +834,6 @@
8460 rts;
8461 ENDPROC(_ret_from_exception)
8462
8463 -#ifdef CONFIG_IPIPE
8464 -
8465 -_sync_root_irqs:
8466 - [--sp] = reti; /* Reenable interrupts */
8467 - r0 = [sp++];
8468 - jump.l ___ipipe_sync_root
8469 -
8470 -_resume_kernel_from_int:
8471 - r0.l = _sync_root_irqs
8472 - r0.h = _sync_root_irqs
8473 - [--sp] = rets;
8474 - [--sp] = ( r7:4, p5:3 );
8475 - SP += -12;
8476 - call ___ipipe_call_irqtail
8477 - SP += 12;
8478 - ( r7:4, p5:3 ) = [sp++];
8479 - rets = [sp++];
8480 - rts
8481 -#else
8482 -#define _resume_kernel_from_int 2f
8483 -#endif
8484 -
8485 ENTRY(_return_from_int)
8486 /* If someone else already raised IRQ 15, do nothing. */
8487 csync;
8488 @@ -907,7 +855,7 @@
8489 r1 = r0 - r1;
8490 r2 = r0 & r1;
8491 cc = r2 == 0;
8492 - if !cc jump _resume_kernel_from_int;
8493 + if !cc jump 2f;
8494
8495 /* Lower the interrupt level to 15. */
8496 p0.l = lo(EVT15);
8497 @@ -1139,7 +1087,7 @@
8498 * EXCPT instruction can provide 4 bits of EXCAUSE, allowing 16 to be user defined
8499 */
8500 .long _ex_syscall /* 0x00 - User Defined - Linux Syscall */
8501 - .long _ex_trap_c /* 0x01 - User Defined - Software breakpoint */
8502 + .long _ex_soft_bp /* 0x01 - User Defined - Software breakpoint */
8503 #ifdef CONFIG_KGDB
8504 .long _ex_trap_c /* 0x02 - User Defined - KGDB initial connection
8505 and break signal trap */
8506 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-common/head.S linux-2.6.29-rc3.owrt/arch/blackfin/mach-common/head.S
8507 --- linux-2.6.29.owrt/arch/blackfin/mach-common/head.S 2009-05-10 22:04:40.000000000 +0200
8508 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-common/head.S 2009-05-10 23:48:28.000000000 +0200
8509 @@ -17,19 +17,6 @@
8510
8511 __INIT
8512
8513 -ENTRY(__init_clear_bss)
8514 - r2 = r2 - r1;
8515 - cc = r2 == 0;
8516 - if cc jump .L_bss_done;
8517 - r2 >>= 2;
8518 - p1 = r1;
8519 - p2 = r2;
8520 - lsetup (1f, 1f) lc0 = p2;
8521 -1: [p1++] = r0;
8522 -.L_bss_done:
8523 - rts;
8524 -ENDPROC(__init_clear_bss)
8525 -
8526 #define INITIAL_STACK (L1_SCRATCH_START + L1_SCRATCH_LENGTH - 12)
8527
8528 ENTRY(__start)
8529 @@ -157,35 +144,6 @@
8530 call _init_early_exception_vectors;
8531 #endif
8532
8533 - r0 = 0 (x);
8534 - /* Zero out all of the fun bss regions */
8535 -#if L1_DATA_A_LENGTH > 0
8536 - r1.l = __sbss_l1;
8537 - r1.h = __sbss_l1;
8538 - r2.l = __ebss_l1;
8539 - r2.h = __ebss_l1;
8540 - call __init_clear_bss
8541 -#endif
8542 -#if L1_DATA_B_LENGTH > 0
8543 - r1.l = __sbss_b_l1;
8544 - r1.h = __sbss_b_l1;
8545 - r2.l = __ebss_b_l1;
8546 - r2.h = __ebss_b_l1;
8547 - call __init_clear_bss
8548 -#endif
8549 -#if L2_LENGTH > 0
8550 - r1.l = __sbss_l2;
8551 - r1.h = __sbss_l2;
8552 - r2.l = __ebss_l2;
8553 - r2.h = __ebss_l2;
8554 - call __init_clear_bss
8555 -#endif
8556 - r1.l = ___bss_start;
8557 - r1.h = ___bss_start;
8558 - r2.l = ___bss_stop;
8559 - r2.h = ___bss_stop;
8560 - call __init_clear_bss
8561 -
8562 /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */
8563 call _bfin_relocate_l1_mem;
8564 #ifdef CONFIG_BFIN_KERNEL_CLOCK
8565 @@ -227,6 +185,19 @@
8566 # define WDOG_CTL WDOGA_CTL
8567 #endif
8568
8569 +ENTRY(__init_clear_bss)
8570 + r2 = r2 - r1;
8571 + cc = r2 == 0;
8572 + if cc jump .L_bss_done;
8573 + r2 >>= 2;
8574 + p1 = r1;
8575 + p2 = r2;
8576 + lsetup (1f, 1f) lc0 = p2;
8577 +1: [p1++] = r0;
8578 +.L_bss_done:
8579 + rts;
8580 +ENDPROC(__init_clear_bss)
8581 +
8582 ENTRY(_real_start)
8583 /* Enable nested interrupts */
8584 [--sp] = reti;
8585 @@ -238,6 +209,35 @@
8586 w[p0] = r0;
8587 ssync;
8588
8589 + r0 = 0 (x);
8590 + /* Zero out all of the fun bss regions */
8591 +#if L1_DATA_A_LENGTH > 0
8592 + r1.l = __sbss_l1;
8593 + r1.h = __sbss_l1;
8594 + r2.l = __ebss_l1;
8595 + r2.h = __ebss_l1;
8596 + call __init_clear_bss
8597 +#endif
8598 +#if L1_DATA_B_LENGTH > 0
8599 + r1.l = __sbss_b_l1;
8600 + r1.h = __sbss_b_l1;
8601 + r2.l = __ebss_b_l1;
8602 + r2.h = __ebss_b_l1;
8603 + call __init_clear_bss
8604 +#endif
8605 +#if L2_LENGTH > 0
8606 + r1.l = __sbss_l2;
8607 + r1.h = __sbss_l2;
8608 + r2.l = __ebss_l2;
8609 + r2.h = __ebss_l2;
8610 + call __init_clear_bss
8611 +#endif
8612 + r1.l = ___bss_start;
8613 + r1.h = ___bss_start;
8614 + r2.l = ___bss_stop;
8615 + r2.h = ___bss_stop;
8616 + call __init_clear_bss
8617 +
8618 /* Pass the u-boot arguments to the global value command line */
8619 R0 = R7;
8620 call _cmdline_init;
8621 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-common/interrupt.S linux-2.6.29-rc3.owrt/arch/blackfin/mach-common/interrupt.S
8622 --- linux-2.6.29.owrt/arch/blackfin/mach-common/interrupt.S 2009-05-10 22:04:40.000000000 +0200
8623 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-common/interrupt.S 2009-05-10 23:48:28.000000000 +0200
8624 @@ -195,7 +195,7 @@
8625 /* Interrupt routine for evt2 (NMI).
8626 * We don't actually use this, so just return.
8627 * For inner circle type details, please see:
8628 - * http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:nmi
8629 + * http://docs.blackfin.uclinux.org/doku.php?id=linux:nmi
8630 */
8631 ENTRY(_evt_nmi)
8632 .weak _evt_nmi
8633 @@ -235,7 +235,6 @@
8634
8635 #ifdef CONFIG_IPIPE
8636 ENTRY(___ipipe_call_irqtail)
8637 - p0 = r0;
8638 r0.l = 1f;
8639 r0.h = 1f;
8640 reti = r0;
8641 @@ -243,6 +242,9 @@
8642 1:
8643 [--sp] = rets;
8644 [--sp] = ( r7:4, p5:3 );
8645 + p0.l = ___ipipe_irq_tail_hook;
8646 + p0.h = ___ipipe_irq_tail_hook;
8647 + p0 = [p0];
8648 sp += -12;
8649 call (p0);
8650 sp += 12;
8651 @@ -257,7 +259,7 @@
8652 p0.h = hi(EVT14);
8653 [p0] = r0;
8654 csync;
8655 - r0 = 0x401f (z);
8656 + r0 = 0x401f;
8657 sti r0;
8658 raise 14;
8659 [--sp] = reti; /* IRQs on. */
8660 @@ -275,7 +277,11 @@
8661 p0.h = _bfin_irq_flags;
8662 r0 = [p0];
8663 sti r0;
8664 +#if 0 /* FIXME: this actually raises scheduling latencies */
8665 + /* Reenable interrupts */
8666 + [--sp] = reti;
8667 + r0 = [sp++];
8668 +#endif
8669 rts;
8670 ENDPROC(___ipipe_call_irqtail)
8671 -
8672 #endif /* CONFIG_IPIPE */
8673 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-common/ints-priority.c linux-2.6.29-rc3.owrt/arch/blackfin/mach-common/ints-priority.c
8674 --- linux-2.6.29.owrt/arch/blackfin/mach-common/ints-priority.c 2009-05-10 22:04:40.000000000 +0200
8675 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-common/ints-priority.c 2009-05-10 23:48:28.000000000 +0200
8676 @@ -161,15 +161,11 @@
8677
8678 static void bfin_internal_mask_irq(unsigned int irq)
8679 {
8680 - unsigned long flags;
8681 -
8682 #ifdef CONFIG_BF53x
8683 - local_irq_save_hw(flags);
8684 bfin_write_SIC_IMASK(bfin_read_SIC_IMASK() &
8685 ~(1 << SIC_SYSIRQ(irq)));
8686 #else
8687 unsigned mask_bank, mask_bit;
8688 - local_irq_save_hw(flags);
8689 mask_bank = SIC_SYSIRQ(irq) / 32;
8690 mask_bit = SIC_SYSIRQ(irq) % 32;
8691 bfin_write_SIC_IMASK(mask_bank, bfin_read_SIC_IMASK(mask_bank) &
8692 @@ -179,20 +175,15 @@
8693 ~(1 << mask_bit));
8694 #endif
8695 #endif
8696 - local_irq_restore_hw(flags);
8697 }
8698
8699 static void bfin_internal_unmask_irq(unsigned int irq)
8700 {
8701 - unsigned long flags;
8702 -
8703 #ifdef CONFIG_BF53x
8704 - local_irq_save_hw(flags);
8705 bfin_write_SIC_IMASK(bfin_read_SIC_IMASK() |
8706 (1 << SIC_SYSIRQ(irq)));
8707 #else
8708 unsigned mask_bank, mask_bit;
8709 - local_irq_save_hw(flags);
8710 mask_bank = SIC_SYSIRQ(irq) / 32;
8711 mask_bit = SIC_SYSIRQ(irq) % 32;
8712 bfin_write_SIC_IMASK(mask_bank, bfin_read_SIC_IMASK(mask_bank) |
8713 @@ -202,7 +193,6 @@
8714 (1 << mask_bit));
8715 #endif
8716 #endif
8717 - local_irq_restore_hw(flags);
8718 }
8719
8720 #ifdef CONFIG_PM
8721 @@ -400,7 +390,7 @@
8722 static inline void bfin_set_irq_handler(unsigned irq, irq_flow_handler_t handle)
8723 {
8724 #ifdef CONFIG_IPIPE
8725 - _set_irq_handler(irq, handle_level_irq);
8726 + _set_irq_handler(irq, handle_edge_irq);
8727 #else
8728 struct irq_desc *desc = irq_desc + irq;
8729 /* May not call generic set_irq_handler() due to spinlock
8730 @@ -1065,18 +1055,13 @@
8731 #endif
8732 default:
8733 #ifdef CONFIG_IPIPE
8734 - /*
8735 - * We want internal interrupt sources to be
8736 - * masked, because ISRs may trigger interrupts
8737 - * recursively (e.g. DMA), but interrupts are
8738 - * _not_ masked at CPU level. So let's handle
8739 - * most of them as level interrupts, except
8740 - * the timer interrupt which is special.
8741 - */
8742 - if (irq == IRQ_SYSTMR || irq == IRQ_CORETMR)
8743 - set_irq_handler(irq, handle_simple_irq);
8744 - else
8745 - set_irq_handler(irq, handle_level_irq);
8746 + /*
8747 + * We want internal interrupt sources to be masked, because
8748 + * ISRs may trigger interrupts recursively (e.g. DMA), but
8749 + * interrupts are _not_ masked at CPU level. So let's handle
8750 + * them as level interrupts.
8751 + */
8752 + set_irq_handler(irq, handle_level_irq);
8753 #else /* !CONFIG_IPIPE */
8754 set_irq_handler(irq, handle_simple_irq);
8755 #endif /* !CONFIG_IPIPE */
8756 @@ -1116,9 +1101,10 @@
8757 IMASK_IVG14 | IMASK_IVG13 | IMASK_IVG12 | IMASK_IVG11 |
8758 IMASK_IVG10 | IMASK_IVG9 | IMASK_IVG8 | IMASK_IVG7 | IMASK_IVGHW;
8759
8760 -#ifdef SIC_IWR0
8761 +#if defined(CONFIG_BF54x) || defined(CONFIG_BF52x) || defined(CONFIG_BF561) \
8762 + || defined(BF538_FAMILY) || defined(CONFIG_BF51x)
8763 bfin_write_SIC_IWR0(IWR_DISABLE_ALL);
8764 -# ifdef SIC_IWR1
8765 +#if defined(CONFIG_BF52x) || defined(CONFIG_BF51x)
8766 /* BF52x/BF51x system reset does not properly reset SIC_IWR1 which
8767 * will screw up the bootrom as it relies on MDMA0/1 waking it
8768 * up from IDLE instructions. See this report for more info:
8769 @@ -1128,8 +1114,10 @@
8770 bfin_write_SIC_IWR1(IWR_ENABLE(10) | IWR_ENABLE(11));
8771 else
8772 bfin_write_SIC_IWR1(IWR_DISABLE_ALL);
8773 -# endif
8774 -# ifdef SIC_IWR2
8775 +#else
8776 + bfin_write_SIC_IWR1(IWR_DISABLE_ALL);
8777 +#endif
8778 +# ifdef CONFIG_BF54x
8779 bfin_write_SIC_IWR2(IWR_DISABLE_ALL);
8780 # endif
8781 #else
8782 @@ -1138,8 +1126,9 @@
8783
8784 #ifdef CONFIG_IPIPE
8785 for (irq = 0; irq < NR_IRQS; irq++) {
8786 - struct irq_desc *desc = irq_to_desc(irq);
8787 + struct irq_desc *desc = irq_desc + irq;
8788 desc->ic_prio = __ipipe_get_irq_priority(irq);
8789 + desc->thr_prio = __ipipe_get_irqthread_priority(irq);
8790 }
8791 #endif /* CONFIG_IPIPE */
8792
8793 @@ -1222,21 +1211,76 @@
8794 return IVG15;
8795 }
8796
8797 +int __ipipe_get_irqthread_priority(unsigned irq)
8798 +{
8799 + int ient, prio;
8800 + int demux_irq;
8801 +
8802 + /* The returned priority value is rescaled to [0..IVG13+1]
8803 + * with 0 being the lowest effective priority level. */
8804 +
8805 + if (irq <= IRQ_CORETMR)
8806 + return IVG13 - irq + 1;
8807 +
8808 + /* GPIO IRQs are given the priority of the demux
8809 + * interrupt. */
8810 + if (IS_GPIOIRQ(irq)) {
8811 +#if defined(CONFIG_BF54x)
8812 + u32 bank = PINT_2_BANK(irq2pint_lut[irq - SYS_IRQS]);
8813 + demux_irq = (bank == 0 ? IRQ_PINT0 :
8814 + bank == 1 ? IRQ_PINT1 :
8815 + bank == 2 ? IRQ_PINT2 :
8816 + IRQ_PINT3);
8817 +#elif defined(CONFIG_BF561)
8818 + demux_irq = (irq >= IRQ_PF32 ? IRQ_PROG2_INTA :
8819 + irq >= IRQ_PF16 ? IRQ_PROG1_INTA :
8820 + IRQ_PROG0_INTA);
8821 +#elif defined(CONFIG_BF52x)
8822 + demux_irq = (irq >= IRQ_PH0 ? IRQ_PORTH_INTA :
8823 + irq >= IRQ_PG0 ? IRQ_PORTG_INTA :
8824 + IRQ_PORTF_INTA);
8825 +#else
8826 + demux_irq = irq;
8827 +#endif
8828 + return IVG13 - PRIO_GPIODEMUX(demux_irq) + 1;
8829 + }
8830 +
8831 + /* The GPIO demux interrupt is given a lower priority
8832 + * than the GPIO IRQs, so that its threaded handler
8833 + * unmasks the interrupt line after the decoded IRQs
8834 + * have been processed. */
8835 + prio = PRIO_GPIODEMUX(irq);
8836 + /* demux irq? */
8837 + if (prio != -1)
8838 + return IVG13 - prio;
8839 +
8840 + for (ient = 0; ient < NR_PERI_INTS; ient++) {
8841 + struct ivgx *ivg = ivg_table + ient;
8842 + if (ivg->irqno == irq) {
8843 + for (prio = 0; prio <= IVG13-IVG7; prio++) {
8844 + if (ivg7_13[prio].ifirst <= ivg &&
8845 + ivg7_13[prio].istop > ivg)
8846 + return IVG7 - prio;
8847 + }
8848 + }
8849 + }
8850 +
8851 + return 0;
8852 +}
8853 +
8854 /* Hw interrupts are disabled on entry (check SAVE_CONTEXT). */
8855 #ifdef CONFIG_DO_IRQ_L1
8856 __attribute__((l1_text))
8857 #endif
8858 asmlinkage int __ipipe_grab_irq(int vec, struct pt_regs *regs)
8859 {
8860 - struct ipipe_percpu_domain_data *p = ipipe_root_cpudom_ptr();
8861 - struct ipipe_domain *this_domain = ipipe_current_domain;
8862 struct ivgx *ivg_stop = ivg7_13[vec-IVG7].istop;
8863 struct ivgx *ivg = ivg7_13[vec-IVG7].ifirst;
8864 - int irq, s;
8865 + int irq;
8866
8867 if (likely(vec == EVT_IVTMR_P)) {
8868 irq = IRQ_CORETMR;
8869 - goto core_tick;
8870 + goto handle_irq;
8871 }
8872
8873 SSYNC();
8874 @@ -1278,39 +1322,24 @@
8875 irq = ivg->irqno;
8876
8877 if (irq == IRQ_SYSTMR) {
8878 -#ifdef CONFIG_GENERIC_CLOCKEVENTS
8879 -core_tick:
8880 -#else
8881 bfin_write_TIMER_STATUS(1); /* Latch TIMIL0 */
8882 -#endif
8883 /* This is basically what we need from the register frame. */
8884 __raw_get_cpu_var(__ipipe_tick_regs).ipend = regs->ipend;
8885 __raw_get_cpu_var(__ipipe_tick_regs).pc = regs->pc;
8886 - if (this_domain != ipipe_root_domain)
8887 - __raw_get_cpu_var(__ipipe_tick_regs).ipend &= ~0x10;
8888 - else
8889 + if (!ipipe_root_domain_p)
8890 __raw_get_cpu_var(__ipipe_tick_regs).ipend |= 0x10;
8891 + else
8892 + __raw_get_cpu_var(__ipipe_tick_regs).ipend &= ~0x10;
8893 }
8894
8895 -#ifndef CONFIG_GENERIC_CLOCKEVENTS
8896 -core_tick:
8897 -#endif
8898 - if (this_domain == ipipe_root_domain) {
8899 - s = __test_and_set_bit(IPIPE_SYNCDEFER_FLAG, &p->status);
8900 - barrier();
8901 - }
8902 +handle_irq:
8903
8904 ipipe_trace_irq_entry(irq);
8905 __ipipe_handle_irq(irq, regs);
8906 - ipipe_trace_irq_exit(irq);
8907 + ipipe_trace_irq_exit(irq);
8908
8909 - if (this_domain == ipipe_root_domain) {
8910 - set_thread_flag(TIF_IRQ_SYNC);
8911 - if (!s) {
8912 - __clear_bit(IPIPE_SYNCDEFER_FLAG, &p->status);
8913 - return !test_bit(IPIPE_STALL_FLAG, &p->status);
8914 - }
8915 - }
8916 + if (ipipe_root_domain_p)
8917 + return !test_bit(IPIPE_STALL_FLAG, &ipipe_root_cpudom_var(status));
8918
8919 return 0;
8920 }
8921 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-common/pm.c linux-2.6.29-rc3.owrt/arch/blackfin/mach-common/pm.c
8922 --- linux-2.6.29.owrt/arch/blackfin/mach-common/pm.c 2009-05-10 22:04:40.000000000 +0200
8923 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-common/pm.c 2009-05-10 23:48:28.000000000 +0200
8924 @@ -82,9 +82,10 @@
8925
8926 bfin_pm_standby_restore();
8927
8928 -#ifdef SIC_IWR0
8929 +#if defined(CONFIG_BF54x) || defined(CONFIG_BF52x) || defined(CONFIG_BF561) || \
8930 + defined(CONFIG_BF538) || defined(CONFIG_BF539) || defined(CONFIG_BF51x)
8931 bfin_write_SIC_IWR0(IWR_DISABLE_ALL);
8932 -# ifdef SIC_IWR1
8933 +#if defined(CONFIG_BF52x) || defined(CONFIG_BF51x)
8934 /* BF52x system reset does not properly reset SIC_IWR1 which
8935 * will screw up the bootrom as it relies on MDMA0/1 waking it
8936 * up from IDLE instructions. See this report for more info:
8937 @@ -94,8 +95,10 @@
8938 bfin_write_SIC_IWR1(IWR_ENABLE(10) | IWR_ENABLE(11));
8939 else
8940 bfin_write_SIC_IWR1(IWR_DISABLE_ALL);
8941 -# endif
8942 -# ifdef SIC_IWR2
8943 +#else
8944 + bfin_write_SIC_IWR1(IWR_DISABLE_ALL);
8945 +#endif
8946 +# ifdef CONFIG_BF54x
8947 bfin_write_SIC_IWR2(IWR_DISABLE_ALL);
8948 # endif
8949 #else
8950 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mach-common/smp.c linux-2.6.29-rc3.owrt/arch/blackfin/mach-common/smp.c
8951 --- linux-2.6.29.owrt/arch/blackfin/mach-common/smp.c 2009-05-10 22:04:40.000000000 +0200
8952 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mach-common/smp.c 2009-05-10 23:48:28.000000000 +0200
8953 @@ -158,14 +158,10 @@
8954 kfree(msg);
8955 break;
8956 case BFIN_IPI_CALL_FUNC:
8957 - spin_unlock(&msg_queue->lock);
8958 ipi_call_function(cpu, msg);
8959 - spin_lock(&msg_queue->lock);
8960 break;
8961 case BFIN_IPI_CPU_STOP:
8962 - spin_unlock(&msg_queue->lock);
8963 ipi_cpu_stop(cpu);
8964 - spin_lock(&msg_queue->lock);
8965 kfree(msg);
8966 break;
8967 default:
8968 @@ -461,7 +457,7 @@
8969 smp_flush_data.start = start;
8970 smp_flush_data.end = end;
8971
8972 - if (smp_call_function(&ipi_flush_icache, &smp_flush_data, 0))
8973 + if (smp_call_function(&ipi_flush_icache, &smp_flush_data, 1))
8974 printk(KERN_WARNING "SMP: failed to run I-cache flush request on other CPUs\n");
8975 }
8976 EXPORT_SYMBOL_GPL(smp_icache_flush_range_others);
8977 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/Makefile linux-2.6.29-rc3.owrt/arch/blackfin/Makefile
8978 --- linux-2.6.29.owrt/arch/blackfin/Makefile 2009-05-10 22:04:41.000000000 +0200
8979 +++ linux-2.6.29-rc3.owrt/arch/blackfin/Makefile 2009-05-10 23:48:28.000000000 +0200
8980 @@ -21,67 +21,57 @@
8981 KBUILD_DEFCONFIG := BF537-STAMP_defconfig
8982
8983 # setup the machine name and the machine dependent settings
8984 -machine-$(CONFIG_BF512) := bf518
8985 -machine-$(CONFIG_BF514) := bf518
8986 -machine-$(CONFIG_BF516) := bf518
8987 -machine-$(CONFIG_BF518) := bf518
8988 -machine-$(CONFIG_BF522) := bf527
8989 -machine-$(CONFIG_BF523) := bf527
8990 -machine-$(CONFIG_BF524) := bf527
8991 -machine-$(CONFIG_BF525) := bf527
8992 -machine-$(CONFIG_BF526) := bf527
8993 -machine-$(CONFIG_BF527) := bf527
8994 -machine-$(CONFIG_BF531) := bf533
8995 -machine-$(CONFIG_BF532) := bf533
8996 -machine-$(CONFIG_BF533) := bf533
8997 -machine-$(CONFIG_BF534) := bf537
8998 -machine-$(CONFIG_BF536) := bf537
8999 -machine-$(CONFIG_BF537) := bf537
9000 -machine-$(CONFIG_BF538) := bf538
9001 -machine-$(CONFIG_BF539) := bf538
9002 -machine-$(CONFIG_BF542) := bf548
9003 -machine-$(CONFIG_BF542M) := bf548
9004 -machine-$(CONFIG_BF544) := bf548
9005 -machine-$(CONFIG_BF544M) := bf548
9006 -machine-$(CONFIG_BF547) := bf548
9007 -machine-$(CONFIG_BF547M) := bf548
9008 -machine-$(CONFIG_BF548) := bf548
9009 -machine-$(CONFIG_BF548M) := bf548
9010 -machine-$(CONFIG_BF549) := bf548
9011 -machine-$(CONFIG_BF549M) := bf548
9012 -machine-$(CONFIG_BF561) := bf561
9013 +machine-$(CONFIG_BF512) := bf518
9014 +machine-$(CONFIG_BF514) := bf518
9015 +machine-$(CONFIG_BF516) := bf518
9016 +machine-$(CONFIG_BF518) := bf518
9017 +machine-$(CONFIG_BF522) := bf527
9018 +machine-$(CONFIG_BF523) := bf527
9019 +machine-$(CONFIG_BF524) := bf527
9020 +machine-$(CONFIG_BF525) := bf527
9021 +machine-$(CONFIG_BF526) := bf527
9022 +machine-$(CONFIG_BF527) := bf527
9023 +machine-$(CONFIG_BF531) := bf533
9024 +machine-$(CONFIG_BF532) := bf533
9025 +machine-$(CONFIG_BF533) := bf533
9026 +machine-$(CONFIG_BF534) := bf537
9027 +machine-$(CONFIG_BF536) := bf537
9028 +machine-$(CONFIG_BF537) := bf537
9029 +machine-$(CONFIG_BF538) := bf538
9030 +machine-$(CONFIG_BF539) := bf538
9031 +machine-$(CONFIG_BF542) := bf548
9032 +machine-$(CONFIG_BF544) := bf548
9033 +machine-$(CONFIG_BF547) := bf548
9034 +machine-$(CONFIG_BF548) := bf548
9035 +machine-$(CONFIG_BF549) := bf548
9036 +machine-$(CONFIG_BF561) := bf561
9037 MACHINE := $(machine-y)
9038 export MACHINE
9039
9040 -cpu-$(CONFIG_BF512) := bf512
9041 -cpu-$(CONFIG_BF514) := bf514
9042 -cpu-$(CONFIG_BF516) := bf516
9043 -cpu-$(CONFIG_BF518) := bf518
9044 -cpu-$(CONFIG_BF522) := bf522
9045 -cpu-$(CONFIG_BF523) := bf523
9046 -cpu-$(CONFIG_BF524) := bf524
9047 -cpu-$(CONFIG_BF525) := bf525
9048 -cpu-$(CONFIG_BF526) := bf526
9049 -cpu-$(CONFIG_BF527) := bf527
9050 -cpu-$(CONFIG_BF531) := bf531
9051 -cpu-$(CONFIG_BF532) := bf532
9052 -cpu-$(CONFIG_BF533) := bf533
9053 -cpu-$(CONFIG_BF534) := bf534
9054 -cpu-$(CONFIG_BF536) := bf536
9055 -cpu-$(CONFIG_BF537) := bf537
9056 -cpu-$(CONFIG_BF538) := bf538
9057 -cpu-$(CONFIG_BF539) := bf539
9058 -cpu-$(CONFIG_BF542) := bf542
9059 -cpu-$(CONFIG_BF542M) := bf542m
9060 -cpu-$(CONFIG_BF544) := bf544
9061 -cpu-$(CONFIG_BF544M) := bf544m
9062 -cpu-$(CONFIG_BF547) := bf547
9063 -cpu-$(CONFIG_BF547M) := bf547m
9064 -cpu-$(CONFIG_BF548) := bf548
9065 -cpu-$(CONFIG_BF548M) := bf548m
9066 -cpu-$(CONFIG_BF549) := bf549
9067 -cpu-$(CONFIG_BF549M) := bf549m
9068 -cpu-$(CONFIG_BF561) := bf561
9069 +cpu-$(CONFIG_BF512) := bf512
9070 +cpu-$(CONFIG_BF514) := bf514
9071 +cpu-$(CONFIG_BF516) := bf516
9072 +cpu-$(CONFIG_BF518) := bf518
9073 +cpu-$(CONFIG_BF522) := bf522
9074 +cpu-$(CONFIG_BF523) := bf523
9075 +cpu-$(CONFIG_BF524) := bf524
9076 +cpu-$(CONFIG_BF525) := bf525
9077 +cpu-$(CONFIG_BF526) := bf526
9078 +cpu-$(CONFIG_BF527) := bf527
9079 +cpu-$(CONFIG_BF531) := bf531
9080 +cpu-$(CONFIG_BF532) := bf532
9081 +cpu-$(CONFIG_BF533) := bf533
9082 +cpu-$(CONFIG_BF534) := bf534
9083 +cpu-$(CONFIG_BF536) := bf536
9084 +cpu-$(CONFIG_BF537) := bf537
9085 +cpu-$(CONFIG_BF538) := bf538
9086 +cpu-$(CONFIG_BF539) := bf539
9087 +cpu-$(CONFIG_BF542) := bf542
9088 +cpu-$(CONFIG_BF544) := bf544
9089 +cpu-$(CONFIG_BF547) := bf547
9090 +cpu-$(CONFIG_BF548) := bf548
9091 +cpu-$(CONFIG_BF549) := bf549
9092 +cpu-$(CONFIG_BF561) := bf561
9093
9094 rev-$(CONFIG_BF_REV_0_0) := 0.0
9095 rev-$(CONFIG_BF_REV_0_1) := 0.1
9096 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/blackfin/mm/init.c linux-2.6.29-rc3.owrt/arch/blackfin/mm/init.c
9097 --- linux-2.6.29.owrt/arch/blackfin/mm/init.c 2009-05-10 22:04:40.000000000 +0200
9098 +++ linux-2.6.29-rc3.owrt/arch/blackfin/mm/init.c 2009-05-10 23:48:28.000000000 +0200
9099 @@ -104,7 +104,7 @@
9100 }
9101 }
9102
9103 -asmlinkage void __init init_pda(void)
9104 +asmlinkage void init_pda(void)
9105 {
9106 unsigned int cpu = raw_smp_processor_id();
9107
9108 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/frv/mm/dma-alloc.c linux-2.6.29-rc3.owrt/arch/frv/mm/dma-alloc.c
9109 --- linux-2.6.29.owrt/arch/frv/mm/dma-alloc.c 2009-05-10 22:04:39.000000000 +0200
9110 +++ linux-2.6.29-rc3.owrt/arch/frv/mm/dma-alloc.c 2009-05-10 23:48:28.000000000 +0200
9111 @@ -36,10 +36,10 @@
9112 #include <linux/vmalloc.h>
9113 #include <linux/init.h>
9114 #include <linux/pci.h>
9115 -#include <linux/hardirq.h>
9116
9117 #include <asm/pgalloc.h>
9118 #include <asm/io.h>
9119 +#include <asm/hardirq.h>
9120 #include <asm/mmu_context.h>
9121 #include <asm/pgtable.h>
9122 #include <asm/mmu.h>
9123 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/ia64/hp/common/sba_iommu.c linux-2.6.29-rc3.owrt/arch/ia64/hp/common/sba_iommu.c
9124 --- linux-2.6.29.owrt/arch/ia64/hp/common/sba_iommu.c 2009-05-10 22:04:40.000000000 +0200
9125 +++ linux-2.6.29-rc3.owrt/arch/ia64/hp/common/sba_iommu.c 2009-05-10 23:48:28.000000000 +0200
9126 @@ -906,7 +906,7 @@
9127 * @dir: R/W or both.
9128 * @attrs: optional dma attributes
9129 *
9130 - * See Documentation/PCI/PCI-DMA-mapping.txt
9131 + * See Documentation/DMA-mapping.txt
9132 */
9133 dma_addr_t
9134 sba_map_single_attrs(struct device *dev, void *addr, size_t size, int dir,
9135 @@ -1024,7 +1024,7 @@
9136 * @dir: R/W or both.
9137 * @attrs: optional dma attributes
9138 *
9139 - * See Documentation/PCI/PCI-DMA-mapping.txt
9140 + * See Documentation/DMA-mapping.txt
9141 */
9142 void sba_unmap_single_attrs(struct device *dev, dma_addr_t iova, size_t size,
9143 int dir, struct dma_attrs *attrs)
9144 @@ -1102,7 +1102,7 @@
9145 * @size: number of bytes mapped in driver buffer.
9146 * @dma_handle: IOVA of new buffer.
9147 *
9148 - * See Documentation/PCI/PCI-DMA-mapping.txt
9149 + * See Documentation/DMA-mapping.txt
9150 */
9151 void *
9152 sba_alloc_coherent (struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t flags)
9153 @@ -1165,7 +1165,7 @@
9154 * @vaddr: virtual address IOVA of "consistent" buffer.
9155 * @dma_handler: IO virtual address of "consistent" buffer.
9156 *
9157 - * See Documentation/PCI/PCI-DMA-mapping.txt
9158 + * See Documentation/DMA-mapping.txt
9159 */
9160 void sba_free_coherent (struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle)
9161 {
9162 @@ -1420,7 +1420,7 @@
9163 * @dir: R/W or both.
9164 * @attrs: optional dma attributes
9165 *
9166 - * See Documentation/PCI/PCI-DMA-mapping.txt
9167 + * See Documentation/DMA-mapping.txt
9168 */
9169 int sba_map_sg_attrs(struct device *dev, struct scatterlist *sglist, int nents,
9170 int dir, struct dma_attrs *attrs)
9171 @@ -1512,7 +1512,7 @@
9172 * @dir: R/W or both.
9173 * @attrs: optional dma attributes
9174 *
9175 - * See Documentation/PCI/PCI-DMA-mapping.txt
9176 + * See Documentation/DMA-mapping.txt
9177 */
9178 void sba_unmap_sg_attrs(struct device *dev, struct scatterlist *sglist,
9179 int nents, int dir, struct dma_attrs *attrs)
9180 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/ia64/include/asm/kvm.h linux-2.6.29-rc3.owrt/arch/ia64/include/asm/kvm.h
9181 --- linux-2.6.29.owrt/arch/ia64/include/asm/kvm.h 2009-05-10 22:04:40.000000000 +0200
9182 +++ linux-2.6.29-rc3.owrt/arch/ia64/include/asm/kvm.h 2009-05-10 23:48:28.000000000 +0200
9183 @@ -25,10 +25,6 @@
9184
9185 #include <linux/ioctl.h>
9186
9187 -/* Select x86 specific features in <linux/kvm.h> */
9188 -#define __KVM_HAVE_IOAPIC
9189 -#define __KVM_HAVE_DEVICE_ASSIGNMENT
9190 -
9191 /* Architectural interrupt line count. */
9192 #define KVM_NR_INTERRUPTS 256
9193
9194 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/ia64/include/asm/mmzone.h linux-2.6.29-rc3.owrt/arch/ia64/include/asm/mmzone.h
9195 --- linux-2.6.29.owrt/arch/ia64/include/asm/mmzone.h 2009-05-10 22:04:40.000000000 +0200
9196 +++ linux-2.6.29-rc3.owrt/arch/ia64/include/asm/mmzone.h 2009-05-10 23:48:28.000000000 +0200
9197 @@ -31,6 +31,10 @@
9198 #endif
9199 }
9200
9201 +#ifdef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID
9202 +extern int early_pfn_to_nid(unsigned long pfn);
9203 +#endif
9204 +
9205 #ifdef CONFIG_IA64_DIG /* DIG systems are small */
9206 # define MAX_PHYSNODE_ID 8
9207 # define NR_NODE_MEMBLKS (MAX_NUMNODES * 8)
9208 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/ia64/include/asm/sn/bte.h linux-2.6.29-rc3.owrt/arch/ia64/include/asm/sn/bte.h
9209 --- linux-2.6.29.owrt/arch/ia64/include/asm/sn/bte.h 2009-05-10 22:04:40.000000000 +0200
9210 +++ linux-2.6.29-rc3.owrt/arch/ia64/include/asm/sn/bte.h 2009-05-10 23:48:28.000000000 +0200
9211 @@ -39,7 +39,7 @@
9212 /* BTE status register only supports 16 bits for length field */
9213 #define BTE_LEN_BITS (16)
9214 #define BTE_LEN_MASK ((1 << BTE_LEN_BITS) - 1)
9215 -#define BTE_MAX_XFER (BTE_LEN_MASK << L1_CACHE_SHIFT)
9216 +#define BTE_MAX_XFER ((1 << BTE_LEN_BITS) * L1_CACHE_BYTES)
9217
9218
9219 /* Define hardware */
9220 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/ia64/Kconfig linux-2.6.29-rc3.owrt/arch/ia64/Kconfig
9221 --- linux-2.6.29.owrt/arch/ia64/Kconfig 2009-05-10 22:04:40.000000000 +0200
9222 +++ linux-2.6.29-rc3.owrt/arch/ia64/Kconfig 2009-05-10 23:48:28.000000000 +0200
9223 @@ -221,11 +221,7 @@
9224
9225 config IA64_XEN_GUEST
9226 bool "Xen guest"
9227 - select SWIOTLB
9228 depends on XEN
9229 - help
9230 - Build a kernel that runs on Xen guest domain. At this moment only
9231 - 16KB page size in supported.
9232
9233 endchoice
9234
9235 @@ -483,7 +479,8 @@
9236 default y if VIRTUAL_MEM_MAP
9237
9238 config HAVE_ARCH_EARLY_PFN_TO_NID
9239 - def_bool NUMA && SPARSEMEM
9240 + def_bool y
9241 + depends on NEED_MULTIPLE_NODES
9242
9243 config HAVE_ARCH_NODEDATA_EXTENSION
9244 def_bool y
9245 @@ -638,17 +635,6 @@
9246 and include PCI device scope covered by these DMA
9247 remapping devices.
9248
9249 -config DMAR_DEFAULT_ON
9250 - def_bool y
9251 - prompt "Enable DMA Remapping Devices by default"
9252 - depends on DMAR
9253 - help
9254 - Selecting this option will enable a DMAR device at boot time if
9255 - one is found. If this option is not selected, DMAR support can
9256 - be enabled by passing intel_iommu=on to the kernel. It is
9257 - recommended you say N here while the DMAR code remains
9258 - experimental.
9259 -
9260 endmenu
9261
9262 endif
9263 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/ia64/kernel/iosapic.c linux-2.6.29-rc3.owrt/arch/ia64/kernel/iosapic.c
9264 --- linux-2.6.29.owrt/arch/ia64/kernel/iosapic.c 2009-05-10 22:04:40.000000000 +0200
9265 +++ linux-2.6.29-rc3.owrt/arch/ia64/kernel/iosapic.c 2009-05-10 23:48:28.000000000 +0200
9266 @@ -507,7 +507,7 @@
9267 if (trigger == IOSAPIC_EDGE)
9268 return -EINVAL;
9269
9270 - for (i = 0; i < NR_IRQS; i++) {
9271 + for (i = 0; i <= NR_IRQS; i++) {
9272 info = &iosapic_intr_info[i];
9273 if (info->trigger == trigger && info->polarity == pol &&
9274 (info->dmode == IOSAPIC_FIXED ||
9275 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/ia64/kernel/smpboot.c linux-2.6.29-rc3.owrt/arch/ia64/kernel/smpboot.c
9276 --- linux-2.6.29.owrt/arch/ia64/kernel/smpboot.c 2009-05-10 22:04:40.000000000 +0200
9277 +++ linux-2.6.29-rc3.owrt/arch/ia64/kernel/smpboot.c 2009-05-10 23:48:28.000000000 +0200
9278 @@ -736,15 +736,14 @@
9279 return -EBUSY;
9280 }
9281
9282 - cpu_clear(cpu, cpu_online_map);
9283 -
9284 if (migrate_platform_irqs(cpu)) {
9285 cpu_set(cpu, cpu_online_map);
9286 - return -EBUSY;
9287 + return (-EBUSY);
9288 }
9289
9290 remove_siblinginfo(cpu);
9291 fixup_irqs();
9292 + cpu_clear(cpu, cpu_online_map);
9293 local_flush_tlb_all();
9294 cpu_clear(cpu, cpu_callin_map);
9295 return 0;
9296 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/ia64/kernel/unwind.c linux-2.6.29-rc3.owrt/arch/ia64/kernel/unwind.c
9297 --- linux-2.6.29.owrt/arch/ia64/kernel/unwind.c 2009-05-10 22:04:40.000000000 +0200
9298 +++ linux-2.6.29-rc3.owrt/arch/ia64/kernel/unwind.c 2009-05-10 23:48:28.000000000 +0200
9299 @@ -2149,7 +2149,7 @@
9300
9301 /* next, remove hash table entries for this table */
9302
9303 - for (index = 0; index < UNW_HASH_SIZE; ++index) {
9304 + for (index = 0; index <= UNW_HASH_SIZE; ++index) {
9305 tmp = unw.cache + unw.hash[index];
9306 if (unw.hash[index] >= UNW_CACHE_SIZE
9307 || tmp->ip < table->start || tmp->ip >= table->end)
9308 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/ia64/kvm/kvm-ia64.c linux-2.6.29-rc3.owrt/arch/ia64/kvm/kvm-ia64.c
9309 --- linux-2.6.29.owrt/arch/ia64/kvm/kvm-ia64.c 2009-05-10 22:04:40.000000000 +0200
9310 +++ linux-2.6.29-rc3.owrt/arch/ia64/kvm/kvm-ia64.c 2009-05-10 23:48:28.000000000 +0200
9311 @@ -1337,10 +1337,6 @@
9312 }
9313 }
9314
9315 -void kvm_arch_sync_events(struct kvm *kvm)
9316 -{
9317 -}
9318 -
9319 void kvm_arch_destroy_vm(struct kvm *kvm)
9320 {
9321 kvm_iommu_unmap_guest(kvm);
9322 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/ia64/kvm/process.c linux-2.6.29-rc3.owrt/arch/ia64/kvm/process.c
9323 --- linux-2.6.29.owrt/arch/ia64/kvm/process.c 2009-05-10 22:04:40.000000000 +0200
9324 +++ linux-2.6.29-rc3.owrt/arch/ia64/kvm/process.c 2009-05-10 23:48:28.000000000 +0200
9325 @@ -455,18 +455,13 @@
9326 if (!vmm_fpswa_interface)
9327 return (fpswa_ret_t) {-1, 0, 0, 0};
9328
9329 - memset(&fp_state, 0, sizeof(fp_state_t));
9330 -
9331 /*
9332 - * compute fp_state. only FP registers f6 - f11 are used by the
9333 - * vmm, so set those bits in the mask and set the low volatile
9334 - * pointer to point to these registers.
9335 + * Just let fpswa driver to use hardware fp registers.
9336 + * No fp register is valid in memory.
9337 */
9338 - fp_state.bitmask_low64 = 0xfc0; /* bit6..bit11 */
9339 -
9340 - fp_state.fp_state_low_volatile = (fp_state_low_volatile_t *) &regs->f6;
9341 + memset(&fp_state, 0, sizeof(fp_state_t));
9342
9343 - /*
9344 + /*
9345 * unsigned long (*EFI_FPSWA) (
9346 * unsigned long trap_type,
9347 * void *Bundle,
9348 @@ -550,6 +545,10 @@
9349 status = vmm_handle_fpu_swa(0, regs, isr);
9350 if (!status)
9351 return ;
9352 + else if (-EAGAIN == status) {
9353 + vcpu_decrement_iip(vcpu);
9354 + return ;
9355 + }
9356 break;
9357 }
9358
9359 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/ia64/mm/numa.c linux-2.6.29-rc3.owrt/arch/ia64/mm/numa.c
9360 --- linux-2.6.29.owrt/arch/ia64/mm/numa.c 2009-05-10 22:04:40.000000000 +0200
9361 +++ linux-2.6.29-rc3.owrt/arch/ia64/mm/numa.c 2009-05-10 23:48:28.000000000 +0200
9362 @@ -58,7 +58,7 @@
9363 * SPARSEMEM to allocate the SPARSEMEM sectionmap on the NUMA node where
9364 * the section resides.
9365 */
9366 -int __meminit __early_pfn_to_nid(unsigned long pfn)
9367 +int early_pfn_to_nid(unsigned long pfn)
9368 {
9369 int i, section = pfn >> PFN_SECTION_SHIFT, ssec, esec;
9370
9371 @@ -70,7 +70,7 @@
9372 return node_memblk[i].nid;
9373 }
9374
9375 - return -1;
9376 + return 0;
9377 }
9378
9379 #ifdef CONFIG_MEMORY_HOTPLUG
9380 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/ia64/sn/kernel/bte.c linux-2.6.29-rc3.owrt/arch/ia64/sn/kernel/bte.c
9381 --- linux-2.6.29.owrt/arch/ia64/sn/kernel/bte.c 2009-05-10 22:04:40.000000000 +0200
9382 +++ linux-2.6.29-rc3.owrt/arch/ia64/sn/kernel/bte.c 2009-05-10 23:48:28.000000000 +0200
9383 @@ -97,10 +97,9 @@
9384 return BTE_SUCCESS;
9385 }
9386
9387 - BUG_ON(len & L1_CACHE_MASK);
9388 - BUG_ON(src & L1_CACHE_MASK);
9389 - BUG_ON(dest & L1_CACHE_MASK);
9390 - BUG_ON(len > BTE_MAX_XFER);
9391 + BUG_ON((len & L1_CACHE_MASK) ||
9392 + (src & L1_CACHE_MASK) || (dest & L1_CACHE_MASK));
9393 + BUG_ON(!(len < ((BTE_LEN_MASK + 1) << L1_CACHE_SHIFT)));
9394
9395 /*
9396 * Start with interface corresponding to cpu number
9397 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/ia64/sn/kernel/io_acpi_init.c linux-2.6.29-rc3.owrt/arch/ia64/sn/kernel/io_acpi_init.c
9398 --- linux-2.6.29.owrt/arch/ia64/sn/kernel/io_acpi_init.c 2009-05-10 22:04:40.000000000 +0200
9399 +++ linux-2.6.29-rc3.owrt/arch/ia64/sn/kernel/io_acpi_init.c 2009-05-10 23:48:28.000000000 +0200
9400 @@ -443,7 +443,7 @@
9401 size = pci_resource_len(dev, PCI_ROM_RESOURCE);
9402 addr = ioremap(pcidev_info->pdi_pio_mapped_addr[PCI_ROM_RESOURCE],
9403 size);
9404 - image_size = pci_get_rom_size(dev, addr, size);
9405 + image_size = pci_get_rom_size(addr, size);
9406 dev->resource[PCI_ROM_RESOURCE].start = (unsigned long) addr;
9407 dev->resource[PCI_ROM_RESOURCE].end =
9408 (unsigned long) addr + image_size - 1;
9409 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/ia64/sn/kernel/io_init.c linux-2.6.29-rc3.owrt/arch/ia64/sn/kernel/io_init.c
9410 --- linux-2.6.29.owrt/arch/ia64/sn/kernel/io_init.c 2009-05-10 22:04:40.000000000 +0200
9411 +++ linux-2.6.29-rc3.owrt/arch/ia64/sn/kernel/io_init.c 2009-05-10 23:48:28.000000000 +0200
9412 @@ -269,7 +269,7 @@
9413
9414 rom = ioremap(pci_resource_start(dev, PCI_ROM_RESOURCE),
9415 size + 1);
9416 - image_size = pci_get_rom_size(dev, rom, size + 1);
9417 + image_size = pci_get_rom_size(rom, size + 1);
9418 dev->resource[PCI_ROM_RESOURCE].end =
9419 dev->resource[PCI_ROM_RESOURCE].start +
9420 image_size - 1;
9421 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/ia64/sn/pci/pcibr/pcibr_dma.c linux-2.6.29-rc3.owrt/arch/ia64/sn/pci/pcibr/pcibr_dma.c
9422 --- linux-2.6.29.owrt/arch/ia64/sn/pci/pcibr/pcibr_dma.c 2009-05-10 22:04:40.000000000 +0200
9423 +++ linux-2.6.29-rc3.owrt/arch/ia64/sn/pci/pcibr/pcibr_dma.c 2009-05-10 23:48:28.000000000 +0200
9424 @@ -135,10 +135,11 @@
9425 if (SN_DMA_ADDRTYPE(dma_flags) == SN_DMA_ADDR_PHYS)
9426 pci_addr = IS_PIC_SOFT(pcibus_info) ?
9427 PHYS_TO_DMA(paddr) :
9428 - PHYS_TO_TIODMA(paddr);
9429 + PHYS_TO_TIODMA(paddr) | dma_attributes;
9430 else
9431 - pci_addr = paddr;
9432 - pci_addr |= dma_attributes;
9433 + pci_addr = IS_PIC_SOFT(pcibus_info) ?
9434 + paddr :
9435 + paddr | dma_attributes;
9436
9437 /* Handle Bus mode */
9438 if (IS_PCIX(pcibus_info))
9439 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/ia64/xen/Kconfig linux-2.6.29-rc3.owrt/arch/ia64/xen/Kconfig
9440 --- linux-2.6.29.owrt/arch/ia64/xen/Kconfig 2009-05-10 22:04:40.000000000 +0200
9441 +++ linux-2.6.29-rc3.owrt/arch/ia64/xen/Kconfig 2009-05-10 23:48:28.000000000 +0200
9442 @@ -8,7 +8,8 @@
9443 depends on PARAVIRT && MCKINLEY && IA64_PAGE_SIZE_16KB && EXPERIMENTAL
9444 select XEN_XENCOMM
9445 select NO_IDLE_HZ
9446 - # followings are required to save/restore.
9447 +
9448 + # those are required to save/restore.
9449 select ARCH_SUSPEND_POSSIBLE
9450 select SUSPEND
9451 select PM_SLEEP
9452 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/ia64/xen/xen_pv_ops.c linux-2.6.29-rc3.owrt/arch/ia64/xen/xen_pv_ops.c
9453 --- linux-2.6.29.owrt/arch/ia64/xen/xen_pv_ops.c 2009-05-10 22:04:40.000000000 +0200
9454 +++ linux-2.6.29-rc3.owrt/arch/ia64/xen/xen_pv_ops.c 2009-05-10 23:48:28.000000000 +0200
9455 @@ -153,7 +153,7 @@
9456 xen_setup_vcpu_info_placement();
9457 }
9458
9459 -static const struct pv_init_ops xen_init_ops __initconst = {
9460 +static const struct pv_init_ops xen_init_ops __initdata = {
9461 .banner = xen_banner,
9462
9463 .reserve_memory = xen_reserve_memory,
9464 @@ -337,7 +337,7 @@
9465 HYPERVISOR_physdev_op(PHYSDEVOP_apic_write, &apic_op);
9466 }
9467
9468 -static const struct pv_iosapic_ops xen_iosapic_ops __initconst = {
9469 +static const struct pv_iosapic_ops xen_iosapic_ops __initdata = {
9470 .pcat_compat_init = xen_pcat_compat_init,
9471 .__get_irq_chip = xen_iosapic_get_irq_chip,
9472
9473 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/m68k/atari/ataints.c linux-2.6.29-rc3.owrt/arch/m68k/atari/ataints.c
9474 --- linux-2.6.29.owrt/arch/m68k/atari/ataints.c 2009-05-10 22:04:40.000000000 +0200
9475 +++ linux-2.6.29-rc3.owrt/arch/m68k/atari/ataints.c 2009-05-10 23:48:28.000000000 +0200
9476 @@ -187,8 +187,8 @@
9477 " jbra ret_from_interrupt\n" \
9478 : : "i" (&kstat_cpu(0).irqs[n+8]), "i" (&irq_handler[n+8]), \
9479 "n" (PT_OFF_SR), "n" (n), \
9480 - "i" (n & 8 ? (n & 16 ? &tt_mfp.int_mk_a : &st_mfp.int_mk_a) \
9481 - : (n & 16 ? &tt_mfp.int_mk_b : &st_mfp.int_mk_b)), \
9482 + "i" (n & 8 ? (n & 16 ? &tt_mfp.int_mk_a : &mfp.int_mk_a) \
9483 + : (n & 16 ? &tt_mfp.int_mk_b : &mfp.int_mk_b)), \
9484 "m" (preempt_count()), "di" (HARDIRQ_OFFSET) \
9485 ); \
9486 for (;;); /* fake noreturn */ \
9487 @@ -366,14 +366,14 @@
9488 /* Initialize the MFP(s) */
9489
9490 #ifdef ATARI_USE_SOFTWARE_EOI
9491 - st_mfp.vec_adr = 0x48; /* Software EOI-Mode */
9492 + mfp.vec_adr = 0x48; /* Software EOI-Mode */
9493 #else
9494 - st_mfp.vec_adr = 0x40; /* Automatic EOI-Mode */
9495 + mfp.vec_adr = 0x40; /* Automatic EOI-Mode */
9496 #endif
9497 - st_mfp.int_en_a = 0x00; /* turn off MFP-Ints */
9498 - st_mfp.int_en_b = 0x00;
9499 - st_mfp.int_mk_a = 0xff; /* no Masking */
9500 - st_mfp.int_mk_b = 0xff;
9501 + mfp.int_en_a = 0x00; /* turn off MFP-Ints */
9502 + mfp.int_en_b = 0x00;
9503 + mfp.int_mk_a = 0xff; /* no Masking */
9504 + mfp.int_mk_b = 0xff;
9505
9506 if (ATARIHW_PRESENT(TT_MFP)) {
9507 #ifdef ATARI_USE_SOFTWARE_EOI
9508 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/m68k/atari/atakeyb.c linux-2.6.29-rc3.owrt/arch/m68k/atari/atakeyb.c
9509 --- linux-2.6.29.owrt/arch/m68k/atari/atakeyb.c 2009-05-10 22:04:40.000000000 +0200
9510 +++ linux-2.6.29-rc3.owrt/arch/m68k/atari/atakeyb.c 2009-05-10 23:48:28.000000000 +0200
9511 @@ -609,10 +609,10 @@
9512 ACIA_RHTID : 0);
9513
9514 /* make sure the interrupt line is up */
9515 - } while ((st_mfp.par_dt_reg & 0x10) == 0);
9516 + } while ((mfp.par_dt_reg & 0x10) == 0);
9517
9518 /* enable ACIA Interrupts */
9519 - st_mfp.active_edge &= ~0x10;
9520 + mfp.active_edge &= ~0x10;
9521 atari_turnon_irq(IRQ_MFP_ACIA);
9522
9523 ikbd_self_test = 1;
9524 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/m68k/atari/config.c linux-2.6.29-rc3.owrt/arch/m68k/atari/config.c
9525 --- linux-2.6.29.owrt/arch/m68k/atari/config.c 2009-05-10 22:04:40.000000000 +0200
9526 +++ linux-2.6.29-rc3.owrt/arch/m68k/atari/config.c 2009-05-10 23:48:28.000000000 +0200
9527 @@ -258,7 +258,7 @@
9528 printk("STND_SHIFTER ");
9529 }
9530 }
9531 - if (hwreg_present(&st_mfp.par_dt_reg)) {
9532 + if (hwreg_present(&mfp.par_dt_reg)) {
9533 ATARIHW_SET(ST_MFP);
9534 printk("ST_MFP ");
9535 }
9536 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/m68k/atari/debug.c linux-2.6.29-rc3.owrt/arch/m68k/atari/debug.c
9537 --- linux-2.6.29.owrt/arch/m68k/atari/debug.c 2009-05-10 22:04:40.000000000 +0200
9538 +++ linux-2.6.29-rc3.owrt/arch/m68k/atari/debug.c 2009-05-10 23:48:28.000000000 +0200
9539 @@ -34,9 +34,9 @@
9540
9541 static inline void ata_mfp_out(char c)
9542 {
9543 - while (!(st_mfp.trn_stat & 0x80)) /* wait for tx buf empty */
9544 + while (!(mfp.trn_stat & 0x80)) /* wait for tx buf empty */
9545 barrier();
9546 - st_mfp.usart_dta = c;
9547 + mfp.usart_dta = c;
9548 }
9549
9550 static void atari_mfp_console_write(struct console *co, const char *str,
9551 @@ -91,7 +91,7 @@
9552 /* This a some-seconds timeout in case no printer is connected */
9553 unsigned long i = loops_per_jiffy > 1 ? loops_per_jiffy : 10000000/HZ;
9554
9555 - while ((st_mfp.par_dt_reg & 1) && --i) /* wait for BUSY == L */
9556 + while ((mfp.par_dt_reg & 1) && --i) /* wait for BUSY == L */
9557 ;
9558 if (!i)
9559 return 0;
9560 @@ -131,9 +131,9 @@
9561 #if 0
9562 int atari_mfp_console_wait_key(struct console *co)
9563 {
9564 - while (!(st_mfp.rcv_stat & 0x80)) /* wait for rx buf filled */
9565 + while (!(mfp.rcv_stat & 0x80)) /* wait for rx buf filled */
9566 barrier();
9567 - return st_mfp.usart_dta;
9568 + return mfp.usart_dta;
9569 }
9570
9571 int atari_scc_console_wait_key(struct console *co)
9572 @@ -175,12 +175,12 @@
9573 baud = B9600; /* use default 9600bps for non-implemented rates */
9574 baud -= B1200; /* baud_table[] starts at 1200bps */
9575
9576 - st_mfp.trn_stat &= ~0x01; /* disable TX */
9577 - st_mfp.usart_ctr = parity | csize | 0x88; /* 1:16 clk mode, 1 stop bit */
9578 - st_mfp.tim_ct_cd &= 0x70; /* stop timer D */
9579 - st_mfp.tim_dt_d = baud_table[baud];
9580 - st_mfp.tim_ct_cd |= 0x01; /* start timer D, 1:4 */
9581 - st_mfp.trn_stat |= 0x01; /* enable TX */
9582 + mfp.trn_stat &= ~0x01; /* disable TX */
9583 + mfp.usart_ctr = parity | csize | 0x88; /* 1:16 clk mode, 1 stop bit */
9584 + mfp.tim_ct_cd &= 0x70; /* stop timer D */
9585 + mfp.tim_dt_d = baud_table[baud];
9586 + mfp.tim_ct_cd |= 0x01; /* start timer D, 1:4 */
9587 + mfp.trn_stat |= 0x01; /* enable TX */
9588 }
9589
9590 #define SCC_WRITE(reg, val) \
9591 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/m68k/atari/time.c linux-2.6.29-rc3.owrt/arch/m68k/atari/time.c
9592 --- linux-2.6.29.owrt/arch/m68k/atari/time.c 2009-05-10 22:04:40.000000000 +0200
9593 +++ linux-2.6.29-rc3.owrt/arch/m68k/atari/time.c 2009-05-10 23:48:28.000000000 +0200
9594 @@ -27,9 +27,9 @@
9595 atari_sched_init(irq_handler_t timer_routine)
9596 {
9597 /* set Timer C data Register */
9598 - st_mfp.tim_dt_c = INT_TICKS;
9599 + mfp.tim_dt_c = INT_TICKS;
9600 /* start timer C, div = 1:100 */
9601 - st_mfp.tim_ct_cd = (st_mfp.tim_ct_cd & 15) | 0x60;
9602 + mfp.tim_ct_cd = (mfp.tim_ct_cd & 15) | 0x60;
9603 /* install interrupt service routine for MFP Timer C */
9604 if (request_irq(IRQ_MFP_TIMC, timer_routine, IRQ_TYPE_SLOW,
9605 "timer", timer_routine))
9606 @@ -46,11 +46,11 @@
9607 unsigned long ticks, offset = 0;
9608
9609 /* read MFP timer C current value */
9610 - ticks = st_mfp.tim_dt_c;
9611 + ticks = mfp.tim_dt_c;
9612 /* The probability of underflow is less than 2% */
9613 if (ticks > INT_TICKS - INT_TICKS / 50)
9614 /* Check for pending timer interrupt */
9615 - if (st_mfp.int_pn_b & (1 << 5))
9616 + if (mfp.int_pn_b & (1 << 5))
9617 offset = TICK_SIZE;
9618
9619 ticks = INT_TICKS - ticks;
9620 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/m68k/include/asm/atarihw.h linux-2.6.29-rc3.owrt/arch/m68k/include/asm/atarihw.h
9621 --- linux-2.6.29.owrt/arch/m68k/include/asm/atarihw.h 2009-05-10 22:04:40.000000000 +0200
9622 +++ linux-2.6.29-rc3.owrt/arch/m68k/include/asm/atarihw.h 2009-05-10 23:48:28.000000000 +0200
9623 @@ -113,7 +113,7 @@
9624 * of nops on various machines. Somebody claimed that the tstb takes 600 ns.
9625 */
9626 #define MFPDELAY() \
9627 - __asm__ __volatile__ ( "tstb %0" : : "m" (st_mfp.par_dt_reg) : "cc" );
9628 + __asm__ __volatile__ ( "tstb %0" : : "m" (mfp.par_dt_reg) : "cc" );
9629
9630 /* Do cache push/invalidate for DMA read/write. This function obeys the
9631 * snooping on some machines (Medusa) and processors: The Medusa itself can
9632 @@ -565,7 +565,7 @@
9633 u_char char_dummy23;
9634 u_char usart_dta;
9635 };
9636 -# define st_mfp ((*(volatile struct MFP*)MFP_BAS))
9637 +# define mfp ((*(volatile struct MFP*)MFP_BAS))
9638
9639 /* TT's second MFP */
9640
9641 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/m68k/include/asm/atariints.h linux-2.6.29-rc3.owrt/arch/m68k/include/asm/atariints.h
9642 --- linux-2.6.29.owrt/arch/m68k/include/asm/atariints.h 2009-05-10 22:04:40.000000000 +0200
9643 +++ linux-2.6.29-rc3.owrt/arch/m68k/include/asm/atariints.h 2009-05-10 23:48:28.000000000 +0200
9644 @@ -113,7 +113,7 @@
9645 { unsigned char mask, *reg;
9646
9647 mask = 1 << (irq & 7);
9648 - reg = (unsigned char *)&st_mfp.int_en_a + type*4 +
9649 + reg = (unsigned char *)&mfp.int_en_a + type*4 +
9650 ((irq & 8) >> 2) + (((irq-8) & 16) << 3);
9651 return( *reg & mask );
9652 }
9653 @@ -123,7 +123,7 @@
9654 { unsigned char mask, *reg;
9655
9656 mask = 1 << (irq & 7);
9657 - reg = (unsigned char *)&st_mfp.int_en_a + type*4 +
9658 + reg = (unsigned char *)&mfp.int_en_a + type*4 +
9659 ((irq & 8) >> 2) + (((irq-8) & 16) << 3);
9660 __asm__ __volatile__ ( "orb %0,%1"
9661 : : "di" (mask), "m" (*reg) : "memory" );
9662 @@ -134,7 +134,7 @@
9663 { unsigned char mask, *reg;
9664
9665 mask = ~(1 << (irq & 7));
9666 - reg = (unsigned char *)&st_mfp.int_en_a + type*4 +
9667 + reg = (unsigned char *)&mfp.int_en_a + type*4 +
9668 ((irq & 8) >> 2) + (((irq-8) & 16) << 3);
9669 if (type == MFP_PENDING || type == MFP_SERVICE)
9670 __asm__ __volatile__ ( "moveb %0,%1"
9671 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/m68k/include/asm/param.h linux-2.6.29-rc3.owrt/arch/m68k/include/asm/param.h
9672 --- linux-2.6.29.owrt/arch/m68k/include/asm/param.h 2009-05-10 22:04:40.000000000 +0200
9673 +++ linux-2.6.29-rc3.owrt/arch/m68k/include/asm/param.h 2009-05-10 23:48:28.000000000 +0200
9674 @@ -1,26 +1,5 @@
9675 -#ifndef _M68K_PARAM_H
9676 -#define _M68K_PARAM_H
9677 -
9678 -#ifdef __KERNEL__
9679 -# define HZ CONFIG_HZ /* Internal kernel timer frequency */
9680 -# define USER_HZ 100 /* .. some user interfaces are in "ticks" */
9681 -# define CLOCKS_PER_SEC (USER_HZ) /* like times() */
9682 -#endif
9683 -
9684 -#ifndef HZ
9685 -#define HZ 100
9686 -#endif
9687 -
9688 #ifdef __uClinux__
9689 -#define EXEC_PAGESIZE 4096
9690 +#include "param_no.h"
9691 #else
9692 -#define EXEC_PAGESIZE 8192
9693 -#endif
9694 -
9695 -#ifndef NOGROUP
9696 -#define NOGROUP (-1)
9697 +#include "param_mm.h"
9698 #endif
9699 -
9700 -#define MAXHOSTNAMELEN 64 /* max length of hostname */
9701 -
9702 -#endif /* _M68K_PARAM_H */
9703 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/m68k/include/asm/param_mm.h linux-2.6.29-rc3.owrt/arch/m68k/include/asm/param_mm.h
9704 --- linux-2.6.29.owrt/arch/m68k/include/asm/param_mm.h 1970-01-01 01:00:00.000000000 +0100
9705 +++ linux-2.6.29-rc3.owrt/arch/m68k/include/asm/param_mm.h 2009-05-10 23:48:28.000000000 +0200
9706 @@ -0,0 +1,22 @@
9707 +#ifndef _M68K_PARAM_H
9708 +#define _M68K_PARAM_H
9709 +
9710 +#ifdef __KERNEL__
9711 +# define HZ CONFIG_HZ /* Internal kernel timer frequency */
9712 +# define USER_HZ 100 /* .. some user interfaces are in "ticks" */
9713 +# define CLOCKS_PER_SEC (USER_HZ) /* like times() */
9714 +#endif
9715 +
9716 +#ifndef HZ
9717 +#define HZ 100
9718 +#endif
9719 +
9720 +#define EXEC_PAGESIZE 8192
9721 +
9722 +#ifndef NOGROUP
9723 +#define NOGROUP (-1)
9724 +#endif
9725 +
9726 +#define MAXHOSTNAMELEN 64 /* max length of hostname */
9727 +
9728 +#endif /* _M68K_PARAM_H */
9729 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/m68k/include/asm/param_no.h linux-2.6.29-rc3.owrt/arch/m68k/include/asm/param_no.h
9730 --- linux-2.6.29.owrt/arch/m68k/include/asm/param_no.h 1970-01-01 01:00:00.000000000 +0100
9731 +++ linux-2.6.29-rc3.owrt/arch/m68k/include/asm/param_no.h 2009-05-10 23:48:28.000000000 +0200
9732 @@ -0,0 +1,22 @@
9733 +#ifndef _M68KNOMMU_PARAM_H
9734 +#define _M68KNOMMU_PARAM_H
9735 +
9736 +#ifdef __KERNEL__
9737 +#define HZ CONFIG_HZ
9738 +#define USER_HZ HZ
9739 +#define CLOCKS_PER_SEC (USER_HZ)
9740 +#endif
9741 +
9742 +#ifndef HZ
9743 +#define HZ 100
9744 +#endif
9745 +
9746 +#define EXEC_PAGESIZE 4096
9747 +
9748 +#ifndef NOGROUP
9749 +#define NOGROUP (-1)
9750 +#endif
9751 +
9752 +#define MAXHOSTNAMELEN 64 /* max length of hostname */
9753 +
9754 +#endif /* _M68KNOMMU_PARAM_H */
9755 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/m68k/include/asm/ptrace.h linux-2.6.29-rc3.owrt/arch/m68k/include/asm/ptrace.h
9756 --- linux-2.6.29.owrt/arch/m68k/include/asm/ptrace.h 2009-05-10 22:04:40.000000000 +0200
9757 +++ linux-2.6.29-rc3.owrt/arch/m68k/include/asm/ptrace.h 2009-05-10 23:48:28.000000000 +0200
9758 @@ -1,87 +1,5 @@
9759 -#ifndef _M68K_PTRACE_H
9760 -#define _M68K_PTRACE_H
9761 -
9762 -#define PT_D1 0
9763 -#define PT_D2 1
9764 -#define PT_D3 2
9765 -#define PT_D4 3
9766 -#define PT_D5 4
9767 -#define PT_D6 5
9768 -#define PT_D7 6
9769 -#define PT_A0 7
9770 -#define PT_A1 8
9771 -#define PT_A2 9
9772 -#define PT_A3 10
9773 -#define PT_A4 11
9774 -#define PT_A5 12
9775 -#define PT_A6 13
9776 -#define PT_D0 14
9777 -#define PT_USP 15
9778 -#define PT_ORIG_D0 16
9779 -#define PT_SR 17
9780 -#define PT_PC 18
9781 -
9782 -#ifndef __ASSEMBLY__
9783 -
9784 -/* this struct defines the way the registers are stored on the
9785 - stack during a system call. */
9786 -
9787 -struct pt_regs {
9788 - long d1;
9789 - long d2;
9790 - long d3;
9791 - long d4;
9792 - long d5;
9793 - long a0;
9794 - long a1;
9795 - long a2;
9796 - long d0;
9797 - long orig_d0;
9798 - long stkadj;
9799 -#ifdef CONFIG_COLDFIRE
9800 - unsigned format : 4; /* frame format specifier */
9801 - unsigned vector : 12; /* vector offset */
9802 - unsigned short sr;
9803 - unsigned long pc;
9804 +#ifdef __uClinux__
9805 +#include "ptrace_no.h"
9806 #else
9807 - unsigned short sr;
9808 - unsigned long pc;
9809 - unsigned format : 4; /* frame format specifier */
9810 - unsigned vector : 12; /* vector offset */
9811 +#include "ptrace_mm.h"
9812 #endif
9813 -};
9814 -
9815 -/*
9816 - * This is the extended stack used by signal handlers and the context
9817 - * switcher: it's pushed after the normal "struct pt_regs".
9818 - */
9819 -struct switch_stack {
9820 - unsigned long d6;
9821 - unsigned long d7;
9822 - unsigned long a3;
9823 - unsigned long a4;
9824 - unsigned long a5;
9825 - unsigned long a6;
9826 - unsigned long retpc;
9827 -};
9828 -
9829 -/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
9830 -#define PTRACE_GETREGS 12
9831 -#define PTRACE_SETREGS 13
9832 -#define PTRACE_GETFPREGS 14
9833 -#define PTRACE_SETFPREGS 15
9834 -
9835 -#ifdef __KERNEL__
9836 -
9837 -#ifndef PS_S
9838 -#define PS_S (0x2000)
9839 -#define PS_M (0x1000)
9840 -#endif
9841 -
9842 -#define user_mode(regs) (!((regs)->sr & PS_S))
9843 -#define instruction_pointer(regs) ((regs)->pc)
9844 -#define profile_pc(regs) instruction_pointer(regs)
9845 -extern void show_regs(struct pt_regs *);
9846 -#endif /* __KERNEL__ */
9847 -#endif /* __ASSEMBLY__ */
9848 -#endif /* _M68K_PTRACE_H */
9849 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/m68k/include/asm/ptrace_mm.h linux-2.6.29-rc3.owrt/arch/m68k/include/asm/ptrace_mm.h
9850 --- linux-2.6.29.owrt/arch/m68k/include/asm/ptrace_mm.h 1970-01-01 01:00:00.000000000 +0100
9851 +++ linux-2.6.29-rc3.owrt/arch/m68k/include/asm/ptrace_mm.h 2009-05-10 23:48:28.000000000 +0200
9852 @@ -0,0 +1,80 @@
9853 +#ifndef _M68K_PTRACE_H
9854 +#define _M68K_PTRACE_H
9855 +
9856 +#define PT_D1 0
9857 +#define PT_D2 1
9858 +#define PT_D3 2
9859 +#define PT_D4 3
9860 +#define PT_D5 4
9861 +#define PT_D6 5
9862 +#define PT_D7 6
9863 +#define PT_A0 7
9864 +#define PT_A1 8
9865 +#define PT_A2 9
9866 +#define PT_A3 10
9867 +#define PT_A4 11
9868 +#define PT_A5 12
9869 +#define PT_A6 13
9870 +#define PT_D0 14
9871 +#define PT_USP 15
9872 +#define PT_ORIG_D0 16
9873 +#define PT_SR 17
9874 +#define PT_PC 18
9875 +
9876 +#ifndef __ASSEMBLY__
9877 +
9878 +/* this struct defines the way the registers are stored on the
9879 + stack during a system call. */
9880 +
9881 +struct pt_regs {
9882 + long d1;
9883 + long d2;
9884 + long d3;
9885 + long d4;
9886 + long d5;
9887 + long a0;
9888 + long a1;
9889 + long a2;
9890 + long d0;
9891 + long orig_d0;
9892 + long stkadj;
9893 + unsigned short sr;
9894 + unsigned long pc;
9895 + unsigned format : 4; /* frame format specifier */
9896 + unsigned vector : 12; /* vector offset */
9897 +};
9898 +
9899 +/*
9900 + * This is the extended stack used by signal handlers and the context
9901 + * switcher: it's pushed after the normal "struct pt_regs".
9902 + */
9903 +struct switch_stack {
9904 + unsigned long d6;
9905 + unsigned long d7;
9906 + unsigned long a3;
9907 + unsigned long a4;
9908 + unsigned long a5;
9909 + unsigned long a6;
9910 + unsigned long retpc;
9911 +};
9912 +
9913 +/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
9914 +#define PTRACE_GETREGS 12
9915 +#define PTRACE_SETREGS 13
9916 +#define PTRACE_GETFPREGS 14
9917 +#define PTRACE_SETFPREGS 15
9918 +
9919 +#ifdef __KERNEL__
9920 +
9921 +#ifndef PS_S
9922 +#define PS_S (0x2000)
9923 +#define PS_M (0x1000)
9924 +#endif
9925 +
9926 +#define user_mode(regs) (!((regs)->sr & PS_S))
9927 +#define instruction_pointer(regs) ((regs)->pc)
9928 +#define profile_pc(regs) instruction_pointer(regs)
9929 +extern void show_regs(struct pt_regs *);
9930 +#endif /* __KERNEL__ */
9931 +#endif /* __ASSEMBLY__ */
9932 +#endif /* _M68K_PTRACE_H */
9933 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/m68k/include/asm/ptrace_no.h linux-2.6.29-rc3.owrt/arch/m68k/include/asm/ptrace_no.h
9934 --- linux-2.6.29.owrt/arch/m68k/include/asm/ptrace_no.h 1970-01-01 01:00:00.000000000 +0100
9935 +++ linux-2.6.29-rc3.owrt/arch/m68k/include/asm/ptrace_no.h 2009-05-10 23:48:28.000000000 +0200
9936 @@ -0,0 +1,87 @@
9937 +#ifndef _M68K_PTRACE_H
9938 +#define _M68K_PTRACE_H
9939 +
9940 +#define PT_D1 0
9941 +#define PT_D2 1
9942 +#define PT_D3 2
9943 +#define PT_D4 3
9944 +#define PT_D5 4
9945 +#define PT_D6 5
9946 +#define PT_D7 6
9947 +#define PT_A0 7
9948 +#define PT_A1 8
9949 +#define PT_A2 9
9950 +#define PT_A3 10
9951 +#define PT_A4 11
9952 +#define PT_A5 12
9953 +#define PT_A6 13
9954 +#define PT_D0 14
9955 +#define PT_USP 15
9956 +#define PT_ORIG_D0 16
9957 +#define PT_SR 17
9958 +#define PT_PC 18
9959 +
9960 +#ifndef __ASSEMBLY__
9961 +
9962 +/* this struct defines the way the registers are stored on the
9963 + stack during a system call. */
9964 +
9965 +struct pt_regs {
9966 + long d1;
9967 + long d2;
9968 + long d3;
9969 + long d4;
9970 + long d5;
9971 + long a0;
9972 + long a1;
9973 + long a2;
9974 + long d0;
9975 + long orig_d0;
9976 + long stkadj;
9977 +#ifdef CONFIG_COLDFIRE
9978 + unsigned format : 4; /* frame format specifier */
9979 + unsigned vector : 12; /* vector offset */
9980 + unsigned short sr;
9981 + unsigned long pc;
9982 +#else
9983 + unsigned short sr;
9984 + unsigned long pc;
9985 + unsigned format : 4; /* frame format specifier */
9986 + unsigned vector : 12; /* vector offset */
9987 +#endif
9988 +};
9989 +
9990 +/*
9991 + * This is the extended stack used by signal handlers and the context
9992 + * switcher: it's pushed after the normal "struct pt_regs".
9993 + */
9994 +struct switch_stack {
9995 + unsigned long d6;
9996 + unsigned long d7;
9997 + unsigned long a3;
9998 + unsigned long a4;
9999 + unsigned long a5;
10000 + unsigned long a6;
10001 + unsigned long retpc;
10002 +};
10003 +
10004 +/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
10005 +#define PTRACE_GETREGS 12
10006 +#define PTRACE_SETREGS 13
10007 +#define PTRACE_GETFPREGS 14
10008 +#define PTRACE_SETFPREGS 15
10009 +
10010 +#ifdef __KERNEL__
10011 +
10012 +#ifndef PS_S
10013 +#define PS_S (0x2000)
10014 +#define PS_M (0x1000)
10015 +#endif
10016 +
10017 +#define user_mode(regs) (!((regs)->sr & PS_S))
10018 +#define instruction_pointer(regs) ((regs)->pc)
10019 +#define profile_pc(regs) instruction_pointer(regs)
10020 +extern void show_regs(struct pt_regs *);
10021 +#endif /* __KERNEL__ */
10022 +#endif /* __ASSEMBLY__ */
10023 +#endif /* _M68K_PTRACE_H */
10024 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/m68k/include/asm/setup.h linux-2.6.29-rc3.owrt/arch/m68k/include/asm/setup.h
10025 --- linux-2.6.29.owrt/arch/m68k/include/asm/setup.h 2009-05-10 22:04:40.000000000 +0200
10026 +++ linux-2.6.29-rc3.owrt/arch/m68k/include/asm/setup.h 2009-05-10 23:48:28.000000000 +0200
10027 @@ -1,376 +1,5 @@
10028 -/*
10029 -** asm/setup.h -- Definition of the Linux/m68k setup information
10030 -**
10031 -** Copyright 1992 by Greg Harp
10032 -**
10033 -** This file is subject to the terms and conditions of the GNU General Public
10034 -** License. See the file COPYING in the main directory of this archive
10035 -** for more details.
10036 -**
10037 -** Created 09/29/92 by Greg Harp
10038 -**
10039 -** 5/2/94 Roman Hodek:
10040 -** Added bi_atari part of the machine dependent union bi_un; for now it
10041 -** contains just a model field to distinguish between TT and Falcon.
10042 -** 26/7/96 Roman Zippel:
10043 -** Renamed to setup.h; added some useful macros to allow gcc some
10044 -** optimizations if possible.
10045 -** 5/10/96 Geert Uytterhoeven:
10046 -** Redesign of the boot information structure; moved boot information
10047 -** structure to bootinfo.h
10048 -*/
10049 -
10050 -#ifndef _M68K_SETUP_H
10051 -#define _M68K_SETUP_H
10052 -
10053 -
10054 -
10055 - /*
10056 - * Linux/m68k Architectures
10057 - */
10058 -
10059 -#define MACH_AMIGA 1
10060 -#define MACH_ATARI 2
10061 -#define MACH_MAC 3
10062 -#define MACH_APOLLO 4
10063 -#define MACH_SUN3 5
10064 -#define MACH_MVME147 6
10065 -#define MACH_MVME16x 7
10066 -#define MACH_BVME6000 8
10067 -#define MACH_HP300 9
10068 -#define MACH_Q40 10
10069 -#define MACH_SUN3X 11
10070 -
10071 -#define COMMAND_LINE_SIZE 256
10072 -
10073 -#ifdef __KERNEL__
10074 -
10075 -#define CL_SIZE COMMAND_LINE_SIZE
10076 -
10077 -#ifndef __ASSEMBLY__
10078 -extern unsigned long m68k_machtype;
10079 -#endif /* !__ASSEMBLY__ */
10080 -
10081 -#if !defined(CONFIG_AMIGA)
10082 -# define MACH_IS_AMIGA (0)
10083 -#elif defined(CONFIG_ATARI) || defined(CONFIG_MAC) || defined(CONFIG_APOLLO) \
10084 - || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) \
10085 - || defined(CONFIG_HP300) || defined(CONFIG_Q40) \
10086 - || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
10087 -# define MACH_IS_AMIGA (m68k_machtype == MACH_AMIGA)
10088 +#ifdef __uClinux__
10089 +#include "setup_no.h"
10090 #else
10091 -# define MACH_AMIGA_ONLY
10092 -# define MACH_IS_AMIGA (1)
10093 -# define MACH_TYPE (MACH_AMIGA)
10094 +#include "setup_mm.h"
10095 #endif
10096 -
10097 -#if !defined(CONFIG_ATARI)
10098 -# define MACH_IS_ATARI (0)
10099 -#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_APOLLO) \
10100 - || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) \
10101 - || defined(CONFIG_HP300) || defined(CONFIG_Q40) \
10102 - || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
10103 -# define MACH_IS_ATARI (m68k_machtype == MACH_ATARI)
10104 -#else
10105 -# define MACH_ATARI_ONLY
10106 -# define MACH_IS_ATARI (1)
10107 -# define MACH_TYPE (MACH_ATARI)
10108 -#endif
10109 -
10110 -#if !defined(CONFIG_MAC)
10111 -# define MACH_IS_MAC (0)
10112 -#elif defined(CONFIG_AMIGA) || defined(CONFIG_ATARI) || defined(CONFIG_APOLLO) \
10113 - || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) \
10114 - || defined(CONFIG_HP300) || defined(CONFIG_Q40) \
10115 - || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
10116 -# define MACH_IS_MAC (m68k_machtype == MACH_MAC)
10117 -#else
10118 -# define MACH_MAC_ONLY
10119 -# define MACH_IS_MAC (1)
10120 -# define MACH_TYPE (MACH_MAC)
10121 -#endif
10122 -
10123 -#if defined(CONFIG_SUN3)
10124 -#define MACH_IS_SUN3 (1)
10125 -#define MACH_SUN3_ONLY (1)
10126 -#define MACH_TYPE (MACH_SUN3)
10127 -#else
10128 -#define MACH_IS_SUN3 (0)
10129 -#endif
10130 -
10131 -#if !defined (CONFIG_APOLLO)
10132 -# define MACH_IS_APOLLO (0)
10133 -#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
10134 - || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) \
10135 - || defined(CONFIG_HP300) || defined(CONFIG_Q40) \
10136 - || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
10137 -# define MACH_IS_APOLLO (m68k_machtype == MACH_APOLLO)
10138 -#else
10139 -# define MACH_APOLLO_ONLY
10140 -# define MACH_IS_APOLLO (1)
10141 -# define MACH_TYPE (MACH_APOLLO)
10142 -#endif
10143 -
10144 -#if !defined (CONFIG_MVME147)
10145 -# define MACH_IS_MVME147 (0)
10146 -#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
10147 - || defined(CONFIG_APOLLO) || defined(CONFIG_BVME6000) \
10148 - || defined(CONFIG_HP300) || defined(CONFIG_Q40) \
10149 - || defined(CONFIG_SUN3X) || defined(CONFIG_MVME16x)
10150 -# define MACH_IS_MVME147 (m68k_machtype == MACH_MVME147)
10151 -#else
10152 -# define MACH_MVME147_ONLY
10153 -# define MACH_IS_MVME147 (1)
10154 -# define MACH_TYPE (MACH_MVME147)
10155 -#endif
10156 -
10157 -#if !defined (CONFIG_MVME16x)
10158 -# define MACH_IS_MVME16x (0)
10159 -#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
10160 - || defined(CONFIG_APOLLO) || defined(CONFIG_BVME6000) \
10161 - || defined(CONFIG_HP300) || defined(CONFIG_Q40) \
10162 - || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
10163 -# define MACH_IS_MVME16x (m68k_machtype == MACH_MVME16x)
10164 -#else
10165 -# define MACH_MVME16x_ONLY
10166 -# define MACH_IS_MVME16x (1)
10167 -# define MACH_TYPE (MACH_MVME16x)
10168 -#endif
10169 -
10170 -#if !defined (CONFIG_BVME6000)
10171 -# define MACH_IS_BVME6000 (0)
10172 -#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
10173 - || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) \
10174 - || defined(CONFIG_HP300) || defined(CONFIG_Q40) \
10175 - || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
10176 -# define MACH_IS_BVME6000 (m68k_machtype == MACH_BVME6000)
10177 -#else
10178 -# define MACH_BVME6000_ONLY
10179 -# define MACH_IS_BVME6000 (1)
10180 -# define MACH_TYPE (MACH_BVME6000)
10181 -#endif
10182 -
10183 -#if !defined (CONFIG_HP300)
10184 -# define MACH_IS_HP300 (0)
10185 -#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
10186 - || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) \
10187 - || defined(CONFIG_BVME6000) || defined(CONFIG_Q40) \
10188 - || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
10189 -# define MACH_IS_HP300 (m68k_machtype == MACH_HP300)
10190 -#else
10191 -# define MACH_HP300_ONLY
10192 -# define MACH_IS_HP300 (1)
10193 -# define MACH_TYPE (MACH_HP300)
10194 -#endif
10195 -
10196 -#if !defined (CONFIG_Q40)
10197 -# define MACH_IS_Q40 (0)
10198 -#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
10199 - || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) \
10200 - || defined(CONFIG_BVME6000) || defined(CONFIG_HP300) \
10201 - || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
10202 -# define MACH_IS_Q40 (m68k_machtype == MACH_Q40)
10203 -#else
10204 -# define MACH_Q40_ONLY
10205 -# define MACH_IS_Q40 (1)
10206 -# define MACH_TYPE (MACH_Q40)
10207 -#endif
10208 -
10209 -#if !defined (CONFIG_SUN3X)
10210 -# define MACH_IS_SUN3X (0)
10211 -#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
10212 - || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) \
10213 - || defined(CONFIG_BVME6000) || defined(CONFIG_HP300) \
10214 - || defined(CONFIG_Q40) || defined(CONFIG_MVME147)
10215 -# define MACH_IS_SUN3X (m68k_machtype == MACH_SUN3X)
10216 -#else
10217 -# define CONFIG_SUN3X_ONLY
10218 -# define MACH_IS_SUN3X (1)
10219 -# define MACH_TYPE (MACH_SUN3X)
10220 -#endif
10221 -
10222 -#ifndef MACH_TYPE
10223 -# define MACH_TYPE (m68k_machtype)
10224 -#endif
10225 -
10226 -#endif /* __KERNEL__ */
10227 -
10228 -
10229 - /*
10230 - * CPU, FPU and MMU types
10231 - *
10232 - * Note: we may rely on the following equalities:
10233 - *
10234 - * CPU_68020 == MMU_68851
10235 - * CPU_68030 == MMU_68030
10236 - * CPU_68040 == FPU_68040 == MMU_68040
10237 - * CPU_68060 == FPU_68060 == MMU_68060
10238 - */
10239 -
10240 -#define CPUB_68020 0
10241 -#define CPUB_68030 1
10242 -#define CPUB_68040 2
10243 -#define CPUB_68060 3
10244 -
10245 -#define CPU_68020 (1<<CPUB_68020)
10246 -#define CPU_68030 (1<<CPUB_68030)
10247 -#define CPU_68040 (1<<CPUB_68040)
10248 -#define CPU_68060 (1<<CPUB_68060)
10249 -
10250 -#define FPUB_68881 0
10251 -#define FPUB_68882 1
10252 -#define FPUB_68040 2 /* Internal FPU */
10253 -#define FPUB_68060 3 /* Internal FPU */
10254 -#define FPUB_SUNFPA 4 /* Sun-3 FPA */
10255 -
10256 -#define FPU_68881 (1<<FPUB_68881)
10257 -#define FPU_68882 (1<<FPUB_68882)
10258 -#define FPU_68040 (1<<FPUB_68040)
10259 -#define FPU_68060 (1<<FPUB_68060)
10260 -#define FPU_SUNFPA (1<<FPUB_SUNFPA)
10261 -
10262 -#define MMUB_68851 0
10263 -#define MMUB_68030 1 /* Internal MMU */
10264 -#define MMUB_68040 2 /* Internal MMU */
10265 -#define MMUB_68060 3 /* Internal MMU */
10266 -#define MMUB_APOLLO 4 /* Custom Apollo */
10267 -#define MMUB_SUN3 5 /* Custom Sun-3 */
10268 -
10269 -#define MMU_68851 (1<<MMUB_68851)
10270 -#define MMU_68030 (1<<MMUB_68030)
10271 -#define MMU_68040 (1<<MMUB_68040)
10272 -#define MMU_68060 (1<<MMUB_68060)
10273 -#define MMU_SUN3 (1<<MMUB_SUN3)
10274 -#define MMU_APOLLO (1<<MMUB_APOLLO)
10275 -
10276 -#ifdef __KERNEL__
10277 -
10278 -#ifndef __ASSEMBLY__
10279 -extern unsigned long m68k_cputype;
10280 -extern unsigned long m68k_fputype;
10281 -extern unsigned long m68k_mmutype;
10282 -#ifdef CONFIG_VME
10283 -extern unsigned long vme_brdtype;
10284 -#endif
10285 -
10286 - /*
10287 - * m68k_is040or060 is != 0 for a '040 or higher;
10288 - * used numbers are 4 for 68040 and 6 for 68060.
10289 - */
10290 -
10291 -extern int m68k_is040or060;
10292 -#endif /* !__ASSEMBLY__ */
10293 -
10294 -#if !defined(CONFIG_M68020)
10295 -# define CPU_IS_020 (0)
10296 -# define MMU_IS_851 (0)
10297 -# define MMU_IS_SUN3 (0)
10298 -#elif defined(CONFIG_M68030) || defined(CONFIG_M68040) || defined(CONFIG_M68060)
10299 -# define CPU_IS_020 (m68k_cputype & CPU_68020)
10300 -# define MMU_IS_851 (m68k_mmutype & MMU_68851)
10301 -# define MMU_IS_SUN3 (0) /* Sun3 not supported with other CPU enabled */
10302 -#else
10303 -# define CPU_M68020_ONLY
10304 -# define CPU_IS_020 (1)
10305 -#ifdef MACH_SUN3_ONLY
10306 -# define MMU_IS_SUN3 (1)
10307 -# define MMU_IS_851 (0)
10308 -#else
10309 -# define MMU_IS_SUN3 (0)
10310 -# define MMU_IS_851 (1)
10311 -#endif
10312 -#endif
10313 -
10314 -#if !defined(CONFIG_M68030)
10315 -# define CPU_IS_030 (0)
10316 -# define MMU_IS_030 (0)
10317 -#elif defined(CONFIG_M68020) || defined(CONFIG_M68040) || defined(CONFIG_M68060)
10318 -# define CPU_IS_030 (m68k_cputype & CPU_68030)
10319 -# define MMU_IS_030 (m68k_mmutype & MMU_68030)
10320 -#else
10321 -# define CPU_M68030_ONLY
10322 -# define CPU_IS_030 (1)
10323 -# define MMU_IS_030 (1)
10324 -#endif
10325 -
10326 -#if !defined(CONFIG_M68040)
10327 -# define CPU_IS_040 (0)
10328 -# define MMU_IS_040 (0)
10329 -#elif defined(CONFIG_M68020) || defined(CONFIG_M68030) || defined(CONFIG_M68060)
10330 -# define CPU_IS_040 (m68k_cputype & CPU_68040)
10331 -# define MMU_IS_040 (m68k_mmutype & MMU_68040)
10332 -#else
10333 -# define CPU_M68040_ONLY
10334 -# define CPU_IS_040 (1)
10335 -# define MMU_IS_040 (1)
10336 -#endif
10337 -
10338 -#if !defined(CONFIG_M68060)
10339 -# define CPU_IS_060 (0)
10340 -# define MMU_IS_060 (0)
10341 -#elif defined(CONFIG_M68020) || defined(CONFIG_M68030) || defined(CONFIG_M68040)
10342 -# define CPU_IS_060 (m68k_cputype & CPU_68060)
10343 -# define MMU_IS_060 (m68k_mmutype & MMU_68060)
10344 -#else
10345 -# define CPU_M68060_ONLY
10346 -# define CPU_IS_060 (1)
10347 -# define MMU_IS_060 (1)
10348 -#endif
10349 -
10350 -#if !defined(CONFIG_M68020) && !defined(CONFIG_M68030)
10351 -# define CPU_IS_020_OR_030 (0)
10352 -#else
10353 -# define CPU_M68020_OR_M68030
10354 -# if defined(CONFIG_M68040) || defined(CONFIG_M68060)
10355 -# define CPU_IS_020_OR_030 (!m68k_is040or060)
10356 -# else
10357 -# define CPU_M68020_OR_M68030_ONLY
10358 -# define CPU_IS_020_OR_030 (1)
10359 -# endif
10360 -#endif
10361 -
10362 -#if !defined(CONFIG_M68040) && !defined(CONFIG_M68060)
10363 -# define CPU_IS_040_OR_060 (0)
10364 -#else
10365 -# define CPU_M68040_OR_M68060
10366 -# if defined(CONFIG_M68020) || defined(CONFIG_M68030)
10367 -# define CPU_IS_040_OR_060 (m68k_is040or060)
10368 -# else
10369 -# define CPU_M68040_OR_M68060_ONLY
10370 -# define CPU_IS_040_OR_060 (1)
10371 -# endif
10372 -#endif
10373 -
10374 -#define CPU_TYPE (m68k_cputype)
10375 -
10376 -#ifdef CONFIG_M68KFPU_EMU
10377 -# ifdef CONFIG_M68KFPU_EMU_ONLY
10378 -# define FPU_IS_EMU (1)
10379 -# else
10380 -# define FPU_IS_EMU (!m68k_fputype)
10381 -# endif
10382 -#else
10383 -# define FPU_IS_EMU (0)
10384 -#endif
10385 -
10386 -
10387 - /*
10388 - * Miscellaneous
10389 - */
10390 -
10391 -#define NUM_MEMINFO 4
10392 -
10393 -#ifndef __ASSEMBLY__
10394 -struct mem_info {
10395 - unsigned long addr; /* physical address of memory chunk */
10396 - unsigned long size; /* length of memory chunk (in bytes) */
10397 -};
10398 -
10399 -extern int m68k_num_memory; /* # of memory blocks found (and used) */
10400 -extern int m68k_realnum_memory; /* real # of memory blocks found */
10401 -extern struct mem_info m68k_memory[NUM_MEMINFO];/* memory description */
10402 -#endif
10403 -
10404 -#endif /* __KERNEL__ */
10405 -
10406 -#endif /* _M68K_SETUP_H */
10407 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/m68k/include/asm/setup_mm.h linux-2.6.29-rc3.owrt/arch/m68k/include/asm/setup_mm.h
10408 --- linux-2.6.29.owrt/arch/m68k/include/asm/setup_mm.h 1970-01-01 01:00:00.000000000 +0100
10409 +++ linux-2.6.29-rc3.owrt/arch/m68k/include/asm/setup_mm.h 2009-05-10 23:48:28.000000000 +0200
10410 @@ -0,0 +1,376 @@
10411 +/*
10412 +** asm/setup.h -- Definition of the Linux/m68k setup information
10413 +**
10414 +** Copyright 1992 by Greg Harp
10415 +**
10416 +** This file is subject to the terms and conditions of the GNU General Public
10417 +** License. See the file COPYING in the main directory of this archive
10418 +** for more details.
10419 +**
10420 +** Created 09/29/92 by Greg Harp
10421 +**
10422 +** 5/2/94 Roman Hodek:
10423 +** Added bi_atari part of the machine dependent union bi_un; for now it
10424 +** contains just a model field to distinguish between TT and Falcon.
10425 +** 26/7/96 Roman Zippel:
10426 +** Renamed to setup.h; added some useful macros to allow gcc some
10427 +** optimizations if possible.
10428 +** 5/10/96 Geert Uytterhoeven:
10429 +** Redesign of the boot information structure; moved boot information
10430 +** structure to bootinfo.h
10431 +*/
10432 +
10433 +#ifndef _M68K_SETUP_H
10434 +#define _M68K_SETUP_H
10435 +
10436 +
10437 +
10438 + /*
10439 + * Linux/m68k Architectures
10440 + */
10441 +
10442 +#define MACH_AMIGA 1
10443 +#define MACH_ATARI 2
10444 +#define MACH_MAC 3
10445 +#define MACH_APOLLO 4
10446 +#define MACH_SUN3 5
10447 +#define MACH_MVME147 6
10448 +#define MACH_MVME16x 7
10449 +#define MACH_BVME6000 8
10450 +#define MACH_HP300 9
10451 +#define MACH_Q40 10
10452 +#define MACH_SUN3X 11
10453 +
10454 +#define COMMAND_LINE_SIZE 256
10455 +
10456 +#ifdef __KERNEL__
10457 +
10458 +#define CL_SIZE COMMAND_LINE_SIZE
10459 +
10460 +#ifndef __ASSEMBLY__
10461 +extern unsigned long m68k_machtype;
10462 +#endif /* !__ASSEMBLY__ */
10463 +
10464 +#if !defined(CONFIG_AMIGA)
10465 +# define MACH_IS_AMIGA (0)
10466 +#elif defined(CONFIG_ATARI) || defined(CONFIG_MAC) || defined(CONFIG_APOLLO) \
10467 + || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) \
10468 + || defined(CONFIG_HP300) || defined(CONFIG_Q40) \
10469 + || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
10470 +# define MACH_IS_AMIGA (m68k_machtype == MACH_AMIGA)
10471 +#else
10472 +# define MACH_AMIGA_ONLY
10473 +# define MACH_IS_AMIGA (1)
10474 +# define MACH_TYPE (MACH_AMIGA)
10475 +#endif
10476 +
10477 +#if !defined(CONFIG_ATARI)
10478 +# define MACH_IS_ATARI (0)
10479 +#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_APOLLO) \
10480 + || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) \
10481 + || defined(CONFIG_HP300) || defined(CONFIG_Q40) \
10482 + || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
10483 +# define MACH_IS_ATARI (m68k_machtype == MACH_ATARI)
10484 +#else
10485 +# define MACH_ATARI_ONLY
10486 +# define MACH_IS_ATARI (1)
10487 +# define MACH_TYPE (MACH_ATARI)
10488 +#endif
10489 +
10490 +#if !defined(CONFIG_MAC)
10491 +# define MACH_IS_MAC (0)
10492 +#elif defined(CONFIG_AMIGA) || defined(CONFIG_ATARI) || defined(CONFIG_APOLLO) \
10493 + || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) \
10494 + || defined(CONFIG_HP300) || defined(CONFIG_Q40) \
10495 + || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
10496 +# define MACH_IS_MAC (m68k_machtype == MACH_MAC)
10497 +#else
10498 +# define MACH_MAC_ONLY
10499 +# define MACH_IS_MAC (1)
10500 +# define MACH_TYPE (MACH_MAC)
10501 +#endif
10502 +
10503 +#if defined(CONFIG_SUN3)
10504 +#define MACH_IS_SUN3 (1)
10505 +#define MACH_SUN3_ONLY (1)
10506 +#define MACH_TYPE (MACH_SUN3)
10507 +#else
10508 +#define MACH_IS_SUN3 (0)
10509 +#endif
10510 +
10511 +#if !defined (CONFIG_APOLLO)
10512 +# define MACH_IS_APOLLO (0)
10513 +#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
10514 + || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) \
10515 + || defined(CONFIG_HP300) || defined(CONFIG_Q40) \
10516 + || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
10517 +# define MACH_IS_APOLLO (m68k_machtype == MACH_APOLLO)
10518 +#else
10519 +# define MACH_APOLLO_ONLY
10520 +# define MACH_IS_APOLLO (1)
10521 +# define MACH_TYPE (MACH_APOLLO)
10522 +#endif
10523 +
10524 +#if !defined (CONFIG_MVME147)
10525 +# define MACH_IS_MVME147 (0)
10526 +#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
10527 + || defined(CONFIG_APOLLO) || defined(CONFIG_BVME6000) \
10528 + || defined(CONFIG_HP300) || defined(CONFIG_Q40) \
10529 + || defined(CONFIG_SUN3X) || defined(CONFIG_MVME16x)
10530 +# define MACH_IS_MVME147 (m68k_machtype == MACH_MVME147)
10531 +#else
10532 +# define MACH_MVME147_ONLY
10533 +# define MACH_IS_MVME147 (1)
10534 +# define MACH_TYPE (MACH_MVME147)
10535 +#endif
10536 +
10537 +#if !defined (CONFIG_MVME16x)
10538 +# define MACH_IS_MVME16x (0)
10539 +#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
10540 + || defined(CONFIG_APOLLO) || defined(CONFIG_BVME6000) \
10541 + || defined(CONFIG_HP300) || defined(CONFIG_Q40) \
10542 + || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
10543 +# define MACH_IS_MVME16x (m68k_machtype == MACH_MVME16x)
10544 +#else
10545 +# define MACH_MVME16x_ONLY
10546 +# define MACH_IS_MVME16x (1)
10547 +# define MACH_TYPE (MACH_MVME16x)
10548 +#endif
10549 +
10550 +#if !defined (CONFIG_BVME6000)
10551 +# define MACH_IS_BVME6000 (0)
10552 +#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
10553 + || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) \
10554 + || defined(CONFIG_HP300) || defined(CONFIG_Q40) \
10555 + || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
10556 +# define MACH_IS_BVME6000 (m68k_machtype == MACH_BVME6000)
10557 +#else
10558 +# define MACH_BVME6000_ONLY
10559 +# define MACH_IS_BVME6000 (1)
10560 +# define MACH_TYPE (MACH_BVME6000)
10561 +#endif
10562 +
10563 +#if !defined (CONFIG_HP300)
10564 +# define MACH_IS_HP300 (0)
10565 +#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
10566 + || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) \
10567 + || defined(CONFIG_BVME6000) || defined(CONFIG_Q40) \
10568 + || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
10569 +# define MACH_IS_HP300 (m68k_machtype == MACH_HP300)
10570 +#else
10571 +# define MACH_HP300_ONLY
10572 +# define MACH_IS_HP300 (1)
10573 +# define MACH_TYPE (MACH_HP300)
10574 +#endif
10575 +
10576 +#if !defined (CONFIG_Q40)
10577 +# define MACH_IS_Q40 (0)
10578 +#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
10579 + || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) \
10580 + || defined(CONFIG_BVME6000) || defined(CONFIG_HP300) \
10581 + || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
10582 +# define MACH_IS_Q40 (m68k_machtype == MACH_Q40)
10583 +#else
10584 +# define MACH_Q40_ONLY
10585 +# define MACH_IS_Q40 (1)
10586 +# define MACH_TYPE (MACH_Q40)
10587 +#endif
10588 +
10589 +#if !defined (CONFIG_SUN3X)
10590 +# define MACH_IS_SUN3X (0)
10591 +#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
10592 + || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) \
10593 + || defined(CONFIG_BVME6000) || defined(CONFIG_HP300) \
10594 + || defined(CONFIG_Q40) || defined(CONFIG_MVME147)
10595 +# define MACH_IS_SUN3X (m68k_machtype == MACH_SUN3X)
10596 +#else
10597 +# define CONFIG_SUN3X_ONLY
10598 +# define MACH_IS_SUN3X (1)
10599 +# define MACH_TYPE (MACH_SUN3X)
10600 +#endif
10601 +
10602 +#ifndef MACH_TYPE
10603 +# define MACH_TYPE (m68k_machtype)
10604 +#endif
10605 +
10606 +#endif /* __KERNEL__ */
10607 +
10608 +
10609 + /*
10610 + * CPU, FPU and MMU types
10611 + *
10612 + * Note: we may rely on the following equalities:
10613 + *
10614 + * CPU_68020 == MMU_68851
10615 + * CPU_68030 == MMU_68030
10616 + * CPU_68040 == FPU_68040 == MMU_68040
10617 + * CPU_68060 == FPU_68060 == MMU_68060
10618 + */
10619 +
10620 +#define CPUB_68020 0
10621 +#define CPUB_68030 1
10622 +#define CPUB_68040 2
10623 +#define CPUB_68060 3
10624 +
10625 +#define CPU_68020 (1<<CPUB_68020)
10626 +#define CPU_68030 (1<<CPUB_68030)
10627 +#define CPU_68040 (1<<CPUB_68040)
10628 +#define CPU_68060 (1<<CPUB_68060)
10629 +
10630 +#define FPUB_68881 0
10631 +#define FPUB_68882 1
10632 +#define FPUB_68040 2 /* Internal FPU */
10633 +#define FPUB_68060 3 /* Internal FPU */
10634 +#define FPUB_SUNFPA 4 /* Sun-3 FPA */
10635 +
10636 +#define FPU_68881 (1<<FPUB_68881)
10637 +#define FPU_68882 (1<<FPUB_68882)
10638 +#define FPU_68040 (1<<FPUB_68040)
10639 +#define FPU_68060 (1<<FPUB_68060)
10640 +#define FPU_SUNFPA (1<<FPUB_SUNFPA)
10641 +
10642 +#define MMUB_68851 0
10643 +#define MMUB_68030 1 /* Internal MMU */
10644 +#define MMUB_68040 2 /* Internal MMU */
10645 +#define MMUB_68060 3 /* Internal MMU */
10646 +#define MMUB_APOLLO 4 /* Custom Apollo */
10647 +#define MMUB_SUN3 5 /* Custom Sun-3 */
10648 +
10649 +#define MMU_68851 (1<<MMUB_68851)
10650 +#define MMU_68030 (1<<MMUB_68030)
10651 +#define MMU_68040 (1<<MMUB_68040)
10652 +#define MMU_68060 (1<<MMUB_68060)
10653 +#define MMU_SUN3 (1<<MMUB_SUN3)
10654 +#define MMU_APOLLO (1<<MMUB_APOLLO)
10655 +
10656 +#ifdef __KERNEL__
10657 +
10658 +#ifndef __ASSEMBLY__
10659 +extern unsigned long m68k_cputype;
10660 +extern unsigned long m68k_fputype;
10661 +extern unsigned long m68k_mmutype;
10662 +#ifdef CONFIG_VME
10663 +extern unsigned long vme_brdtype;
10664 +#endif
10665 +
10666 + /*
10667 + * m68k_is040or060 is != 0 for a '040 or higher;
10668 + * used numbers are 4 for 68040 and 6 for 68060.
10669 + */
10670 +
10671 +extern int m68k_is040or060;
10672 +#endif /* !__ASSEMBLY__ */
10673 +
10674 +#if !defined(CONFIG_M68020)
10675 +# define CPU_IS_020 (0)
10676 +# define MMU_IS_851 (0)
10677 +# define MMU_IS_SUN3 (0)
10678 +#elif defined(CONFIG_M68030) || defined(CONFIG_M68040) || defined(CONFIG_M68060)
10679 +# define CPU_IS_020 (m68k_cputype & CPU_68020)
10680 +# define MMU_IS_851 (m68k_mmutype & MMU_68851)
10681 +# define MMU_IS_SUN3 (0) /* Sun3 not supported with other CPU enabled */
10682 +#else
10683 +# define CPU_M68020_ONLY
10684 +# define CPU_IS_020 (1)
10685 +#ifdef MACH_SUN3_ONLY
10686 +# define MMU_IS_SUN3 (1)
10687 +# define MMU_IS_851 (0)
10688 +#else
10689 +# define MMU_IS_SUN3 (0)
10690 +# define MMU_IS_851 (1)
10691 +#endif
10692 +#endif
10693 +
10694 +#if !defined(CONFIG_M68030)
10695 +# define CPU_IS_030 (0)
10696 +# define MMU_IS_030 (0)
10697 +#elif defined(CONFIG_M68020) || defined(CONFIG_M68040) || defined(CONFIG_M68060)
10698 +# define CPU_IS_030 (m68k_cputype & CPU_68030)
10699 +# define MMU_IS_030 (m68k_mmutype & MMU_68030)
10700 +#else
10701 +# define CPU_M68030_ONLY
10702 +# define CPU_IS_030 (1)
10703 +# define MMU_IS_030 (1)
10704 +#endif
10705 +
10706 +#if !defined(CONFIG_M68040)
10707 +# define CPU_IS_040 (0)
10708 +# define MMU_IS_040 (0)
10709 +#elif defined(CONFIG_M68020) || defined(CONFIG_M68030) || defined(CONFIG_M68060)
10710 +# define CPU_IS_040 (m68k_cputype & CPU_68040)
10711 +# define MMU_IS_040 (m68k_mmutype & MMU_68040)
10712 +#else
10713 +# define CPU_M68040_ONLY
10714 +# define CPU_IS_040 (1)
10715 +# define MMU_IS_040 (1)
10716 +#endif
10717 +
10718 +#if !defined(CONFIG_M68060)
10719 +# define CPU_IS_060 (0)
10720 +# define MMU_IS_060 (0)
10721 +#elif defined(CONFIG_M68020) || defined(CONFIG_M68030) || defined(CONFIG_M68040)
10722 +# define CPU_IS_060 (m68k_cputype & CPU_68060)
10723 +# define MMU_IS_060 (m68k_mmutype & MMU_68060)
10724 +#else
10725 +# define CPU_M68060_ONLY
10726 +# define CPU_IS_060 (1)
10727 +# define MMU_IS_060 (1)
10728 +#endif
10729 +
10730 +#if !defined(CONFIG_M68020) && !defined(CONFIG_M68030)
10731 +# define CPU_IS_020_OR_030 (0)
10732 +#else
10733 +# define CPU_M68020_OR_M68030
10734 +# if defined(CONFIG_M68040) || defined(CONFIG_M68060)
10735 +# define CPU_IS_020_OR_030 (!m68k_is040or060)
10736 +# else
10737 +# define CPU_M68020_OR_M68030_ONLY
10738 +# define CPU_IS_020_OR_030 (1)
10739 +# endif
10740 +#endif
10741 +
10742 +#if !defined(CONFIG_M68040) && !defined(CONFIG_M68060)
10743 +# define CPU_IS_040_OR_060 (0)
10744 +#else
10745 +# define CPU_M68040_OR_M68060
10746 +# if defined(CONFIG_M68020) || defined(CONFIG_M68030)
10747 +# define CPU_IS_040_OR_060 (m68k_is040or060)
10748 +# else
10749 +# define CPU_M68040_OR_M68060_ONLY
10750 +# define CPU_IS_040_OR_060 (1)
10751 +# endif
10752 +#endif
10753 +
10754 +#define CPU_TYPE (m68k_cputype)
10755 +
10756 +#ifdef CONFIG_M68KFPU_EMU
10757 +# ifdef CONFIG_M68KFPU_EMU_ONLY
10758 +# define FPU_IS_EMU (1)
10759 +# else
10760 +# define FPU_IS_EMU (!m68k_fputype)
10761 +# endif
10762 +#else
10763 +# define FPU_IS_EMU (0)
10764 +#endif
10765 +
10766 +
10767 + /*
10768 + * Miscellaneous
10769 + */
10770 +
10771 +#define NUM_MEMINFO 4
10772 +
10773 +#ifndef __ASSEMBLY__
10774 +struct mem_info {
10775 + unsigned long addr; /* physical address of memory chunk */
10776 + unsigned long size; /* length of memory chunk (in bytes) */
10777 +};
10778 +
10779 +extern int m68k_num_memory; /* # of memory blocks found (and used) */
10780 +extern int m68k_realnum_memory; /* real # of memory blocks found */
10781 +extern struct mem_info m68k_memory[NUM_MEMINFO];/* memory description */
10782 +#endif
10783 +
10784 +#endif /* __KERNEL__ */
10785 +
10786 +#endif /* _M68K_SETUP_H */
10787 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/m68k/include/asm/setup_no.h linux-2.6.29-rc3.owrt/arch/m68k/include/asm/setup_no.h
10788 --- linux-2.6.29.owrt/arch/m68k/include/asm/setup_no.h 1970-01-01 01:00:00.000000000 +0100
10789 +++ linux-2.6.29-rc3.owrt/arch/m68k/include/asm/setup_no.h 2009-05-10 23:48:28.000000000 +0200
10790 @@ -0,0 +1,10 @@
10791 +#ifdef __KERNEL__
10792 +
10793 +#include <asm/setup_mm.h>
10794 +
10795 +/* We have a bigger command line buffer. */
10796 +#undef COMMAND_LINE_SIZE
10797 +
10798 +#endif /* __KERNEL__ */
10799 +
10800 +#define COMMAND_LINE_SIZE 512
10801 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/m68k/include/asm/sigcontext.h linux-2.6.29-rc3.owrt/arch/m68k/include/asm/sigcontext.h
10802 --- linux-2.6.29.owrt/arch/m68k/include/asm/sigcontext.h 2009-05-10 22:04:40.000000000 +0200
10803 +++ linux-2.6.29-rc3.owrt/arch/m68k/include/asm/sigcontext.h 2009-05-10 23:48:28.000000000 +0200
10804 @@ -1,24 +1,5 @@
10805 -#ifndef _ASM_M68k_SIGCONTEXT_H
10806 -#define _ASM_M68k_SIGCONTEXT_H
10807 -
10808 -struct sigcontext {
10809 - unsigned long sc_mask; /* old sigmask */
10810 - unsigned long sc_usp; /* old user stack pointer */
10811 - unsigned long sc_d0;
10812 - unsigned long sc_d1;
10813 - unsigned long sc_a0;
10814 - unsigned long sc_a1;
10815 #ifdef __uClinux__
10816 - unsigned long sc_a5;
10817 -#endif
10818 - unsigned short sc_sr;
10819 - unsigned long sc_pc;
10820 - unsigned short sc_formatvec;
10821 -#ifndef __uClinux__
10822 - unsigned long sc_fpregs[2*3]; /* room for two fp registers */
10823 - unsigned long sc_fpcntl[3];
10824 - unsigned char sc_fpstate[216];
10825 -#endif
10826 -};
10827 -
10828 +#include "sigcontext_no.h"
10829 +#else
10830 +#include "sigcontext_mm.h"
10831 #endif
10832 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/m68k/include/asm/sigcontext_mm.h linux-2.6.29-rc3.owrt/arch/m68k/include/asm/sigcontext_mm.h
10833 --- linux-2.6.29.owrt/arch/m68k/include/asm/sigcontext_mm.h 1970-01-01 01:00:00.000000000 +0100
10834 +++ linux-2.6.29-rc3.owrt/arch/m68k/include/asm/sigcontext_mm.h 2009-05-10 23:48:28.000000000 +0200
10835 @@ -0,0 +1,19 @@
10836 +#ifndef _ASM_M68k_SIGCONTEXT_H
10837 +#define _ASM_M68k_SIGCONTEXT_H
10838 +
10839 +struct sigcontext {
10840 + unsigned long sc_mask; /* old sigmask */
10841 + unsigned long sc_usp; /* old user stack pointer */
10842 + unsigned long sc_d0;
10843 + unsigned long sc_d1;
10844 + unsigned long sc_a0;
10845 + unsigned long sc_a1;
10846 + unsigned short sc_sr;
10847 + unsigned long sc_pc;
10848 + unsigned short sc_formatvec;
10849 + unsigned long sc_fpregs[2*3]; /* room for two fp registers */
10850 + unsigned long sc_fpcntl[3];
10851 + unsigned char sc_fpstate[216];
10852 +};
10853 +
10854 +#endif
10855 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/m68k/include/asm/sigcontext_no.h linux-2.6.29-rc3.owrt/arch/m68k/include/asm/sigcontext_no.h
10856 --- linux-2.6.29.owrt/arch/m68k/include/asm/sigcontext_no.h 1970-01-01 01:00:00.000000000 +0100
10857 +++ linux-2.6.29-rc3.owrt/arch/m68k/include/asm/sigcontext_no.h 2009-05-10 23:48:28.000000000 +0200
10858 @@ -0,0 +1,17 @@
10859 +#ifndef _ASM_M68KNOMMU_SIGCONTEXT_H
10860 +#define _ASM_M68KNOMMU_SIGCONTEXT_H
10861 +
10862 +struct sigcontext {
10863 + unsigned long sc_mask; /* old sigmask */
10864 + unsigned long sc_usp; /* old user stack pointer */
10865 + unsigned long sc_d0;
10866 + unsigned long sc_d1;
10867 + unsigned long sc_a0;
10868 + unsigned long sc_a1;
10869 + unsigned long sc_a5;
10870 + unsigned short sc_sr;
10871 + unsigned long sc_pc;
10872 + unsigned short sc_formatvec;
10873 +};
10874 +
10875 +#endif
10876 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/m68k/include/asm/siginfo.h linux-2.6.29-rc3.owrt/arch/m68k/include/asm/siginfo.h
10877 --- linux-2.6.29.owrt/arch/m68k/include/asm/siginfo.h 2009-05-10 22:04:40.000000000 +0200
10878 +++ linux-2.6.29-rc3.owrt/arch/m68k/include/asm/siginfo.h 2009-05-10 23:48:28.000000000 +0200
10879 @@ -1,97 +1,5 @@
10880 -#ifndef _M68K_SIGINFO_H
10881 -#define _M68K_SIGINFO_H
10882 -
10883 -#ifndef __uClinux__
10884 -#define HAVE_ARCH_SIGINFO_T
10885 -#define HAVE_ARCH_COPY_SIGINFO
10886 -#endif
10887 -
10888 -#include <asm-generic/siginfo.h>
10889 -
10890 -#ifndef __uClinux__
10891 -
10892 -typedef struct siginfo {
10893 - int si_signo;
10894 - int si_errno;
10895 - int si_code;
10896 -
10897 - union {
10898 - int _pad[SI_PAD_SIZE];
10899 -
10900 - /* kill() */
10901 - struct {
10902 - __kernel_pid_t _pid; /* sender's pid */
10903 - __kernel_uid_t _uid; /* backwards compatibility */
10904 - __kernel_uid32_t _uid32; /* sender's uid */
10905 - } _kill;
10906 -
10907 - /* POSIX.1b timers */
10908 - struct {
10909 - timer_t _tid; /* timer id */
10910 - int _overrun; /* overrun count */
10911 - char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)];
10912 - sigval_t _sigval; /* same as below */
10913 - int _sys_private; /* not to be passed to user */
10914 - } _timer;
10915 -
10916 - /* POSIX.1b signals */
10917 - struct {
10918 - __kernel_pid_t _pid; /* sender's pid */
10919 - __kernel_uid_t _uid; /* backwards compatibility */
10920 - sigval_t _sigval;
10921 - __kernel_uid32_t _uid32; /* sender's uid */
10922 - } _rt;
10923 -
10924 - /* SIGCHLD */
10925 - struct {
10926 - __kernel_pid_t _pid; /* which child */
10927 - __kernel_uid_t _uid; /* backwards compatibility */
10928 - int _status; /* exit code */
10929 - clock_t _utime;
10930 - clock_t _stime;
10931 - __kernel_uid32_t _uid32; /* sender's uid */
10932 - } _sigchld;
10933 -
10934 - /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
10935 - struct {
10936 - void *_addr; /* faulting insn/memory ref. */
10937 - } _sigfault;
10938 -
10939 - /* SIGPOLL */
10940 - struct {
10941 - int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
10942 - int _fd;
10943 - } _sigpoll;
10944 - } _sifields;
10945 -} siginfo_t;
10946 -
10947 -#define UID16_SIGINFO_COMPAT_NEEDED
10948 -
10949 -/*
10950 - * How these fields are to be accessed.
10951 - */
10952 -#undef si_uid
10953 -#ifdef __KERNEL__
10954 -#define si_uid _sifields._kill._uid32
10955 -#define si_uid16 _sifields._kill._uid
10956 +#ifdef __uClinux__
10957 +#include "siginfo_no.h"
10958 #else
10959 -#define si_uid _sifields._kill._uid
10960 -#endif
10961 -
10962 -#ifdef __KERNEL__
10963 -
10964 -#include <linux/string.h>
10965 -
10966 -static inline void copy_siginfo(struct siginfo *to, struct siginfo *from)
10967 -{
10968 - if (from->si_code < 0)
10969 - memcpy(to, from, sizeof(*to));
10970 - else
10971 - /* _sigchld is currently the largest know union member */
10972 - memcpy(to, from, 3*sizeof(int) + sizeof(from->_sifields._sigchld));
10973 -}
10974 -
10975 -#endif /* __KERNEL__ */
10976 -#endif /* !__uClinux__ */
10977 -
10978 +#include "siginfo_mm.h"
10979 #endif
10980 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/m68k/include/asm/siginfo_mm.h linux-2.6.29-rc3.owrt/arch/m68k/include/asm/siginfo_mm.h
10981 --- linux-2.6.29.owrt/arch/m68k/include/asm/siginfo_mm.h 1970-01-01 01:00:00.000000000 +0100
10982 +++ linux-2.6.29-rc3.owrt/arch/m68k/include/asm/siginfo_mm.h 2009-05-10 23:48:28.000000000 +0200
10983 @@ -0,0 +1,92 @@
10984 +#ifndef _M68K_SIGINFO_H
10985 +#define _M68K_SIGINFO_H
10986 +
10987 +#define HAVE_ARCH_SIGINFO_T
10988 +#define HAVE_ARCH_COPY_SIGINFO
10989 +
10990 +#include <asm-generic/siginfo.h>
10991 +
10992 +typedef struct siginfo {
10993 + int si_signo;
10994 + int si_errno;
10995 + int si_code;
10996 +
10997 + union {
10998 + int _pad[SI_PAD_SIZE];
10999 +
11000 + /* kill() */
11001 + struct {
11002 + __kernel_pid_t _pid; /* sender's pid */
11003 + __kernel_uid_t _uid; /* backwards compatibility */
11004 + __kernel_uid32_t _uid32; /* sender's uid */
11005 + } _kill;
11006 +
11007 + /* POSIX.1b timers */
11008 + struct {
11009 + timer_t _tid; /* timer id */
11010 + int _overrun; /* overrun count */
11011 + char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)];
11012 + sigval_t _sigval; /* same as below */
11013 + int _sys_private; /* not to be passed to user */
11014 + } _timer;
11015 +
11016 + /* POSIX.1b signals */
11017 + struct {
11018 + __kernel_pid_t _pid; /* sender's pid */
11019 + __kernel_uid_t _uid; /* backwards compatibility */
11020 + sigval_t _sigval;
11021 + __kernel_uid32_t _uid32; /* sender's uid */
11022 + } _rt;
11023 +
11024 + /* SIGCHLD */
11025 + struct {
11026 + __kernel_pid_t _pid; /* which child */
11027 + __kernel_uid_t _uid; /* backwards compatibility */
11028 + int _status; /* exit code */
11029 + clock_t _utime;
11030 + clock_t _stime;
11031 + __kernel_uid32_t _uid32; /* sender's uid */
11032 + } _sigchld;
11033 +
11034 + /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
11035 + struct {
11036 + void *_addr; /* faulting insn/memory ref. */
11037 + } _sigfault;
11038 +
11039 + /* SIGPOLL */
11040 + struct {
11041 + int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
11042 + int _fd;
11043 + } _sigpoll;
11044 + } _sifields;
11045 +} siginfo_t;
11046 +
11047 +#define UID16_SIGINFO_COMPAT_NEEDED
11048 +
11049 +/*
11050 + * How these fields are to be accessed.
11051 + */
11052 +#undef si_uid
11053 +#ifdef __KERNEL__
11054 +#define si_uid _sifields._kill._uid32
11055 +#define si_uid16 _sifields._kill._uid
11056 +#else
11057 +#define si_uid _sifields._kill._uid
11058 +#endif
11059 +
11060 +#ifdef __KERNEL__
11061 +
11062 +#include <linux/string.h>
11063 +
11064 +static inline void copy_siginfo(struct siginfo *to, struct siginfo *from)
11065 +{
11066 + if (from->si_code < 0)
11067 + memcpy(to, from, sizeof(*to));
11068 + else
11069 + /* _sigchld is currently the largest know union member */
11070 + memcpy(to, from, 3*sizeof(int) + sizeof(from->_sifields._sigchld));
11071 +}
11072 +
11073 +#endif /* __KERNEL__ */
11074 +
11075 +#endif
11076 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/m68k/include/asm/siginfo_no.h linux-2.6.29-rc3.owrt/arch/m68k/include/asm/siginfo_no.h
11077 --- linux-2.6.29.owrt/arch/m68k/include/asm/siginfo_no.h 1970-01-01 01:00:00.000000000 +0100
11078 +++ linux-2.6.29-rc3.owrt/arch/m68k/include/asm/siginfo_no.h 2009-05-10 23:48:28.000000000 +0200
11079 @@ -0,0 +1,6 @@
11080 +#ifndef _M68KNOMMU_SIGINFO_H
11081 +#define _M68KNOMMU_SIGINFO_H
11082 +
11083 +#include <asm-generic/siginfo.h>
11084 +
11085 +#endif
11086 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/m68k/include/asm/signal.h linux-2.6.29-rc3.owrt/arch/m68k/include/asm/signal.h
11087 --- linux-2.6.29.owrt/arch/m68k/include/asm/signal.h 2009-05-10 22:04:40.000000000 +0200
11088 +++ linux-2.6.29-rc3.owrt/arch/m68k/include/asm/signal.h 2009-05-10 23:48:28.000000000 +0200
11089 @@ -1,213 +1,5 @@
11090 -#ifndef _M68K_SIGNAL_H
11091 -#define _M68K_SIGNAL_H
11092 -
11093 -#include <linux/types.h>
11094 -
11095 -/* Avoid too many header ordering problems. */
11096 -struct siginfo;
11097 -
11098 -#ifdef __KERNEL__
11099 -/* Most things should be clean enough to redefine this at will, if care
11100 - is taken to make libc match. */
11101 -
11102 -#define _NSIG 64
11103 -#define _NSIG_BPW 32
11104 -#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
11105 -
11106 -typedef unsigned long old_sigset_t; /* at least 32 bits */
11107 -
11108 -typedef struct {
11109 - unsigned long sig[_NSIG_WORDS];
11110 -} sigset_t;
11111 -
11112 +#ifdef __uClinux__
11113 +#include "signal_no.h"
11114 #else
11115 -/* Here we must cater to libcs that poke about in kernel headers. */
11116 -
11117 -#define NSIG 32
11118 -typedef unsigned long sigset_t;
11119 -
11120 -#endif /* __KERNEL__ */
11121 -
11122 -#define SIGHUP 1
11123 -#define SIGINT 2
11124 -#define SIGQUIT 3
11125 -#define SIGILL 4
11126 -#define SIGTRAP 5
11127 -#define SIGABRT 6
11128 -#define SIGIOT 6
11129 -#define SIGBUS 7
11130 -#define SIGFPE 8
11131 -#define SIGKILL 9
11132 -#define SIGUSR1 10
11133 -#define SIGSEGV 11
11134 -#define SIGUSR2 12
11135 -#define SIGPIPE 13
11136 -#define SIGALRM 14
11137 -#define SIGTERM 15
11138 -#define SIGSTKFLT 16
11139 -#define SIGCHLD 17
11140 -#define SIGCONT 18
11141 -#define SIGSTOP 19
11142 -#define SIGTSTP 20
11143 -#define SIGTTIN 21
11144 -#define SIGTTOU 22
11145 -#define SIGURG 23
11146 -#define SIGXCPU 24
11147 -#define SIGXFSZ 25
11148 -#define SIGVTALRM 26
11149 -#define SIGPROF 27
11150 -#define SIGWINCH 28
11151 -#define SIGIO 29
11152 -#define SIGPOLL SIGIO
11153 -/*
11154 -#define SIGLOST 29
11155 -*/
11156 -#define SIGPWR 30
11157 -#define SIGSYS 31
11158 -#define SIGUNUSED 31
11159 -
11160 -/* These should not be considered constants from userland. */
11161 -#define SIGRTMIN 32
11162 -#define SIGRTMAX _NSIG
11163 -
11164 -/*
11165 - * SA_FLAGS values:
11166 - *
11167 - * SA_ONSTACK indicates that a registered stack_t will be used.
11168 - * SA_RESTART flag to get restarting signals (which were the default long ago)
11169 - * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
11170 - * SA_RESETHAND clears the handler when the signal is delivered.
11171 - * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
11172 - * SA_NODEFER prevents the current signal from being masked in the handler.
11173 - *
11174 - * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
11175 - * Unix names RESETHAND and NODEFER respectively.
11176 - */
11177 -#define SA_NOCLDSTOP 0x00000001
11178 -#define SA_NOCLDWAIT 0x00000002
11179 -#define SA_SIGINFO 0x00000004
11180 -#define SA_ONSTACK 0x08000000
11181 -#define SA_RESTART 0x10000000
11182 -#define SA_NODEFER 0x40000000
11183 -#define SA_RESETHAND 0x80000000
11184 -
11185 -#define SA_NOMASK SA_NODEFER
11186 -#define SA_ONESHOT SA_RESETHAND
11187 -
11188 -/*
11189 - * sigaltstack controls
11190 - */
11191 -#define SS_ONSTACK 1
11192 -#define SS_DISABLE 2
11193 -
11194 -#define MINSIGSTKSZ 2048
11195 -#define SIGSTKSZ 8192
11196 -
11197 -#include <asm-generic/signal.h>
11198 -
11199 -#ifdef __KERNEL__
11200 -struct old_sigaction {
11201 - __sighandler_t sa_handler;
11202 - old_sigset_t sa_mask;
11203 - unsigned long sa_flags;
11204 - __sigrestore_t sa_restorer;
11205 -};
11206 -
11207 -struct sigaction {
11208 - __sighandler_t sa_handler;
11209 - unsigned long sa_flags;
11210 - __sigrestore_t sa_restorer;
11211 - sigset_t sa_mask; /* mask last for extensibility */
11212 -};
11213 -
11214 -struct k_sigaction {
11215 - struct sigaction sa;
11216 -};
11217 -#else
11218 -/* Here we must cater to libcs that poke about in kernel headers. */
11219 -
11220 -struct sigaction {
11221 - union {
11222 - __sighandler_t _sa_handler;
11223 - void (*_sa_sigaction)(int, struct siginfo *, void *);
11224 - } _u;
11225 - sigset_t sa_mask;
11226 - unsigned long sa_flags;
11227 - void (*sa_restorer)(void);
11228 -};
11229 -
11230 -#define sa_handler _u._sa_handler
11231 -#define sa_sigaction _u._sa_sigaction
11232 -
11233 -#endif /* __KERNEL__ */
11234 -
11235 -typedef struct sigaltstack {
11236 - void __user *ss_sp;
11237 - int ss_flags;
11238 - size_t ss_size;
11239 -} stack_t;
11240 -
11241 -#ifdef __KERNEL__
11242 -#include <asm/sigcontext.h>
11243 -
11244 -#ifndef __uClinux__
11245 -#define __HAVE_ARCH_SIG_BITOPS
11246 -
11247 -static inline void sigaddset(sigset_t *set, int _sig)
11248 -{
11249 - asm ("bfset %0{%1,#1}"
11250 - : "+od" (*set)
11251 - : "id" ((_sig - 1) ^ 31)
11252 - : "cc");
11253 -}
11254 -
11255 -static inline void sigdelset(sigset_t *set, int _sig)
11256 -{
11257 - asm ("bfclr %0{%1,#1}"
11258 - : "+od" (*set)
11259 - : "id" ((_sig - 1) ^ 31)
11260 - : "cc");
11261 -}
11262 -
11263 -static inline int __const_sigismember(sigset_t *set, int _sig)
11264 -{
11265 - unsigned long sig = _sig - 1;
11266 - return 1 & (set->sig[sig / _NSIG_BPW] >> (sig % _NSIG_BPW));
11267 -}
11268 -
11269 -static inline int __gen_sigismember(sigset_t *set, int _sig)
11270 -{
11271 - int ret;
11272 - asm ("bfextu %1{%2,#1},%0"
11273 - : "=d" (ret)
11274 - : "od" (*set), "id" ((_sig-1) ^ 31)
11275 - : "cc");
11276 - return ret;
11277 -}
11278 -
11279 -#define sigismember(set,sig) \
11280 - (__builtin_constant_p(sig) ? \
11281 - __const_sigismember(set,sig) : \
11282 - __gen_sigismember(set,sig))
11283 -
11284 -static inline int sigfindinword(unsigned long word)
11285 -{
11286 - asm ("bfffo %1{#0,#0},%0"
11287 - : "=d" (word)
11288 - : "d" (word & -word)
11289 - : "cc");
11290 - return word ^ 31;
11291 -}
11292 -
11293 -struct pt_regs;
11294 -extern void ptrace_signal_deliver(struct pt_regs *regs, void *cookie);
11295 -
11296 -#else
11297 -
11298 -#undef __HAVE_ARCH_SIG_BITOPS
11299 -#define ptrace_signal_deliver(regs, cookie) do { } while (0)
11300 -
11301 -#endif /* __uClinux__ */
11302 -#endif /* __KERNEL__ */
11303 -
11304 -#endif /* _M68K_SIGNAL_H */
11305 +#include "signal_mm.h"
11306 +#endif
11307 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/m68k/include/asm/signal_mm.h linux-2.6.29-rc3.owrt/arch/m68k/include/asm/signal_mm.h
11308 --- linux-2.6.29.owrt/arch/m68k/include/asm/signal_mm.h 1970-01-01 01:00:00.000000000 +0100
11309 +++ linux-2.6.29-rc3.owrt/arch/m68k/include/asm/signal_mm.h 2009-05-10 23:48:28.000000000 +0200
11310 @@ -0,0 +1,206 @@
11311 +#ifndef _M68K_SIGNAL_H
11312 +#define _M68K_SIGNAL_H
11313 +
11314 +#include <linux/types.h>
11315 +
11316 +/* Avoid too many header ordering problems. */
11317 +struct siginfo;
11318 +
11319 +#ifdef __KERNEL__
11320 +/* Most things should be clean enough to redefine this at will, if care
11321 + is taken to make libc match. */
11322 +
11323 +#define _NSIG 64
11324 +#define _NSIG_BPW 32
11325 +#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
11326 +
11327 +typedef unsigned long old_sigset_t; /* at least 32 bits */
11328 +
11329 +typedef struct {
11330 + unsigned long sig[_NSIG_WORDS];
11331 +} sigset_t;
11332 +
11333 +#else
11334 +/* Here we must cater to libcs that poke about in kernel headers. */
11335 +
11336 +#define NSIG 32
11337 +typedef unsigned long sigset_t;
11338 +
11339 +#endif /* __KERNEL__ */
11340 +
11341 +#define SIGHUP 1
11342 +#define SIGINT 2
11343 +#define SIGQUIT 3
11344 +#define SIGILL 4
11345 +#define SIGTRAP 5
11346 +#define SIGABRT 6
11347 +#define SIGIOT 6
11348 +#define SIGBUS 7
11349 +#define SIGFPE 8
11350 +#define SIGKILL 9
11351 +#define SIGUSR1 10
11352 +#define SIGSEGV 11
11353 +#define SIGUSR2 12
11354 +#define SIGPIPE 13
11355 +#define SIGALRM 14
11356 +#define SIGTERM 15
11357 +#define SIGSTKFLT 16
11358 +#define SIGCHLD 17
11359 +#define SIGCONT 18
11360 +#define SIGSTOP 19
11361 +#define SIGTSTP 20
11362 +#define SIGTTIN 21
11363 +#define SIGTTOU 22
11364 +#define SIGURG 23
11365 +#define SIGXCPU 24
11366 +#define SIGXFSZ 25
11367 +#define SIGVTALRM 26
11368 +#define SIGPROF 27
11369 +#define SIGWINCH 28
11370 +#define SIGIO 29
11371 +#define SIGPOLL SIGIO
11372 +/*
11373 +#define SIGLOST 29
11374 +*/
11375 +#define SIGPWR 30
11376 +#define SIGSYS 31
11377 +#define SIGUNUSED 31
11378 +
11379 +/* These should not be considered constants from userland. */
11380 +#define SIGRTMIN 32
11381 +#define SIGRTMAX _NSIG
11382 +
11383 +/*
11384 + * SA_FLAGS values:
11385 + *
11386 + * SA_ONSTACK indicates that a registered stack_t will be used.
11387 + * SA_RESTART flag to get restarting signals (which were the default long ago)
11388 + * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
11389 + * SA_RESETHAND clears the handler when the signal is delivered.
11390 + * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
11391 + * SA_NODEFER prevents the current signal from being masked in the handler.
11392 + *
11393 + * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
11394 + * Unix names RESETHAND and NODEFER respectively.
11395 + */
11396 +#define SA_NOCLDSTOP 0x00000001
11397 +#define SA_NOCLDWAIT 0x00000002
11398 +#define SA_SIGINFO 0x00000004
11399 +#define SA_ONSTACK 0x08000000
11400 +#define SA_RESTART 0x10000000
11401 +#define SA_NODEFER 0x40000000
11402 +#define SA_RESETHAND 0x80000000
11403 +
11404 +#define SA_NOMASK SA_NODEFER
11405 +#define SA_ONESHOT SA_RESETHAND
11406 +
11407 +/*
11408 + * sigaltstack controls
11409 + */
11410 +#define SS_ONSTACK 1
11411 +#define SS_DISABLE 2
11412 +
11413 +#define MINSIGSTKSZ 2048
11414 +#define SIGSTKSZ 8192
11415 +
11416 +#include <asm-generic/signal.h>
11417 +
11418 +#ifdef __KERNEL__
11419 +struct old_sigaction {
11420 + __sighandler_t sa_handler;
11421 + old_sigset_t sa_mask;
11422 + unsigned long sa_flags;
11423 + __sigrestore_t sa_restorer;
11424 +};
11425 +
11426 +struct sigaction {
11427 + __sighandler_t sa_handler;
11428 + unsigned long sa_flags;
11429 + __sigrestore_t sa_restorer;
11430 + sigset_t sa_mask; /* mask last for extensibility */
11431 +};
11432 +
11433 +struct k_sigaction {
11434 + struct sigaction sa;
11435 +};
11436 +#else
11437 +/* Here we must cater to libcs that poke about in kernel headers. */
11438 +
11439 +struct sigaction {
11440 + union {
11441 + __sighandler_t _sa_handler;
11442 + void (*_sa_sigaction)(int, struct siginfo *, void *);
11443 + } _u;
11444 + sigset_t sa_mask;
11445 + unsigned long sa_flags;
11446 + void (*sa_restorer)(void);
11447 +};
11448 +
11449 +#define sa_handler _u._sa_handler
11450 +#define sa_sigaction _u._sa_sigaction
11451 +
11452 +#endif /* __KERNEL__ */
11453 +
11454 +typedef struct sigaltstack {
11455 + void __user *ss_sp;
11456 + int ss_flags;
11457 + size_t ss_size;
11458 +} stack_t;
11459 +
11460 +#ifdef __KERNEL__
11461 +#include <asm/sigcontext.h>
11462 +
11463 +#define __HAVE_ARCH_SIG_BITOPS
11464 +
11465 +static inline void sigaddset(sigset_t *set, int _sig)
11466 +{
11467 + asm ("bfset %0{%1,#1}"
11468 + : "+od" (*set)
11469 + : "id" ((_sig - 1) ^ 31)
11470 + : "cc");
11471 +}
11472 +
11473 +static inline void sigdelset(sigset_t *set, int _sig)
11474 +{
11475 + asm ("bfclr %0{%1,#1}"
11476 + : "+od" (*set)
11477 + : "id" ((_sig - 1) ^ 31)
11478 + : "cc");
11479 +}
11480 +
11481 +static inline int __const_sigismember(sigset_t *set, int _sig)
11482 +{
11483 + unsigned long sig = _sig - 1;
11484 + return 1 & (set->sig[sig / _NSIG_BPW] >> (sig % _NSIG_BPW));
11485 +}
11486 +
11487 +static inline int __gen_sigismember(sigset_t *set, int _sig)
11488 +{
11489 + int ret;
11490 + asm ("bfextu %1{%2,#1},%0"
11491 + : "=d" (ret)
11492 + : "od" (*set), "id" ((_sig-1) ^ 31)
11493 + : "cc");
11494 + return ret;
11495 +}
11496 +
11497 +#define sigismember(set,sig) \
11498 + (__builtin_constant_p(sig) ? \
11499 + __const_sigismember(set,sig) : \
11500 + __gen_sigismember(set,sig))
11501 +
11502 +static inline int sigfindinword(unsigned long word)
11503 +{
11504 + asm ("bfffo %1{#0,#0},%0"
11505 + : "=d" (word)
11506 + : "d" (word & -word)
11507 + : "cc");
11508 + return word ^ 31;
11509 +}
11510 +
11511 +struct pt_regs;
11512 +extern void ptrace_signal_deliver(struct pt_regs *regs, void *cookie);
11513 +
11514 +#endif /* __KERNEL__ */
11515 +
11516 +#endif /* _M68K_SIGNAL_H */
11517 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/m68k/include/asm/signal_no.h linux-2.6.29-rc3.owrt/arch/m68k/include/asm/signal_no.h
11518 --- linux-2.6.29.owrt/arch/m68k/include/asm/signal_no.h 1970-01-01 01:00:00.000000000 +0100
11519 +++ linux-2.6.29-rc3.owrt/arch/m68k/include/asm/signal_no.h 2009-05-10 23:48:28.000000000 +0200
11520 @@ -0,0 +1,159 @@
11521 +#ifndef _M68KNOMMU_SIGNAL_H
11522 +#define _M68KNOMMU_SIGNAL_H
11523 +
11524 +#include <linux/types.h>
11525 +
11526 +/* Avoid too many header ordering problems. */
11527 +struct siginfo;
11528 +
11529 +#ifdef __KERNEL__
11530 +/* Most things should be clean enough to redefine this at will, if care
11531 + is taken to make libc match. */
11532 +
11533 +#define _NSIG 64
11534 +#define _NSIG_BPW 32
11535 +#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
11536 +
11537 +typedef unsigned long old_sigset_t; /* at least 32 bits */
11538 +
11539 +typedef struct {
11540 + unsigned long sig[_NSIG_WORDS];
11541 +} sigset_t;
11542 +
11543 +#else
11544 +/* Here we must cater to libcs that poke about in kernel headers. */
11545 +
11546 +#define NSIG 32
11547 +typedef unsigned long sigset_t;
11548 +
11549 +#endif /* __KERNEL__ */
11550 +
11551 +#define SIGHUP 1
11552 +#define SIGINT 2
11553 +#define SIGQUIT 3
11554 +#define SIGILL 4
11555 +#define SIGTRAP 5
11556 +#define SIGABRT 6
11557 +#define SIGIOT 6
11558 +#define SIGBUS 7
11559 +#define SIGFPE 8
11560 +#define SIGKILL 9
11561 +#define SIGUSR1 10
11562 +#define SIGSEGV 11
11563 +#define SIGUSR2 12
11564 +#define SIGPIPE 13
11565 +#define SIGALRM 14
11566 +#define SIGTERM 15
11567 +#define SIGSTKFLT 16
11568 +#define SIGCHLD 17
11569 +#define SIGCONT 18
11570 +#define SIGSTOP 19
11571 +#define SIGTSTP 20
11572 +#define SIGTTIN 21
11573 +#define SIGTTOU 22
11574 +#define SIGURG 23
11575 +#define SIGXCPU 24
11576 +#define SIGXFSZ 25
11577 +#define SIGVTALRM 26
11578 +#define SIGPROF 27
11579 +#define SIGWINCH 28
11580 +#define SIGIO 29
11581 +#define SIGPOLL SIGIO
11582 +/*
11583 +#define SIGLOST 29
11584 +*/
11585 +#define SIGPWR 30
11586 +#define SIGSYS 31
11587 +#define SIGUNUSED 31
11588 +
11589 +/* These should not be considered constants from userland. */
11590 +#define SIGRTMIN 32
11591 +#define SIGRTMAX _NSIG
11592 +
11593 +/*
11594 + * SA_FLAGS values:
11595 + *
11596 + * SA_ONSTACK indicates that a registered stack_t will be used.
11597 + * SA_RESTART flag to get restarting signals (which were the default long ago)
11598 + * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
11599 + * SA_RESETHAND clears the handler when the signal is delivered.
11600 + * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
11601 + * SA_NODEFER prevents the current signal from being masked in the handler.
11602 + *
11603 + * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
11604 + * Unix names RESETHAND and NODEFER respectively.
11605 + */
11606 +#define SA_NOCLDSTOP 0x00000001
11607 +#define SA_NOCLDWAIT 0x00000002
11608 +#define SA_SIGINFO 0x00000004
11609 +#define SA_ONSTACK 0x08000000
11610 +#define SA_RESTART 0x10000000
11611 +#define SA_NODEFER 0x40000000
11612 +#define SA_RESETHAND 0x80000000
11613 +
11614 +#define SA_NOMASK SA_NODEFER
11615 +#define SA_ONESHOT SA_RESETHAND
11616 +
11617 +/*
11618 + * sigaltstack controls
11619 + */
11620 +#define SS_ONSTACK 1
11621 +#define SS_DISABLE 2
11622 +
11623 +#define MINSIGSTKSZ 2048
11624 +#define SIGSTKSZ 8192
11625 +
11626 +#include <asm-generic/signal.h>
11627 +
11628 +#ifdef __KERNEL__
11629 +struct old_sigaction {
11630 + __sighandler_t sa_handler;
11631 + old_sigset_t sa_mask;
11632 + unsigned long sa_flags;
11633 + void (*sa_restorer)(void);
11634 +};
11635 +
11636 +struct sigaction {
11637 + __sighandler_t sa_handler;
11638 + unsigned long sa_flags;
11639 + void (*sa_restorer)(void);
11640 + sigset_t sa_mask; /* mask last for extensibility */
11641 +};
11642 +
11643 +struct k_sigaction {
11644 + struct sigaction sa;
11645 +};
11646 +#else
11647 +/* Here we must cater to libcs that poke about in kernel headers. */
11648 +
11649 +struct sigaction {
11650 + union {
11651 + __sighandler_t _sa_handler;
11652 + void (*_sa_sigaction)(int, struct siginfo *, void *);
11653 + } _u;
11654 + sigset_t sa_mask;
11655 + unsigned long sa_flags;
11656 + void (*sa_restorer)(void);
11657 +};
11658 +
11659 +#define sa_handler _u._sa_handler
11660 +#define sa_sigaction _u._sa_sigaction
11661 +
11662 +#endif /* __KERNEL__ */
11663 +
11664 +typedef struct sigaltstack {
11665 + void *ss_sp;
11666 + int ss_flags;
11667 + size_t ss_size;
11668 +} stack_t;
11669 +
11670 +#ifdef __KERNEL__
11671 +
11672 +#include <asm/sigcontext.h>
11673 +#undef __HAVE_ARCH_SIG_BITOPS
11674 +
11675 +#define ptrace_signal_deliver(regs, cookie) do { } while (0)
11676 +
11677 +#endif /* __KERNEL__ */
11678 +
11679 +#endif /* _M68KNOMMU_SIGNAL_H */
11680 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/m68k/include/asm/swab.h linux-2.6.29-rc3.owrt/arch/m68k/include/asm/swab.h
11681 --- linux-2.6.29.owrt/arch/m68k/include/asm/swab.h 2009-05-10 22:04:40.000000000 +0200
11682 +++ linux-2.6.29-rc3.owrt/arch/m68k/include/asm/swab.h 2009-05-10 23:48:28.000000000 +0200
11683 @@ -1,27 +1,5 @@
11684 -#ifndef _M68K_SWAB_H
11685 -#define _M68K_SWAB_H
11686 -
11687 -#include <asm/types.h>
11688 -#include <linux/compiler.h>
11689 -
11690 -#define __SWAB_64_THRU_32__
11691 -
11692 -#if defined (__mcfisaaplus__) || defined (__mcfisac__)
11693 -static inline __attribute_const__ __u32 __arch_swab32(__u32 val)
11694 -{
11695 - __asm__("byterev %0" : "=d" (val) : "0" (val));
11696 - return val;
11697 -}
11698 -
11699 -#define __arch_swab32 __arch_swab32
11700 -#elif !defined(__uClinux__)
11701 -
11702 -static inline __attribute_const__ __u32 __arch_swab32(__u32 val)
11703 -{
11704 - __asm__("rolw #8,%0; swap %0; rolw #8,%0" : "=d" (val) : "0" (val));
11705 - return val;
11706 -}
11707 -#define __arch_swab32 __arch_swab32
11708 +#ifdef __uClinux__
11709 +#include "swab_no.h"
11710 +#else
11711 +#include "swab_mm.h"
11712 #endif
11713 -
11714 -#endif /* _M68K_SWAB_H */
11715 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/m68k/include/asm/swab_mm.h linux-2.6.29-rc3.owrt/arch/m68k/include/asm/swab_mm.h
11716 --- linux-2.6.29.owrt/arch/m68k/include/asm/swab_mm.h 1970-01-01 01:00:00.000000000 +0100
11717 +++ linux-2.6.29-rc3.owrt/arch/m68k/include/asm/swab_mm.h 2009-05-10 23:48:28.000000000 +0200
11718 @@ -0,0 +1,16 @@
11719 +#ifndef _M68K_SWAB_H
11720 +#define _M68K_SWAB_H
11721 +
11722 +#include <asm/types.h>
11723 +#include <linux/compiler.h>
11724 +
11725 +#define __SWAB_64_THRU_32__
11726 +
11727 +static inline __attribute_const__ __u32 __arch_swab32(__u32 val)
11728 +{
11729 + __asm__("rolw #8,%0; swap %0; rolw #8,%0" : "=d" (val) : "0" (val));
11730 + return val;
11731 +}
11732 +#define __arch_swab32 __arch_swab32
11733 +
11734 +#endif /* _M68K_SWAB_H */
11735 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/m68k/include/asm/swab_no.h linux-2.6.29-rc3.owrt/arch/m68k/include/asm/swab_no.h
11736 --- linux-2.6.29.owrt/arch/m68k/include/asm/swab_no.h 1970-01-01 01:00:00.000000000 +0100
11737 +++ linux-2.6.29-rc3.owrt/arch/m68k/include/asm/swab_no.h 2009-05-10 23:48:28.000000000 +0200
11738 @@ -0,0 +1,24 @@
11739 +#ifndef _M68KNOMMU_SWAB_H
11740 +#define _M68KNOMMU_SWAB_H
11741 +
11742 +#include <linux/types.h>
11743 +
11744 +#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
11745 +# define __SWAB_64_THRU_32__
11746 +#endif
11747 +
11748 +#if defined (__mcfisaaplus__) || defined (__mcfisac__)
11749 +static inline __attribute_const__ __u32 __arch_swab32(__u32 val)
11750 +{
11751 + asm(
11752 + "byterev %0"
11753 + : "=d" (val)
11754 + : "0" (val)
11755 + );
11756 + return val;
11757 +}
11758 +
11759 +#define __arch_swab32 __arch_swab32
11760 +#endif
11761 +
11762 +#endif /* _M68KNOMMU_SWAB_H */
11763 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/m68k/include/asm/unistd.h linux-2.6.29-rc3.owrt/arch/m68k/include/asm/unistd.h
11764 --- linux-2.6.29.owrt/arch/m68k/include/asm/unistd.h 2009-05-10 22:04:40.000000000 +0200
11765 +++ linux-2.6.29-rc3.owrt/arch/m68k/include/asm/unistd.h 2009-05-10 23:48:28.000000000 +0200
11766 @@ -1,372 +1,5 @@
11767 -#ifndef _ASM_M68K_UNISTD_H_
11768 -#define _ASM_M68K_UNISTD_H_
11769 -
11770 -/*
11771 - * This file contains the system call numbers.
11772 - */
11773 -
11774 -#define __NR_restart_syscall 0
11775 -#define __NR_exit 1
11776 -#define __NR_fork 2
11777 -#define __NR_read 3
11778 -#define __NR_write 4
11779 -#define __NR_open 5
11780 -#define __NR_close 6
11781 -#define __NR_waitpid 7
11782 -#define __NR_creat 8
11783 -#define __NR_link 9
11784 -#define __NR_unlink 10
11785 -#define __NR_execve 11
11786 -#define __NR_chdir 12
11787 -#define __NR_time 13
11788 -#define __NR_mknod 14
11789 -#define __NR_chmod 15
11790 -#define __NR_chown 16
11791 -#define __NR_break 17
11792 -#define __NR_oldstat 18
11793 -#define __NR_lseek 19
11794 -#define __NR_getpid 20
11795 -#define __NR_mount 21
11796 -#define __NR_umount 22
11797 -#define __NR_setuid 23
11798 -#define __NR_getuid 24
11799 -#define __NR_stime 25
11800 -#define __NR_ptrace 26
11801 -#define __NR_alarm 27
11802 -#define __NR_oldfstat 28
11803 -#define __NR_pause 29
11804 -#define __NR_utime 30
11805 -#define __NR_stty 31
11806 -#define __NR_gtty 32
11807 -#define __NR_access 33
11808 -#define __NR_nice 34
11809 -#define __NR_ftime 35
11810 -#define __NR_sync 36
11811 -#define __NR_kill 37
11812 -#define __NR_rename 38
11813 -#define __NR_mkdir 39
11814 -#define __NR_rmdir 40
11815 -#define __NR_dup 41
11816 -#define __NR_pipe 42
11817 -#define __NR_times 43
11818 -#define __NR_prof 44
11819 -#define __NR_brk 45
11820 -#define __NR_setgid 46
11821 -#define __NR_getgid 47
11822 -#define __NR_signal 48
11823 -#define __NR_geteuid 49
11824 -#define __NR_getegid 50
11825 -#define __NR_acct 51
11826 -#define __NR_umount2 52
11827 -#define __NR_lock 53
11828 -#define __NR_ioctl 54
11829 -#define __NR_fcntl 55
11830 -#define __NR_mpx 56
11831 -#define __NR_setpgid 57
11832 -#define __NR_ulimit 58
11833 -#define __NR_oldolduname 59
11834 -#define __NR_umask 60
11835 -#define __NR_chroot 61
11836 -#define __NR_ustat 62
11837 -#define __NR_dup2 63
11838 -#define __NR_getppid 64
11839 -#define __NR_getpgrp 65
11840 -#define __NR_setsid 66
11841 -#define __NR_sigaction 67
11842 -#define __NR_sgetmask 68
11843 -#define __NR_ssetmask 69
11844 -#define __NR_setreuid 70
11845 -#define __NR_setregid 71
11846 -#define __NR_sigsuspend 72
11847 -#define __NR_sigpending 73
11848 -#define __NR_sethostname 74
11849 -#define __NR_setrlimit 75
11850 -#define __NR_getrlimit 76
11851 -#define __NR_getrusage 77
11852 -#define __NR_gettimeofday 78
11853 -#define __NR_settimeofday 79
11854 -#define __NR_getgroups 80
11855 -#define __NR_setgroups 81
11856 -#define __NR_select 82
11857 -#define __NR_symlink 83
11858 -#define __NR_oldlstat 84
11859 -#define __NR_readlink 85
11860 -#define __NR_uselib 86
11861 -#define __NR_swapon 87
11862 -#define __NR_reboot 88
11863 -#define __NR_readdir 89
11864 -#define __NR_mmap 90
11865 -#define __NR_munmap 91
11866 -#define __NR_truncate 92
11867 -#define __NR_ftruncate 93
11868 -#define __NR_fchmod 94
11869 -#define __NR_fchown 95
11870 -#define __NR_getpriority 96
11871 -#define __NR_setpriority 97
11872 -#define __NR_profil 98
11873 -#define __NR_statfs 99
11874 -#define __NR_fstatfs 100
11875 -#define __NR_ioperm 101
11876 -#define __NR_socketcall 102
11877 -#define __NR_syslog 103
11878 -#define __NR_setitimer 104
11879 -#define __NR_getitimer 105
11880 -#define __NR_stat 106
11881 -#define __NR_lstat 107
11882 -#define __NR_fstat 108
11883 -#define __NR_olduname 109
11884 -#define __NR_iopl /* 110 */ not supported
11885 -#define __NR_vhangup 111
11886 -#define __NR_idle /* 112 */ Obsolete
11887 -#define __NR_vm86 /* 113 */ not supported
11888 -#define __NR_wait4 114
11889 -#define __NR_swapoff 115
11890 -#define __NR_sysinfo 116
11891 -#define __NR_ipc 117
11892 -#define __NR_fsync 118
11893 -#define __NR_sigreturn 119
11894 -#define __NR_clone 120
11895 -#define __NR_setdomainname 121
11896 -#define __NR_uname 122
11897 -#define __NR_cacheflush 123
11898 -#define __NR_adjtimex 124
11899 -#define __NR_mprotect 125
11900 -#define __NR_sigprocmask 126
11901 -#define __NR_create_module 127
11902 -#define __NR_init_module 128
11903 -#define __NR_delete_module 129
11904 -#define __NR_get_kernel_syms 130
11905 -#define __NR_quotactl 131
11906 -#define __NR_getpgid 132
11907 -#define __NR_fchdir 133
11908 -#define __NR_bdflush 134
11909 -#define __NR_sysfs 135
11910 -#define __NR_personality 136
11911 -#define __NR_afs_syscall 137 /* Syscall for Andrew File System */
11912 -#define __NR_setfsuid 138
11913 -#define __NR_setfsgid 139
11914 -#define __NR__llseek 140
11915 -#define __NR_getdents 141
11916 -#define __NR__newselect 142
11917 -#define __NR_flock 143
11918 -#define __NR_msync 144
11919 -#define __NR_readv 145
11920 -#define __NR_writev 146
11921 -#define __NR_getsid 147
11922 -#define __NR_fdatasync 148
11923 -#define __NR__sysctl 149
11924 -#define __NR_mlock 150
11925 -#define __NR_munlock 151
11926 -#define __NR_mlockall 152
11927 -#define __NR_munlockall 153
11928 -#define __NR_sched_setparam 154
11929 -#define __NR_sched_getparam 155
11930 -#define __NR_sched_setscheduler 156
11931 -#define __NR_sched_getscheduler 157
11932 -#define __NR_sched_yield 158
11933 -#define __NR_sched_get_priority_max 159
11934 -#define __NR_sched_get_priority_min 160
11935 -#define __NR_sched_rr_get_interval 161
11936 -#define __NR_nanosleep 162
11937 -#define __NR_mremap 163
11938 -#define __NR_setresuid 164
11939 -#define __NR_getresuid 165
11940 -#define __NR_getpagesize 166
11941 -#define __NR_query_module 167
11942 -#define __NR_poll 168
11943 -#define __NR_nfsservctl 169
11944 -#define __NR_setresgid 170
11945 -#define __NR_getresgid 171
11946 -#define __NR_prctl 172
11947 -#define __NR_rt_sigreturn 173
11948 -#define __NR_rt_sigaction 174
11949 -#define __NR_rt_sigprocmask 175
11950 -#define __NR_rt_sigpending 176
11951 -#define __NR_rt_sigtimedwait 177
11952 -#define __NR_rt_sigqueueinfo 178
11953 -#define __NR_rt_sigsuspend 179
11954 -#define __NR_pread64 180
11955 -#define __NR_pwrite64 181
11956 -#define __NR_lchown 182
11957 -#define __NR_getcwd 183
11958 -#define __NR_capget 184
11959 -#define __NR_capset 185
11960 -#define __NR_sigaltstack 186
11961 -#define __NR_sendfile 187
11962 -#define __NR_getpmsg 188 /* some people actually want streams */
11963 -#define __NR_putpmsg 189 /* some people actually want streams */
11964 -#define __NR_vfork 190
11965 -#define __NR_ugetrlimit 191
11966 -#define __NR_mmap2 192
11967 -#define __NR_truncate64 193
11968 -#define __NR_ftruncate64 194
11969 -#define __NR_stat64 195
11970 -#define __NR_lstat64 196
11971 -#define __NR_fstat64 197
11972 -#define __NR_chown32 198
11973 -#define __NR_getuid32 199
11974 -#define __NR_getgid32 200
11975 -#define __NR_geteuid32 201
11976 -#define __NR_getegid32 202
11977 -#define __NR_setreuid32 203
11978 -#define __NR_setregid32 204
11979 -#define __NR_getgroups32 205
11980 -#define __NR_setgroups32 206
11981 -#define __NR_fchown32 207
11982 -#define __NR_setresuid32 208
11983 -#define __NR_getresuid32 209
11984 -#define __NR_setresgid32 210
11985 -#define __NR_getresgid32 211
11986 -#define __NR_lchown32 212
11987 -#define __NR_setuid32 213
11988 -#define __NR_setgid32 214
11989 -#define __NR_setfsuid32 215
11990 -#define __NR_setfsgid32 216
11991 -#define __NR_pivot_root 217
11992 -#define __NR_getdents64 220
11993 -#define __NR_gettid 221
11994 -#define __NR_tkill 222
11995 -#define __NR_setxattr 223
11996 -#define __NR_lsetxattr 224
11997 -#define __NR_fsetxattr 225
11998 -#define __NR_getxattr 226
11999 -#define __NR_lgetxattr 227
12000 -#define __NR_fgetxattr 228
12001 -#define __NR_listxattr 229
12002 -#define __NR_llistxattr 230
12003 -#define __NR_flistxattr 231
12004 -#define __NR_removexattr 232
12005 -#define __NR_lremovexattr 233
12006 -#define __NR_fremovexattr 234
12007 -#define __NR_futex 235
12008 -#define __NR_sendfile64 236
12009 -#define __NR_mincore 237
12010 -#define __NR_madvise 238
12011 -#define __NR_fcntl64 239
12012 -#define __NR_readahead 240
12013 -#define __NR_io_setup 241
12014 -#define __NR_io_destroy 242
12015 -#define __NR_io_getevents 243
12016 -#define __NR_io_submit 244
12017 -#define __NR_io_cancel 245
12018 -#define __NR_fadvise64 246
12019 -#define __NR_exit_group 247
12020 -#define __NR_lookup_dcookie 248
12021 -#define __NR_epoll_create 249
12022 -#define __NR_epoll_ctl 250
12023 -#define __NR_epoll_wait 251
12024 -#define __NR_remap_file_pages 252
12025 -#define __NR_set_tid_address 253
12026 -#define __NR_timer_create 254
12027 -#define __NR_timer_settime 255
12028 -#define __NR_timer_gettime 256
12029 -#define __NR_timer_getoverrun 257
12030 -#define __NR_timer_delete 258
12031 -#define __NR_clock_settime 259
12032 -#define __NR_clock_gettime 260
12033 -#define __NR_clock_getres 261
12034 -#define __NR_clock_nanosleep 262
12035 -#define __NR_statfs64 263
12036 -#define __NR_fstatfs64 264
12037 -#define __NR_tgkill 265
12038 -#define __NR_utimes 266
12039 -#define __NR_fadvise64_64 267
12040 -#define __NR_mbind 268
12041 -#define __NR_get_mempolicy 269
12042 -#define __NR_set_mempolicy 270
12043 -#define __NR_mq_open 271
12044 -#define __NR_mq_unlink 272
12045 -#define __NR_mq_timedsend 273
12046 -#define __NR_mq_timedreceive 274
12047 -#define __NR_mq_notify 275
12048 -#define __NR_mq_getsetattr 276
12049 -#define __NR_waitid 277
12050 -#define __NR_vserver 278
12051 -#define __NR_add_key 279
12052 -#define __NR_request_key 280
12053 -#define __NR_keyctl 281
12054 -#define __NR_ioprio_set 282
12055 -#define __NR_ioprio_get 283
12056 -#define __NR_inotify_init 284
12057 -#define __NR_inotify_add_watch 285
12058 -#define __NR_inotify_rm_watch 286
12059 -#define __NR_migrate_pages 287
12060 -#define __NR_openat 288
12061 -#define __NR_mkdirat 289
12062 -#define __NR_mknodat 290
12063 -#define __NR_fchownat 291
12064 -#define __NR_futimesat 292
12065 -#define __NR_fstatat64 293
12066 -#define __NR_unlinkat 294
12067 -#define __NR_renameat 295
12068 -#define __NR_linkat 296
12069 -#define __NR_symlinkat 297
12070 -#define __NR_readlinkat 298
12071 -#define __NR_fchmodat 299
12072 -#define __NR_faccessat 300
12073 -#define __NR_pselect6 301
12074 -#define __NR_ppoll 302
12075 -#define __NR_unshare 303
12076 -#define __NR_set_robust_list 304
12077 -#define __NR_get_robust_list 305
12078 -#define __NR_splice 306
12079 -#define __NR_sync_file_range 307
12080 -#define __NR_tee 308
12081 -#define __NR_vmsplice 309
12082 -#define __NR_move_pages 310
12083 -#define __NR_sched_setaffinity 311
12084 -#define __NR_sched_getaffinity 312
12085 -#define __NR_kexec_load 313
12086 -#define __NR_getcpu 314
12087 -#define __NR_epoll_pwait 315
12088 -#define __NR_utimensat 316
12089 -#define __NR_signalfd 317
12090 -#define __NR_timerfd_create 318
12091 -#define __NR_eventfd 319
12092 -#define __NR_fallocate 320
12093 -#define __NR_timerfd_settime 321
12094 -#define __NR_timerfd_gettime 322
12095 -#define __NR_signalfd4 323
12096 -#define __NR_eventfd2 324
12097 -#define __NR_epoll_create1 325
12098 -#define __NR_dup3 326
12099 -#define __NR_pipe2 327
12100 -#define __NR_inotify_init1 328
12101 -
12102 -#ifdef __KERNEL__
12103 -
12104 -#define NR_syscalls 329
12105 -
12106 -#define __ARCH_WANT_IPC_PARSE_VERSION
12107 -#define __ARCH_WANT_OLD_READDIR
12108 -#define __ARCH_WANT_OLD_STAT
12109 -#define __ARCH_WANT_STAT64
12110 -#define __ARCH_WANT_SYS_ALARM
12111 -#define __ARCH_WANT_SYS_GETHOSTNAME
12112 -#define __ARCH_WANT_SYS_PAUSE
12113 -#define __ARCH_WANT_SYS_SGETMASK
12114 -#define __ARCH_WANT_SYS_SIGNAL
12115 -#define __ARCH_WANT_SYS_TIME
12116 -#define __ARCH_WANT_SYS_UTIME
12117 -#define __ARCH_WANT_SYS_WAITPID
12118 -#define __ARCH_WANT_SYS_SOCKETCALL
12119 -#define __ARCH_WANT_SYS_FADVISE64
12120 -#define __ARCH_WANT_SYS_GETPGRP
12121 -#define __ARCH_WANT_SYS_LLSEEK
12122 -#define __ARCH_WANT_SYS_NICE
12123 -#define __ARCH_WANT_SYS_OLD_GETRLIMIT
12124 -#define __ARCH_WANT_SYS_OLDUMOUNT
12125 -#define __ARCH_WANT_SYS_SIGPENDING
12126 -#define __ARCH_WANT_SYS_SIGPROCMASK
12127 -#define __ARCH_WANT_SYS_RT_SIGACTION
12128 -
12129 -/*
12130 - * "Conditional" syscalls
12131 - *
12132 - * What we want is __attribute__((weak,alias("sys_ni_syscall"))),
12133 - * but it doesn't work on all toolchains, so we just do it by hand
12134 - */
12135 -#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
12136 -
12137 -#endif /* __KERNEL__ */
12138 -#endif /* _ASM_M68K_UNISTD_H_ */
12139 +#ifdef __uClinux__
12140 +#include "unistd_no.h"
12141 +#else
12142 +#include "unistd_mm.h"
12143 +#endif
12144 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/m68k/include/asm/unistd_mm.h linux-2.6.29-rc3.owrt/arch/m68k/include/asm/unistd_mm.h
12145 --- linux-2.6.29.owrt/arch/m68k/include/asm/unistd_mm.h 1970-01-01 01:00:00.000000000 +0100
12146 +++ linux-2.6.29-rc3.owrt/arch/m68k/include/asm/unistd_mm.h 2009-05-10 23:48:28.000000000 +0200
12147 @@ -0,0 +1,372 @@
12148 +#ifndef _ASM_M68K_UNISTD_H_
12149 +#define _ASM_M68K_UNISTD_H_
12150 +
12151 +/*
12152 + * This file contains the system call numbers.
12153 + */
12154 +
12155 +#define __NR_restart_syscall 0
12156 +#define __NR_exit 1
12157 +#define __NR_fork 2
12158 +#define __NR_read 3
12159 +#define __NR_write 4
12160 +#define __NR_open 5
12161 +#define __NR_close 6
12162 +#define __NR_waitpid 7
12163 +#define __NR_creat 8
12164 +#define __NR_link 9
12165 +#define __NR_unlink 10
12166 +#define __NR_execve 11
12167 +#define __NR_chdir 12
12168 +#define __NR_time 13
12169 +#define __NR_mknod 14
12170 +#define __NR_chmod 15
12171 +#define __NR_chown 16
12172 +#define __NR_break 17
12173 +#define __NR_oldstat 18
12174 +#define __NR_lseek 19
12175 +#define __NR_getpid 20
12176 +#define __NR_mount 21
12177 +#define __NR_umount 22
12178 +#define __NR_setuid 23
12179 +#define __NR_getuid 24
12180 +#define __NR_stime 25
12181 +#define __NR_ptrace 26
12182 +#define __NR_alarm 27
12183 +#define __NR_oldfstat 28
12184 +#define __NR_pause 29
12185 +#define __NR_utime 30
12186 +#define __NR_stty 31
12187 +#define __NR_gtty 32
12188 +#define __NR_access 33
12189 +#define __NR_nice 34
12190 +#define __NR_ftime 35
12191 +#define __NR_sync 36
12192 +#define __NR_kill 37
12193 +#define __NR_rename 38
12194 +#define __NR_mkdir 39
12195 +#define __NR_rmdir 40
12196 +#define __NR_dup 41
12197 +#define __NR_pipe 42
12198 +#define __NR_times 43
12199 +#define __NR_prof 44
12200 +#define __NR_brk 45
12201 +#define __NR_setgid 46
12202 +#define __NR_getgid 47
12203 +#define __NR_signal 48
12204 +#define __NR_geteuid 49
12205 +#define __NR_getegid 50
12206 +#define __NR_acct 51
12207 +#define __NR_umount2 52
12208 +#define __NR_lock 53
12209 +#define __NR_ioctl 54
12210 +#define __NR_fcntl 55
12211 +#define __NR_mpx 56
12212 +#define __NR_setpgid 57
12213 +#define __NR_ulimit 58
12214 +#define __NR_oldolduname 59
12215 +#define __NR_umask 60
12216 +#define __NR_chroot 61
12217 +#define __NR_ustat 62
12218 +#define __NR_dup2 63
12219 +#define __NR_getppid 64
12220 +#define __NR_getpgrp 65
12221 +#define __NR_setsid 66
12222 +#define __NR_sigaction 67
12223 +#define __NR_sgetmask 68
12224 +#define __NR_ssetmask 69
12225 +#define __NR_setreuid 70
12226 +#define __NR_setregid 71
12227 +#define __NR_sigsuspend 72
12228 +#define __NR_sigpending 73
12229 +#define __NR_sethostname 74
12230 +#define __NR_setrlimit 75
12231 +#define __NR_getrlimit 76
12232 +#define __NR_getrusage 77
12233 +#define __NR_gettimeofday 78
12234 +#define __NR_settimeofday 79
12235 +#define __NR_getgroups 80
12236 +#define __NR_setgroups 81
12237 +#define __NR_select 82
12238 +#define __NR_symlink 83
12239 +#define __NR_oldlstat 84
12240 +#define __NR_readlink 85
12241 +#define __NR_uselib 86
12242 +#define __NR_swapon 87
12243 +#define __NR_reboot 88
12244 +#define __NR_readdir 89
12245 +#define __NR_mmap 90
12246 +#define __NR_munmap 91
12247 +#define __NR_truncate 92
12248 +#define __NR_ftruncate 93
12249 +#define __NR_fchmod 94
12250 +#define __NR_fchown 95
12251 +#define __NR_getpriority 96
12252 +#define __NR_setpriority 97
12253 +#define __NR_profil 98
12254 +#define __NR_statfs 99
12255 +#define __NR_fstatfs 100
12256 +#define __NR_ioperm 101
12257 +#define __NR_socketcall 102
12258 +#define __NR_syslog 103
12259 +#define __NR_setitimer 104
12260 +#define __NR_getitimer 105
12261 +#define __NR_stat 106
12262 +#define __NR_lstat 107
12263 +#define __NR_fstat 108
12264 +#define __NR_olduname 109
12265 +#define __NR_iopl /* 110 */ not supported
12266 +#define __NR_vhangup 111
12267 +#define __NR_idle /* 112 */ Obsolete
12268 +#define __NR_vm86 /* 113 */ not supported
12269 +#define __NR_wait4 114
12270 +#define __NR_swapoff 115
12271 +#define __NR_sysinfo 116
12272 +#define __NR_ipc 117
12273 +#define __NR_fsync 118
12274 +#define __NR_sigreturn 119
12275 +#define __NR_clone 120
12276 +#define __NR_setdomainname 121
12277 +#define __NR_uname 122
12278 +#define __NR_cacheflush 123
12279 +#define __NR_adjtimex 124
12280 +#define __NR_mprotect 125
12281 +#define __NR_sigprocmask 126
12282 +#define __NR_create_module 127
12283 +#define __NR_init_module 128
12284 +#define __NR_delete_module 129
12285 +#define __NR_get_kernel_syms 130
12286 +#define __NR_quotactl 131
12287 +#define __NR_getpgid 132
12288 +#define __NR_fchdir 133
12289 +#define __NR_bdflush 134
12290 +#define __NR_sysfs 135
12291 +#define __NR_personality 136
12292 +#define __NR_afs_syscall 137 /* Syscall for Andrew File System */
12293 +#define __NR_setfsuid 138
12294 +#define __NR_setfsgid 139
12295 +#define __NR__llseek 140
12296 +#define __NR_getdents 141
12297 +#define __NR__newselect 142
12298 +#define __NR_flock 143
12299 +#define __NR_msync 144
12300 +#define __NR_readv 145
12301 +#define __NR_writev 146
12302 +#define __NR_getsid 147
12303 +#define __NR_fdatasync 148
12304 +#define __NR__sysctl 149
12305 +#define __NR_mlock 150
12306 +#define __NR_munlock 151
12307 +#define __NR_mlockall 152
12308 +#define __NR_munlockall 153
12309 +#define __NR_sched_setparam 154
12310 +#define __NR_sched_getparam 155
12311 +#define __NR_sched_setscheduler 156
12312 +#define __NR_sched_getscheduler 157
12313 +#define __NR_sched_yield 158
12314 +#define __NR_sched_get_priority_max 159
12315 +#define __NR_sched_get_priority_min 160
12316 +#define __NR_sched_rr_get_interval 161
12317 +#define __NR_nanosleep 162
12318 +#define __NR_mremap 163
12319 +#define __NR_setresuid 164
12320 +#define __NR_getresuid 165
12321 +#define __NR_getpagesize 166
12322 +#define __NR_query_module 167
12323 +#define __NR_poll 168
12324 +#define __NR_nfsservctl 169
12325 +#define __NR_setresgid 170
12326 +#define __NR_getresgid 171
12327 +#define __NR_prctl 172
12328 +#define __NR_rt_sigreturn 173
12329 +#define __NR_rt_sigaction 174
12330 +#define __NR_rt_sigprocmask 175
12331 +#define __NR_rt_sigpending 176
12332 +#define __NR_rt_sigtimedwait 177
12333 +#define __NR_rt_sigqueueinfo 178
12334 +#define __NR_rt_sigsuspend 179
12335 +#define __NR_pread64 180
12336 +#define __NR_pwrite64 181
12337 +#define __NR_lchown 182
12338 +#define __NR_getcwd 183
12339 +#define __NR_capget 184
12340 +#define __NR_capset 185
12341 +#define __NR_sigaltstack 186
12342 +#define __NR_sendfile 187
12343 +#define __NR_getpmsg 188 /* some people actually want streams */
12344 +#define __NR_putpmsg 189 /* some people actually want streams */
12345 +#define __NR_vfork 190
12346 +#define __NR_ugetrlimit 191
12347 +#define __NR_mmap2 192
12348 +#define __NR_truncate64 193
12349 +#define __NR_ftruncate64 194
12350 +#define __NR_stat64 195
12351 +#define __NR_lstat64 196
12352 +#define __NR_fstat64 197
12353 +#define __NR_chown32 198
12354 +#define __NR_getuid32 199
12355 +#define __NR_getgid32 200
12356 +#define __NR_geteuid32 201
12357 +#define __NR_getegid32 202
12358 +#define __NR_setreuid32 203
12359 +#define __NR_setregid32 204
12360 +#define __NR_getgroups32 205
12361 +#define __NR_setgroups32 206
12362 +#define __NR_fchown32 207
12363 +#define __NR_setresuid32 208
12364 +#define __NR_getresuid32 209
12365 +#define __NR_setresgid32 210
12366 +#define __NR_getresgid32 211
12367 +#define __NR_lchown32 212
12368 +#define __NR_setuid32 213
12369 +#define __NR_setgid32 214
12370 +#define __NR_setfsuid32 215
12371 +#define __NR_setfsgid32 216
12372 +#define __NR_pivot_root 217
12373 +#define __NR_getdents64 220
12374 +#define __NR_gettid 221
12375 +#define __NR_tkill 222
12376 +#define __NR_setxattr 223
12377 +#define __NR_lsetxattr 224
12378 +#define __NR_fsetxattr 225
12379 +#define __NR_getxattr 226
12380 +#define __NR_lgetxattr 227
12381 +#define __NR_fgetxattr 228
12382 +#define __NR_listxattr 229
12383 +#define __NR_llistxattr 230
12384 +#define __NR_flistxattr 231
12385 +#define __NR_removexattr 232
12386 +#define __NR_lremovexattr 233
12387 +#define __NR_fremovexattr 234
12388 +#define __NR_futex 235
12389 +#define __NR_sendfile64 236
12390 +#define __NR_mincore 237
12391 +#define __NR_madvise 238
12392 +#define __NR_fcntl64 239
12393 +#define __NR_readahead 240
12394 +#define __NR_io_setup 241
12395 +#define __NR_io_destroy 242
12396 +#define __NR_io_getevents 243
12397 +#define __NR_io_submit 244
12398 +#define __NR_io_cancel 245
12399 +#define __NR_fadvise64 246
12400 +#define __NR_exit_group 247
12401 +#define __NR_lookup_dcookie 248
12402 +#define __NR_epoll_create 249
12403 +#define __NR_epoll_ctl 250
12404 +#define __NR_epoll_wait 251
12405 +#define __NR_remap_file_pages 252
12406 +#define __NR_set_tid_address 253
12407 +#define __NR_timer_create 254
12408 +#define __NR_timer_settime 255
12409 +#define __NR_timer_gettime 256
12410 +#define __NR_timer_getoverrun 257
12411 +#define __NR_timer_delete 258
12412 +#define __NR_clock_settime 259
12413 +#define __NR_clock_gettime 260
12414 +#define __NR_clock_getres 261
12415 +#define __NR_clock_nanosleep 262
12416 +#define __NR_statfs64 263
12417 +#define __NR_fstatfs64 264
12418 +#define __NR_tgkill 265
12419 +#define __NR_utimes 266
12420 +#define __NR_fadvise64_64 267
12421 +#define __NR_mbind 268
12422 +#define __NR_get_mempolicy 269
12423 +#define __NR_set_mempolicy 270
12424 +#define __NR_mq_open 271
12425 +#define __NR_mq_unlink 272
12426 +#define __NR_mq_timedsend 273
12427 +#define __NR_mq_timedreceive 274
12428 +#define __NR_mq_notify 275
12429 +#define __NR_mq_getsetattr 276
12430 +#define __NR_waitid 277
12431 +#define __NR_vserver 278
12432 +#define __NR_add_key 279
12433 +#define __NR_request_key 280
12434 +#define __NR_keyctl 281
12435 +#define __NR_ioprio_set 282
12436 +#define __NR_ioprio_get 283
12437 +#define __NR_inotify_init 284
12438 +#define __NR_inotify_add_watch 285
12439 +#define __NR_inotify_rm_watch 286
12440 +#define __NR_migrate_pages 287
12441 +#define __NR_openat 288
12442 +#define __NR_mkdirat 289
12443 +#define __NR_mknodat 290
12444 +#define __NR_fchownat 291
12445 +#define __NR_futimesat 292
12446 +#define __NR_fstatat64 293
12447 +#define __NR_unlinkat 294
12448 +#define __NR_renameat 295
12449 +#define __NR_linkat 296
12450 +#define __NR_symlinkat 297
12451 +#define __NR_readlinkat 298
12452 +#define __NR_fchmodat 299
12453 +#define __NR_faccessat 300
12454 +#define __NR_pselect6 301
12455 +#define __NR_ppoll 302
12456 +#define __NR_unshare 303
12457 +#define __NR_set_robust_list 304
12458 +#define __NR_get_robust_list 305
12459 +#define __NR_splice 306
12460 +#define __NR_sync_file_range 307
12461 +#define __NR_tee 308
12462 +#define __NR_vmsplice 309
12463 +#define __NR_move_pages 310
12464 +#define __NR_sched_setaffinity 311
12465 +#define __NR_sched_getaffinity 312
12466 +#define __NR_kexec_load 313
12467 +#define __NR_getcpu 314
12468 +#define __NR_epoll_pwait 315
12469 +#define __NR_utimensat 316
12470 +#define __NR_signalfd 317
12471 +#define __NR_timerfd_create 318
12472 +#define __NR_eventfd 319
12473 +#define __NR_fallocate 320
12474 +#define __NR_timerfd_settime 321
12475 +#define __NR_timerfd_gettime 322
12476 +#define __NR_signalfd4 323
12477 +#define __NR_eventfd2 324
12478 +#define __NR_epoll_create1 325
12479 +#define __NR_dup3 326
12480 +#define __NR_pipe2 327
12481 +#define __NR_inotify_init1 328
12482 +
12483 +#ifdef __KERNEL__
12484 +
12485 +#define NR_syscalls 329
12486 +
12487 +#define __ARCH_WANT_IPC_PARSE_VERSION
12488 +#define __ARCH_WANT_OLD_READDIR
12489 +#define __ARCH_WANT_OLD_STAT
12490 +#define __ARCH_WANT_STAT64
12491 +#define __ARCH_WANT_SYS_ALARM
12492 +#define __ARCH_WANT_SYS_GETHOSTNAME
12493 +#define __ARCH_WANT_SYS_PAUSE
12494 +#define __ARCH_WANT_SYS_SGETMASK
12495 +#define __ARCH_WANT_SYS_SIGNAL
12496 +#define __ARCH_WANT_SYS_TIME
12497 +#define __ARCH_WANT_SYS_UTIME
12498 +#define __ARCH_WANT_SYS_WAITPID
12499 +#define __ARCH_WANT_SYS_SOCKETCALL
12500 +#define __ARCH_WANT_SYS_FADVISE64
12501 +#define __ARCH_WANT_SYS_GETPGRP
12502 +#define __ARCH_WANT_SYS_LLSEEK
12503 +#define __ARCH_WANT_SYS_NICE
12504 +#define __ARCH_WANT_SYS_OLD_GETRLIMIT
12505 +#define __ARCH_WANT_SYS_OLDUMOUNT
12506 +#define __ARCH_WANT_SYS_SIGPENDING
12507 +#define __ARCH_WANT_SYS_SIGPROCMASK
12508 +#define __ARCH_WANT_SYS_RT_SIGACTION
12509 +
12510 +/*
12511 + * "Conditional" syscalls
12512 + *
12513 + * What we want is __attribute__((weak,alias("sys_ni_syscall"))),
12514 + * but it doesn't work on all toolchains, so we just do it by hand
12515 + */
12516 +#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
12517 +
12518 +#endif /* __KERNEL__ */
12519 +#endif /* _ASM_M68K_UNISTD_H_ */
12520 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/m68k/include/asm/unistd_no.h linux-2.6.29-rc3.owrt/arch/m68k/include/asm/unistd_no.h
12521 --- linux-2.6.29.owrt/arch/m68k/include/asm/unistd_no.h 1970-01-01 01:00:00.000000000 +0100
12522 +++ linux-2.6.29-rc3.owrt/arch/m68k/include/asm/unistd_no.h 2009-05-10 23:48:28.000000000 +0200
12523 @@ -0,0 +1,372 @@
12524 +#ifndef _ASM_M68K_UNISTD_H_
12525 +#define _ASM_M68K_UNISTD_H_
12526 +
12527 +/*
12528 + * This file contains the system call numbers.
12529 + */
12530 +
12531 +#define __NR_restart_syscall 0
12532 +#define __NR_exit 1
12533 +#define __NR_fork 2
12534 +#define __NR_read 3
12535 +#define __NR_write 4
12536 +#define __NR_open 5
12537 +#define __NR_close 6
12538 +#define __NR_waitpid 7
12539 +#define __NR_creat 8
12540 +#define __NR_link 9
12541 +#define __NR_unlink 10
12542 +#define __NR_execve 11
12543 +#define __NR_chdir 12
12544 +#define __NR_time 13
12545 +#define __NR_mknod 14
12546 +#define __NR_chmod 15
12547 +#define __NR_chown 16
12548 +#define __NR_break 17
12549 +#define __NR_oldstat 18
12550 +#define __NR_lseek 19
12551 +#define __NR_getpid 20
12552 +#define __NR_mount 21
12553 +#define __NR_umount 22
12554 +#define __NR_setuid 23
12555 +#define __NR_getuid 24
12556 +#define __NR_stime 25
12557 +#define __NR_ptrace 26
12558 +#define __NR_alarm 27
12559 +#define __NR_oldfstat 28
12560 +#define __NR_pause 29
12561 +#define __NR_utime 30
12562 +#define __NR_stty 31
12563 +#define __NR_gtty 32
12564 +#define __NR_access 33
12565 +#define __NR_nice 34
12566 +#define __NR_ftime 35
12567 +#define __NR_sync 36
12568 +#define __NR_kill 37
12569 +#define __NR_rename 38
12570 +#define __NR_mkdir 39
12571 +#define __NR_rmdir 40
12572 +#define __NR_dup 41
12573 +#define __NR_pipe 42
12574 +#define __NR_times 43
12575 +#define __NR_prof 44
12576 +#define __NR_brk 45
12577 +#define __NR_setgid 46
12578 +#define __NR_getgid 47
12579 +#define __NR_signal 48
12580 +#define __NR_geteuid 49
12581 +#define __NR_getegid 50
12582 +#define __NR_acct 51
12583 +#define __NR_umount2 52
12584 +#define __NR_lock 53
12585 +#define __NR_ioctl 54
12586 +#define __NR_fcntl 55
12587 +#define __NR_mpx 56
12588 +#define __NR_setpgid 57
12589 +#define __NR_ulimit 58
12590 +#define __NR_oldolduname 59
12591 +#define __NR_umask 60
12592 +#define __NR_chroot 61
12593 +#define __NR_ustat 62
12594 +#define __NR_dup2 63
12595 +#define __NR_getppid 64
12596 +#define __NR_getpgrp 65
12597 +#define __NR_setsid 66
12598 +#define __NR_sigaction 67
12599 +#define __NR_sgetmask 68
12600 +#define __NR_ssetmask 69
12601 +#define __NR_setreuid 70
12602 +#define __NR_setregid 71
12603 +#define __NR_sigsuspend 72
12604 +#define __NR_sigpending 73
12605 +#define __NR_sethostname 74
12606 +#define __NR_setrlimit 75
12607 +#define __NR_getrlimit 76
12608 +#define __NR_getrusage 77
12609 +#define __NR_gettimeofday 78
12610 +#define __NR_settimeofday 79
12611 +#define __NR_getgroups 80
12612 +#define __NR_setgroups 81
12613 +#define __NR_select 82
12614 +#define __NR_symlink 83
12615 +#define __NR_oldlstat 84
12616 +#define __NR_readlink 85
12617 +#define __NR_uselib 86
12618 +#define __NR_swapon 87
12619 +#define __NR_reboot 88
12620 +#define __NR_readdir 89
12621 +#define __NR_mmap 90
12622 +#define __NR_munmap 91
12623 +#define __NR_truncate 92
12624 +#define __NR_ftruncate 93
12625 +#define __NR_fchmod 94
12626 +#define __NR_fchown 95
12627 +#define __NR_getpriority 96
12628 +#define __NR_setpriority 97
12629 +#define __NR_profil 98
12630 +#define __NR_statfs 99
12631 +#define __NR_fstatfs 100
12632 +#define __NR_ioperm 101
12633 +#define __NR_socketcall 102
12634 +#define __NR_syslog 103
12635 +#define __NR_setitimer 104
12636 +#define __NR_getitimer 105
12637 +#define __NR_stat 106
12638 +#define __NR_lstat 107
12639 +#define __NR_fstat 108
12640 +#define __NR_olduname 109
12641 +#define __NR_iopl /* 110 */ not supported
12642 +#define __NR_vhangup 111
12643 +#define __NR_idle /* 112 */ Obsolete
12644 +#define __NR_vm86 /* 113 */ not supported
12645 +#define __NR_wait4 114
12646 +#define __NR_swapoff 115
12647 +#define __NR_sysinfo 116
12648 +#define __NR_ipc 117
12649 +#define __NR_fsync 118
12650 +#define __NR_sigreturn 119
12651 +#define __NR_clone 120
12652 +#define __NR_setdomainname 121
12653 +#define __NR_uname 122
12654 +#define __NR_cacheflush 123
12655 +#define __NR_adjtimex 124
12656 +#define __NR_mprotect 125
12657 +#define __NR_sigprocmask 126
12658 +#define __NR_create_module 127
12659 +#define __NR_init_module 128
12660 +#define __NR_delete_module 129
12661 +#define __NR_get_kernel_syms 130
12662 +#define __NR_quotactl 131
12663 +#define __NR_getpgid 132
12664 +#define __NR_fchdir 133
12665 +#define __NR_bdflush 134
12666 +#define __NR_sysfs 135
12667 +#define __NR_personality 136
12668 +#define __NR_afs_syscall 137 /* Syscall for Andrew File System */
12669 +#define __NR_setfsuid 138
12670 +#define __NR_setfsgid 139
12671 +#define __NR__llseek 140
12672 +#define __NR_getdents 141
12673 +#define __NR__newselect 142
12674 +#define __NR_flock 143
12675 +#define __NR_msync 144
12676 +#define __NR_readv 145
12677 +#define __NR_writev 146
12678 +#define __NR_getsid 147
12679 +#define __NR_fdatasync 148
12680 +#define __NR__sysctl 149
12681 +#define __NR_mlock 150
12682 +#define __NR_munlock 151
12683 +#define __NR_mlockall 152
12684 +#define __NR_munlockall 153
12685 +#define __NR_sched_setparam 154
12686 +#define __NR_sched_getparam 155
12687 +#define __NR_sched_setscheduler 156
12688 +#define __NR_sched_getscheduler 157
12689 +#define __NR_sched_yield 158
12690 +#define __NR_sched_get_priority_max 159
12691 +#define __NR_sched_get_priority_min 160
12692 +#define __NR_sched_rr_get_interval 161
12693 +#define __NR_nanosleep 162
12694 +#define __NR_mremap 163
12695 +#define __NR_setresuid 164
12696 +#define __NR_getresuid 165
12697 +#define __NR_getpagesize 166
12698 +#define __NR_query_module 167
12699 +#define __NR_poll 168
12700 +#define __NR_nfsservctl 169
12701 +#define __NR_setresgid 170
12702 +#define __NR_getresgid 171
12703 +#define __NR_prctl 172
12704 +#define __NR_rt_sigreturn 173
12705 +#define __NR_rt_sigaction 174
12706 +#define __NR_rt_sigprocmask 175
12707 +#define __NR_rt_sigpending 176
12708 +#define __NR_rt_sigtimedwait 177
12709 +#define __NR_rt_sigqueueinfo 178
12710 +#define __NR_rt_sigsuspend 179
12711 +#define __NR_pread64 180
12712 +#define __NR_pwrite64 181
12713 +#define __NR_lchown 182
12714 +#define __NR_getcwd 183
12715 +#define __NR_capget 184
12716 +#define __NR_capset 185
12717 +#define __NR_sigaltstack 186
12718 +#define __NR_sendfile 187
12719 +#define __NR_getpmsg 188 /* some people actually want streams */
12720 +#define __NR_putpmsg 189 /* some people actually want streams */
12721 +#define __NR_vfork 190
12722 +#define __NR_ugetrlimit 191
12723 +#define __NR_mmap2 192
12724 +#define __NR_truncate64 193
12725 +#define __NR_ftruncate64 194
12726 +#define __NR_stat64 195
12727 +#define __NR_lstat64 196
12728 +#define __NR_fstat64 197
12729 +#define __NR_chown32 198
12730 +#define __NR_getuid32 199
12731 +#define __NR_getgid32 200
12732 +#define __NR_geteuid32 201
12733 +#define __NR_getegid32 202
12734 +#define __NR_setreuid32 203
12735 +#define __NR_setregid32 204
12736 +#define __NR_getgroups32 205
12737 +#define __NR_setgroups32 206
12738 +#define __NR_fchown32 207
12739 +#define __NR_setresuid32 208
12740 +#define __NR_getresuid32 209
12741 +#define __NR_setresgid32 210
12742 +#define __NR_getresgid32 211
12743 +#define __NR_lchown32 212
12744 +#define __NR_setuid32 213
12745 +#define __NR_setgid32 214
12746 +#define __NR_setfsuid32 215
12747 +#define __NR_setfsgid32 216
12748 +#define __NR_pivot_root 217
12749 +#define __NR_getdents64 220
12750 +#define __NR_gettid 221
12751 +#define __NR_tkill 222
12752 +#define __NR_setxattr 223
12753 +#define __NR_lsetxattr 224
12754 +#define __NR_fsetxattr 225
12755 +#define __NR_getxattr 226
12756 +#define __NR_lgetxattr 227
12757 +#define __NR_fgetxattr 228
12758 +#define __NR_listxattr 229
12759 +#define __NR_llistxattr 230
12760 +#define __NR_flistxattr 231
12761 +#define __NR_removexattr 232
12762 +#define __NR_lremovexattr 233
12763 +#define __NR_fremovexattr 234
12764 +#define __NR_futex 235
12765 +#define __NR_sendfile64 236
12766 +#define __NR_mincore 237
12767 +#define __NR_madvise 238
12768 +#define __NR_fcntl64 239
12769 +#define __NR_readahead 240
12770 +#define __NR_io_setup 241
12771 +#define __NR_io_destroy 242
12772 +#define __NR_io_getevents 243
12773 +#define __NR_io_submit 244
12774 +#define __NR_io_cancel 245
12775 +#define __NR_fadvise64 246
12776 +#define __NR_exit_group 247
12777 +#define __NR_lookup_dcookie 248
12778 +#define __NR_epoll_create 249
12779 +#define __NR_epoll_ctl 250
12780 +#define __NR_epoll_wait 251
12781 +#define __NR_remap_file_pages 252
12782 +#define __NR_set_tid_address 253
12783 +#define __NR_timer_create 254
12784 +#define __NR_timer_settime 255
12785 +#define __NR_timer_gettime 256
12786 +#define __NR_timer_getoverrun 257
12787 +#define __NR_timer_delete 258
12788 +#define __NR_clock_settime 259
12789 +#define __NR_clock_gettime 260
12790 +#define __NR_clock_getres 261
12791 +#define __NR_clock_nanosleep 262
12792 +#define __NR_statfs64 263
12793 +#define __NR_fstatfs64 264
12794 +#define __NR_tgkill 265
12795 +#define __NR_utimes 266
12796 +#define __NR_fadvise64_64 267
12797 +#define __NR_mbind 268
12798 +#define __NR_get_mempolicy 269
12799 +#define __NR_set_mempolicy 270
12800 +#define __NR_mq_open 271
12801 +#define __NR_mq_unlink 272
12802 +#define __NR_mq_timedsend 273
12803 +#define __NR_mq_timedreceive 274
12804 +#define __NR_mq_notify 275
12805 +#define __NR_mq_getsetattr 276
12806 +#define __NR_waitid 277
12807 +#define __NR_vserver 278
12808 +#define __NR_add_key 279
12809 +#define __NR_request_key 280
12810 +#define __NR_keyctl 281
12811 +#define __NR_ioprio_set 282
12812 +#define __NR_ioprio_get 283
12813 +#define __NR_inotify_init 284
12814 +#define __NR_inotify_add_watch 285
12815 +#define __NR_inotify_rm_watch 286
12816 +#define __NR_migrate_pages 287
12817 +#define __NR_openat 288
12818 +#define __NR_mkdirat 289
12819 +#define __NR_mknodat 290
12820 +#define __NR_fchownat 291
12821 +#define __NR_futimesat 292
12822 +#define __NR_fstatat64 293
12823 +#define __NR_unlinkat 294
12824 +#define __NR_renameat 295
12825 +#define __NR_linkat 296
12826 +#define __NR_symlinkat 297
12827 +#define __NR_readlinkat 298
12828 +#define __NR_fchmodat 299
12829 +#define __NR_faccessat 300
12830 +#define __NR_pselect6 301
12831 +#define __NR_ppoll 302
12832 +#define __NR_unshare 303
12833 +#define __NR_set_robust_list 304
12834 +#define __NR_get_robust_list 305
12835 +#define __NR_splice 306
12836 +#define __NR_sync_file_range 307
12837 +#define __NR_tee 308
12838 +#define __NR_vmsplice 309
12839 +#define __NR_move_pages 310
12840 +#define __NR_sched_setaffinity 311
12841 +#define __NR_sched_getaffinity 312
12842 +#define __NR_kexec_load 313
12843 +#define __NR_getcpu 314
12844 +#define __NR_epoll_pwait 315
12845 +#define __NR_utimensat 316
12846 +#define __NR_signalfd 317
12847 +#define __NR_timerfd_create 318
12848 +#define __NR_eventfd 319
12849 +#define __NR_fallocate 320
12850 +#define __NR_timerfd_settime 321
12851 +#define __NR_timerfd_gettime 322
12852 +#define __NR_signalfd4 323
12853 +#define __NR_eventfd2 324
12854 +#define __NR_epoll_create1 325
12855 +#define __NR_dup3 326
12856 +#define __NR_pipe2 327
12857 +#define __NR_inotify_init1 328
12858 +
12859 +#ifdef __KERNEL__
12860 +
12861 +#define NR_syscalls 329
12862 +
12863 +#define __ARCH_WANT_IPC_PARSE_VERSION
12864 +#define __ARCH_WANT_OLD_READDIR
12865 +#define __ARCH_WANT_OLD_STAT
12866 +#define __ARCH_WANT_STAT64
12867 +#define __ARCH_WANT_SYS_ALARM
12868 +#define __ARCH_WANT_SYS_GETHOSTNAME
12869 +#define __ARCH_WANT_SYS_PAUSE
12870 +#define __ARCH_WANT_SYS_SGETMASK
12871 +#define __ARCH_WANT_SYS_SIGNAL
12872 +#define __ARCH_WANT_SYS_TIME
12873 +#define __ARCH_WANT_SYS_UTIME
12874 +#define __ARCH_WANT_SYS_WAITPID
12875 +#define __ARCH_WANT_SYS_SOCKETCALL
12876 +#define __ARCH_WANT_SYS_FADVISE64
12877 +#define __ARCH_WANT_SYS_GETPGRP
12878 +#define __ARCH_WANT_SYS_LLSEEK
12879 +#define __ARCH_WANT_SYS_NICE
12880 +#define __ARCH_WANT_SYS_OLD_GETRLIMIT
12881 +#define __ARCH_WANT_SYS_OLDUMOUNT
12882 +#define __ARCH_WANT_SYS_SIGPENDING
12883 +#define __ARCH_WANT_SYS_SIGPROCMASK
12884 +#define __ARCH_WANT_SYS_RT_SIGACTION
12885 +
12886 +/*
12887 + * "Conditional" syscalls
12888 + *
12889 + * What we want is __attribute__((weak,alias("sys_ni_syscall"))),
12890 + * but it doesn't work on all toolchains, so we just do it by hand
12891 + */
12892 +#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
12893 +
12894 +#endif /* __KERNEL__ */
12895 +#endif /* _ASM_M68K_UNISTD_H_ */
12896 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/m68knommu/platform/5206e/config.c linux-2.6.29-rc3.owrt/arch/m68knommu/platform/5206e/config.c
12897 --- linux-2.6.29.owrt/arch/m68knommu/platform/5206e/config.c 2009-05-10 22:04:41.000000000 +0200
12898 +++ linux-2.6.29-rc3.owrt/arch/m68knommu/platform/5206e/config.c 2009-05-10 23:48:28.000000000 +0200
12899 @@ -17,7 +17,6 @@
12900 #include <asm/coldfire.h>
12901 #include <asm/mcfsim.h>
12902 #include <asm/mcfdma.h>
12903 -#include <asm/mcfuart.h>
12904
12905 /***************************************************************************/
12906
12907 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/m68knommu/platform/528x/config.c linux-2.6.29-rc3.owrt/arch/m68knommu/platform/528x/config.c
12908 --- linux-2.6.29.owrt/arch/m68knommu/platform/528x/config.c 2009-05-10 22:04:41.000000000 +0200
12909 +++ linux-2.6.29-rc3.owrt/arch/m68knommu/platform/528x/config.c 2009-05-10 23:48:28.000000000 +0200
12910 @@ -24,6 +24,7 @@
12911 #include <asm/coldfire.h>
12912 #include <asm/mcfsim.h>
12913 #include <asm/mcfuart.h>
12914 +#include <asm/mcfqspi.h>
12915
12916 #ifdef CONFIG_MTD_PARTITIONS
12917 #include <linux/mtd/partitions.h>
12918 @@ -32,6 +33,233 @@
12919 /***************************************************************************/
12920
12921 void coldfire_reset(void);
12922 +static void coldfire_qspi_cs_control(u8 cs, u8 command);
12923 +
12924 +/***************************************************************************/
12925 +
12926 +#if defined(CONFIG_SPI)
12927 +
12928 +#if defined(CONFIG_WILDFIRE)
12929 +#define SPI_NUM_CHIPSELECTS 0x02
12930 +#define SPI_PAR_VAL 0x07 /* Enable DIN, DOUT, CLK */
12931 +#define SPI_CS_MASK 0x18
12932 +
12933 +#define FLASH_BLOCKSIZE (1024*64)
12934 +#define FLASH_NUMBLOCKS 16
12935 +#define FLASH_TYPE "m25p80"
12936 +
12937 +#define M25P80_CS 0
12938 +#define MMC_CS 1
12939 +
12940 +#ifdef CONFIG_MTD_PARTITIONS
12941 +static struct mtd_partition stm25p_partitions[] = {
12942 + /* sflash */
12943 + [0] = {
12944 + .name = "stm25p80",
12945 + .offset = 0x00000000,
12946 + .size = FLASH_BLOCKSIZE * FLASH_NUMBLOCKS,
12947 + .mask_flags = 0
12948 + }
12949 +};
12950 +
12951 +#endif
12952 +
12953 +#elif defined(CONFIG_WILDFIREMOD)
12954 +
12955 +#define SPI_NUM_CHIPSELECTS 0x08
12956 +#define SPI_PAR_VAL 0x07 /* Enable DIN, DOUT, CLK */
12957 +#define SPI_CS_MASK 0x78
12958 +
12959 +#define FLASH_BLOCKSIZE (1024*64)
12960 +#define FLASH_NUMBLOCKS 64
12961 +#define FLASH_TYPE "m25p32"
12962 +/* Reserve 1M for the kernel parition */
12963 +#define FLASH_KERNEL_SIZE (1024 * 1024)
12964 +
12965 +#define M25P80_CS 5
12966 +#define MMC_CS 6
12967 +
12968 +#ifdef CONFIG_MTD_PARTITIONS
12969 +static struct mtd_partition stm25p_partitions[] = {
12970 + /* sflash */
12971 + [0] = {
12972 + .name = "kernel",
12973 + .offset = FLASH_BLOCKSIZE * FLASH_NUMBLOCKS - FLASH_KERNEL_SIZE,
12974 + .size = FLASH_KERNEL_SIZE,
12975 + .mask_flags = 0
12976 + },
12977 + [1] = {
12978 + .name = "image",
12979 + .offset = 0x00000000,
12980 + .size = FLASH_BLOCKSIZE * FLASH_NUMBLOCKS - FLASH_KERNEL_SIZE,
12981 + .mask_flags = 0
12982 + },
12983 + [2] = {
12984 + .name = "all",
12985 + .offset = 0x00000000,
12986 + .size = FLASH_BLOCKSIZE * FLASH_NUMBLOCKS,
12987 + .mask_flags = 0
12988 + }
12989 +};
12990 +#endif
12991 +
12992 +#else
12993 +#define SPI_NUM_CHIPSELECTS 0x04
12994 +#define SPI_PAR_VAL 0x7F /* Enable DIN, DOUT, CLK, CS0 - CS4 */
12995 +#endif
12996 +
12997 +#ifdef MMC_CS
12998 +static struct coldfire_spi_chip flash_chip_info = {
12999 + .mode = SPI_MODE_0,
13000 + .bits_per_word = 16,
13001 + .del_cs_to_clk = 17,
13002 + .del_after_trans = 1,
13003 + .void_write_data = 0
13004 +};
13005 +
13006 +static struct coldfire_spi_chip mmc_chip_info = {
13007 + .mode = SPI_MODE_0,
13008 + .bits_per_word = 16,
13009 + .del_cs_to_clk = 17,
13010 + .del_after_trans = 1,
13011 + .void_write_data = 0xFFFF
13012 +};
13013 +#endif
13014 +
13015 +#ifdef M25P80_CS
13016 +static struct flash_platform_data stm25p80_platform_data = {
13017 + .name = "ST M25P80 SPI Flash chip",
13018 +#ifdef CONFIG_MTD_PARTITIONS
13019 + .parts = stm25p_partitions,
13020 + .nr_parts = sizeof(stm25p_partitions) / sizeof(*stm25p_partitions),
13021 +#endif
13022 + .type = FLASH_TYPE
13023 +};
13024 +#endif
13025 +
13026 +static struct spi_board_info spi_board_info[] __initdata = {
13027 +#ifdef M25P80_CS
13028 + {
13029 + .modalias = "m25p80",
13030 + .max_speed_hz = 16000000,
13031 + .bus_num = 1,
13032 + .chip_select = M25P80_CS,
13033 + .platform_data = &stm25p80_platform_data,
13034 + .controller_data = &flash_chip_info
13035 + },
13036 +#endif
13037 +#ifdef MMC_CS
13038 + {
13039 + .modalias = "mmc_spi",
13040 + .max_speed_hz = 16000000,
13041 + .bus_num = 1,
13042 + .chip_select = MMC_CS,
13043 + .controller_data = &mmc_chip_info
13044 + }
13045 +#endif
13046 +};
13047 +
13048 +static struct coldfire_spi_master coldfire_master_info = {
13049 + .bus_num = 1,
13050 + .num_chipselect = SPI_NUM_CHIPSELECTS,
13051 + .irq_source = MCF5282_QSPI_IRQ_SOURCE,
13052 + .irq_vector = MCF5282_QSPI_IRQ_VECTOR,
13053 + .irq_mask = ((0x01 << MCF5282_QSPI_IRQ_SOURCE) | 0x01),
13054 + .irq_lp = 0x2B, /* Level 5 and Priority 3 */
13055 + .par_val = SPI_PAR_VAL,
13056 + .cs_control = coldfire_qspi_cs_control,
13057 +};
13058 +
13059 +static struct resource coldfire_spi_resources[] = {
13060 + [0] = {
13061 + .name = "qspi-par",
13062 + .start = MCF5282_QSPI_PAR,
13063 + .end = MCF5282_QSPI_PAR,
13064 + .flags = IORESOURCE_MEM
13065 + },
13066 +
13067 + [1] = {
13068 + .name = "qspi-module",
13069 + .start = MCF5282_QSPI_QMR,
13070 + .end = MCF5282_QSPI_QMR + 0x18,
13071 + .flags = IORESOURCE_MEM
13072 + },
13073 +
13074 + [2] = {
13075 + .name = "qspi-int-level",
13076 + .start = MCF5282_INTC0 + MCFINTC_ICR0 + MCF5282_QSPI_IRQ_SOURCE,
13077 + .end = MCF5282_INTC0 + MCFINTC_ICR0 + MCF5282_QSPI_IRQ_SOURCE,
13078 + .flags = IORESOURCE_MEM
13079 + },
13080 +
13081 + [3] = {
13082 + .name = "qspi-int-mask",
13083 + .start = MCF5282_INTC0 + MCFINTC_IMRL,
13084 + .end = MCF5282_INTC0 + MCFINTC_IMRL,
13085 + .flags = IORESOURCE_MEM
13086 + }
13087 +};
13088 +
13089 +static struct platform_device coldfire_spi = {
13090 + .name = "spi_coldfire",
13091 + .id = -1,
13092 + .resource = coldfire_spi_resources,
13093 + .num_resources = ARRAY_SIZE(coldfire_spi_resources),
13094 + .dev = {
13095 + .platform_data = &coldfire_master_info,
13096 + }
13097 +};
13098 +
13099 +static void coldfire_qspi_cs_control(u8 cs, u8 command)
13100 +{
13101 + u8 cs_bit = ((0x01 << cs) << 3) & SPI_CS_MASK;
13102 +
13103 +#if defined(CONFIG_WILDFIRE)
13104 + u8 cs_mask = ~(((0x01 << cs) << 3) & SPI_CS_MASK);
13105 +#endif
13106 +#if defined(CONFIG_WILDFIREMOD)
13107 + u8 cs_mask = (cs << 3) & SPI_CS_MASK;
13108 +#endif
13109 +
13110 + /*
13111 + * Don't do anything if the chip select is not
13112 + * one of the port qs pins.
13113 + */
13114 + if (command & QSPI_CS_INIT) {
13115 +#if defined(CONFIG_WILDFIRE)
13116 + MCF5282_GPIO_DDRQS |= cs_bit;
13117 + MCF5282_GPIO_PQSPAR &= ~cs_bit;
13118 +#endif
13119 +
13120 +#if defined(CONFIG_WILDFIREMOD)
13121 + MCF5282_GPIO_DDRQS |= SPI_CS_MASK;
13122 + MCF5282_GPIO_PQSPAR &= ~SPI_CS_MASK;
13123 +#endif
13124 + }
13125 +
13126 + if (command & QSPI_CS_ASSERT) {
13127 + MCF5282_GPIO_PORTQS &= ~SPI_CS_MASK;
13128 + MCF5282_GPIO_PORTQS |= cs_mask;
13129 + } else if (command & QSPI_CS_DROP) {
13130 + MCF5282_GPIO_PORTQS |= SPI_CS_MASK;
13131 + }
13132 +}
13133 +
13134 +static int __init spi_dev_init(void)
13135 +{
13136 + int retval;
13137 +
13138 + retval = platform_device_register(&coldfire_spi);
13139 + if (retval < 0)
13140 + return retval;
13141 +
13142 + if (ARRAY_SIZE(spi_board_info))
13143 + retval = spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
13144 +
13145 + return retval;
13146 +}
13147 +
13148 +#endif /* CONFIG_SPI */
13149
13150 /***************************************************************************/
13151
13152 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/alchemy/common/time.c linux-2.6.29-rc3.owrt/arch/mips/alchemy/common/time.c
13153 --- linux-2.6.29.owrt/arch/mips/alchemy/common/time.c 2009-05-10 22:04:40.000000000 +0200
13154 +++ linux-2.6.29-rc3.owrt/arch/mips/alchemy/common/time.c 2009-05-10 23:48:28.000000000 +0200
13155 @@ -89,7 +89,7 @@
13156 .irq = AU1000_RTC_MATCH2_INT,
13157 .set_next_event = au1x_rtcmatch2_set_next_event,
13158 .set_mode = au1x_rtcmatch2_set_mode,
13159 - .cpumask = CPU_MASK_ALL_PTR,
13160 + .cpumask = CPU_MASK_ALL,
13161 };
13162
13163 static struct irqaction au1x_rtcmatch2_irqaction = {
13164 @@ -118,7 +118,7 @@
13165 * setup counter 1 (RTC) to tick at full speed
13166 */
13167 t = 0xffffff;
13168 - while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T1S) && --t)
13169 + while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T1S) && t--)
13170 asm volatile ("nop");
13171 if (!t)
13172 goto cntr_err;
13173 @@ -127,7 +127,7 @@
13174 au_sync();
13175
13176 t = 0xffffff;
13177 - while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S) && --t)
13178 + while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S) && t--)
13179 asm volatile ("nop");
13180 if (!t)
13181 goto cntr_err;
13182 @@ -135,7 +135,7 @@
13183 au_sync();
13184
13185 t = 0xffffff;
13186 - while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S) && --t)
13187 + while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S) && t--)
13188 asm volatile ("nop");
13189 if (!t)
13190 goto cntr_err;
13191 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/cavium-octeon/setup.c linux-2.6.29-rc3.owrt/arch/mips/cavium-octeon/setup.c
13192 --- linux-2.6.29.owrt/arch/mips/cavium-octeon/setup.c 2009-05-10 22:04:40.000000000 +0200
13193 +++ linux-2.6.29-rc3.owrt/arch/mips/cavium-octeon/setup.c 2009-05-10 23:48:28.000000000 +0200
13194 @@ -15,11 +15,13 @@
13195 #include <linux/serial.h>
13196 #include <linux/types.h>
13197 #include <linux/string.h> /* for memset */
13198 +#include <linux/serial.h>
13199 #include <linux/tty.h>
13200 #include <linux/time.h>
13201 #include <linux/platform_device.h>
13202 #include <linux/serial_core.h>
13203 #include <linux/serial_8250.h>
13204 +#include <linux/string.h>
13205
13206 #include <asm/processor.h>
13207 #include <asm/reboot.h>
13208 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/emma/Kconfig linux-2.6.29-rc3.owrt/arch/mips/emma/Kconfig
13209 --- linux-2.6.29.owrt/arch/mips/emma/Kconfig 1970-01-01 01:00:00.000000000 +0100
13210 +++ linux-2.6.29-rc3.owrt/arch/mips/emma/Kconfig 2009-05-10 23:48:28.000000000 +0200
13211 @@ -0,0 +1,29 @@
13212 +choice
13213 + prompt "Machine type"
13214 + depends on MACH_EMMA
13215 + default NEC_MARKEINS
13216 +
13217 +config NEC_MARKEINS
13218 + bool "NEC EMMA2RH Mark-eins board"
13219 + select SOC_EMMA2RH
13220 + select HW_HAS_PCI
13221 + help
13222 + This enables support for the NEC Electronics Mark-eins boards.
13223 +
13224 +endchoice
13225 +
13226 +config SOC_EMMA2RH
13227 + bool
13228 + select SOC_EMMA
13229 + select SYS_HAS_CPU_R5500
13230 + select SYS_SUPPORTS_32BIT_KERNEL
13231 + select SYS_SUPPORTS_64BIT_KERNEL
13232 +
13233 +config SOC_EMMA
13234 + bool
13235 + select CEVT_R4K
13236 + select CSRC_R4K
13237 + select DMA_NONCOHERENT
13238 + select IRQ_CPU
13239 + select SWAP_IO_SPACE
13240 + select SYS_SUPPORTS_BIG_ENDIAN
13241 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/emma/markeins/platform.c linux-2.6.29-rc3.owrt/arch/mips/emma/markeins/platform.c
13242 --- linux-2.6.29.owrt/arch/mips/emma/markeins/platform.c 2009-05-10 22:04:40.000000000 +0200
13243 +++ linux-2.6.29-rc3.owrt/arch/mips/emma/markeins/platform.c 2009-05-10 23:48:28.000000000 +0200
13244 @@ -141,6 +141,13 @@
13245 },
13246 };
13247
13248 +static struct platform_device *devices[] = {
13249 + &i2c_emma_devices[0],
13250 + &i2c_emma_devices[1],
13251 + &i2c_emma_devices[2],
13252 + &serial_emma,
13253 +};
13254 +
13255 static struct mtd_partition markeins_parts[] = {
13256 [0] = {
13257 .name = "RootFS",
13258 @@ -174,39 +181,11 @@
13259 },
13260 };
13261
13262 -static struct physmap_flash_data markeins_flash_data = {
13263 - .width = 2,
13264 - .nr_parts = ARRAY_SIZE(markeins_parts),
13265 - .parts = markeins_parts
13266 -};
13267 -
13268 -static struct resource markeins_flash_resource = {
13269 - .start = 0x1e000000,
13270 - .end = 0x02000000,
13271 - .flags = IORESOURCE_MEM
13272 -};
13273 -
13274 -static struct platform_device markeins_flash_device = {
13275 - .name = "physmap-flash",
13276 - .id = 0,
13277 - .dev = {
13278 - .platform_data = &markeins_flash_data,
13279 - },
13280 - .num_resources = 1,
13281 - .resource = &markeins_flash_resource,
13282 -};
13283 -
13284 -static struct platform_device *devices[] = {
13285 - i2c_emma_devices,
13286 - i2c_emma_devices + 1,
13287 - i2c_emma_devices + 2,
13288 - &serial_emma,
13289 - &markeins_flash_device,
13290 -};
13291 -
13292 static int __init platform_devices_setup(void)
13293 {
13294 + physmap_set_partitions(markeins_parts, ARRAY_SIZE(markeins_parts));
13295 return platform_add_devices(devices, ARRAY_SIZE(devices));
13296 }
13297
13298 arch_initcall(platform_devices_setup);
13299 +
13300 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/include/asm/atomic.h linux-2.6.29-rc3.owrt/arch/mips/include/asm/atomic.h
13301 --- linux-2.6.29.owrt/arch/mips/include/asm/atomic.h 2009-05-10 22:04:40.000000000 +0200
13302 +++ linux-2.6.29-rc3.owrt/arch/mips/include/asm/atomic.h 2009-05-10 23:48:28.000000000 +0200
13303 @@ -50,7 +50,7 @@
13304 static __inline__ void atomic_add(int i, atomic_t * v)
13305 {
13306 if (cpu_has_llsc && R10000_LLSC_WAR) {
13307 - int temp;
13308 + unsigned long temp;
13309
13310 __asm__ __volatile__(
13311 " .set mips3 \n"
13312 @@ -62,7 +62,7 @@
13313 : "=&r" (temp), "=m" (v->counter)
13314 : "Ir" (i), "m" (v->counter));
13315 } else if (cpu_has_llsc) {
13316 - int temp;
13317 + unsigned long temp;
13318
13319 __asm__ __volatile__(
13320 " .set mips3 \n"
13321 @@ -95,7 +95,7 @@
13322 static __inline__ void atomic_sub(int i, atomic_t * v)
13323 {
13324 if (cpu_has_llsc && R10000_LLSC_WAR) {
13325 - int temp;
13326 + unsigned long temp;
13327
13328 __asm__ __volatile__(
13329 " .set mips3 \n"
13330 @@ -107,7 +107,7 @@
13331 : "=&r" (temp), "=m" (v->counter)
13332 : "Ir" (i), "m" (v->counter));
13333 } else if (cpu_has_llsc) {
13334 - int temp;
13335 + unsigned long temp;
13336
13337 __asm__ __volatile__(
13338 " .set mips3 \n"
13339 @@ -135,12 +135,12 @@
13340 */
13341 static __inline__ int atomic_add_return(int i, atomic_t * v)
13342 {
13343 - int result;
13344 + unsigned long result;
13345
13346 smp_llsc_mb();
13347
13348 if (cpu_has_llsc && R10000_LLSC_WAR) {
13349 - int temp;
13350 + unsigned long temp;
13351
13352 __asm__ __volatile__(
13353 " .set mips3 \n"
13354 @@ -154,7 +154,7 @@
13355 : "Ir" (i), "m" (v->counter)
13356 : "memory");
13357 } else if (cpu_has_llsc) {
13358 - int temp;
13359 + unsigned long temp;
13360
13361 __asm__ __volatile__(
13362 " .set mips3 \n"
13363 @@ -187,12 +187,12 @@
13364
13365 static __inline__ int atomic_sub_return(int i, atomic_t * v)
13366 {
13367 - int result;
13368 + unsigned long result;
13369
13370 smp_llsc_mb();
13371
13372 if (cpu_has_llsc && R10000_LLSC_WAR) {
13373 - int temp;
13374 + unsigned long temp;
13375
13376 __asm__ __volatile__(
13377 " .set mips3 \n"
13378 @@ -206,7 +206,7 @@
13379 : "Ir" (i), "m" (v->counter)
13380 : "memory");
13381 } else if (cpu_has_llsc) {
13382 - int temp;
13383 + unsigned long temp;
13384
13385 __asm__ __volatile__(
13386 " .set mips3 \n"
13387 @@ -247,12 +247,12 @@
13388 */
13389 static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)
13390 {
13391 - int result;
13392 + unsigned long result;
13393
13394 smp_llsc_mb();
13395
13396 if (cpu_has_llsc && R10000_LLSC_WAR) {
13397 - int temp;
13398 + unsigned long temp;
13399
13400 __asm__ __volatile__(
13401 " .set mips3 \n"
13402 @@ -270,7 +270,7 @@
13403 : "Ir" (i), "m" (v->counter)
13404 : "memory");
13405 } else if (cpu_has_llsc) {
13406 - int temp;
13407 + unsigned long temp;
13408
13409 __asm__ __volatile__(
13410 " .set mips3 \n"
13411 @@ -429,7 +429,7 @@
13412 static __inline__ void atomic64_add(long i, atomic64_t * v)
13413 {
13414 if (cpu_has_llsc && R10000_LLSC_WAR) {
13415 - long temp;
13416 + unsigned long temp;
13417
13418 __asm__ __volatile__(
13419 " .set mips3 \n"
13420 @@ -441,7 +441,7 @@
13421 : "=&r" (temp), "=m" (v->counter)
13422 : "Ir" (i), "m" (v->counter));
13423 } else if (cpu_has_llsc) {
13424 - long temp;
13425 + unsigned long temp;
13426
13427 __asm__ __volatile__(
13428 " .set mips3 \n"
13429 @@ -474,7 +474,7 @@
13430 static __inline__ void atomic64_sub(long i, atomic64_t * v)
13431 {
13432 if (cpu_has_llsc && R10000_LLSC_WAR) {
13433 - long temp;
13434 + unsigned long temp;
13435
13436 __asm__ __volatile__(
13437 " .set mips3 \n"
13438 @@ -486,7 +486,7 @@
13439 : "=&r" (temp), "=m" (v->counter)
13440 : "Ir" (i), "m" (v->counter));
13441 } else if (cpu_has_llsc) {
13442 - long temp;
13443 + unsigned long temp;
13444
13445 __asm__ __volatile__(
13446 " .set mips3 \n"
13447 @@ -514,12 +514,12 @@
13448 */
13449 static __inline__ long atomic64_add_return(long i, atomic64_t * v)
13450 {
13451 - long result;
13452 + unsigned long result;
13453
13454 smp_llsc_mb();
13455
13456 if (cpu_has_llsc && R10000_LLSC_WAR) {
13457 - long temp;
13458 + unsigned long temp;
13459
13460 __asm__ __volatile__(
13461 " .set mips3 \n"
13462 @@ -533,7 +533,7 @@
13463 : "Ir" (i), "m" (v->counter)
13464 : "memory");
13465 } else if (cpu_has_llsc) {
13466 - long temp;
13467 + unsigned long temp;
13468
13469 __asm__ __volatile__(
13470 " .set mips3 \n"
13471 @@ -566,12 +566,12 @@
13472
13473 static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
13474 {
13475 - long result;
13476 + unsigned long result;
13477
13478 smp_llsc_mb();
13479
13480 if (cpu_has_llsc && R10000_LLSC_WAR) {
13481 - long temp;
13482 + unsigned long temp;
13483
13484 __asm__ __volatile__(
13485 " .set mips3 \n"
13486 @@ -585,7 +585,7 @@
13487 : "Ir" (i), "m" (v->counter)
13488 : "memory");
13489 } else if (cpu_has_llsc) {
13490 - long temp;
13491 + unsigned long temp;
13492
13493 __asm__ __volatile__(
13494 " .set mips3 \n"
13495 @@ -626,12 +626,12 @@
13496 */
13497 static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v)
13498 {
13499 - long result;
13500 + unsigned long result;
13501
13502 smp_llsc_mb();
13503
13504 if (cpu_has_llsc && R10000_LLSC_WAR) {
13505 - long temp;
13506 + unsigned long temp;
13507
13508 __asm__ __volatile__(
13509 " .set mips3 \n"
13510 @@ -649,7 +649,7 @@
13511 : "Ir" (i), "m" (v->counter)
13512 : "memory");
13513 } else if (cpu_has_llsc) {
13514 - long temp;
13515 + unsigned long temp;
13516
13517 __asm__ __volatile__(
13518 " .set mips3 \n"
13519 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/include/asm/compat.h linux-2.6.29-rc3.owrt/arch/mips/include/asm/compat.h
13520 --- linux-2.6.29.owrt/arch/mips/include/asm/compat.h 2009-05-10 22:04:40.000000000 +0200
13521 +++ linux-2.6.29-rc3.owrt/arch/mips/include/asm/compat.h 2009-05-10 23:48:28.000000000 +0200
13522 @@ -3,8 +3,6 @@
13523 /*
13524 * Architecture specific compatibility types
13525 */
13526 -#include <linux/seccomp.h>
13527 -#include <linux/thread_info.h>
13528 #include <linux/types.h>
13529 #include <asm/page.h>
13530 #include <asm/ptrace.h>
13531 @@ -220,9 +218,4 @@
13532 compat_ulong_t __unused2;
13533 };
13534
13535 -static inline int is_compat_task(void)
13536 -{
13537 - return test_thread_flag(TIF_32BIT);
13538 -}
13539 -
13540 #endif /* _ASM_COMPAT_H */
13541 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/include/asm/hazards.h linux-2.6.29-rc3.owrt/arch/mips/include/asm/hazards.h
13542 --- linux-2.6.29.owrt/arch/mips/include/asm/hazards.h 2009-05-10 22:04:40.000000000 +0200
13543 +++ linux-2.6.29-rc3.owrt/arch/mips/include/asm/hazards.h 2009-05-10 23:48:28.000000000 +0200
13544 @@ -138,8 +138,7 @@
13545 __instruction_hazard(); \
13546 } while (0)
13547
13548 -#elif defined(CONFIG_CPU_R10000) || defined(CONFIG_CPU_CAVIUM_OCTEON) || \
13549 - defined(CONFIG_CPU_R5500)
13550 +#elif defined(CONFIG_CPU_R10000) || defined(CONFIG_CPU_CAVIUM_OCTEON)
13551
13552 /*
13553 * R10000 rocks - all hazards handled in hardware, so this becomes a nobrainer.
13554 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/include/asm/mach-rc32434/gpio.h linux-2.6.29-rc3.owrt/arch/mips/include/asm/mach-rc32434/gpio.h
13555 --- linux-2.6.29.owrt/arch/mips/include/asm/mach-rc32434/gpio.h 2009-05-10 22:04:40.000000000 +0200
13556 +++ linux-2.6.29-rc3.owrt/arch/mips/include/asm/mach-rc32434/gpio.h 2009-05-10 23:48:28.000000000 +0200
13557 @@ -80,8 +80,11 @@
13558 /* Compact Flash GPIO pin */
13559 #define CF_GPIO_NUM 13
13560
13561 +extern void set_434_reg(unsigned reg_offs, unsigned bit, unsigned len, unsigned val);
13562 +extern unsigned get_434_reg(unsigned reg_offs);
13563 +extern void set_latch_u5(unsigned char or_mask, unsigned char nand_mask);
13564 +extern unsigned char get_latch_u5(void);
13565 extern void rb532_gpio_set_ilevel(int bit, unsigned gpio);
13566 extern void rb532_gpio_set_istat(int bit, unsigned gpio);
13567 -extern void rb532_gpio_set_func(unsigned gpio);
13568
13569 #endif /* _RC32434_GPIO_H_ */
13570 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/include/asm/mach-rc32434/irq.h linux-2.6.29-rc3.owrt/arch/mips/include/asm/mach-rc32434/irq.h
13571 --- linux-2.6.29.owrt/arch/mips/include/asm/mach-rc32434/irq.h 2009-05-10 22:04:40.000000000 +0200
13572 +++ linux-2.6.29-rc3.owrt/arch/mips/include/asm/mach-rc32434/irq.h 2009-05-10 23:48:28.000000000 +0200
13573 @@ -30,7 +30,4 @@
13574 #define ETH0_RX_OVR_IRQ (GROUP3_IRQ_BASE + 9)
13575 #define ETH0_TX_UND_IRQ (GROUP3_IRQ_BASE + 10)
13576
13577 -#define GPIO_MAPPED_IRQ_BASE GROUP4_IRQ_BASE
13578 -#define GPIO_MAPPED_IRQ_GROUP 4
13579 -
13580 #endif /* __ASM_RC32434_IRQ_H */
13581 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/include/asm/mach-rc32434/rb.h linux-2.6.29-rc3.owrt/arch/mips/include/asm/mach-rc32434/rb.h
13582 --- linux-2.6.29.owrt/arch/mips/include/asm/mach-rc32434/rb.h 2009-05-10 22:04:40.000000000 +0200
13583 +++ linux-2.6.29-rc3.owrt/arch/mips/include/asm/mach-rc32434/rb.h 2009-05-10 23:48:28.000000000 +0200
13584 @@ -83,7 +83,4 @@
13585 void __iomem *base;
13586 };
13587
13588 -extern void set_latch_u5(unsigned char or_mask, unsigned char nand_mask);
13589 -extern unsigned char get_latch_u5(void);
13590 -
13591 #endif /* __ASM_RC32434_RB_H */
13592 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/include/asm/prefetch.h linux-2.6.29-rc3.owrt/arch/mips/include/asm/prefetch.h
13593 --- linux-2.6.29.owrt/arch/mips/include/asm/prefetch.h 2009-05-10 22:04:40.000000000 +0200
13594 +++ linux-2.6.29-rc3.owrt/arch/mips/include/asm/prefetch.h 2009-05-10 23:48:28.000000000 +0200
13595 @@ -26,7 +26,7 @@
13596 * Pref_WriteBackInvalidate is a nop and Pref_PrepareForStore is broken in
13597 * current versions due to erratum G105.
13598 *
13599 - * VR5500 (including VR5701 and VR7701) only implement load prefetch.
13600 + * VR7701 only implements the Load prefetch.
13601 *
13602 * Finally MIPS32 and MIPS64 implement all of the following hints.
13603 */
13604 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/include/asm/ptrace.h linux-2.6.29-rc3.owrt/arch/mips/include/asm/ptrace.h
13605 --- linux-2.6.29.owrt/arch/mips/include/asm/ptrace.h 2009-05-10 22:04:40.000000000 +0200
13606 +++ linux-2.6.29-rc3.owrt/arch/mips/include/asm/ptrace.h 2009-05-10 23:48:28.000000000 +0200
13607 @@ -105,7 +105,7 @@
13608 enum pt_watch_style style;
13609 union {
13610 struct mips32_watch_regs mips32;
13611 - struct mips64_watch_regs mips64;
13612 + struct mips32_watch_regs mips64;
13613 };
13614 };
13615
13616 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/include/asm/seccomp.h linux-2.6.29-rc3.owrt/arch/mips/include/asm/seccomp.h
13617 --- linux-2.6.29.owrt/arch/mips/include/asm/seccomp.h 2009-05-10 22:04:40.000000000 +0200
13618 +++ linux-2.6.29-rc3.owrt/arch/mips/include/asm/seccomp.h 2009-05-10 23:48:28.000000000 +0200
13619 @@ -1,5 +1,6 @@
13620 #ifndef __ASM_SECCOMP_H
13621
13622 +#include <linux/thread_info.h>
13623 #include <linux/unistd.h>
13624
13625 #define __NR_seccomp_read __NR_read
13626 @@ -15,6 +16,8 @@
13627 */
13628 #ifdef CONFIG_MIPS32_O32
13629
13630 +#define TIF_32BIT TIF_32BIT_REGS
13631 +
13632 #define __NR_seccomp_read_32 4003
13633 #define __NR_seccomp_write_32 4004
13634 #define __NR_seccomp_exit_32 4001
13635 @@ -22,6 +25,8 @@
13636
13637 #elif defined(CONFIG_MIPS32_N32)
13638
13639 +#define TIF_32BIT _TIF_32BIT_ADDR
13640 +
13641 #define __NR_seccomp_read_32 6000
13642 #define __NR_seccomp_write_32 6001
13643 #define __NR_seccomp_exit_32 6058
13644 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/include/asm/spinlock.h linux-2.6.29-rc3.owrt/arch/mips/include/asm/spinlock.h
13645 --- linux-2.6.29.owrt/arch/mips/include/asm/spinlock.h 2009-05-10 22:04:40.000000000 +0200
13646 +++ linux-2.6.29-rc3.owrt/arch/mips/include/asm/spinlock.h 2009-05-10 23:48:28.000000000 +0200
13647 @@ -51,7 +51,6 @@
13648
13649 return (((counters >> 14) - counters) & 0x1fff) > 1;
13650 }
13651 -#define __raw_spin_is_contended __raw_spin_is_contended
13652
13653 static inline void __raw_spin_lock(raw_spinlock_t *lock)
13654 {
13655 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/include/asm/termios.h linux-2.6.29-rc3.owrt/arch/mips/include/asm/termios.h
13656 --- linux-2.6.29.owrt/arch/mips/include/asm/termios.h 2009-05-10 22:04:40.000000000 +0200
13657 +++ linux-2.6.29-rc3.owrt/arch/mips/include/asm/termios.h 2009-05-10 23:48:28.000000000 +0200
13658 @@ -9,7 +9,6 @@
13659 #ifndef _ASM_TERMIOS_H
13660 #define _ASM_TERMIOS_H
13661
13662 -#include <linux/errno.h>
13663 #include <asm/termbits.h>
13664 #include <asm/ioctls.h>
13665
13666 @@ -95,81 +94,38 @@
13667 /*
13668 * Translate a "termio" structure into a "termios". Ugh.
13669 */
13670 -static inline int user_termio_to_kernel_termios(struct ktermios *termios,
13671 - struct termio __user *termio)
13672 -{
13673 - unsigned short iflag, oflag, cflag, lflag;
13674 - unsigned int err;
13675 -
13676 - if (!access_ok(VERIFY_READ, termio, sizeof(struct termio)))
13677 - return -EFAULT;
13678 -
13679 - err = __get_user(iflag, &termio->c_iflag);
13680 - termios->c_iflag = (termios->c_iflag & 0xffff0000) | iflag;
13681 - err |=__get_user(oflag, &termio->c_oflag);
13682 - termios->c_oflag = (termios->c_oflag & 0xffff0000) | oflag;
13683 - err |=__get_user(cflag, &termio->c_cflag);
13684 - termios->c_cflag = (termios->c_cflag & 0xffff0000) | cflag;
13685 - err |=__get_user(lflag, &termio->c_lflag);
13686 - termios->c_lflag = (termios->c_lflag & 0xffff0000) | lflag;
13687 - err |=__get_user(termios->c_line, &termio->c_line);
13688 - if (err)
13689 - return -EFAULT;
13690 -
13691 - if (__copy_from_user(termios->c_cc, termio->c_cc, NCC))
13692 - return -EFAULT;
13693 -
13694 - return 0;
13695 -}
13696 +#define user_termio_to_kernel_termios(termios, termio) \
13697 +({ \
13698 + unsigned short tmp; \
13699 + get_user(tmp, &(termio)->c_iflag); \
13700 + (termios)->c_iflag = (0xffff0000 & ((termios)->c_iflag)) | tmp; \
13701 + get_user(tmp, &(termio)->c_oflag); \
13702 + (termios)->c_oflag = (0xffff0000 & ((termios)->c_oflag)) | tmp; \
13703 + get_user(tmp, &(termio)->c_cflag); \
13704 + (termios)->c_cflag = (0xffff0000 & ((termios)->c_cflag)) | tmp; \
13705 + get_user(tmp, &(termio)->c_lflag); \
13706 + (termios)->c_lflag = (0xffff0000 & ((termios)->c_lflag)) | tmp; \
13707 + get_user((termios)->c_line, &(termio)->c_line); \
13708 + copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \
13709 +})
13710
13711 /*
13712 * Translate a "termios" structure into a "termio". Ugh.
13713 */
13714 -static inline int kernel_termios_to_user_termio(struct termio __user *termio,
13715 - struct ktermios *termios)
13716 -{
13717 - int err;
13718 -
13719 - if (!access_ok(VERIFY_WRITE, termio, sizeof(struct termio)))
13720 - return -EFAULT;
13721 -
13722 - err = __put_user(termios->c_iflag, &termio->c_iflag);
13723 - err |= __put_user(termios->c_oflag, &termio->c_oflag);
13724 - err |= __put_user(termios->c_cflag, &termio->c_cflag);
13725 - err |= __put_user(termios->c_lflag, &termio->c_lflag);
13726 - err |= __put_user(termios->c_line, &termio->c_line);
13727 - if (err)
13728 - return -EFAULT;
13729 -
13730 - if (__copy_to_user(termio->c_cc, termios->c_cc, NCC))
13731 - return -EFAULT;
13732 -
13733 - return 0;
13734 -}
13735 -
13736 -static inline int user_termios_to_kernel_termios(struct ktermios __user *k,
13737 - struct termios2 *u)
13738 -{
13739 - return copy_from_user(k, u, sizeof(struct termios2)) ? -EFAULT : 0;
13740 -}
13741 -
13742 -static inline int kernel_termios_to_user_termios(struct termios2 __user *u,
13743 - struct ktermios *k)
13744 -{
13745 - return copy_to_user(u, k, sizeof(struct termios2)) ? -EFAULT : 0;
13746 -}
13747 -
13748 -static inline int user_termios_to_kernel_termios_1(struct ktermios *k,
13749 - struct termios __user *u)
13750 -{
13751 - return copy_from_user(k, u, sizeof(struct termios)) ? -EFAULT : 0;
13752 -}
13753 -
13754 -static inline int kernel_termios_to_user_termios_1(struct termios __user *u,
13755 - struct ktermios *k)
13756 -{
13757 - return copy_to_user(u, k, sizeof(struct termios)) ? -EFAULT : 0;
13758 -}
13759 +#define kernel_termios_to_user_termio(termio, termios) \
13760 +({ \
13761 + put_user((termios)->c_iflag, &(termio)->c_iflag); \
13762 + put_user((termios)->c_oflag, &(termio)->c_oflag); \
13763 + put_user((termios)->c_cflag, &(termio)->c_cflag); \
13764 + put_user((termios)->c_lflag, &(termio)->c_lflag); \
13765 + put_user((termios)->c_line, &(termio)->c_line); \
13766 + copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
13767 +})
13768 +
13769 +#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2))
13770 +#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2))
13771 +#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))
13772 +#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios))
13773
13774 #endif /* defined(__KERNEL__) */
13775
13776 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/include/asm/thread_info.h linux-2.6.29-rc3.owrt/arch/mips/include/asm/thread_info.h
13777 --- linux-2.6.29.owrt/arch/mips/include/asm/thread_info.h 2009-05-10 22:04:40.000000000 +0200
13778 +++ linux-2.6.29-rc3.owrt/arch/mips/include/asm/thread_info.h 2009-05-10 23:48:28.000000000 +0200
13779 @@ -127,12 +127,6 @@
13780 #define TIF_LOAD_WATCH 25 /* If set, load watch registers */
13781 #define TIF_SYSCALL_TRACE 31 /* syscall trace active */
13782
13783 -#ifdef CONFIG_MIPS32_O32
13784 -#define TIF_32BIT TIF_32BIT_REGS
13785 -#elif defined(CONFIG_MIPS32_N32)
13786 -#define TIF_32BIT _TIF_32BIT_ADDR
13787 -#endif /* CONFIG_MIPS32_O32 */
13788 -
13789 #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
13790 #define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
13791 #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
13792 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/include/asm/txx9/tx4939.h linux-2.6.29-rc3.owrt/arch/mips/include/asm/txx9/tx4939.h
13793 --- linux-2.6.29.owrt/arch/mips/include/asm/txx9/tx4939.h 2009-05-10 22:04:40.000000000 +0200
13794 +++ linux-2.6.29-rc3.owrt/arch/mips/include/asm/txx9/tx4939.h 2009-05-10 23:48:28.000000000 +0200
13795 @@ -541,6 +541,5 @@
13796 int tx4939_irq(void);
13797 void tx4939_mtd_init(int ch);
13798 void tx4939_ata_init(void);
13799 -void tx4939_rtc_init(void);
13800
13801 #endif /* __ASM_TXX9_TX4939_H */
13802 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/Kconfig linux-2.6.29-rc3.owrt/arch/mips/Kconfig
13803 --- linux-2.6.29.owrt/arch/mips/Kconfig 2009-05-10 22:04:40.000000000 +0200
13804 +++ linux-2.6.29-rc3.owrt/arch/mips/Kconfig 2009-05-10 23:48:28.000000000 +0200
13805 @@ -238,12 +238,8 @@
13806 This option enables support for MIPS Technologies MIPSsim software
13807 emulator.
13808
13809 -config NEC_MARKEINS
13810 - bool "NEC EMMA2RH Mark-eins board"
13811 - select SOC_EMMA2RH
13812 - select HW_HAS_PCI
13813 - help
13814 - This enables support for the NEC Electronics Mark-eins boards.
13815 +config MACH_EMMA
13816 + bool "NEC EMMA series based machines"
13817
13818 config MACH_VR41XX
13819 bool "NEC VR4100 series based machines"
13820 @@ -355,7 +351,7 @@
13821 select ARC64
13822 select BOOT_ELF64
13823 select DEFAULT_SGI_PARTITION
13824 - select DMA_COHERENT
13825 + select DMA_IP27
13826 select SYS_HAS_EARLY_PRINTK
13827 select HW_HAS_PCI
13828 select NR_CPUS_DEFAULT_64
13829 @@ -607,7 +603,7 @@
13830 select SYS_SUPPORTS_64BIT_KERNEL
13831 select SYS_SUPPORTS_BIG_ENDIAN
13832 select SYS_SUPPORTS_HIGHMEM
13833 - select SYS_HAS_CPU_CAVIUM_OCTEON
13834 + select CPU_CAVIUM_OCTEON
13835 help
13836 The Octeon simulator is software performance model of the Cavium
13837 Octeon Processor. It supports simulating Octeon processors on x86
13838 @@ -622,7 +618,7 @@
13839 select SYS_SUPPORTS_BIG_ENDIAN
13840 select SYS_SUPPORTS_HIGHMEM
13841 select SYS_HAS_EARLY_PRINTK
13842 - select SYS_HAS_CPU_CAVIUM_OCTEON
13843 + select CPU_CAVIUM_OCTEON
13844 select SWAP_IO_SPACE
13845 help
13846 This option supports all of the Octeon reference boards from Cavium
13847 @@ -641,6 +637,7 @@
13848
13849 source "arch/mips/alchemy/Kconfig"
13850 source "arch/mips/basler/excite/Kconfig"
13851 +source "arch/mips/emma/Kconfig"
13852 source "arch/mips/jazz/Kconfig"
13853 source "arch/mips/lasat/Kconfig"
13854 source "arch/mips/pmc-sierra/Kconfig"
13855 @@ -764,6 +761,9 @@
13856 config DMA_COHERENT
13857 bool
13858
13859 +config DMA_IP27
13860 + bool
13861 +
13862 config DMA_NONCOHERENT
13863 bool
13864 select DMA_NEED_PCI_MAP_STATE
13865 @@ -904,18 +904,6 @@
13866 bool
13867 select SERIAL_RM9000
13868
13869 -config SOC_EMMA2RH
13870 - bool
13871 - select CEVT_R4K
13872 - select CSRC_R4K
13873 - select DMA_NONCOHERENT
13874 - select IRQ_CPU
13875 - select SWAP_IO_SPACE
13876 - select SYS_HAS_CPU_R5500
13877 - select SYS_SUPPORTS_32BIT_KERNEL
13878 - select SYS_SUPPORTS_64BIT_KERNEL
13879 - select SYS_SUPPORTS_BIG_ENDIAN
13880 -
13881 config SOC_PNX833X
13882 bool
13883 select CEVT_R4K
13884 @@ -951,6 +939,11 @@
13885 config SWAP_IO_SPACE
13886 bool
13887
13888 +config EMMA2RH
13889 + bool
13890 + depends on MARKEINS
13891 + default y
13892 +
13893 config SERIAL_RM9000
13894 bool
13895
13896 @@ -1250,7 +1243,6 @@
13897
13898 config CPU_CAVIUM_OCTEON
13899 bool "Cavium Octeon processor"
13900 - depends on SYS_HAS_CPU_CAVIUM_OCTEON
13901 select IRQ_CPU
13902 select IRQ_CPU_OCTEON
13903 select CPU_HAS_PREFETCH
13904 @@ -1331,9 +1323,6 @@
13905 config SYS_HAS_CPU_SB1
13906 bool
13907
13908 -config SYS_HAS_CPU_CAVIUM_OCTEON
13909 - bool
13910 -
13911 #
13912 # CPU may reorder R->R, R->W, W->R, W->W
13913 # Reordering beyond LL and SC is handled in WEAK_REORDERING_BEYOND_LLSC
13914 @@ -1385,7 +1374,7 @@
13915 #
13916 config HARDWARE_WATCHPOINTS
13917 bool
13918 - default y if CPU_MIPSR1 || CPU_MIPSR2
13919 + default y if CPU_MIPS32 || CPU_MIPS64
13920
13921 menu "Kernel type"
13922
13923 @@ -1407,7 +1396,6 @@
13924 config 64BIT
13925 bool "64-bit kernel"
13926 depends on CPU_SUPPORTS_64BIT_KERNEL && SYS_SUPPORTS_64BIT_KERNEL
13927 - select HAVE_SYSCALL_WRAPPERS
13928 help
13929 Select this option if you want to build a 64-bit kernel.
13930
13931 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/kernel/cpu-probe.c linux-2.6.29-rc3.owrt/arch/mips/kernel/cpu-probe.c
13932 --- linux-2.6.29.owrt/arch/mips/kernel/cpu-probe.c 2009-05-10 22:04:40.000000000 +0200
13933 +++ linux-2.6.29-rc3.owrt/arch/mips/kernel/cpu-probe.c 2009-05-10 23:48:28.000000000 +0200
13934 @@ -149,7 +149,6 @@
13935 case CPU_R4650:
13936 case CPU_R4700:
13937 case CPU_R5000:
13938 - case CPU_R5500:
13939 case CPU_NEVADA:
13940 case CPU_4KC:
13941 case CPU_4KEC:
13942 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/kernel/genex.S linux-2.6.29-rc3.owrt/arch/mips/kernel/genex.S
13943 --- linux-2.6.29.owrt/arch/mips/kernel/genex.S 2009-05-10 22:04:40.000000000 +0200
13944 +++ linux-2.6.29-rc3.owrt/arch/mips/kernel/genex.S 2009-05-10 23:48:28.000000000 +0200
13945 @@ -458,11 +458,7 @@
13946 BUILD_HANDLER fpe fpe fpe silent /* #15 */
13947 BUILD_HANDLER mdmx mdmx sti silent /* #22 */
13948 #ifdef CONFIG_HARDWARE_WATCHPOINTS
13949 - /*
13950 - * For watch, interrupts will be enabled after the watch
13951 - * registers are read.
13952 - */
13953 - BUILD_HANDLER watch watch cli silent /* #23 */
13954 + BUILD_HANDLER watch watch sti silent /* #23 */
13955 #else
13956 BUILD_HANDLER watch watch sti verbose /* #23 */
13957 #endif
13958 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/kernel/irq.c linux-2.6.29-rc3.owrt/arch/mips/kernel/irq.c
13959 --- linux-2.6.29.owrt/arch/mips/kernel/irq.c 2009-05-10 22:04:40.000000000 +0200
13960 +++ linux-2.6.29-rc3.owrt/arch/mips/kernel/irq.c 2009-05-10 23:48:28.000000000 +0200
13961 @@ -111,6 +111,7 @@
13962 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
13963 #endif
13964 seq_printf(p, " %14s", irq_desc[i].chip->name);
13965 + seq_printf(p, "-%-8s", irq_desc[i].name);
13966 seq_printf(p, " %s", action->name);
13967
13968 for (action=action->next; action; action = action->next)
13969 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/kernel/linux32.c linux-2.6.29-rc3.owrt/arch/mips/kernel/linux32.c
13970 --- linux-2.6.29.owrt/arch/mips/kernel/linux32.c 2009-05-10 22:04:40.000000000 +0200
13971 +++ linux-2.6.29-rc3.owrt/arch/mips/kernel/linux32.c 2009-05-10 23:48:28.000000000 +0200
13972 @@ -32,7 +32,6 @@
13973 #include <linux/module.h>
13974 #include <linux/binfmts.h>
13975 #include <linux/security.h>
13976 -#include <linux/syscalls.h>
13977 #include <linux/compat.h>
13978 #include <linux/vfs.h>
13979 #include <linux/ipc.h>
13980 @@ -64,9 +63,9 @@
13981 #define merge_64(r1, r2) ((((r2) & 0xffffffffUL) << 32) + ((r1) & 0xffffffffUL))
13982 #endif
13983
13984 -SYSCALL_DEFINE6(32_mmap2, unsigned long, addr, unsigned long, len,
13985 - unsigned long, prot, unsigned long, flags, unsigned long, fd,
13986 - unsigned long, pgoff)
13987 +asmlinkage unsigned long
13988 +sys32_mmap2(unsigned long addr, unsigned long len, unsigned long prot,
13989 + unsigned long flags, unsigned long fd, unsigned long pgoff)
13990 {
13991 struct file * file = NULL;
13992 unsigned long error;
13993 @@ -122,21 +121,21 @@
13994 int rlim_max;
13995 };
13996
13997 -SYSCALL_DEFINE4(32_truncate64, const char __user *, path,
13998 - unsigned long, __dummy, unsigned long, a2, unsigned long, a3)
13999 +asmlinkage long sys32_truncate64(const char __user * path,
14000 + unsigned long __dummy, int a2, int a3)
14001 {
14002 return sys_truncate(path, merge_64(a2, a3));
14003 }
14004
14005 -SYSCALL_DEFINE4(32_ftruncate64, unsigned long, fd, unsigned long, __dummy,
14006 - unsigned long, a2, unsigned long, a3)
14007 +asmlinkage long sys32_ftruncate64(unsigned int fd, unsigned long __dummy,
14008 + int a2, int a3)
14009 {
14010 return sys_ftruncate(fd, merge_64(a2, a3));
14011 }
14012
14013 -SYSCALL_DEFINE5(32_llseek, unsigned long, fd, unsigned long, offset_high,
14014 - unsigned long, offset_low, loff_t __user *, result,
14015 - unsigned long, origin)
14016 +asmlinkage int sys32_llseek(unsigned int fd, unsigned int offset_high,
14017 + unsigned int offset_low, loff_t __user * result,
14018 + unsigned int origin)
14019 {
14020 return sys_llseek(fd, offset_high, offset_low, result, origin);
14021 }
14022 @@ -145,20 +144,20 @@
14023 lseek back to original location. They fail just like lseek does on
14024 non-seekable files. */
14025
14026 -SYSCALL_DEFINE6(32_pread, unsigned long, fd, char __user *, buf, size_t, count,
14027 - unsigned long, unused, unsigned long, a4, unsigned long, a5)
14028 +asmlinkage ssize_t sys32_pread(unsigned int fd, char __user * buf,
14029 + size_t count, u32 unused, u64 a4, u64 a5)
14030 {
14031 return sys_pread64(fd, buf, count, merge_64(a4, a5));
14032 }
14033
14034 -SYSCALL_DEFINE6(32_pwrite, unsigned int, fd, const char __user *, buf,
14035 - size_t, count, u32, unused, u64, a4, u64, a5)
14036 +asmlinkage ssize_t sys32_pwrite(unsigned int fd, const char __user * buf,
14037 + size_t count, u32 unused, u64 a4, u64 a5)
14038 {
14039 return sys_pwrite64(fd, buf, count, merge_64(a4, a5));
14040 }
14041
14042 -SYSCALL_DEFINE2(32_sched_rr_get_interval, compat_pid_t, pid,
14043 - struct compat_timespec __user *, interval)
14044 +asmlinkage int sys32_sched_rr_get_interval(compat_pid_t pid,
14045 + struct compat_timespec __user *interval)
14046 {
14047 struct timespec t;
14048 int ret;
14049 @@ -175,8 +174,8 @@
14050
14051 #ifdef CONFIG_SYSVIPC
14052
14053 -SYSCALL_DEFINE6(32_ipc, u32, call, long, first, long, second, long, third,
14054 - unsigned long, ptr, unsigned long, fifth)
14055 +asmlinkage long
14056 +sys32_ipc(u32 call, int first, int second, int third, u32 ptr, u32 fifth)
14057 {
14058 int version, err;
14059
14060 @@ -234,8 +233,8 @@
14061
14062 #else
14063
14064 -SYSCALL_DEFINE6(32_ipc, u32, call, int, first, int, second, int, third,
14065 - u32, ptr, u32, fifth)
14066 +asmlinkage long
14067 +sys32_ipc(u32 call, int first, int second, int third, u32 ptr, u32 fifth)
14068 {
14069 return -ENOSYS;
14070 }
14071 @@ -243,7 +242,7 @@
14072 #endif /* CONFIG_SYSVIPC */
14073
14074 #ifdef CONFIG_MIPS32_N32
14075 -SYSCALL_DEFINE4(n32_semctl, int, semid, int, semnum, int, cmd, u32, arg)
14076 +asmlinkage long sysn32_semctl(int semid, int semnum, int cmd, u32 arg)
14077 {
14078 /* compat_sys_semctl expects a pointer to union semun */
14079 u32 __user *uptr = compat_alloc_user_space(sizeof(u32));
14080 @@ -252,14 +251,13 @@
14081 return compat_sys_semctl(semid, semnum, cmd, uptr);
14082 }
14083
14084 -SYSCALL_DEFINE4(n32_msgsnd, int, msqid, u32, msgp, unsigned int, msgsz,
14085 - int, msgflg)
14086 +asmlinkage long sysn32_msgsnd(int msqid, u32 msgp, unsigned msgsz, int msgflg)
14087 {
14088 return compat_sys_msgsnd(msqid, msgsz, msgflg, compat_ptr(msgp));
14089 }
14090
14091 -SYSCALL_DEFINE5(n32_msgrcv, int, msqid, u32, msgp, size_t, msgsz,
14092 - int, msgtyp, int, msgflg)
14093 +asmlinkage long sysn32_msgrcv(int msqid, u32 msgp, size_t msgsz, int msgtyp,
14094 + int msgflg)
14095 {
14096 return compat_sys_msgrcv(msqid, msgsz, msgtyp, msgflg, IPC_64,
14097 compat_ptr(msgp));
14098 @@ -279,7 +277,7 @@
14099
14100 #ifdef CONFIG_SYSCTL_SYSCALL
14101
14102 -SYSCALL_DEFINE1(32_sysctl, struct sysctl_args32 __user *, args)
14103 +asmlinkage long sys32_sysctl(struct sysctl_args32 __user *args)
14104 {
14105 struct sysctl_args32 tmp;
14106 int error;
14107 @@ -318,16 +316,9 @@
14108 return error;
14109 }
14110
14111 -#else
14112 -
14113 -SYSCALL_DEFINE1(32_sysctl, struct sysctl_args32 __user *, args)
14114 -{
14115 - return -ENOSYS;
14116 -}
14117 -
14118 #endif /* CONFIG_SYSCTL_SYSCALL */
14119
14120 -SYSCALL_DEFINE1(32_newuname, struct new_utsname __user *, name)
14121 +asmlinkage long sys32_newuname(struct new_utsname __user * name)
14122 {
14123 int ret = 0;
14124
14125 @@ -343,7 +334,7 @@
14126 return ret;
14127 }
14128
14129 -SYSCALL_DEFINE1(32_personality, unsigned long, personality)
14130 +asmlinkage int sys32_personality(unsigned long personality)
14131 {
14132 int ret;
14133 personality &= 0xffffffff;
14134 @@ -366,7 +357,7 @@
14135
14136 extern asmlinkage long sys_ustat(dev_t dev, struct ustat __user * ubuf);
14137
14138 -SYSCALL_DEFINE2(32_ustat, dev_t, dev, struct ustat32 __user *, ubuf32)
14139 +asmlinkage int sys32_ustat(dev_t dev, struct ustat32 __user * ubuf32)
14140 {
14141 int err;
14142 struct ustat tmp;
14143 @@ -390,8 +381,8 @@
14144 return err;
14145 }
14146
14147 -SYSCALL_DEFINE4(32_sendfile, long, out_fd, long, in_fd,
14148 - compat_off_t __user *, offset, s32, count)
14149 +asmlinkage int sys32_sendfile(int out_fd, int in_fd, compat_off_t __user *offset,
14150 + s32 count)
14151 {
14152 mm_segment_t old_fs = get_fs();
14153 int ret;
14154 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/kernel/mips-mt-fpaff.c linux-2.6.29-rc3.owrt/arch/mips/kernel/mips-mt-fpaff.c
14155 --- linux-2.6.29.owrt/arch/mips/kernel/mips-mt-fpaff.c 2009-05-10 22:04:40.000000000 +0200
14156 +++ linux-2.6.29-rc3.owrt/arch/mips/kernel/mips-mt-fpaff.c 2009-05-10 23:48:28.000000000 +0200
14157 @@ -79,8 +79,7 @@
14158
14159 euid = current_euid();
14160 retval = -EPERM;
14161 - if (euid != p->cred->euid && euid != p->cred->uid &&
14162 - !capable(CAP_SYS_NICE)) {
14163 + if (euid != p->euid && euid != p->uid && !capable(CAP_SYS_NICE)) {
14164 read_unlock(&tasklist_lock);
14165 goto out_unlock;
14166 }
14167 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/kernel/scall32-o32.S linux-2.6.29-rc3.owrt/arch/mips/kernel/scall32-o32.S
14168 --- linux-2.6.29.owrt/arch/mips/kernel/scall32-o32.S 2009-05-10 22:04:40.000000000 +0200
14169 +++ linux-2.6.29-rc3.owrt/arch/mips/kernel/scall32-o32.S 2009-05-10 23:48:28.000000000 +0200
14170 @@ -399,7 +399,7 @@
14171 sys sys_swapon 2
14172 sys sys_reboot 3
14173 sys sys_old_readdir 3
14174 - sys sys_mips_mmap 6 /* 4090 */
14175 + sys old_mmap 6 /* 4090 */
14176 sys sys_munmap 2
14177 sys sys_truncate 2
14178 sys sys_ftruncate 2
14179 @@ -519,7 +519,7 @@
14180 sys sys_sendfile 4
14181 sys sys_ni_syscall 0
14182 sys sys_ni_syscall 0
14183 - sys sys_mips_mmap2 6 /* 4210 */
14184 + sys sys_mmap2 6 /* 4210 */
14185 sys sys_truncate64 4
14186 sys sys_ftruncate64 4
14187 sys sys_stat64 2
14188 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/kernel/scall64-64.S linux-2.6.29-rc3.owrt/arch/mips/kernel/scall64-64.S
14189 --- linux-2.6.29.owrt/arch/mips/kernel/scall64-64.S 2009-05-10 22:04:40.000000000 +0200
14190 +++ linux-2.6.29-rc3.owrt/arch/mips/kernel/scall64-64.S 2009-05-10 23:48:28.000000000 +0200
14191 @@ -207,7 +207,7 @@
14192 PTR sys_newlstat
14193 PTR sys_poll
14194 PTR sys_lseek
14195 - PTR sys_mips_mmap
14196 + PTR old_mmap
14197 PTR sys_mprotect /* 5010 */
14198 PTR sys_munmap
14199 PTR sys_brk
14200 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/kernel/scall64-n32.S linux-2.6.29-rc3.owrt/arch/mips/kernel/scall64-n32.S
14201 --- linux-2.6.29.owrt/arch/mips/kernel/scall64-n32.S 2009-05-10 22:04:40.000000000 +0200
14202 +++ linux-2.6.29-rc3.owrt/arch/mips/kernel/scall64-n32.S 2009-05-10 23:48:28.000000000 +0200
14203 @@ -129,12 +129,12 @@
14204 PTR sys_newlstat
14205 PTR sys_poll
14206 PTR sys_lseek
14207 - PTR sys_mips_mmap
14208 + PTR old_mmap
14209 PTR sys_mprotect /* 6010 */
14210 PTR sys_munmap
14211 PTR sys_brk
14212 - PTR sys_32_rt_sigaction
14213 - PTR sys_32_rt_sigprocmask
14214 + PTR sys32_rt_sigaction
14215 + PTR sys32_rt_sigprocmask
14216 PTR compat_sys_ioctl /* 6015 */
14217 PTR sys_pread64
14218 PTR sys_pwrite64
14219 @@ -159,7 +159,7 @@
14220 PTR compat_sys_setitimer
14221 PTR sys_alarm
14222 PTR sys_getpid
14223 - PTR sys_32_sendfile
14224 + PTR sys32_sendfile
14225 PTR sys_socket /* 6040 */
14226 PTR sys_connect
14227 PTR sys_accept
14228 @@ -181,14 +181,14 @@
14229 PTR sys_exit
14230 PTR compat_sys_wait4
14231 PTR sys_kill /* 6060 */
14232 - PTR sys_32_newuname
14233 + PTR sys32_newuname
14234 PTR sys_semget
14235 PTR sys_semop
14236 - PTR sys_n32_semctl
14237 + PTR sysn32_semctl
14238 PTR sys_shmdt /* 6065 */
14239 PTR sys_msgget
14240 - PTR sys_n32_msgsnd
14241 - PTR sys_n32_msgrcv
14242 + PTR sysn32_msgsnd
14243 + PTR sysn32_msgrcv
14244 PTR compat_sys_msgctl
14245 PTR compat_sys_fcntl /* 6070 */
14246 PTR sys_flock
14247 @@ -245,15 +245,15 @@
14248 PTR sys_getsid
14249 PTR sys_capget
14250 PTR sys_capset
14251 - PTR sys_32_rt_sigpending /* 6125 */
14252 + PTR sys32_rt_sigpending /* 6125 */
14253 PTR compat_sys_rt_sigtimedwait
14254 - PTR sys_32_rt_sigqueueinfo
14255 + PTR sys32_rt_sigqueueinfo
14256 PTR sysn32_rt_sigsuspend
14257 PTR sys32_sigaltstack
14258 PTR compat_sys_utime /* 6130 */
14259 PTR sys_mknod
14260 - PTR sys_32_personality
14261 - PTR sys_32_ustat
14262 + PTR sys32_personality
14263 + PTR sys32_ustat
14264 PTR compat_sys_statfs
14265 PTR compat_sys_fstatfs /* 6135 */
14266 PTR sys_sysfs
14267 @@ -265,14 +265,14 @@
14268 PTR sys_sched_getscheduler
14269 PTR sys_sched_get_priority_max
14270 PTR sys_sched_get_priority_min
14271 - PTR sys_32_sched_rr_get_interval /* 6145 */
14272 + PTR sys32_sched_rr_get_interval /* 6145 */
14273 PTR sys_mlock
14274 PTR sys_munlock
14275 PTR sys_mlockall
14276 PTR sys_munlockall
14277 PTR sys_vhangup /* 6150 */
14278 PTR sys_pivot_root
14279 - PTR sys_32_sysctl
14280 + PTR sys32_sysctl
14281 PTR sys_prctl
14282 PTR compat_sys_adjtimex
14283 PTR compat_sys_setrlimit /* 6155 */
14284 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/kernel/scall64-o32.S linux-2.6.29-rc3.owrt/arch/mips/kernel/scall64-o32.S
14285 --- linux-2.6.29.owrt/arch/mips/kernel/scall64-o32.S 2009-05-10 22:04:40.000000000 +0200
14286 +++ linux-2.6.29-rc3.owrt/arch/mips/kernel/scall64-o32.S 2009-05-10 23:48:28.000000000 +0200
14287 @@ -265,12 +265,12 @@
14288 PTR sys_olduname
14289 PTR sys_umask /* 4060 */
14290 PTR sys_chroot
14291 - PTR sys_32_ustat
14292 + PTR sys32_ustat
14293 PTR sys_dup2
14294 PTR sys_getppid
14295 PTR sys_getpgrp /* 4065 */
14296 PTR sys_setsid
14297 - PTR sys_32_sigaction
14298 + PTR sys32_sigaction
14299 PTR sys_sgetmask
14300 PTR sys_ssetmask
14301 PTR sys_setreuid /* 4070 */
14302 @@ -293,7 +293,7 @@
14303 PTR sys_swapon
14304 PTR sys_reboot
14305 PTR compat_sys_old_readdir
14306 - PTR sys_mips_mmap /* 4090 */
14307 + PTR old_mmap /* 4090 */
14308 PTR sys_munmap
14309 PTR sys_truncate
14310 PTR sys_ftruncate
14311 @@ -320,12 +320,12 @@
14312 PTR compat_sys_wait4
14313 PTR sys_swapoff /* 4115 */
14314 PTR compat_sys_sysinfo
14315 - PTR sys_32_ipc
14316 + PTR sys32_ipc
14317 PTR sys_fsync
14318 PTR sys32_sigreturn
14319 PTR sys32_clone /* 4120 */
14320 PTR sys_setdomainname
14321 - PTR sys_32_newuname
14322 + PTR sys32_newuname
14323 PTR sys_ni_syscall /* sys_modify_ldt */
14324 PTR compat_sys_adjtimex
14325 PTR sys_mprotect /* 4125 */
14326 @@ -339,11 +339,11 @@
14327 PTR sys_fchdir
14328 PTR sys_bdflush
14329 PTR sys_sysfs /* 4135 */
14330 - PTR sys_32_personality
14331 + PTR sys32_personality
14332 PTR sys_ni_syscall /* for afs_syscall */
14333 PTR sys_setfsuid
14334 PTR sys_setfsgid
14335 - PTR sys_32_llseek /* 4140 */
14336 + PTR sys32_llseek /* 4140 */
14337 PTR compat_sys_getdents
14338 PTR compat_sys_select
14339 PTR sys_flock
14340 @@ -356,7 +356,7 @@
14341 PTR sys_ni_syscall /* 4150 */
14342 PTR sys_getsid
14343 PTR sys_fdatasync
14344 - PTR sys_32_sysctl
14345 + PTR sys32_sysctl
14346 PTR sys_mlock
14347 PTR sys_munlock /* 4155 */
14348 PTR sys_mlockall
14349 @@ -368,7 +368,7 @@
14350 PTR sys_sched_yield
14351 PTR sys_sched_get_priority_max
14352 PTR sys_sched_get_priority_min
14353 - PTR sys_32_sched_rr_get_interval /* 4165 */
14354 + PTR sys32_sched_rr_get_interval /* 4165 */
14355 PTR compat_sys_nanosleep
14356 PTR sys_mremap
14357 PTR sys_accept
14358 @@ -397,25 +397,25 @@
14359 PTR sys_getresgid
14360 PTR sys_prctl
14361 PTR sys32_rt_sigreturn
14362 - PTR sys_32_rt_sigaction
14363 - PTR sys_32_rt_sigprocmask /* 4195 */
14364 - PTR sys_32_rt_sigpending
14365 + PTR sys32_rt_sigaction
14366 + PTR sys32_rt_sigprocmask /* 4195 */
14367 + PTR sys32_rt_sigpending
14368 PTR compat_sys_rt_sigtimedwait
14369 - PTR sys_32_rt_sigqueueinfo
14370 + PTR sys32_rt_sigqueueinfo
14371 PTR sys32_rt_sigsuspend
14372 - PTR sys_32_pread /* 4200 */
14373 - PTR sys_32_pwrite
14374 + PTR sys32_pread /* 4200 */
14375 + PTR sys32_pwrite
14376 PTR sys_chown
14377 PTR sys_getcwd
14378 PTR sys_capget
14379 PTR sys_capset /* 4205 */
14380 PTR sys32_sigaltstack
14381 - PTR sys_32_sendfile
14382 + PTR sys32_sendfile
14383 PTR sys_ni_syscall
14384 PTR sys_ni_syscall
14385 - PTR sys_mips_mmap2 /* 4210 */
14386 - PTR sys_32_truncate64
14387 - PTR sys_32_ftruncate64
14388 + PTR sys32_mmap2 /* 4210 */
14389 + PTR sys32_truncate64
14390 + PTR sys32_ftruncate64
14391 PTR sys_newstat
14392 PTR sys_newlstat
14393 PTR sys_newfstat /* 4215 */
14394 @@ -481,7 +481,7 @@
14395 PTR compat_sys_mq_notify /* 4275 */
14396 PTR compat_sys_mq_getsetattr
14397 PTR sys_ni_syscall /* sys_vserver */
14398 - PTR sys_32_waitid
14399 + PTR sys32_waitid
14400 PTR sys_ni_syscall /* available, was setaltroot */
14401 PTR sys_add_key /* 4280 */
14402 PTR sys_request_key
14403 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/kernel/signal32.c linux-2.6.29-rc3.owrt/arch/mips/kernel/signal32.c
14404 --- linux-2.6.29.owrt/arch/mips/kernel/signal32.c 2009-05-10 22:04:40.000000000 +0200
14405 +++ linux-2.6.29-rc3.owrt/arch/mips/kernel/signal32.c 2009-05-10 23:48:28.000000000 +0200
14406 @@ -349,8 +349,8 @@
14407 return -ERESTARTNOHAND;
14408 }
14409
14410 -SYSCALL_DEFINE3(32_sigaction, long, sig, const struct sigaction32 __user *, act,
14411 - struct sigaction32 __user *, oact)
14412 +asmlinkage int sys32_sigaction(int sig, const struct sigaction32 __user *act,
14413 + struct sigaction32 __user *oact)
14414 {
14415 struct k_sigaction new_ka, old_ka;
14416 int ret;
14417 @@ -704,9 +704,9 @@
14418 .restart = __NR_O32_restart_syscall
14419 };
14420
14421 -SYSCALL_DEFINE4(32_rt_sigaction, int, sig,
14422 - const struct sigaction32 __user *, act,
14423 - struct sigaction32 __user *, oact, unsigned int, sigsetsize)
14424 +asmlinkage int sys32_rt_sigaction(int sig, const struct sigaction32 __user *act,
14425 + struct sigaction32 __user *oact,
14426 + unsigned int sigsetsize)
14427 {
14428 struct k_sigaction new_sa, old_sa;
14429 int ret = -EINVAL;
14430 @@ -748,8 +748,8 @@
14431 return ret;
14432 }
14433
14434 -SYSCALL_DEFINE4(32_rt_sigprocmask, int, how, compat_sigset_t __user *, set,
14435 - compat_sigset_t __user *, oset, unsigned int, sigsetsize)
14436 +asmlinkage int sys32_rt_sigprocmask(int how, compat_sigset_t __user *set,
14437 + compat_sigset_t __user *oset, unsigned int sigsetsize)
14438 {
14439 sigset_t old_set, new_set;
14440 int ret;
14441 @@ -770,8 +770,8 @@
14442 return ret;
14443 }
14444
14445 -SYSCALL_DEFINE2(32_rt_sigpending, compat_sigset_t __user *, uset,
14446 - unsigned int, sigsetsize)
14447 +asmlinkage int sys32_rt_sigpending(compat_sigset_t __user *uset,
14448 + unsigned int sigsetsize)
14449 {
14450 int ret;
14451 sigset_t set;
14452 @@ -787,8 +787,7 @@
14453 return ret;
14454 }
14455
14456 -SYSCALL_DEFINE3(32_rt_sigqueueinfo, int, pid, int, sig,
14457 - compat_siginfo_t __user *, uinfo)
14458 +asmlinkage int sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *uinfo)
14459 {
14460 siginfo_t info;
14461 int ret;
14462 @@ -803,9 +802,10 @@
14463 return ret;
14464 }
14465
14466 -SYSCALL_DEFINE5(32_waitid, int, which, compat_pid_t, pid,
14467 - compat_siginfo_t __user *, uinfo, int, options,
14468 - struct compat_rusage __user *, uru)
14469 +asmlinkage long
14470 +sys32_waitid(int which, compat_pid_t pid,
14471 + compat_siginfo_t __user *uinfo, int options,
14472 + struct compat_rusage __user *uru)
14473 {
14474 siginfo_t info;
14475 struct rusage ru;
14476 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/kernel/signal.c linux-2.6.29-rc3.owrt/arch/mips/kernel/signal.c
14477 --- linux-2.6.29.owrt/arch/mips/kernel/signal.c 2009-05-10 22:04:40.000000000 +0200
14478 +++ linux-2.6.29-rc3.owrt/arch/mips/kernel/signal.c 2009-05-10 23:48:28.000000000 +0200
14479 @@ -19,7 +19,6 @@
14480 #include <linux/ptrace.h>
14481 #include <linux/unistd.h>
14482 #include <linux/compiler.h>
14483 -#include <linux/syscalls.h>
14484 #include <linux/uaccess.h>
14485
14486 #include <asm/abi.h>
14487 @@ -339,8 +338,8 @@
14488 }
14489
14490 #ifdef CONFIG_TRAD_SIGNALS
14491 -SYSCALL_DEFINE3(sigaction, int, sig, const struct sigaction __user *, act,
14492 - struct sigaction __user *, oact)
14493 +asmlinkage int sys_sigaction(int sig, const struct sigaction __user *act,
14494 + struct sigaction __user *oact)
14495 {
14496 struct k_sigaction new_ka, old_ka;
14497 int ret;
14498 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/kernel/syscall.c linux-2.6.29-rc3.owrt/arch/mips/kernel/syscall.c
14499 --- linux-2.6.29.owrt/arch/mips/kernel/syscall.c 2009-05-10 22:04:40.000000000 +0200
14500 +++ linux-2.6.29-rc3.owrt/arch/mips/kernel/syscall.c 2009-05-10 23:48:28.000000000 +0200
14501 @@ -152,9 +152,9 @@
14502 return error;
14503 }
14504
14505 -SYSCALL_DEFINE6(mips_mmap, unsigned long, addr, unsigned long, len,
14506 - unsigned long, prot, unsigned long, flags, unsigned long,
14507 - fd, off_t, offset)
14508 +asmlinkage unsigned long
14509 +old_mmap(unsigned long addr, unsigned long len, int prot,
14510 + int flags, int fd, off_t offset)
14511 {
14512 unsigned long result;
14513
14514 @@ -168,9 +168,9 @@
14515 return result;
14516 }
14517
14518 -SYSCALL_DEFINE6(mips_mmap2, unsigned long, addr, unsigned long, len,
14519 - unsigned long, prot, unsigned long, flags, unsigned long, fd,
14520 - unsigned long, pgoff)
14521 +asmlinkage unsigned long
14522 +sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot,
14523 + unsigned long flags, unsigned long fd, unsigned long pgoff)
14524 {
14525 if (pgoff & (~PAGE_MASK >> 12))
14526 return -EINVAL;
14527 @@ -240,7 +240,7 @@
14528 /*
14529 * Compacrapability ...
14530 */
14531 -SYSCALL_DEFINE1(uname, struct old_utsname __user *, name)
14532 +asmlinkage int sys_uname(struct old_utsname __user * name)
14533 {
14534 if (name && !copy_to_user(name, utsname(), sizeof (*name)))
14535 return 0;
14536 @@ -250,7 +250,7 @@
14537 /*
14538 * Compacrapability ...
14539 */
14540 -SYSCALL_DEFINE1(olduname, struct oldold_utsname __user *, name)
14541 +asmlinkage int sys_olduname(struct oldold_utsname __user * name)
14542 {
14543 int error;
14544
14545 @@ -279,7 +279,7 @@
14546 return error;
14547 }
14548
14549 -SYSCALL_DEFINE1(set_thread_area, unsigned long, addr)
14550 +asmlinkage int sys_set_thread_area(unsigned long addr)
14551 {
14552 struct thread_info *ti = task_thread_info(current);
14553
14554 @@ -290,7 +290,7 @@
14555 return 0;
14556 }
14557
14558 -asmlinkage int _sys_sysmips(long cmd, long arg1, long arg2, long arg3)
14559 +asmlinkage int _sys_sysmips(int cmd, long arg1, int arg2, int arg3)
14560 {
14561 switch (cmd) {
14562 case MIPS_ATOMIC_SET:
14563 @@ -325,8 +325,8 @@
14564 *
14565 * This is really horribly ugly.
14566 */
14567 -SYSCALL_DEFINE6(ipc, unsigned int, call, int, first, int, second,
14568 - unsigned long, third, void __user *, ptr, long, fifth)
14569 +asmlinkage int sys_ipc(unsigned int call, int first, int second,
14570 + unsigned long third, void __user *ptr, long fifth)
14571 {
14572 int version, ret;
14573
14574 @@ -411,7 +411,7 @@
14575 /*
14576 * No implemented yet ...
14577 */
14578 -SYSCALL_DEFINE3(cachectl, char *, addr, int, nbytes, int, op)
14579 +asmlinkage int sys_cachectl(char *addr, int nbytes, int op)
14580 {
14581 return -ENOSYS;
14582 }
14583 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/kernel/traps.c linux-2.6.29-rc3.owrt/arch/mips/kernel/traps.c
14584 --- linux-2.6.29.owrt/arch/mips/kernel/traps.c 2009-05-10 22:04:40.000000000 +0200
14585 +++ linux-2.6.29-rc3.owrt/arch/mips/kernel/traps.c 2009-05-10 23:48:28.000000000 +0200
14586 @@ -944,9 +944,6 @@
14587 force_sig(SIGILL, current);
14588 }
14589
14590 -/*
14591 - * Called with interrupts disabled.
14592 - */
14593 asmlinkage void do_watch(struct pt_regs *regs)
14594 {
14595 u32 cause;
14596 @@ -966,12 +963,9 @@
14597 */
14598 if (test_tsk_thread_flag(current, TIF_LOAD_WATCH)) {
14599 mips_read_watch_registers();
14600 - local_irq_enable();
14601 force_sig(SIGTRAP, current);
14602 - } else {
14603 + } else
14604 mips_clear_watch_registers();
14605 - local_irq_enable();
14606 - }
14607 }
14608
14609 asmlinkage void do_mcheck(struct pt_regs *regs)
14610 @@ -1588,11 +1582,7 @@
14611 static char panic_null_cerr[] __cpuinitdata =
14612 "Trying to set NULL cache error exception handler";
14613
14614 -/*
14615 - * Install uncached CPU exception handler.
14616 - * This is suitable only for the cache error exception which is the only
14617 - * exception handler that is being run uncached.
14618 - */
14619 +/* Install uncached CPU exception handler */
14620 void __cpuinit set_uncached_handler(unsigned long offset, void *addr,
14621 unsigned long size)
14622 {
14623 @@ -1603,7 +1593,7 @@
14624 unsigned long uncached_ebase = TO_UNCAC(ebase);
14625 #endif
14626 if (cpu_has_mips_r2)
14627 - uncached_ebase += (read_c0_ebase() & 0x3ffff000);
14628 + ebase += (read_c0_ebase() & 0x3ffff000);
14629
14630 if (!addr)
14631 panic(panic_null_cerr);
14632 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/lib/memcpy-inatomic.S linux-2.6.29-rc3.owrt/arch/mips/lib/memcpy-inatomic.S
14633 --- linux-2.6.29.owrt/arch/mips/lib/memcpy-inatomic.S 2009-05-10 22:04:40.000000000 +0200
14634 +++ linux-2.6.29-rc3.owrt/arch/mips/lib/memcpy-inatomic.S 2009-05-10 23:48:28.000000000 +0200
14635 @@ -21,7 +21,7 @@
14636 * end of memory on some systems. It's also a seriously bad idea on non
14637 * dma-coherent systems.
14638 */
14639 -#ifdef CONFIG_DMA_NONCOHERENT
14640 +#if !defined(CONFIG_DMA_COHERENT) || !defined(CONFIG_DMA_IP27)
14641 #undef CONFIG_CPU_HAS_PREFETCH
14642 #endif
14643 #ifdef CONFIG_MIPS_MALTA
14644 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/lib/memcpy.S linux-2.6.29-rc3.owrt/arch/mips/lib/memcpy.S
14645 --- linux-2.6.29.owrt/arch/mips/lib/memcpy.S 2009-05-10 22:04:40.000000000 +0200
14646 +++ linux-2.6.29-rc3.owrt/arch/mips/lib/memcpy.S 2009-05-10 23:48:28.000000000 +0200
14647 @@ -21,7 +21,7 @@
14648 * end of memory on some systems. It's also a seriously bad idea on non
14649 * dma-coherent systems.
14650 */
14651 -#ifdef CONFIG_DMA_NONCOHERENT
14652 +#if !defined(CONFIG_DMA_COHERENT) || !defined(CONFIG_DMA_IP27)
14653 #undef CONFIG_CPU_HAS_PREFETCH
14654 #endif
14655 #ifdef CONFIG_MIPS_MALTA
14656 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/Makefile linux-2.6.29-rc3.owrt/arch/mips/Makefile
14657 --- linux-2.6.29.owrt/arch/mips/Makefile 2009-05-10 22:04:40.000000000 +0200
14658 +++ linux-2.6.29-rc3.owrt/arch/mips/Makefile 2009-05-10 23:48:28.000000000 +0200
14659 @@ -416,7 +416,7 @@
14660 #
14661 # Common NEC EMMAXXX
14662 #
14663 -core-$(CONFIG_SOC_EMMA2RH) += arch/mips/emma/common/
14664 +core-$(CONFIG_SOC_EMMA) += arch/mips/emma/common/
14665 cflags-$(CONFIG_SOC_EMMA2RH) += -I$(srctree)/arch/mips/include/asm/mach-emma2rh
14666
14667 #
14668 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/mm/cache.c linux-2.6.29-rc3.owrt/arch/mips/mm/cache.c
14669 --- linux-2.6.29.owrt/arch/mips/mm/cache.c 2009-05-10 22:04:40.000000000 +0200
14670 +++ linux-2.6.29-rc3.owrt/arch/mips/mm/cache.c 2009-05-10 23:48:28.000000000 +0200
14671 @@ -13,7 +13,6 @@
14672 #include <linux/linkage.h>
14673 #include <linux/module.h>
14674 #include <linux/sched.h>
14675 -#include <linux/syscalls.h>
14676 #include <linux/mm.h>
14677
14678 #include <asm/cacheflush.h>
14679 @@ -59,8 +58,8 @@
14680 * We could optimize the case where the cache argument is not BCACHE but
14681 * that seems very atypical use ...
14682 */
14683 -SYSCALL_DEFINE3(cacheflush, unsigned long, addr, unsigned long, bytes,
14684 - unsigned int, cache)
14685 +asmlinkage int sys_cacheflush(unsigned long addr,
14686 + unsigned long bytes, unsigned int cache)
14687 {
14688 if (bytes == 0)
14689 return 0;
14690 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/mm/c-r4k.c linux-2.6.29-rc3.owrt/arch/mips/mm/c-r4k.c
14691 --- linux-2.6.29.owrt/arch/mips/mm/c-r4k.c 2009-05-10 22:04:40.000000000 +0200
14692 +++ linux-2.6.29-rc3.owrt/arch/mips/mm/c-r4k.c 2009-05-10 23:48:28.000000000 +0200
14693 @@ -618,35 +618,15 @@
14694 if (cpu_has_inclusive_pcaches) {
14695 if (size >= scache_size)
14696 r4k_blast_scache();
14697 - else {
14698 - unsigned long lsize = cpu_scache_line_size();
14699 - unsigned long almask = ~(lsize - 1);
14700 -
14701 - /*
14702 - * There is no clearly documented alignment requirement
14703 - * for the cache instruction on MIPS processors and
14704 - * some processors, among them the RM5200 and RM7000
14705 - * QED processors will throw an address error for cache
14706 - * hit ops with insufficient alignment. Solved by
14707 - * aligning the address to cache line size.
14708 - */
14709 - cache_op(Hit_Writeback_Inv_SD, addr & almask);
14710 - cache_op(Hit_Writeback_Inv_SD,
14711 - (addr + size - 1) & almask);
14712 + else
14713 blast_inv_scache_range(addr, addr + size);
14714 - }
14715 return;
14716 }
14717
14718 if (cpu_has_safe_index_cacheops && size >= dcache_size) {
14719 r4k_blast_dcache();
14720 } else {
14721 - unsigned long lsize = cpu_dcache_line_size();
14722 - unsigned long almask = ~(lsize - 1);
14723 -
14724 R4600_HIT_CACHEOP_WAR_IMPL;
14725 - cache_op(Hit_Writeback_Inv_D, addr & almask);
14726 - cache_op(Hit_Writeback_Inv_D, (addr + size - 1) & almask);
14727 blast_inv_dcache_range(addr, addr + size);
14728 }
14729
14730 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/mm/fault.c linux-2.6.29-rc3.owrt/arch/mips/mm/fault.c
14731 --- linux-2.6.29.owrt/arch/mips/mm/fault.c 2009-05-10 22:04:40.000000000 +0200
14732 +++ linux-2.6.29-rc3.owrt/arch/mips/mm/fault.c 2009-05-10 23:48:28.000000000 +0200
14733 @@ -97,6 +97,7 @@
14734 goto bad_area;
14735 }
14736
14737 +survive:
14738 /*
14739 * If for any reason at all we couldn't handle the fault,
14740 * make sure we exit gracefully rather than endlessly redo
14741 @@ -166,13 +167,21 @@
14742 field, regs->regs[31]);
14743 die("Oops", regs);
14744
14745 +/*
14746 + * We ran out of memory, or some other thing happened to us that made
14747 + * us unable to handle the page fault gracefully.
14748 + */
14749 out_of_memory:
14750 - /*
14751 - * We ran out of memory, call the OOM killer, and return the userspace
14752 - * (which will retry the fault, or kill us if we got oom-killed).
14753 - */
14754 - pagefault_out_of_memory();
14755 - return;
14756 + up_read(&mm->mmap_sem);
14757 + if (is_global_init(tsk)) {
14758 + yield();
14759 + down_read(&mm->mmap_sem);
14760 + goto survive;
14761 + }
14762 + printk("VM: killing process %s\n", tsk->comm);
14763 + if (user_mode(regs))
14764 + do_group_exit(SIGKILL);
14765 + goto no_context;
14766
14767 do_sigbus:
14768 up_read(&mm->mmap_sem);
14769 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/mm/page.c linux-2.6.29-rc3.owrt/arch/mips/mm/page.c
14770 --- linux-2.6.29.owrt/arch/mips/mm/page.c 2009-05-10 22:04:40.000000000 +0200
14771 +++ linux-2.6.29-rc3.owrt/arch/mips/mm/page.c 2009-05-10 23:48:28.000000000 +0200
14772 @@ -172,9 +172,8 @@
14773 */
14774 cache_line_size = cpu_dcache_line_size();
14775 switch (current_cpu_type()) {
14776 - case CPU_R5500:
14777 case CPU_TX49XX:
14778 - /* These processors only support the Pref_Load. */
14779 + /* TX49 supports only Pref_Load */
14780 pref_bias_copy_load = 256;
14781 break;
14782
14783 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/mm/tlbex.c linux-2.6.29-rc3.owrt/arch/mips/mm/tlbex.c
14784 --- linux-2.6.29.owrt/arch/mips/mm/tlbex.c 2009-05-10 22:04:40.000000000 +0200
14785 +++ linux-2.6.29-rc3.owrt/arch/mips/mm/tlbex.c 2009-05-10 23:48:28.000000000 +0200
14786 @@ -318,7 +318,6 @@
14787 case CPU_BCM4710:
14788 case CPU_LOONGSON2:
14789 case CPU_CAVIUM_OCTEON:
14790 - case CPU_R5500:
14791 if (m4kc_tlbp_war())
14792 uasm_i_nop(p);
14793 tlbw(p);
14794 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/pci/pci-rc32434.c linux-2.6.29-rc3.owrt/arch/mips/pci/pci-rc32434.c
14795 --- linux-2.6.29.owrt/arch/mips/pci/pci-rc32434.c 2009-05-10 22:04:40.000000000 +0200
14796 +++ linux-2.6.29-rc3.owrt/arch/mips/pci/pci-rc32434.c 2009-05-10 23:48:28.000000000 +0200
14797 @@ -205,8 +205,6 @@
14798
14799 static int __init rc32434_pci_init(void)
14800 {
14801 - void __iomem *io_map_base;
14802 -
14803 pr_info("PCI: Initializing PCI\n");
14804
14805 ioport_resource.start = rc32434_res_pci_io1.start;
14806 @@ -214,15 +212,6 @@
14807
14808 rc32434_pcibridge_init();
14809
14810 - io_map_base = ioremap(rc32434_res_pci_io1.start,
14811 - rc32434_res_pci_io1.end - rc32434_res_pci_io1.start + 1);
14812 -
14813 - if (!io_map_base)
14814 - return -ENOMEM;
14815 -
14816 - rc32434_controller.io_map_base =
14817 - (unsigned long)io_map_base - rc32434_res_pci_io1.start;
14818 -
14819 register_pci_controller(&rc32434_controller);
14820 rc32434_sync();
14821
14822 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/rb532/devices.c linux-2.6.29-rc3.owrt/arch/mips/rb532/devices.c
14823 --- linux-2.6.29.owrt/arch/mips/rb532/devices.c 2009-05-10 22:04:40.000000000 +0200
14824 +++ linux-2.6.29-rc3.owrt/arch/mips/rb532/devices.c 2009-05-10 23:48:28.000000000 +0200
14825 @@ -24,7 +24,6 @@
14826 #include <linux/mtd/partitions.h>
14827 #include <linux/gpio_keys.h>
14828 #include <linux/input.h>
14829 -#include <linux/serial_8250.h>
14830
14831 #include <asm/bootinfo.h>
14832
14833 @@ -40,29 +39,6 @@
14834 #define ETH0_RX_DMA_ADDR (DMA0_BASE_ADDR + 0 * DMA_CHAN_OFFSET)
14835 #define ETH0_TX_DMA_ADDR (DMA0_BASE_ADDR + 1 * DMA_CHAN_OFFSET)
14836
14837 -extern unsigned int idt_cpu_freq;
14838 -
14839 -static struct mpmc_device dev3;
14840 -
14841 -void set_latch_u5(unsigned char or_mask, unsigned char nand_mask)
14842 -{
14843 - unsigned long flags;
14844 -
14845 - spin_lock_irqsave(&dev3.lock, flags);
14846 -
14847 - dev3.state = (dev3.state | or_mask) & ~nand_mask;
14848 - writeb(dev3.state, dev3.base);
14849 -
14850 - spin_unlock_irqrestore(&dev3.lock, flags);
14851 -}
14852 -EXPORT_SYMBOL(set_latch_u5);
14853 -
14854 -unsigned char get_latch_u5(void)
14855 -{
14856 - return dev3.state;
14857 -}
14858 -EXPORT_SYMBOL(get_latch_u5);
14859 -
14860 static struct resource korina_dev0_res[] = {
14861 {
14862 .name = "korina_regs",
14863 @@ -110,7 +86,7 @@
14864 static struct platform_device korina_dev0 = {
14865 .id = -1,
14866 .name = "korina",
14867 - .dev.driver_data = &korina_dev0_data,
14868 + .dev.platform_data = &korina_dev0_data,
14869 .resource = korina_dev0_res,
14870 .num_resources = ARRAY_SIZE(korina_dev0_res),
14871 };
14872 @@ -238,32 +214,12 @@
14873 .num_resources = ARRAY_SIZE(rb532_wdt_res),
14874 };
14875
14876 -static struct plat_serial8250_port rb532_uart_res[] = {
14877 - {
14878 - .membase = (char *)KSEG1ADDR(REGBASE + UART0BASE),
14879 - .irq = UART0_IRQ,
14880 - .regshift = 2,
14881 - .iotype = UPIO_MEM,
14882 - .flags = UPF_BOOT_AUTOCONF,
14883 - },
14884 - {
14885 - .flags = 0,
14886 - }
14887 -};
14888 -
14889 -static struct platform_device rb532_uart = {
14890 - .name = "serial8250",
14891 - .id = PLAT8250_DEV_PLATFORM,
14892 - .dev.platform_data = &rb532_uart_res,
14893 -};
14894 -
14895 static struct platform_device *rb532_devs[] = {
14896 &korina_dev0,
14897 &nand_slot0,
14898 &cf_slot0,
14899 &rb532_led,
14900 &rb532_button,
14901 - &rb532_uart,
14902 &rb532_wdt
14903 };
14904
14905 @@ -335,20 +291,9 @@
14906 nand_slot0_res[0].start = readl(IDT434_REG_BASE + DEV2BASE);
14907 nand_slot0_res[0].end = nand_slot0_res[0].start + 0x1000;
14908
14909 - /* Read and map device controller 3 */
14910 - dev3.base = ioremap_nocache(readl(IDT434_REG_BASE + DEV3BASE), 1);
14911 -
14912 - if (!dev3.base) {
14913 - printk(KERN_ERR "rb532: cannot remap device controller 3\n");
14914 - return -ENXIO;
14915 - }
14916 -
14917 /* Initialise the NAND device */
14918 rb532_nand_setup();
14919
14920 - /* set the uart clock to the current cpu frequency */
14921 - rb532_uart_res[0].uartclk = idt_cpu_freq;
14922 -
14923 return platform_add_devices(rb532_devs, ARRAY_SIZE(rb532_devs));
14924 }
14925
14926 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/rb532/gpio.c linux-2.6.29-rc3.owrt/arch/mips/rb532/gpio.c
14927 --- linux-2.6.29.owrt/arch/mips/rb532/gpio.c 2009-05-10 22:04:40.000000000 +0200
14928 +++ linux-2.6.29-rc3.owrt/arch/mips/rb532/gpio.c 2009-05-10 23:48:28.000000000 +0200
14929 @@ -41,6 +41,8 @@
14930 void __iomem *regbase;
14931 };
14932
14933 +struct mpmc_device dev3;
14934 +
14935 static struct resource rb532_gpio_reg0_res[] = {
14936 {
14937 .name = "gpio_reg0",
14938 @@ -50,6 +52,61 @@
14939 }
14940 };
14941
14942 +static struct resource rb532_dev3_ctl_res[] = {
14943 + {
14944 + .name = "dev3_ctl",
14945 + .start = REGBASE + DEV3BASE,
14946 + .end = REGBASE + DEV3BASE + sizeof(struct dev_reg) - 1,
14947 + .flags = IORESOURCE_MEM,
14948 + }
14949 +};
14950 +
14951 +void set_434_reg(unsigned reg_offs, unsigned bit, unsigned len, unsigned val)
14952 +{
14953 + unsigned long flags;
14954 + unsigned data;
14955 + unsigned i = 0;
14956 +
14957 + spin_lock_irqsave(&dev3.lock, flags);
14958 +
14959 + data = readl(IDT434_REG_BASE + reg_offs);
14960 + for (i = 0; i != len; ++i) {
14961 + if (val & (1 << i))
14962 + data |= (1 << (i + bit));
14963 + else
14964 + data &= ~(1 << (i + bit));
14965 + }
14966 + writel(data, (IDT434_REG_BASE + reg_offs));
14967 +
14968 + spin_unlock_irqrestore(&dev3.lock, flags);
14969 +}
14970 +EXPORT_SYMBOL(set_434_reg);
14971 +
14972 +unsigned get_434_reg(unsigned reg_offs)
14973 +{
14974 + return readl(IDT434_REG_BASE + reg_offs);
14975 +}
14976 +EXPORT_SYMBOL(get_434_reg);
14977 +
14978 +void set_latch_u5(unsigned char or_mask, unsigned char nand_mask)
14979 +{
14980 + unsigned long flags;
14981 +
14982 + spin_lock_irqsave(&dev3.lock, flags);
14983 +
14984 + dev3.state = (dev3.state | or_mask) & ~nand_mask;
14985 + writel(dev3.state, &dev3.base);
14986 +
14987 + spin_unlock_irqrestore(&dev3.lock, flags);
14988 +}
14989 +EXPORT_SYMBOL(set_latch_u5);
14990 +
14991 +unsigned char get_latch_u5(void)
14992 +{
14993 + return dev3.state;
14994 +}
14995 +EXPORT_SYMBOL(get_latch_u5);
14996 +
14997 /* rb532_set_bit - sanely set a bit
14998 *
14999 * bitval: new value for the bit
15000 @@ -62,11 +119,13 @@
15001 unsigned long flags;
15002 u32 val;
15003
15004 + bitval = !!bitval; /* map parameter to {0,1} */
15005 +
15006 local_irq_save(flags);
15007
15008 val = readl(ioaddr);
15009 - val &= ~(!bitval << offset); /* unset bit if bitval == 0 */
15010 - val |= (!!bitval << offset); /* set bit if bitval == 1 */
15011 + val &= ~( ~bitval << offset ); /* unset bit if bitval == 0 */
15012 + val |= ( bitval << offset ); /* set bit if bitval == 1 */
15013 writel(val, ioaddr);
15014
15015 local_irq_restore(flags);
15016 @@ -112,8 +171,8 @@
15017
15018 gpch = container_of(chip, struct rb532_gpio_chip, chip);
15019
15020 - /* disable alternate function in case it's set */
15021 - rb532_set_bit(0, offset, gpch->regbase + GPIOFUNC);
15022 + if (rb532_get_bit(offset, gpch->regbase + GPIOFUNC))
15023 + return 1; /* alternate function, GPIOCFG is ignored */
15024
15025 rb532_set_bit(0, offset, gpch->regbase + GPIOCFG);
15026 return 0;
15027 @@ -129,8 +188,8 @@
15028
15029 gpch = container_of(chip, struct rb532_gpio_chip, chip);
15030
15031 - /* disable alternate function in case it's set */
15032 - rb532_set_bit(0, offset, gpch->regbase + GPIOFUNC);
15033 + if (rb532_get_bit(offset, gpch->regbase + GPIOFUNC))
15034 + return 1; /* alternate function, GPIOCFG is ignored */
15035
15036 /* set the initial output value */
15037 rb532_set_bit(value, offset, gpch->regbase + GPIOD);
15038 @@ -174,11 +233,10 @@
15039 /*
15040 * Configure GPIO alternate function
15041 */
15042 -void rb532_gpio_set_func(unsigned gpio)
15043 +static void rb532_gpio_set_func(int bit, unsigned gpio)
15044 {
15045 - rb532_set_bit(1, gpio, rb532_gpio_chip->regbase + GPIOFUNC);
15046 + rb532_set_bit(bit, gpio, rb532_gpio_chip->regbase + GPIOFUNC);
15047 }
15048 -EXPORT_SYMBOL(rb532_gpio_set_func);
15049
15050 int __init rb532_gpio_init(void)
15051 {
15052 @@ -195,6 +253,20 @@
15053 /* Register our GPIO chip */
15054 gpiochip_add(&rb532_gpio_chip->chip);
15055
15056 + r = rb532_dev3_ctl_res;
15057 + dev3.base = ioremap_nocache(r->start, r->end - r->start);
15058 +
15059 + if (!dev3.base) {
15060 + printk(KERN_ERR "rb532: cannot remap device controller 3\n");
15061 + return -ENXIO;
15062 + }
15063 +
15064 + /* configure CF_GPIO_NUM as CFRDY IRQ source */
15065 + rb532_gpio_set_func(0, CF_GPIO_NUM);
15066 + rb532_gpio_direction_input(&rb532_gpio_chip->chip, CF_GPIO_NUM);
15067 + rb532_gpio_set_ilevel(1, CF_GPIO_NUM);
15068 + rb532_gpio_set_istat(0, CF_GPIO_NUM);
15069 +
15070 return 0;
15071 }
15072 arch_initcall(rb532_gpio_init);
15073 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/rb532/irq.c linux-2.6.29-rc3.owrt/arch/mips/rb532/irq.c
15074 --- linux-2.6.29.owrt/arch/mips/rb532/irq.c 2009-05-10 22:04:40.000000000 +0200
15075 +++ linux-2.6.29-rc3.owrt/arch/mips/rb532/irq.c 2009-05-10 23:48:28.000000000 +0200
15076 @@ -46,7 +46,6 @@
15077 #include <asm/system.h>
15078
15079 #include <asm/mach-rc32434/irq.h>
15080 -#include <asm/mach-rc32434/gpio.h>
15081
15082 struct intr_group {
15083 u32 mask; /* mask of valid bits in pending/mask registers */
15084 @@ -151,9 +150,6 @@
15085 mask |= intr_bit;
15086 WRITE_MASK(addr, mask);
15087
15088 - if (group == GPIO_MAPPED_IRQ_GROUP)
15089 - rb532_gpio_set_istat(0, irq_nr - GPIO_MAPPED_IRQ_BASE);
15090 -
15091 /*
15092 * if there are no more interrupts enabled in this
15093 * group, disable corresponding IP
15094 @@ -169,35 +165,12 @@
15095 ack_local_irq(group_to_ip(irq_to_group(irq_nr)));
15096 }
15097
15098 -static int rb532_set_type(unsigned int irq_nr, unsigned type)
15099 -{
15100 - int gpio = irq_nr - GPIO_MAPPED_IRQ_BASE;
15101 - int group = irq_to_group(irq_nr);
15102 -
15103 - if (group != GPIO_MAPPED_IRQ_GROUP)
15104 - return (type == IRQ_TYPE_LEVEL_HIGH) ? 0 : -EINVAL;
15105 -
15106 - switch (type) {
15107 - case IRQ_TYPE_LEVEL_HIGH:
15108 - rb532_gpio_set_ilevel(1, gpio);
15109 - break;
15110 - case IRQ_TYPE_LEVEL_LOW:
15111 - rb532_gpio_set_ilevel(0, gpio);
15112 - break;
15113 - default:
15114 - return -EINVAL;
15115 - }
15116 -
15117 - return 0;
15118 -}
15119 -
15120 static struct irq_chip rc32434_irq_type = {
15121 .name = "RB532",
15122 .ack = rb532_disable_irq,
15123 .mask = rb532_disable_irq,
15124 .mask_ack = rb532_mask_and_ack_irq,
15125 .unmask = rb532_enable_irq,
15126 - .set_type = rb532_set_type,
15127 };
15128
15129 void __init arch_init_irq(void)
15130 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/rb532/serial.c linux-2.6.29-rc3.owrt/arch/mips/rb532/serial.c
15131 --- linux-2.6.29.owrt/arch/mips/rb532/serial.c 2009-05-10 22:04:40.000000000 +0200
15132 +++ linux-2.6.29-rc3.owrt/arch/mips/rb532/serial.c 2009-05-10 23:48:28.000000000 +0200
15133 @@ -36,7 +36,7 @@
15134 extern unsigned int idt_cpu_freq;
15135
15136 static struct uart_port rb532_uart = {
15137 - .flags = UPF_BOOT_AUTOCONF,
15138 + .type = PORT_16550A,
15139 .line = 0,
15140 .irq = UART0_IRQ,
15141 .iotype = UPIO_MEM,
15142 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/txx9/generic/setup_tx4939.c linux-2.6.29-rc3.owrt/arch/mips/txx9/generic/setup_tx4939.c
15143 --- linux-2.6.29.owrt/arch/mips/txx9/generic/setup_tx4939.c 2009-05-10 22:04:40.000000000 +0200
15144 +++ linux-2.6.29-rc3.owrt/arch/mips/txx9/generic/setup_tx4939.c 2009-05-10 23:48:28.000000000 +0200
15145 @@ -435,28 +435,6 @@
15146 platform_device_register(&ata1_dev);
15147 }
15148
15149 -void __init tx4939_rtc_init(void)
15150 -{
15151 - static struct resource res[] = {
15152 - {
15153 - .start = TX4939_RTC_REG & 0xfffffffffULL,
15154 - .end = (TX4939_RTC_REG & 0xfffffffffULL) + 0x100 - 1,
15155 - .flags = IORESOURCE_MEM,
15156 - }, {
15157 - .start = TXX9_IRQ_BASE + TX4939_IR_RTC,
15158 - .flags = IORESOURCE_IRQ,
15159 - },
15160 - };
15161 - static struct platform_device rtc_dev = {
15162 - .name = "tx4939rtc",
15163 - .id = -1,
15164 - .num_resources = ARRAY_SIZE(res),
15165 - .resource = res,
15166 - };
15167 -
15168 - platform_device_register(&rtc_dev);
15169 -}
15170 -
15171 static void __init tx4939_stop_unused_modules(void)
15172 {
15173 __u64 pcfg, rst = 0, ckd = 0;
15174 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mips/txx9/rbtx4939/setup.c linux-2.6.29-rc3.owrt/arch/mips/txx9/rbtx4939/setup.c
15175 --- linux-2.6.29.owrt/arch/mips/txx9/rbtx4939/setup.c 2009-05-10 22:04:40.000000000 +0200
15176 +++ linux-2.6.29-rc3.owrt/arch/mips/txx9/rbtx4939/setup.c 2009-05-10 23:48:28.000000000 +0200
15177 @@ -336,7 +336,6 @@
15178 rbtx4939_led_setup();
15179 tx4939_wdt_init();
15180 tx4939_ata_init();
15181 - tx4939_rtc_init();
15182 }
15183
15184 static void __init rbtx4939_setup(void)
15185 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mn10300/Kconfig linux-2.6.29-rc3.owrt/arch/mn10300/Kconfig
15186 --- linux-2.6.29.owrt/arch/mn10300/Kconfig 2009-05-10 22:04:41.000000000 +0200
15187 +++ linux-2.6.29-rc3.owrt/arch/mn10300/Kconfig 2009-05-10 23:48:28.000000000 +0200
15188 @@ -7,7 +7,6 @@
15189
15190 config MN10300
15191 def_bool y
15192 - select HAVE_OPROFILE
15193
15194 config AM33
15195 def_bool y
15196 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/mn10300/unit-asb2305/pci.c linux-2.6.29-rc3.owrt/arch/mn10300/unit-asb2305/pci.c
15197 --- linux-2.6.29.owrt/arch/mn10300/unit-asb2305/pci.c 2009-05-10 22:04:41.000000000 +0200
15198 +++ linux-2.6.29-rc3.owrt/arch/mn10300/unit-asb2305/pci.c 2009-05-10 23:48:28.000000000 +0200
15199 @@ -173,7 +173,7 @@
15200 BRIDGEREGB(where) = value;
15201 } else {
15202 if (bus->number == 0 &&
15203 - (devfn == PCI_DEVFN(2, 0) || devfn == PCI_DEVFN(3, 0))
15204 + (devfn == PCI_DEVFN(2, 0) && devfn == PCI_DEVFN(3, 0))
15205 )
15206 __pcidebug("<= %02x", bus, devfn, where, value);
15207 CONFIG_ADDRESS = CONFIG_CMD(bus, devfn, where);
15208 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/parisc/hpux/fs.c linux-2.6.29-rc3.owrt/arch/parisc/hpux/fs.c
15209 --- linux-2.6.29.owrt/arch/parisc/hpux/fs.c 2009-05-10 22:04:39.000000000 +0200
15210 +++ linux-2.6.29-rc3.owrt/arch/parisc/hpux/fs.c 2009-05-10 23:48:28.000000000 +0200
15211 @@ -137,6 +137,7 @@
15212 error = count - buf.count;
15213 }
15214
15215 +out_putf:
15216 fput(file);
15217 out:
15218 return error;
15219 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/parisc/include/asm/assembly.h linux-2.6.29-rc3.owrt/arch/parisc/include/asm/assembly.h
15220 --- linux-2.6.29.owrt/arch/parisc/include/asm/assembly.h 2009-05-10 22:04:39.000000000 +0200
15221 +++ linux-2.6.29-rc3.owrt/arch/parisc/include/asm/assembly.h 2009-05-10 23:48:28.000000000 +0200
15222 @@ -79,7 +79,6 @@
15223
15224 #include <asm/asm-offsets.h>
15225 #include <asm/page.h>
15226 -#include <asm/types.h>
15227
15228 #include <asm/asmregs.h>
15229
15230 @@ -130,27 +129,27 @@
15231
15232 /* Shift Left - note the r and t can NOT be the same! */
15233 .macro shl r, sa, t
15234 - dep,z \r, 31-(\sa), 32-(\sa), \t
15235 + dep,z \r, 31-\sa, 32-\sa, \t
15236 .endm
15237
15238 /* The PA 2.0 shift left */
15239 .macro shlw r, sa, t
15240 - depw,z \r, 31-(\sa), 32-(\sa), \t
15241 + depw,z \r, 31-\sa, 32-\sa, \t
15242 .endm
15243
15244 /* And the PA 2.0W shift left */
15245 .macro shld r, sa, t
15246 - depd,z \r, 63-(\sa), 64-(\sa), \t
15247 + depd,z \r, 63-\sa, 64-\sa, \t
15248 .endm
15249
15250 /* Shift Right - note the r and t can NOT be the same! */
15251 .macro shr r, sa, t
15252 - extru \r, 31-(\sa), 32-(\sa), \t
15253 + extru \r, 31-\sa, 32-\sa, \t
15254 .endm
15255
15256 /* pa20w version of shift right */
15257 .macro shrd r, sa, t
15258 - extrd,u \r, 63-(\sa), 64-(\sa), \t
15259 + extrd,u \r, 63-\sa, 64-\sa, \t
15260 .endm
15261
15262 /* load 32-bit 'value' into 'reg' compensating for the ldil
15263 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/parisc/include/asm/dma-mapping.h linux-2.6.29-rc3.owrt/arch/parisc/include/asm/dma-mapping.h
15264 --- linux-2.6.29.owrt/arch/parisc/include/asm/dma-mapping.h 2009-05-10 22:04:39.000000000 +0200
15265 +++ linux-2.6.29-rc3.owrt/arch/parisc/include/asm/dma-mapping.h 2009-05-10 23:48:28.000000000 +0200
15266 @@ -5,7 +5,7 @@
15267 #include <asm/cacheflush.h>
15268 #include <asm/scatterlist.h>
15269
15270 -/* See Documentation/PCI/PCI-DMA-mapping.txt */
15271 +/* See Documentation/DMA-mapping.txt */
15272 struct hppa_dma_ops {
15273 int (*dma_supported)(struct device *dev, u64 mask);
15274 void *(*alloc_consistent)(struct device *dev, size_t size, dma_addr_t *iova, gfp_t flag);
15275 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/parisc/include/asm/io.h linux-2.6.29-rc3.owrt/arch/parisc/include/asm/io.h
15276 --- linux-2.6.29.owrt/arch/parisc/include/asm/io.h 2009-05-10 22:04:39.000000000 +0200
15277 +++ linux-2.6.29-rc3.owrt/arch/parisc/include/asm/io.h 2009-05-10 23:48:28.000000000 +0200
15278 @@ -174,48 +174,15 @@
15279 *(volatile unsigned long long __force *) addr = b;
15280 }
15281
15282 -static inline unsigned char readb(const volatile void __iomem *addr)
15283 -{
15284 - return __raw_readb(addr);
15285 -}
15286 -static inline unsigned short readw(const volatile void __iomem *addr)
15287 -{
15288 - return le16_to_cpu(__raw_readw(addr));
15289 -}
15290 -static inline unsigned int readl(const volatile void __iomem *addr)
15291 -{
15292 - return le32_to_cpu(__raw_readl(addr));
15293 -}
15294 -static inline unsigned long long readq(const volatile void __iomem *addr)
15295 -{
15296 - return le64_to_cpu(__raw_readq(addr));
15297 -}
15298 -
15299 -static inline void writeb(unsigned char b, volatile void __iomem *addr)
15300 -{
15301 - __raw_writeb(b, addr);
15302 -}
15303 -static inline void writew(unsigned short w, volatile void __iomem *addr)
15304 -{
15305 - __raw_writew(cpu_to_le16(w), addr);
15306 -}
15307 -static inline void writel(unsigned int l, volatile void __iomem *addr)
15308 -{
15309 - __raw_writel(cpu_to_le32(l), addr);
15310 -}
15311 -static inline void writeq(unsigned long long q, volatile void __iomem *addr)
15312 -{
15313 - __raw_writeq(cpu_to_le64(q), addr);
15314 -}
15315 -
15316 -#define readb readb
15317 -#define readw readw
15318 -#define readl readl
15319 -#define readq readq
15320 -#define writeb writeb
15321 -#define writew writew
15322 -#define writel writel
15323 -#define writeq writeq
15324 +/* readb can never be const, so use __fswab instead of le*_to_cpu */
15325 +#define readb(addr) __raw_readb(addr)
15326 +#define readw(addr) le16_to_cpu(__raw_readw(addr))
15327 +#define readl(addr) le32_to_cpu(__raw_readl(addr))
15328 +#define readq(addr) le64_to_cpu(__raw_readq(addr))
15329 +#define writeb(b, addr) __raw_writeb(b, addr)
15330 +#define writew(b, addr) __raw_writew(cpu_to_le16(b), addr)
15331 +#define writel(b, addr) __raw_writel(cpu_to_le32(b), addr)
15332 +#define writeq(b, addr) __raw_writeq(cpu_to_le64(b), addr)
15333
15334 #define readb_relaxed(addr) readb(addr)
15335 #define readw_relaxed(addr) readw(addr)
15336 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/parisc/include/asm/irq.h linux-2.6.29-rc3.owrt/arch/parisc/include/asm/irq.h
15337 --- linux-2.6.29.owrt/arch/parisc/include/asm/irq.h 2009-05-10 22:04:39.000000000 +0200
15338 +++ linux-2.6.29-rc3.owrt/arch/parisc/include/asm/irq.h 2009-05-10 23:48:28.000000000 +0200
15339 @@ -49,7 +49,7 @@
15340 extern unsigned long txn_affinity_addr(unsigned int irq, int cpu);
15341
15342 extern int cpu_claim_irq(unsigned int irq, struct irq_chip *, void *);
15343 -extern int cpu_check_affinity(unsigned int irq, const struct cpumask *dest);
15344 +extern int cpu_check_affinity(unsigned int irq, cpumask_t *dest);
15345
15346 /* soft power switch support (power.c) */
15347 extern struct tasklet_struct power_tasklet;
15348 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/parisc/include/asm/uaccess.h linux-2.6.29-rc3.owrt/arch/parisc/include/asm/uaccess.h
15349 --- linux-2.6.29.owrt/arch/parisc/include/asm/uaccess.h 2009-05-10 22:04:39.000000000 +0200
15350 +++ linux-2.6.29-rc3.owrt/arch/parisc/include/asm/uaccess.h 2009-05-10 23:48:28.000000000 +0200
15351 @@ -241,7 +241,6 @@
15352 #define __copy_to_user_inatomic __copy_to_user
15353 #define __copy_from_user_inatomic __copy_from_user
15354
15355 -struct pt_regs;
15356 int fixup_exception(struct pt_regs *regs);
15357
15358 #endif /* __PARISC_UACCESS_H */
15359 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/parisc/kernel/cache.c linux-2.6.29-rc3.owrt/arch/parisc/kernel/cache.c
15360 --- linux-2.6.29.owrt/arch/parisc/kernel/cache.c 2009-05-10 22:04:39.000000000 +0200
15361 +++ linux-2.6.29-rc3.owrt/arch/parisc/kernel/cache.c 2009-05-10 23:48:28.000000000 +0200
15362 @@ -551,7 +551,10 @@
15363 {
15364 int sr3;
15365
15366 - BUG_ON(!vma->vm_mm->context);
15367 + if (!vma->vm_mm->context) {
15368 + BUG();
15369 + return;
15370 + }
15371
15372 sr3 = mfsp(3);
15373 if (vma->vm_mm->context == sr3) {
15374 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/parisc/kernel/entry.S linux-2.6.29-rc3.owrt/arch/parisc/kernel/entry.S
15375 --- linux-2.6.29.owrt/arch/parisc/kernel/entry.S 2009-05-10 22:04:39.000000000 +0200
15376 +++ linux-2.6.29-rc3.owrt/arch/parisc/kernel/entry.S 2009-05-10 23:48:28.000000000 +0200
15377 @@ -368,7 +368,7 @@
15378 * abstractions for the macros */
15379 .macro EXTR reg1,start,length,reg2
15380 #ifdef CONFIG_64BIT
15381 - extrd,u \reg1,32+(\start),\length,\reg2
15382 + extrd,u \reg1,32+\start,\length,\reg2
15383 #else
15384 extrw,u \reg1,\start,\length,\reg2
15385 #endif
15386 @@ -376,7 +376,7 @@
15387
15388 .macro DEP reg1,start,length,reg2
15389 #ifdef CONFIG_64BIT
15390 - depd \reg1,32+(\start),\length,\reg2
15391 + depd \reg1,32+\start,\length,\reg2
15392 #else
15393 depw \reg1,\start,\length,\reg2
15394 #endif
15395 @@ -384,7 +384,7 @@
15396
15397 .macro DEPI val,start,length,reg
15398 #ifdef CONFIG_64BIT
15399 - depdi \val,32+(\start),\length,\reg
15400 + depdi \val,32+\start,\length,\reg
15401 #else
15402 depwi \val,\start,\length,\reg
15403 #endif
15404 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/parisc/kernel/firmware.c linux-2.6.29-rc3.owrt/arch/parisc/kernel/firmware.c
15405 --- linux-2.6.29.owrt/arch/parisc/kernel/firmware.c 2009-05-10 22:04:39.000000000 +0200
15406 +++ linux-2.6.29-rc3.owrt/arch/parisc/kernel/firmware.c 2009-05-10 23:48:28.000000000 +0200
15407 @@ -151,7 +151,7 @@
15408 }
15409
15410 #ifdef CONFIG_64BIT
15411 -void __cpuinit set_firmware_width_unlocked(void)
15412 +void __init set_firmware_width_unlocked(void)
15413 {
15414 int ret;
15415
15416 @@ -168,7 +168,7 @@
15417 * This function must be called before any pdc_* function that uses the
15418 * convert_to_wide function.
15419 */
15420 -void __cpuinit set_firmware_width(void)
15421 +void __init set_firmware_width(void)
15422 {
15423 unsigned long flags;
15424 spin_lock_irqsave(&pdc_lock, flags);
15425 @@ -176,11 +176,11 @@
15426 spin_unlock_irqrestore(&pdc_lock, flags);
15427 }
15428 #else
15429 -void __cpuinit set_firmware_width_unlocked(void) {
15430 +void __init set_firmware_width_unlocked(void) {
15431 return;
15432 }
15433
15434 -void __cpuinit set_firmware_width(void) {
15435 +void __init set_firmware_width(void) {
15436 return;
15437 }
15438 #endif /*CONFIG_64BIT*/
15439 @@ -302,7 +302,7 @@
15440 return retval;
15441 }
15442
15443 -int __cpuinit pdc_coproc_cfg_unlocked(struct pdc_coproc_cfg *pdc_coproc_info)
15444 +int __init pdc_coproc_cfg_unlocked(struct pdc_coproc_cfg *pdc_coproc_info)
15445 {
15446 int ret;
15447
15448 @@ -323,7 +323,7 @@
15449 * This PDC call returns the presence and status of all the coprocessors
15450 * attached to the processor.
15451 */
15452 -int __cpuinit pdc_coproc_cfg(struct pdc_coproc_cfg *pdc_coproc_info)
15453 +int __init pdc_coproc_cfg(struct pdc_coproc_cfg *pdc_coproc_info)
15454 {
15455 int ret;
15456 unsigned long flags;
15457 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/parisc/kernel/irq.c linux-2.6.29-rc3.owrt/arch/parisc/kernel/irq.c
15458 --- linux-2.6.29.owrt/arch/parisc/kernel/irq.c 2009-05-10 22:04:39.000000000 +0200
15459 +++ linux-2.6.29-rc3.owrt/arch/parisc/kernel/irq.c 2009-05-10 23:48:28.000000000 +0200
15460 @@ -112,7 +112,7 @@
15461 }
15462
15463 #ifdef CONFIG_SMP
15464 -int cpu_check_affinity(unsigned int irq, const struct cpumask *dest)
15465 +int cpu_check_affinity(unsigned int irq, cpumask_t *dest)
15466 {
15467 int cpu_dest;
15468
15469 @@ -120,25 +120,23 @@
15470 if (CHECK_IRQ_PER_CPU(irq)) {
15471 /* Bad linux design decision. The mask has already
15472 * been set; we must reset it */
15473 - cpumask_setall(&irq_desc[irq].affinity);
15474 + irq_desc[irq].affinity = CPU_MASK_ALL;
15475 return -EINVAL;
15476 }
15477
15478 /* whatever mask they set, we just allow one CPU */
15479 cpu_dest = first_cpu(*dest);
15480 + *dest = cpumask_of_cpu(cpu_dest);
15481
15482 - return cpu_dest;
15483 + return 0;
15484 }
15485
15486 static void cpu_set_affinity_irq(unsigned int irq, const struct cpumask *dest)
15487 {
15488 - int cpu_dest;
15489 -
15490 - cpu_dest = cpu_check_affinity(irq, dest);
15491 - if (cpu_dest < 0)
15492 + if (cpu_check_affinity(irq, dest))
15493 return;
15494
15495 - cpumask_copy(&irq_desc[irq].affinity, &cpumask_of_cpu(cpu_dest));
15496 + irq_desc[irq].affinity = *dest;
15497 }
15498 #endif
15499
15500 @@ -297,7 +295,7 @@
15501 unsigned long txn_affinity_addr(unsigned int irq, int cpu)
15502 {
15503 #ifdef CONFIG_SMP
15504 - cpumask_copy(&irq_desc[irq].affinity, cpumask_of(cpu));
15505 + irq_desc[irq].affinity = cpumask_of_cpu(cpu);
15506 #endif
15507
15508 return per_cpu(cpu_data, cpu).txn_addr;
15509 @@ -354,7 +352,7 @@
15510 irq = eirr_to_irq(eirr_val);
15511
15512 #ifdef CONFIG_SMP
15513 - cpumask_copy(&dest, &irq_desc[irq].affinity);
15514 + dest = irq_desc[irq].affinity;
15515 if (CHECK_IRQ_PER_CPU(irq_desc[irq].status) &&
15516 !cpu_isset(smp_processor_id(), dest)) {
15517 int cpu = first_cpu(dest);
15518 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/parisc/kernel/pci-dma.c linux-2.6.29-rc3.owrt/arch/parisc/kernel/pci-dma.c
15519 --- linux-2.6.29.owrt/arch/parisc/kernel/pci-dma.c 2009-05-10 22:04:39.000000000 +0200
15520 +++ linux-2.6.29-rc3.owrt/arch/parisc/kernel/pci-dma.c 2009-05-10 23:48:28.000000000 +0200
15521 @@ -2,7 +2,7 @@
15522 ** PARISC 1.1 Dynamic DMA mapping support.
15523 ** This implementation is for PA-RISC platforms that do not support
15524 ** I/O TLBs (aka DMA address translation hardware).
15525 -** See Documentation/PCI/PCI-DMA-mapping.txt for interface definitions.
15526 +** See Documentation/DMA-mapping.txt for interface definitions.
15527 **
15528 ** (c) Copyright 1999,2000 Hewlett-Packard Company
15529 ** (c) Copyright 2000 Grant Grundler
15530 @@ -447,7 +447,10 @@
15531
15532 static dma_addr_t pa11_dma_map_single(struct device *dev, void *addr, size_t size, enum dma_data_direction direction)
15533 {
15534 - BUG_ON(direction == DMA_NONE);
15535 + if (direction == DMA_NONE) {
15536 + printk(KERN_ERR "pa11_dma_map_single(PCI_DMA_NONE) called by %p\n", __builtin_return_address(0));
15537 + BUG();
15538 + }
15539
15540 flush_kernel_dcache_range((unsigned long) addr, size);
15541 return virt_to_phys(addr);
15542 @@ -455,7 +458,10 @@
15543
15544 static void pa11_dma_unmap_single(struct device *dev, dma_addr_t dma_handle, size_t size, enum dma_data_direction direction)
15545 {
15546 - BUG_ON(direction == DMA_NONE);
15547 + if (direction == DMA_NONE) {
15548 + printk(KERN_ERR "pa11_dma_unmap_single(PCI_DMA_NONE) called by %p\n", __builtin_return_address(0));
15549 + BUG();
15550 + }
15551
15552 if (direction == DMA_TO_DEVICE)
15553 return;
15554 @@ -474,7 +480,8 @@
15555 {
15556 int i;
15557
15558 - BUG_ON(direction == DMA_NONE);
15559 + if (direction == DMA_NONE)
15560 + BUG();
15561
15562 for (i = 0; i < nents; i++, sglist++ ) {
15563 unsigned long vaddr = sg_virt_addr(sglist);
15564 @@ -489,7 +496,8 @@
15565 {
15566 int i;
15567
15568 - BUG_ON(direction == DMA_NONE);
15569 + if (direction == DMA_NONE)
15570 + BUG();
15571
15572 if (direction == DMA_TO_DEVICE)
15573 return;
15574 @@ -503,14 +511,16 @@
15575
15576 static void pa11_dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, unsigned long offset, size_t size, enum dma_data_direction direction)
15577 {
15578 - BUG_ON(direction == DMA_NONE);
15579 + if (direction == DMA_NONE)
15580 + BUG();
15581
15582 flush_kernel_dcache_range((unsigned long) phys_to_virt(dma_handle) + offset, size);
15583 }
15584
15585 static void pa11_dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, unsigned long offset, size_t size, enum dma_data_direction direction)
15586 {
15587 - BUG_ON(direction == DMA_NONE);
15588 + if (direction == DMA_NONE)
15589 + BUG();
15590
15591 flush_kernel_dcache_range((unsigned long) phys_to_virt(dma_handle) + offset, size);
15592 }
15593 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/parisc/mm/init.c linux-2.6.29-rc3.owrt/arch/parisc/mm/init.c
15594 --- linux-2.6.29.owrt/arch/parisc/mm/init.c 2009-05-10 22:04:39.000000000 +0200
15595 +++ linux-2.6.29-rc3.owrt/arch/parisc/mm/init.c 2009-05-10 23:48:28.000000000 +0200
15596 @@ -304,8 +304,10 @@
15597 */
15598 max_low_pfn = max_pfn;
15599
15600 - /* bootmap sizing messed up? */
15601 - BUG_ON((bootmap_pfn - bootmap_start_pfn) != bootmap_pages);
15602 + if ((bootmap_pfn - bootmap_start_pfn) != bootmap_pages) {
15603 + printk(KERN_WARNING "WARNING! bootmap sizing is messed up!\n");
15604 + BUG();
15605 + }
15606
15607 /* reserve PAGE0 pdc memory, kernel text/data/bss & bootmap */
15608
15609 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/powerpc/boot/dts/mpc8313erdb.dts linux-2.6.29-rc3.owrt/arch/powerpc/boot/dts/mpc8313erdb.dts
15610 --- linux-2.6.29.owrt/arch/powerpc/boot/dts/mpc8313erdb.dts 2009-05-10 22:04:40.000000000 +0200
15611 +++ linux-2.6.29-rc3.owrt/arch/powerpc/boot/dts/mpc8313erdb.dts 2009-05-10 23:48:28.000000000 +0200
15612 @@ -191,8 +191,7 @@
15613 interrupts = <37 0x8 36 0x8 35 0x8>;
15614 interrupt-parent = <&ipic>;
15615 tbi-handle = < &tbi0 >;
15616 - /* Vitesse 7385 isn't on the MDIO bus */
15617 - fixed-link = <1 1 1000 0 0>;
15618 + phy-handle = < &phy1 >;
15619 fsl,magic-packet;
15620
15621 mdio@24520 {
15622 @@ -200,6 +199,12 @@
15623 #size-cells = <0>;
15624 compatible = "fsl,gianfar-mdio";
15625 reg = <0x24520 0x20>;
15626 + phy1: ethernet-phy@1 {
15627 + interrupt-parent = <&ipic>;
15628 + interrupts = <19 0x8>;
15629 + reg = <0x1>;
15630 + device_type = "ethernet-phy";
15631 + };
15632 phy4: ethernet-phy@4 {
15633 interrupt-parent = <&ipic>;
15634 interrupts = <20 0x8>;
15635 @@ -214,8 +219,6 @@
15636 };
15637
15638 enet1: ethernet@25000 {
15639 - #address-cells = <1>;
15640 - #size-cells = <1>;
15641 cell-index = <1>;
15642 device_type = "network";
15643 model = "eTSEC";
15644 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/powerpc/include/asm/compat.h linux-2.6.29-rc3.owrt/arch/powerpc/include/asm/compat.h
15645 --- linux-2.6.29.owrt/arch/powerpc/include/asm/compat.h 2009-05-10 22:04:39.000000000 +0200
15646 +++ linux-2.6.29-rc3.owrt/arch/powerpc/include/asm/compat.h 2009-05-10 23:48:28.000000000 +0200
15647 @@ -210,10 +210,5 @@
15648 compat_ulong_t __unused6;
15649 };
15650
15651 -static inline int is_compat_task(void)
15652 -{
15653 - return test_thread_flag(TIF_32BIT);
15654 -}
15655 -
15656 #endif /* __KERNEL__ */
15657 #endif /* _ASM_POWERPC_COMPAT_H */
15658 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/powerpc/include/asm/cputable.h linux-2.6.29-rc3.owrt/arch/powerpc/include/asm/cputable.h
15659 --- linux-2.6.29.owrt/arch/powerpc/include/asm/cputable.h 2009-05-10 22:04:40.000000000 +0200
15660 +++ linux-2.6.29-rc3.owrt/arch/powerpc/include/asm/cputable.h 2009-05-10 23:48:28.000000000 +0200
15661 @@ -241,11 +241,9 @@
15662 /* We need to mark all pages as being coherent if we're SMP or we have a
15663 * 74[45]x and an MPC107 host bridge. Also 83xx and PowerQUICC II
15664 * require it for PCI "streaming/prefetch" to work properly.
15665 - * This is also required by 52xx family.
15666 */
15667 #if defined(CONFIG_SMP) || defined(CONFIG_MPC10X_BRIDGE) \
15668 - || defined(CONFIG_PPC_83xx) || defined(CONFIG_8260) \
15669 - || defined(CONFIG_PPC_MPC52xx)
15670 + || defined(CONFIG_PPC_83xx) || defined(CONFIG_8260)
15671 #define CPU_FTR_COMMON CPU_FTR_NEED_COHERENT
15672 #else
15673 #define CPU_FTR_COMMON 0
15674 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/powerpc/include/asm/pgtable-4k.h linux-2.6.29-rc3.owrt/arch/powerpc/include/asm/pgtable-4k.h
15675 --- linux-2.6.29.owrt/arch/powerpc/include/asm/pgtable-4k.h 2009-05-10 22:04:39.000000000 +0200
15676 +++ linux-2.6.29-rc3.owrt/arch/powerpc/include/asm/pgtable-4k.h 2009-05-10 23:48:28.000000000 +0200
15677 @@ -60,7 +60,7 @@
15678 /* It should be preserving the high 48 bits and then specifically */
15679 /* preserving _PAGE_SECONDARY | _PAGE_GROUP_IX */
15680 #define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | \
15681 - _PAGE_HPTEFLAGS | _PAGE_SPECIAL)
15682 + _PAGE_HPTEFLAGS)
15683
15684 /* Bits to mask out from a PMD to get to the PTE page */
15685 #define PMD_MASKED_BITS 0
15686 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/powerpc/include/asm/pgtable-64k.h linux-2.6.29-rc3.owrt/arch/powerpc/include/asm/pgtable-64k.h
15687 --- linux-2.6.29.owrt/arch/powerpc/include/asm/pgtable-64k.h 2009-05-10 22:04:40.000000000 +0200
15688 +++ linux-2.6.29-rc3.owrt/arch/powerpc/include/asm/pgtable-64k.h 2009-05-10 23:48:28.000000000 +0200
15689 @@ -114,7 +114,7 @@
15690 * pgprot changes
15691 */
15692 #define _PAGE_CHG_MASK (PTE_RPN_MASK | _PAGE_HPTEFLAGS | _PAGE_DIRTY | \
15693 - _PAGE_ACCESSED | _PAGE_SPECIAL)
15694 + _PAGE_ACCESSED)
15695
15696 /* Bits to mask out from a PMD to get to the PTE page */
15697 #define PMD_MASKED_BITS 0x1ff
15698 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/powerpc/include/asm/pgtable-ppc32.h linux-2.6.29-rc3.owrt/arch/powerpc/include/asm/pgtable-ppc32.h
15699 --- linux-2.6.29.owrt/arch/powerpc/include/asm/pgtable-ppc32.h 2009-05-10 22:04:39.000000000 +0200
15700 +++ linux-2.6.29-rc3.owrt/arch/powerpc/include/asm/pgtable-ppc32.h 2009-05-10 23:48:28.000000000 +0200
15701 @@ -429,8 +429,7 @@
15702 #define PMD_PAGE_SIZE(pmd) bad_call_to_PMD_PAGE_SIZE()
15703 #endif
15704
15705 -#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | \
15706 - _PAGE_SPECIAL)
15707 +#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)
15708
15709
15710 #define PAGE_PROT_BITS (_PAGE_GUARDED | _PAGE_COHERENT | _PAGE_NO_CACHE | \
15711 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/powerpc/include/asm/seccomp.h linux-2.6.29-rc3.owrt/arch/powerpc/include/asm/seccomp.h
15712 --- linux-2.6.29.owrt/arch/powerpc/include/asm/seccomp.h 2009-05-10 22:04:40.000000000 +0200
15713 +++ linux-2.6.29-rc3.owrt/arch/powerpc/include/asm/seccomp.h 2009-05-10 23:48:28.000000000 +0200
15714 @@ -1,6 +1,10 @@
15715 #ifndef _ASM_POWERPC_SECCOMP_H
15716 #define _ASM_POWERPC_SECCOMP_H
15717
15718 +#ifdef __KERNEL__
15719 +#include <linux/thread_info.h>
15720 +#endif
15721 +
15722 #include <linux/unistd.h>
15723
15724 #define __NR_seccomp_read __NR_read
15725 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/powerpc/kernel/align.c linux-2.6.29-rc3.owrt/arch/powerpc/kernel/align.c
15726 --- linux-2.6.29.owrt/arch/powerpc/kernel/align.c 2009-05-10 22:04:40.000000000 +0200
15727 +++ linux-2.6.29-rc3.owrt/arch/powerpc/kernel/align.c 2009-05-10 23:48:28.000000000 +0200
15728 @@ -367,24 +367,27 @@
15729 static int emulate_fp_pair(unsigned char __user *addr, unsigned int reg,
15730 unsigned int flags)
15731 {
15732 - char *ptr0 = (char *) &current->thread.TS_FPR(reg);
15733 - char *ptr1 = (char *) &current->thread.TS_FPR(reg+1);
15734 - int i, ret, sw = 0;
15735 + char *ptr = (char *) &current->thread.TS_FPR(reg);
15736 + int i, ret;
15737
15738 if (!(flags & F))
15739 return 0;
15740 if (reg & 1)
15741 return 0; /* invalid form: FRS/FRT must be even */
15742 - if (flags & SW)
15743 - sw = 7;
15744 - ret = 0;
15745 - for (i = 0; i < 8; ++i) {
15746 - if (!(flags & ST)) {
15747 - ret |= __get_user(ptr0[i^sw], addr + i);
15748 - ret |= __get_user(ptr1[i^sw], addr + i + 8);
15749 - } else {
15750 - ret |= __put_user(ptr0[i^sw], addr + i);
15751 - ret |= __put_user(ptr1[i^sw], addr + i + 8);
15752 + if (!(flags & SW)) {
15753 + /* not byte-swapped - easy */
15754 + if (!(flags & ST))
15755 + ret = __copy_from_user(ptr, addr, 16);
15756 + else
15757 + ret = __copy_to_user(addr, ptr, 16);
15758 + } else {
15759 + /* each FPR value is byte-swapped separately */
15760 + ret = 0;
15761 + for (i = 0; i < 16; ++i) {
15762 + if (!(flags & ST))
15763 + ret |= __get_user(ptr[i^7], addr + i);
15764 + else
15765 + ret |= __put_user(ptr[i^7], addr + i);
15766 }
15767 }
15768 if (ret)
15769 @@ -643,16 +646,11 @@
15770 unsigned int areg, struct pt_regs *regs,
15771 unsigned int flags, unsigned int length)
15772 {
15773 - char *ptr;
15774 + char *ptr = (char *) &current->thread.TS_FPR(reg);
15775 int ret = 0;
15776
15777 flush_vsx_to_thread(current);
15778
15779 - if (reg < 32)
15780 - ptr = (char *) &current->thread.TS_FPR(reg);
15781 - else
15782 - ptr = (char *) &current->thread.vr[reg - 32];
15783 -
15784 if (flags & ST)
15785 ret = __copy_to_user(addr, ptr, length);
15786 else {
15787 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/powerpc/kernel/ftrace.c linux-2.6.29-rc3.owrt/arch/powerpc/kernel/ftrace.c
15788 --- linux-2.6.29.owrt/arch/powerpc/kernel/ftrace.c 2009-05-10 22:04:40.000000000 +0200
15789 +++ linux-2.6.29-rc3.owrt/arch/powerpc/kernel/ftrace.c 2009-05-10 23:48:28.000000000 +0200
15790 @@ -195,9 +195,8 @@
15791 return -EINVAL;
15792 }
15793
15794 - /* The bottom half is signed extended */
15795 - offset = ((unsigned)((unsigned short)jmp[0]) << 16) +
15796 - (int)((short)jmp[1]);
15797 + offset = (unsigned)((unsigned short)jmp[0]) << 16 |
15798 + (unsigned)((unsigned short)jmp[1]);
15799
15800 DEBUGP(" %x ", offset);
15801
15802 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/powerpc/kernel/head_32.S linux-2.6.29-rc3.owrt/arch/powerpc/kernel/head_32.S
15803 --- linux-2.6.29.owrt/arch/powerpc/kernel/head_32.S 2009-05-10 22:04:40.000000000 +0200
15804 +++ linux-2.6.29-rc3.owrt/arch/powerpc/kernel/head_32.S 2009-05-10 23:48:28.000000000 +0200
15805 @@ -511,11 +511,8 @@
15806 and r1,r1,r2 /* writable if _RW and _DIRTY */
15807 rlwimi r3,r3,32-1,30,30 /* _PAGE_USER -> PP msb */
15808 rlwimi r3,r3,32-1,31,31 /* _PAGE_USER -> PP lsb */
15809 - ori r1,r1,0xe04 /* clear out reserved bits */
15810 + ori r1,r1,0xe14 /* clear out reserved bits and M */
15811 andc r1,r3,r1 /* PP = user? (rw&dirty? 2: 3): 0 */
15812 -BEGIN_FTR_SECTION
15813 - rlwinm r1,r1,0,~_PAGE_COHERENT /* clear M (coherence not required) */
15814 -END_FTR_SECTION_IFCLR(CPU_FTR_NEED_COHERENT)
15815 mtspr SPRN_RPA,r1
15816 mfspr r3,SPRN_IMISS
15817 tlbli r3
15818 @@ -588,11 +585,8 @@
15819 and r1,r1,r2 /* writable if _RW and _DIRTY */
15820 rlwimi r3,r3,32-1,30,30 /* _PAGE_USER -> PP msb */
15821 rlwimi r3,r3,32-1,31,31 /* _PAGE_USER -> PP lsb */
15822 - ori r1,r1,0xe04 /* clear out reserved bits */
15823 + ori r1,r1,0xe14 /* clear out reserved bits and M */
15824 andc r1,r3,r1 /* PP = user? (rw&dirty? 2: 3): 0 */
15825 -BEGIN_FTR_SECTION
15826 - rlwinm r1,r1,0,~_PAGE_COHERENT /* clear M (coherence not required) */
15827 -END_FTR_SECTION_IFCLR(CPU_FTR_NEED_COHERENT)
15828 mtspr SPRN_RPA,r1
15829 mfspr r3,SPRN_DMISS
15830 tlbld r3
15831 @@ -659,11 +653,8 @@
15832 stw r3,0(r2) /* update PTE (accessed/dirty bits) */
15833 /* Convert linux-style PTE to low word of PPC-style PTE */
15834 rlwimi r3,r3,32-1,30,30 /* _PAGE_USER -> PP msb */
15835 - li r1,0xe05 /* clear out reserved bits & PP lsb */
15836 + li r1,0xe15 /* clear out reserved bits and M */
15837 andc r1,r3,r1 /* PP = user? 2: 0 */
15838 -BEGIN_FTR_SECTION
15839 - rlwinm r1,r1,0,~_PAGE_COHERENT /* clear M (coherence not required) */
15840 -END_FTR_SECTION_IFCLR(CPU_FTR_NEED_COHERENT)
15841 mtspr SPRN_RPA,r1
15842 mfspr r3,SPRN_DMISS
15843 tlbld r3
15844 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/powerpc/kernel/pci-common.c linux-2.6.29-rc3.owrt/arch/powerpc/kernel/pci-common.c
15845 --- linux-2.6.29.owrt/arch/powerpc/kernel/pci-common.c 2009-05-10 22:04:40.000000000 +0200
15846 +++ linux-2.6.29-rc3.owrt/arch/powerpc/kernel/pci-common.c 2009-05-10 23:48:28.000000000 +0200
15847 @@ -16,6 +16,8 @@
15848 * 2 of the License, or (at your option) any later version.
15849 */
15850
15851 +#define DEBUG
15852 +
15853 #include <linux/kernel.h>
15854 #include <linux/pci.h>
15855 #include <linux/string.h>
15856 @@ -256,8 +258,7 @@
15857 } else {
15858 pr_debug(" Got one, spec %d cells (0x%08x 0x%08x...) on %s\n",
15859 oirq.size, oirq.specifier[0], oirq.specifier[1],
15860 - oirq.controller ? oirq.controller->full_name :
15861 - "<default>");
15862 + oirq.controller->full_name);
15863
15864 virq = irq_create_of_mapping(oirq.controller, oirq.specifier,
15865 oirq.size);
15866 @@ -561,21 +562,8 @@
15867 (unsigned long long)(offset + size - 1));
15868
15869 if (mmap_state == pci_mmap_mem) {
15870 - /* Hack alert !
15871 - *
15872 - * Because X is lame and can fail starting if it gets an error trying
15873 - * to mmap legacy_mem (instead of just moving on without legacy memory
15874 - * access) we fake it here by giving it anonymous memory, effectively
15875 - * behaving just like /dev/zero
15876 - */
15877 - if ((offset + size) > hose->isa_mem_size) {
15878 - printk(KERN_DEBUG
15879 - "Process %s (pid:%d) mapped non-existing PCI legacy memory for 0%04x:%02x\n",
15880 - current->comm, current->pid, pci_domain_nr(bus), bus->number);
15881 - if (vma->vm_flags & VM_SHARED)
15882 - return shmem_zero_setup(vma);
15883 - return 0;
15884 - }
15885 + if ((offset + size) > hose->isa_mem_size)
15886 + return -ENXIO;
15887 offset += hose->isa_mem_phys;
15888 } else {
15889 unsigned long io_offset = (unsigned long)hose->io_base_virt - _IO_BASE;
15890 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/powerpc/kvm/powerpc.c linux-2.6.29-rc3.owrt/arch/powerpc/kvm/powerpc.c
15891 --- linux-2.6.29.owrt/arch/powerpc/kvm/powerpc.c 2009-05-10 22:04:40.000000000 +0200
15892 +++ linux-2.6.29-rc3.owrt/arch/powerpc/kvm/powerpc.c 2009-05-10 23:48:28.000000000 +0200
15893 @@ -125,10 +125,6 @@
15894 }
15895 }
15896
15897 -void kvm_arch_sync_events(struct kvm *kvm)
15898 -{
15899 -}
15900 -
15901 void kvm_arch_destroy_vm(struct kvm *kvm)
15902 {
15903 kvmppc_free_vcpus(kvm);
15904 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/powerpc/lib/copyuser_64.S linux-2.6.29-rc3.owrt/arch/powerpc/lib/copyuser_64.S
15905 --- linux-2.6.29.owrt/arch/powerpc/lib/copyuser_64.S 2009-05-10 22:04:40.000000000 +0200
15906 +++ linux-2.6.29-rc3.owrt/arch/powerpc/lib/copyuser_64.S 2009-05-10 23:48:28.000000000 +0200
15907 @@ -62,19 +62,18 @@
15908 72: std r8,8(r3)
15909 beq+ 3f
15910 addi r3,r3,16
15911 +23: ld r9,8(r4)
15912 .Ldo_tail:
15913 bf cr7*4+1,1f
15914 -23: lwz r9,8(r4)
15915 - addi r4,r4,4
15916 + rotldi r9,r9,32
15917 73: stw r9,0(r3)
15918 addi r3,r3,4
15919 1: bf cr7*4+2,2f
15920 -44: lhz r9,8(r4)
15921 - addi r4,r4,2
15922 + rotldi r9,r9,16
15923 74: sth r9,0(r3)
15924 addi r3,r3,2
15925 2: bf cr7*4+3,3f
15926 -45: lbz r9,8(r4)
15927 + rotldi r9,r9,8
15928 75: stb r9,0(r3)
15929 3: li r3,0
15930 blr
15931 @@ -142,24 +141,11 @@
15932 6: cmpwi cr1,r5,8
15933 addi r3,r3,32
15934 sld r9,r9,r10
15935 - ble cr1,7f
15936 + ble cr1,.Ldo_tail
15937 34: ld r0,8(r4)
15938 srd r7,r0,r11
15939 or r9,r7,r9
15940 -7:
15941 - bf cr7*4+1,1f
15942 - rotldi r9,r9,32
15943 -94: stw r9,0(r3)
15944 - addi r3,r3,4
15945 -1: bf cr7*4+2,2f
15946 - rotldi r9,r9,16
15947 -95: sth r9,0(r3)
15948 - addi r3,r3,2
15949 -2: bf cr7*4+3,3f
15950 - rotldi r9,r9,8
15951 -96: stb r9,0(r3)
15952 -3: li r3,0
15953 - blr
15954 + b .Ldo_tail
15955
15956 .Ldst_unaligned:
15957 PPC_MTOCRF 0x01,r6 /* put #bytes to 8B bdry into cr7 */
15958 @@ -232,6 +218,7 @@
15959 121:
15960 132:
15961 addi r3,r3,8
15962 +123:
15963 134:
15964 135:
15965 138:
15966 @@ -239,9 +226,6 @@
15967 140:
15968 141:
15969 142:
15970 -123:
15971 -144:
15972 -145:
15973
15974 /*
15975 * here we have had a fault on a load and r3 points to the first
15976 @@ -325,9 +309,6 @@
15977 187:
15978 188:
15979 189:
15980 -194:
15981 -195:
15982 -196:
15983 1:
15984 ld r6,-24(r1)
15985 ld r5,-8(r1)
15986 @@ -348,9 +329,7 @@
15987 .llong 72b,172b
15988 .llong 23b,123b
15989 .llong 73b,173b
15990 - .llong 44b,144b
15991 .llong 74b,174b
15992 - .llong 45b,145b
15993 .llong 75b,175b
15994 .llong 24b,124b
15995 .llong 25b,125b
15996 @@ -368,9 +347,6 @@
15997 .llong 79b,179b
15998 .llong 80b,180b
15999 .llong 34b,134b
16000 - .llong 94b,194b
16001 - .llong 95b,195b
16002 - .llong 96b,196b
16003 .llong 35b,135b
16004 .llong 81b,181b
16005 .llong 36b,136b
16006 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/powerpc/lib/memcpy_64.S linux-2.6.29-rc3.owrt/arch/powerpc/lib/memcpy_64.S
16007 --- linux-2.6.29.owrt/arch/powerpc/lib/memcpy_64.S 2009-05-10 22:04:40.000000000 +0200
16008 +++ linux-2.6.29-rc3.owrt/arch/powerpc/lib/memcpy_64.S 2009-05-10 23:48:28.000000000 +0200
16009 @@ -53,19 +53,18 @@
16010 3: std r8,8(r3)
16011 beq 3f
16012 addi r3,r3,16
16013 + ld r9,8(r4)
16014 .Ldo_tail:
16015 bf cr7*4+1,1f
16016 - lwz r9,8(r4)
16017 - addi r4,r4,4
16018 + rotldi r9,r9,32
16019 stw r9,0(r3)
16020 addi r3,r3,4
16021 1: bf cr7*4+2,2f
16022 - lhz r9,8(r4)
16023 - addi r4,r4,2
16024 + rotldi r9,r9,16
16025 sth r9,0(r3)
16026 addi r3,r3,2
16027 2: bf cr7*4+3,3f
16028 - lbz r9,8(r4)
16029 + rotldi r9,r9,8
16030 stb r9,0(r3)
16031 3: ld r3,48(r1) /* return dest pointer */
16032 blr
16033 @@ -134,24 +133,11 @@
16034 cmpwi cr1,r5,8
16035 addi r3,r3,32
16036 sld r9,r9,r10
16037 - ble cr1,6f
16038 + ble cr1,.Ldo_tail
16039 ld r0,8(r4)
16040 srd r7,r0,r11
16041 or r9,r7,r9
16042 -6:
16043 - bf cr7*4+1,1f
16044 - rotldi r9,r9,32
16045 - stw r9,0(r3)
16046 - addi r3,r3,4
16047 -1: bf cr7*4+2,2f
16048 - rotldi r9,r9,16
16049 - sth r9,0(r3)
16050 - addi r3,r3,2
16051 -2: bf cr7*4+3,3f
16052 - rotldi r9,r9,8
16053 - stb r9,0(r3)
16054 -3: ld r3,48(r1) /* return dest pointer */
16055 - blr
16056 + b .Ldo_tail
16057
16058 .Ldst_unaligned:
16059 PPC_MTOCRF 0x01,r6 # put #bytes to 8B bdry into cr7
16060 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/powerpc/lib/sstep.c linux-2.6.29-rc3.owrt/arch/powerpc/lib/sstep.c
16061 --- linux-2.6.29.owrt/arch/powerpc/lib/sstep.c 2009-05-10 22:04:40.000000000 +0200
16062 +++ linux-2.6.29-rc3.owrt/arch/powerpc/lib/sstep.c 2009-05-10 23:48:28.000000000 +0200
16063 @@ -172,8 +172,6 @@
16064 }
16065 break;
16066 case 0x378: /* orx */
16067 - if (instr & 1)
16068 - break;
16069 rs = (instr >> 21) & 0x1f;
16070 rb = (instr >> 11) & 0x1f;
16071 if (rs == rb) { /* mr */
16072 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/powerpc/mm/fsl_booke_mmu.c linux-2.6.29-rc3.owrt/arch/powerpc/mm/fsl_booke_mmu.c
16073 --- linux-2.6.29.owrt/arch/powerpc/mm/fsl_booke_mmu.c 2009-05-10 22:04:40.000000000 +0200
16074 +++ linux-2.6.29-rc3.owrt/arch/powerpc/mm/fsl_booke_mmu.c 2009-05-10 23:48:28.000000000 +0200
16075 @@ -73,7 +73,7 @@
16076 /*
16077 * Return PA for this VA if it is mapped by a CAM, or 0
16078 */
16079 -phys_addr_t v_mapped_by_tlbcam(unsigned long va)
16080 +unsigned long v_mapped_by_tlbcam(unsigned long va)
16081 {
16082 int b;
16083 for (b = 0; b < tlbcam_index; ++b)
16084 @@ -85,7 +85,7 @@
16085 /*
16086 * Return VA for a given PA or 0 if not mapped
16087 */
16088 -unsigned long p_mapped_by_tlbcam(phys_addr_t pa)
16089 +unsigned long p_mapped_by_tlbcam(unsigned long pa)
16090 {
16091 int b;
16092 for (b = 0; b < tlbcam_index; ++b)
16093 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/powerpc/mm/hash_low_32.S linux-2.6.29-rc3.owrt/arch/powerpc/mm/hash_low_32.S
16094 --- linux-2.6.29.owrt/arch/powerpc/mm/hash_low_32.S 2009-05-10 22:04:40.000000000 +0200
16095 +++ linux-2.6.29-rc3.owrt/arch/powerpc/mm/hash_low_32.S 2009-05-10 23:48:28.000000000 +0200
16096 @@ -320,7 +320,7 @@
16097 and r8,r8,r0 /* writable if _RW & _DIRTY */
16098 rlwimi r5,r5,32-1,30,30 /* _PAGE_USER -> PP msb */
16099 rlwimi r5,r5,32-2,31,31 /* _PAGE_USER -> PP lsb */
16100 - ori r8,r8,0xe04 /* clear out reserved bits */
16101 + ori r8,r8,0xe14 /* clear out reserved bits and M */
16102 andc r8,r5,r8 /* PP = user? (rw&dirty? 2: 3): 0 */
16103 BEGIN_FTR_SECTION
16104 rlwinm r8,r8,0,~_PAGE_COHERENT /* clear M (coherence not required) */
16105 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/powerpc/mm/numa.c linux-2.6.29-rc3.owrt/arch/powerpc/mm/numa.c
16106 --- linux-2.6.29.owrt/arch/powerpc/mm/numa.c 2009-05-10 22:04:40.000000000 +0200
16107 +++ linux-2.6.29-rc3.owrt/arch/powerpc/mm/numa.c 2009-05-10 23:48:28.000000000 +0200
16108 @@ -19,7 +19,6 @@
16109 #include <linux/notifier.h>
16110 #include <linux/lmb.h>
16111 #include <linux/of.h>
16112 -#include <linux/pfn.h>
16113 #include <asm/sparsemem.h>
16114 #include <asm/prom.h>
16115 #include <asm/system.h>
16116 @@ -883,7 +882,7 @@
16117 unsigned long physbase = lmb.reserved.region[i].base;
16118 unsigned long size = lmb.reserved.region[i].size;
16119 unsigned long start_pfn = physbase >> PAGE_SHIFT;
16120 - unsigned long end_pfn = PFN_UP(physbase + size);
16121 + unsigned long end_pfn = ((physbase + size) >> PAGE_SHIFT);
16122 struct node_active_region node_ar;
16123 unsigned long node_end_pfn = node->node_start_pfn +
16124 node->node_spanned_pages;
16125 @@ -909,7 +908,7 @@
16126 */
16127 if (end_pfn > node_ar.end_pfn)
16128 reserve_size = (node_ar.end_pfn << PAGE_SHIFT)
16129 - - physbase;
16130 + - (start_pfn << PAGE_SHIFT);
16131 /*
16132 * Only worry about *this* node, others may not
16133 * yet have valid NODE_DATA().
16134 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/powerpc/mm/pgtable_32.c linux-2.6.29-rc3.owrt/arch/powerpc/mm/pgtable_32.c
16135 --- linux-2.6.29.owrt/arch/powerpc/mm/pgtable_32.c 2009-05-10 22:04:40.000000000 +0200
16136 +++ linux-2.6.29-rc3.owrt/arch/powerpc/mm/pgtable_32.c 2009-05-10 23:48:28.000000000 +0200
16137 @@ -61,8 +61,8 @@
16138
16139 #ifdef HAVE_TLBCAM
16140 extern unsigned int tlbcam_index;
16141 -extern phys_addr_t v_mapped_by_tlbcam(unsigned long va);
16142 -extern unsigned long p_mapped_by_tlbcam(phys_addr_t pa);
16143 +extern unsigned long v_mapped_by_tlbcam(unsigned long va);
16144 +extern unsigned long p_mapped_by_tlbcam(unsigned long pa);
16145 #else /* !HAVE_TLBCAM */
16146 #define v_mapped_by_tlbcam(x) (0UL)
16147 #define p_mapped_by_tlbcam(x) (0UL)
16148 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/powerpc/oprofile/cell/spu_profiler.c linux-2.6.29-rc3.owrt/arch/powerpc/oprofile/cell/spu_profiler.c
16149 --- linux-2.6.29.owrt/arch/powerpc/oprofile/cell/spu_profiler.c 2009-05-10 22:04:39.000000000 +0200
16150 +++ linux-2.6.29-rc3.owrt/arch/powerpc/oprofile/cell/spu_profiler.c 2009-05-10 23:48:28.000000000 +0200
16151 @@ -16,7 +16,6 @@
16152 #include <linux/smp.h>
16153 #include <linux/slab.h>
16154 #include <asm/cell-pmu.h>
16155 -#include <asm/time.h>
16156 #include "pr_util.h"
16157
16158 #define SCALE_SHIFT 14
16159 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/powerpc/platforms/52xx/mpc52xx_pci.c linux-2.6.29-rc3.owrt/arch/powerpc/platforms/52xx/mpc52xx_pci.c
16160 --- linux-2.6.29.owrt/arch/powerpc/platforms/52xx/mpc52xx_pci.c 2009-05-10 22:04:40.000000000 +0200
16161 +++ linux-2.6.29-rc3.owrt/arch/powerpc/platforms/52xx/mpc52xx_pci.c 2009-05-10 23:48:28.000000000 +0200
16162 @@ -20,6 +20,14 @@
16163
16164
16165 /* ======================================================================== */
16166 +/* PCI windows config */
16167 +/* ======================================================================== */
16168 +
16169 +#define MPC52xx_PCI_TARGET_IO 0xf0000000
16170 +#define MPC52xx_PCI_TARGET_MEM 0x00000000
16171 +
16172 +
16173 +/* ======================================================================== */
16174 /* Structures mapping & Defines for PCI Unit */
16175 /* ======================================================================== */
16176
16177 @@ -236,7 +244,7 @@
16178
16179 static void __init
16180 mpc52xx_pci_setup(struct pci_controller *hose,
16181 - struct mpc52xx_pci __iomem *pci_regs, phys_addr_t pci_phys)
16182 + struct mpc52xx_pci __iomem *pci_regs)
16183 {
16184 struct resource *res;
16185 u32 tmp;
16186 @@ -306,14 +314,10 @@
16187 /* Set all the IWCR fields at once; they're in the same reg */
16188 out_be32(&pci_regs->iwcr, MPC52xx_PCI_IWCR_PACK(iwcr0, iwcr1, iwcr2));
16189
16190 - /* Map IMMR onto PCI bus */
16191 - pci_phys &= 0xfffc0000; /* bar0 has only 14 significant bits */
16192 - out_be32(&pci_regs->tbatr0, MPC52xx_PCI_TBATR_ENABLE | pci_phys);
16193 - out_be32(&pci_regs->bar0, PCI_BASE_ADDRESS_MEM_PREFETCH | pci_phys);
16194 -
16195 - /* Map memory onto PCI bus */
16196 - out_be32(&pci_regs->tbatr1, MPC52xx_PCI_TBATR_ENABLE);
16197 - out_be32(&pci_regs->bar1, PCI_BASE_ADDRESS_MEM_PREFETCH);
16198 + out_be32(&pci_regs->tbatr0,
16199 + MPC52xx_PCI_TBATR_ENABLE | MPC52xx_PCI_TARGET_IO );
16200 + out_be32(&pci_regs->tbatr1,
16201 + MPC52xx_PCI_TBATR_ENABLE | MPC52xx_PCI_TARGET_MEM );
16202
16203 out_be32(&pci_regs->tcr, MPC52xx_PCI_TCR_LD | MPC52xx_PCI_TCR_WCT8);
16204
16205 @@ -410,7 +414,7 @@
16206
16207 /* Finish setting up PCI using values obtained by
16208 * pci_proces_bridge_OF_ranges */
16209 - mpc52xx_pci_setup(hose, pci_regs, rsrc.start);
16210 + mpc52xx_pci_setup(hose, pci_regs);
16211
16212 return 0;
16213 }
16214 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c linux-2.6.29-rc3.owrt/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
16215 --- linux-2.6.29.owrt/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c 2009-05-10 22:04:40.000000000 +0200
16216 +++ linux-2.6.29-rc3.owrt/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c 2009-05-10 23:48:28.000000000 +0200
16217 @@ -186,7 +186,7 @@
16218 iounmap(priv->regs);
16219 out_free_bootmem:
16220 free_bootmem((unsigned long)priv,
16221 - sizeof(struct pq2ads_pci_pic));
16222 + sizeof(sizeof(struct pq2ads_pci_pic)));
16223 of_node_put(np);
16224 out_unmap_irq:
16225 irq_dispose_mapping(irq);
16226 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/powerpc/platforms/86xx/gef_sbc610.c linux-2.6.29-rc3.owrt/arch/powerpc/platforms/86xx/gef_sbc610.c
16227 --- linux-2.6.29.owrt/arch/powerpc/platforms/86xx/gef_sbc610.c 2009-05-10 22:04:40.000000000 +0200
16228 +++ linux-2.6.29-rc3.owrt/arch/powerpc/platforms/86xx/gef_sbc610.c 2009-05-10 23:48:28.000000000 +0200
16229 @@ -142,10 +142,6 @@
16230 {
16231 unsigned int val;
16232
16233 - /* Do not do the fixup on other platforms! */
16234 - if (!machine_is(gef_sbc610))
16235 - return;
16236 -
16237 printk(KERN_INFO "Running NEC uPD720101 Fixup\n");
16238
16239 /* Ensure ports 1, 2, 3, 4 & 5 are enabled */
16240 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/powerpc/platforms/embedded6xx/linkstation.c linux-2.6.29-rc3.owrt/arch/powerpc/platforms/embedded6xx/linkstation.c
16241 --- linux-2.6.29.owrt/arch/powerpc/platforms/embedded6xx/linkstation.c 2009-05-10 22:04:40.000000000 +0200
16242 +++ linux-2.6.29-rc3.owrt/arch/powerpc/platforms/embedded6xx/linkstation.c 2009-05-10 23:48:28.000000000 +0200
16243 @@ -12,6 +12,7 @@
16244
16245 #include <linux/kernel.h>
16246 #include <linux/initrd.h>
16247 +#include <linux/mtd/physmap.h>
16248 #include <linux/of_platform.h>
16249
16250 #include <asm/time.h>
16251 @@ -21,6 +22,39 @@
16252
16253 #include "mpc10x.h"
16254
16255 +static struct mtd_partition linkstation_physmap_partitions[] = {
16256 + {
16257 + .name = "mtd_firmimg",
16258 + .offset = 0x000000,
16259 + .size = 0x300000,
16260 + },
16261 + {
16262 + .name = "mtd_bootcode",
16263 + .offset = 0x300000,
16264 + .size = 0x070000,
16265 + },
16266 + {
16267 + .name = "mtd_status",
16268 + .offset = 0x370000,
16269 + .size = 0x010000,
16270 + },
16271 + {
16272 + .name = "mtd_conf",
16273 + .offset = 0x380000,
16274 + .size = 0x080000,
16275 + },
16276 + {
16277 + .name = "mtd_allflash",
16278 + .offset = 0x000000,
16279 + .size = 0x400000,
16280 + },
16281 + {
16282 + .name = "mtd_data",
16283 + .offset = 0x310000,
16284 + .size = 0x0f0000,
16285 + },
16286 +};
16287 +
16288 static __initdata struct of_device_id of_bus_ids[] = {
16289 { .type = "soc", },
16290 { .compatible = "simple-bus", },
16291 @@ -65,6 +99,10 @@
16292 static void __init linkstation_setup_arch(void)
16293 {
16294 struct device_node *np;
16295 +#ifdef CONFIG_MTD_PHYSMAP
16296 + physmap_set_partitions(linkstation_physmap_partitions,
16297 + ARRAY_SIZE(linkstation_physmap_partitions));
16298 +#endif
16299
16300 /* Lookup PCI host bridges */
16301 for_each_compatible_node(np, "pci", "mpc10x-pci")
16302 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/powerpc/platforms/embedded6xx/storcenter.c linux-2.6.29-rc3.owrt/arch/powerpc/platforms/embedded6xx/storcenter.c
16303 --- linux-2.6.29.owrt/arch/powerpc/platforms/embedded6xx/storcenter.c 2009-05-10 22:04:40.000000000 +0200
16304 +++ linux-2.6.29-rc3.owrt/arch/powerpc/platforms/embedded6xx/storcenter.c 2009-05-10 23:48:28.000000000 +0200
16305 @@ -14,6 +14,7 @@
16306 #include <linux/kernel.h>
16307 #include <linux/pci.h>
16308 #include <linux/initrd.h>
16309 +#include <linux/mtd/physmap.h>
16310 #include <linux/of_platform.h>
16311
16312 #include <asm/system.h>
16313 @@ -25,6 +26,32 @@
16314 #include "mpc10x.h"
16315
16316
16317 +#ifdef CONFIG_MTD_PHYSMAP
16318 +static struct mtd_partition storcenter_physmap_partitions[] = {
16319 + {
16320 + .name = "kernel",
16321 + .offset = 0x000000,
16322 + .size = 0x170000,
16323 + },
16324 + {
16325 + .name = "rootfs",
16326 + .offset = 0x170000,
16327 + .size = 0x590000,
16328 + },
16329 + {
16330 + .name = "uboot",
16331 + .offset = 0x700000,
16332 + .size = 0x040000,
16333 + },
16334 + {
16335 + .name = "config",
16336 + .offset = 0x740000,
16337 + .size = 0x0c0000,
16338 + },
16339 +};
16340 +#endif
16341 +
16342 +
16343 static __initdata struct of_device_id storcenter_of_bus[] = {
16344 { .name = "soc", },
16345 {},
16346 @@ -69,6 +96,11 @@
16347 {
16348 struct device_node *np;
16349
16350 +#ifdef CONFIG_MTD_PHYSMAP
16351 + physmap_set_partitions(storcenter_physmap_partitions,
16352 + ARRAY_SIZE(storcenter_physmap_partitions));
16353 +#endif
16354 +
16355 /* Lookup PCI host bridges */
16356 for_each_compatible_node(np, "pci", "mpc10x-pci")
16357 storcenter_add_bridge(np);
16358 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/powerpc/platforms/ps3/Kconfig linux-2.6.29-rc3.owrt/arch/powerpc/platforms/ps3/Kconfig
16359 --- linux-2.6.29.owrt/arch/powerpc/platforms/ps3/Kconfig 2009-05-10 22:04:40.000000000 +0200
16360 +++ linux-2.6.29-rc3.owrt/arch/powerpc/platforms/ps3/Kconfig 2009-05-10 23:48:28.000000000 +0200
16361 @@ -128,13 +128,6 @@
16362 be disabled on the kernel command line using "ps3flash=off", to
16363 not allocate this fixed buffer.
16364
16365 -config PS3_VRAM
16366 - tristate "PS3 Video RAM Storage Driver"
16367 - depends on FB_PS3=y && BLOCK && m
16368 - help
16369 - This driver allows you to use excess PS3 video RAM as volatile
16370 - storage or system swap.
16371 -
16372 config PS3_LPM
16373 tristate "PS3 Logical Performance Monitor support"
16374 depends on PPC_PS3
16375 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/powerpc/platforms/ps3/mm.c linux-2.6.29-rc3.owrt/arch/powerpc/platforms/ps3/mm.c
16376 --- linux-2.6.29.owrt/arch/powerpc/platforms/ps3/mm.c 2009-05-10 22:04:40.000000000 +0200
16377 +++ linux-2.6.29-rc3.owrt/arch/powerpc/platforms/ps3/mm.c 2009-05-10 23:48:28.000000000 +0200
16378 @@ -328,7 +328,7 @@
16379 return result;
16380 }
16381
16382 -device_initcall(ps3_mm_add_memory);
16383 +core_initcall(ps3_mm_add_memory);
16384
16385 /*============================================================================*/
16386 /* dma routines */
16387 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/powerpc/platforms/pseries/hotplug-memory.c linux-2.6.29-rc3.owrt/arch/powerpc/platforms/pseries/hotplug-memory.c
16388 --- linux-2.6.29.owrt/arch/powerpc/platforms/pseries/hotplug-memory.c 2009-05-10 22:04:40.000000000 +0200
16389 +++ linux-2.6.29-rc3.owrt/arch/powerpc/platforms/pseries/hotplug-memory.c 2009-05-10 23:48:28.000000000 +0200
16390 @@ -14,7 +14,6 @@
16391 #include <asm/firmware.h>
16392 #include <asm/machdep.h>
16393 #include <asm/pSeries_reconfig.h>
16394 -#include <asm/sparsemem.h>
16395
16396 static int pseries_remove_lmb(unsigned long base, unsigned int lmb_size)
16397 {
16398 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/powerpc/sysdev/cpm2_pic.c linux-2.6.29-rc3.owrt/arch/powerpc/sysdev/cpm2_pic.c
16399 --- linux-2.6.29.owrt/arch/powerpc/sysdev/cpm2_pic.c 2009-05-10 22:04:39.000000000 +0200
16400 +++ linux-2.6.29-rc3.owrt/arch/powerpc/sysdev/cpm2_pic.c 2009-05-10 23:48:28.000000000 +0200
16401 @@ -165,7 +165,7 @@
16402 edibit = (14 - (src - CPM2_IRQ_EXT1));
16403 else
16404 if (src >= CPM2_IRQ_PORTC15 && src <= CPM2_IRQ_PORTC0)
16405 - edibit = (31 - (CPM2_IRQ_PORTC0 - src));
16406 + edibit = (31 - (src - CPM2_IRQ_PORTC15));
16407 else
16408 return (flow_type & IRQ_TYPE_LEVEL_LOW) ? 0 : -EINVAL;
16409
16410 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/powerpc/sysdev/ipic.c linux-2.6.29-rc3.owrt/arch/powerpc/sysdev/ipic.c
16411 --- linux-2.6.29.owrt/arch/powerpc/sysdev/ipic.c 2009-05-10 22:04:39.000000000 +0200
16412 +++ linux-2.6.29-rc3.owrt/arch/powerpc/sysdev/ipic.c 2009-05-10 23:48:28.000000000 +0200
16413 @@ -890,7 +890,7 @@
16414 return irq_linear_revmap(primary_ipic->irqhost, irq);
16415 }
16416
16417 -#ifdef CONFIG_SUSPEND
16418 +#ifdef CONFIG_PM
16419 static struct {
16420 u32 sicfr;
16421 u32 siprr[2];
16422 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/powerpc/sysdev/ppc4xx_pci.c linux-2.6.29-rc3.owrt/arch/powerpc/sysdev/ppc4xx_pci.c
16423 --- linux-2.6.29.owrt/arch/powerpc/sysdev/ppc4xx_pci.c 2009-05-10 22:04:39.000000000 +0200
16424 +++ linux-2.6.29-rc3.owrt/arch/powerpc/sysdev/ppc4xx_pci.c 2009-05-10 23:48:28.000000000 +0200
16425 @@ -204,23 +204,6 @@
16426 {
16427 u32 ma, pcila, pciha;
16428
16429 - /* Hack warning ! The "old" PCI 2.x cell only let us configure the low
16430 - * 32-bit of incoming PLB addresses. The top 4 bits of the 36-bit
16431 - * address are actually hard wired to a value that appears to depend
16432 - * on the specific SoC. For example, it's 0 on 440EP and 1 on 440EPx.
16433 - *
16434 - * The trick here is we just crop those top bits and ignore them when
16435 - * programming the chip. That means the device-tree has to be right
16436 - * for the specific part used (we don't print a warning if it's wrong
16437 - * but on the other hand, you'll crash quickly enough), but at least
16438 - * this code should work whatever the hard coded value is
16439 - */
16440 - plb_addr &= 0xffffffffull;
16441 -
16442 - /* Note: Due to the above hack, the test below doesn't actually test
16443 - * if you address is above 4G, but it tests that address and
16444 - * (address + size) are both contained in the same 4G
16445 - */
16446 if ((plb_addr + size) > 0xffffffffull || !is_power_of_2(size) ||
16447 size < 0x1000 || (plb_addr & (size - 1)) != 0) {
16448 printk(KERN_WARNING "%s: Resource out of range\n",
16449 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/s390/crypto/aes_s390.c linux-2.6.29-rc3.owrt/arch/s390/crypto/aes_s390.c
16450 --- linux-2.6.29.owrt/arch/s390/crypto/aes_s390.c 2009-05-10 22:04:39.000000000 +0200
16451 +++ linux-2.6.29-rc3.owrt/arch/s390/crypto/aes_s390.c 2009-05-10 23:48:28.000000000 +0200
16452 @@ -556,7 +556,7 @@
16453 module_init(aes_s390_init);
16454 module_exit(aes_s390_fini);
16455
16456 -MODULE_ALIAS("aes-all");
16457 +MODULE_ALIAS("aes");
16458
16459 MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm");
16460 MODULE_LICENSE("GPL");
16461 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/s390/defconfig linux-2.6.29-rc3.owrt/arch/s390/defconfig
16462 --- linux-2.6.29.owrt/arch/s390/defconfig 2009-05-10 22:04:39.000000000 +0200
16463 +++ linux-2.6.29-rc3.owrt/arch/s390/defconfig 2009-05-10 23:48:28.000000000 +0200
16464 @@ -1,7 +1,7 @@
16465 #
16466 # Automatically generated make config: don't edit
16467 -# Linux kernel version: 2.6.29-rc4
16468 -# Wed Feb 11 10:07:16 2009
16469 +# Linux kernel version: 2.6.28-rc6
16470 +# Thu Nov 27 11:00:49 2008
16471 #
16472 CONFIG_SCHED_MC=y
16473 CONFIG_MMU=y
16474 @@ -14,14 +14,12 @@
16475 # CONFIG_ARCH_HAS_ILOG2_U64 is not set
16476 CONFIG_GENERIC_HWEIGHT=y
16477 CONFIG_GENERIC_TIME=y
16478 -CONFIG_GENERIC_TIME_VSYSCALL=y
16479 CONFIG_GENERIC_CLOCKEVENTS=y
16480 CONFIG_GENERIC_BUG=y
16481 CONFIG_NO_IOMEM=y
16482 CONFIG_NO_DMA=y
16483 CONFIG_GENERIC_LOCKBREAK=y
16484 CONFIG_PGSTE=y
16485 -CONFIG_VIRT_CPU_ACCOUNTING=y
16486 CONFIG_S390=y
16487 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
16488
16489 @@ -41,29 +39,20 @@
16490 # CONFIG_TASKSTATS is not set
16491 CONFIG_AUDIT=y
16492 # CONFIG_AUDITSYSCALL is not set
16493 -
16494 -#
16495 -# RCU Subsystem
16496 -#
16497 -CONFIG_CLASSIC_RCU=y
16498 -# CONFIG_TREE_RCU is not set
16499 -# CONFIG_PREEMPT_RCU is not set
16500 -# CONFIG_TREE_RCU_TRACE is not set
16501 -# CONFIG_PREEMPT_RCU_TRACE is not set
16502 CONFIG_IKCONFIG=y
16503 CONFIG_IKCONFIG_PROC=y
16504 CONFIG_LOG_BUF_SHIFT=17
16505 -CONFIG_GROUP_SCHED=y
16506 -CONFIG_FAIR_GROUP_SCHED=y
16507 -# CONFIG_RT_GROUP_SCHED is not set
16508 -CONFIG_USER_SCHED=y
16509 -# CONFIG_CGROUP_SCHED is not set
16510 CONFIG_CGROUPS=y
16511 # CONFIG_CGROUP_DEBUG is not set
16512 CONFIG_CGROUP_NS=y
16513 # CONFIG_CGROUP_FREEZER is not set
16514 # CONFIG_CGROUP_DEVICE is not set
16515 # CONFIG_CPUSETS is not set
16516 +CONFIG_GROUP_SCHED=y
16517 +CONFIG_FAIR_GROUP_SCHED=y
16518 +# CONFIG_RT_GROUP_SCHED is not set
16519 +CONFIG_USER_SCHED=y
16520 +# CONFIG_CGROUP_SCHED is not set
16521 # CONFIG_CGROUP_CPUACCT is not set
16522 # CONFIG_RESOURCE_COUNTERS is not set
16523 CONFIG_SYSFS_DEPRECATED=y
16524 @@ -74,7 +63,6 @@
16525 CONFIG_IPC_NS=y
16526 # CONFIG_USER_NS is not set
16527 # CONFIG_PID_NS is not set
16528 -# CONFIG_NET_NS is not set
16529 CONFIG_BLK_DEV_INITRD=y
16530 CONFIG_INITRAMFS_SOURCE=""
16531 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
16532 @@ -103,17 +91,17 @@
16533 # CONFIG_SLUB is not set
16534 # CONFIG_SLOB is not set
16535 # CONFIG_PROFILING is not set
16536 +# CONFIG_MARKERS is not set
16537 CONFIG_HAVE_OPROFILE=y
16538 CONFIG_KPROBES=y
16539 -CONFIG_HAVE_SYSCALL_WRAPPERS=y
16540 CONFIG_KRETPROBES=y
16541 CONFIG_HAVE_KPROBES=y
16542 CONFIG_HAVE_KRETPROBES=y
16543 CONFIG_HAVE_ARCH_TRACEHOOK=y
16544 -CONFIG_USE_GENERIC_SMP_HELPERS=y
16545 # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
16546 CONFIG_SLABINFO=y
16547 CONFIG_RT_MUTEXES=y
16548 +# CONFIG_TINY_SHMEM is not set
16549 CONFIG_BASE_SMALL=0
16550 CONFIG_MODULES=y
16551 # CONFIG_MODULE_FORCE_LOAD is not set
16552 @@ -121,7 +109,7 @@
16553 # CONFIG_MODULE_FORCE_UNLOAD is not set
16554 CONFIG_MODVERSIONS=y
16555 # CONFIG_MODULE_SRCVERSION_ALL is not set
16556 -CONFIG_INIT_ALL_POSSIBLE=y
16557 +CONFIG_KMOD=y
16558 CONFIG_STOP_MACHINE=y
16559 CONFIG_BLOCK=y
16560 # CONFIG_BLK_DEV_IO_TRACE is not set
16561 @@ -142,6 +130,7 @@
16562 # CONFIG_DEFAULT_NOOP is not set
16563 CONFIG_DEFAULT_IOSCHED="deadline"
16564 CONFIG_PREEMPT_NOTIFIERS=y
16565 +CONFIG_CLASSIC_RCU=y
16566 # CONFIG_FREEZER is not set
16567
16568 #
16569 @@ -172,7 +161,6 @@
16570 CONFIG_MARCH_Z900=y
16571 # CONFIG_MARCH_Z990 is not set
16572 # CONFIG_MARCH_Z9_109 is not set
16573 -# CONFIG_MARCH_Z10 is not set
16574 CONFIG_PACK_STACK=y
16575 # CONFIG_SMALL_STACK is not set
16576 CONFIG_CHECK_STACK=y
16577 @@ -186,6 +174,7 @@
16578 # CONFIG_PREEMPT_NONE is not set
16579 # CONFIG_PREEMPT_VOLUNTARY is not set
16580 CONFIG_PREEMPT=y
16581 +# CONFIG_PREEMPT_RCU is not set
16582 CONFIG_ARCH_SPARSEMEM_ENABLE=y
16583 CONFIG_ARCH_SPARSEMEM_DEFAULT=y
16584 CONFIG_ARCH_SELECT_MEMORY_MODEL=y
16585 @@ -206,6 +195,7 @@
16586 CONFIG_PAGEFLAGS_EXTENDED=y
16587 CONFIG_SPLIT_PTLOCK_CPUS=4
16588 CONFIG_MIGRATION=y
16589 +CONFIG_RESOURCES_64BIT=y
16590 CONFIG_PHYS_ADDR_T_64BIT=y
16591 CONFIG_ZONE_DMA_FLAG=1
16592 CONFIG_BOUNCE=y
16593 @@ -217,6 +207,7 @@
16594 #
16595 CONFIG_MACHCHK_WARNING=y
16596 CONFIG_QDIO=y
16597 +# CONFIG_QDIO_DEBUG is not set
16598 CONFIG_CHSC_SCH=m
16599
16600 #
16601 @@ -236,13 +227,15 @@
16602 # CONFIG_SHARED_KERNEL is not set
16603 # CONFIG_CMM is not set
16604 # CONFIG_PAGE_STATES is not set
16605 +CONFIG_VIRT_TIMER=y
16606 +CONFIG_VIRT_CPU_ACCOUNTING=y
16607 # CONFIG_APPLDATA_BASE is not set
16608 CONFIG_HZ_100=y
16609 # CONFIG_HZ_250 is not set
16610 # CONFIG_HZ_300 is not set
16611 # CONFIG_HZ_1000 is not set
16612 CONFIG_HZ=100
16613 -CONFIG_SCHED_HRTICK=y
16614 +# CONFIG_SCHED_HRTICK is not set
16615 CONFIG_S390_HYPFS_FS=y
16616 CONFIG_KEXEC=y
16617 # CONFIG_ZFCPDUMP is not set
16618 @@ -252,7 +245,6 @@
16619 #
16620 # Networking options
16621 #
16622 -CONFIG_COMPAT_NET_DEV_OPS=y
16623 CONFIG_PACKET=y
16624 # CONFIG_PACKET_MMAP is not set
16625 CONFIG_UNIX=y
16626 @@ -391,7 +383,6 @@
16627 CONFIG_NET_SCH_GRED=m
16628 CONFIG_NET_SCH_DSMARK=m
16629 # CONFIG_NET_SCH_NETEM is not set
16630 -# CONFIG_NET_SCH_DRR is not set
16631 # CONFIG_NET_SCH_INGRESS is not set
16632
16633 #
16634 @@ -409,7 +400,6 @@
16635 CONFIG_NET_CLS_RSVP=m
16636 CONFIG_NET_CLS_RSVP6=m
16637 CONFIG_NET_CLS_FLOW=m
16638 -# CONFIG_NET_CLS_CGROUP is not set
16639 # CONFIG_NET_EMATCH is not set
16640 CONFIG_NET_CLS_ACT=y
16641 CONFIG_NET_ACT_POLICE=y
16642 @@ -421,7 +411,6 @@
16643 # CONFIG_NET_ACT_SKBEDIT is not set
16644 # CONFIG_NET_CLS_IND is not set
16645 CONFIG_NET_SCH_FIFO=y
16646 -# CONFIG_DCB is not set
16647
16648 #
16649 # Network testing
16650 @@ -439,7 +428,6 @@
16651 # CONFIG_CAN_DEBUG_DEVICES is not set
16652 # CONFIG_AF_RXRPC is not set
16653 # CONFIG_PHONET is not set
16654 -# CONFIG_WIMAX is not set
16655 # CONFIG_RFKILL is not set
16656 # CONFIG_NET_9P is not set
16657 # CONFIG_PCMCIA is not set
16658 @@ -487,15 +475,11 @@
16659 CONFIG_DASD_EER=y
16660 CONFIG_VIRTIO_BLK=m
16661 CONFIG_MISC_DEVICES=y
16662 +# CONFIG_EEPROM_93CX6 is not set
16663 # CONFIG_ENCLOSURE_SERVICES is not set
16664 # CONFIG_C2PORT is not set
16665
16666 #
16667 -# EEPROM support
16668 -#
16669 -# CONFIG_EEPROM_93CX6 is not set
16670 -
16671 -#
16672 # SCSI device support
16673 #
16674 # CONFIG_RAID_ATTRS is not set
16675 @@ -536,7 +520,6 @@
16676 # CONFIG_SCSI_SRP_ATTRS is not set
16677 CONFIG_SCSI_LOWLEVEL=y
16678 # CONFIG_ISCSI_TCP is not set
16679 -# CONFIG_LIBFC is not set
16680 # CONFIG_SCSI_DEBUG is not set
16681 CONFIG_ZFCP=y
16682 CONFIG_SCSI_DH=m
16683 @@ -583,10 +566,6 @@
16684 CONFIG_NETDEV_1000=y
16685 CONFIG_NETDEV_10000=y
16686 # CONFIG_TR is not set
16687 -
16688 -#
16689 -# Enable WiMAX (Networking options) to see the WiMAX drivers
16690 -#
16691 # CONFIG_WAN is not set
16692
16693 #
16694 @@ -614,11 +593,9 @@
16695 #
16696 CONFIG_DEVKMEM=y
16697 CONFIG_UNIX98_PTYS=y
16698 -# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
16699 CONFIG_LEGACY_PTYS=y
16700 CONFIG_LEGACY_PTY_COUNT=256
16701 CONFIG_HVC_DRIVER=y
16702 -CONFIG_HVC_IUCV=y
16703 CONFIG_VIRTIO_CONSOLE=y
16704 CONFIG_HW_RANDOM=m
16705 CONFIG_HW_RANDOM_VIRTIO=m
16706 @@ -668,6 +645,7 @@
16707 # CONFIG_NEW_LEDS is not set
16708 CONFIG_ACCESSIBILITY=y
16709 # CONFIG_STAGING is not set
16710 +CONFIG_STAGING_EXCLUDE_BUILD=y
16711
16712 #
16713 # File systems
16714 @@ -690,7 +668,6 @@
16715 # CONFIG_XFS_FS is not set
16716 # CONFIG_GFS2_FS is not set
16717 # CONFIG_OCFS2_FS is not set
16718 -# CONFIG_BTRFS_FS is not set
16719 CONFIG_DNOTIFY=y
16720 CONFIG_INOTIFY=y
16721 CONFIG_INOTIFY_USER=y
16722 @@ -726,7 +703,10 @@
16723 # CONFIG_HUGETLBFS is not set
16724 # CONFIG_HUGETLB_PAGE is not set
16725 CONFIG_CONFIGFS_FS=m
16726 -CONFIG_MISC_FILESYSTEMS=y
16727 +
16728 +#
16729 +# Miscellaneous filesystems
16730 +#
16731 # CONFIG_ADFS_FS is not set
16732 # CONFIG_AFFS_FS is not set
16733 # CONFIG_HFS_FS is not set
16734 @@ -735,7 +715,6 @@
16735 # CONFIG_BFS_FS is not set
16736 # CONFIG_EFS_FS is not set
16737 # CONFIG_CRAMFS is not set
16738 -# CONFIG_SQUASHFS is not set
16739 # CONFIG_VXFS_FS is not set
16740 # CONFIG_MINIX_FS is not set
16741 # CONFIG_OMFS_FS is not set
16742 @@ -829,7 +808,6 @@
16743 CONFIG_DEBUG_MEMORY_INIT=y
16744 # CONFIG_DEBUG_LIST is not set
16745 # CONFIG_DEBUG_SG is not set
16746 -# CONFIG_DEBUG_NOTIFIERS is not set
16747 # CONFIG_FRAME_POINTER is not set
16748 # CONFIG_RCU_TORTURE_TEST is not set
16749 # CONFIG_RCU_CPU_STALL_DETECTOR is not set
16750 @@ -840,19 +818,15 @@
16751 # CONFIG_FAULT_INJECTION is not set
16752 # CONFIG_LATENCYTOP is not set
16753 CONFIG_SYSCTL_SYSCALL_CHECK=y
16754 -CONFIG_HAVE_FUNCTION_TRACER=y
16755
16756 #
16757 # Tracers
16758 #
16759 -# CONFIG_FUNCTION_TRACER is not set
16760 # CONFIG_IRQSOFF_TRACER is not set
16761 # CONFIG_PREEMPT_TRACER is not set
16762 # CONFIG_SCHED_TRACER is not set
16763 # CONFIG_CONTEXT_SWITCH_TRACER is not set
16764 # CONFIG_BOOT_TRACER is not set
16765 -# CONFIG_TRACE_BRANCH_PROFILING is not set
16766 -# CONFIG_STACK_TRACER is not set
16767 # CONFIG_DYNAMIC_PRINTK_DEBUG is not set
16768 CONFIG_SAMPLES=y
16769 # CONFIG_SAMPLE_KOBJECT is not set
16770 @@ -873,17 +847,11 @@
16771 #
16772 CONFIG_CRYPTO_FIPS=y
16773 CONFIG_CRYPTO_ALGAPI=y
16774 -CONFIG_CRYPTO_ALGAPI2=y
16775 -CONFIG_CRYPTO_AEAD=m
16776 -CONFIG_CRYPTO_AEAD2=y
16777 +CONFIG_CRYPTO_AEAD=y
16778 CONFIG_CRYPTO_BLKCIPHER=y
16779 -CONFIG_CRYPTO_BLKCIPHER2=y
16780 -CONFIG_CRYPTO_HASH=m
16781 -CONFIG_CRYPTO_HASH2=y
16782 -CONFIG_CRYPTO_RNG=m
16783 -CONFIG_CRYPTO_RNG2=y
16784 +CONFIG_CRYPTO_HASH=y
16785 +CONFIG_CRYPTO_RNG=y
16786 CONFIG_CRYPTO_MANAGER=y
16787 -CONFIG_CRYPTO_MANAGER2=y
16788 CONFIG_CRYPTO_GF128MUL=m
16789 # CONFIG_CRYPTO_NULL is not set
16790 # CONFIG_CRYPTO_CRYPTD is not set
16791 @@ -917,7 +885,7 @@
16792 #
16793 # Digest
16794 #
16795 -CONFIG_CRYPTO_CRC32C=m
16796 +# CONFIG_CRYPTO_CRC32C is not set
16797 # CONFIG_CRYPTO_MD4 is not set
16798 CONFIG_CRYPTO_MD5=m
16799 # CONFIG_CRYPTO_MICHAEL_MIC is not set
16800 @@ -974,7 +942,6 @@
16801 # Library routines
16802 #
16803 CONFIG_BITREVERSE=m
16804 -CONFIG_GENERIC_FIND_LAST_BIT=y
16805 # CONFIG_CRC_CCITT is not set
16806 # CONFIG_CRC16 is not set
16807 CONFIG_CRC_T10DIF=y
16808 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/s390/include/asm/cputime.h linux-2.6.29-rc3.owrt/arch/s390/include/asm/cputime.h
16809 --- linux-2.6.29.owrt/arch/s390/include/asm/cputime.h 2009-05-10 22:04:39.000000000 +0200
16810 +++ linux-2.6.29-rc3.owrt/arch/s390/include/asm/cputime.h 2009-05-10 23:48:28.000000000 +0200
16811 @@ -145,7 +145,7 @@
16812 value->tv_usec = rp.subreg.even / 4096;
16813 value->tv_sec = rp.subreg.odd;
16814 #else
16815 - value->tv_usec = (cputime % 4096000000ULL) / 4096;
16816 + value->tv_usec = cputime % 4096000000ULL;
16817 value->tv_sec = cputime / 4096000000ULL;
16818 #endif
16819 }
16820 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/s390/include/asm/lowcore.h linux-2.6.29-rc3.owrt/arch/s390/include/asm/lowcore.h
16821 --- linux-2.6.29.owrt/arch/s390/include/asm/lowcore.h 2009-05-10 22:04:39.000000000 +0200
16822 +++ linux-2.6.29-rc3.owrt/arch/s390/include/asm/lowcore.h 2009-05-10 23:48:28.000000000 +0200
16823 @@ -384,8 +384,8 @@
16824 __u32 panic_magic; /* 0xe00 */
16825
16826 /* Per cpu primary space access list */
16827 - __u8 pad_0xe04[0xe38-0xe04]; /* 0xe04 */
16828 - __u64 vdso_per_cpu_data; /* 0xe38 */
16829 + __u8 pad_0xe04[0xe3c-0xe04]; /* 0xe04 */
16830 + __u32 vdso_per_cpu_data; /* 0xe3c */
16831 __u32 paste[16]; /* 0xe40 */
16832
16833 __u8 pad13[0x11b8-0xe80]; /* 0xe80 */
16834 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/s390/include/asm/mman.h linux-2.6.29-rc3.owrt/arch/s390/include/asm/mman.h
16835 --- linux-2.6.29.owrt/arch/s390/include/asm/mman.h 2009-05-10 22:04:39.000000000 +0200
16836 +++ linux-2.6.29-rc3.owrt/arch/s390/include/asm/mman.h 2009-05-10 23:48:28.000000000 +0200
16837 @@ -22,9 +22,4 @@
16838 #define MCL_CURRENT 1 /* lock all current mappings */
16839 #define MCL_FUTURE 2 /* lock all future mappings */
16840
16841 -#if defined(__KERNEL__) && !defined(__ASSEMBLY__) && defined(CONFIG_64BIT)
16842 -int s390_mmap_check(unsigned long addr, unsigned long len);
16843 -#define arch_mmap_check(addr,len,flags) s390_mmap_check(addr,len)
16844 -#endif
16845 -
16846 #endif /* __S390_MMAN_H__ */
16847 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/s390/include/asm/processor.h linux-2.6.29-rc3.owrt/arch/s390/include/asm/processor.h
16848 --- linux-2.6.29.owrt/arch/s390/include/asm/processor.h 2009-05-10 22:04:39.000000000 +0200
16849 +++ linux-2.6.29-rc3.owrt/arch/s390/include/asm/processor.h 2009-05-10 23:48:28.000000000 +0200
16850 @@ -61,7 +61,7 @@
16851 extern int get_cpu_capability(unsigned int *);
16852
16853 /*
16854 - * User space process size: 2GB for 31 bit, 4TB or 8PT for 64 bit.
16855 + * User space process size: 2GB for 31 bit, 4TB for 64 bit.
16856 */
16857 #ifndef __s390x__
16858
16859 @@ -70,7 +70,8 @@
16860
16861 #else /* __s390x__ */
16862
16863 -#define TASK_SIZE_OF(tsk) ((tsk)->mm->context.asce_limit)
16864 +#define TASK_SIZE_OF(tsk) (test_tsk_thread_flag(tsk,TIF_31BIT) ? \
16865 + (1UL << 31) : (1UL << 53))
16866 #define TASK_UNMAPPED_BASE (test_thread_flag(TIF_31BIT) ? \
16867 (1UL << 30) : (1UL << 41))
16868 #define TASK_SIZE TASK_SIZE_OF(current)
16869 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/s390/include/asm/setup.h linux-2.6.29-rc3.owrt/arch/s390/include/asm/setup.h
16870 --- linux-2.6.29.owrt/arch/s390/include/asm/setup.h 2009-05-10 22:04:39.000000000 +0200
16871 +++ linux-2.6.29-rc3.owrt/arch/s390/include/asm/setup.h 2009-05-10 23:48:28.000000000 +0200
16872 @@ -43,8 +43,6 @@
16873
16874 extern struct mem_chunk memory_chunk[];
16875 extern unsigned long real_memory_size;
16876 -extern int memory_end_set;
16877 -extern unsigned long memory_end;
16878
16879 void detect_memory_layout(struct mem_chunk chunk[]);
16880
16881 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/s390/include/asm/topology.h linux-2.6.29-rc3.owrt/arch/s390/include/asm/topology.h
16882 --- linux-2.6.29.owrt/arch/s390/include/asm/topology.h 2009-05-10 22:04:39.000000000 +0200
16883 +++ linux-2.6.29-rc3.owrt/arch/s390/include/asm/topology.h 2009-05-10 23:48:28.000000000 +0200
16884 @@ -30,8 +30,6 @@
16885 };
16886 #endif
16887
16888 -#define SD_MC_INIT SD_CPU_INIT
16889 -
16890 #include <asm-generic/topology.h>
16891
16892 #endif /* _ASM_S390_TOPOLOGY_H */
16893 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/s390/kernel/irq.c linux-2.6.29-rc3.owrt/arch/s390/kernel/irq.c
16894 --- linux-2.6.29.owrt/arch/s390/kernel/irq.c 2009-05-10 22:04:39.000000000 +0200
16895 +++ linux-2.6.29-rc3.owrt/arch/s390/kernel/irq.c 2009-05-10 23:48:28.000000000 +0200
16896 @@ -95,7 +95,6 @@
16897 local_irq_restore(flags);
16898 }
16899
16900 -#ifdef CONFIG_PROC_FS
16901 void init_irq_proc(void)
16902 {
16903 struct proc_dir_entry *root_irq_dir;
16904 @@ -103,4 +102,3 @@
16905 root_irq_dir = proc_mkdir("irq", NULL);
16906 create_prof_cpu_mask(root_irq_dir);
16907 }
16908 -#endif
16909 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/s390/kernel/mcount.S linux-2.6.29-rc3.owrt/arch/s390/kernel/mcount.S
16910 --- linux-2.6.29.owrt/arch/s390/kernel/mcount.S 2009-05-10 22:04:39.000000000 +0200
16911 +++ linux-2.6.29-rc3.owrt/arch/s390/kernel/mcount.S 2009-05-10 23:48:28.000000000 +0200
16912 @@ -5,8 +5,6 @@
16913 *
16914 */
16915
16916 -#include <asm/asm-offsets.h>
16917 -
16918 #ifndef CONFIG_64BIT
16919 .globl _mcount
16920 _mcount:
16921 @@ -16,7 +14,7 @@
16922 ahi %r15,-96
16923 l %r3,100(%r15)
16924 la %r2,0(%r14)
16925 - st %r1,__SF_BACKCHAIN(%r15)
16926 + st %r1,0(%r15)
16927 la %r3,0(%r3)
16928 bras %r14,0f
16929 .long ftrace_trace_function
16930 @@ -40,7 +38,7 @@
16931 stg %r14,112(%r15)
16932 lgr %r1,%r15
16933 aghi %r15,-160
16934 - stg %r1,__SF_BACKCHAIN(%r15)
16935 + stg %r1,0(%r15)
16936 lgr %r2,%r14
16937 lg %r3,168(%r15)
16938 larl %r14,ftrace_trace_function
16939 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/s390/kernel/setup.c linux-2.6.29-rc3.owrt/arch/s390/kernel/setup.c
16940 --- linux-2.6.29.owrt/arch/s390/kernel/setup.c 2009-05-10 22:04:39.000000000 +0200
16941 +++ linux-2.6.29-rc3.owrt/arch/s390/kernel/setup.c 2009-05-10 23:48:28.000000000 +0200
16942 @@ -82,9 +82,7 @@
16943
16944 struct mem_chunk __initdata memory_chunk[MEMORY_CHUNKS];
16945 volatile int __cpu_logical_map[NR_CPUS]; /* logical cpu to cpu address */
16946 -
16947 -int __initdata memory_end_set;
16948 -unsigned long __initdata memory_end;
16949 +static unsigned long __initdata memory_end;
16950
16951 /*
16952 * This is set up by the setup-routine at boot-time
16953 @@ -283,7 +281,6 @@
16954 static int __init early_parse_mem(char *p)
16955 {
16956 memory_end = memparse(p, &p);
16957 - memory_end_set = 1;
16958 return 0;
16959 }
16960 early_param("mem", early_parse_mem);
16961 @@ -511,10 +508,8 @@
16962 int i;
16963
16964 #if defined(CONFIG_ZFCPDUMP) || defined(CONFIG_ZFCPDUMP_MODULE)
16965 - if (ipl_info.type == IPL_TYPE_FCP_DUMP) {
16966 + if (ipl_info.type == IPL_TYPE_FCP_DUMP)
16967 memory_end = ZFCPDUMP_HSA_SIZE;
16968 - memory_end_set = 1;
16969 - }
16970 #endif
16971 memory_size = 0;
16972 memory_end &= PAGE_MASK;
16973 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/s390/kvm/kvm-s390.c linux-2.6.29-rc3.owrt/arch/s390/kvm/kvm-s390.c
16974 --- linux-2.6.29.owrt/arch/s390/kvm/kvm-s390.c 2009-05-10 22:04:39.000000000 +0200
16975 +++ linux-2.6.29-rc3.owrt/arch/s390/kvm/kvm-s390.c 2009-05-10 23:48:28.000000000 +0200
16976 @@ -212,10 +212,6 @@
16977 }
16978 }
16979
16980 -void kvm_arch_sync_events(struct kvm *kvm)
16981 -{
16982 -}
16983 -
16984 void kvm_arch_destroy_vm(struct kvm *kvm)
16985 {
16986 kvm_free_vcpus(kvm);
16987 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/s390/lib/div64.c linux-2.6.29-rc3.owrt/arch/s390/lib/div64.c
16988 --- linux-2.6.29.owrt/arch/s390/lib/div64.c 2009-05-10 22:04:39.000000000 +0200
16989 +++ linux-2.6.29-rc3.owrt/arch/s390/lib/div64.c 2009-05-10 23:48:28.000000000 +0200
16990 @@ -61,7 +61,7 @@
16991 " clr %0,%3\n"
16992 " jl 0f\n"
16993 " slr %0,%3\n"
16994 - " ahi %1,1\n"
16995 + " alr %1,%2\n"
16996 "0:\n"
16997 : "+d" (reg2), "+d" (reg3), "=d" (tmp)
16998 : "d" (base), "2" (1UL) : "cc" );
16999 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/s390/lib/uaccess_pt.c linux-2.6.29-rc3.owrt/arch/s390/lib/uaccess_pt.c
17000 --- linux-2.6.29.owrt/arch/s390/lib/uaccess_pt.c 2009-05-10 22:04:39.000000000 +0200
17001 +++ linux-2.6.29-rc3.owrt/arch/s390/lib/uaccess_pt.c 2009-05-10 23:48:28.000000000 +0200
17002 @@ -119,6 +119,8 @@
17003 goto fault;
17004
17005 pfn = pte_pfn(*pte);
17006 + if (!pfn_valid(pfn))
17007 + goto out;
17008
17009 offset = uaddr & (PAGE_SIZE - 1);
17010 size = min(n - done, PAGE_SIZE - offset);
17011 @@ -133,6 +135,7 @@
17012 done += size;
17013 uaddr += size;
17014 } while (done < n);
17015 +out:
17016 spin_unlock(&mm->page_table_lock);
17017 return n - done;
17018 fault:
17019 @@ -160,6 +163,9 @@
17020 goto fault;
17021
17022 pfn = pte_pfn(*pte);
17023 + if (!pfn_valid(pfn))
17024 + goto out;
17025 +
17026 ret = (pfn << PAGE_SHIFT) + (uaddr & (PAGE_SIZE - 1));
17027 out:
17028 return ret;
17029 @@ -238,6 +244,11 @@
17030 goto fault;
17031
17032 pfn = pte_pfn(*pte);
17033 + if (!pfn_valid(pfn)) {
17034 + done = -1;
17035 + goto out;
17036 + }
17037 +
17038 offset = uaddr & (PAGE_SIZE-1);
17039 addr = (char *)(pfn << PAGE_SHIFT) + offset;
17040 len = min(count - done, PAGE_SIZE - offset);
17041 @@ -245,6 +256,7 @@
17042 done += len_str;
17043 uaddr += len_str;
17044 } while ((len_str == len) && (done < count));
17045 +out:
17046 spin_unlock(&mm->page_table_lock);
17047 return done + 1;
17048 fault:
17049 @@ -313,7 +325,12 @@
17050 }
17051
17052 pfn_from = pte_pfn(*pte_from);
17053 + if (!pfn_valid(pfn_from))
17054 + goto out;
17055 pfn_to = pte_pfn(*pte_to);
17056 + if (!pfn_valid(pfn_to))
17057 + goto out;
17058 +
17059 offset_from = uaddr_from & (PAGE_SIZE-1);
17060 offset_to = uaddr_from & (PAGE_SIZE-1);
17061 offset_max = max(offset_from, offset_to);
17062 @@ -325,6 +342,7 @@
17063 uaddr_from += size;
17064 uaddr_to += size;
17065 } while (done < n);
17066 +out:
17067 spin_unlock(&mm->page_table_lock);
17068 return n - done;
17069 fault:
17070 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/s390/mm/mmap.c linux-2.6.29-rc3.owrt/arch/s390/mm/mmap.c
17071 --- linux-2.6.29.owrt/arch/s390/mm/mmap.c 2009-05-10 22:04:39.000000000 +0200
17072 +++ linux-2.6.29-rc3.owrt/arch/s390/mm/mmap.c 2009-05-10 23:48:28.000000000 +0200
17073 @@ -35,7 +35,7 @@
17074 * Leave an at least ~128 MB hole.
17075 */
17076 #define MIN_GAP (128*1024*1024)
17077 -#define MAX_GAP (STACK_TOP/6*5)
17078 +#define MAX_GAP (TASK_SIZE/6*5)
17079
17080 static inline unsigned long mmap_base(void)
17081 {
17082 @@ -46,7 +46,7 @@
17083 else if (gap > MAX_GAP)
17084 gap = MAX_GAP;
17085
17086 - return STACK_TOP - (gap & PAGE_MASK);
17087 + return TASK_SIZE - (gap & PAGE_MASK);
17088 }
17089
17090 static inline int mmap_is_legacy(void)
17091 @@ -89,58 +89,42 @@
17092
17093 #else
17094
17095 -int s390_mmap_check(unsigned long addr, unsigned long len)
17096 -{
17097 - if (!test_thread_flag(TIF_31BIT) &&
17098 - len >= TASK_SIZE && TASK_SIZE < (1UL << 53))
17099 - return crst_table_upgrade(current->mm, 1UL << 53);
17100 - return 0;
17101 -}
17102 -
17103 static unsigned long
17104 s390_get_unmapped_area(struct file *filp, unsigned long addr,
17105 unsigned long len, unsigned long pgoff, unsigned long flags)
17106 {
17107 struct mm_struct *mm = current->mm;
17108 - unsigned long area;
17109 int rc;
17110
17111 - area = arch_get_unmapped_area(filp, addr, len, pgoff, flags);
17112 - if (!(area & ~PAGE_MASK))
17113 - return area;
17114 - if (area == -ENOMEM &&
17115 - !test_thread_flag(TIF_31BIT) && TASK_SIZE < (1UL << 53)) {
17116 - /* Upgrade the page table to 4 levels and retry. */
17117 - rc = crst_table_upgrade(mm, 1UL << 53);
17118 + addr = arch_get_unmapped_area(filp, addr, len, pgoff, flags);
17119 + if (addr & ~PAGE_MASK)
17120 + return addr;
17121 + if (unlikely(mm->context.asce_limit < addr + len)) {
17122 + rc = crst_table_upgrade(mm, addr + len);
17123 if (rc)
17124 return (unsigned long) rc;
17125 - area = arch_get_unmapped_area(filp, addr, len, pgoff, flags);
17126 }
17127 - return area;
17128 + return addr;
17129 }
17130
17131 static unsigned long
17132 -s390_get_unmapped_area_topdown(struct file *filp, const unsigned long addr,
17133 +s390_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
17134 const unsigned long len, const unsigned long pgoff,
17135 const unsigned long flags)
17136 {
17137 struct mm_struct *mm = current->mm;
17138 - unsigned long area;
17139 + unsigned long addr = addr0;
17140 int rc;
17141
17142 - area = arch_get_unmapped_area_topdown(filp, addr, len, pgoff, flags);
17143 - if (!(area & ~PAGE_MASK))
17144 - return area;
17145 - if (area == -ENOMEM &&
17146 - !test_thread_flag(TIF_31BIT) && TASK_SIZE < (1UL << 53)) {
17147 - /* Upgrade the page table to 4 levels and retry. */
17148 - rc = crst_table_upgrade(mm, 1UL << 53);
17149 + addr = arch_get_unmapped_area_topdown(filp, addr, len, pgoff, flags);
17150 + if (addr & ~PAGE_MASK)
17151 + return addr;
17152 + if (unlikely(mm->context.asce_limit < addr + len)) {
17153 + rc = crst_table_upgrade(mm, addr + len);
17154 if (rc)
17155 return (unsigned long) rc;
17156 - area = arch_get_unmapped_area_topdown(filp, addr, len,
17157 - pgoff, flags);
17158 }
17159 - return area;
17160 + return addr;
17161 }
17162 /*
17163 * This function, called very early during the creation of a new
17164 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/s390/mm/pgtable.c linux-2.6.29-rc3.owrt/arch/s390/mm/pgtable.c
17165 --- linux-2.6.29.owrt/arch/s390/mm/pgtable.c 2009-05-10 22:04:39.000000000 +0200
17166 +++ linux-2.6.29-rc3.owrt/arch/s390/mm/pgtable.c 2009-05-10 23:48:28.000000000 +0200
17167 @@ -117,7 +117,6 @@
17168 crst_table_init(table, entry);
17169 pgd_populate(mm, (pgd_t *) table, (pud_t *) pgd);
17170 mm->pgd = (pgd_t *) table;
17171 - mm->task_size = mm->context.asce_limit;
17172 table = NULL;
17173 }
17174 spin_unlock(&mm->page_table_lock);
17175 @@ -155,7 +154,6 @@
17176 BUG();
17177 }
17178 mm->pgd = (pgd_t *) (pgd_val(*pgd) & _REGION_ENTRY_ORIGIN);
17179 - mm->task_size = mm->context.asce_limit;
17180 crst_table_free(mm, (unsigned long *) pgd);
17181 }
17182 update_mm(mm, current);
17183 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sh/boards/board-ap325rxa.c linux-2.6.29-rc3.owrt/arch/sh/boards/board-ap325rxa.c
17184 --- linux-2.6.29.owrt/arch/sh/boards/board-ap325rxa.c 2009-05-10 22:04:41.000000000 +0200
17185 +++ linux-2.6.29-rc3.owrt/arch/sh/boards/board-ap325rxa.c 2009-05-10 23:48:28.000000000 +0200
17186 @@ -22,7 +22,6 @@
17187 #include <linux/gpio.h>
17188 #include <linux/spi/spi.h>
17189 #include <linux/spi/spi_gpio.h>
17190 -#include <media/soc_camera.h>
17191 #include <media/soc_camera_platform.h>
17192 #include <media/sh_mobile_ceu.h>
17193 #include <video/sh_mobile_lcdc.h>
17194 @@ -217,12 +216,6 @@
17195 },
17196 };
17197
17198 -static void camera_power(int val)
17199 -{
17200 - gpio_set_value(GPIO_PTZ5, val); /* RST_CAM/RSTB */
17201 - mdelay(10);
17202 -}
17203 -
17204 #ifdef CONFIG_I2C
17205 static unsigned char camera_ncm03j_magic[] =
17206 {
17207 @@ -252,11 +245,9 @@
17208 int ret = 0;
17209 int i;
17210
17211 - camera_power(0);
17212 if (!enable)
17213 return 0; /* no disable for now */
17214
17215 - camera_power(1);
17216 for (i = 0; i < ARRAY_SIZE(camera_ncm03j_magic); i += 2) {
17217 u_int8_t buf[8];
17218
17219 @@ -435,7 +426,7 @@
17220 gpio_request(GPIO_PTZ6, NULL);
17221 gpio_direction_output(GPIO_PTZ6, 0); /* STBY_CAM */
17222 gpio_request(GPIO_PTZ5, NULL);
17223 - gpio_direction_output(GPIO_PTZ5, 0); /* RST_CAM */
17224 + gpio_direction_output(GPIO_PTZ5, 1); /* RST_CAM */
17225 gpio_request(GPIO_PTZ4, NULL);
17226 gpio_direction_output(GPIO_PTZ4, 0); /* SADDR */
17227
17228 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sh/include/asm/mutex-llsc.h linux-2.6.29-rc3.owrt/arch/sh/include/asm/mutex-llsc.h
17229 --- linux-2.6.29.owrt/arch/sh/include/asm/mutex-llsc.h 2009-05-10 22:04:41.000000000 +0200
17230 +++ linux-2.6.29-rc3.owrt/arch/sh/include/asm/mutex-llsc.h 2009-05-10 23:48:28.000000000 +0200
17231 @@ -21,36 +21,38 @@
17232 static inline void
17233 __mutex_fastpath_lock(atomic_t *count, void (*fail_fn)(atomic_t *))
17234 {
17235 - int __done, __res;
17236 + int __ex_flag, __res;
17237
17238 __asm__ __volatile__ (
17239 "movli.l @%2, %0 \n"
17240 "add #-1, %0 \n"
17241 "movco.l %0, @%2 \n"
17242 "movt %1 \n"
17243 - : "=&z" (__res), "=&r" (__done)
17244 + : "=&z" (__res), "=&r" (__ex_flag)
17245 : "r" (&(count)->counter)
17246 : "t");
17247
17248 - if (unlikely(!__done || __res != 0))
17249 + __res |= !__ex_flag;
17250 + if (unlikely(__res != 0))
17251 fail_fn(count);
17252 }
17253
17254 static inline int
17255 __mutex_fastpath_lock_retval(atomic_t *count, int (*fail_fn)(atomic_t *))
17256 {
17257 - int __done, __res;
17258 + int __ex_flag, __res;
17259
17260 __asm__ __volatile__ (
17261 "movli.l @%2, %0 \n"
17262 "add #-1, %0 \n"
17263 "movco.l %0, @%2 \n"
17264 "movt %1 \n"
17265 - : "=&z" (__res), "=&r" (__done)
17266 + : "=&z" (__res), "=&r" (__ex_flag)
17267 : "r" (&(count)->counter)
17268 : "t");
17269
17270 - if (unlikely(!__done || __res != 0))
17271 + __res |= !__ex_flag;
17272 + if (unlikely(__res != 0))
17273 __res = fail_fn(count);
17274
17275 return __res;
17276 @@ -59,18 +61,19 @@
17277 static inline void
17278 __mutex_fastpath_unlock(atomic_t *count, void (*fail_fn)(atomic_t *))
17279 {
17280 - int __done, __res;
17281 + int __ex_flag, __res;
17282
17283 __asm__ __volatile__ (
17284 "movli.l @%2, %0 \n\t"
17285 "add #1, %0 \n\t"
17286 "movco.l %0, @%2 \n\t"
17287 "movt %1 \n\t"
17288 - : "=&z" (__res), "=&r" (__done)
17289 + : "=&z" (__res), "=&r" (__ex_flag)
17290 : "r" (&(count)->counter)
17291 : "t");
17292
17293 - if (unlikely(!__done || __res <= 0))
17294 + __res |= !__ex_flag;
17295 + if (unlikely(__res <= 0))
17296 fail_fn(count);
17297 }
17298
17299 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sh/include/asm/syscall_32.h linux-2.6.29-rc3.owrt/arch/sh/include/asm/syscall_32.h
17300 --- linux-2.6.29.owrt/arch/sh/include/asm/syscall_32.h 2009-05-10 22:04:41.000000000 +0200
17301 +++ linux-2.6.29-rc3.owrt/arch/sh/include/asm/syscall_32.h 2009-05-10 23:48:28.000000000 +0200
17302 @@ -21,10 +21,23 @@
17303 */
17304 }
17305
17306 +static inline bool syscall_has_error(struct pt_regs *regs)
17307 +{
17308 + return (regs->sr & 0x1) ? true : false;
17309 +}
17310 +static inline void syscall_set_error(struct pt_regs *regs)
17311 +{
17312 + regs->sr |= 0x1;
17313 +}
17314 +static inline void syscall_clear_error(struct pt_regs *regs)
17315 +{
17316 + regs->sr &= ~0x1;
17317 +}
17318 +
17319 static inline long syscall_get_error(struct task_struct *task,
17320 struct pt_regs *regs)
17321 {
17322 - return IS_ERR_VALUE(regs->regs[0]) ? regs->regs[0] : 0;
17323 + return syscall_has_error(regs) ? regs->regs[0] : 0;
17324 }
17325
17326 static inline long syscall_get_return_value(struct task_struct *task,
17327 @@ -37,10 +50,13 @@
17328 struct pt_regs *regs,
17329 int error, long val)
17330 {
17331 - if (error)
17332 + if (error) {
17333 + syscall_set_error(regs);
17334 regs->regs[0] = -error;
17335 - else
17336 + } else {
17337 + syscall_clear_error(regs);
17338 regs->regs[0] = val;
17339 + }
17340 }
17341
17342 static inline void syscall_get_arguments(struct task_struct *task,
17343 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sh/include/asm/syscall_64.h linux-2.6.29-rc3.owrt/arch/sh/include/asm/syscall_64.h
17344 --- linux-2.6.29.owrt/arch/sh/include/asm/syscall_64.h 2009-05-10 22:04:41.000000000 +0200
17345 +++ linux-2.6.29-rc3.owrt/arch/sh/include/asm/syscall_64.h 2009-05-10 23:48:28.000000000 +0200
17346 @@ -21,10 +21,23 @@
17347 */
17348 }
17349
17350 +static inline bool syscall_has_error(struct pt_regs *regs)
17351 +{
17352 + return (regs->sr & 0x1) ? true : false;
17353 +}
17354 +static inline void syscall_set_error(struct pt_regs *regs)
17355 +{
17356 + regs->sr |= 0x1;
17357 +}
17358 +static inline void syscall_clear_error(struct pt_regs *regs)
17359 +{
17360 + regs->sr &= ~0x1;
17361 +}
17362 +
17363 static inline long syscall_get_error(struct task_struct *task,
17364 struct pt_regs *regs)
17365 {
17366 - return IS_ERR_VALUE(regs->regs[9]) ? regs->regs[9] : 0;
17367 + return syscall_has_error(regs) ? regs->regs[9] : 0;
17368 }
17369
17370 static inline long syscall_get_return_value(struct task_struct *task,
17371 @@ -37,10 +50,13 @@
17372 struct pt_regs *regs,
17373 int error, long val)
17374 {
17375 - if (error)
17376 + if (error) {
17377 + syscall_set_error(regs);
17378 regs->regs[9] = -error;
17379 - else
17380 + } else {
17381 + syscall_clear_error(regs);
17382 regs->regs[9] = val;
17383 + }
17384 }
17385
17386 static inline void syscall_get_arguments(struct task_struct *task,
17387 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sh/kernel/cpu/sh2a/clock-sh7201.c linux-2.6.29-rc3.owrt/arch/sh/kernel/cpu/sh2a/clock-sh7201.c
17388 --- linux-2.6.29.owrt/arch/sh/kernel/cpu/sh2a/clock-sh7201.c 2009-05-10 22:04:41.000000000 +0200
17389 +++ linux-2.6.29-rc3.owrt/arch/sh/kernel/cpu/sh2a/clock-sh7201.c 2009-05-10 23:48:28.000000000 +0200
17390 @@ -18,8 +18,8 @@
17391 #include <asm/freq.h>
17392 #include <asm/io.h>
17393
17394 -static const int pll1rate[]={1,2,3,4,6,8};
17395 -static const int pfc_divisors[]={1,2,3,4,6,8,12};
17396 +const static int pll1rate[]={1,2,3,4,6,8};
17397 +const static int pfc_divisors[]={1,2,3,4,6,8,12};
17398 #define ifc_divisors pfc_divisors
17399
17400 #if (CONFIG_SH_CLK_MD == 0)
17401 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sh/kernel/cpu/sh4/fpu.c linux-2.6.29-rc3.owrt/arch/sh/kernel/cpu/sh4/fpu.c
17402 --- linux-2.6.29.owrt/arch/sh/kernel/cpu/sh4/fpu.c 2009-05-10 22:04:41.000000000 +0200
17403 +++ linux-2.6.29-rc3.owrt/arch/sh/kernel/cpu/sh4/fpu.c 2009-05-10 23:48:28.000000000 +0200
17404 @@ -423,7 +423,7 @@
17405 int m;
17406 unsigned int hx;
17407
17408 - m = (finsn >> 8) & 0x7;
17409 + m = (finsn >> 9) & 0x7;
17410 hx = tsk->thread.fpu.hard.fp_regs[m];
17411
17412 if ((tsk->thread.fpu.hard.fpscr & FPSCR_CAUSE_ERROR)
17413 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sh/kernel/setup.c linux-2.6.29-rc3.owrt/arch/sh/kernel/setup.c
17414 --- linux-2.6.29.owrt/arch/sh/kernel/setup.c 2009-05-10 22:04:41.000000000 +0200
17415 +++ linux-2.6.29-rc3.owrt/arch/sh/kernel/setup.c 2009-05-10 23:48:28.000000000 +0200
17416 @@ -262,11 +262,11 @@
17417 BOOTMEM_DEFAULT);
17418
17419 /*
17420 - * Reserve physical pages below CONFIG_ZERO_PAGE_OFFSET.
17421 + * reserve physical page 0 - it's a special BIOS page on many boxes,
17422 + * enabling clean reboots, SMP operation, laptop functions.
17423 */
17424 - if (CONFIG_ZERO_PAGE_OFFSET != 0)
17425 - reserve_bootmem(__MEMORY_START, CONFIG_ZERO_PAGE_OFFSET,
17426 - BOOTMEM_DEFAULT);
17427 + reserve_bootmem(__MEMORY_START, CONFIG_ZERO_PAGE_OFFSET,
17428 + BOOTMEM_DEFAULT);
17429
17430 sparse_memory_present_with_active_regions(0);
17431
17432 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sh/kernel/signal_32.c linux-2.6.29-rc3.owrt/arch/sh/kernel/signal_32.c
17433 --- linux-2.6.29.owrt/arch/sh/kernel/signal_32.c 2009-05-10 22:04:41.000000000 +0200
17434 +++ linux-2.6.29-rc3.owrt/arch/sh/kernel/signal_32.c 2009-05-10 23:48:28.000000000 +0200
17435 @@ -510,6 +510,7 @@
17436 case -ERESTARTNOHAND:
17437 no_system_call_restart:
17438 regs->regs[0] = -EINTR;
17439 + regs->sr |= 1;
17440 break;
17441
17442 case -ERESTARTSYS:
17443 @@ -588,7 +589,8 @@
17444
17445 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
17446 if (signr > 0) {
17447 - handle_syscall_restart(save_r0, regs, &ka.sa);
17448 + if (regs->sr & 1)
17449 + handle_syscall_restart(save_r0, regs, &ka.sa);
17450
17451 /* Whee! Actually deliver the signal. */
17452 if (handle_signal(signr, &ka, &info, oldset,
17453 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sh/kernel/signal_64.c linux-2.6.29-rc3.owrt/arch/sh/kernel/signal_64.c
17454 --- linux-2.6.29.owrt/arch/sh/kernel/signal_64.c 2009-05-10 22:04:41.000000000 +0200
17455 +++ linux-2.6.29-rc3.owrt/arch/sh/kernel/signal_64.c 2009-05-10 23:48:28.000000000 +0200
17456 @@ -60,6 +60,7 @@
17457 case -ERESTARTNOHAND:
17458 no_system_call_restart:
17459 regs->regs[REG_RET] = -EINTR;
17460 + regs->sr |= 1;
17461 break;
17462
17463 case -ERESTARTSYS:
17464 @@ -108,7 +109,8 @@
17465
17466 signr = get_signal_to_deliver(&info, &ka, regs, 0);
17467 if (signr > 0) {
17468 - handle_syscall_restart(regs, &ka.sa);
17469 + if (regs->sr & 1)
17470 + handle_syscall_restart(regs, &ka.sa);
17471
17472 /* Whee! Actually deliver the signal. */
17473 if (handle_signal(signr, &info, &ka, oldset, regs) == 0) {
17474 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sh/lib/checksum.S linux-2.6.29-rc3.owrt/arch/sh/lib/checksum.S
17475 --- linux-2.6.29.owrt/arch/sh/lib/checksum.S 2009-05-10 22:04:41.000000000 +0200
17476 +++ linux-2.6.29-rc3.owrt/arch/sh/lib/checksum.S 2009-05-10 23:48:28.000000000 +0200
17477 @@ -36,7 +36,8 @@
17478 */
17479
17480 /*
17481 - * asmlinkage __wsum csum_partial(const void *buf, int len, __wsum sum);
17482 + * unsigned int csum_partial(const unsigned char *buf, int len,
17483 + * unsigned int sum);
17484 */
17485
17486 .text
17487 @@ -48,31 +49,11 @@
17488 * Fortunately, it is easy to convert 2-byte alignment to 4-byte
17489 * alignment for the unrolled loop.
17490 */
17491 + mov r5, r1
17492 mov r4, r0
17493 - tst #3, r0 ! Check alignment.
17494 - bt/s 2f ! Jump if alignment is ok.
17495 - mov r4, r7 ! Keep a copy to check for alignment
17496 + tst #2, r0 ! Check alignment.
17497 + bt 2f ! Jump if alignment is ok.
17498 !
17499 - tst #1, r0 ! Check alignment.
17500 - bt 21f ! Jump if alignment is boundary of 2bytes.
17501 -
17502 - ! buf is odd
17503 - tst r5, r5
17504 - add #-1, r5
17505 - bt 9f
17506 - mov.b @r4+, r0
17507 - extu.b r0, r0
17508 - addc r0, r6 ! t=0 from previous tst
17509 - mov r6, r0
17510 - shll8 r6
17511 - shlr16 r0
17512 - shlr8 r0
17513 - or r0, r6
17514 - mov r4, r0
17515 - tst #2, r0
17516 - bt 2f
17517 -21:
17518 - ! buf is 2 byte aligned (len could be 0)
17519 add #-2, r5 ! Alignment uses up two bytes.
17520 cmp/pz r5 !
17521 bt/s 1f ! Jump if we had at least two bytes.
17522 @@ -80,17 +61,16 @@
17523 bra 6f
17524 add #2, r5 ! r5 was < 2. Deal with it.
17525 1:
17526 + mov r5, r1 ! Save new len for later use.
17527 mov.w @r4+, r0
17528 extu.w r0, r0
17529 addc r0, r6
17530 bf 2f
17531 add #1, r6
17532 2:
17533 - ! buf is 4 byte aligned (len could be 0)
17534 - mov r5, r1
17535 mov #-5, r0
17536 - shld r0, r1
17537 - tst r1, r1
17538 + shld r0, r5
17539 + tst r5, r5
17540 bt/s 4f ! if it's =0, go to 4f
17541 clrt
17542 .align 2
17543 @@ -112,31 +92,30 @@
17544 addc r0, r6
17545 addc r2, r6
17546 movt r0
17547 - dt r1
17548 + dt r5
17549 bf/s 3b
17550 cmp/eq #1, r0
17551 - ! here, we know r1==0
17552 - addc r1, r6 ! add carry to r6
17553 + ! here, we know r5==0
17554 + addc r5, r6 ! add carry to r6
17555 4:
17556 - mov r5, r0
17557 + mov r1, r0
17558 and #0x1c, r0
17559 tst r0, r0
17560 - bt 6f
17561 - ! 4 bytes or more remaining
17562 - mov r0, r1
17563 - shlr2 r1
17564 + bt/s 6f
17565 + mov r0, r5
17566 + shlr2 r5
17567 mov #0, r2
17568 5:
17569 addc r2, r6
17570 mov.l @r4+, r2
17571 movt r0
17572 - dt r1
17573 + dt r5
17574 bf/s 5b
17575 cmp/eq #1, r0
17576 addc r2, r6
17577 - addc r1, r6 ! r1==0 here, so it means add carry-bit
17578 + addc r5, r6 ! r5==0 here, so it means add carry-bit
17579 6:
17580 - ! 3 bytes or less remaining
17581 + mov r1, r5
17582 mov #3, r0
17583 and r0, r5
17584 tst r5, r5
17585 @@ -160,18 +139,8 @@
17586 8:
17587 addc r0, r6
17588 mov #0, r0
17589 - addc r0, r6
17590 + addc r0, r6
17591 9:
17592 - ! Check if the buffer was misaligned, if so realign sum
17593 - mov r7, r0
17594 - tst #1, r0
17595 - bt 10f
17596 - mov r6, r0
17597 - shll8 r6
17598 - shlr16 r0
17599 - shlr8 r0
17600 - or r0, r6
17601 -10:
17602 rts
17603 mov r6, r0
17604
17605 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/include/asm/compat.h linux-2.6.29-rc3.owrt/arch/sparc/include/asm/compat.h
17606 --- linux-2.6.29.owrt/arch/sparc/include/asm/compat.h 2009-05-10 22:04:40.000000000 +0200
17607 +++ linux-2.6.29-rc3.owrt/arch/sparc/include/asm/compat.h 2009-05-10 23:48:28.000000000 +0200
17608 @@ -240,9 +240,4 @@
17609 unsigned int __unused2;
17610 };
17611
17612 -static inline int is_compat_task(void)
17613 -{
17614 - return test_thread_flag(TIF_32BIT);
17615 -}
17616 -
17617 #endif /* _ASM_SPARC64_COMPAT_H */
17618 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/include/asm/cpudata_64.h linux-2.6.29-rc3.owrt/arch/sparc/include/asm/cpudata_64.h
17619 --- linux-2.6.29.owrt/arch/sparc/include/asm/cpudata_64.h 2009-05-10 22:04:40.000000000 +0200
17620 +++ linux-2.6.29-rc3.owrt/arch/sparc/include/asm/cpudata_64.h 2009-05-10 23:48:28.000000000 +0200
17621 @@ -17,7 +17,7 @@
17622 typedef struct {
17623 /* Dcache line 1 */
17624 unsigned int __softirq_pending; /* must be 1st, see rtrap.S */
17625 - unsigned int __nmi_count;
17626 + unsigned int __pad0;
17627 unsigned long clock_tick; /* %tick's per second */
17628 unsigned long __pad;
17629 unsigned int __pad1;
17630 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/include/asm/irq_64.h linux-2.6.29-rc3.owrt/arch/sparc/include/asm/irq_64.h
17631 --- linux-2.6.29.owrt/arch/sparc/include/asm/irq_64.h 2009-05-10 22:04:40.000000000 +0200
17632 +++ linux-2.6.29-rc3.owrt/arch/sparc/include/asm/irq_64.h 2009-05-10 23:48:28.000000000 +0200
17633 @@ -66,6 +66,9 @@
17634 extern void __init init_IRQ(void);
17635 extern void fixup_irqs(void);
17636
17637 +extern int register_perfctr_intr(void (*handler)(struct pt_regs *));
17638 +extern void release_perfctr_intr(void (*handler)(struct pt_regs *));
17639 +
17640 static inline void set_softint(unsigned long bits)
17641 {
17642 __asm__ __volatile__("wr %0, 0x0, %%set_softint"
17643 @@ -95,6 +98,5 @@
17644 extern void *hardirq_stack[NR_CPUS];
17645 extern void *softirq_stack[NR_CPUS];
17646 #define __ARCH_HAS_DO_SOFTIRQ
17647 -#define ARCH_HAS_NMI_WATCHDOG
17648
17649 #endif
17650 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/include/asm/kdebug_64.h linux-2.6.29-rc3.owrt/arch/sparc/include/asm/kdebug_64.h
17651 --- linux-2.6.29.owrt/arch/sparc/include/asm/kdebug_64.h 2009-05-10 22:04:40.000000000 +0200
17652 +++ linux-2.6.29-rc3.owrt/arch/sparc/include/asm/kdebug_64.h 2009-05-10 23:48:28.000000000 +0200
17653 @@ -14,8 +14,6 @@
17654 DIE_TRAP,
17655 DIE_TRAP_TL1,
17656 DIE_CALL,
17657 - DIE_NMI,
17658 - DIE_NMIWATCHDOG,
17659 };
17660
17661 #endif
17662 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/include/asm/nmi.h linux-2.6.29-rc3.owrt/arch/sparc/include/asm/nmi.h
17663 --- linux-2.6.29.owrt/arch/sparc/include/asm/nmi.h 2009-05-10 22:04:40.000000000 +0200
17664 +++ linux-2.6.29-rc3.owrt/arch/sparc/include/asm/nmi.h 1970-01-01 01:00:00.000000000 +0100
17665 @@ -1,10 +0,0 @@
17666 -#ifndef __NMI_H
17667 -#define __NMI_H
17668 -
17669 -extern int __init nmi_init(void);
17670 -extern void perfctr_irq(int irq, struct pt_regs *regs);
17671 -extern void nmi_adjust_hz(unsigned int new_hz);
17672 -
17673 -extern int nmi_usable;
17674 -
17675 -#endif /* __NMI_H */
17676 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/include/asm/pcr.h linux-2.6.29-rc3.owrt/arch/sparc/include/asm/pcr.h
17677 --- linux-2.6.29.owrt/arch/sparc/include/asm/pcr.h 2009-05-10 22:04:40.000000000 +0200
17678 +++ linux-2.6.29-rc3.owrt/arch/sparc/include/asm/pcr.h 1970-01-01 01:00:00.000000000 +0100
17679 @@ -1,46 +0,0 @@
17680 -#ifndef __PCR_H
17681 -#define __PCR_H
17682 -
17683 -struct pcr_ops {
17684 - u64 (*read)(void);
17685 - void (*write)(u64);
17686 -};
17687 -extern const struct pcr_ops *pcr_ops;
17688 -
17689 -extern void deferred_pcr_work_irq(int irq, struct pt_regs *regs);
17690 -extern void schedule_deferred_pcr_work(void);
17691 -
17692 -#define PCR_PIC_PRIV 0x00000001 /* PIC access is privileged */
17693 -#define PCR_STRACE 0x00000002 /* Trace supervisor events */
17694 -#define PCR_UTRACE 0x00000004 /* Trace user events */
17695 -#define PCR_N2_HTRACE 0x00000008 /* Trace hypervisor events */
17696 -#define PCR_N2_TOE_OV0 0x00000010 /* Trap if PIC 0 overflows */
17697 -#define PCR_N2_TOE_OV1 0x00000020 /* Trap if PIC 1 overflows */
17698 -#define PCR_N2_MASK0 0x00003fc0
17699 -#define PCR_N2_MASK0_SHIFT 6
17700 -#define PCR_N2_SL0 0x0003c000
17701 -#define PCR_N2_SL0_SHIFT 14
17702 -#define PCR_N2_OV0 0x00040000
17703 -#define PCR_N2_MASK1 0x07f80000
17704 -#define PCR_N2_MASK1_SHIFT 19
17705 -#define PCR_N2_SL1 0x78000000
17706 -#define PCR_N2_SL1_SHIFT 27
17707 -#define PCR_N2_OV1 0x80000000
17708 -
17709 -extern unsigned int picl_shift;
17710 -
17711 -/* In order to commonize as much of the implementation as
17712 - * possible, we use PICH as our counter. Mostly this is
17713 - * to accomodate Niagara-1 which can only count insn cycles
17714 - * in PICH.
17715 - */
17716 -static inline u64 picl_value(unsigned int nmi_hz)
17717 -{
17718 - u32 delta = local_cpu_data().clock_tick / (nmi_hz << picl_shift);
17719 -
17720 - return ((u64)((0 - delta) & 0xffffffff)) << 32;
17721 -}
17722 -
17723 -extern u64 pcr_enable;
17724 -
17725 -#endif /* __PCR_H */
17726 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/include/asm/pil.h linux-2.6.29-rc3.owrt/arch/sparc/include/asm/pil.h
17727 --- linux-2.6.29.owrt/arch/sparc/include/asm/pil.h 2009-05-10 22:04:40.000000000 +0200
17728 +++ linux-2.6.29-rc3.owrt/arch/sparc/include/asm/pil.h 2009-05-10 23:48:28.000000000 +0200
17729 @@ -23,8 +23,6 @@
17730 #define PIL_SMP_CTX_NEW_VERSION 4
17731 #define PIL_DEVICE_IRQ 5
17732 #define PIL_SMP_CALL_FUNC_SNGL 6
17733 -#define PIL_DEFERRED_PCR_WORK 7
17734 -#define PIL_KGDB_CAPTURE 8
17735 #define PIL_NORMAL_MAX 14
17736 #define PIL_NMI 15
17737
17738 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/include/asm/seccomp.h linux-2.6.29-rc3.owrt/arch/sparc/include/asm/seccomp.h
17739 --- linux-2.6.29.owrt/arch/sparc/include/asm/seccomp.h 2009-05-10 22:04:40.000000000 +0200
17740 +++ linux-2.6.29-rc3.owrt/arch/sparc/include/asm/seccomp.h 2009-05-10 23:48:28.000000000 +0200
17741 @@ -1,5 +1,11 @@
17742 #ifndef _ASM_SECCOMP_H
17743
17744 +#include <linux/thread_info.h> /* already defines TIF_32BIT */
17745 +
17746 +#ifndef TIF_32BIT
17747 +#error "unexpected TIF_32BIT on sparc64"
17748 +#endif
17749 +
17750 #include <linux/unistd.h>
17751
17752 #define __NR_seccomp_read __NR_read
17753 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/kernel/chmc.c linux-2.6.29-rc3.owrt/arch/sparc/kernel/chmc.c
17754 --- linux-2.6.29.owrt/arch/sparc/kernel/chmc.c 2009-05-10 22:04:40.000000000 +0200
17755 +++ linux-2.6.29-rc3.owrt/arch/sparc/kernel/chmc.c 2009-05-10 23:48:28.000000000 +0200
17756 @@ -306,7 +306,6 @@
17757 buf[1] = '?';
17758 buf[2] = '?';
17759 buf[3] = '\0';
17760 - return 0;
17761 }
17762 p = dp->controller;
17763 prop = &p->layout;
17764 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/kernel/cpu.c linux-2.6.29-rc3.owrt/arch/sparc/kernel/cpu.c
17765 --- linux-2.6.29.owrt/arch/sparc/kernel/cpu.c 2009-05-10 22:04:40.000000000 +0200
17766 +++ linux-2.6.29-rc3.owrt/arch/sparc/kernel/cpu.c 2009-05-10 23:48:28.000000000 +0200
17767 @@ -26,7 +26,6 @@
17768 struct cpu_info {
17769 int psr_vers;
17770 const char *name;
17771 - const char *pmu_name;
17772 };
17773
17774 struct fpu_info {
17775 @@ -46,9 +45,6 @@
17776 #define CPU(ver, _name) \
17777 { .psr_vers = ver, .name = _name }
17778
17779 -#define CPU_PMU(ver, _name, _pmu_name) \
17780 -{ .psr_vers = ver, .name = _name, .pmu_name = _pmu_name }
17781 -
17782 #define FPU(ver, _name) \
17783 { .fp_vers = ver, .name = _name }
17784
17785 @@ -187,10 +183,10 @@
17786 },{
17787 0x17,
17788 .cpu_info = {
17789 - CPU_PMU(0x10, "TI UltraSparc I (SpitFire)", "ultra12"),
17790 - CPU_PMU(0x11, "TI UltraSparc II (BlackBird)", "ultra12"),
17791 - CPU_PMU(0x12, "TI UltraSparc IIi (Sabre)", "ultra12"),
17792 - CPU_PMU(0x13, "TI UltraSparc IIe (Hummingbird)", "ultra12"),
17793 + CPU(0x10, "TI UltraSparc I (SpitFire)"),
17794 + CPU(0x11, "TI UltraSparc II (BlackBird)"),
17795 + CPU(0x12, "TI UltraSparc IIi (Sabre)"),
17796 + CPU(0x13, "TI UltraSparc IIe (Hummingbird)"),
17797 CPU(-1, NULL)
17798 },
17799 .fpu_info = {
17800 @@ -203,7 +199,7 @@
17801 },{
17802 0x22,
17803 .cpu_info = {
17804 - CPU_PMU(0x10, "TI UltraSparc I (SpitFire)", "ultra12"),
17805 + CPU(0x10, "TI UltraSparc I (SpitFire)"),
17806 CPU(-1, NULL)
17807 },
17808 .fpu_info = {
17809 @@ -213,12 +209,12 @@
17810 },{
17811 0x3e,
17812 .cpu_info = {
17813 - CPU_PMU(0x14, "TI UltraSparc III (Cheetah)", "ultra3"),
17814 - CPU_PMU(0x15, "TI UltraSparc III+ (Cheetah+)", "ultra3+"),
17815 - CPU_PMU(0x16, "TI UltraSparc IIIi (Jalapeno)", "ultra3i"),
17816 - CPU_PMU(0x18, "TI UltraSparc IV (Jaguar)", "ultra3+"),
17817 - CPU_PMU(0x19, "TI UltraSparc IV+ (Panther)", "ultra4+"),
17818 - CPU_PMU(0x22, "TI UltraSparc IIIi+ (Serrano)", "ultra3i"),
17819 + CPU(0x14, "TI UltraSparc III (Cheetah)"),
17820 + CPU(0x15, "TI UltraSparc III+ (Cheetah+)"),
17821 + CPU(0x16, "TI UltraSparc IIIi (Jalapeno)"),
17822 + CPU(0x18, "TI UltraSparc IV (Jaguar)"),
17823 + CPU(0x19, "TI UltraSparc IV+ (Panther)"),
17824 + CPU(0x22, "TI UltraSparc IIIi+ (Serrano)"),
17825 CPU(-1, NULL)
17826 },
17827 .fpu_info = {
17828 @@ -238,7 +234,6 @@
17829
17830 const char *sparc_cpu_type;
17831 const char *sparc_fpu_type;
17832 -const char *sparc_pmu_type;
17833
17834 unsigned int fsr_storage;
17835
17836 @@ -249,7 +244,6 @@
17837
17838 sparc_cpu_type = NULL;
17839 sparc_fpu_type = NULL;
17840 - sparc_pmu_type = NULL;
17841 manuf = NULL;
17842
17843 for (i = 0; i < ARRAY_SIZE(manufacturer_info); i++)
17844 @@ -269,7 +263,6 @@
17845 {
17846 if (cpu->psr_vers == psr_vers) {
17847 sparc_cpu_type = cpu->name;
17848 - sparc_pmu_type = cpu->pmu_name;
17849 sparc_fpu_type = "No FPU";
17850 break;
17851 }
17852 @@ -297,8 +290,6 @@
17853 psr_impl, fpu_vers);
17854 sparc_fpu_type = "Unknown FPU";
17855 }
17856 - if (sparc_pmu_type == NULL)
17857 - sparc_pmu_type = "Unknown PMU";
17858 }
17859
17860 #ifdef CONFIG_SPARC32
17861 @@ -324,13 +315,11 @@
17862 case SUN4V_CHIP_NIAGARA1:
17863 sparc_cpu_type = "UltraSparc T1 (Niagara)";
17864 sparc_fpu_type = "UltraSparc T1 integrated FPU";
17865 - sparc_pmu_type = "niagara";
17866 break;
17867
17868 case SUN4V_CHIP_NIAGARA2:
17869 sparc_cpu_type = "UltraSparc T2 (Niagara2)";
17870 sparc_fpu_type = "UltraSparc T2 integrated FPU";
17871 - sparc_pmu_type = "niagara2";
17872 break;
17873
17874 default:
17875 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/kernel/head_64.S linux-2.6.29-rc3.owrt/arch/sparc/kernel/head_64.S
17876 --- linux-2.6.29.owrt/arch/sparc/kernel/head_64.S 2009-05-10 22:04:40.000000000 +0200
17877 +++ linux-2.6.29-rc3.owrt/arch/sparc/kernel/head_64.S 2009-05-10 23:48:28.000000000 +0200
17878 @@ -891,35 +891,10 @@
17879 tlb_type: .word 0 /* Must NOT end up in BSS */
17880 .section ".fixup",#alloc,#execinstr
17881
17882 - .globl __ret_efault, __retl_efault, __ret_one, __retl_one
17883 -ENTRY(__ret_efault)
17884 + .globl __ret_efault, __retl_efault
17885 +__ret_efault:
17886 ret
17887 restore %g0, -EFAULT, %o0
17888 -ENDPROC(__ret_efault)
17889 -
17890 -ENTRY(__retl_efault)
17891 +__retl_efault:
17892 retl
17893 mov -EFAULT, %o0
17894 -ENDPROC(__retl_efault)
17895 -
17896 -ENTRY(__retl_one)
17897 - retl
17898 - mov 1, %o0
17899 -ENDPROC(__retl_one)
17900 -
17901 -ENTRY(__ret_one_asi)
17902 - wr %g0, ASI_AIUS, %asi
17903 - ret
17904 - restore %g0, 1, %o0
17905 -ENDPROC(__ret_one_asi)
17906 -
17907 -ENTRY(__retl_one_asi)
17908 - wr %g0, ASI_AIUS, %asi
17909 - retl
17910 - mov 1, %o0
17911 -ENDPROC(__retl_one_asi)
17912 -
17913 -ENTRY(__retl_o1)
17914 - retl
17915 - mov %o1, %o0
17916 -ENDPROC(__retl_o1)
17917 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/kernel/irq_64.c linux-2.6.29-rc3.owrt/arch/sparc/kernel/irq_64.c
17918 --- linux-2.6.29.owrt/arch/sparc/kernel/irq_64.c 2009-05-10 22:04:40.000000000 +0200
17919 +++ linux-2.6.29-rc3.owrt/arch/sparc/kernel/irq_64.c 2009-05-10 23:48:28.000000000 +0200
17920 @@ -196,11 +196,6 @@
17921 seq_putc(p, '\n');
17922 skip:
17923 spin_unlock_irqrestore(&irq_desc[i].lock, flags);
17924 - } else if (i == NR_IRQS) {
17925 - seq_printf(p, "NMI: ");
17926 - for_each_online_cpu(j)
17927 - seq_printf(p, "%10u ", cpu_data(j).__nmi_count);
17928 - seq_printf(p, " Non-maskable interrupts\n");
17929 }
17930 return 0;
17931 }
17932 @@ -323,25 +318,17 @@
17933 sun4u_irq_enable(virt_irq);
17934 }
17935
17936 -/* Don't do anything. The desc->status check for IRQ_DISABLED in
17937 - * handler_irq() will skip the handler call and that will leave the
17938 - * interrupt in the sent state. The next ->enable() call will hit the
17939 - * ICLR register to reset the state machine.
17940 - *
17941 - * This scheme is necessary, instead of clearing the Valid bit in the
17942 - * IMAP register, to handle the case of IMAP registers being shared by
17943 - * multiple INOs (and thus ICLR registers). Since we use a different
17944 - * virtual IRQ for each shared IMAP instance, the generic code thinks
17945 - * there is only one user so it prematurely calls ->disable() on
17946 - * free_irq().
17947 - *
17948 - * We have to provide an explicit ->disable() method instead of using
17949 - * NULL to get the default. The reason is that if the generic code
17950 - * sees that, it also hooks up a default ->shutdown method which
17951 - * invokes ->mask() which we do not want. See irq_chip_set_defaults().
17952 - */
17953 static void sun4u_irq_disable(unsigned int virt_irq)
17954 {
17955 + struct irq_handler_data *data = get_irq_chip_data(virt_irq);
17956 +
17957 + if (likely(data)) {
17958 + unsigned long imap = data->imap;
17959 + unsigned long tmp = upa_readq(imap);
17960 +
17961 + tmp &= ~IMAP_VALID;
17962 + upa_writeq(tmp, imap);
17963 + }
17964 }
17965
17966 static void sun4u_irq_eoi(unsigned int virt_irq)
17967 @@ -754,8 +741,7 @@
17968
17969 desc = irq_desc + virt_irq;
17970
17971 - if (!(desc->status & IRQ_DISABLED))
17972 - desc->handle_irq(virt_irq, desc);
17973 + desc->handle_irq(virt_irq, desc);
17974
17975 bucket_pa = next_pa;
17976 }
17977 @@ -792,6 +778,69 @@
17978 local_irq_restore(flags);
17979 }
17980
17981 +static void unhandled_perf_irq(struct pt_regs *regs)
17982 +{
17983 + unsigned long pcr, pic;
17984 +
17985 + read_pcr(pcr);
17986 + read_pic(pic);
17987 +
17988 + write_pcr(0);
17989 +
17990 + printk(KERN_EMERG "CPU %d: Got unexpected perf counter IRQ.\n",
17991 + smp_processor_id());
17992 + printk(KERN_EMERG "CPU %d: PCR[%016lx] PIC[%016lx]\n",
17993 + smp_processor_id(), pcr, pic);
17994 +}
17995 +
17996 +/* Almost a direct copy of the powerpc PMC code. */
17997 +static DEFINE_SPINLOCK(perf_irq_lock);
17998 +static void *perf_irq_owner_caller; /* mostly for debugging */
17999 +static void (*perf_irq)(struct pt_regs *regs) = unhandled_perf_irq;
18000 +
18001 +/* Invoked from level 15 PIL handler in trap table. */
18002 +void perfctr_irq(int irq, struct pt_regs *regs)
18003 +{
18004 + clear_softint(1 << irq);
18005 + perf_irq(regs);
18006 +}
18007 +
18008 +int register_perfctr_intr(void (*handler)(struct pt_regs *))
18009 +{
18010 + int ret;
18011 +
18012 + if (!handler)
18013 + return -EINVAL;
18014 +
18015 + spin_lock(&perf_irq_lock);
18016 + if (perf_irq != unhandled_perf_irq) {
18017 + printk(KERN_WARNING "register_perfctr_intr: "
18018 + "perf IRQ busy (reserved by caller %p)\n",
18019 + perf_irq_owner_caller);
18020 + ret = -EBUSY;
18021 + goto out;
18022 + }
18023 +
18024 + perf_irq_owner_caller = __builtin_return_address(0);
18025 + perf_irq = handler;
18026 +
18027 + ret = 0;
18028 +out:
18029 + spin_unlock(&perf_irq_lock);
18030 +
18031 + return ret;
18032 +}
18033 +EXPORT_SYMBOL_GPL(register_perfctr_intr);
18034 +
18035 +void release_perfctr_intr(void (*handler)(struct pt_regs *))
18036 +{
18037 + spin_lock(&perf_irq_lock);
18038 + perf_irq_owner_caller = NULL;
18039 + perf_irq = unhandled_perf_irq;
18040 + spin_unlock(&perf_irq_lock);
18041 +}
18042 +EXPORT_SYMBOL_GPL(release_perfctr_intr);
18043 +
18044 #ifdef CONFIG_HOTPLUG_CPU
18045 void fixup_irqs(void)
18046 {
18047 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/kernel/kernel.h linux-2.6.29-rc3.owrt/arch/sparc/kernel/kernel.h
18048 --- linux-2.6.29.owrt/arch/sparc/kernel/kernel.h 2009-05-10 22:04:40.000000000 +0200
18049 +++ linux-2.6.29-rc3.owrt/arch/sparc/kernel/kernel.h 2009-05-10 23:48:28.000000000 +0200
18050 @@ -5,7 +5,6 @@
18051
18052 /* cpu.c */
18053 extern const char *sparc_cpu_type;
18054 -extern const char *sparc_pmu_type;
18055 extern const char *sparc_fpu_type;
18056
18057 extern unsigned int fsr_storage;
18058 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/kernel/kgdb_64.c linux-2.6.29-rc3.owrt/arch/sparc/kernel/kgdb_64.c
18059 --- linux-2.6.29.owrt/arch/sparc/kernel/kgdb_64.c 2009-05-10 22:04:40.000000000 +0200
18060 +++ linux-2.6.29-rc3.owrt/arch/sparc/kernel/kgdb_64.c 2009-05-10 23:48:28.000000000 +0200
18061 @@ -108,7 +108,7 @@
18062 }
18063
18064 #ifdef CONFIG_SMP
18065 -void smp_kgdb_capture_client(int irq, struct pt_regs *regs)
18066 +void smp_kgdb_capture_client(struct pt_regs *regs)
18067 {
18068 unsigned long flags;
18069
18070 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/kernel/Makefile linux-2.6.29-rc3.owrt/arch/sparc/kernel/Makefile
18071 --- linux-2.6.29.owrt/arch/sparc/kernel/Makefile 2009-05-10 22:04:40.000000000 +0200
18072 +++ linux-2.6.29-rc3.owrt/arch/sparc/kernel/Makefile 2009-05-10 23:48:28.000000000 +0200
18073 @@ -52,8 +52,6 @@
18074 obj-$(CONFIG_SPARC64) += hvapi.o
18075 obj-$(CONFIG_SPARC64) += sstate.o
18076 obj-$(CONFIG_SPARC64) += mdesc.o
18077 -obj-$(CONFIG_SPARC64) += pcr.o
18078 -obj-$(CONFIG_SPARC64) += nmi.o
18079
18080 # sparc32 do not use GENERIC_HARDIRQS but uses the generic devres implementation
18081 obj-$(CONFIG_SPARC32) += devres.o
18082 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/kernel/nmi.c linux-2.6.29-rc3.owrt/arch/sparc/kernel/nmi.c
18083 --- linux-2.6.29.owrt/arch/sparc/kernel/nmi.c 2009-05-10 22:04:40.000000000 +0200
18084 +++ linux-2.6.29-rc3.owrt/arch/sparc/kernel/nmi.c 1970-01-01 01:00:00.000000000 +0100
18085 @@ -1,225 +0,0 @@
18086 -/* Pseudo NMI support on sparc64 systems.
18087 - *
18088 - * Copyright (C) 2009 David S. Miller <davem@davemloft.net>
18089 - *
18090 - * The NMI watchdog support and infrastructure is based almost
18091 - * entirely upon the x86 NMI support code.
18092 - */
18093 -#include <linux/kernel.h>
18094 -#include <linux/param.h>
18095 -#include <linux/init.h>
18096 -#include <linux/percpu.h>
18097 -#include <linux/nmi.h>
18098 -#include <linux/module.h>
18099 -#include <linux/kprobes.h>
18100 -#include <linux/kernel_stat.h>
18101 -#include <linux/slab.h>
18102 -#include <linux/kdebug.h>
18103 -#include <linux/delay.h>
18104 -#include <linux/smp.h>
18105 -
18106 -#include <asm/ptrace.h>
18107 -#include <asm/local.h>
18108 -#include <asm/pcr.h>
18109 -
18110 -/* We don't have a real NMI on sparc64, but we can fake one
18111 - * up using profiling counter overflow interrupts and interrupt
18112 - * levels.
18113 - *
18114 - * The profile overflow interrupts at level 15, so we use
18115 - * level 14 as our IRQ off level.
18116 - */
18117 -
18118 -static int nmi_watchdog_active;
18119 -static int panic_on_timeout;
18120 -
18121 -int nmi_usable;
18122 -EXPORT_SYMBOL_GPL(nmi_usable);
18123 -
18124 -static unsigned int nmi_hz = HZ;
18125 -
18126 -static DEFINE_PER_CPU(unsigned int, last_irq_sum);
18127 -static DEFINE_PER_CPU(local_t, alert_counter);
18128 -static DEFINE_PER_CPU(int, nmi_touch);
18129 -
18130 -void touch_nmi_watchdog(void)
18131 -{
18132 - if (nmi_watchdog_active) {
18133 - int cpu;
18134 -
18135 - for_each_present_cpu(cpu) {
18136 - if (per_cpu(nmi_touch, cpu) != 1)
18137 - per_cpu(nmi_touch, cpu) = 1;
18138 - }
18139 - }
18140 -
18141 - touch_softlockup_watchdog();
18142 -}
18143 -EXPORT_SYMBOL(touch_nmi_watchdog);
18144 -
18145 -static void die_nmi(const char *str, struct pt_regs *regs, int do_panic)
18146 -{
18147 - if (notify_die(DIE_NMIWATCHDOG, str, regs, 0,
18148 - pt_regs_trap_type(regs), SIGINT) == NOTIFY_STOP)
18149 - return;
18150 -
18151 - console_verbose();
18152 - bust_spinlocks(1);
18153 -
18154 - printk(KERN_EMERG "%s", str);
18155 - printk(" on CPU%d, ip %08lx, registers:\n",
18156 - smp_processor_id(), regs->tpc);
18157 - show_regs(regs);
18158 - dump_stack();
18159 -
18160 - bust_spinlocks(0);
18161 -
18162 - if (do_panic || panic_on_oops)
18163 - panic("Non maskable interrupt");
18164 -
18165 - local_irq_enable();
18166 - do_exit(SIGBUS);
18167 -}
18168 -
18169 -notrace __kprobes void perfctr_irq(int irq, struct pt_regs *regs)
18170 -{
18171 - unsigned int sum, touched = 0;
18172 - int cpu = smp_processor_id();
18173 -
18174 - clear_softint(1 << irq);
18175 - pcr_ops->write(PCR_PIC_PRIV);
18176 -
18177 - local_cpu_data().__nmi_count++;
18178 -
18179 - if (notify_die(DIE_NMI, "nmi", regs, 0,
18180 - pt_regs_trap_type(regs), SIGINT) == NOTIFY_STOP)
18181 - touched = 1;
18182 -
18183 - sum = kstat_irqs_cpu(0, cpu);
18184 - if (__get_cpu_var(nmi_touch)) {
18185 - __get_cpu_var(nmi_touch) = 0;
18186 - touched = 1;
18187 - }
18188 - if (!touched && __get_cpu_var(last_irq_sum) == sum) {
18189 - local_inc(&__get_cpu_var(alert_counter));
18190 - if (local_read(&__get_cpu_var(alert_counter)) == 5 * nmi_hz)
18191 - die_nmi("BUG: NMI Watchdog detected LOCKUP",
18192 - regs, panic_on_timeout);
18193 - } else {
18194 - __get_cpu_var(last_irq_sum) = sum;
18195 - local_set(&__get_cpu_var(alert_counter), 0);
18196 - }
18197 - if (nmi_usable) {
18198 - write_pic(picl_value(nmi_hz));
18199 - pcr_ops->write(pcr_enable);
18200 - }
18201 -}
18202 -
18203 -static inline unsigned int get_nmi_count(int cpu)
18204 -{
18205 - return cpu_data(cpu).__nmi_count;
18206 -}
18207 -
18208 -static int endflag __initdata;
18209 -
18210 -static __init void nmi_cpu_busy(void *data)
18211 -{
18212 - local_irq_enable_in_hardirq();
18213 - while (endflag == 0)
18214 - mb();
18215 -}
18216 -
18217 -static void report_broken_nmi(int cpu, int *prev_nmi_count)
18218 -{
18219 - printk(KERN_CONT "\n");
18220 -
18221 - printk(KERN_WARNING
18222 - "WARNING: CPU#%d: NMI appears to be stuck (%d->%d)!\n",
18223 - cpu, prev_nmi_count[cpu], get_nmi_count(cpu));
18224 -
18225 - printk(KERN_WARNING
18226 - "Please report this to bugzilla.kernel.org,\n");
18227 - printk(KERN_WARNING
18228 - "and attach the output of the 'dmesg' command.\n");
18229 -
18230 - nmi_usable = 0;
18231 -}
18232 -
18233 -static void stop_watchdog(void *unused)
18234 -{
18235 - pcr_ops->write(PCR_PIC_PRIV);
18236 -}
18237 -
18238 -static int __init check_nmi_watchdog(void)
18239 -{
18240 - unsigned int *prev_nmi_count;
18241 - int cpu, err;
18242 -
18243 - prev_nmi_count = kmalloc(nr_cpu_ids * sizeof(unsigned int), GFP_KERNEL);
18244 - if (!prev_nmi_count) {
18245 - err = -ENOMEM;
18246 - goto error;
18247 - }
18248 -
18249 - printk(KERN_INFO "Testing NMI watchdog ... ");
18250 -
18251 - smp_call_function(nmi_cpu_busy, (void *)&endflag, 0);
18252 -
18253 - for_each_possible_cpu(cpu)
18254 - prev_nmi_count[cpu] = get_nmi_count(cpu);
18255 - local_irq_enable();
18256 - mdelay((20 * 1000) / nmi_hz); /* wait 20 ticks */
18257 -
18258 - for_each_online_cpu(cpu) {
18259 - if (get_nmi_count(cpu) - prev_nmi_count[cpu] <= 5)
18260 - report_broken_nmi(cpu, prev_nmi_count);
18261 - }
18262 - endflag = 1;
18263 - if (!nmi_usable) {
18264 - kfree(prev_nmi_count);
18265 - err = -ENODEV;
18266 - goto error;
18267 - }
18268 - printk("OK.\n");
18269 -
18270 - nmi_hz = 1;
18271 -
18272 - kfree(prev_nmi_count);
18273 - return 0;
18274 -error:
18275 - on_each_cpu(stop_watchdog, NULL, 1);
18276 - return err;
18277 -}
18278 -
18279 -static void start_watchdog(void *unused)
18280 -{
18281 - pcr_ops->write(PCR_PIC_PRIV);
18282 - write_pic(picl_value(nmi_hz));
18283 -
18284 - pcr_ops->write(pcr_enable);
18285 -}
18286 -
18287 -void nmi_adjust_hz(unsigned int new_hz)
18288 -{
18289 - nmi_hz = new_hz;
18290 - on_each_cpu(start_watchdog, NULL, 1);
18291 -}
18292 -EXPORT_SYMBOL_GPL(nmi_adjust_hz);
18293 -
18294 -int __init nmi_init(void)
18295 -{
18296 - nmi_usable = 1;
18297 -
18298 - on_each_cpu(start_watchdog, NULL, 1);
18299 -
18300 - return check_nmi_watchdog();
18301 -}
18302 -
18303 -static int __init setup_nmi_watchdog(char *str)
18304 -{
18305 - if (!strncmp(str, "panic", 5))
18306 - panic_on_timeout = 1;
18307 -
18308 - return 0;
18309 -}
18310 -__setup("nmi_watchdog=", setup_nmi_watchdog);
18311 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/kernel/pci_common.c linux-2.6.29-rc3.owrt/arch/sparc/kernel/pci_common.c
18312 --- linux-2.6.29.owrt/arch/sparc/kernel/pci_common.c 2009-05-10 22:04:40.000000000 +0200
18313 +++ linux-2.6.29-rc3.owrt/arch/sparc/kernel/pci_common.c 2009-05-10 23:48:28.000000000 +0200
18314 @@ -368,7 +368,7 @@
18315 const u32 *vdma = of_get_property(pbm->op->node, "virtual-dma", NULL);
18316
18317 if (vdma) {
18318 - struct resource *rp = kzalloc(sizeof(*rp), GFP_KERNEL);
18319 + struct resource *rp = kmalloc(sizeof(*rp), GFP_KERNEL);
18320
18321 if (!rp) {
18322 prom_printf("Cannot allocate IOMMU resource.\n");
18323 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/kernel/pcr.c linux-2.6.29-rc3.owrt/arch/sparc/kernel/pcr.c
18324 --- linux-2.6.29.owrt/arch/sparc/kernel/pcr.c 2009-05-10 22:04:40.000000000 +0200
18325 +++ linux-2.6.29-rc3.owrt/arch/sparc/kernel/pcr.c 1970-01-01 01:00:00.000000000 +0100
18326 @@ -1,158 +0,0 @@
18327 -/* pcr.c: Generic sparc64 performance counter infrastructure.
18328 - *
18329 - * Copyright (C) 2009 David S. Miller (davem@davemloft.net)
18330 - */
18331 -#include <linux/kernel.h>
18332 -#include <linux/module.h>
18333 -#include <linux/init.h>
18334 -#include <linux/irq.h>
18335 -
18336 -#include <asm/pil.h>
18337 -#include <asm/pcr.h>
18338 -#include <asm/nmi.h>
18339 -
18340 -/* This code is shared between various users of the performance
18341 - * counters. Users will be oprofile, pseudo-NMI watchdog, and the
18342 - * perf_counter support layer.
18343 - */
18344 -
18345 -#define PCR_SUN4U_ENABLE (PCR_PIC_PRIV | PCR_STRACE | PCR_UTRACE)
18346 -#define PCR_N2_ENABLE (PCR_PIC_PRIV | PCR_STRACE | PCR_UTRACE | \
18347 - PCR_N2_TOE_OV1 | \
18348 - (2 << PCR_N2_SL1_SHIFT) | \
18349 - (0xff << PCR_N2_MASK1_SHIFT))
18350 -
18351 -u64 pcr_enable;
18352 -unsigned int picl_shift;
18353 -
18354 -/* Performance counter interrupts run unmasked at PIL level 15.
18355 - * Therefore we can't do things like wakeups and other work
18356 - * that expects IRQ disabling to be adhered to in locking etc.
18357 - *
18358 - * Therefore in such situations we defer the work by signalling
18359 - * a lower level cpu IRQ.
18360 - */
18361 -void deferred_pcr_work_irq(int irq, struct pt_regs *regs)
18362 -{
18363 - clear_softint(1 << PIL_DEFERRED_PCR_WORK);
18364 -}
18365 -
18366 -void schedule_deferred_pcr_work(void)
18367 -{
18368 - set_softint(1 << PIL_DEFERRED_PCR_WORK);
18369 -}
18370 -
18371 -const struct pcr_ops *pcr_ops;
18372 -EXPORT_SYMBOL_GPL(pcr_ops);
18373 -
18374 -static u64 direct_pcr_read(void)
18375 -{
18376 - u64 val;
18377 -
18378 - read_pcr(val);
18379 - return val;
18380 -}
18381 -
18382 -static void direct_pcr_write(u64 val)
18383 -{
18384 - write_pcr(val);
18385 -}
18386 -
18387 -static const struct pcr_ops direct_pcr_ops = {
18388 - .read = direct_pcr_read,
18389 - .write = direct_pcr_write,
18390 -};
18391 -
18392 -static void n2_pcr_write(u64 val)
18393 -{
18394 - unsigned long ret;
18395 -
18396 - ret = sun4v_niagara2_setperf(HV_N2_PERF_SPARC_CTL, val);
18397 - if (val != HV_EOK)
18398 - write_pcr(val);
18399 -}
18400 -
18401 -static const struct pcr_ops n2_pcr_ops = {
18402 - .read = direct_pcr_read,
18403 - .write = n2_pcr_write,
18404 -};
18405 -
18406 -static unsigned long perf_hsvc_group;
18407 -static unsigned long perf_hsvc_major;
18408 -static unsigned long perf_hsvc_minor;
18409 -
18410 -static int __init register_perf_hsvc(void)
18411 -{
18412 - if (tlb_type == hypervisor) {
18413 - switch (sun4v_chip_type) {
18414 - case SUN4V_CHIP_NIAGARA1:
18415 - perf_hsvc_group = HV_GRP_NIAG_PERF;
18416 - break;
18417 -
18418 - case SUN4V_CHIP_NIAGARA2:
18419 - perf_hsvc_group = HV_GRP_N2_CPU;
18420 - break;
18421 -
18422 - default:
18423 - return -ENODEV;
18424 - }
18425 -
18426 -
18427 - perf_hsvc_major = 1;
18428 - perf_hsvc_minor = 0;
18429 - if (sun4v_hvapi_register(perf_hsvc_group,
18430 - perf_hsvc_major,
18431 - &perf_hsvc_minor)) {
18432 - printk("perfmon: Could not register hvapi.\n");
18433 - return -ENODEV;
18434 - }
18435 - }
18436 - return 0;
18437 -}
18438 -
18439 -static void __init unregister_perf_hsvc(void)
18440 -{
18441 - if (tlb_type != hypervisor)
18442 - return;
18443 - sun4v_hvapi_unregister(perf_hsvc_group);
18444 -}
18445 -
18446 -int __init pcr_arch_init(void)
18447 -{
18448 - int err = register_perf_hsvc();
18449 -
18450 - if (err)
18451 - return err;
18452 -
18453 - switch (tlb_type) {
18454 - case hypervisor:
18455 - pcr_ops = &n2_pcr_ops;
18456 - pcr_enable = PCR_N2_ENABLE;
18457 - picl_shift = 2;
18458 - break;
18459 -
18460 - case cheetah:
18461 - case cheetah_plus:
18462 - pcr_ops = &direct_pcr_ops;
18463 - pcr_enable = PCR_SUN4U_ENABLE;
18464 - break;
18465 -
18466 - case spitfire:
18467 - /* UltraSPARC-I/II and derivatives lack a profile
18468 - * counter overflow interrupt so we can't make use of
18469 - * their hardware currently.
18470 - */
18471 - /* fallthrough */
18472 - default:
18473 - err = -ENODEV;
18474 - goto out_unregister;
18475 - }
18476 -
18477 - return nmi_init();
18478 -
18479 -out_unregister:
18480 - unregister_perf_hsvc();
18481 - return err;
18482 -}
18483 -
18484 -arch_initcall(pcr_arch_init);
18485 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/kernel/process_64.c linux-2.6.29-rc3.owrt/arch/sparc/kernel/process_64.c
18486 --- linux-2.6.29.owrt/arch/sparc/kernel/process_64.c 2009-05-10 22:04:40.000000000 +0200
18487 +++ linux-2.6.29-rc3.owrt/arch/sparc/kernel/process_64.c 2009-05-10 23:48:28.000000000 +0200
18488 @@ -29,7 +29,6 @@
18489 #include <linux/cpu.h>
18490 #include <linux/elfcore.h>
18491 #include <linux/sysrq.h>
18492 -#include <linux/nmi.h>
18493
18494 #include <asm/uaccess.h>
18495 #include <asm/system.h>
18496 @@ -53,10 +52,8 @@
18497
18498 static void sparc64_yield(int cpu)
18499 {
18500 - if (tlb_type != hypervisor) {
18501 - touch_nmi_watchdog();
18502 + if (tlb_type != hypervisor)
18503 return;
18504 - }
18505
18506 clear_thread_flag(TIF_POLLING_NRFLAG);
18507 smp_mb__after_clear_bit();
18508 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/kernel/setup_64.c linux-2.6.29-rc3.owrt/arch/sparc/kernel/setup_64.c
18509 --- linux-2.6.29.owrt/arch/sparc/kernel/setup_64.c 2009-05-10 22:04:40.000000000 +0200
18510 +++ linux-2.6.29-rc3.owrt/arch/sparc/kernel/setup_64.c 2009-05-10 23:48:28.000000000 +0200
18511 @@ -354,7 +354,6 @@
18512 seq_printf(m,
18513 "cpu\t\t: %s\n"
18514 "fpu\t\t: %s\n"
18515 - "pmu\t\t: %s\n"
18516 "prom\t\t: %s\n"
18517 "type\t\t: %s\n"
18518 "ncpus probed\t: %d\n"
18519 @@ -367,7 +366,6 @@
18520 ,
18521 sparc_cpu_type,
18522 sparc_fpu_type,
18523 - sparc_pmu_type,
18524 prom_version,
18525 ((tlb_type == hypervisor) ?
18526 "sun4v" :
18527 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/kernel/ttable.S linux-2.6.29-rc3.owrt/arch/sparc/kernel/ttable.S
18528 --- linux-2.6.29.owrt/arch/sparc/kernel/ttable.S 2009-05-10 22:04:40.000000000 +0200
18529 +++ linux-2.6.29-rc3.owrt/arch/sparc/kernel/ttable.S 2009-05-10 23:48:28.000000000 +0200
18530 @@ -63,13 +63,7 @@
18531 #else
18532 tl0_irq6: BTRAP(0x46)
18533 #endif
18534 -tl0_irq7: TRAP_IRQ(deferred_pcr_work_irq, 7)
18535 -#ifdef CONFIG_KGDB
18536 -tl0_irq8: TRAP_IRQ(smp_kgdb_capture_client, 8)
18537 -#else
18538 -tl0_irq8: BTRAP(0x48)
18539 -#endif
18540 -tl0_irq9: BTRAP(0x49)
18541 +tl0_irq7: BTRAP(0x47) BTRAP(0x48) BTRAP(0x49)
18542 tl0_irq10: BTRAP(0x4a) BTRAP(0x4b) BTRAP(0x4c) BTRAP(0x4d)
18543 tl0_irq14: TRAP_IRQ(timer_interrupt, 14)
18544 tl0_irq15: TRAP_NMI_IRQ(perfctr_irq, 15)
18545 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/lib/bzero.S linux-2.6.29-rc3.owrt/arch/sparc/lib/bzero.S
18546 --- linux-2.6.29.owrt/arch/sparc/lib/bzero.S 2009-05-10 22:04:40.000000000 +0200
18547 +++ linux-2.6.29-rc3.owrt/arch/sparc/lib/bzero.S 2009-05-10 23:48:28.000000000 +0200
18548 @@ -88,9 +88,13 @@
18549
18550 #define EX_ST(x,y) \
18551 98: x,y; \
18552 + .section .fixup; \
18553 + .align 4; \
18554 +99: retl; \
18555 + mov %o1, %o0; \
18556 .section __ex_table,"a";\
18557 .align 4; \
18558 - .word 98b, __retl_o1; \
18559 + .word 98b, 99b; \
18560 .text; \
18561 .align 4;
18562
18563 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/lib/copy_in_user.S linux-2.6.29-rc3.owrt/arch/sparc/lib/copy_in_user.S
18564 --- linux-2.6.29.owrt/arch/sparc/lib/copy_in_user.S 2009-05-10 22:04:40.000000000 +0200
18565 +++ linux-2.6.29-rc3.owrt/arch/sparc/lib/copy_in_user.S 2009-05-10 23:48:28.000000000 +0200
18566 @@ -3,16 +3,19 @@
18567 * Copyright (C) 1999, 2000, 2004 David S. Miller (davem@redhat.com)
18568 */
18569
18570 -#include <linux/linkage.h>
18571 #include <asm/asi.h>
18572
18573 #define XCC xcc
18574
18575 #define EX(x,y) \
18576 98: x,y; \
18577 + .section .fixup; \
18578 + .align 4; \
18579 +99: retl; \
18580 + mov 1, %o0; \
18581 .section __ex_table,"a";\
18582 .align 4; \
18583 - .word 98b, __retl_one; \
18584 + .word 98b, 99b; \
18585 .text; \
18586 .align 4;
18587
18588 @@ -28,7 +31,18 @@
18589 * to copy register windows around during thread cloning.
18590 */
18591
18592 -ENTRY(___copy_in_user) /* %o0=dst, %o1=src, %o2=len */
18593 + .globl ___copy_in_user
18594 + .type ___copy_in_user,#function
18595 +___copy_in_user: /* %o0=dst, %o1=src, %o2=len */
18596 + /* Writing to %asi is _expensive_ so we hardcode it.
18597 + * Reading %asi to check for KERNEL_DS is comparatively
18598 + * cheap.
18599 + */
18600 + rd %asi, %g1
18601 + cmp %g1, ASI_AIUS
18602 + bne,pn %icc, memcpy_user_stub
18603 + nop
18604 +
18605 cmp %o2, 0
18606 be,pn %XCC, 85f
18607 or %o0, %o1, %o3
18608 @@ -39,24 +53,22 @@
18609 /* 16 < len <= 64 */
18610 andcc %o3, 0x7, %g0
18611 bne,pn %XCC, 90f
18612 - nop
18613 + sub %o0, %o1, %o3
18614
18615 andn %o2, 0x7, %o4
18616 and %o2, 0x7, %o2
18617 1: subcc %o4, 0x8, %o4
18618 EX(ldxa [%o1] %asi, %o5)
18619 - EX(stxa %o5, [%o0] %asi)
18620 - add %o1, 0x8, %o1
18621 + EX(stxa %o5, [%o1 + %o3] ASI_AIUS)
18622 bgu,pt %XCC, 1b
18623 - add %o0, 0x8, %o0
18624 + add %o1, 0x8, %o1
18625 andcc %o2, 0x4, %g0
18626 be,pt %XCC, 1f
18627 nop
18628 sub %o2, 0x4, %o2
18629 EX(lduwa [%o1] %asi, %o5)
18630 - EX(stwa %o5, [%o0] %asi)
18631 + EX(stwa %o5, [%o1 + %o3] ASI_AIUS)
18632 add %o1, 0x4, %o1
18633 - add %o0, 0x4, %o0
18634 1: cmp %o2, 0
18635 be,pt %XCC, 85f
18636 nop
18637 @@ -66,15 +78,14 @@
18638 80: /* 0 < len <= 16 */
18639 andcc %o3, 0x3, %g0
18640 bne,pn %XCC, 90f
18641 - nop
18642 + sub %o0, %o1, %o3
18643
18644 82:
18645 subcc %o2, 4, %o2
18646 EX(lduwa [%o1] %asi, %g1)
18647 - EX(stwa %g1, [%o0] %asi)
18648 - add %o1, 4, %o1
18649 + EX(stwa %g1, [%o1 + %o3] ASI_AIUS)
18650 bgu,pt %XCC, 82b
18651 - add %o0, 4, %o0
18652 + add %o1, 4, %o1
18653
18654 85: retl
18655 clr %o0
18656 @@ -83,10 +94,26 @@
18657 90:
18658 subcc %o2, 1, %o2
18659 EX(lduba [%o1] %asi, %g1)
18660 - EX(stba %g1, [%o0] %asi)
18661 - add %o1, 1, %o1
18662 + EX(stba %g1, [%o1 + %o3] ASI_AIUS)
18663 bgu,pt %XCC, 90b
18664 - add %o0, 1, %o0
18665 + add %o1, 1, %o1
18666 retl
18667 clr %o0
18668 -ENDPROC(___copy_in_user)
18669 +
18670 + .size ___copy_in_user, .-___copy_in_user
18671 +
18672 + /* Act like copy_{to,in}_user(), ie. return zero instead
18673 + * of original destination pointer. This is invoked when
18674 + * copy_{to,in}_user() finds that %asi is kernel space.
18675 + */
18676 + .globl memcpy_user_stub
18677 + .type memcpy_user_stub,#function
18678 +memcpy_user_stub:
18679 + save %sp, -192, %sp
18680 + mov %i0, %o0
18681 + mov %i1, %o1
18682 + call memcpy
18683 + mov %i2, %o2
18684 + ret
18685 + restore %g0, %g0, %o0
18686 + .size memcpy_user_stub, .-memcpy_user_stub
18687 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/lib/GENbzero.S linux-2.6.29-rc3.owrt/arch/sparc/lib/GENbzero.S
18688 --- linux-2.6.29.owrt/arch/sparc/lib/GENbzero.S 2009-05-10 22:04:40.000000000 +0200
18689 +++ linux-2.6.29-rc3.owrt/arch/sparc/lib/GENbzero.S 2009-05-10 23:48:28.000000000 +0200
18690 @@ -6,9 +6,13 @@
18691
18692 #define EX_ST(x,y) \
18693 98: x,y; \
18694 + .section .fixup; \
18695 + .align 4; \
18696 +99: retl; \
18697 + mov %o1, %o0; \
18698 .section __ex_table,"a";\
18699 .align 4; \
18700 - .word 98b, __retl_o1; \
18701 + .word 98b, 99b; \
18702 .text; \
18703 .align 4;
18704
18705 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/lib/GENcopy_from_user.S linux-2.6.29-rc3.owrt/arch/sparc/lib/GENcopy_from_user.S
18706 --- linux-2.6.29.owrt/arch/sparc/lib/GENcopy_from_user.S 2009-05-10 22:04:40.000000000 +0200
18707 +++ linux-2.6.29-rc3.owrt/arch/sparc/lib/GENcopy_from_user.S 2009-05-10 23:48:28.000000000 +0200
18708 @@ -5,9 +5,13 @@
18709
18710 #define EX_LD(x) \
18711 98: x; \
18712 + .section .fixup; \
18713 + .align 4; \
18714 +99: retl; \
18715 + mov 1, %o0; \
18716 .section __ex_table,"a";\
18717 .align 4; \
18718 - .word 98b, __retl_one; \
18719 + .word 98b, 99b; \
18720 .text; \
18721 .align 4;
18722
18723 @@ -23,7 +27,7 @@
18724 #define PREAMBLE \
18725 rd %asi, %g1; \
18726 cmp %g1, ASI_AIUS; \
18727 - bne,pn %icc, ___copy_in_user; \
18728 + bne,pn %icc, memcpy_user_stub; \
18729 nop
18730 #endif
18731
18732 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/lib/GENcopy_to_user.S linux-2.6.29-rc3.owrt/arch/sparc/lib/GENcopy_to_user.S
18733 --- linux-2.6.29.owrt/arch/sparc/lib/GENcopy_to_user.S 2009-05-10 22:04:40.000000000 +0200
18734 +++ linux-2.6.29-rc3.owrt/arch/sparc/lib/GENcopy_to_user.S 2009-05-10 23:48:28.000000000 +0200
18735 @@ -5,9 +5,13 @@
18736
18737 #define EX_ST(x) \
18738 98: x; \
18739 + .section .fixup; \
18740 + .align 4; \
18741 +99: retl; \
18742 + mov 1, %o0; \
18743 .section __ex_table,"a";\
18744 .align 4; \
18745 - .word 98b, __retl_one; \
18746 + .word 98b, 99b; \
18747 .text; \
18748 .align 4;
18749
18750 @@ -27,7 +31,7 @@
18751 #define PREAMBLE \
18752 rd %asi, %g1; \
18753 cmp %g1, ASI_AIUS; \
18754 - bne,pn %icc, ___copy_in_user; \
18755 + bne,pn %icc, memcpy_user_stub; \
18756 nop
18757 #endif
18758
18759 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/lib/NG2copy_from_user.S linux-2.6.29-rc3.owrt/arch/sparc/lib/NG2copy_from_user.S
18760 --- linux-2.6.29.owrt/arch/sparc/lib/NG2copy_from_user.S 2009-05-10 22:04:40.000000000 +0200
18761 +++ linux-2.6.29-rc3.owrt/arch/sparc/lib/NG2copy_from_user.S 2009-05-10 23:48:28.000000000 +0200
18762 @@ -5,9 +5,14 @@
18763
18764 #define EX_LD(x) \
18765 98: x; \
18766 + .section .fixup; \
18767 + .align 4; \
18768 +99: wr %g0, ASI_AIUS, %asi;\
18769 + retl; \
18770 + mov 1, %o0; \
18771 .section __ex_table,"a";\
18772 .align 4; \
18773 - .word 98b, __retl_one_asi;\
18774 + .word 98b, 99b; \
18775 .text; \
18776 .align 4;
18777
18778 @@ -28,7 +33,7 @@
18779 #define PREAMBLE \
18780 rd %asi, %g1; \
18781 cmp %g1, ASI_AIUS; \
18782 - bne,pn %icc, ___copy_in_user; \
18783 + bne,pn %icc, memcpy_user_stub; \
18784 nop
18785 #endif
18786
18787 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/lib/NG2copy_to_user.S linux-2.6.29-rc3.owrt/arch/sparc/lib/NG2copy_to_user.S
18788 --- linux-2.6.29.owrt/arch/sparc/lib/NG2copy_to_user.S 2009-05-10 22:04:40.000000000 +0200
18789 +++ linux-2.6.29-rc3.owrt/arch/sparc/lib/NG2copy_to_user.S 2009-05-10 23:48:28.000000000 +0200
18790 @@ -5,9 +5,14 @@
18791
18792 #define EX_ST(x) \
18793 98: x; \
18794 + .section .fixup; \
18795 + .align 4; \
18796 +99: wr %g0, ASI_AIUS, %asi;\
18797 + retl; \
18798 + mov 1, %o0; \
18799 .section __ex_table,"a";\
18800 .align 4; \
18801 - .word 98b, __retl_one_asi;\
18802 + .word 98b, 99b; \
18803 .text; \
18804 .align 4;
18805
18806 @@ -37,7 +42,7 @@
18807 #define PREAMBLE \
18808 rd %asi, %g1; \
18809 cmp %g1, ASI_AIUS; \
18810 - bne,pn %icc, ___copy_in_user; \
18811 + bne,pn %icc, memcpy_user_stub; \
18812 nop
18813 #endif
18814
18815 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/lib/NGbzero.S linux-2.6.29-rc3.owrt/arch/sparc/lib/NGbzero.S
18816 --- linux-2.6.29.owrt/arch/sparc/lib/NGbzero.S 2009-05-10 22:04:40.000000000 +0200
18817 +++ linux-2.6.29-rc3.owrt/arch/sparc/lib/NGbzero.S 2009-05-10 23:48:28.000000000 +0200
18818 @@ -6,9 +6,13 @@
18819
18820 #define EX_ST(x,y) \
18821 98: x,y; \
18822 + .section .fixup; \
18823 + .align 4; \
18824 +99: retl; \
18825 + mov %o1, %o0; \
18826 .section __ex_table,"a";\
18827 .align 4; \
18828 - .word 98b, __retl_o1; \
18829 + .word 98b, 99b; \
18830 .text; \
18831 .align 4;
18832
18833 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/lib/NGcopy_from_user.S linux-2.6.29-rc3.owrt/arch/sparc/lib/NGcopy_from_user.S
18834 --- linux-2.6.29.owrt/arch/sparc/lib/NGcopy_from_user.S 2009-05-10 22:04:40.000000000 +0200
18835 +++ linux-2.6.29-rc3.owrt/arch/sparc/lib/NGcopy_from_user.S 2009-05-10 23:48:28.000000000 +0200
18836 @@ -5,9 +5,14 @@
18837
18838 #define EX_LD(x) \
18839 98: x; \
18840 + .section .fixup; \
18841 + .align 4; \
18842 +99: wr %g0, ASI_AIUS, %asi;\
18843 + ret; \
18844 + restore %g0, 1, %o0; \
18845 .section __ex_table,"a";\
18846 .align 4; \
18847 - .word 98b, __ret_one_asi;\
18848 + .word 98b, 99b; \
18849 .text; \
18850 .align 4;
18851
18852 @@ -25,7 +30,7 @@
18853 #define PREAMBLE \
18854 rd %asi, %g1; \
18855 cmp %g1, ASI_AIUS; \
18856 - bne,pn %icc, ___copy_in_user; \
18857 + bne,pn %icc, memcpy_user_stub; \
18858 nop
18859 #endif
18860
18861 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/lib/NGcopy_to_user.S linux-2.6.29-rc3.owrt/arch/sparc/lib/NGcopy_to_user.S
18862 --- linux-2.6.29.owrt/arch/sparc/lib/NGcopy_to_user.S 2009-05-10 22:04:40.000000000 +0200
18863 +++ linux-2.6.29-rc3.owrt/arch/sparc/lib/NGcopy_to_user.S 2009-05-10 23:48:28.000000000 +0200
18864 @@ -5,9 +5,14 @@
18865
18866 #define EX_ST(x) \
18867 98: x; \
18868 + .section .fixup; \
18869 + .align 4; \
18870 +99: wr %g0, ASI_AIUS, %asi;\
18871 + ret; \
18872 + restore %g0, 1, %o0; \
18873 .section __ex_table,"a";\
18874 .align 4; \
18875 - .word 98b, __ret_one_asi;\
18876 + .word 98b, 99b; \
18877 .text; \
18878 .align 4;
18879
18880 @@ -28,7 +33,7 @@
18881 #define PREAMBLE \
18882 rd %asi, %g1; \
18883 cmp %g1, ASI_AIUS; \
18884 - bne,pn %icc, ___copy_in_user; \
18885 + bne,pn %icc, memcpy_user_stub; \
18886 nop
18887 #endif
18888
18889 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/lib/U1copy_from_user.S linux-2.6.29-rc3.owrt/arch/sparc/lib/U1copy_from_user.S
18890 --- linux-2.6.29.owrt/arch/sparc/lib/U1copy_from_user.S 2009-05-10 22:04:40.000000000 +0200
18891 +++ linux-2.6.29-rc3.owrt/arch/sparc/lib/U1copy_from_user.S 2009-05-10 23:48:28.000000000 +0200
18892 @@ -5,9 +5,13 @@
18893
18894 #define EX_LD(x) \
18895 98: x; \
18896 + .section .fixup; \
18897 + .align 4; \
18898 +99: retl; \
18899 + mov 1, %o0; \
18900 .section __ex_table,"a";\
18901 .align 4; \
18902 - .word 98b, __retl_one; \
18903 + .word 98b, 99b; \
18904 .text; \
18905 .align 4;
18906
18907 @@ -23,7 +27,7 @@
18908 #define PREAMBLE \
18909 rd %asi, %g1; \
18910 cmp %g1, ASI_AIUS; \
18911 - bne,pn %icc, ___copy_in_user; \
18912 + bne,pn %icc, memcpy_user_stub; \
18913 nop; \
18914
18915 #include "U1memcpy.S"
18916 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/lib/U1copy_to_user.S linux-2.6.29-rc3.owrt/arch/sparc/lib/U1copy_to_user.S
18917 --- linux-2.6.29.owrt/arch/sparc/lib/U1copy_to_user.S 2009-05-10 22:04:40.000000000 +0200
18918 +++ linux-2.6.29-rc3.owrt/arch/sparc/lib/U1copy_to_user.S 2009-05-10 23:48:28.000000000 +0200
18919 @@ -5,9 +5,13 @@
18920
18921 #define EX_ST(x) \
18922 98: x; \
18923 + .section .fixup; \
18924 + .align 4; \
18925 +99: retl; \
18926 + mov 1, %o0; \
18927 .section __ex_table,"a";\
18928 .align 4; \
18929 - .word 98b, __retl_one; \
18930 + .word 98b, 99b; \
18931 .text; \
18932 .align 4;
18933
18934 @@ -23,7 +27,7 @@
18935 #define PREAMBLE \
18936 rd %asi, %g1; \
18937 cmp %g1, ASI_AIUS; \
18938 - bne,pn %icc, ___copy_in_user; \
18939 + bne,pn %icc, memcpy_user_stub; \
18940 nop; \
18941
18942 #include "U1memcpy.S"
18943 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/lib/U3copy_from_user.S linux-2.6.29-rc3.owrt/arch/sparc/lib/U3copy_from_user.S
18944 --- linux-2.6.29.owrt/arch/sparc/lib/U3copy_from_user.S 2009-05-10 22:04:40.000000000 +0200
18945 +++ linux-2.6.29-rc3.owrt/arch/sparc/lib/U3copy_from_user.S 2009-05-10 23:48:28.000000000 +0200
18946 @@ -5,9 +5,13 @@
18947
18948 #define EX_LD(x) \
18949 98: x; \
18950 + .section .fixup; \
18951 + .align 4; \
18952 +99: retl; \
18953 + mov 1, %o0; \
18954 .section __ex_table,"a";\
18955 .align 4; \
18956 - .word 98b, __retl_one; \
18957 + .word 98b, 99b; \
18958 .text; \
18959 .align 4;
18960
18961 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/lib/U3copy_to_user.S linux-2.6.29-rc3.owrt/arch/sparc/lib/U3copy_to_user.S
18962 --- linux-2.6.29.owrt/arch/sparc/lib/U3copy_to_user.S 2009-05-10 22:04:40.000000000 +0200
18963 +++ linux-2.6.29-rc3.owrt/arch/sparc/lib/U3copy_to_user.S 2009-05-10 23:48:28.000000000 +0200
18964 @@ -5,9 +5,13 @@
18965
18966 #define EX_ST(x) \
18967 98: x; \
18968 + .section .fixup; \
18969 + .align 4; \
18970 +99: retl; \
18971 + mov 1, %o0; \
18972 .section __ex_table,"a";\
18973 .align 4; \
18974 - .word 98b, __retl_one; \
18975 + .word 98b, 99b; \
18976 .text; \
18977 .align 4;
18978
18979 @@ -23,7 +27,7 @@
18980 #define PREAMBLE \
18981 rd %asi, %g1; \
18982 cmp %g1, ASI_AIUS; \
18983 - bne,pn %icc, ___copy_in_user; \
18984 + bne,pn %icc, memcpy_user_stub; \
18985 nop; \
18986
18987 #include "U3memcpy.S"
18988 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/mm/fault_64.c linux-2.6.29-rc3.owrt/arch/sparc/mm/fault_64.c
18989 --- linux-2.6.29.owrt/arch/sparc/mm/fault_64.c 2009-05-10 22:04:40.000000000 +0200
18990 +++ linux-2.6.29-rc3.owrt/arch/sparc/mm/fault_64.c 2009-05-10 23:48:28.000000000 +0200
18991 @@ -19,7 +19,6 @@
18992 #include <linux/interrupt.h>
18993 #include <linux/kprobes.h>
18994 #include <linux/kdebug.h>
18995 -#include <linux/percpu.h>
18996
18997 #include <asm/page.h>
18998 #include <asm/pgtable.h>
18999 @@ -225,30 +224,6 @@
19000 unhandled_fault (address, current, regs);
19001 }
19002
19003 -static void noinline bogus_32bit_fault_tpc(struct pt_regs *regs)
19004 -{
19005 - static int times;
19006 -
19007 - if (times++ < 10)
19008 - printk(KERN_ERR "FAULT[%s:%d]: 32-bit process reports "
19009 - "64-bit TPC [%lx]\n",
19010 - current->comm, current->pid,
19011 - regs->tpc);
19012 - show_regs(regs);
19013 -}
19014 -
19015 -static void noinline bogus_32bit_fault_address(struct pt_regs *regs,
19016 - unsigned long addr)
19017 -{
19018 - static int times;
19019 -
19020 - if (times++ < 10)
19021 - printk(KERN_ERR "FAULT[%s:%d]: 32-bit process "
19022 - "reports 64-bit fault address [%lx]\n",
19023 - current->comm, current->pid, addr);
19024 - show_regs(regs);
19025 -}
19026 -
19027 asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs)
19028 {
19029 struct mm_struct *mm = current->mm;
19030 @@ -269,19 +244,6 @@
19031 (fault_code & FAULT_CODE_DTLB))
19032 BUG();
19033
19034 - if (test_thread_flag(TIF_32BIT)) {
19035 - if (!(regs->tstate & TSTATE_PRIV)) {
19036 - if (unlikely((regs->tpc >> 32) != 0)) {
19037 - bogus_32bit_fault_tpc(regs);
19038 - goto intr_or_no_mm;
19039 - }
19040 - }
19041 - if (unlikely((address >> 32) != 0)) {
19042 - bogus_32bit_fault_address(regs, address);
19043 - goto intr_or_no_mm;
19044 - }
19045 - }
19046 -
19047 if (regs->tstate & TSTATE_PRIV) {
19048 unsigned long tpc = regs->tpc;
19049
19050 @@ -302,6 +264,12 @@
19051 if (in_atomic() || !mm)
19052 goto intr_or_no_mm;
19053
19054 + if (test_thread_flag(TIF_32BIT)) {
19055 + if (!(regs->tstate & TSTATE_PRIV))
19056 + regs->tpc &= 0xffffffff;
19057 + address &= 0xffffffff;
19058 + }
19059 +
19060 if (!down_read_trylock(&mm->mmap_sem)) {
19061 if ((regs->tstate & TSTATE_PRIV) &&
19062 !search_exception_tables(regs->tpc)) {
19063 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/mm/ultra.S linux-2.6.29-rc3.owrt/arch/sparc/mm/ultra.S
19064 --- linux-2.6.29.owrt/arch/sparc/mm/ultra.S 2009-05-10 22:04:40.000000000 +0200
19065 +++ linux-2.6.29-rc3.owrt/arch/sparc/mm/ultra.S 2009-05-10 23:48:28.000000000 +0200
19066 @@ -679,8 +679,28 @@
19067 #ifdef CONFIG_KGDB
19068 .globl xcall_kgdb_capture
19069 xcall_kgdb_capture:
19070 - wr %g0, (1 << PIL_KGDB_CAPTURE), %set_softint
19071 - retry
19072 +661: rdpr %pstate, %g2
19073 + wrpr %g2, PSTATE_IG | PSTATE_AG, %pstate
19074 + .section .sun4v_2insn_patch, "ax"
19075 + .word 661b
19076 + nop
19077 + nop
19078 + .previous
19079 +
19080 + rdpr %pil, %g2
19081 + wrpr %g0, PIL_NORMAL_MAX, %pil
19082 + sethi %hi(109f), %g7
19083 + ba,pt %xcc, etrap_irq
19084 +109: or %g7, %lo(109b), %g7
19085 +#ifdef CONFIG_TRACE_IRQFLAGS
19086 + call trace_hardirqs_off
19087 + nop
19088 +#endif
19089 + call smp_kgdb_capture_client
19090 + add %sp, PTREGS_OFF, %o0
19091 + /* Has to be a non-v9 branch due to the large distance. */
19092 + ba rtrap_xcall
19093 + ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %l1
19094 #endif
19095
19096 #endif /* CONFIG_SMP */
19097 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/sparc/oprofile/init.c linux-2.6.29-rc3.owrt/arch/sparc/oprofile/init.c
19098 --- linux-2.6.29.owrt/arch/sparc/oprofile/init.c 2009-05-10 22:04:40.000000000 +0200
19099 +++ linux-2.6.29-rc3.owrt/arch/sparc/oprofile/init.c 2009-05-10 23:48:28.000000000 +0200
19100 @@ -13,57 +13,217 @@
19101 #include <linux/init.h>
19102
19103 #ifdef CONFIG_SPARC64
19104 -#include <linux/notifier.h>
19105 -#include <linux/rcupdate.h>
19106 -#include <linux/kdebug.h>
19107 -#include <asm/nmi.h>
19108 -
19109 -static int profile_timer_exceptions_notify(struct notifier_block *self,
19110 - unsigned long val, void *data)
19111 -{
19112 - struct die_args *args = (struct die_args *)data;
19113 - int ret = NOTIFY_DONE;
19114 -
19115 - switch (val) {
19116 - case DIE_NMI:
19117 - oprofile_add_sample(args->regs, 0);
19118 - ret = NOTIFY_STOP;
19119 - break;
19120 - default:
19121 - break;
19122 - }
19123 - return ret;
19124 +#include <asm/hypervisor.h>
19125 +#include <asm/spitfire.h>
19126 +#include <asm/cpudata.h>
19127 +#include <asm/irq.h>
19128 +
19129 +static int nmi_enabled;
19130 +
19131 +struct pcr_ops {
19132 + u64 (*read)(void);
19133 + void (*write)(u64);
19134 +};
19135 +static const struct pcr_ops *pcr_ops;
19136 +
19137 +static u64 direct_pcr_read(void)
19138 +{
19139 + u64 val;
19140 +
19141 + read_pcr(val);
19142 + return val;
19143 +}
19144 +
19145 +static void direct_pcr_write(u64 val)
19146 +{
19147 + write_pcr(val);
19148 }
19149
19150 -static struct notifier_block profile_timer_exceptions_nb = {
19151 - .notifier_call = profile_timer_exceptions_notify,
19152 +static const struct pcr_ops direct_pcr_ops = {
19153 + .read = direct_pcr_read,
19154 + .write = direct_pcr_write,
19155 };
19156
19157 -static int timer_start(void)
19158 +static void n2_pcr_write(u64 val)
19159 {
19160 - if (register_die_notifier(&profile_timer_exceptions_nb))
19161 - return 1;
19162 - nmi_adjust_hz(HZ);
19163 - return 0;
19164 + unsigned long ret;
19165 +
19166 + ret = sun4v_niagara2_setperf(HV_N2_PERF_SPARC_CTL, val);
19167 + if (val != HV_EOK)
19168 + write_pcr(val);
19169 }
19170
19171 +static const struct pcr_ops n2_pcr_ops = {
19172 + .read = direct_pcr_read,
19173 + .write = n2_pcr_write,
19174 +};
19175
19176 -static void timer_stop(void)
19177 +/* In order to commonize as much of the implementation as
19178 + * possible, we use PICH as our counter. Mostly this is
19179 + * to accomodate Niagara-1 which can only count insn cycles
19180 + * in PICH.
19181 + */
19182 +static u64 picl_value(void)
19183 +{
19184 + u32 delta = local_cpu_data().clock_tick / HZ;
19185 +
19186 + return ((u64)((0 - delta) & 0xffffffff)) << 32;
19187 +}
19188 +
19189 +#define PCR_PIC_PRIV 0x00000001 /* PIC access is privileged */
19190 +#define PCR_STRACE 0x00000002 /* Trace supervisor events */
19191 +#define PCR_UTRACE 0x00000004 /* Trace user events */
19192 +#define PCR_N2_HTRACE 0x00000008 /* Trace hypervisor events */
19193 +#define PCR_N2_TOE_OV0 0x00000010 /* Trap if PIC 0 overflows */
19194 +#define PCR_N2_TOE_OV1 0x00000020 /* Trap if PIC 1 overflows */
19195 +#define PCR_N2_MASK0 0x00003fc0
19196 +#define PCR_N2_MASK0_SHIFT 6
19197 +#define PCR_N2_SL0 0x0003c000
19198 +#define PCR_N2_SL0_SHIFT 14
19199 +#define PCR_N2_OV0 0x00040000
19200 +#define PCR_N2_MASK1 0x07f80000
19201 +#define PCR_N2_MASK1_SHIFT 19
19202 +#define PCR_N2_SL1 0x78000000
19203 +#define PCR_N2_SL1_SHIFT 27
19204 +#define PCR_N2_OV1 0x80000000
19205 +
19206 +#define PCR_SUN4U_ENABLE (PCR_PIC_PRIV | PCR_STRACE | PCR_UTRACE)
19207 +#define PCR_N2_ENABLE (PCR_PIC_PRIV | PCR_STRACE | PCR_UTRACE | \
19208 + PCR_N2_TOE_OV1 | \
19209 + (2 << PCR_N2_SL1_SHIFT) | \
19210 + (0xff << PCR_N2_MASK1_SHIFT))
19211 +
19212 +static u64 pcr_enable = PCR_SUN4U_ENABLE;
19213 +
19214 +static void nmi_handler(struct pt_regs *regs)
19215 {
19216 - nmi_adjust_hz(1);
19217 - unregister_die_notifier(&profile_timer_exceptions_nb);
19218 - synchronize_sched(); /* Allow already-started NMIs to complete. */
19219 + pcr_ops->write(PCR_PIC_PRIV);
19220 +
19221 + if (nmi_enabled) {
19222 + oprofile_add_sample(regs, 0);
19223 +
19224 + write_pic(picl_value());
19225 + pcr_ops->write(pcr_enable);
19226 + }
19227 +}
19228 +
19229 +/* We count "clock cycle" events in the lower 32-bit PIC.
19230 + * Then configure it such that it overflows every HZ, and thus
19231 + * generates a level 15 interrupt at that frequency.
19232 + */
19233 +static void cpu_nmi_start(void *_unused)
19234 +{
19235 + pcr_ops->write(PCR_PIC_PRIV);
19236 + write_pic(picl_value());
19237 +
19238 + pcr_ops->write(pcr_enable);
19239 +}
19240 +
19241 +static void cpu_nmi_stop(void *_unused)
19242 +{
19243 + pcr_ops->write(PCR_PIC_PRIV);
19244 +}
19245 +
19246 +static int nmi_start(void)
19247 +{
19248 + int err = register_perfctr_intr(nmi_handler);
19249 +
19250 + if (!err) {
19251 + nmi_enabled = 1;
19252 + wmb();
19253 + err = on_each_cpu(cpu_nmi_start, NULL, 1);
19254 + if (err) {
19255 + nmi_enabled = 0;
19256 + wmb();
19257 + on_each_cpu(cpu_nmi_stop, NULL, 1);
19258 + release_perfctr_intr(nmi_handler);
19259 + }
19260 + }
19261 +
19262 + return err;
19263 }
19264
19265 -static int op_nmi_timer_init(struct oprofile_operations *ops)
19266 +static void nmi_stop(void)
19267 {
19268 - if (!nmi_usable)
19269 + nmi_enabled = 0;
19270 + wmb();
19271 +
19272 + on_each_cpu(cpu_nmi_stop, NULL, 1);
19273 + release_perfctr_intr(nmi_handler);
19274 + synchronize_sched();
19275 +}
19276 +
19277 +static unsigned long perf_hsvc_group;
19278 +static unsigned long perf_hsvc_major;
19279 +static unsigned long perf_hsvc_minor;
19280 +
19281 +static int __init register_perf_hsvc(void)
19282 +{
19283 + if (tlb_type == hypervisor) {
19284 + switch (sun4v_chip_type) {
19285 + case SUN4V_CHIP_NIAGARA1:
19286 + perf_hsvc_group = HV_GRP_NIAG_PERF;
19287 + break;
19288 +
19289 + case SUN4V_CHIP_NIAGARA2:
19290 + perf_hsvc_group = HV_GRP_N2_CPU;
19291 + break;
19292 +
19293 + default:
19294 + return -ENODEV;
19295 + }
19296 +
19297 +
19298 + perf_hsvc_major = 1;
19299 + perf_hsvc_minor = 0;
19300 + if (sun4v_hvapi_register(perf_hsvc_group,
19301 + perf_hsvc_major,
19302 + &perf_hsvc_minor)) {
19303 + printk("perfmon: Could not register N2 hvapi.\n");
19304 + return -ENODEV;
19305 + }
19306 + }
19307 + return 0;
19308 +}
19309 +
19310 +static void unregister_perf_hsvc(void)
19311 +{
19312 + if (tlb_type != hypervisor)
19313 + return;
19314 + sun4v_hvapi_unregister(perf_hsvc_group);
19315 +}
19316 +
19317 +static int oprofile_nmi_init(struct oprofile_operations *ops)
19318 +{
19319 + int err = register_perf_hsvc();
19320 +
19321 + if (err)
19322 + return err;
19323 +
19324 + switch (tlb_type) {
19325 + case hypervisor:
19326 + pcr_ops = &n2_pcr_ops;
19327 + pcr_enable = PCR_N2_ENABLE;
19328 + break;
19329 +
19330 + case cheetah:
19331 + case cheetah_plus:
19332 + pcr_ops = &direct_pcr_ops;
19333 + break;
19334 +
19335 + default:
19336 return -ENODEV;
19337 + }
19338
19339 - ops->start = timer_start;
19340 - ops->stop = timer_stop;
19341 + ops->create_files = NULL;
19342 + ops->setup = NULL;
19343 + ops->shutdown = NULL;
19344 + ops->start = nmi_start;
19345 + ops->stop = nmi_stop;
19346 ops->cpu_type = "timer";
19347 - printk(KERN_INFO "oprofile: Using perfctr NMI timer interrupt.\n");
19348 +
19349 + printk(KERN_INFO "oprofile: Using perfctr based NMI timer interrupt.\n");
19350 +
19351 return 0;
19352 }
19353 #endif
19354 @@ -73,7 +233,7 @@
19355 int ret = -ENODEV;
19356
19357 #ifdef CONFIG_SPARC64
19358 - ret = op_nmi_timer_init(ops);
19359 + ret = oprofile_nmi_init(ops);
19360 if (!ret)
19361 return ret;
19362 #endif
19363 @@ -81,6 +241,10 @@
19364 return ret;
19365 }
19366
19367 +
19368 void oprofile_arch_exit(void)
19369 {
19370 +#ifdef CONFIG_SPARC64
19371 + unregister_perf_hsvc();
19372 +#endif
19373 }
19374 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/um/drivers/vde_user.c linux-2.6.29-rc3.owrt/arch/um/drivers/vde_user.c
19375 --- linux-2.6.29.owrt/arch/um/drivers/vde_user.c 2009-05-10 22:04:41.000000000 +0200
19376 +++ linux-2.6.29-rc3.owrt/arch/um/drivers/vde_user.c 2009-05-10 23:48:28.000000000 +0200
19377 @@ -78,7 +78,7 @@
19378 {
19379 struct vde_open_args *args;
19380
19381 - vpri->args = uml_kmalloc(sizeof(struct vde_open_args), UM_GFP_KERNEL);
19382 + vpri->args = kmalloc(sizeof(struct vde_open_args), UM_GFP_KERNEL);
19383 if (vpri->args == NULL) {
19384 printk(UM_KERN_ERR "vde_init_libstuff - vde_open_args "
19385 "allocation failed");
19386 @@ -91,8 +91,8 @@
19387 args->group = init->group;
19388 args->mode = init->mode ? init->mode : 0700;
19389
19390 - args->port ? printk("port %d", args->port) :
19391 - printk("undefined port");
19392 + args->port ? printk(UM_KERN_INFO "port %d", args->port) :
19393 + printk(UM_KERN_INFO "undefined port");
19394 }
19395
19396 int vde_user_read(void *conn, void *buf, int len)
19397 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/um/kernel/ptrace.c linux-2.6.29-rc3.owrt/arch/um/kernel/ptrace.c
19398 --- linux-2.6.29.owrt/arch/um/kernel/ptrace.c 2009-05-10 22:04:41.000000000 +0200
19399 +++ linux-2.6.29-rc3.owrt/arch/um/kernel/ptrace.c 2009-05-10 23:48:28.000000000 +0200
19400 @@ -64,11 +64,6 @@
19401 ret = poke_user(child, addr, data);
19402 break;
19403
19404 - case PTRACE_SYSEMU:
19405 - case PTRACE_SYSEMU_SINGLESTEP:
19406 - ret = -EIO;
19407 - break;
19408 -
19409 /* continue and stop at next (return from) syscall */
19410 case PTRACE_SYSCALL:
19411 /* restart after signal. */
19412 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/um/os-Linux/user_syms.c linux-2.6.29-rc3.owrt/arch/um/os-Linux/user_syms.c
19413 --- linux-2.6.29.owrt/arch/um/os-Linux/user_syms.c 2009-05-10 22:04:41.000000000 +0200
19414 +++ linux-2.6.29-rc3.owrt/arch/um/os-Linux/user_syms.c 2009-05-10 23:48:28.000000000 +0200
19415 @@ -14,6 +14,7 @@
19416 #undef memset
19417
19418 extern size_t strlen(const char *);
19419 +extern void *memcpy(void *, const void *, size_t);
19420 extern void *memmove(void *, const void *, size_t);
19421 extern void *memset(void *, int, size_t);
19422 extern int printf(const char *, ...);
19423 @@ -23,11 +24,7 @@
19424 EXPORT_SYMBOL(strstr);
19425 #endif
19426
19427 -#ifndef __x86_64__
19428 -extern void *memcpy(void *, const void *, size_t);
19429 EXPORT_SYMBOL(memcpy);
19430 -#endif
19431 -
19432 EXPORT_SYMBOL(memmove);
19433 EXPORT_SYMBOL(memset);
19434 EXPORT_SYMBOL(printf);
19435 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/boot/video-vesa.c linux-2.6.29-rc3.owrt/arch/x86/boot/video-vesa.c
19436 --- linux-2.6.29.owrt/arch/x86/boot/video-vesa.c 2009-05-10 22:04:41.000000000 +0200
19437 +++ linux-2.6.29-rc3.owrt/arch/x86/boot/video-vesa.c 2009-05-10 23:48:28.000000000 +0200
19438 @@ -269,8 +269,9 @@
19439 we genuinely have to assume all registers are destroyed here. */
19440
19441 asm("pushw %%es; movw %2,%%es; "INT10"; popw %%es"
19442 - : "+a" (ax), "+b" (bx), "+c" (cx), "+D" (di)
19443 - : : "esi", "edx");
19444 + : "+a" (ax), "+b" (bx)
19445 + : "c" (cx), "D" (di)
19446 + : "esi");
19447
19448 if (ax != 0x004f)
19449 return; /* No EDID */
19450 @@ -284,9 +285,9 @@
19451 dx = 0; /* EDID block number */
19452 di =(size_t) &boot_params.edid_info; /* (ES:)Pointer to block */
19453 asm(INT10
19454 - : "+a" (ax), "+b" (bx), "+d" (dx), "=m" (boot_params.edid_info),
19455 - "+c" (cx), "+D" (di)
19456 - : : "esi");
19457 + : "+a" (ax), "+b" (bx), "+d" (dx), "=m" (boot_params.edid_info)
19458 + : "c" (cx), "D" (di)
19459 + : "esi");
19460 #endif /* CONFIG_FIRMWARE_EDID */
19461 }
19462
19463 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/ia32/ia32entry.S linux-2.6.29-rc3.owrt/arch/x86/ia32/ia32entry.S
19464 --- linux-2.6.29.owrt/arch/x86/ia32/ia32entry.S 2009-05-10 22:04:41.000000000 +0200
19465 +++ linux-2.6.29-rc3.owrt/arch/x86/ia32/ia32entry.S 2009-05-10 23:48:28.000000000 +0200
19466 @@ -418,9 +418,9 @@
19467 orl $TS_COMPAT,TI_status(%r10)
19468 testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r10)
19469 jnz ia32_tracesys
19470 +ia32_do_syscall:
19471 cmpl $(IA32_NR_syscalls-1),%eax
19472 - ja ia32_badsys
19473 -ia32_do_call:
19474 + ja int_ret_from_sys_call /* ia32_tracesys has set RAX(%rsp) */
19475 IA32_ARG_FIXUP
19476 call *ia32_sys_call_table(,%rax,8) # xxx: rip relative
19477 ia32_sysret:
19478 @@ -435,9 +435,7 @@
19479 call syscall_trace_enter
19480 LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */
19481 RESTORE_REST
19482 - cmpl $(IA32_NR_syscalls-1),%eax
19483 - ja int_ret_from_sys_call /* ia32_tracesys has set RAX(%rsp) */
19484 - jmp ia32_do_call
19485 + jmp ia32_do_syscall
19486 END(ia32_syscall)
19487
19488 ia32_badsys:
19489 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/include/asm/a.out-core.h linux-2.6.29-rc3.owrt/arch/x86/include/asm/a.out-core.h
19490 --- linux-2.6.29.owrt/arch/x86/include/asm/a.out-core.h 2009-05-10 22:04:41.000000000 +0200
19491 +++ linux-2.6.29-rc3.owrt/arch/x86/include/asm/a.out-core.h 2009-05-10 23:48:28.000000000 +0200
19492 @@ -23,6 +23,8 @@
19493 */
19494 static inline void aout_dump_thread(struct pt_regs *regs, struct user *dump)
19495 {
19496 + u16 gs;
19497 +
19498 /* changed the size calculations - should hopefully work better. lbt */
19499 dump->magic = CMAGIC;
19500 dump->start_code = 0;
19501 @@ -55,7 +57,7 @@
19502 dump->regs.ds = (u16)regs->ds;
19503 dump->regs.es = (u16)regs->es;
19504 dump->regs.fs = (u16)regs->fs;
19505 - savesegment(gs, dump->regs.gs);
19506 + savesegment(gs, gs);
19507 dump->regs.orig_ax = regs->orig_ax;
19508 dump->regs.ip = regs->ip;
19509 dump->regs.cs = (u16)regs->cs;
19510 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/include/asm/cpufeature.h linux-2.6.29-rc3.owrt/arch/x86/include/asm/cpufeature.h
19511 --- linux-2.6.29.owrt/arch/x86/include/asm/cpufeature.h 2009-05-10 22:04:41.000000000 +0200
19512 +++ linux-2.6.29-rc3.owrt/arch/x86/include/asm/cpufeature.h 2009-05-10 23:48:28.000000000 +0200
19513 @@ -93,7 +93,6 @@
19514 #define X86_FEATURE_XTOPOLOGY (3*32+22) /* cpu topology enum extensions */
19515 #define X86_FEATURE_TSC_RELIABLE (3*32+23) /* TSC is known to be reliable */
19516 #define X86_FEATURE_NONSTOP_TSC (3*32+24) /* TSC does not stop in C states */
19517 -#define X86_FEATURE_CLFLUSH_MONITOR (3*32+25) /* "" clflush reqd with monitor */
19518
19519 /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */
19520 #define X86_FEATURE_XMM3 (4*32+ 0) /* "pni" SSE-3 */
19521 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/include/asm/dma-mapping.h linux-2.6.29-rc3.owrt/arch/x86/include/asm/dma-mapping.h
19522 --- linux-2.6.29.owrt/arch/x86/include/asm/dma-mapping.h 2009-05-10 22:04:41.000000000 +0200
19523 +++ linux-2.6.29-rc3.owrt/arch/x86/include/asm/dma-mapping.h 2009-05-10 23:48:28.000000000 +0200
19524 @@ -2,8 +2,8 @@
19525 #define _ASM_X86_DMA_MAPPING_H
19526
19527 /*
19528 - * IOMMU interface. See Documentation/PCI/PCI-DMA-mapping.txt and
19529 - * Documentation/DMA-API.txt for documentation.
19530 + * IOMMU interface. See Documentation/DMA-mapping.txt and DMA-API.txt for
19531 + * documentation.
19532 */
19533
19534 #include <linux/scatterlist.h>
19535 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/include/asm/e820.h linux-2.6.29-rc3.owrt/arch/x86/include/asm/e820.h
19536 --- linux-2.6.29.owrt/arch/x86/include/asm/e820.h 2009-05-10 22:04:41.000000000 +0200
19537 +++ linux-2.6.29-rc3.owrt/arch/x86/include/asm/e820.h 2009-05-10 23:48:28.000000000 +0200
19538 @@ -49,7 +49,6 @@
19539 #define E820_RESERVED_KERN 128
19540
19541 #ifndef __ASSEMBLY__
19542 -#include <linux/types.h>
19543 struct e820entry {
19544 __u64 addr; /* start of memory segment */
19545 __u64 size; /* size of memory segment */
19546 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/include/asm/efi.h linux-2.6.29-rc3.owrt/arch/x86/include/asm/efi.h
19547 --- linux-2.6.29.owrt/arch/x86/include/asm/efi.h 2009-05-10 22:04:41.000000000 +0200
19548 +++ linux-2.6.29-rc3.owrt/arch/x86/include/asm/efi.h 2009-05-10 23:48:28.000000000 +0200
19549 @@ -37,6 +37,8 @@
19550
19551 #else /* !CONFIG_X86_32 */
19552
19553 +#define MAX_EFI_IO_PAGES 100
19554 +
19555 extern u64 efi_call0(void *fp);
19556 extern u64 efi_call1(void *fp, u64 arg1);
19557 extern u64 efi_call2(void *fp, u64 arg1, u64 arg2);
19558 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/include/asm/fixmap_64.h linux-2.6.29-rc3.owrt/arch/x86/include/asm/fixmap_64.h
19559 --- linux-2.6.29.owrt/arch/x86/include/asm/fixmap_64.h 2009-05-10 22:04:41.000000000 +0200
19560 +++ linux-2.6.29-rc3.owrt/arch/x86/include/asm/fixmap_64.h 2009-05-10 23:48:28.000000000 +0200
19561 @@ -16,6 +16,7 @@
19562 #include <asm/apicdef.h>
19563 #include <asm/page.h>
19564 #include <asm/vsyscall.h>
19565 +#include <asm/efi.h>
19566
19567 /*
19568 * Here we define all the compile-time 'special' virtual
19569 @@ -42,6 +43,9 @@
19570 FIX_APIC_BASE, /* local (CPU) APIC) -- required for SMP or not */
19571 FIX_IO_APIC_BASE_0,
19572 FIX_IO_APIC_BASE_END = FIX_IO_APIC_BASE_0 + MAX_IO_APICS - 1,
19573 + FIX_EFI_IO_MAP_LAST_PAGE,
19574 + FIX_EFI_IO_MAP_FIRST_PAGE = FIX_EFI_IO_MAP_LAST_PAGE
19575 + + MAX_EFI_IO_PAGES - 1,
19576 #ifdef CONFIG_PARAVIRT
19577 FIX_PARAVIRT_BOOTMAP,
19578 #endif
19579 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/include/asm/i387.h linux-2.6.29-rc3.owrt/arch/x86/include/asm/i387.h
19580 --- linux-2.6.29.owrt/arch/x86/include/asm/i387.h 2009-05-10 22:04:41.000000000 +0200
19581 +++ linux-2.6.29-rc3.owrt/arch/x86/include/asm/i387.h 2009-05-10 23:48:28.000000000 +0200
19582 @@ -172,13 +172,7 @@
19583
19584 #else /* CONFIG_X86_32 */
19585
19586 -#ifdef CONFIG_MATH_EMULATION
19587 -extern void finit_task(struct task_struct *tsk);
19588 -#else
19589 -static inline void finit_task(struct task_struct *tsk)
19590 -{
19591 -}
19592 -#endif
19593 +extern void finit(void);
19594
19595 static inline void tolerant_fwait(void)
19596 {
19597 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/include/asm/iomap.h linux-2.6.29-rc3.owrt/arch/x86/include/asm/iomap.h
19598 --- linux-2.6.29.owrt/arch/x86/include/asm/iomap.h 2009-05-10 22:04:41.000000000 +0200
19599 +++ linux-2.6.29-rc3.owrt/arch/x86/include/asm/iomap.h 2009-05-10 23:48:28.000000000 +0200
19600 @@ -23,9 +23,6 @@
19601 #include <asm/pgtable.h>
19602 #include <asm/tlbflush.h>
19603
19604 -int
19605 -is_io_mapping_possible(resource_size_t base, unsigned long size);
19606 -
19607 void *
19608 iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot);
19609
19610 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/include/asm/kvm.h linux-2.6.29-rc3.owrt/arch/x86/include/asm/kvm.h
19611 --- linux-2.6.29.owrt/arch/x86/include/asm/kvm.h 2009-05-10 22:04:41.000000000 +0200
19612 +++ linux-2.6.29-rc3.owrt/arch/x86/include/asm/kvm.h 2009-05-10 23:48:28.000000000 +0200
19613 @@ -6,16 +6,9 @@
19614 *
19615 */
19616
19617 -#include <linux/types.h>
19618 +#include <asm/types.h>
19619 #include <linux/ioctl.h>
19620
19621 -/* Select x86 specific features in <linux/kvm.h> */
19622 -#define __KVM_HAVE_PIT
19623 -#define __KVM_HAVE_IOAPIC
19624 -#define __KVM_HAVE_DEVICE_ASSIGNMENT
19625 -#define __KVM_HAVE_MSI
19626 -#define __KVM_HAVE_USER_NMI
19627 -
19628 /* Architectural interrupt line count. */
19629 #define KVM_NR_INTERRUPTS 256
19630
19631 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/include/asm/math_emu.h linux-2.6.29-rc3.owrt/arch/x86/include/asm/math_emu.h
19632 --- linux-2.6.29.owrt/arch/x86/include/asm/math_emu.h 2009-05-10 22:04:41.000000000 +0200
19633 +++ linux-2.6.29-rc3.owrt/arch/x86/include/asm/math_emu.h 2009-05-10 23:48:28.000000000 +0200
19634 @@ -1,18 +1,31 @@
19635 #ifndef _ASM_X86_MATH_EMU_H
19636 #define _ASM_X86_MATH_EMU_H
19637
19638 -#include <asm/ptrace.h>
19639 -#include <asm/vm86.h>
19640 -
19641 /* This structure matches the layout of the data saved to the stack
19642 following a device-not-present interrupt, part of it saved
19643 automatically by the 80386/80486.
19644 */
19645 -struct math_emu_info {
19646 +struct info {
19647 long ___orig_eip;
19648 - union {
19649 - struct pt_regs *regs;
19650 - struct kernel_vm86_regs *vm86;
19651 - };
19652 + long ___ebx;
19653 + long ___ecx;
19654 + long ___edx;
19655 + long ___esi;
19656 + long ___edi;
19657 + long ___ebp;
19658 + long ___eax;
19659 + long ___ds;
19660 + long ___es;
19661 + long ___fs;
19662 + long ___orig_eax;
19663 + long ___eip;
19664 + long ___cs;
19665 + long ___eflags;
19666 + long ___esp;
19667 + long ___ss;
19668 + long ___vm86_es; /* This and the following only in vm86 mode */
19669 + long ___vm86_ds;
19670 + long ___vm86_fs;
19671 + long ___vm86_gs;
19672 };
19673 #endif /* _ASM_X86_MATH_EMU_H */
19674 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/include/asm/mce.h linux-2.6.29-rc3.owrt/arch/x86/include/asm/mce.h
19675 --- linux-2.6.29.owrt/arch/x86/include/asm/mce.h 2009-05-10 22:04:41.000000000 +0200
19676 +++ linux-2.6.29-rc3.owrt/arch/x86/include/asm/mce.h 2009-05-10 23:48:28.000000000 +0200
19677 @@ -3,8 +3,8 @@
19678
19679 #ifdef __x86_64__
19680
19681 -#include <linux/types.h>
19682 #include <asm/ioctls.h>
19683 +#include <asm/types.h>
19684
19685 /*
19686 * Machine Check support for x86
19687 @@ -115,6 +115,8 @@
19688
19689 #endif /* !CONFIG_X86_32 */
19690
19691 +
19692 +
19693 #ifdef CONFIG_X86_MCE
19694 extern void mcheck_init(struct cpuinfo_x86 *c);
19695 #else
19696 @@ -124,4 +126,5 @@
19697 extern void restart_mce(void);
19698
19699 #endif /* __KERNEL__ */
19700 +
19701 #endif /* _ASM_X86_MCE_H */
19702 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/include/asm/mmzone_32.h linux-2.6.29-rc3.owrt/arch/x86/include/asm/mmzone_32.h
19703 --- linux-2.6.29.owrt/arch/x86/include/asm/mmzone_32.h 2009-05-10 22:04:41.000000000 +0200
19704 +++ linux-2.6.29-rc3.owrt/arch/x86/include/asm/mmzone_32.h 2009-05-10 23:48:28.000000000 +0200
19705 @@ -32,6 +32,8 @@
19706 get_memcfg_numa_flat();
19707 }
19708
19709 +extern int early_pfn_to_nid(unsigned long pfn);
19710 +
19711 extern void resume_map_numa_kva(pgd_t *pgd);
19712
19713 #else /* !CONFIG_NUMA */
19714 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/include/asm/mmzone_64.h linux-2.6.29-rc3.owrt/arch/x86/include/asm/mmzone_64.h
19715 --- linux-2.6.29.owrt/arch/x86/include/asm/mmzone_64.h 2009-05-10 22:04:41.000000000 +0200
19716 +++ linux-2.6.29-rc3.owrt/arch/x86/include/asm/mmzone_64.h 2009-05-10 23:48:28.000000000 +0200
19717 @@ -40,6 +40,8 @@
19718 #define node_end_pfn(nid) (NODE_DATA(nid)->node_start_pfn + \
19719 NODE_DATA(nid)->node_spanned_pages)
19720
19721 +extern int early_pfn_to_nid(unsigned long pfn);
19722 +
19723 #ifdef CONFIG_NUMA_EMU
19724 #define FAKE_NODE_MIN_SIZE (64 * 1024 * 1024)
19725 #define FAKE_NODE_MIN_HASH_MASK (~(FAKE_NODE_MIN_SIZE - 1UL))
19726 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/include/asm/mpspec.h linux-2.6.29-rc3.owrt/arch/x86/include/asm/mpspec.h
19727 --- linux-2.6.29.owrt/arch/x86/include/asm/mpspec.h 2009-05-10 22:04:41.000000000 +0200
19728 +++ linux-2.6.29-rc3.owrt/arch/x86/include/asm/mpspec.h 2009-05-10 23:48:28.000000000 +0200
19729 @@ -60,7 +60,6 @@
19730 u32 gsi);
19731 extern void mp_config_acpi_legacy_irqs(void);
19732 extern int mp_register_gsi(u32 gsi, int edge_level, int active_high_low);
19733 -extern int acpi_probe_gsi(void);
19734 #ifdef CONFIG_X86_IO_APIC
19735 extern int mp_config_acpi_gsi(unsigned char number, unsigned int devfn, u8 pin,
19736 u32 gsi, int triggering, int polarity);
19737 @@ -72,11 +71,6 @@
19738 return 0;
19739 }
19740 #endif
19741 -#else /* !CONFIG_ACPI: */
19742 -static inline int acpi_probe_gsi(void)
19743 -{
19744 - return 0;
19745 -}
19746 #endif /* CONFIG_ACPI */
19747
19748 #define PHYSID_ARRAY_SIZE BITS_TO_LONGS(MAX_APICS)
19749 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/include/asm/mtrr.h linux-2.6.29-rc3.owrt/arch/x86/include/asm/mtrr.h
19750 --- linux-2.6.29.owrt/arch/x86/include/asm/mtrr.h 2009-05-10 22:04:41.000000000 +0200
19751 +++ linux-2.6.29-rc3.owrt/arch/x86/include/asm/mtrr.h 2009-05-10 23:48:28.000000000 +0200
19752 @@ -23,7 +23,6 @@
19753 #ifndef _ASM_X86_MTRR_H
19754 #define _ASM_X86_MTRR_H
19755
19756 -#include <linux/types.h>
19757 #include <linux/ioctl.h>
19758 #include <linux/errno.h>
19759
19760 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/include/asm/page.h linux-2.6.29-rc3.owrt/arch/x86/include/asm/page.h
19761 --- linux-2.6.29.owrt/arch/x86/include/asm/page.h 2009-05-10 22:04:41.000000000 +0200
19762 +++ linux-2.6.29-rc3.owrt/arch/x86/include/asm/page.h 2009-05-10 23:48:28.000000000 +0200
19763 @@ -57,6 +57,7 @@
19764 typedef struct { pgprotval_t pgprot; } pgprot_t;
19765
19766 extern int page_is_ram(unsigned long pagenr);
19767 +extern int pagerange_is_ram(unsigned long start, unsigned long end);
19768 extern int devmem_is_allowed(unsigned long pagenr);
19769 extern void map_devmem(unsigned long pfn, unsigned long size,
19770 pgprot_t vma_prot);
19771 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/include/asm/paravirt.h linux-2.6.29-rc3.owrt/arch/x86/include/asm/paravirt.h
19772 --- linux-2.6.29.owrt/arch/x86/include/asm/paravirt.h 2009-05-10 22:04:41.000000000 +0200
19773 +++ linux-2.6.29-rc3.owrt/arch/x86/include/asm/paravirt.h 2009-05-10 23:48:28.000000000 +0200
19774 @@ -1352,7 +1352,14 @@
19775 PVOP_VCALL0(pv_cpu_ops.lazy_mode.leave);
19776 }
19777
19778 -void arch_flush_lazy_cpu_mode(void);
19779 +static inline void arch_flush_lazy_cpu_mode(void)
19780 +{
19781 + if (unlikely(paravirt_get_lazy_mode() == PARAVIRT_LAZY_CPU)) {
19782 + arch_leave_lazy_cpu_mode();
19783 + arch_enter_lazy_cpu_mode();
19784 + }
19785 +}
19786 +
19787
19788 #define __HAVE_ARCH_ENTER_LAZY_MMU_MODE
19789 static inline void arch_enter_lazy_mmu_mode(void)
19790 @@ -1365,7 +1372,13 @@
19791 PVOP_VCALL0(pv_mmu_ops.lazy_mode.leave);
19792 }
19793
19794 -void arch_flush_lazy_mmu_mode(void);
19795 +static inline void arch_flush_lazy_mmu_mode(void)
19796 +{
19797 + if (unlikely(paravirt_get_lazy_mode() == PARAVIRT_LAZY_MMU)) {
19798 + arch_leave_lazy_mmu_mode();
19799 + arch_enter_lazy_mmu_mode();
19800 + }
19801 +}
19802
19803 static inline void __set_fixmap(unsigned /* enum fixed_addresses */ idx,
19804 unsigned long phys, pgprot_t flags)
19805 @@ -1389,7 +1402,6 @@
19806 {
19807 return PVOP_CALL1(int, pv_lock_ops.spin_is_contended, lock);
19808 }
19809 -#define __raw_spin_is_contended __raw_spin_is_contended
19810
19811 static __always_inline void __raw_spin_lock(struct raw_spinlock *lock)
19812 {
19813 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/include/asm/pgtable.h linux-2.6.29-rc3.owrt/arch/x86/include/asm/pgtable.h
19814 --- linux-2.6.29.owrt/arch/x86/include/asm/pgtable.h 2009-05-10 22:04:41.000000000 +0200
19815 +++ linux-2.6.29-rc3.owrt/arch/x86/include/asm/pgtable.h 2009-05-10 23:48:28.000000000 +0200
19816 @@ -302,30 +302,16 @@
19817
19818 extern pteval_t __supported_pte_mask;
19819
19820 -/*
19821 - * Mask out unsupported bits in a present pgprot. Non-present pgprots
19822 - * can use those bits for other purposes, so leave them be.
19823 - */
19824 -static inline pgprotval_t massage_pgprot(pgprot_t pgprot)
19825 -{
19826 - pgprotval_t protval = pgprot_val(pgprot);
19827 -
19828 - if (protval & _PAGE_PRESENT)
19829 - protval &= __supported_pte_mask;
19830 -
19831 - return protval;
19832 -}
19833 -
19834 static inline pte_t pfn_pte(unsigned long page_nr, pgprot_t pgprot)
19835 {
19836 - return __pte(((phys_addr_t)page_nr << PAGE_SHIFT) |
19837 - massage_pgprot(pgprot));
19838 + return __pte((((phys_addr_t)page_nr << PAGE_SHIFT) |
19839 + pgprot_val(pgprot)) & __supported_pte_mask);
19840 }
19841
19842 static inline pmd_t pfn_pmd(unsigned long page_nr, pgprot_t pgprot)
19843 {
19844 - return __pmd(((phys_addr_t)page_nr << PAGE_SHIFT) |
19845 - massage_pgprot(pgprot));
19846 + return __pmd((((phys_addr_t)page_nr << PAGE_SHIFT) |
19847 + pgprot_val(pgprot)) & __supported_pte_mask);
19848 }
19849
19850 static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
19851 @@ -337,7 +323,7 @@
19852 * the newprot (if present):
19853 */
19854 val &= _PAGE_CHG_MASK;
19855 - val |= massage_pgprot(newprot) & ~_PAGE_CHG_MASK;
19856 + val |= pgprot_val(newprot) & (~_PAGE_CHG_MASK) & __supported_pte_mask;
19857
19858 return __pte(val);
19859 }
19860 @@ -353,7 +339,7 @@
19861
19862 #define pte_pgprot(x) __pgprot(pte_flags(x) & PTE_FLAGS_MASK)
19863
19864 -#define canon_pgprot(p) __pgprot(massage_pgprot(p))
19865 +#define canon_pgprot(p) __pgprot(pgprot_val(p) & __supported_pte_mask)
19866
19867 static inline int is_new_memtype_allowed(unsigned long flags,
19868 unsigned long new_flags)
19869 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/include/asm/processor.h linux-2.6.29-rc3.owrt/arch/x86/include/asm/processor.h
19870 --- linux-2.6.29.owrt/arch/x86/include/asm/processor.h 2009-05-10 22:04:41.000000000 +0200
19871 +++ linux-2.6.29-rc3.owrt/arch/x86/include/asm/processor.h 2009-05-10 23:48:28.000000000 +0200
19872 @@ -353,7 +353,7 @@
19873 u8 no_update;
19874 u8 rm;
19875 u8 alimit;
19876 - struct math_emu_info *info;
19877 + struct info *info;
19878 u32 entry_eip;
19879 };
19880
19881 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/include/asm/ptrace-abi.h linux-2.6.29-rc3.owrt/arch/x86/include/asm/ptrace-abi.h
19882 --- linux-2.6.29.owrt/arch/x86/include/asm/ptrace-abi.h 2009-05-10 22:04:41.000000000 +0200
19883 +++ linux-2.6.29-rc3.owrt/arch/x86/include/asm/ptrace-abi.h 2009-05-10 23:48:28.000000000 +0200
19884 @@ -83,7 +83,7 @@
19885 #ifdef CONFIG_X86_PTRACE_BTS
19886
19887 #ifndef __ASSEMBLY__
19888 -#include <linux/types.h>
19889 +#include <asm/types.h>
19890
19891 /* configuration/status structure used in PTRACE_BTS_CONFIG and
19892 PTRACE_BTS_STATUS commands.
19893 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/include/asm/seccomp_32.h linux-2.6.29-rc3.owrt/arch/x86/include/asm/seccomp_32.h
19894 --- linux-2.6.29.owrt/arch/x86/include/asm/seccomp_32.h 2009-05-10 22:04:41.000000000 +0200
19895 +++ linux-2.6.29-rc3.owrt/arch/x86/include/asm/seccomp_32.h 2009-05-10 23:48:28.000000000 +0200
19896 @@ -1,6 +1,12 @@
19897 #ifndef _ASM_X86_SECCOMP_32_H
19898 #define _ASM_X86_SECCOMP_32_H
19899
19900 +#include <linux/thread_info.h>
19901 +
19902 +#ifdef TIF_32BIT
19903 +#error "unexpected TIF_32BIT on i386"
19904 +#endif
19905 +
19906 #include <linux/unistd.h>
19907
19908 #define __NR_seccomp_read __NR_read
19909 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/include/asm/seccomp_64.h linux-2.6.29-rc3.owrt/arch/x86/include/asm/seccomp_64.h
19910 --- linux-2.6.29.owrt/arch/x86/include/asm/seccomp_64.h 2009-05-10 22:04:41.000000000 +0200
19911 +++ linux-2.6.29-rc3.owrt/arch/x86/include/asm/seccomp_64.h 2009-05-10 23:48:28.000000000 +0200
19912 @@ -1,6 +1,14 @@
19913 #ifndef _ASM_X86_SECCOMP_64_H
19914 #define _ASM_X86_SECCOMP_64_H
19915
19916 +#include <linux/thread_info.h>
19917 +
19918 +#ifdef TIF_32BIT
19919 +#error "unexpected TIF_32BIT on x86_64"
19920 +#else
19921 +#define TIF_32BIT TIF_IA32
19922 +#endif
19923 +
19924 #include <linux/unistd.h>
19925 #include <asm/ia32_unistd.h>
19926
19927 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/include/asm/sigcontext32.h linux-2.6.29-rc3.owrt/arch/x86/include/asm/sigcontext32.h
19928 --- linux-2.6.29.owrt/arch/x86/include/asm/sigcontext32.h 2009-05-10 22:04:41.000000000 +0200
19929 +++ linux-2.6.29-rc3.owrt/arch/x86/include/asm/sigcontext32.h 2009-05-10 23:48:28.000000000 +0200
19930 @@ -1,8 +1,6 @@
19931 #ifndef _ASM_X86_SIGCONTEXT32_H
19932 #define _ASM_X86_SIGCONTEXT32_H
19933
19934 -#include <linux/types.h>
19935 -
19936 /* signal context for 32bit programs. */
19937
19938 #define X86_FXSR_MAGIC 0x0000
19939 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/include/asm/sigcontext.h linux-2.6.29-rc3.owrt/arch/x86/include/asm/sigcontext.h
19940 --- linux-2.6.29.owrt/arch/x86/include/asm/sigcontext.h 2009-05-10 22:04:41.000000000 +0200
19941 +++ linux-2.6.29-rc3.owrt/arch/x86/include/asm/sigcontext.h 2009-05-10 23:48:28.000000000 +0200
19942 @@ -2,7 +2,7 @@
19943 #define _ASM_X86_SIGCONTEXT_H
19944
19945 #include <linux/compiler.h>
19946 -#include <linux/types.h>
19947 +#include <asm/types.h>
19948
19949 #define FP_XSTATE_MAGIC1 0x46505853U
19950 #define FP_XSTATE_MAGIC2 0x46505845U
19951 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/include/asm/spinlock.h linux-2.6.29-rc3.owrt/arch/x86/include/asm/spinlock.h
19952 --- linux-2.6.29.owrt/arch/x86/include/asm/spinlock.h 2009-05-10 22:04:41.000000000 +0200
19953 +++ linux-2.6.29-rc3.owrt/arch/x86/include/asm/spinlock.h 2009-05-10 23:48:28.000000000 +0200
19954 @@ -245,7 +245,6 @@
19955 {
19956 return __ticket_spin_is_contended(lock);
19957 }
19958 -#define __raw_spin_is_contended __raw_spin_is_contended
19959
19960 static __always_inline void __raw_spin_lock(raw_spinlock_t *lock)
19961 {
19962 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/include/asm/swab.h linux-2.6.29-rc3.owrt/arch/x86/include/asm/swab.h
19963 --- linux-2.6.29.owrt/arch/x86/include/asm/swab.h 2009-05-10 22:04:41.000000000 +0200
19964 +++ linux-2.6.29-rc3.owrt/arch/x86/include/asm/swab.h 2009-05-10 23:48:28.000000000 +0200
19965 @@ -1,7 +1,7 @@
19966 #ifndef _ASM_X86_SWAB_H
19967 #define _ASM_X86_SWAB_H
19968
19969 -#include <linux/types.h>
19970 +#include <asm/types.h>
19971 #include <linux/compiler.h>
19972
19973 static inline __attribute_const__ __u32 __arch_swab32(__u32 val)
19974 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/include/asm/traps.h linux-2.6.29-rc3.owrt/arch/x86/include/asm/traps.h
19975 --- linux-2.6.29.owrt/arch/x86/include/asm/traps.h 2009-05-10 22:04:41.000000000 +0200
19976 +++ linux-2.6.29-rc3.owrt/arch/x86/include/asm/traps.h 2009-05-10 23:48:28.000000000 +0200
19977 @@ -41,7 +41,7 @@
19978 dotraplinkage void do_overflow(struct pt_regs *, long);
19979 dotraplinkage void do_bounds(struct pt_regs *, long);
19980 dotraplinkage void do_invalid_op(struct pt_regs *, long);
19981 -dotraplinkage void do_device_not_available(struct pt_regs);
19982 +dotraplinkage void do_device_not_available(struct pt_regs *, long);
19983 dotraplinkage void do_coprocessor_segment_overrun(struct pt_regs *, long);
19984 dotraplinkage void do_invalid_TSS(struct pt_regs *, long);
19985 dotraplinkage void do_segment_not_present(struct pt_regs *, long);
19986 @@ -77,7 +77,7 @@
19987 extern int kstack_depth_to_print;
19988
19989 void math_error(void __user *);
19990 -void math_emulate(struct math_emu_info *);
19991 +asmlinkage void math_emulate(long);
19992 #ifdef CONFIG_X86_32
19993 unsigned long patch_espfix_desc(unsigned long, unsigned long);
19994 #else
19995 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/include/asm/xen/page.h linux-2.6.29-rc3.owrt/arch/x86/include/asm/xen/page.h
19996 --- linux-2.6.29.owrt/arch/x86/include/asm/xen/page.h 2009-05-10 22:04:41.000000000 +0200
19997 +++ linux-2.6.29-rc3.owrt/arch/x86/include/asm/xen/page.h 2009-05-10 23:48:28.000000000 +0200
19998 @@ -137,7 +137,7 @@
19999 pte_t pte;
20000
20001 pte.pte = ((phys_addr_t)page_nr << PAGE_SHIFT) |
20002 - massage_pgprot(pgprot);
20003 + (pgprot_val(pgprot) & __supported_pte_mask);
20004
20005 return pte;
20006 }
20007 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/Kconfig linux-2.6.29-rc3.owrt/arch/x86/Kconfig
20008 --- linux-2.6.29.owrt/arch/x86/Kconfig 2009-05-10 22:04:41.000000000 +0200
20009 +++ linux-2.6.29-rc3.owrt/arch/x86/Kconfig 2009-05-10 23:48:28.000000000 +0200
20010 @@ -1802,17 +1802,6 @@
20011 and include PCI device scope covered by these DMA
20012 remapping devices.
20013
20014 -config DMAR_DEFAULT_ON
20015 - def_bool y
20016 - prompt "Enable DMA Remapping Devices by default"
20017 - depends on DMAR
20018 - help
20019 - Selecting this option will enable a DMAR device at boot time if
20020 - one is found. If this option is not selected, DMAR support can
20021 - be enabled by passing intel_iommu=on to the kernel. It is
20022 - recommended you say N here while the DMAR code remains
20023 - experimental.
20024 -
20025 config DMAR_GFX_WA
20026 def_bool y
20027 prompt "Support for Graphics workaround"
20028 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/Kconfig.cpu linux-2.6.29-rc3.owrt/arch/x86/Kconfig.cpu
20029 --- linux-2.6.29.owrt/arch/x86/Kconfig.cpu 2009-05-10 22:04:41.000000000 +0200
20030 +++ linux-2.6.29-rc3.owrt/arch/x86/Kconfig.cpu 2009-05-10 23:48:28.000000000 +0200
20031 @@ -167,9 +167,9 @@
20032 config MK8
20033 bool "Opteron/Athlon64/Hammer/K8"
20034 help
20035 - Select this for an AMD Opteron or Athlon64 Hammer-family processor.
20036 - Enables use of some extended instructions, and passes appropriate
20037 - optimization flags to GCC.
20038 + Select this for an AMD Opteron or Athlon64 Hammer-family processor. Enables
20039 + use of some extended instructions, and passes appropriate optimization
20040 + flags to GCC.
20041
20042 config MCRUSOE
20043 bool "Crusoe"
20044 @@ -256,11 +256,9 @@
20045 config MCORE2
20046 bool "Core 2/newer Xeon"
20047 help
20048 -
20049 - Select this for Intel Core 2 and newer Core 2 Xeons (Xeon 51xx and
20050 - 53xx) CPUs. You can distinguish newer from older Xeons by the CPU
20051 - family in /proc/cpuinfo. Newer ones have 6 and older ones 15
20052 - (not a typo)
20053 + Select this for Intel Core 2 and newer Core 2 Xeons (Xeon 51xx and 53xx)
20054 + CPUs. You can distinguish newer from older Xeons by the CPU family
20055 + in /proc/cpuinfo. Newer ones have 6 and older ones 15 (not a typo)
20056
20057 config GENERIC_CPU
20058 bool "Generic-x86-64"
20059 @@ -322,14 +320,14 @@
20060 bool "PentiumPro memory ordering errata workaround"
20061 depends on M686 || M586MMX || M586TSC || M586 || M486 || M386 || MGEODEGX1
20062 help
20063 - Old PentiumPro multiprocessor systems had errata that could cause
20064 - memory operations to violate the x86 ordering standard in rare cases.
20065 - Enabling this option will attempt to work around some (but not all)
20066 - occurances of this problem, at the cost of much heavier spinlock and
20067 - memory barrier operations.
20068 + Old PentiumPro multiprocessor systems had errata that could cause memory
20069 + operations to violate the x86 ordering standard in rare cases. Enabling this
20070 + option will attempt to work around some (but not all) occurances of
20071 + this problem, at the cost of much heavier spinlock and memory barrier
20072 + operations.
20073
20074 - If unsure, say n here. Even distro kernels should think twice before
20075 - enabling this: there are few systems, and an unlikely bug.
20076 + If unsure, say n here. Even distro kernels should think twice before enabling
20077 + this: there are few systems, and an unlikely bug.
20078
20079 config X86_F00F_BUG
20080 def_bool y
20081 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/Kconfig.debug linux-2.6.29-rc3.owrt/arch/x86/Kconfig.debug
20082 --- linux-2.6.29.owrt/arch/x86/Kconfig.debug 2009-05-10 22:04:41.000000000 +0200
20083 +++ linux-2.6.29-rc3.owrt/arch/x86/Kconfig.debug 2009-05-10 23:48:28.000000000 +0200
20084 @@ -174,8 +174,28 @@
20085 Add a simple leak tracer to the IOMMU code. This is useful when you
20086 are debugging a buggy device driver that leaks IOMMU mappings.
20087
20088 -config HAVE_MMIOTRACE_SUPPORT
20089 - def_bool y
20090 +config MMIOTRACE
20091 + bool "Memory mapped IO tracing"
20092 + depends on DEBUG_KERNEL && PCI
20093 + select TRACING
20094 + help
20095 + Mmiotrace traces Memory Mapped I/O access and is meant for
20096 + debugging and reverse engineering. It is called from the ioremap
20097 + implementation and works via page faults. Tracing is disabled by
20098 + default and can be enabled at run-time.
20099 +
20100 + See Documentation/tracers/mmiotrace.txt.
20101 + If you are not helping to develop drivers, say N.
20102 +
20103 +config MMIOTRACE_TEST
20104 + tristate "Test module for mmiotrace"
20105 + depends on MMIOTRACE && m
20106 + help
20107 + This is a dumb module for testing mmiotrace. It is very dangerous
20108 + as it will write garbage to IO memory starting at a given address.
20109 + However, it should be safe to use on e.g. unused portion of VRAM.
20110 +
20111 + Say N, unless you absolutely know what you are doing.
20112
20113 #
20114 # IO delay types:
20115 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/acpi/boot.c linux-2.6.29-rc3.owrt/arch/x86/kernel/acpi/boot.c
20116 --- linux-2.6.29.owrt/arch/x86/kernel/acpi/boot.c 2009-05-10 22:04:41.000000000 +0200
20117 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/acpi/boot.c 2009-05-10 23:48:28.000000000 +0200
20118 @@ -973,29 +973,6 @@
20119 nr_ioapics++;
20120 }
20121
20122 -int __init acpi_probe_gsi(void)
20123 -{
20124 - int idx;
20125 - int gsi;
20126 - int max_gsi = 0;
20127 -
20128 - if (acpi_disabled)
20129 - return 0;
20130 -
20131 - if (!acpi_ioapic)
20132 - return 0;
20133 -
20134 - max_gsi = 0;
20135 - for (idx = 0; idx < nr_ioapics; idx++) {
20136 - gsi = mp_ioapic_routing[idx].gsi_end;
20137 -
20138 - if (gsi > max_gsi)
20139 - max_gsi = gsi;
20140 - }
20141 -
20142 - return max_gsi + 1;
20143 -}
20144 -
20145 static void assign_to_mp_irq(struct mp_config_intsrc *m,
20146 struct mp_config_intsrc *mp_irq)
20147 {
20148 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/acpi/sleep.c linux-2.6.29-rc3.owrt/arch/x86/kernel/acpi/sleep.c
20149 --- linux-2.6.29.owrt/arch/x86/kernel/acpi/sleep.c 2009-05-10 22:04:41.000000000 +0200
20150 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/acpi/sleep.c 2009-05-10 23:48:28.000000000 +0200
20151 @@ -156,11 +156,11 @@
20152 #ifdef CONFIG_HIBERNATION
20153 if (strncmp(str, "s4_nohwsig", 10) == 0)
20154 acpi_no_s4_hw_signature();
20155 - if (strncmp(str, "s4_nonvs", 8) == 0)
20156 - acpi_s4_no_nvs();
20157 #endif
20158 if (strncmp(str, "old_ordering", 12) == 0)
20159 acpi_old_suspend_ordering();
20160 + if (strncmp(str, "s4_nonvs", 8) == 0)
20161 + acpi_s4_no_nvs();
20162 str = strchr(str, ',');
20163 if (str != NULL)
20164 str += strspn(str, ", \t");
20165 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/acpi/wakeup_64.S linux-2.6.29-rc3.owrt/arch/x86/kernel/acpi/wakeup_64.S
20166 --- linux-2.6.29.owrt/arch/x86/kernel/acpi/wakeup_64.S 2009-05-10 22:04:41.000000000 +0200
20167 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/acpi/wakeup_64.S 2009-05-10 23:48:28.000000000 +0200
20168 @@ -13,6 +13,7 @@
20169 * Hooray, we are in Long 64-bit mode (but still running in low memory)
20170 */
20171 ENTRY(wakeup_long64)
20172 +wakeup_long64:
20173 movq saved_magic, %rax
20174 movq $0x123456789abcdef0, %rdx
20175 cmpq %rdx, %rax
20176 @@ -33,12 +34,16 @@
20177
20178 movq saved_rip, %rax
20179 jmp *%rax
20180 -ENDPROC(wakeup_long64)
20181
20182 bogus_64_magic:
20183 jmp bogus_64_magic
20184
20185 -ENTRY(do_suspend_lowlevel)
20186 + .align 2
20187 + .p2align 4,,15
20188 +.globl do_suspend_lowlevel
20189 + .type do_suspend_lowlevel,@function
20190 +do_suspend_lowlevel:
20191 +.LFB5:
20192 subq $8, %rsp
20193 xorl %eax, %eax
20194 call save_processor_state
20195 @@ -62,7 +67,7 @@
20196 pushfq
20197 popq pt_regs_flags(%rax)
20198
20199 - movq $resume_point, saved_rip(%rip)
20200 + movq $.L97, saved_rip(%rip)
20201
20202 movq %rsp, saved_rsp
20203 movq %rbp, saved_rbp
20204 @@ -73,12 +78,14 @@
20205 addq $8, %rsp
20206 movl $3, %edi
20207 xorl %eax, %eax
20208 - call acpi_enter_sleep_state
20209 - /* in case something went wrong, restore the machine status and go on */
20210 - jmp resume_point
20211 -
20212 + jmp acpi_enter_sleep_state
20213 +.L97:
20214 + .p2align 4,,7
20215 +.L99:
20216 .align 4
20217 -resume_point:
20218 + movl $24, %eax
20219 + movw %ax, %ds
20220 +
20221 /* We don't restore %rax, it must be 0 anyway */
20222 movq $saved_context, %rax
20223 movq saved_context_cr4(%rax), %rbx
20224 @@ -110,9 +117,12 @@
20225 xorl %eax, %eax
20226 addq $8, %rsp
20227 jmp restore_processor_state
20228 -ENDPROC(do_suspend_lowlevel)
20229 -
20230 +.LFE5:
20231 +.Lfe5:
20232 + .size do_suspend_lowlevel, .Lfe5-do_suspend_lowlevel
20233 +
20234 .data
20235 +ALIGN
20236 ENTRY(saved_rbp) .quad 0
20237 ENTRY(saved_rsi) .quad 0
20238 ENTRY(saved_rdi) .quad 0
20239 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/apic.c linux-2.6.29-rc3.owrt/arch/x86/kernel/apic.c
20240 --- linux-2.6.29.owrt/arch/x86/kernel/apic.c 2009-05-10 22:04:41.000000000 +0200
20241 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/apic.c 2009-05-10 23:48:28.000000000 +0200
20242 @@ -862,7 +862,7 @@
20243 }
20244
20245 /* lets not touch this if we didn't frob it */
20246 -#if defined(CONFIG_X86_MCE_P4THERMAL) || defined(CONFIG_X86_MCE_INTEL)
20247 +#if defined(CONFIG_X86_MCE_P4THERMAL) || defined(X86_MCE_INTEL)
20248 if (maxlvt >= 5) {
20249 v = apic_read(APIC_LVTTHMR);
20250 apic_write(APIC_LVTTHMR, v | APIC_LVT_MASKED);
20251 @@ -1436,7 +1436,7 @@
20252 switch (boot_cpu_data.x86_vendor) {
20253 case X86_VENDOR_AMD:
20254 if ((boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model > 1) ||
20255 - (boot_cpu_data.x86 >= 15))
20256 + (boot_cpu_data.x86 == 15))
20257 break;
20258 goto no_apic;
20259 case X86_VENDOR_INTEL:
20260 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/apm_32.c linux-2.6.29-rc3.owrt/arch/x86/kernel/apm_32.c
20261 --- linux-2.6.29.owrt/arch/x86/kernel/apm_32.c 2009-05-10 22:04:41.000000000 +0200
20262 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/apm_32.c 2009-05-10 23:48:28.000000000 +0200
20263 @@ -1192,7 +1192,6 @@
20264 device_suspend(PMSG_SUSPEND);
20265 local_irq_disable();
20266 device_power_down(PMSG_SUSPEND);
20267 - sysdev_suspend(PMSG_SUSPEND);
20268
20269 local_irq_enable();
20270
20271 @@ -1209,7 +1208,6 @@
20272 if (err != APM_SUCCESS)
20273 apm_error("suspend", err);
20274 err = (err == APM_SUCCESS) ? 0 : -EIO;
20275 - sysdev_resume();
20276 device_power_up(PMSG_RESUME);
20277 local_irq_enable();
20278 device_resume(PMSG_RESUME);
20279 @@ -1230,7 +1228,6 @@
20280
20281 local_irq_disable();
20282 device_power_down(PMSG_SUSPEND);
20283 - sysdev_suspend(PMSG_SUSPEND);
20284 local_irq_enable();
20285
20286 err = set_system_power_state(APM_STATE_STANDBY);
20287 @@ -1238,7 +1235,6 @@
20288 apm_error("standby", err);
20289
20290 local_irq_disable();
20291 - sysdev_resume();
20292 device_power_up(PMSG_RESUME);
20293 local_irq_enable();
20294 }
20295 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/cpu/cpufreq/Kconfig linux-2.6.29-rc3.owrt/arch/x86/kernel/cpu/cpufreq/Kconfig
20296 --- linux-2.6.29.owrt/arch/x86/kernel/cpu/cpufreq/Kconfig 2009-05-10 22:04:41.000000000 +0200
20297 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/cpu/cpufreq/Kconfig 2009-05-10 23:48:28.000000000 +0200
20298 @@ -245,6 +245,17 @@
20299
20300 comment "shared options"
20301
20302 +config X86_ACPI_CPUFREQ_PROC_INTF
20303 + bool "/proc/acpi/processor/../performance interface (deprecated)"
20304 + depends on PROC_FS
20305 + depends on X86_ACPI_CPUFREQ || X86_POWERNOW_K7_ACPI || X86_POWERNOW_K8_ACPI
20306 + help
20307 + This enables the deprecated /proc/acpi/processor/../performance
20308 + interface. While it is helpful for debugging, the generic,
20309 + cross-architecture cpufreq interfaces should be used.
20310 +
20311 + If in doubt, say N.
20312 +
20313 config X86_SPEEDSTEP_LIB
20314 tristate
20315 default (X86_SPEEDSTEP_ICH || X86_SPEEDSTEP_SMI || X86_P4_CLOCKMOD)
20316 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c linux-2.6.29-rc3.owrt/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c
20317 --- linux-2.6.29.owrt/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c 2009-05-10 22:04:41.000000000 +0200
20318 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c 2009-05-10 23:48:28.000000000 +0200
20319 @@ -277,6 +277,7 @@
20320 .name = "p4-clockmod",
20321 .owner = THIS_MODULE,
20322 .attr = p4clockmod_attr,
20323 + .hide_interface = 1,
20324 };
20325
20326
20327 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/cpu/cpufreq/powernow-k8.c linux-2.6.29-rc3.owrt/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
20328 --- linux-2.6.29.owrt/arch/x86/kernel/cpu/cpufreq/powernow-k8.c 2009-05-10 22:04:41.000000000 +0200
20329 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/cpu/cpufreq/powernow-k8.c 2009-05-10 23:48:28.000000000 +0200
20330 @@ -939,25 +939,10 @@
20331 free_cpumask_var(data->acpi_data.shared_cpu_map);
20332 }
20333
20334 -static int get_transition_latency(struct powernow_k8_data *data)
20335 -{
20336 - int max_latency = 0;
20337 - int i;
20338 - for (i = 0; i < data->acpi_data.state_count; i++) {
20339 - int cur_latency = data->acpi_data.states[i].transition_latency
20340 - + data->acpi_data.states[i].bus_master_latency;
20341 - if (cur_latency > max_latency)
20342 - max_latency = cur_latency;
20343 - }
20344 - /* value in usecs, needs to be in nanoseconds */
20345 - return 1000 * max_latency;
20346 -}
20347 -
20348 #else
20349 static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data) { return -ENODEV; }
20350 static void powernow_k8_cpu_exit_acpi(struct powernow_k8_data *data) { return; }
20351 static void powernow_k8_acpi_pst_values(struct powernow_k8_data *data, unsigned int index) { return; }
20352 -static int get_transition_latency(struct powernow_k8_data *data) { return 0; }
20353 #endif /* CONFIG_X86_POWERNOW_K8_ACPI */
20354
20355 /* Take a frequency, and issue the fid/vid transition command */
20356 @@ -1157,7 +1142,8 @@
20357 data->cpu = pol->cpu;
20358 data->currpstate = HW_PSTATE_INVALID;
20359
20360 - if (powernow_k8_cpu_init_acpi(data)) {
20361 + rc = powernow_k8_cpu_init_acpi(data);
20362 + if (rc) {
20363 /*
20364 * Use the PSB BIOS structure. This is only availabe on
20365 * an UP version, and is deprecated by AMD.
20366 @@ -1175,28 +1161,19 @@
20367 "ACPI maintainers and complain to your BIOS "
20368 "vendor.\n");
20369 #endif
20370 - kfree(data);
20371 - return -ENODEV;
20372 + goto err_out;
20373 }
20374 if (pol->cpu != 0) {
20375 printk(KERN_ERR FW_BUG PFX "No ACPI _PSS objects for "
20376 "CPU other than CPU0. Complain to your BIOS "
20377 "vendor.\n");
20378 - kfree(data);
20379 - return -ENODEV;
20380 + goto err_out;
20381 }
20382 rc = find_psb_table(data);
20383 if (rc) {
20384 - kfree(data);
20385 - return -ENODEV;
20386 + goto err_out;
20387 }
20388 - /* Take a crude guess here.
20389 - * That guess was in microseconds, so multiply with 1000 */
20390 - pol->cpuinfo.transition_latency = (
20391 - ((data->rvo + 8) * data->vstable * VST_UNITS_20US) +
20392 - ((1 << data->irt) * 30)) * 1000;
20393 - } else /* ACPI _PSS objects available */
20394 - pol->cpuinfo.transition_latency = get_transition_latency(data);
20395 + }
20396
20397 /* only run on specific CPU from here on */
20398 oldmask = current->cpus_allowed;
20399 @@ -1227,6 +1204,11 @@
20400 cpumask_copy(pol->cpus, &per_cpu(cpu_core_map, pol->cpu));
20401 data->available_cores = pol->cpus;
20402
20403 + /* Take a crude guess here.
20404 + * That guess was in microseconds, so multiply with 1000 */
20405 + pol->cpuinfo.transition_latency = (((data->rvo + 8) * data->vstable * VST_UNITS_20US)
20406 + + (3 * (1 << data->irt) * 10)) * 1000;
20407 +
20408 if (cpu_family == CPU_HW_PSTATE)
20409 pol->cur = find_khz_freq_from_pstate(data->powernow_table, data->currpstate);
20410 else
20411 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/cpu/intel.c linux-2.6.29-rc3.owrt/arch/x86/kernel/cpu/intel.c
20412 --- linux-2.6.29.owrt/arch/x86/kernel/cpu/intel.c 2009-05-10 22:04:41.000000000 +0200
20413 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/cpu/intel.c 2009-05-10 23:48:28.000000000 +0200
20414 @@ -30,7 +30,7 @@
20415 static void __cpuinit early_init_intel(struct cpuinfo_x86 *c)
20416 {
20417 /* Unmask CPUID levels if masked: */
20418 - if (c->x86 > 6 || (c->x86 == 6 && c->x86_model >= 0xd)) {
20419 + if (c->x86 == 6 && c->x86_model >= 15) {
20420 u64 misc_enable;
20421
20422 rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
20423 @@ -291,9 +291,6 @@
20424 ds_init_intel(c);
20425 }
20426
20427 - if (c->x86 == 6 && c->x86_model == 29 && cpu_has_clflush)
20428 - set_cpu_cap(c, X86_FEATURE_CLFLUSH_MONITOR);
20429 -
20430 #ifdef CONFIG_X86_64
20431 if (c->x86 == 15)
20432 c->x86_cache_alignment = c->x86_clflush_size * 2;
20433 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/cpu/intel_cacheinfo.c linux-2.6.29-rc3.owrt/arch/x86/kernel/cpu/intel_cacheinfo.c
20434 --- linux-2.6.29.owrt/arch/x86/kernel/cpu/intel_cacheinfo.c 2009-05-10 22:04:41.000000000 +0200
20435 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/cpu/intel_cacheinfo.c 2009-05-10 23:48:28.000000000 +0200
20436 @@ -36,11 +36,8 @@
20437 {
20438 { 0x06, LVL_1_INST, 8 }, /* 4-way set assoc, 32 byte line size */
20439 { 0x08, LVL_1_INST, 16 }, /* 4-way set assoc, 32 byte line size */
20440 - { 0x09, LVL_1_INST, 32 }, /* 4-way set assoc, 64 byte line size */
20441 { 0x0a, LVL_1_DATA, 8 }, /* 2 way set assoc, 32 byte line size */
20442 { 0x0c, LVL_1_DATA, 16 }, /* 4-way set assoc, 32 byte line size */
20443 - { 0x0d, LVL_1_DATA, 16 }, /* 4-way set assoc, 64 byte line size */
20444 - { 0x21, LVL_2, 256 }, /* 8-way set assoc, 64 byte line size */
20445 { 0x22, LVL_3, 512 }, /* 4-way set assoc, sectored cache, 64 byte line size */
20446 { 0x23, LVL_3, 1024 }, /* 8-way set assoc, sectored cache, 64 byte line size */
20447 { 0x25, LVL_3, 2048 }, /* 8-way set assoc, sectored cache, 64 byte line size */
20448 @@ -88,18 +85,6 @@
20449 { 0x85, LVL_2, 2048 }, /* 8-way set assoc, 32 byte line size */
20450 { 0x86, LVL_2, 512 }, /* 4-way set assoc, 64 byte line size */
20451 { 0x87, LVL_2, 1024 }, /* 8-way set assoc, 64 byte line size */
20452 - { 0xd0, LVL_3, 512 }, /* 4-way set assoc, 64 byte line size */
20453 - { 0xd1, LVL_3, 1024 }, /* 4-way set assoc, 64 byte line size */
20454 - { 0xd2, LVL_3, 2048 }, /* 4-way set assoc, 64 byte line size */
20455 - { 0xd6, LVL_3, 1024 }, /* 8-way set assoc, 64 byte line size */
20456 - { 0xd7, LVL_3, 2038 }, /* 8-way set assoc, 64 byte line size */
20457 - { 0xd8, LVL_3, 4096 }, /* 12-way set assoc, 64 byte line size */
20458 - { 0xdc, LVL_3, 2048 }, /* 12-way set assoc, 64 byte line size */
20459 - { 0xdd, LVL_3, 4096 }, /* 12-way set assoc, 64 byte line size */
20460 - { 0xde, LVL_3, 8192 }, /* 12-way set assoc, 64 byte line size */
20461 - { 0xe2, LVL_3, 2048 }, /* 16-way set assoc, 64 byte line size */
20462 - { 0xe3, LVL_3, 4096 }, /* 16-way set assoc, 64 byte line size */
20463 - { 0xe4, LVL_3, 8192 }, /* 16-way set assoc, 64 byte line size */
20464 { 0x00, 0, 0}
20465 };
20466
20467 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/cpu/mcheck/mce_64.c linux-2.6.29-rc3.owrt/arch/x86/kernel/cpu/mcheck/mce_64.c
20468 --- linux-2.6.29.owrt/arch/x86/kernel/cpu/mcheck/mce_64.c 2009-05-10 22:04:41.000000000 +0200
20469 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/cpu/mcheck/mce_64.c 2009-05-10 23:48:28.000000000 +0200
20470 @@ -295,11 +295,11 @@
20471 * If we know that the error was in user space, send a
20472 * SIGBUS. Otherwise, panic if tolerance is low.
20473 *
20474 - * force_sig() takes an awful lot of locks and has a slight
20475 + * do_exit() takes an awful lot of locks and has a slight
20476 * risk of deadlocking.
20477 */
20478 if (user_space) {
20479 - force_sig(SIGBUS, current);
20480 + do_exit(SIGBUS);
20481 } else if (panic_on_oops || tolerant < 2) {
20482 mce_panic("Uncorrected machine check",
20483 &panicm, mcestart);
20484 @@ -490,7 +490,7 @@
20485
20486 }
20487
20488 -static void mce_cpu_features(struct cpuinfo_x86 *c)
20489 +static void __cpuinit mce_cpu_features(struct cpuinfo_x86 *c)
20490 {
20491 switch (c->x86_vendor) {
20492 case X86_VENDOR_INTEL:
20493 @@ -734,7 +734,6 @@
20494 static int mce_resume(struct sys_device *dev)
20495 {
20496 mce_init(NULL);
20497 - mce_cpu_features(&current_cpu_data);
20498 return 0;
20499 }
20500
20501 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/cpu/mcheck/mce_amd_64.c linux-2.6.29-rc3.owrt/arch/x86/kernel/cpu/mcheck/mce_amd_64.c
20502 --- linux-2.6.29.owrt/arch/x86/kernel/cpu/mcheck/mce_amd_64.c 2009-05-10 22:04:41.000000000 +0200
20503 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/cpu/mcheck/mce_amd_64.c 2009-05-10 23:48:28.000000000 +0200
20504 @@ -121,7 +121,7 @@
20505 }
20506
20507 /* cpu init entry point, called from mce.c with preempt off */
20508 -void mce_amd_feature_init(struct cpuinfo_x86 *c)
20509 +void __cpuinit mce_amd_feature_init(struct cpuinfo_x86 *c)
20510 {
20511 unsigned int bank, block;
20512 unsigned int cpu = smp_processor_id();
20513 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/cpu/mcheck/mce_intel_64.c linux-2.6.29-rc3.owrt/arch/x86/kernel/cpu/mcheck/mce_intel_64.c
20514 --- linux-2.6.29.owrt/arch/x86/kernel/cpu/mcheck/mce_intel_64.c 2009-05-10 22:04:41.000000000 +0200
20515 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/cpu/mcheck/mce_intel_64.c 2009-05-10 23:48:28.000000000 +0200
20516 @@ -30,7 +30,7 @@
20517 irq_exit();
20518 }
20519
20520 -static void intel_init_thermal(struct cpuinfo_x86 *c)
20521 +static void __cpuinit intel_init_thermal(struct cpuinfo_x86 *c)
20522 {
20523 u32 l, h;
20524 int tm2 = 0;
20525 @@ -84,7 +84,7 @@
20526 return;
20527 }
20528
20529 -void mce_intel_feature_init(struct cpuinfo_x86 *c)
20530 +void __cpuinit mce_intel_feature_init(struct cpuinfo_x86 *c)
20531 {
20532 intel_init_thermal(c);
20533 }
20534 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/cpu/mtrr/main.c linux-2.6.29-rc3.owrt/arch/x86/kernel/cpu/mtrr/main.c
20535 --- linux-2.6.29.owrt/arch/x86/kernel/cpu/mtrr/main.c 2009-05-10 22:04:41.000000000 +0200
20536 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/cpu/mtrr/main.c 2009-05-10 23:48:28.000000000 +0200
20537 @@ -1594,7 +1594,8 @@
20538
20539 /* kvm/qemu doesn't have mtrr set right, don't trim them all */
20540 if (!highest_pfn) {
20541 - printk(KERN_INFO "CPU MTRRs all blank - virtualized system.\n");
20542 + WARN(!kvm_para_available(), KERN_WARNING
20543 + "WARNING: strange, CPU MTRRs all blank?\n");
20544 return 0;
20545 }
20546
20547 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/ds.c linux-2.6.29-rc3.owrt/arch/x86/kernel/ds.c
20548 --- linux-2.6.29.owrt/arch/x86/kernel/ds.c 2009-05-10 22:04:41.000000000 +0200
20549 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/ds.c 2009-05-10 23:48:28.000000000 +0200
20550 @@ -15,8 +15,8 @@
20551 * - buffer allocation (memory accounting)
20552 *
20553 *
20554 - * Copyright (C) 2007-2009 Intel Corporation.
20555 - * Markus Metzger <markus.t.metzger@intel.com>, 2007-2009
20556 + * Copyright (C) 2007-2008 Intel Corporation.
20557 + * Markus Metzger <markus.t.metzger@intel.com>, 2007-2008
20558 */
20559
20560
20561 @@ -729,7 +729,7 @@
20562
20563 spin_unlock_irqrestore(&ds_lock, irq);
20564
20565 - ds_write_config(tracer->ds.context, &tracer->trace.ds, ds_pebs);
20566 + ds_write_config(tracer->ds.context, &tracer->trace.ds, ds_bts);
20567 ds_resume_pebs(tracer);
20568
20569 return tracer;
20570 @@ -890,7 +890,7 @@
20571 }
20572
20573 static const struct ds_configuration ds_cfg_netburst = {
20574 - .name = "Netburst",
20575 + .name = "netburst",
20576 .ctl[dsf_bts] = (1 << 2) | (1 << 3),
20577 .ctl[dsf_bts_kernel] = (1 << 5),
20578 .ctl[dsf_bts_user] = (1 << 6),
20579 @@ -904,7 +904,7 @@
20580 #endif
20581 };
20582 static const struct ds_configuration ds_cfg_pentium_m = {
20583 - .name = "Pentium M",
20584 + .name = "pentium m",
20585 .ctl[dsf_bts] = (1 << 6) | (1 << 7),
20586
20587 .sizeof_field = sizeof(long),
20588 @@ -915,8 +915,8 @@
20589 .sizeof_rec[ds_pebs] = sizeof(long) * 18,
20590 #endif
20591 };
20592 -static const struct ds_configuration ds_cfg_core2_atom = {
20593 - .name = "Core 2/Atom",
20594 +static const struct ds_configuration ds_cfg_core2 = {
20595 + .name = "core 2",
20596 .ctl[dsf_bts] = (1 << 6) | (1 << 7),
20597 .ctl[dsf_bts_kernel] = (1 << 9),
20598 .ctl[dsf_bts_user] = (1 << 10),
20599 @@ -949,22 +949,19 @@
20600 switch (c->x86) {
20601 case 0x6:
20602 switch (c->x86_model) {
20603 - case 0x9:
20604 - case 0xd: /* Pentium M */
20605 - ds_configure(&ds_cfg_pentium_m);
20606 + case 0 ... 0xC:
20607 + /* sorry, don't know about them */
20608 break;
20609 - case 0xf:
20610 - case 0x17: /* Core2 */
20611 - case 0x1c: /* Atom */
20612 - ds_configure(&ds_cfg_core2_atom);
20613 + case 0xD:
20614 + case 0xE: /* Pentium M */
20615 + ds_configure(&ds_cfg_pentium_m);
20616 break;
20617 - case 0x1a: /* i7 */
20618 - default:
20619 - /* sorry, don't know about them */
20620 + default: /* Core2, Atom, ... */
20621 + ds_configure(&ds_cfg_core2);
20622 break;
20623 }
20624 break;
20625 - case 0xf:
20626 + case 0xF:
20627 switch (c->x86_model) {
20628 case 0x0:
20629 case 0x1:
20630 @@ -1029,4 +1026,5 @@
20631
20632 void ds_exit_thread(struct task_struct *tsk)
20633 {
20634 + WARN_ON(tsk->thread.ds_ctx);
20635 }
20636 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/efi_64.c linux-2.6.29-rc3.owrt/arch/x86/kernel/efi_64.c
20637 --- linux-2.6.29.owrt/arch/x86/kernel/efi_64.c 2009-05-10 22:04:41.000000000 +0200
20638 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/efi_64.c 2009-05-10 23:48:28.000000000 +0200
20639 @@ -99,11 +99,24 @@
20640
20641 void __iomem *__init efi_ioremap(unsigned long phys_addr, unsigned long size)
20642 {
20643 - unsigned long last_map_pfn;
20644 + static unsigned pages_mapped __initdata;
20645 + unsigned i, pages;
20646 + unsigned long offset;
20647
20648 - last_map_pfn = init_memory_mapping(phys_addr, phys_addr + size);
20649 - if ((last_map_pfn << PAGE_SHIFT) < phys_addr + size)
20650 + pages = PFN_UP(phys_addr + size) - PFN_DOWN(phys_addr);
20651 + offset = phys_addr & ~PAGE_MASK;
20652 + phys_addr &= PAGE_MASK;
20653 +
20654 + if (pages_mapped + pages > MAX_EFI_IO_PAGES)
20655 return NULL;
20656
20657 - return (void __iomem *)__va(phys_addr);
20658 + for (i = 0; i < pages; i++) {
20659 + __set_fixmap(FIX_EFI_IO_MAP_FIRST_PAGE - pages_mapped,
20660 + phys_addr, PAGE_KERNEL);
20661 + phys_addr += PAGE_SIZE;
20662 + pages_mapped++;
20663 + }
20664 +
20665 + return (void __iomem *)__fix_to_virt(FIX_EFI_IO_MAP_FIRST_PAGE - \
20666 + (pages_mapped - pages)) + offset;
20667 }
20668 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/efi.c linux-2.6.29-rc3.owrt/arch/x86/kernel/efi.c
20669 --- linux-2.6.29.owrt/arch/x86/kernel/efi.c 2009-05-10 22:04:41.000000000 +0200
20670 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/efi.c 2009-05-10 23:48:28.000000000 +0200
20671 @@ -467,7 +467,7 @@
20672 efi_memory_desc_t *md;
20673 efi_status_t status;
20674 unsigned long size;
20675 - u64 end, systab, addr, npages, end_pfn;
20676 + u64 end, systab, addr, npages;
20677 void *p, *va;
20678
20679 efi.systab = NULL;
20680 @@ -479,10 +479,7 @@
20681 size = md->num_pages << EFI_PAGE_SHIFT;
20682 end = md->phys_addr + size;
20683
20684 - end_pfn = PFN_UP(end);
20685 - if (end_pfn <= max_low_pfn_mapped
20686 - || (end_pfn > (1UL << (32 - PAGE_SHIFT))
20687 - && end_pfn <= max_pfn_mapped))
20688 + if (PFN_UP(end) <= max_low_pfn_mapped)
20689 va = __va(md->phys_addr);
20690 else
20691 va = efi_ioremap(md->phys_addr, size);
20692 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/entry_64.S linux-2.6.29-rc3.owrt/arch/x86/kernel/entry_64.S
20693 --- linux-2.6.29.owrt/arch/x86/kernel/entry_64.S 2009-05-10 22:04:41.000000000 +0200
20694 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/entry_64.S 2009-05-10 23:48:28.000000000 +0200
20695 @@ -346,7 +346,6 @@
20696 popq_cfi %rax /* move return address... */
20697 mov %gs:pda_irqstackptr,%rsp
20698 EMPTY_FRAME 0
20699 - pushq_cfi %rbp /* backlink for unwinder */
20700 pushq_cfi %rax /* ... to the new stack */
20701 /*
20702 * We entered an interrupt context - irqs are off:
20703 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/ftrace.c linux-2.6.29-rc3.owrt/arch/x86/kernel/ftrace.c
20704 --- linux-2.6.29.owrt/arch/x86/kernel/ftrace.c 2009-05-10 22:04:41.000000000 +0200
20705 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/ftrace.c 2009-05-10 23:48:28.000000000 +0200
20706 @@ -488,21 +488,20 @@
20707 * ignore such a protection.
20708 */
20709 asm volatile(
20710 - "1: " _ASM_MOV " (%[parent]), %[old]\n"
20711 - "2: " _ASM_MOV " %[return_hooker], (%[parent])\n"
20712 + "1: " _ASM_MOV " (%[parent_old]), %[old]\n"
20713 + "2: " _ASM_MOV " %[return_hooker], (%[parent_replaced])\n"
20714 " movl $0, %[faulted]\n"
20715 - "3:\n"
20716
20717 ".section .fixup, \"ax\"\n"
20718 - "4: movl $1, %[faulted]\n"
20719 - " jmp 3b\n"
20720 + "3: movl $1, %[faulted]\n"
20721 ".previous\n"
20722
20723 - _ASM_EXTABLE(1b, 4b)
20724 - _ASM_EXTABLE(2b, 4b)
20725 + _ASM_EXTABLE(1b, 3b)
20726 + _ASM_EXTABLE(2b, 3b)
20727
20728 - : [old] "=r" (old), [faulted] "=r" (faulted)
20729 - : [parent] "r" (parent), [return_hooker] "r" (return_hooker)
20730 + : [parent_replaced] "=r" (parent), [old] "=r" (old),
20731 + [faulted] "=r" (faulted)
20732 + : [parent_old] "0" (parent), [return_hooker] "r" (return_hooker)
20733 : "memory"
20734 );
20735
20736 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/hpet.c linux-2.6.29-rc3.owrt/arch/x86/kernel/hpet.c
20737 --- linux-2.6.29.owrt/arch/x86/kernel/hpet.c 2009-05-10 22:04:41.000000000 +0200
20738 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/hpet.c 2009-05-10 23:48:28.000000000 +0200
20739 @@ -269,8 +269,6 @@
20740 now = hpet_readl(HPET_COUNTER);
20741 cmp = now + (unsigned long) delta;
20742 cfg = hpet_readl(HPET_Tn_CFG(timer));
20743 - /* Make sure we use edge triggered interrupts */
20744 - cfg &= ~HPET_TN_LEVEL;
20745 cfg |= HPET_TN_ENABLE | HPET_TN_PERIODIC |
20746 HPET_TN_SETVAL | HPET_TN_32BIT;
20747 hpet_writel(cfg, HPET_Tn_CFG(timer));
20748 @@ -899,7 +897,7 @@
20749 static int hpet_prev_update_sec;
20750 static struct rtc_time hpet_alarm_time;
20751 static unsigned long hpet_pie_count;
20752 -static u32 hpet_t1_cmp;
20753 +static unsigned long hpet_t1_cmp;
20754 static unsigned long hpet_default_delta;
20755 static unsigned long hpet_pie_delta;
20756 static unsigned long hpet_pie_limit;
20757 @@ -907,14 +905,6 @@
20758 static rtc_irq_handler irq_handler;
20759
20760 /*
20761 - * Check that the hpet counter c1 is ahead of the c2
20762 - */
20763 -static inline int hpet_cnt_ahead(u32 c1, u32 c2)
20764 -{
20765 - return (s32)(c2 - c1) < 0;
20766 -}
20767 -
20768 -/*
20769 * Registers a IRQ handler.
20770 */
20771 int hpet_register_irq_handler(rtc_irq_handler handler)
20772 @@ -1085,7 +1075,7 @@
20773 hpet_t1_cmp += delta;
20774 hpet_writel(hpet_t1_cmp, HPET_T1_CMP);
20775 lost_ints++;
20776 - } while (!hpet_cnt_ahead(hpet_t1_cmp, hpet_readl(HPET_COUNTER)));
20777 + } while ((long)(hpet_readl(HPET_COUNTER) - hpet_t1_cmp) > 0);
20778
20779 if (lost_ints) {
20780 if (hpet_rtc_flags & RTC_PIE)
20781 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/i387.c linux-2.6.29-rc3.owrt/arch/x86/kernel/i387.c
20782 --- linux-2.6.29.owrt/arch/x86/kernel/i387.c 2009-05-10 22:04:41.000000000 +0200
20783 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/i387.c 2009-05-10 23:48:28.000000000 +0200
20784 @@ -136,7 +136,7 @@
20785 #ifdef CONFIG_X86_32
20786 if (!HAVE_HWFP) {
20787 memset(tsk->thread.xstate, 0, xstate_size);
20788 - finit_task(tsk);
20789 + finit();
20790 set_stopped_child_used_math(tsk);
20791 return 0;
20792 }
20793 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/i8237.c linux-2.6.29-rc3.owrt/arch/x86/kernel/i8237.c
20794 --- linux-2.6.29.owrt/arch/x86/kernel/i8237.c 2009-05-10 22:04:41.000000000 +0200
20795 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/i8237.c 2009-05-10 23:48:28.000000000 +0200
20796 @@ -28,10 +28,10 @@
20797
20798 flags = claim_dma_lock();
20799
20800 - dma_outb(0, DMA1_RESET_REG);
20801 - dma_outb(0, DMA2_RESET_REG);
20802 + dma_outb(DMA1_RESET_REG, 0);
20803 + dma_outb(DMA2_RESET_REG, 0);
20804
20805 - for (i = 0; i < 8; i++) {
20806 + for (i = 0;i < 8;i++) {
20807 set_dma_addr(i, 0x000000);
20808 /* DMA count is a bit weird so this is not 0 */
20809 set_dma_count(i, 1);
20810 @@ -51,14 +51,14 @@
20811 }
20812
20813 static struct sysdev_class i8237_sysdev_class = {
20814 - .name = "i8237",
20815 - .suspend = i8237A_suspend,
20816 - .resume = i8237A_resume,
20817 + .name = "i8237",
20818 + .suspend = i8237A_suspend,
20819 + .resume = i8237A_resume,
20820 };
20821
20822 static struct sys_device device_i8237A = {
20823 - .id = 0,
20824 - .cls = &i8237_sysdev_class,
20825 + .id = 0,
20826 + .cls = &i8237_sysdev_class,
20827 };
20828
20829 static int __init i8237A_init_sysfs(void)
20830 @@ -68,4 +68,5 @@
20831 error = sysdev_register(&device_i8237A);
20832 return error;
20833 }
20834 +
20835 device_initcall(i8237A_init_sysfs);
20836 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/io_apic.c linux-2.6.29-rc3.owrt/arch/x86/kernel/io_apic.c
20837 --- linux-2.6.29.owrt/arch/x86/kernel/io_apic.c 2009-05-10 22:04:41.000000000 +0200
20838 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/io_apic.c 2009-05-10 23:48:28.000000000 +0200
20839 @@ -2528,15 +2528,14 @@
20840
20841 vector = ~get_irq_regs()->orig_ax;
20842 me = smp_processor_id();
20843 -
20844 - if (vector == cfg->vector && cpumask_test_cpu(me, cfg->domain)) {
20845 #ifdef CONFIG_NUMA_MIGRATE_IRQ_DESC
20846 *descp = desc = move_irq_desc(desc, me);
20847 /* get the new one */
20848 cfg = desc->chip_data;
20849 #endif
20850 +
20851 + if (vector == cfg->vector && cpumask_test_cpu(me, cfg->domain))
20852 send_cleanup_vector(cfg);
20853 - }
20854 }
20855 #else
20856 static inline void irq_complete_move(struct irq_desc **descp) {}
20857 @@ -3841,24 +3840,14 @@
20858
20859 void __init probe_nr_irqs_gsi(void)
20860 {
20861 + int idx;
20862 int nr = 0;
20863
20864 - nr = acpi_probe_gsi();
20865 - if (nr > nr_irqs_gsi) {
20866 - nr_irqs_gsi = nr;
20867 - } else {
20868 - /* for acpi=off or acpi is not compiled in */
20869 - int idx;
20870 -
20871 - nr = 0;
20872 - for (idx = 0; idx < nr_ioapics; idx++)
20873 - nr += io_apic_get_redir_entries(idx) + 1;
20874 -
20875 - if (nr > nr_irqs_gsi)
20876 - nr_irqs_gsi = nr;
20877 - }
20878 + for (idx = 0; idx < nr_ioapics; idx++)
20879 + nr += io_apic_get_redir_entries(idx) + 1;
20880
20881 - printk(KERN_DEBUG "nr_irqs_gsi: %d\n", nr_irqs_gsi);
20882 + if (nr > nr_irqs_gsi)
20883 + nr_irqs_gsi = nr;
20884 }
20885
20886 /* --------------------------------------------------------------------------
20887 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/irqinit_32.c linux-2.6.29-rc3.owrt/arch/x86/kernel/irqinit_32.c
20888 --- linux-2.6.29.owrt/arch/x86/kernel/irqinit_32.c 2009-05-10 22:04:41.000000000 +0200
20889 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/irqinit_32.c 2009-05-10 23:48:28.000000000 +0200
20890 @@ -78,6 +78,15 @@
20891 }
20892 }
20893
20894 +/*
20895 + * IRQ2 is cascade interrupt to second interrupt controller
20896 + */
20897 +static struct irqaction irq2 = {
20898 + .handler = no_action,
20899 + .mask = CPU_MASK_NONE,
20900 + .name = "cascade",
20901 +};
20902 +
20903 DEFINE_PER_CPU(vector_irq_t, vector_irq) = {
20904 [0 ... IRQ0_VECTOR - 1] = -1,
20905 [IRQ0_VECTOR] = 0,
20906 @@ -169,6 +178,9 @@
20907 alloc_intr_gate(THERMAL_APIC_VECTOR, thermal_interrupt);
20908 #endif
20909
20910 + if (!acpi_ioapic)
20911 + setup_irq(2, &irq2);
20912 +
20913 /* setup after call gates are initialised (usually add in
20914 * the architecture specific gates)
20915 */
20916 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/kprobes.c linux-2.6.29-rc3.owrt/arch/x86/kernel/kprobes.c
20917 --- linux-2.6.29.owrt/arch/x86/kernel/kprobes.c 2009-05-10 22:04:41.000000000 +0200
20918 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/kprobes.c 2009-05-10 23:48:28.000000000 +0200
20919 @@ -193,9 +193,6 @@
20920 kprobe_opcode_t opcode;
20921 kprobe_opcode_t *orig_opcodes = opcodes;
20922
20923 - if (search_exception_tables(opcodes))
20924 - return 0; /* Page fault may occur on this address. */
20925 -
20926 retry:
20927 if (opcodes - orig_opcodes > MAX_INSN_SIZE - 1)
20928 return 0;
20929 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/olpc.c linux-2.6.29-rc3.owrt/arch/x86/kernel/olpc.c
20930 --- linux-2.6.29.owrt/arch/x86/kernel/olpc.c 2009-05-10 22:04:41.000000000 +0200
20931 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/olpc.c 2009-05-10 23:48:28.000000000 +0200
20932 @@ -203,7 +203,7 @@
20933 static void __init platform_detect(void)
20934 {
20935 /* stopgap until OFW support is added to the kernel */
20936 - olpc_platform_info.boardrev = olpc_board(0xc2);
20937 + olpc_platform_info.boardrev = 0xc2;
20938 }
20939 #endif
20940
20941 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/paravirt.c linux-2.6.29-rc3.owrt/arch/x86/kernel/paravirt.c
20942 --- linux-2.6.29.owrt/arch/x86/kernel/paravirt.c 2009-05-10 22:04:41.000000000 +0200
20943 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/paravirt.c 2009-05-10 23:48:28.000000000 +0200
20944 @@ -268,32 +268,6 @@
20945 return __get_cpu_var(paravirt_lazy_mode);
20946 }
20947
20948 -void arch_flush_lazy_mmu_mode(void)
20949 -{
20950 - preempt_disable();
20951 -
20952 - if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_MMU) {
20953 - WARN_ON(preempt_count() == 1);
20954 - arch_leave_lazy_mmu_mode();
20955 - arch_enter_lazy_mmu_mode();
20956 - }
20957 -
20958 - preempt_enable();
20959 -}
20960 -
20961 -void arch_flush_lazy_cpu_mode(void)
20962 -{
20963 - preempt_disable();
20964 -
20965 - if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_CPU) {
20966 - WARN_ON(preempt_count() == 1);
20967 - arch_leave_lazy_cpu_mode();
20968 - arch_enter_lazy_cpu_mode();
20969 - }
20970 -
20971 - preempt_enable();
20972 -}
20973 -
20974 struct pv_info pv_info = {
20975 .name = "bare hardware",
20976 .paravirt_enabled = 0,
20977 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/pci-gart_64.c linux-2.6.29-rc3.owrt/arch/x86/kernel/pci-gart_64.c
20978 --- linux-2.6.29.owrt/arch/x86/kernel/pci-gart_64.c 2009-05-10 22:04:41.000000000 +0200
20979 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/pci-gart_64.c 2009-05-10 23:48:28.000000000 +0200
20980 @@ -5,7 +5,7 @@
20981 * This allows to use PCI devices that only support 32bit addresses on systems
20982 * with more than 4GB.
20983 *
20984 - * See Documentation/PCI/PCI-DMA-mapping.txt for the interface specification.
20985 + * See Documentation/DMA-mapping.txt for the interface specification.
20986 *
20987 * Copyright 2002 Andi Kleen, SuSE Labs.
20988 * Subject to the GNU General Public License v2 only.
20989 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/process_32.c linux-2.6.29-rc3.owrt/arch/x86/kernel/process_32.c
20990 --- linux-2.6.29.owrt/arch/x86/kernel/process_32.c 2009-05-10 22:04:41.000000000 +0200
20991 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/process_32.c 2009-05-10 23:48:28.000000000 +0200
20992 @@ -104,6 +104,9 @@
20993 check_pgt_cache();
20994 rmb();
20995
20996 + if (rcu_pending(cpu))
20997 + rcu_check_callbacks(cpu, 0);
20998 +
20999 if (cpu_is_offline(cpu))
21000 play_dead();
21001
21002 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/process_64.c linux-2.6.29-rc3.owrt/arch/x86/kernel/process_64.c
21003 --- linux-2.6.29.owrt/arch/x86/kernel/process_64.c 2009-05-10 22:04:41.000000000 +0200
21004 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/process_64.c 2009-05-10 23:48:28.000000000 +0200
21005 @@ -40,7 +40,6 @@
21006 #include <linux/uaccess.h>
21007 #include <linux/io.h>
21008 #include <linux/ftrace.h>
21009 -#include <linux/dmi.h>
21010
21011 #include <asm/pgtable.h>
21012 #include <asm/system.h>
21013 @@ -152,18 +151,14 @@
21014 unsigned long d0, d1, d2, d3, d6, d7;
21015 unsigned int fsindex, gsindex;
21016 unsigned int ds, cs, es;
21017 - const char *board;
21018
21019 printk("\n");
21020 print_modules();
21021 - board = dmi_get_system_info(DMI_PRODUCT_NAME);
21022 - if (!board)
21023 - board = "";
21024 - printk(KERN_INFO "Pid: %d, comm: %.20s %s %s %.*s %s\n",
21025 + printk(KERN_INFO "Pid: %d, comm: %.20s %s %s %.*s\n",
21026 current->pid, current->comm, print_tainted(),
21027 init_utsname()->release,
21028 (int)strcspn(init_utsname()->version, " "),
21029 - init_utsname()->version, board);
21030 + init_utsname()->version);
21031 printk(KERN_INFO "RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->ip);
21032 printk_address(regs->ip, 1);
21033 printk(KERN_INFO "RSP: %04lx:%016lx EFLAGS: %08lx\n", regs->ss,
21034 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/process.c linux-2.6.29-rc3.owrt/arch/x86/kernel/process.c
21035 --- linux-2.6.29.owrt/arch/x86/kernel/process.c 2009-05-10 22:04:41.000000000 +0200
21036 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/process.c 2009-05-10 23:48:28.000000000 +0200
21037 @@ -180,9 +180,6 @@
21038
21039 trace_power_start(&it, POWER_CSTATE, (ax>>4)+1);
21040 if (!need_resched()) {
21041 - if (cpu_has(&current_cpu_data, X86_FEATURE_CLFLUSH_MONITOR))
21042 - clflush((void *)&current_thread_info()->flags);
21043 -
21044 __monitor((void *)&current_thread_info()->flags, 0, 0);
21045 smp_mb();
21046 if (!need_resched())
21047 @@ -197,9 +194,6 @@
21048 struct power_trace it;
21049 if (!need_resched()) {
21050 trace_power_start(&it, POWER_CSTATE, 1);
21051 - if (cpu_has(&current_cpu_data, X86_FEATURE_CLFLUSH_MONITOR))
21052 - clflush((void *)&current_thread_info()->flags);
21053 -
21054 __monitor((void *)&current_thread_info()->flags, 0, 0);
21055 smp_mb();
21056 if (!need_resched())
21057 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/ptrace.c linux-2.6.29-rc3.owrt/arch/x86/kernel/ptrace.c
21058 --- linux-2.6.29.owrt/arch/x86/kernel/ptrace.c 2009-05-10 22:04:41.000000000 +0200
21059 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/ptrace.c 2009-05-10 23:48:28.000000000 +0200
21060 @@ -810,16 +810,12 @@
21061
21062 static void ptrace_bts_detach(struct task_struct *child)
21063 {
21064 - /*
21065 - * Ptrace_detach() races with ptrace_untrace() in case
21066 - * the child dies and is reaped by another thread.
21067 - *
21068 - * We only do the memory accounting at this point and
21069 - * leave the buffer deallocation and the bts tracer
21070 - * release to ptrace_bts_untrace() which will be called
21071 - * later on with tasklist_lock held.
21072 - */
21073 - release_locked_buffer(child->bts_buffer, child->bts_size);
21074 + if (unlikely(child->bts)) {
21075 + ds_release_bts(child->bts);
21076 + child->bts = NULL;
21077 +
21078 + ptrace_bts_free_buffer(child);
21079 + }
21080 }
21081 #else
21082 static inline void ptrace_bts_fork(struct task_struct *tsk) {}
21083 @@ -1388,7 +1384,7 @@
21084 #ifdef CONFIG_X86_32
21085 # define IS_IA32 1
21086 #elif defined CONFIG_IA32_EMULATION
21087 -# define IS_IA32 is_compat_task()
21088 +# define IS_IA32 test_thread_flag(TIF_IA32)
21089 #else
21090 # define IS_IA32 0
21091 #endif
21092 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/reboot.c linux-2.6.29-rc3.owrt/arch/x86/kernel/reboot.c
21093 --- linux-2.6.29.owrt/arch/x86/kernel/reboot.c 2009-05-10 22:04:41.000000000 +0200
21094 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/reboot.c 2009-05-10 23:48:28.000000000 +0200
21095 @@ -217,14 +217,6 @@
21096 DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq"),
21097 },
21098 },
21099 - { /* Handle problems with rebooting on Dell XPS710 */
21100 - .callback = set_bios_reboot,
21101 - .ident = "Dell XPS710",
21102 - .matches = {
21103 - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
21104 - DMI_MATCH(DMI_PRODUCT_NAME, "Dell XPS710"),
21105 - },
21106 - },
21107 { }
21108 };
21109
21110 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/setup.c linux-2.6.29-rc3.owrt/arch/x86/kernel/setup.c
21111 --- linux-2.6.29.owrt/arch/x86/kernel/setup.c 2009-05-10 22:04:41.000000000 +0200
21112 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/setup.c 2009-05-10 23:48:28.000000000 +0200
21113 @@ -607,7 +607,7 @@
21114 static int __init dmi_low_memory_corruption(const struct dmi_system_id *d)
21115 {
21116 printk(KERN_NOTICE
21117 - "%s detected: BIOS may corrupt low RAM, working around it.\n",
21118 + "%s detected: BIOS may corrupt low RAM, working it around.\n",
21119 d->ident);
21120
21121 e820_update_range(0, 0x10000, E820_RAM, E820_RESERVED);
21122 @@ -770,9 +770,6 @@
21123
21124 finish_e820_parsing();
21125
21126 - if (efi_enabled)
21127 - efi_init();
21128 -
21129 dmi_scan_machine();
21130
21131 dmi_check_system(bad_bios_dmi_table);
21132 @@ -792,6 +789,8 @@
21133 insert_resource(&iomem_resource, &data_resource);
21134 insert_resource(&iomem_resource, &bss_resource);
21135
21136 + if (efi_enabled)
21137 + efi_init();
21138
21139 #ifdef CONFIG_X86_32
21140 if (ppro_with_ram_bug()) {
21141 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/time_64.c linux-2.6.29-rc3.owrt/arch/x86/kernel/time_64.c
21142 --- linux-2.6.29.owrt/arch/x86/kernel/time_64.c 2009-05-10 22:04:41.000000000 +0200
21143 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/time_64.c 2009-05-10 23:48:28.000000000 +0200
21144 @@ -115,7 +115,7 @@
21145
21146 static struct irqaction irq0 = {
21147 .handler = timer_interrupt,
21148 - .flags = IRQF_DISABLED | IRQF_IRQPOLL | IRQF_NOBALANCING | IRQF_TIMER,
21149 + .flags = IRQF_DISABLED | IRQF_IRQPOLL | IRQF_NOBALANCING,
21150 .mask = CPU_MASK_NONE,
21151 .name = "timer"
21152 };
21153 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/traps.c linux-2.6.29-rc3.owrt/arch/x86/kernel/traps.c
21154 --- linux-2.6.29.owrt/arch/x86/kernel/traps.c 2009-05-10 22:04:41.000000000 +0200
21155 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/traps.c 2009-05-10 23:48:28.000000000 +0200
21156 @@ -99,12 +99,6 @@
21157 local_irq_enable();
21158 }
21159
21160 -static inline void conditional_cli(struct pt_regs *regs)
21161 -{
21162 - if (regs->flags & X86_EFLAGS_IF)
21163 - local_irq_disable();
21164 -}
21165 -
21166 static inline void preempt_conditional_cli(struct pt_regs *regs)
21167 {
21168 if (regs->flags & X86_EFLAGS_IF)
21169 @@ -632,10 +626,8 @@
21170
21171 #ifdef CONFIG_X86_32
21172 debug_vm86:
21173 - /* reenable preemption: handle_vm86_trap() might sleep */
21174 - dec_preempt_count();
21175 handle_vm86_trap((struct kernel_vm86_regs *) regs, error_code, 1);
21176 - conditional_cli(regs);
21177 + preempt_conditional_cli(regs);
21178 return;
21179 #endif
21180
21181 @@ -904,7 +896,7 @@
21182 EXPORT_SYMBOL_GPL(math_state_restore);
21183
21184 #ifndef CONFIG_MATH_EMULATION
21185 -void math_emulate(struct math_emu_info *info)
21186 +asmlinkage void math_emulate(long arg)
21187 {
21188 printk(KERN_EMERG
21189 "math-emulation not enabled and no coprocessor found.\n");
21190 @@ -914,19 +906,16 @@
21191 }
21192 #endif /* CONFIG_MATH_EMULATION */
21193
21194 -dotraplinkage void __kprobes do_device_not_available(struct pt_regs regs)
21195 +dotraplinkage void __kprobes
21196 +do_device_not_available(struct pt_regs *regs, long error)
21197 {
21198 #ifdef CONFIG_X86_32
21199 if (read_cr0() & X86_CR0_EM) {
21200 - struct math_emu_info info = { };
21201 -
21202 - conditional_sti(&regs);
21203 -
21204 - info.regs = &regs;
21205 - math_emulate(&info);
21206 + conditional_sti(regs);
21207 + math_emulate(0);
21208 } else {
21209 math_state_restore(); /* interrupts still off */
21210 - conditional_sti(&regs);
21211 + conditional_sti(regs);
21212 }
21213 #else
21214 math_state_restore();
21215 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/tsc.c linux-2.6.29-rc3.owrt/arch/x86/kernel/tsc.c
21216 --- linux-2.6.29.owrt/arch/x86/kernel/tsc.c 2009-05-10 22:04:41.000000000 +0200
21217 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/tsc.c 2009-05-10 23:48:28.000000000 +0200
21218 @@ -273,43 +273,30 @@
21219 * use the TSC value at the transitions to calculate a pretty
21220 * good value for the TSC frequencty.
21221 */
21222 -static inline int pit_expect_msb(unsigned char val, u64 *tscp, unsigned long *deltap)
21223 +static inline int pit_expect_msb(unsigned char val)
21224 {
21225 - int count;
21226 - u64 tsc = 0;
21227 + int count = 0;
21228
21229 for (count = 0; count < 50000; count++) {
21230 /* Ignore LSB */
21231 inb(0x42);
21232 if (inb(0x42) != val)
21233 break;
21234 - tsc = get_cycles();
21235 }
21236 - *deltap = get_cycles() - tsc;
21237 - *tscp = tsc;
21238 -
21239 - /*
21240 - * We require _some_ success, but the quality control
21241 - * will be based on the error terms on the TSC values.
21242 - */
21243 - return count > 5;
21244 + return count > 50;
21245 }
21246
21247 /*
21248 - * How many MSB values do we want to see? We aim for
21249 - * a maximum error rate of 500ppm (in practice the
21250 - * real error is much smaller), but refuse to spend
21251 - * more than 25ms on it.
21252 + * How many MSB values do we want to see? We aim for a
21253 + * 15ms calibration, which assuming a 2us counter read
21254 + * error should give us roughly 150 ppm precision for
21255 + * the calibration.
21256 */
21257 -#define MAX_QUICK_PIT_MS 25
21258 -#define MAX_QUICK_PIT_ITERATIONS (MAX_QUICK_PIT_MS * PIT_TICK_RATE / 1000 / 256)
21259 +#define QUICK_PIT_MS 15
21260 +#define QUICK_PIT_ITERATIONS (QUICK_PIT_MS * PIT_TICK_RATE / 1000 / 256)
21261
21262 static unsigned long quick_pit_calibrate(void)
21263 {
21264 - int i;
21265 - u64 tsc, delta;
21266 - unsigned long d1, d2;
21267 -
21268 /* Set the Gate high, disable speaker */
21269 outb((inb(0x61) & ~0x02) | 0x01, 0x61);
21270
21271 @@ -328,52 +315,45 @@
21272 outb(0xff, 0x42);
21273 outb(0xff, 0x42);
21274
21275 - /*
21276 - * The PIT starts counting at the next edge, so we
21277 - * need to delay for a microsecond. The easiest way
21278 - * to do that is to just read back the 16-bit counter
21279 - * once from the PIT.
21280 - */
21281 - inb(0x42);
21282 - inb(0x42);
21283 -
21284 - if (pit_expect_msb(0xff, &tsc, &d1)) {
21285 - for (i = 1; i <= MAX_QUICK_PIT_ITERATIONS; i++) {
21286 - if (!pit_expect_msb(0xff-i, &delta, &d2))
21287 - break;
21288 -
21289 - /*
21290 - * Iterate until the error is less than 500 ppm
21291 - */
21292 - delta -= tsc;
21293 - if (d1+d2 < delta >> 11)
21294 - goto success;
21295 + if (pit_expect_msb(0xff)) {
21296 + int i;
21297 + u64 t1, t2, delta;
21298 + unsigned char expect = 0xfe;
21299 +
21300 + t1 = get_cycles();
21301 + for (i = 0; i < QUICK_PIT_ITERATIONS; i++, expect--) {
21302 + if (!pit_expect_msb(expect))
21303 + goto failed;
21304 }
21305 + t2 = get_cycles();
21306 +
21307 + /*
21308 + * Make sure we can rely on the second TSC timestamp:
21309 + */
21310 + if (!pit_expect_msb(expect))
21311 + goto failed;
21312 +
21313 + /*
21314 + * Ok, if we get here, then we've seen the
21315 + * MSB of the PIT decrement QUICK_PIT_ITERATIONS
21316 + * times, and each MSB had many hits, so we never
21317 + * had any sudden jumps.
21318 + *
21319 + * As a result, we can depend on there not being
21320 + * any odd delays anywhere, and the TSC reads are
21321 + * reliable.
21322 + *
21323 + * kHz = ticks / time-in-seconds / 1000;
21324 + * kHz = (t2 - t1) / (QPI * 256 / PIT_TICK_RATE) / 1000
21325 + * kHz = ((t2 - t1) * PIT_TICK_RATE) / (QPI * 256 * 1000)
21326 + */
21327 + delta = (t2 - t1)*PIT_TICK_RATE;
21328 + do_div(delta, QUICK_PIT_ITERATIONS*256*1000);
21329 + printk("Fast TSC calibration using PIT\n");
21330 + return delta;
21331 }
21332 - printk("Fast TSC calibration failed\n");
21333 +failed:
21334 return 0;
21335 -
21336 -success:
21337 - /*
21338 - * Ok, if we get here, then we've seen the
21339 - * MSB of the PIT decrement 'i' times, and the
21340 - * error has shrunk to less than 500 ppm.
21341 - *
21342 - * As a result, we can depend on there not being
21343 - * any odd delays anywhere, and the TSC reads are
21344 - * reliable (within the error). We also adjust the
21345 - * delta to the middle of the error bars, just
21346 - * because it looks nicer.
21347 - *
21348 - * kHz = ticks / time-in-seconds / 1000;
21349 - * kHz = (t2 - t1) / (I * 256 / PIT_TICK_RATE) / 1000
21350 - * kHz = ((t2 - t1) * PIT_TICK_RATE) / (I * 256 * 1000)
21351 - */
21352 - delta += (long)(d2 - d1)/2;
21353 - delta *= PIT_TICK_RATE;
21354 - do_div(delta, i*256*1000);
21355 - printk("Fast TSC calibration using PIT\n");
21356 - return delta;
21357 }
21358
21359 /**
21360 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/vmi_32.c linux-2.6.29-rc3.owrt/arch/x86/kernel/vmi_32.c
21361 --- linux-2.6.29.owrt/arch/x86/kernel/vmi_32.c 2009-05-10 22:04:41.000000000 +0200
21362 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/vmi_32.c 2009-05-10 23:48:28.000000000 +0200
21363 @@ -321,16 +321,6 @@
21364 }
21365
21366 /*
21367 - * We use the pgd_free hook for releasing the pgd page:
21368 - */
21369 -static void vmi_pgd_free(struct mm_struct *mm, pgd_t *pgd)
21370 -{
21371 - unsigned long pfn = __pa(pgd) >> PAGE_SHIFT;
21372 -
21373 - vmi_ops.release_page(pfn, VMI_PAGE_L2);
21374 -}
21375 -
21376 -/*
21377 * Helper macros for MMU update flags. We can defer updates until a flush
21378 * or page invalidation only if the update is to the current address space
21379 * (otherwise, there is no flush). We must check against init_mm, since
21380 @@ -772,7 +762,6 @@
21381 if (vmi_ops.release_page) {
21382 pv_mmu_ops.release_pte = vmi_release_pte;
21383 pv_mmu_ops.release_pmd = vmi_release_pmd;
21384 - pv_mmu_ops.pgd_free = vmi_pgd_free;
21385 }
21386
21387 /* Set linear is needed in all cases */
21388 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kernel/vmiclock_32.c linux-2.6.29-rc3.owrt/arch/x86/kernel/vmiclock_32.c
21389 --- linux-2.6.29.owrt/arch/x86/kernel/vmiclock_32.c 2009-05-10 22:04:41.000000000 +0200
21390 +++ linux-2.6.29-rc3.owrt/arch/x86/kernel/vmiclock_32.c 2009-05-10 23:48:28.000000000 +0200
21391 @@ -202,7 +202,7 @@
21392 static struct irqaction vmi_clock_action = {
21393 .name = "vmi-timer",
21394 .handler = vmi_timer_interrupt,
21395 - .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_TIMER,
21396 + .flags = IRQF_DISABLED | IRQF_NOBALANCING,
21397 .mask = CPU_MASK_ALL,
21398 };
21399
21400 @@ -283,13 +283,10 @@
21401 #endif
21402
21403 /** vmi clocksource */
21404 -static struct clocksource clocksource_vmi;
21405
21406 static cycle_t read_real_cycles(void)
21407 {
21408 - cycle_t ret = (cycle_t)vmi_timer_ops.get_cycle_counter(VMI_CYCLES_REAL);
21409 - return ret >= clocksource_vmi.cycle_last ?
21410 - ret : clocksource_vmi.cycle_last;
21411 + return vmi_timer_ops.get_cycle_counter(VMI_CYCLES_REAL);
21412 }
21413
21414 static struct clocksource clocksource_vmi = {
21415 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kvm/i8254.c linux-2.6.29-rc3.owrt/arch/x86/kvm/i8254.c
21416 --- linux-2.6.29.owrt/arch/x86/kvm/i8254.c 2009-05-10 22:04:41.000000000 +0200
21417 +++ linux-2.6.29-rc3.owrt/arch/x86/kvm/i8254.c 2009-05-10 23:48:28.000000000 +0200
21418 @@ -207,7 +207,7 @@
21419 hrtimer_add_expires_ns(&pt->timer, pt->period);
21420 pt->scheduled = hrtimer_get_expires_ns(&pt->timer);
21421 if (pt->period)
21422 - ps->channels[0].count_load_time = ktime_get();
21423 + ps->channels[0].count_load_time = hrtimer_get_expires(&pt->timer);
21424
21425 return (pt->period == 0 ? 0 : 1);
21426 }
21427 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kvm/irq.c linux-2.6.29-rc3.owrt/arch/x86/kvm/irq.c
21428 --- linux-2.6.29.owrt/arch/x86/kvm/irq.c 2009-05-10 22:04:41.000000000 +0200
21429 +++ linux-2.6.29-rc3.owrt/arch/x86/kvm/irq.c 2009-05-10 23:48:28.000000000 +0200
21430 @@ -87,6 +87,13 @@
21431 }
21432 EXPORT_SYMBOL_GPL(kvm_inject_pending_timer_irqs);
21433
21434 +void kvm_timer_intr_post(struct kvm_vcpu *vcpu, int vec)
21435 +{
21436 + kvm_apic_timer_intr_post(vcpu, vec);
21437 + /* TODO: PIT, RTC etc. */
21438 +}
21439 +EXPORT_SYMBOL_GPL(kvm_timer_intr_post);
21440 +
21441 void __kvm_migrate_timers(struct kvm_vcpu *vcpu)
21442 {
21443 __kvm_migrate_apic_timer(vcpu);
21444 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kvm/irq.h linux-2.6.29-rc3.owrt/arch/x86/kvm/irq.h
21445 --- linux-2.6.29.owrt/arch/x86/kvm/irq.h 2009-05-10 22:04:41.000000000 +0200
21446 +++ linux-2.6.29-rc3.owrt/arch/x86/kvm/irq.h 2009-05-10 23:48:28.000000000 +0200
21447 @@ -89,6 +89,7 @@
21448
21449 void kvm_pic_reset(struct kvm_kpic_state *s);
21450
21451 +void kvm_timer_intr_post(struct kvm_vcpu *vcpu, int vec);
21452 void kvm_inject_pending_timer_irqs(struct kvm_vcpu *vcpu);
21453 void kvm_inject_apic_timer_irqs(struct kvm_vcpu *vcpu);
21454 void kvm_apic_nmi_wd_deliver(struct kvm_vcpu *vcpu);
21455 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kvm/lapic.c linux-2.6.29-rc3.owrt/arch/x86/kvm/lapic.c
21456 --- linux-2.6.29.owrt/arch/x86/kvm/lapic.c 2009-05-10 22:04:41.000000000 +0200
21457 +++ linux-2.6.29-rc3.owrt/arch/x86/kvm/lapic.c 2009-05-10 23:48:28.000000000 +0200
21458 @@ -35,12 +35,6 @@
21459 #include "kvm_cache_regs.h"
21460 #include "irq.h"
21461
21462 -#ifndef CONFIG_X86_64
21463 -#define mod_64(x, y) ((x) - (y) * div64_u64(x, y))
21464 -#else
21465 -#define mod_64(x, y) ((x) % (y))
21466 -#endif
21467 -
21468 #define PRId64 "d"
21469 #define PRIx64 "llx"
21470 #define PRIu64 "u"
21471 @@ -517,22 +511,52 @@
21472
21473 static u32 apic_get_tmcct(struct kvm_lapic *apic)
21474 {
21475 - ktime_t remaining;
21476 - s64 ns;
21477 + u64 counter_passed;
21478 + ktime_t passed, now;
21479 u32 tmcct;
21480
21481 ASSERT(apic != NULL);
21482
21483 + now = apic->timer.dev.base->get_time();
21484 + tmcct = apic_get_reg(apic, APIC_TMICT);
21485 +
21486 /* if initial count is 0, current count should also be 0 */
21487 - if (apic_get_reg(apic, APIC_TMICT) == 0)
21488 + if (tmcct == 0)
21489 return 0;
21490
21491 - remaining = hrtimer_expires_remaining(&apic->timer.dev);
21492 - if (ktime_to_ns(remaining) < 0)
21493 - remaining = ktime_set(0, 0);
21494 -
21495 - ns = mod_64(ktime_to_ns(remaining), apic->timer.period);
21496 - tmcct = div64_u64(ns, (APIC_BUS_CYCLE_NS * apic->timer.divide_count));
21497 + if (unlikely(ktime_to_ns(now) <=
21498 + ktime_to_ns(apic->timer.last_update))) {
21499 + /* Wrap around */
21500 + passed = ktime_add(( {
21501 + (ktime_t) {
21502 + .tv64 = KTIME_MAX -
21503 + (apic->timer.last_update).tv64}; }
21504 + ), now);
21505 + apic_debug("time elapsed\n");
21506 + } else
21507 + passed = ktime_sub(now, apic->timer.last_update);
21508 +
21509 + counter_passed = div64_u64(ktime_to_ns(passed),
21510 + (APIC_BUS_CYCLE_NS * apic->timer.divide_count));
21511 +
21512 + if (counter_passed > tmcct) {
21513 + if (unlikely(!apic_lvtt_period(apic))) {
21514 + /* one-shot timers stick at 0 until reset */
21515 + tmcct = 0;
21516 + } else {
21517 + /*
21518 + * periodic timers reset to APIC_TMICT when they
21519 + * hit 0. The while loop simulates this happening N
21520 + * times. (counter_passed %= tmcct) would also work,
21521 + * but might be slower or not work on 32-bit??
21522 + */
21523 + while (counter_passed > tmcct)
21524 + counter_passed -= tmcct;
21525 + tmcct -= counter_passed;
21526 + }
21527 + } else {
21528 + tmcct -= counter_passed;
21529 + }
21530
21531 return tmcct;
21532 }
21533 @@ -629,6 +653,8 @@
21534 {
21535 ktime_t now = apic->timer.dev.base->get_time();
21536
21537 + apic->timer.last_update = now;
21538 +
21539 apic->timer.period = apic_get_reg(apic, APIC_TMICT) *
21540 APIC_BUS_CYCLE_NS * apic->timer.divide_count;
21541 atomic_set(&apic->timer.pending, 0);
21542 @@ -1084,6 +1110,16 @@
21543 }
21544 }
21545
21546 +void kvm_apic_timer_intr_post(struct kvm_vcpu *vcpu, int vec)
21547 +{
21548 + struct kvm_lapic *apic = vcpu->arch.apic;
21549 +
21550 + if (apic && apic_lvt_vector(apic, APIC_LVTT) == vec)
21551 + apic->timer.last_update = ktime_add_ns(
21552 + apic->timer.last_update,
21553 + apic->timer.period);
21554 +}
21555 +
21556 int kvm_get_apic_interrupt(struct kvm_vcpu *vcpu)
21557 {
21558 int vector = kvm_apic_has_interrupt(vcpu);
21559 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kvm/lapic.h linux-2.6.29-rc3.owrt/arch/x86/kvm/lapic.h
21560 --- linux-2.6.29.owrt/arch/x86/kvm/lapic.h 2009-05-10 22:04:41.000000000 +0200
21561 +++ linux-2.6.29-rc3.owrt/arch/x86/kvm/lapic.h 2009-05-10 23:48:28.000000000 +0200
21562 @@ -12,6 +12,7 @@
21563 atomic_t pending;
21564 s64 period; /* unit: ns */
21565 u32 divide_count;
21566 + ktime_t last_update;
21567 struct hrtimer dev;
21568 } timer;
21569 struct kvm_vcpu *vcpu;
21570 @@ -41,6 +42,7 @@
21571 void kvm_apic_post_state_restore(struct kvm_vcpu *vcpu);
21572 int kvm_lapic_enabled(struct kvm_vcpu *vcpu);
21573 int kvm_lapic_find_highest_irr(struct kvm_vcpu *vcpu);
21574 +void kvm_apic_timer_intr_post(struct kvm_vcpu *vcpu, int vec);
21575
21576 void kvm_lapic_set_vapic_addr(struct kvm_vcpu *vcpu, gpa_t vapic_addr);
21577 void kvm_lapic_sync_from_vapic(struct kvm_vcpu *vcpu);
21578 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kvm/mmu.c linux-2.6.29-rc3.owrt/arch/x86/kvm/mmu.c
21579 --- linux-2.6.29.owrt/arch/x86/kvm/mmu.c 2009-05-10 22:04:41.000000000 +0200
21580 +++ linux-2.6.29-rc3.owrt/arch/x86/kvm/mmu.c 2009-05-10 23:48:28.000000000 +0200
21581 @@ -1698,13 +1698,8 @@
21582 if (largepage)
21583 spte |= PT_PAGE_SIZE_MASK;
21584 if (mt_mask) {
21585 - if (!kvm_is_mmio_pfn(pfn)) {
21586 - mt_mask = get_memory_type(vcpu, gfn) <<
21587 - kvm_x86_ops->get_mt_mask_shift();
21588 - mt_mask |= VMX_EPT_IGMT_BIT;
21589 - } else
21590 - mt_mask = MTRR_TYPE_UNCACHABLE <<
21591 - kvm_x86_ops->get_mt_mask_shift();
21592 + mt_mask = get_memory_type(vcpu, gfn) <<
21593 + kvm_x86_ops->get_mt_mask_shift();
21594 spte |= mt_mask;
21595 }
21596
21597 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kvm/svm.c linux-2.6.29-rc3.owrt/arch/x86/kvm/svm.c
21598 --- linux-2.6.29.owrt/arch/x86/kvm/svm.c 2009-05-10 22:04:41.000000000 +0200
21599 +++ linux-2.6.29-rc3.owrt/arch/x86/kvm/svm.c 2009-05-10 23:48:28.000000000 +0200
21600 @@ -1600,6 +1600,7 @@
21601 /* Okay, we can deliver the interrupt: grab it and update PIC state. */
21602 intr_vector = kvm_cpu_get_interrupt(vcpu);
21603 svm_inject_irq(svm, intr_vector);
21604 + kvm_timer_intr_post(vcpu, intr_vector);
21605 out:
21606 update_cr8_intercept(vcpu);
21607 }
21608 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kvm/vmx.c linux-2.6.29-rc3.owrt/arch/x86/kvm/vmx.c
21609 --- linux-2.6.29.owrt/arch/x86/kvm/vmx.c 2009-05-10 22:04:41.000000000 +0200
21610 +++ linux-2.6.29-rc3.owrt/arch/x86/kvm/vmx.c 2009-05-10 23:48:28.000000000 +0200
21611 @@ -903,7 +903,6 @@
21612 data = vmcs_readl(GUEST_SYSENTER_ESP);
21613 break;
21614 default:
21615 - vmx_load_host_state(to_vmx(vcpu));
21616 msr = find_msr_entry(to_vmx(vcpu), msr_index);
21617 if (msr) {
21618 data = msr->data;
21619 @@ -3286,6 +3285,7 @@
21620 }
21621 if (vcpu->arch.interrupt.pending) {
21622 vmx_inject_irq(vcpu, vcpu->arch.interrupt.nr);
21623 + kvm_timer_intr_post(vcpu, vcpu->arch.interrupt.nr);
21624 if (kvm_cpu_has_interrupt(vcpu))
21625 enable_irq_window(vcpu);
21626 }
21627 @@ -3687,7 +3687,8 @@
21628 if (vm_need_ept()) {
21629 bypass_guest_pf = 0;
21630 kvm_mmu_set_base_ptes(VMX_EPT_READABLE_MASK |
21631 - VMX_EPT_WRITABLE_MASK);
21632 + VMX_EPT_WRITABLE_MASK |
21633 + VMX_EPT_IGMT_BIT);
21634 kvm_mmu_set_mask_ptes(0ull, 0ull, 0ull, 0ull,
21635 VMX_EPT_EXECUTABLE_MASK,
21636 VMX_EPT_DEFAULT_MT << VMX_EPT_MT_EPTE_SHIFT);
21637 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/kvm/x86.c linux-2.6.29-rc3.owrt/arch/x86/kvm/x86.c
21638 --- linux-2.6.29.owrt/arch/x86/kvm/x86.c 2009-05-10 22:04:41.000000000 +0200
21639 +++ linux-2.6.29-rc3.owrt/arch/x86/kvm/x86.c 2009-05-10 23:48:28.000000000 +0200
21640 @@ -967,6 +967,7 @@
21641 case KVM_CAP_MMU_SHADOW_CACHE_CONTROL:
21642 case KVM_CAP_SET_TSS_ADDR:
21643 case KVM_CAP_EXT_CPUID:
21644 + case KVM_CAP_CLOCKSOURCE:
21645 case KVM_CAP_PIT:
21646 case KVM_CAP_NOP_IO_DELAY:
21647 case KVM_CAP_MP_STATE:
21648 @@ -991,9 +992,6 @@
21649 case KVM_CAP_IOMMU:
21650 r = iommu_found();
21651 break;
21652 - case KVM_CAP_CLOCKSOURCE:
21653 - r = boot_cpu_has(X86_FEATURE_CONSTANT_TSC);
21654 - break;
21655 default:
21656 r = 0;
21657 break;
21658 @@ -4129,13 +4127,9 @@
21659
21660 }
21661
21662 -void kvm_arch_sync_events(struct kvm *kvm)
21663 -{
21664 - kvm_free_all_assigned_devices(kvm);
21665 -}
21666 -
21667 void kvm_arch_destroy_vm(struct kvm *kvm)
21668 {
21669 + kvm_free_all_assigned_devices(kvm);
21670 kvm_iommu_unmap_guest(kvm);
21671 kvm_free_pit(kvm);
21672 kfree(kvm->arch.vpic);
21673 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/lguest/boot.c linux-2.6.29-rc3.owrt/arch/x86/lguest/boot.c
21674 --- linux-2.6.29.owrt/arch/x86/lguest/boot.c 2009-05-10 22:04:41.000000000 +0200
21675 +++ linux-2.6.29-rc3.owrt/arch/x86/lguest/boot.c 2009-05-10 23:48:28.000000000 +0200
21676 @@ -343,11 +343,6 @@
21677 * flush_tlb_user() for both user and kernel mappings unless
21678 * the Page Global Enable (PGE) feature bit is set. */
21679 *dx |= 0x00002000;
21680 - /* We also lie, and say we're family id 5. 6 or greater
21681 - * leads to a rdmsr in early_init_intel which we can't handle.
21682 - * Family ID is returned as bits 8-12 in ax. */
21683 - *ax &= 0xFFFFF0FF;
21684 - *ax |= 0x00000500;
21685 break;
21686 case 0x80000000:
21687 /* Futureproof this a little: if they ask how much extended
21688 @@ -594,21 +589,19 @@
21689 /* Some systems map "vectors" to interrupts weirdly. Lguest has
21690 * a straightforward 1 to 1 mapping, so force that here. */
21691 __get_cpu_var(vector_irq)[vector] = i;
21692 - if (vector != SYSCALL_VECTOR)
21693 - set_intr_gate(vector, interrupt[i]);
21694 + if (vector != SYSCALL_VECTOR) {
21695 + set_intr_gate(vector,
21696 + interrupt[vector-FIRST_EXTERNAL_VECTOR]);
21697 + set_irq_chip_and_handler_name(i, &lguest_irq_controller,
21698 + handle_level_irq,
21699 + "level");
21700 + }
21701 }
21702 /* This call is required to set up for 4k stacks, where we have
21703 * separate stacks for hard and soft interrupts. */
21704 irq_ctx_init(smp_processor_id());
21705 }
21706
21707 -void lguest_setup_irq(unsigned int irq)
21708 -{
21709 - irq_to_desc_alloc_cpu(irq, 0);
21710 - set_irq_chip_and_handler_name(irq, &lguest_irq_controller,
21711 - handle_level_irq, "level");
21712 -}
21713 -
21714 /*
21715 * Time.
21716 *
21717 @@ -938,7 +931,7 @@
21718 * that we can fit comfortably.
21719 *
21720 * First we need assembly templates of each of the patchable Guest operations,
21721 - * and these are in i386_head.S. */
21722 + * and these are in lguest_asm.S. */
21723
21724 /*G:060 We construct a table from the assembler templates: */
21725 static const struct lguest_insns
21726 @@ -1100,7 +1093,7 @@
21727 acpi_ht = 0;
21728 #endif
21729
21730 - /* We set the preferred console to "hvc". This is the "hypervisor
21731 + /* We set the perferred console to "hvc". This is the "hypervisor
21732 * virtual console" driver written by the PowerPC people, which we also
21733 * adapted for lguest's use. */
21734 add_preferred_console("hvc", 0, NULL);
21735 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/mach-default/setup.c linux-2.6.29-rc3.owrt/arch/x86/mach-default/setup.c
21736 --- linux-2.6.29.owrt/arch/x86/mach-default/setup.c 2009-05-10 22:04:41.000000000 +0200
21737 +++ linux-2.6.29-rc3.owrt/arch/x86/mach-default/setup.c 2009-05-10 23:48:28.000000000 +0200
21738 @@ -38,15 +38,6 @@
21739 init_ISA_irqs();
21740 }
21741
21742 -/*
21743 - * IRQ2 is cascade interrupt to second interrupt controller
21744 - */
21745 -static struct irqaction irq2 = {
21746 - .handler = no_action,
21747 - .mask = CPU_MASK_NONE,
21748 - .name = "cascade",
21749 -};
21750 -
21751 /**
21752 * intr_init_hook - post gate setup interrupt initialisation
21753 *
21754 @@ -62,9 +53,6 @@
21755 if (x86_quirks->arch_intr_init())
21756 return;
21757 }
21758 - if (!acpi_ioapic)
21759 - setup_irq(2, &irq2);
21760 -
21761 }
21762
21763 /**
21764 @@ -96,7 +84,7 @@
21765
21766 static struct irqaction irq0 = {
21767 .handler = timer_interrupt,
21768 - .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_IRQPOLL | IRQF_TIMER,
21769 + .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_IRQPOLL,
21770 .mask = CPU_MASK_NONE,
21771 .name = "timer"
21772 };
21773 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/mach-voyager/setup.c linux-2.6.29-rc3.owrt/arch/x86/mach-voyager/setup.c
21774 --- linux-2.6.29.owrt/arch/x86/mach-voyager/setup.c 2009-05-10 22:04:41.000000000 +0200
21775 +++ linux-2.6.29-rc3.owrt/arch/x86/mach-voyager/setup.c 2009-05-10 23:48:28.000000000 +0200
21776 @@ -33,30 +33,20 @@
21777 setup_irq(2, &irq2);
21778 }
21779
21780 -static void voyager_disable_tsc(void)
21781 +void __init pre_setup_arch_hook(void)
21782 {
21783 /* Voyagers run their CPUs from independent clocks, so disable
21784 * the TSC code because we can't sync them */
21785 setup_clear_cpu_cap(X86_FEATURE_TSC);
21786 }
21787
21788 -void __init pre_setup_arch_hook(void)
21789 -{
21790 - voyager_disable_tsc();
21791 -}
21792 -
21793 -void __init pre_time_init_hook(void)
21794 -{
21795 - voyager_disable_tsc();
21796 -}
21797 -
21798 void __init trap_init_hook(void)
21799 {
21800 }
21801
21802 static struct irqaction irq0 = {
21803 .handler = timer_interrupt,
21804 - .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_IRQPOLL | IRQF_TIMER,
21805 + .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_IRQPOLL,
21806 .mask = CPU_MASK_NONE,
21807 .name = "timer"
21808 };
21809 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/mach-voyager/voyager_smp.c linux-2.6.29-rc3.owrt/arch/x86/mach-voyager/voyager_smp.c
21810 --- linux-2.6.29.owrt/arch/x86/mach-voyager/voyager_smp.c 2009-05-10 22:04:41.000000000 +0200
21811 +++ linux-2.6.29-rc3.owrt/arch/x86/mach-voyager/voyager_smp.c 2009-05-10 23:48:28.000000000 +0200
21812 @@ -65,7 +65,7 @@
21813
21814 /* Bitmask of CPUs present in the system - exported by i386_syms.c, used
21815 * by scheduler but indexed physically */
21816 -static cpumask_t voyager_phys_cpu_present_map = CPU_MASK_NONE;
21817 +cpumask_t phys_cpu_present_map = CPU_MASK_NONE;
21818
21819 /* The internal functions */
21820 static void send_CPI(__u32 cpuset, __u8 cpi);
21821 @@ -81,7 +81,7 @@
21822 static void disable_local_vic_irq(unsigned int irq);
21823 static void before_handle_vic_irq(unsigned int irq);
21824 static void after_handle_vic_irq(unsigned int irq);
21825 -static void set_vic_irq_affinity(unsigned int irq, const struct cpumask *mask);
21826 +static void set_vic_irq_affinity(unsigned int irq, cpumask_t mask);
21827 static void ack_vic_irq(unsigned int irq);
21828 static void vic_enable_cpi(void);
21829 static void do_boot_cpu(__u8 cpuid);
21830 @@ -211,6 +211,8 @@
21831 static cpumask_t smp_commenced_mask = CPU_MASK_NONE;
21832
21833 /* This is for the new dynamic CPU boot code */
21834 +cpumask_t cpu_callin_map = CPU_MASK_NONE;
21835 +cpumask_t cpu_callout_map = CPU_MASK_NONE;
21836
21837 /* The per processor IRQ masks (these are usually kept in sync) */
21838 static __u16 vic_irq_mask[NR_CPUS] __cacheline_aligned;
21839 @@ -366,19 +368,19 @@
21840 /* set up everything for just this CPU, we can alter
21841 * this as we start the other CPUs later */
21842 /* now get the CPU disposition from the extended CMOS */
21843 - cpus_addr(voyager_phys_cpu_present_map)[0] =
21844 + cpus_addr(phys_cpu_present_map)[0] =
21845 voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK);
21846 - cpus_addr(voyager_phys_cpu_present_map)[0] |=
21847 + cpus_addr(phys_cpu_present_map)[0] |=
21848 voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK + 1) << 8;
21849 - cpus_addr(voyager_phys_cpu_present_map)[0] |=
21850 + cpus_addr(phys_cpu_present_map)[0] |=
21851 voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK +
21852 2) << 16;
21853 - cpus_addr(voyager_phys_cpu_present_map)[0] |=
21854 + cpus_addr(phys_cpu_present_map)[0] |=
21855 voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK +
21856 3) << 24;
21857 - init_cpu_possible(&voyager_phys_cpu_present_map);
21858 - printk("VOYAGER SMP: voyager_phys_cpu_present_map = 0x%lx\n",
21859 - cpus_addr(voyager_phys_cpu_present_map)[0]);
21860 + cpu_possible_map = phys_cpu_present_map;
21861 + printk("VOYAGER SMP: phys_cpu_present_map = 0x%lx\n",
21862 + cpus_addr(phys_cpu_present_map)[0]);
21863 /* Here we set up the VIC to enable SMP */
21864 /* enable the CPIs by writing the base vector to their register */
21865 outb(VIC_DEFAULT_CPI_BASE, VIC_CPI_BASE_REGISTER);
21866 @@ -628,15 +630,15 @@
21867 /* now that the cat has probed the Voyager System Bus, sanity
21868 * check the cpu map */
21869 if (((voyager_quad_processors | voyager_extended_vic_processors)
21870 - & cpus_addr(voyager_phys_cpu_present_map)[0]) !=
21871 - cpus_addr(voyager_phys_cpu_present_map)[0]) {
21872 + & cpus_addr(phys_cpu_present_map)[0]) !=
21873 + cpus_addr(phys_cpu_present_map)[0]) {
21874 /* should panic */
21875 printk("\n\n***WARNING*** "
21876 "Sanity check of CPU present map FAILED\n");
21877 }
21878 } else if (voyager_level == 4)
21879 voyager_extended_vic_processors =
21880 - cpus_addr(voyager_phys_cpu_present_map)[0];
21881 + cpus_addr(phys_cpu_present_map)[0];
21882
21883 /* this sets up the idle task to run on the current cpu */
21884 voyager_extended_cpus = 1;
21885 @@ -670,7 +672,7 @@
21886 /* loop over all the extended VIC CPUs and boot them. The
21887 * Quad CPUs must be bootstrapped by their extended VIC cpu */
21888 for (i = 0; i < nr_cpu_ids; i++) {
21889 - if (i == boot_cpu_id || !cpu_isset(i, voyager_phys_cpu_present_map))
21890 + if (i == boot_cpu_id || !cpu_isset(i, phys_cpu_present_map))
21891 continue;
21892 do_boot_cpu(i);
21893 /* This udelay seems to be needed for the Quad boots
21894 @@ -1597,16 +1599,16 @@
21895 * change the mask and then do an interrupt enable CPI to re-enable on
21896 * the selected processors */
21897
21898 -void set_vic_irq_affinity(unsigned int irq, const struct cpumask *mask)
21899 +void set_vic_irq_affinity(unsigned int irq, cpumask_t mask)
21900 {
21901 /* Only extended processors handle interrupts */
21902 unsigned long real_mask;
21903 unsigned long irq_mask = 1 << irq;
21904 int cpu;
21905
21906 - real_mask = cpus_addr(*mask)[0] & voyager_extended_vic_processors;
21907 + real_mask = cpus_addr(mask)[0] & voyager_extended_vic_processors;
21908
21909 - if (cpus_addr(*mask)[0] == 0)
21910 + if (cpus_addr(mask)[0] == 0)
21911 /* can't have no CPUs to accept the interrupt -- extremely
21912 * bad things will happen */
21913 return;
21914 @@ -1748,11 +1750,10 @@
21915 init_gdt(smp_processor_id());
21916 switch_to_new_gdt();
21917
21918 - cpu_online_map = cpumask_of_cpu(smp_processor_id());
21919 - cpu_callout_map = cpumask_of_cpu(smp_processor_id());
21920 - cpu_callin_map = CPU_MASK_NONE;
21921 - cpu_present_map = cpumask_of_cpu(smp_processor_id());
21922 -
21923 + cpu_set(smp_processor_id(), cpu_online_map);
21924 + cpu_set(smp_processor_id(), cpu_callout_map);
21925 + cpu_set(smp_processor_id(), cpu_possible_map);
21926 + cpu_set(smp_processor_id(), cpu_present_map);
21927 }
21928
21929 static int __cpuinit voyager_cpu_up(unsigned int cpu)
21930 @@ -1782,9 +1783,9 @@
21931 x86_write_percpu(cpu_number, hard_smp_processor_id());
21932 }
21933
21934 -static void voyager_send_call_func(const struct cpumask *callmask)
21935 +static void voyager_send_call_func(cpumask_t callmask)
21936 {
21937 - __u32 mask = cpus_addr(*callmask)[0] & ~(1 << smp_processor_id());
21938 + __u32 mask = cpus_addr(callmask)[0] & ~(1 << smp_processor_id());
21939 send_CPI(mask, VIC_CALL_FUNCTION_CPI);
21940 }
21941
21942 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/math-emu/fpu_aux.c linux-2.6.29-rc3.owrt/arch/x86/math-emu/fpu_aux.c
21943 --- linux-2.6.29.owrt/arch/x86/math-emu/fpu_aux.c 2009-05-10 22:04:41.000000000 +0200
21944 +++ linux-2.6.29-rc3.owrt/arch/x86/math-emu/fpu_aux.c 2009-05-10 23:48:28.000000000 +0200
21945 @@ -30,29 +30,20 @@
21946 }
21947
21948 /* Needs to be externally visible */
21949 -void finit_task(struct task_struct *tsk)
21950 +void finit(void)
21951 {
21952 - struct i387_soft_struct *soft = &tsk->thread.xstate->soft;
21953 - struct address *oaddr, *iaddr;
21954 - soft->cwd = 0x037f;
21955 - soft->swd = 0;
21956 - soft->ftop = 0; /* We don't keep top in the status word internally. */
21957 - soft->twd = 0xffff;
21958 + control_word = 0x037f;
21959 + partial_status = 0;
21960 + top = 0; /* We don't keep top in the status word internally. */
21961 + fpu_tag_word = 0xffff;
21962 /* The behaviour is different from that detailed in
21963 Section 15.1.6 of the Intel manual */
21964 - oaddr = (struct address *)&soft->foo;
21965 - oaddr->offset = 0;
21966 - oaddr->selector = 0;
21967 - iaddr = (struct address *)&soft->fip;
21968 - iaddr->offset = 0;
21969 - iaddr->selector = 0;
21970 - iaddr->opcode = 0;
21971 - soft->no_update = 1;
21972 -}
21973 -
21974 -void finit(void)
21975 -{
21976 - finit_task(current);
21977 + operand_address.offset = 0;
21978 + operand_address.selector = 0;
21979 + instruction_address.offset = 0;
21980 + instruction_address.selector = 0;
21981 + instruction_address.opcode = 0;
21982 + no_ip_update = 1;
21983 }
21984
21985 /*
21986 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/math-emu/fpu_entry.c linux-2.6.29-rc3.owrt/arch/x86/math-emu/fpu_entry.c
21987 --- linux-2.6.29.owrt/arch/x86/math-emu/fpu_entry.c 2009-05-10 22:04:41.000000000 +0200
21988 +++ linux-2.6.29-rc3.owrt/arch/x86/math-emu/fpu_entry.c 2009-05-10 23:48:28.000000000 +0200
21989 @@ -131,7 +131,7 @@
21990 static int valid_prefix(u_char *Byte, u_char __user ** fpu_eip,
21991 overrides * override);
21992
21993 -void math_emulate(struct math_emu_info *info)
21994 +asmlinkage void math_emulate(long arg)
21995 {
21996 u_char FPU_modrm, byte1;
21997 unsigned short code;
21998 @@ -161,7 +161,7 @@
21999 RE_ENTRANT_CHECK_ON;
22000 #endif /* RE_ENTRANT_CHECKING */
22001
22002 - FPU_info = info;
22003 + SETUP_DATA_AREA(arg);
22004
22005 FPU_ORIG_EIP = FPU_EIP;
22006
22007 @@ -659,7 +659,7 @@
22008 }
22009 }
22010
22011 -void math_abort(struct math_emu_info *info, unsigned int signal)
22012 +void math_abort(struct info *info, unsigned int signal)
22013 {
22014 FPU_EIP = FPU_ORIG_EIP;
22015 current->thread.trap_no = 16;
22016 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/math-emu/fpu_proto.h linux-2.6.29-rc3.owrt/arch/x86/math-emu/fpu_proto.h
22017 --- linux-2.6.29.owrt/arch/x86/math-emu/fpu_proto.h 2009-05-10 22:04:41.000000000 +0200
22018 +++ linux-2.6.29-rc3.owrt/arch/x86/math-emu/fpu_proto.h 2009-05-10 23:48:28.000000000 +0200
22019 @@ -51,8 +51,8 @@
22020 extern void fst_i_(void);
22021 extern void fstp_i(void);
22022 /* fpu_entry.c */
22023 -extern void math_emulate(struct math_emu_info *info);
22024 -extern void math_abort(struct math_emu_info *info, unsigned int signal);
22025 +asmlinkage extern void math_emulate(long arg);
22026 +extern void math_abort(struct info *info, unsigned int signal);
22027 /* fpu_etc.c */
22028 extern void FPU_etc(void);
22029 /* fpu_tags.c */
22030 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/math-emu/fpu_system.h linux-2.6.29-rc3.owrt/arch/x86/math-emu/fpu_system.h
22031 --- linux-2.6.29.owrt/arch/x86/math-emu/fpu_system.h 2009-05-10 22:04:41.000000000 +0200
22032 +++ linux-2.6.29-rc3.owrt/arch/x86/math-emu/fpu_system.h 2009-05-10 23:48:28.000000000 +0200
22033 @@ -16,6 +16,10 @@
22034 #include <linux/kernel.h>
22035 #include <linux/mm.h>
22036
22037 +/* This sets the pointer FPU_info to point to the argument part
22038 + of the stack frame of math_emulate() */
22039 +#define SETUP_DATA_AREA(arg) FPU_info = (struct info *) &arg
22040 +
22041 /* s is always from a cpu register, and the cpu does bounds checking
22042 * during register load --> no further bounds checks needed */
22043 #define LDT_DESCRIPTOR(s) (((struct desc_struct *)current->mm->context.ldt)[(s) >> 3])
22044 @@ -34,12 +38,12 @@
22045 #define I387 (current->thread.xstate)
22046 #define FPU_info (I387->soft.info)
22047
22048 -#define FPU_CS (*(unsigned short *) &(FPU_info->regs->cs))
22049 -#define FPU_SS (*(unsigned short *) &(FPU_info->regs->ss))
22050 -#define FPU_DS (*(unsigned short *) &(FPU_info->regs->ds))
22051 -#define FPU_EAX (FPU_info->regs->ax)
22052 -#define FPU_EFLAGS (FPU_info->regs->flags)
22053 -#define FPU_EIP (FPU_info->regs->ip)
22054 +#define FPU_CS (*(unsigned short *) &(FPU_info->___cs))
22055 +#define FPU_SS (*(unsigned short *) &(FPU_info->___ss))
22056 +#define FPU_DS (*(unsigned short *) &(FPU_info->___ds))
22057 +#define FPU_EAX (FPU_info->___eax)
22058 +#define FPU_EFLAGS (FPU_info->___eflags)
22059 +#define FPU_EIP (FPU_info->___eip)
22060 #define FPU_ORIG_EIP (FPU_info->___orig_eip)
22061
22062 #define FPU_lookahead (I387->soft.lookahead)
22063 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/math-emu/get_address.c linux-2.6.29-rc3.owrt/arch/x86/math-emu/get_address.c
22064 --- linux-2.6.29.owrt/arch/x86/math-emu/get_address.c 2009-05-10 22:04:41.000000000 +0200
22065 +++ linux-2.6.29-rc3.owrt/arch/x86/math-emu/get_address.c 2009-05-10 23:48:28.000000000 +0200
22066 @@ -29,43 +29,46 @@
22067 #define FPU_WRITE_BIT 0x10
22068
22069 static int reg_offset[] = {
22070 - offsetof(struct pt_regs, ax),
22071 - offsetof(struct pt_regs, cx),
22072 - offsetof(struct pt_regs, dx),
22073 - offsetof(struct pt_regs, bx),
22074 - offsetof(struct pt_regs, sp),
22075 - offsetof(struct pt_regs, bp),
22076 - offsetof(struct pt_regs, si),
22077 - offsetof(struct pt_regs, di)
22078 + offsetof(struct info, ___eax),
22079 + offsetof(struct info, ___ecx),
22080 + offsetof(struct info, ___edx),
22081 + offsetof(struct info, ___ebx),
22082 + offsetof(struct info, ___esp),
22083 + offsetof(struct info, ___ebp),
22084 + offsetof(struct info, ___esi),
22085 + offsetof(struct info, ___edi)
22086 };
22087
22088 -#define REG_(x) (*(long *)(reg_offset[(x)] + (u_char *)FPU_info->regs))
22089 +#define REG_(x) (*(long *)(reg_offset[(x)]+(u_char *) FPU_info))
22090
22091 static int reg_offset_vm86[] = {
22092 - offsetof(struct pt_regs, cs),
22093 - offsetof(struct kernel_vm86_regs, ds),
22094 - offsetof(struct kernel_vm86_regs, es),
22095 - offsetof(struct kernel_vm86_regs, fs),
22096 - offsetof(struct kernel_vm86_regs, gs),
22097 - offsetof(struct pt_regs, ss),
22098 - offsetof(struct kernel_vm86_regs, ds)
22099 + offsetof(struct info, ___cs),
22100 + offsetof(struct info, ___vm86_ds),
22101 + offsetof(struct info, ___vm86_es),
22102 + offsetof(struct info, ___vm86_fs),
22103 + offsetof(struct info, ___vm86_gs),
22104 + offsetof(struct info, ___ss),
22105 + offsetof(struct info, ___vm86_ds)
22106 };
22107
22108 #define VM86_REG_(x) (*(unsigned short *) \
22109 - (reg_offset_vm86[((unsigned)x)] + (u_char *)FPU_info->regs))
22110 + (reg_offset_vm86[((unsigned)x)]+(u_char *) FPU_info))
22111 +
22112 +/* This dummy, gs is not saved on the stack. */
22113 +#define ___GS ___ds
22114
22115 static int reg_offset_pm[] = {
22116 - offsetof(struct pt_regs, cs),
22117 - offsetof(struct pt_regs, ds),
22118 - offsetof(struct pt_regs, es),
22119 - offsetof(struct pt_regs, fs),
22120 - offsetof(struct pt_regs, ds), /* dummy, not saved on stack */
22121 - offsetof(struct pt_regs, ss),
22122 - offsetof(struct pt_regs, ds)
22123 + offsetof(struct info, ___cs),
22124 + offsetof(struct info, ___ds),
22125 + offsetof(struct info, ___es),
22126 + offsetof(struct info, ___fs),
22127 + offsetof(struct info, ___GS),
22128 + offsetof(struct info, ___ss),
22129 + offsetof(struct info, ___ds)
22130 };
22131
22132 #define PM_REG_(x) (*(unsigned short *) \
22133 - (reg_offset_pm[((unsigned)x)] + (u_char *)FPU_info->regs))
22134 + (reg_offset_pm[((unsigned)x)]+(u_char *) FPU_info))
22135
22136 /* Decode the SIB byte. This function assumes mod != 0 */
22137 static int sib(int mod, unsigned long *fpu_eip)
22138 @@ -346,34 +349,34 @@
22139 }
22140 switch (rm) {
22141 case 0:
22142 - address += FPU_info->regs->bx + FPU_info->regs->si;
22143 + address += FPU_info->___ebx + FPU_info->___esi;
22144 break;
22145 case 1:
22146 - address += FPU_info->regs->bx + FPU_info->regs->di;
22147 + address += FPU_info->___ebx + FPU_info->___edi;
22148 break;
22149 case 2:
22150 - address += FPU_info->regs->bp + FPU_info->regs->si;
22151 + address += FPU_info->___ebp + FPU_info->___esi;
22152 if (addr_modes.override.segment == PREFIX_DEFAULT)
22153 addr_modes.override.segment = PREFIX_SS_;
22154 break;
22155 case 3:
22156 - address += FPU_info->regs->bp + FPU_info->regs->di;
22157 + address += FPU_info->___ebp + FPU_info->___edi;
22158 if (addr_modes.override.segment == PREFIX_DEFAULT)
22159 addr_modes.override.segment = PREFIX_SS_;
22160 break;
22161 case 4:
22162 - address += FPU_info->regs->si;
22163 + address += FPU_info->___esi;
22164 break;
22165 case 5:
22166 - address += FPU_info->regs->di;
22167 + address += FPU_info->___edi;
22168 break;
22169 case 6:
22170 - address += FPU_info->regs->bp;
22171 + address += FPU_info->___ebp;
22172 if (addr_modes.override.segment == PREFIX_DEFAULT)
22173 addr_modes.override.segment = PREFIX_SS_;
22174 break;
22175 case 7:
22176 - address += FPU_info->regs->bx;
22177 + address += FPU_info->___ebx;
22178 break;
22179 }
22180
22181 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/mm/fault.c linux-2.6.29-rc3.owrt/arch/x86/mm/fault.c
22182 --- linux-2.6.29.owrt/arch/x86/mm/fault.c 2009-05-10 22:04:41.000000000 +0200
22183 +++ linux-2.6.29-rc3.owrt/arch/x86/mm/fault.c 2009-05-10 23:48:28.000000000 +0200
22184 @@ -603,6 +603,8 @@
22185
22186 si_code = SEGV_MAPERR;
22187
22188 + if (notify_page_fault(regs))
22189 + return;
22190 if (unlikely(kmmio_fault(regs, address)))
22191 return;
22192
22193 @@ -632,9 +634,6 @@
22194 if (spurious_fault(address, error_code))
22195 return;
22196
22197 - /* kprobes don't want to hook the spurious faults. */
22198 - if (notify_page_fault(regs))
22199 - return;
22200 /*
22201 * Don't take the mm semaphore here. If we fixup a prefetch
22202 * fault we could otherwise deadlock.
22203 @@ -642,9 +641,6 @@
22204 goto bad_area_nosemaphore;
22205 }
22206
22207 - /* kprobes don't want to hook the spurious faults. */
22208 - if (notify_page_fault(regs))
22209 - return;
22210
22211 /*
22212 * It's safe to allow irq's after cr2 has been saved and the
22213 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/mm/init_64.c linux-2.6.29-rc3.owrt/arch/x86/mm/init_64.c
22214 --- linux-2.6.29.owrt/arch/x86/mm/init_64.c 2009-05-10 22:04:41.000000000 +0200
22215 +++ linux-2.6.29-rc3.owrt/arch/x86/mm/init_64.c 2009-05-10 23:48:28.000000000 +0200
22216 @@ -714,8 +714,6 @@
22217 pos = start_pfn << PAGE_SHIFT;
22218 end_pfn = ((pos + (PMD_SIZE - 1)) >> PMD_SHIFT)
22219 << (PMD_SHIFT - PAGE_SHIFT);
22220 - if (end_pfn > (end >> PAGE_SHIFT))
22221 - end_pfn = end >> PAGE_SHIFT;
22222 if (start_pfn < end_pfn) {
22223 nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, 0);
22224 pos = end_pfn << PAGE_SHIFT;
22225 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/mm/iomap_32.c linux-2.6.29-rc3.owrt/arch/x86/mm/iomap_32.c
22226 --- linux-2.6.29.owrt/arch/x86/mm/iomap_32.c 2009-05-10 22:04:41.000000000 +0200
22227 +++ linux-2.6.29-rc3.owrt/arch/x86/mm/iomap_32.c 2009-05-10 23:48:28.000000000 +0200
22228 @@ -20,17 +20,6 @@
22229 #include <asm/pat.h>
22230 #include <linux/module.h>
22231
22232 -int is_io_mapping_possible(resource_size_t base, unsigned long size)
22233 -{
22234 -#ifndef CONFIG_X86_PAE
22235 - /* There is no way to map greater than 1 << 32 address without PAE */
22236 - if (base + size > 0x100000000ULL)
22237 - return 0;
22238 -#endif
22239 - return 1;
22240 -}
22241 -EXPORT_SYMBOL_GPL(is_io_mapping_possible);
22242 -
22243 /* Map 'pfn' using fixed map 'type' and protections 'prot'
22244 */
22245 void *
22246 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/mm/ioremap.c linux-2.6.29-rc3.owrt/arch/x86/mm/ioremap.c
22247 --- linux-2.6.29.owrt/arch/x86/mm/ioremap.c 2009-05-10 22:04:41.000000000 +0200
22248 +++ linux-2.6.29-rc3.owrt/arch/x86/mm/ioremap.c 2009-05-10 23:48:28.000000000 +0200
22249 @@ -134,6 +134,25 @@
22250 return 0;
22251 }
22252
22253 +int pagerange_is_ram(unsigned long start, unsigned long end)
22254 +{
22255 + int ram_page = 0, not_rampage = 0;
22256 + unsigned long page_nr;
22257 +
22258 + for (page_nr = (start >> PAGE_SHIFT); page_nr < (end >> PAGE_SHIFT);
22259 + ++page_nr) {
22260 + if (page_is_ram(page_nr))
22261 + ram_page = 1;
22262 + else
22263 + not_rampage = 1;
22264 +
22265 + if (ram_page == not_rampage)
22266 + return -1;
22267 + }
22268 +
22269 + return ram_page;
22270 +}
22271 +
22272 /*
22273 * Fix up the linear direct mapping of the kernel to avoid cache attribute
22274 * conflicts.
22275 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/mm/kmmio.c linux-2.6.29-rc3.owrt/arch/x86/mm/kmmio.c
22276 --- linux-2.6.29.owrt/arch/x86/mm/kmmio.c 2009-05-10 22:04:41.000000000 +0200
22277 +++ linux-2.6.29-rc3.owrt/arch/x86/mm/kmmio.c 2009-05-10 23:48:28.000000000 +0200
22278 @@ -32,14 +32,11 @@
22279 struct list_head list;
22280 struct kmmio_fault_page *release_next;
22281 unsigned long page; /* location of the fault page */
22282 - bool old_presence; /* page presence prior to arming */
22283 - bool armed;
22284
22285 /*
22286 * Number of times this page has been registered as a part
22287 * of a probe. If zero, page is disarmed and this may be freed.
22288 - * Used only by writers (RCU) and post_kmmio_handler().
22289 - * Protected by kmmio_lock, when linked into kmmio_page_table.
22290 + * Used only by writers (RCU).
22291 */
22292 int count;
22293 };
22294 @@ -108,85 +105,57 @@
22295 return NULL;
22296 }
22297
22298 -static void set_pmd_presence(pmd_t *pmd, bool present, bool *old)
22299 -{
22300 - pmdval_t v = pmd_val(*pmd);
22301 - *old = !!(v & _PAGE_PRESENT);
22302 - v &= ~_PAGE_PRESENT;
22303 - if (present)
22304 - v |= _PAGE_PRESENT;
22305 - set_pmd(pmd, __pmd(v));
22306 -}
22307 -
22308 -static void set_pte_presence(pte_t *pte, bool present, bool *old)
22309 -{
22310 - pteval_t v = pte_val(*pte);
22311 - *old = !!(v & _PAGE_PRESENT);
22312 - v &= ~_PAGE_PRESENT;
22313 - if (present)
22314 - v |= _PAGE_PRESENT;
22315 - set_pte_atomic(pte, __pte(v));
22316 -}
22317 -
22318 -static int set_page_presence(unsigned long addr, bool present, bool *old)
22319 +static void set_page_present(unsigned long addr, bool present,
22320 + unsigned int *pglevel)
22321 {
22322 + pteval_t pteval;
22323 + pmdval_t pmdval;
22324 unsigned int level;
22325 + pmd_t *pmd;
22326 pte_t *pte = lookup_address(addr, &level);
22327
22328 if (!pte) {
22329 pr_err("kmmio: no pte for page 0x%08lx\n", addr);
22330 - return -1;
22331 + return;
22332 }
22333
22334 + if (pglevel)
22335 + *pglevel = level;
22336 +
22337 switch (level) {
22338 case PG_LEVEL_2M:
22339 - set_pmd_presence((pmd_t *)pte, present, old);
22340 + pmd = (pmd_t *)pte;
22341 + pmdval = pmd_val(*pmd) & ~_PAGE_PRESENT;
22342 + if (present)
22343 + pmdval |= _PAGE_PRESENT;
22344 + set_pmd(pmd, __pmd(pmdval));
22345 break;
22346 +
22347 case PG_LEVEL_4K:
22348 - set_pte_presence(pte, present, old);
22349 + pteval = pte_val(*pte) & ~_PAGE_PRESENT;
22350 + if (present)
22351 + pteval |= _PAGE_PRESENT;
22352 + set_pte_atomic(pte, __pte(pteval));
22353 break;
22354 +
22355 default:
22356 pr_err("kmmio: unexpected page level 0x%x.\n", level);
22357 - return -1;
22358 + return;
22359 }
22360
22361 __flush_tlb_one(addr);
22362 - return 0;
22363 }
22364
22365 -/*
22366 - * Mark the given page as not present. Access to it will trigger a fault.
22367 - *
22368 - * Struct kmmio_fault_page is protected by RCU and kmmio_lock, but the
22369 - * protection is ignored here. RCU read lock is assumed held, so the struct
22370 - * will not disappear unexpectedly. Furthermore, the caller must guarantee,
22371 - * that double arming the same virtual address (page) cannot occur.
22372 - *
22373 - * Double disarming on the other hand is allowed, and may occur when a fault
22374 - * and mmiotrace shutdown happen simultaneously.
22375 - */
22376 -static int arm_kmmio_fault_page(struct kmmio_fault_page *f)
22377 +/** Mark the given page as not present. Access to it will trigger a fault. */
22378 +static void arm_kmmio_fault_page(unsigned long page, unsigned int *pglevel)
22379 {
22380 - int ret;
22381 - WARN_ONCE(f->armed, KERN_ERR "kmmio page already armed.\n");
22382 - if (f->armed) {
22383 - pr_warning("kmmio double-arm: page 0x%08lx, ref %d, old %d\n",
22384 - f->page, f->count, f->old_presence);
22385 - }
22386 - ret = set_page_presence(f->page, false, &f->old_presence);
22387 - WARN_ONCE(ret < 0, KERN_ERR "kmmio arming 0x%08lx failed.\n", f->page);
22388 - f->armed = true;
22389 - return ret;
22390 + set_page_present(page & PAGE_MASK, false, pglevel);
22391 }
22392
22393 -/** Restore the given page to saved presence state. */
22394 -static void disarm_kmmio_fault_page(struct kmmio_fault_page *f)
22395 +/** Mark the given page as present. */
22396 +static void disarm_kmmio_fault_page(unsigned long page, unsigned int *pglevel)
22397 {
22398 - bool tmp;
22399 - int ret = set_page_presence(f->page, f->old_presence, &tmp);
22400 - WARN_ONCE(ret < 0,
22401 - KERN_ERR "kmmio disarming 0x%08lx failed.\n", f->page);
22402 - f->armed = false;
22403 + set_page_present(page & PAGE_MASK, true, pglevel);
22404 }
22405
22406 /*
22407 @@ -233,32 +202,28 @@
22408
22409 ctx = &get_cpu_var(kmmio_ctx);
22410 if (ctx->active) {
22411 + disarm_kmmio_fault_page(faultpage->page, NULL);
22412 if (addr == ctx->addr) {
22413 /*
22414 - * A second fault on the same page means some other
22415 - * condition needs handling by do_page_fault(), the
22416 - * page really not being present is the most common.
22417 + * On SMP we sometimes get recursive probe hits on the
22418 + * same address. Context is already saved, fall out.
22419 */
22420 - pr_debug("kmmio: secondary hit for 0x%08lx CPU %d.\n",
22421 - addr, smp_processor_id());
22422 -
22423 - if (!faultpage->old_presence)
22424 - pr_info("kmmio: unexpected secondary hit for "
22425 - "address 0x%08lx on CPU %d.\n", addr,
22426 - smp_processor_id());
22427 - } else {
22428 - /*
22429 - * Prevent overwriting already in-flight context.
22430 - * This should not happen, let's hope disarming at
22431 - * least prevents a panic.
22432 - */
22433 - pr_emerg("kmmio: recursive probe hit on CPU %d, "
22434 + pr_debug("kmmio: duplicate probe hit on CPU %d, for "
22435 + "address 0x%08lx.\n",
22436 + smp_processor_id(), addr);
22437 + ret = 1;
22438 + goto no_kmmio_ctx;
22439 + }
22440 + /*
22441 + * Prevent overwriting already in-flight context.
22442 + * This should not happen, let's hope disarming at least
22443 + * prevents a panic.
22444 + */
22445 + pr_emerg("kmmio: recursive probe hit on CPU %d, "
22446 "for address 0x%08lx. Ignoring.\n",
22447 smp_processor_id(), addr);
22448 - pr_emerg("kmmio: previous hit was at 0x%08lx.\n",
22449 - ctx->addr);
22450 - disarm_kmmio_fault_page(faultpage);
22451 - }
22452 + pr_emerg("kmmio: previous hit was at 0x%08lx.\n",
22453 + ctx->addr);
22454 goto no_kmmio_ctx;
22455 }
22456 ctx->active++;
22457 @@ -279,7 +244,7 @@
22458 regs->flags &= ~X86_EFLAGS_IF;
22459
22460 /* Now we set present bit in PTE and single step. */
22461 - disarm_kmmio_fault_page(ctx->fpage);
22462 + disarm_kmmio_fault_page(ctx->fpage->page, NULL);
22463
22464 /*
22465 * If another cpu accesses the same page while we are stepping,
22466 @@ -310,7 +275,7 @@
22467 struct kmmio_context *ctx = &get_cpu_var(kmmio_ctx);
22468
22469 if (!ctx->active) {
22470 - pr_warning("kmmio: spurious debug trap on CPU %d.\n",
22471 + pr_debug("kmmio: spurious debug trap on CPU %d.\n",
22472 smp_processor_id());
22473 goto out;
22474 }
22475 @@ -318,11 +283,7 @@
22476 if (ctx->probe && ctx->probe->post_handler)
22477 ctx->probe->post_handler(ctx->probe, condition, regs);
22478
22479 - /* Prevent racing against release_kmmio_fault_page(). */
22480 - spin_lock(&kmmio_lock);
22481 - if (ctx->fpage->count)
22482 - arm_kmmio_fault_page(ctx->fpage);
22483 - spin_unlock(&kmmio_lock);
22484 + arm_kmmio_fault_page(ctx->fpage->page, NULL);
22485
22486 regs->flags &= ~X86_EFLAGS_TF;
22487 regs->flags |= ctx->saved_flags;
22488 @@ -354,25 +315,21 @@
22489 f = get_kmmio_fault_page(page);
22490 if (f) {
22491 if (!f->count)
22492 - arm_kmmio_fault_page(f);
22493 + arm_kmmio_fault_page(f->page, NULL);
22494 f->count++;
22495 return 0;
22496 }
22497
22498 - f = kzalloc(sizeof(*f), GFP_ATOMIC);
22499 + f = kmalloc(sizeof(*f), GFP_ATOMIC);
22500 if (!f)
22501 return -1;
22502
22503 f->count = 1;
22504 f->page = page;
22505 -
22506 - if (arm_kmmio_fault_page(f)) {
22507 - kfree(f);
22508 - return -1;
22509 - }
22510 -
22511 list_add_rcu(&f->list, kmmio_page_list(f->page));
22512
22513 + arm_kmmio_fault_page(f->page, NULL);
22514 +
22515 return 0;
22516 }
22517
22518 @@ -390,7 +347,7 @@
22519 f->count--;
22520 BUG_ON(f->count < 0);
22521 if (!f->count) {
22522 - disarm_kmmio_fault_page(f);
22523 + disarm_kmmio_fault_page(f->page, NULL);
22524 f->release_next = *release_list;
22525 *release_list = f;
22526 }
22527 @@ -451,24 +408,23 @@
22528
22529 static void remove_kmmio_fault_pages(struct rcu_head *head)
22530 {
22531 - struct kmmio_delayed_release *dr =
22532 - container_of(head, struct kmmio_delayed_release, rcu);
22533 + struct kmmio_delayed_release *dr = container_of(
22534 + head,
22535 + struct kmmio_delayed_release,
22536 + rcu);
22537 struct kmmio_fault_page *p = dr->release_list;
22538 struct kmmio_fault_page **prevp = &dr->release_list;
22539 unsigned long flags;
22540 -
22541 spin_lock_irqsave(&kmmio_lock, flags);
22542 while (p) {
22543 - if (!p->count) {
22544 + if (!p->count)
22545 list_del_rcu(&p->list);
22546 - prevp = &p->release_next;
22547 - } else {
22548 + else
22549 *prevp = p->release_next;
22550 - }
22551 + prevp = &p->release_next;
22552 p = p->release_next;
22553 }
22554 spin_unlock_irqrestore(&kmmio_lock, flags);
22555 -
22556 /* This is the real RCU destroy call. */
22557 call_rcu(&dr->rcu, rcu_free_kmmio_fault_pages);
22558 }
22559 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/mm/numa_64.c linux-2.6.29-rc3.owrt/arch/x86/mm/numa_64.c
22560 --- linux-2.6.29.owrt/arch/x86/mm/numa_64.c 2009-05-10 22:04:41.000000000 +0200
22561 +++ linux-2.6.29-rc3.owrt/arch/x86/mm/numa_64.c 2009-05-10 23:48:28.000000000 +0200
22562 @@ -145,7 +145,7 @@
22563 return shift;
22564 }
22565
22566 -int __meminit __early_pfn_to_nid(unsigned long pfn)
22567 +int early_pfn_to_nid(unsigned long pfn)
22568 {
22569 return phys_to_nid(pfn << PAGE_SHIFT);
22570 }
22571 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/mm/pageattr.c linux-2.6.29-rc3.owrt/arch/x86/mm/pageattr.c
22572 --- linux-2.6.29.owrt/arch/x86/mm/pageattr.c 2009-05-10 22:04:41.000000000 +0200
22573 +++ linux-2.6.29-rc3.owrt/arch/x86/mm/pageattr.c 2009-05-10 23:48:28.000000000 +0200
22574 @@ -508,24 +508,18 @@
22575 #endif
22576
22577 /*
22578 - * Install the new, split up pagetable.
22579 + * Install the new, split up pagetable. Important details here:
22580 *
22581 - * We use the standard kernel pagetable protections for the new
22582 - * pagetable protections, the actual ptes set above control the
22583 - * primary protection behavior:
22584 - */
22585 - __set_pmd_pte(kpte, address, mk_pte(base, __pgprot(_KERNPG_TABLE)));
22586 -
22587 - /*
22588 - * Intel Atom errata AAH41 workaround.
22589 + * On Intel the NX bit of all levels must be cleared to make a
22590 + * page executable. See section 4.13.2 of Intel 64 and IA-32
22591 + * Architectures Software Developer's Manual).
22592 *
22593 - * The real fix should be in hw or in a microcode update, but
22594 - * we also probabilistically try to reduce the window of having
22595 - * a large TLB mixed with 4K TLBs while instruction fetches are
22596 - * going on.
22597 + * Mark the entry present. The current mapping might be
22598 + * set to not present, which we preserved above.
22599 */
22600 - __flush_tlb_all();
22601 -
22602 + ref_prot = pte_pgprot(pte_mkexec(pte_clrhuge(*kpte)));
22603 + pgprot_val(ref_prot) |= _PAGE_PRESENT;
22604 + __set_pmd_pte(kpte, address, mk_pte(base, ref_prot));
22605 base = NULL;
22606
22607 out_unlock:
22608 @@ -581,6 +575,7 @@
22609 address = cpa->vaddr[cpa->curpage];
22610 else
22611 address = *cpa->vaddr;
22612 +
22613 repeat:
22614 kpte = lookup_address(address, &level);
22615 if (!kpte)
22616 @@ -817,13 +812,6 @@
22617
22618 vm_unmap_aliases();
22619
22620 - /*
22621 - * If we're called with lazy mmu updates enabled, the
22622 - * in-memory pte state may be stale. Flush pending updates to
22623 - * bring them up to date.
22624 - */
22625 - arch_flush_lazy_mmu_mode();
22626 -
22627 cpa.vaddr = addr;
22628 cpa.numpages = numpages;
22629 cpa.mask_set = mask_set;
22630 @@ -866,13 +854,6 @@
22631 } else
22632 cpa_flush_all(cache);
22633
22634 - /*
22635 - * If we've been called with lazy mmu updates enabled, then
22636 - * make sure that everything gets flushed out before we
22637 - * return.
22638 - */
22639 - arch_flush_lazy_mmu_mode();
22640 -
22641 out:
22642 return ret;
22643 }
22644 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/mm/pat.c linux-2.6.29-rc3.owrt/arch/x86/mm/pat.c
22645 --- linux-2.6.29.owrt/arch/x86/mm/pat.c 2009-05-10 22:04:41.000000000 +0200
22646 +++ linux-2.6.29-rc3.owrt/arch/x86/mm/pat.c 2009-05-10 23:48:28.000000000 +0200
22647 @@ -11,7 +11,6 @@
22648 #include <linux/bootmem.h>
22649 #include <linux/debugfs.h>
22650 #include <linux/kernel.h>
22651 -#include <linux/module.h>
22652 #include <linux/gfp.h>
22653 #include <linux/mm.h>
22654 #include <linux/fs.h>
22655 @@ -212,33 +211,6 @@
22656 static struct memtype *cached_entry;
22657 static u64 cached_start;
22658
22659 -static int pat_pagerange_is_ram(unsigned long start, unsigned long end)
22660 -{
22661 - int ram_page = 0, not_rampage = 0;
22662 - unsigned long page_nr;
22663 -
22664 - for (page_nr = (start >> PAGE_SHIFT); page_nr < (end >> PAGE_SHIFT);
22665 - ++page_nr) {
22666 - /*
22667 - * For legacy reasons, physical address range in the legacy ISA
22668 - * region is tracked as non-RAM. This will allow users of
22669 - * /dev/mem to map portions of legacy ISA region, even when
22670 - * some of those portions are listed(or not even listed) with
22671 - * different e820 types(RAM/reserved/..)
22672 - */
22673 - if (page_nr >= (ISA_END_ADDRESS >> PAGE_SHIFT) &&
22674 - page_is_ram(page_nr))
22675 - ram_page = 1;
22676 - else
22677 - not_rampage = 1;
22678 -
22679 - if (ram_page == not_rampage)
22680 - return -1;
22681 - }
22682 -
22683 - return ram_page;
22684 -}
22685 -
22686 /*
22687 * For RAM pages, mark the pages as non WB memory type using
22688 * PageNonWB (PG_arch_1). We allow only one set_memory_uc() or
22689 @@ -364,12 +336,20 @@
22690 if (new_type)
22691 *new_type = actual_type;
22692
22693 - is_range_ram = pat_pagerange_is_ram(start, end);
22694 - if (is_range_ram == 1)
22695 - return reserve_ram_pages_type(start, end, req_type,
22696 - new_type);
22697 - else if (is_range_ram < 0)
22698 - return -EINVAL;
22699 + /*
22700 + * For legacy reasons, some parts of the physical address range in the
22701 + * legacy 1MB region is treated as non-RAM (even when listed as RAM in
22702 + * the e820 tables). So we will track the memory attributes of this
22703 + * legacy 1MB region using the linear memtype_list always.
22704 + */
22705 + if (end >= ISA_END_ADDRESS) {
22706 + is_range_ram = pagerange_is_ram(start, end);
22707 + if (is_range_ram == 1)
22708 + return reserve_ram_pages_type(start, end, req_type,
22709 + new_type);
22710 + else if (is_range_ram < 0)
22711 + return -EINVAL;
22712 + }
22713
22714 new = kmalloc(sizeof(struct memtype), GFP_KERNEL);
22715 if (!new)
22716 @@ -466,11 +446,19 @@
22717 if (is_ISA_range(start, end - 1))
22718 return 0;
22719
22720 - is_range_ram = pat_pagerange_is_ram(start, end);
22721 - if (is_range_ram == 1)
22722 - return free_ram_pages_type(start, end);
22723 - else if (is_range_ram < 0)
22724 - return -EINVAL;
22725 + /*
22726 + * For legacy reasons, some parts of the physical address range in the
22727 + * legacy 1MB region is treated as non-RAM (even when listed as RAM in
22728 + * the e820 tables). So we will track the memory attributes of this
22729 + * legacy 1MB region using the linear memtype_list always.
22730 + */
22731 + if (end >= ISA_END_ADDRESS) {
22732 + is_range_ram = pagerange_is_ram(start, end);
22733 + if (is_range_ram == 1)
22734 + return free_ram_pages_type(start, end);
22735 + else if (is_range_ram < 0)
22736 + return -EINVAL;
22737 + }
22738
22739 spin_lock(&memtype_lock);
22740 list_for_each_entry(entry, &memtype_list, nd) {
22741 @@ -638,13 +626,17 @@
22742 unsigned long flags;
22743 unsigned long want_flags = (pgprot_val(*vma_prot) & _PAGE_CACHE_MASK);
22744
22745 - is_ram = pat_pagerange_is_ram(paddr, paddr + size);
22746 + is_ram = pagerange_is_ram(paddr, paddr + size);
22747
22748 - /*
22749 - * reserve_pfn_range() doesn't support RAM pages.
22750 - */
22751 - if (is_ram != 0)
22752 - return -EINVAL;
22753 + if (is_ram != 0) {
22754 + /*
22755 + * For mapping RAM pages, drivers need to call
22756 + * set_memory_[uc|wc|wb] directly, for reserve and free, before
22757 + * setting up the PTE.
22758 + */
22759 + WARN_ON_ONCE(1);
22760 + return 0;
22761 + }
22762
22763 ret = reserve_memtype(paddr, paddr + size, want_flags, &flags);
22764 if (ret)
22765 @@ -701,7 +693,7 @@
22766 {
22767 int is_ram;
22768
22769 - is_ram = pat_pagerange_is_ram(paddr, paddr + size);
22770 + is_ram = pagerange_is_ram(paddr, paddr + size);
22771 if (is_ram == 0)
22772 free_memtype(paddr, paddr + size);
22773 }
22774 @@ -869,7 +861,6 @@
22775 else
22776 return pgprot_noncached(prot);
22777 }
22778 -EXPORT_SYMBOL_GPL(pgprot_writecombine);
22779
22780 #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_X86_PAT)
22781
22782 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/mm/testmmiotrace.c linux-2.6.29-rc3.owrt/arch/x86/mm/testmmiotrace.c
22783 --- linux-2.6.29.owrt/arch/x86/mm/testmmiotrace.c 2009-05-10 22:04:41.000000000 +0200
22784 +++ linux-2.6.29-rc3.owrt/arch/x86/mm/testmmiotrace.c 2009-05-10 23:48:28.000000000 +0200
22785 @@ -1,5 +1,5 @@
22786 /*
22787 - * Written by Pekka Paalanen, 2008-2009 <pq@iki.fi>
22788 + * Written by Pekka Paalanen, 2008 <pq@iki.fi>
22789 */
22790 #include <linux/module.h>
22791 #include <linux/io.h>
22792 @@ -9,74 +9,35 @@
22793
22794 static unsigned long mmio_address;
22795 module_param(mmio_address, ulong, 0);
22796 -MODULE_PARM_DESC(mmio_address, " Start address of the mapping of 16 kB "
22797 - "(or 8 MB if read_far is non-zero).");
22798 -
22799 -static unsigned long read_far = 0x400100;
22800 -module_param(read_far, ulong, 0);
22801 -MODULE_PARM_DESC(read_far, " Offset of a 32-bit read within 8 MB "
22802 - "(default: 0x400100).");
22803 -
22804 -static unsigned v16(unsigned i)
22805 -{
22806 - return i * 12 + 7;
22807 -}
22808 -
22809 -static unsigned v32(unsigned i)
22810 -{
22811 - return i * 212371 + 13;
22812 -}
22813 +MODULE_PARM_DESC(mmio_address, "Start address of the mapping of 16 kB.");
22814
22815 static void do_write_test(void __iomem *p)
22816 {
22817 unsigned int i;
22818 - pr_info(MODULE_NAME ": write test.\n");
22819 mmiotrace_printk("Write test.\n");
22820 -
22821 for (i = 0; i < 256; i++)
22822 iowrite8(i, p + i);
22823 -
22824 for (i = 1024; i < (5 * 1024); i += 2)
22825 - iowrite16(v16(i), p + i);
22826 -
22827 + iowrite16(i * 12 + 7, p + i);
22828 for (i = (5 * 1024); i < (16 * 1024); i += 4)
22829 - iowrite32(v32(i), p + i);
22830 + iowrite32(i * 212371 + 13, p + i);
22831 }
22832
22833 static void do_read_test(void __iomem *p)
22834 {
22835 unsigned int i;
22836 - unsigned errs[3] = { 0 };
22837 - pr_info(MODULE_NAME ": read test.\n");
22838 mmiotrace_printk("Read test.\n");
22839 -
22840 for (i = 0; i < 256; i++)
22841 - if (ioread8(p + i) != i)
22842 - ++errs[0];
22843 -
22844 + ioread8(p + i);
22845 for (i = 1024; i < (5 * 1024); i += 2)
22846 - if (ioread16(p + i) != v16(i))
22847 - ++errs[1];
22848 -
22849 + ioread16(p + i);
22850 for (i = (5 * 1024); i < (16 * 1024); i += 4)
22851 - if (ioread32(p + i) != v32(i))
22852 - ++errs[2];
22853 -
22854 - mmiotrace_printk("Read errors: 8-bit %d, 16-bit %d, 32-bit %d.\n",
22855 - errs[0], errs[1], errs[2]);
22856 + ioread32(p + i);
22857 }
22858
22859 -static void do_read_far_test(void __iomem *p)
22860 +static void do_test(void)
22861 {
22862 - pr_info(MODULE_NAME ": read far test.\n");
22863 - mmiotrace_printk("Read far test.\n");
22864 -
22865 - ioread32(p + read_far);
22866 -}
22867 -
22868 -static void do_test(unsigned long size)
22869 -{
22870 - void __iomem *p = ioremap_nocache(mmio_address, size);
22871 + void __iomem *p = ioremap_nocache(mmio_address, 0x4000);
22872 if (!p) {
22873 pr_err(MODULE_NAME ": could not ioremap, aborting.\n");
22874 return;
22875 @@ -84,15 +45,11 @@
22876 mmiotrace_printk("ioremap returned %p.\n", p);
22877 do_write_test(p);
22878 do_read_test(p);
22879 - if (read_far && read_far < size - 4)
22880 - do_read_far_test(p);
22881 iounmap(p);
22882 }
22883
22884 static int __init init(void)
22885 {
22886 - unsigned long size = (read_far) ? (8 << 20) : (16 << 10);
22887 -
22888 if (mmio_address == 0) {
22889 pr_err(MODULE_NAME ": you have to use the module argument "
22890 "mmio_address.\n");
22891 @@ -101,11 +58,10 @@
22892 return -ENXIO;
22893 }
22894
22895 - pr_warning(MODULE_NAME ": WARNING: mapping %lu kB @ 0x%08lx in PCI "
22896 - "address space, and writing 16 kB of rubbish in there.\n",
22897 - size >> 10, mmio_address);
22898 - do_test(size);
22899 - pr_info(MODULE_NAME ": All done.\n");
22900 + pr_warning(MODULE_NAME ": WARNING: mapping 16 kB @ 0x%08lx "
22901 + "in PCI address space, and writing "
22902 + "rubbish in there.\n", mmio_address);
22903 + do_test();
22904 return 0;
22905 }
22906
22907 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/oprofile/op_model_ppro.c linux-2.6.29-rc3.owrt/arch/x86/oprofile/op_model_ppro.c
22908 --- linux-2.6.29.owrt/arch/x86/oprofile/op_model_ppro.c 2009-05-10 22:04:41.000000000 +0200
22909 +++ linux-2.6.29-rc3.owrt/arch/x86/oprofile/op_model_ppro.c 2009-05-10 23:48:28.000000000 +0200
22910 @@ -78,18 +78,8 @@
22911 if (cpu_has_arch_perfmon) {
22912 union cpuid10_eax eax;
22913 eax.full = cpuid_eax(0xa);
22914 -
22915 - /*
22916 - * For Core2 (family 6, model 15), don't reset the
22917 - * counter width:
22918 - */
22919 - if (!(eax.split.version_id == 0 &&
22920 - current_cpu_data.x86 == 6 &&
22921 - current_cpu_data.x86_model == 15)) {
22922 -
22923 - if (counter_width < eax.split.bit_width)
22924 - counter_width = eax.split.bit_width;
22925 - }
22926 + if (counter_width < eax.split.bit_width)
22927 + counter_width = eax.split.bit_width;
22928 }
22929
22930 /* clear all counters */
22931 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/pci/irq.c linux-2.6.29-rc3.owrt/arch/x86/pci/irq.c
22932 --- linux-2.6.29.owrt/arch/x86/pci/irq.c 2009-05-10 22:04:41.000000000 +0200
22933 +++ linux-2.6.29-rc3.owrt/arch/x86/pci/irq.c 2009-05-10 23:48:28.000000000 +0200
22934 @@ -572,7 +572,6 @@
22935 case PCI_DEVICE_ID_INTEL_ICH7_1:
22936 case PCI_DEVICE_ID_INTEL_ICH7_30:
22937 case PCI_DEVICE_ID_INTEL_ICH7_31:
22938 - case PCI_DEVICE_ID_INTEL_TGP_LPC:
22939 case PCI_DEVICE_ID_INTEL_ESB2_0:
22940 case PCI_DEVICE_ID_INTEL_ICH8_0:
22941 case PCI_DEVICE_ID_INTEL_ICH8_1:
22942 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/xen/enlighten.c linux-2.6.29-rc3.owrt/arch/x86/xen/enlighten.c
22943 --- linux-2.6.29.owrt/arch/x86/xen/enlighten.c 2009-05-10 22:04:41.000000000 +0200
22944 +++ linux-2.6.29-rc3.owrt/arch/x86/xen/enlighten.c 2009-05-10 23:48:28.000000000 +0200
22945 @@ -1672,9 +1672,6 @@
22946 possible map and a non-dummy shared_info. */
22947 per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0];
22948
22949 - local_irq_disable();
22950 - early_boot_irqs_off();
22951 -
22952 xen_raw_console_write("mapping kernel into physical memory\n");
22953 pgd = xen_setup_kernel_pagetable(pgd, xen_start_info->nr_pages);
22954
22955 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/x86/xen/multicalls.h linux-2.6.29-rc3.owrt/arch/x86/xen/multicalls.h
22956 --- linux-2.6.29.owrt/arch/x86/xen/multicalls.h 2009-05-10 22:04:41.000000000 +0200
22957 +++ linux-2.6.29-rc3.owrt/arch/x86/xen/multicalls.h 2009-05-10 23:48:28.000000000 +0200
22958 @@ -19,10 +19,8 @@
22959 paired with xen_mc_issue() */
22960 static inline void xen_mc_batch(void)
22961 {
22962 - unsigned long flags;
22963 /* need to disable interrupts until this entry is complete */
22964 - local_irq_save(flags);
22965 - __get_cpu_var(xen_mc_irq_flags) = flags;
22966 + local_irq_save(__get_cpu_var(xen_mc_irq_flags));
22967 }
22968
22969 static inline struct multicall_space xen_mc_entry(size_t args)
22970 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/xtensa/Kconfig linux-2.6.29-rc3.owrt/arch/xtensa/Kconfig
22971 --- linux-2.6.29.owrt/arch/xtensa/Kconfig 2009-05-10 22:04:41.000000000 +0200
22972 +++ linux-2.6.29-rc3.owrt/arch/xtensa/Kconfig 2009-05-10 23:48:28.000000000 +0200
22973 @@ -103,6 +103,9 @@
22974 help
22975 Can we use information of configuration file?
22976
22977 +config HIGHMEM
22978 + bool "High memory support"
22979 +
22980 endmenu
22981
22982 menu "Platform options"
22983 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/xtensa/kernel/setup.c linux-2.6.29-rc3.owrt/arch/xtensa/kernel/setup.c
22984 --- linux-2.6.29.owrt/arch/xtensa/kernel/setup.c 2009-05-10 22:04:41.000000000 +0200
22985 +++ linux-2.6.29-rc3.owrt/arch/xtensa/kernel/setup.c 2009-05-10 23:48:28.000000000 +0200
22986 @@ -44,8 +44,6 @@
22987 #include <asm/setup.h>
22988 #include <asm/param.h>
22989
22990 -#include <platform/hardware.h>
22991 -
22992 #if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE)
22993 struct screen_info screen_info = { 0, 24, 0, 0, 0, 80, 0, 0, 0, 24, 1, 16};
22994 #endif
22995 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/xtensa/kernel/traps.c linux-2.6.29-rc3.owrt/arch/xtensa/kernel/traps.c
22996 --- linux-2.6.29.owrt/arch/xtensa/kernel/traps.c 2009-05-10 22:04:41.000000000 +0200
22997 +++ linux-2.6.29-rc3.owrt/arch/xtensa/kernel/traps.c 2009-05-10 23:48:28.000000000 +0200
22998 @@ -30,7 +30,6 @@
22999 #include <linux/stringify.h>
23000 #include <linux/kallsyms.h>
23001 #include <linux/delay.h>
23002 -#include <linux/hardirq.h>
23003
23004 #include <asm/ptrace.h>
23005 #include <asm/timex.h>
23006 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/xtensa/mm/fault.c linux-2.6.29-rc3.owrt/arch/xtensa/mm/fault.c
23007 --- linux-2.6.29.owrt/arch/xtensa/mm/fault.c 2009-05-10 22:04:41.000000000 +0200
23008 +++ linux-2.6.29-rc3.owrt/arch/xtensa/mm/fault.c 2009-05-10 23:48:28.000000000 +0200
23009 @@ -14,7 +14,6 @@
23010
23011 #include <linux/mm.h>
23012 #include <linux/module.h>
23013 -#include <linux/hardirq.h>
23014 #include <asm/mmu_context.h>
23015 #include <asm/cacheflush.h>
23016 #include <asm/hardirq.h>
23017 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/arch/xtensa/platforms/iss/console.c linux-2.6.29-rc3.owrt/arch/xtensa/platforms/iss/console.c
23018 --- linux-2.6.29.owrt/arch/xtensa/platforms/iss/console.c 2009-05-10 22:04:41.000000000 +0200
23019 +++ linux-2.6.29-rc3.owrt/arch/xtensa/platforms/iss/console.c 2009-05-10 23:48:28.000000000 +0200
23020 @@ -140,14 +140,16 @@
23021 }
23022
23023
23024 -static int rs_put_char(struct tty_struct *tty, unsigned char ch)
23025 +static void rs_put_char(struct tty_struct *tty, unsigned char ch)
23026 {
23027 char buf[2];
23028
23029 + if (!tty)
23030 + return;
23031 +
23032 buf[0] = ch;
23033 buf[1] = '\0'; /* Is this NULL necessary? */
23034 __simc (SYS_write, 1, (unsigned long) buf, 1, 0, 0);
23035 - return 1;
23036 }
23037
23038 static void rs_flush_chars(struct tty_struct *tty)
23039 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/block/blk-barrier.c linux-2.6.29-rc3.owrt/block/blk-barrier.c
23040 --- linux-2.6.29.owrt/block/blk-barrier.c 2009-05-10 22:04:39.000000000 +0200
23041 +++ linux-2.6.29-rc3.owrt/block/blk-barrier.c 2009-05-10 23:48:28.000000000 +0200
23042 @@ -302,7 +302,7 @@
23043 * Description:
23044 * Issue a flush for the block device in question. Caller can supply
23045 * room for storing the error offset in case of a flush error, if they
23046 - * wish to.
23047 + * wish to. Caller must run wait_for_completion() on its own.
23048 */
23049 int blkdev_issue_flush(struct block_device *bdev, sector_t *error_sector)
23050 {
23051 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/block/blk-core.c linux-2.6.29-rc3.owrt/block/blk-core.c
23052 --- linux-2.6.29.owrt/block/blk-core.c 2009-05-10 22:04:39.000000000 +0200
23053 +++ linux-2.6.29-rc3.owrt/block/blk-core.c 2009-05-10 23:48:28.000000000 +0200
23054 @@ -64,12 +64,11 @@
23055
23056 static void drive_stat_acct(struct request *rq, int new_io)
23057 {
23058 - struct gendisk *disk = rq->rq_disk;
23059 struct hd_struct *part;
23060 int rw = rq_data_dir(rq);
23061 int cpu;
23062
23063 - if (!blk_fs_request(rq) || !disk || !blk_do_io_stat(disk->queue))
23064 + if (!blk_fs_request(rq) || !rq->rq_disk)
23065 return;
23066
23067 cpu = part_stat_lock();
23068 @@ -600,7 +599,8 @@
23069 q->request_fn = rfn;
23070 q->prep_rq_fn = NULL;
23071 q->unplug_fn = generic_unplug_device;
23072 - q->queue_flags = QUEUE_FLAG_DEFAULT;
23073 + q->queue_flags = (1 << QUEUE_FLAG_CLUSTER |
23074 + 1 << QUEUE_FLAG_STACKABLE);
23075 q->queue_lock = lock;
23076
23077 blk_queue_segment_boundary(q, BLK_SEG_BOUNDARY_MASK);
23078 @@ -1125,8 +1125,6 @@
23079
23080 if (bio_sync(bio))
23081 req->cmd_flags |= REQ_RW_SYNC;
23082 - if (bio_unplug(bio))
23083 - req->cmd_flags |= REQ_UNPLUG;
23084 if (bio_rw_meta(bio))
23085 req->cmd_flags |= REQ_RW_META;
23086
23087 @@ -1143,7 +1141,6 @@
23088 int el_ret, nr_sectors;
23089 const unsigned short prio = bio_prio(bio);
23090 const int sync = bio_sync(bio);
23091 - const int unplug = bio_unplug(bio);
23092 int rw_flags;
23093
23094 nr_sectors = bio_sectors(bio);
23095 @@ -1247,7 +1244,7 @@
23096 blk_plug_device(q);
23097 add_request(q, req);
23098 out:
23099 - if (unplug || blk_queue_nonrot(q))
23100 + if (sync || blk_queue_nonrot(q))
23101 __generic_unplug_device(q);
23102 spin_unlock_irq(q->queue_lock);
23103 return 0;
23104 @@ -1451,11 +1448,6 @@
23105 err = -EOPNOTSUPP;
23106 goto end_io;
23107 }
23108 - if (bio_barrier(bio) && bio_has_data(bio) &&
23109 - (q->next_ordered == QUEUE_ORDERED_NONE)) {
23110 - err = -EOPNOTSUPP;
23111 - goto end_io;
23112 - }
23113
23114 ret = q->make_request_fn(q, bio);
23115 } while (ret);
23116 @@ -1663,55 +1655,6 @@
23117 }
23118 EXPORT_SYMBOL(blkdev_dequeue_request);
23119
23120 -static void blk_account_io_completion(struct request *req, unsigned int bytes)
23121 -{
23122 - struct gendisk *disk = req->rq_disk;
23123 -
23124 - if (!disk || !blk_do_io_stat(disk->queue))
23125 - return;
23126 -
23127 - if (blk_fs_request(req)) {
23128 - const int rw = rq_data_dir(req);
23129 - struct hd_struct *part;
23130 - int cpu;
23131 -
23132 - cpu = part_stat_lock();
23133 - part = disk_map_sector_rcu(req->rq_disk, req->sector);
23134 - part_stat_add(cpu, part, sectors[rw], bytes >> 9);
23135 - part_stat_unlock();
23136 - }
23137 -}
23138 -
23139 -static void blk_account_io_done(struct request *req)
23140 -{
23141 - struct gendisk *disk = req->rq_disk;
23142 -
23143 - if (!disk || !blk_do_io_stat(disk->queue))
23144 - return;
23145 -
23146 - /*
23147 - * Account IO completion. bar_rq isn't accounted as a normal
23148 - * IO on queueing nor completion. Accounting the containing
23149 - * request is enough.
23150 - */
23151 - if (blk_fs_request(req) && req != &req->q->bar_rq) {
23152 - unsigned long duration = jiffies - req->start_time;
23153 - const int rw = rq_data_dir(req);
23154 - struct hd_struct *part;
23155 - int cpu;
23156 -
23157 - cpu = part_stat_lock();
23158 - part = disk_map_sector_rcu(disk, req->sector);
23159 -
23160 - part_stat_inc(cpu, part, ios[rw]);
23161 - part_stat_add(cpu, part, ticks[rw], duration);
23162 - part_round_stats(cpu, part);
23163 - part_dec_in_flight(part);
23164 -
23165 - part_stat_unlock();
23166 - }
23167 -}
23168 -
23169 /**
23170 * __end_that_request_first - end I/O on a request
23171 * @req: the request being processed
23172 @@ -1747,7 +1690,16 @@
23173 (unsigned long long)req->sector);
23174 }
23175
23176 - blk_account_io_completion(req, nr_bytes);
23177 + if (blk_fs_request(req) && req->rq_disk) {
23178 + const int rw = rq_data_dir(req);
23179 + struct hd_struct *part;
23180 + int cpu;
23181 +
23182 + cpu = part_stat_lock();
23183 + part = disk_map_sector_rcu(req->rq_disk, req->sector);
23184 + part_stat_add(cpu, part, sectors[rw], nr_bytes >> 9);
23185 + part_stat_unlock();
23186 + }
23187
23188 total_bytes = bio_nbytes = 0;
23189 while ((bio = req->bio) != NULL) {
23190 @@ -1827,6 +1779,8 @@
23191 */
23192 static void end_that_request_last(struct request *req, int error)
23193 {
23194 + struct gendisk *disk = req->rq_disk;
23195 +
23196 if (blk_rq_tagged(req))
23197 blk_queue_end_tag(req->q, req);
23198
23199 @@ -1838,7 +1792,27 @@
23200
23201 blk_delete_timer(req);
23202
23203 - blk_account_io_done(req);
23204 + /*
23205 + * Account IO completion. bar_rq isn't accounted as a normal
23206 + * IO on queueing nor completion. Accounting the containing
23207 + * request is enough.
23208 + */
23209 + if (disk && blk_fs_request(req) && req != &req->q->bar_rq) {
23210 + unsigned long duration = jiffies - req->start_time;
23211 + const int rw = rq_data_dir(req);
23212 + struct hd_struct *part;
23213 + int cpu;
23214 +
23215 + cpu = part_stat_lock();
23216 + part = disk_map_sector_rcu(disk, req->sector);
23217 +
23218 + part_stat_inc(cpu, part, ios[rw]);
23219 + part_stat_add(cpu, part, ticks[rw], duration);
23220 + part_round_stats(cpu, part);
23221 + part_dec_in_flight(part);
23222 +
23223 + part_stat_unlock();
23224 + }
23225
23226 if (req->end_io)
23227 req->end_io(req, error);
23228 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/block/blk.h linux-2.6.29-rc3.owrt/block/blk.h
23229 --- linux-2.6.29.owrt/block/blk.h 2009-05-10 22:04:39.000000000 +0200
23230 +++ linux-2.6.29-rc3.owrt/block/blk.h 2009-05-10 23:48:28.000000000 +0200
23231 @@ -108,12 +108,4 @@
23232 #endif
23233 }
23234
23235 -static inline int blk_do_io_stat(struct request_queue *q)
23236 -{
23237 - if (q)
23238 - return blk_queue_io_stat(q);
23239 -
23240 - return 0;
23241 -}
23242 -
23243 #endif
23244 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/block/blk-integrity.c linux-2.6.29-rc3.owrt/block/blk-integrity.c
23245 --- linux-2.6.29.owrt/block/blk-integrity.c 2009-05-10 22:04:39.000000000 +0200
23246 +++ linux-2.6.29-rc3.owrt/block/blk-integrity.c 2009-05-10 23:48:28.000000000 +0200
23247 @@ -309,24 +309,24 @@
23248 /**
23249 * blk_integrity_register - Register a gendisk as being integrity-capable
23250 * @disk: struct gendisk pointer to make integrity-aware
23251 - * @template: optional integrity profile to register
23252 + * @template: integrity profile
23253 *
23254 * Description: When a device needs to advertise itself as being able
23255 * to send/receive integrity metadata it must use this function to
23256 * register the capability with the block layer. The template is a
23257 * blk_integrity struct with values appropriate for the underlying
23258 - * hardware. If template is NULL the new profile is allocated but
23259 - * not filled out. See Documentation/block/data-integrity.txt.
23260 + * hardware. See Documentation/block/data-integrity.txt.
23261 */
23262 int blk_integrity_register(struct gendisk *disk, struct blk_integrity *template)
23263 {
23264 struct blk_integrity *bi;
23265
23266 BUG_ON(disk == NULL);
23267 + BUG_ON(template == NULL);
23268
23269 if (disk->integrity == NULL) {
23270 bi = kmem_cache_alloc(integrity_cachep,
23271 - GFP_KERNEL | __GFP_ZERO);
23272 + GFP_KERNEL | __GFP_ZERO);
23273 if (!bi)
23274 return -1;
23275
23276 @@ -346,16 +346,13 @@
23277 bi = disk->integrity;
23278
23279 /* Use the provided profile as template */
23280 - if (template != NULL) {
23281 - bi->name = template->name;
23282 - bi->generate_fn = template->generate_fn;
23283 - bi->verify_fn = template->verify_fn;
23284 - bi->tuple_size = template->tuple_size;
23285 - bi->set_tag_fn = template->set_tag_fn;
23286 - bi->get_tag_fn = template->get_tag_fn;
23287 - bi->tag_size = template->tag_size;
23288 - } else
23289 - bi->name = "unsupported";
23290 + bi->name = template->name;
23291 + bi->generate_fn = template->generate_fn;
23292 + bi->verify_fn = template->verify_fn;
23293 + bi->tuple_size = template->tuple_size;
23294 + bi->set_tag_fn = template->set_tag_fn;
23295 + bi->get_tag_fn = template->get_tag_fn;
23296 + bi->tag_size = template->tag_size;
23297
23298 return 0;
23299 }
23300 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/block/blk-merge.c linux-2.6.29-rc3.owrt/block/blk-merge.c
23301 --- linux-2.6.29.owrt/block/blk-merge.c 2009-05-10 22:04:39.000000000 +0200
23302 +++ linux-2.6.29-rc3.owrt/block/blk-merge.c 2009-05-10 23:48:28.000000000 +0200
23303 @@ -38,77 +38,72 @@
23304 }
23305 }
23306
23307 -static unsigned int __blk_recalc_rq_segments(struct request_queue *q,
23308 - struct bio *bio)
23309 +void blk_recalc_rq_segments(struct request *rq)
23310 {
23311 + int nr_phys_segs;
23312 unsigned int phys_size;
23313 struct bio_vec *bv, *bvprv = NULL;
23314 - int cluster, i, high, highprv = 1;
23315 - unsigned int seg_size, nr_phys_segs;
23316 - struct bio *fbio, *bbio;
23317 + int seg_size;
23318 + int cluster;
23319 + struct req_iterator iter;
23320 + int high, highprv = 1;
23321 + struct request_queue *q = rq->q;
23322
23323 - if (!bio)
23324 - return 0;
23325 + if (!rq->bio)
23326 + return;
23327
23328 - fbio = bio;
23329 cluster = test_bit(QUEUE_FLAG_CLUSTER, &q->queue_flags);
23330 seg_size = 0;
23331 phys_size = nr_phys_segs = 0;
23332 - for_each_bio(bio) {
23333 - bio_for_each_segment(bv, bio, i) {
23334 - /*
23335 - * the trick here is making sure that a high page is
23336 - * never considered part of another segment, since that
23337 - * might change with the bounce page.
23338 - */
23339 - high = page_to_pfn(bv->bv_page) > q->bounce_pfn;
23340 - if (high || highprv)
23341 + rq_for_each_segment(bv, rq, iter) {
23342 + /*
23343 + * the trick here is making sure that a high page is never
23344 + * considered part of another segment, since that might
23345 + * change with the bounce page.
23346 + */
23347 + high = page_to_pfn(bv->bv_page) > q->bounce_pfn;
23348 + if (high || highprv)
23349 + goto new_segment;
23350 + if (cluster) {
23351 + if (seg_size + bv->bv_len > q->max_segment_size)
23352 + goto new_segment;
23353 + if (!BIOVEC_PHYS_MERGEABLE(bvprv, bv))
23354 + goto new_segment;
23355 + if (!BIOVEC_SEG_BOUNDARY(q, bvprv, bv))
23356 goto new_segment;
23357 - if (cluster) {
23358 - if (seg_size + bv->bv_len > q->max_segment_size)
23359 - goto new_segment;
23360 - if (!BIOVEC_PHYS_MERGEABLE(bvprv, bv))
23361 - goto new_segment;
23362 - if (!BIOVEC_SEG_BOUNDARY(q, bvprv, bv))
23363 - goto new_segment;
23364 -
23365 - seg_size += bv->bv_len;
23366 - bvprv = bv;
23367 - continue;
23368 - }
23369 -new_segment:
23370 - if (nr_phys_segs == 1 && seg_size >
23371 - fbio->bi_seg_front_size)
23372 - fbio->bi_seg_front_size = seg_size;
23373
23374 - nr_phys_segs++;
23375 + seg_size += bv->bv_len;
23376 bvprv = bv;
23377 - seg_size = bv->bv_len;
23378 - highprv = high;
23379 + continue;
23380 }
23381 - bbio = bio;
23382 +new_segment:
23383 + if (nr_phys_segs == 1 && seg_size > rq->bio->bi_seg_front_size)
23384 + rq->bio->bi_seg_front_size = seg_size;
23385 +
23386 + nr_phys_segs++;
23387 + bvprv = bv;
23388 + seg_size = bv->bv_len;
23389 + highprv = high;
23390 }
23391
23392 - if (nr_phys_segs == 1 && seg_size > fbio->bi_seg_front_size)
23393 - fbio->bi_seg_front_size = seg_size;
23394 - if (seg_size > bbio->bi_seg_back_size)
23395 - bbio->bi_seg_back_size = seg_size;
23396 + if (nr_phys_segs == 1 && seg_size > rq->bio->bi_seg_front_size)
23397 + rq->bio->bi_seg_front_size = seg_size;
23398 + if (seg_size > rq->biotail->bi_seg_back_size)
23399 + rq->biotail->bi_seg_back_size = seg_size;
23400
23401 - return nr_phys_segs;
23402 -}
23403 -
23404 -void blk_recalc_rq_segments(struct request *rq)
23405 -{
23406 - rq->nr_phys_segments = __blk_recalc_rq_segments(rq->q, rq->bio);
23407 + rq->nr_phys_segments = nr_phys_segs;
23408 }
23409
23410 void blk_recount_segments(struct request_queue *q, struct bio *bio)
23411 {
23412 + struct request rq;
23413 struct bio *nxt = bio->bi_next;
23414 -
23415 + rq.q = q;
23416 + rq.bio = rq.biotail = bio;
23417 bio->bi_next = NULL;
23418 - bio->bi_phys_segments = __blk_recalc_rq_segments(q, bio);
23419 + blk_recalc_rq_segments(&rq);
23420 bio->bi_next = nxt;
23421 + bio->bi_phys_segments = rq.nr_phys_segments;
23422 bio->bi_flags |= (1 << BIO_SEG_VALID);
23423 }
23424 EXPORT_SYMBOL(blk_recount_segments);
23425 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/block/blk-sysfs.c linux-2.6.29-rc3.owrt/block/blk-sysfs.c
23426 --- linux-2.6.29.owrt/block/blk-sysfs.c 2009-05-10 22:04:39.000000000 +0200
23427 +++ linux-2.6.29-rc3.owrt/block/blk-sysfs.c 2009-05-10 23:48:28.000000000 +0200
23428 @@ -130,27 +130,6 @@
23429 return queue_var_show(max_hw_sectors_kb, (page));
23430 }
23431
23432 -static ssize_t queue_nonrot_show(struct request_queue *q, char *page)
23433 -{
23434 - return queue_var_show(!blk_queue_nonrot(q), page);
23435 -}
23436 -
23437 -static ssize_t queue_nonrot_store(struct request_queue *q, const char *page,
23438 - size_t count)
23439 -{
23440 - unsigned long nm;
23441 - ssize_t ret = queue_var_store(&nm, page, count);
23442 -
23443 - spin_lock_irq(q->queue_lock);
23444 - if (nm)
23445 - queue_flag_clear(QUEUE_FLAG_NONROT, q);
23446 - else
23447 - queue_flag_set(QUEUE_FLAG_NONROT, q);
23448 - spin_unlock_irq(q->queue_lock);
23449 -
23450 - return ret;
23451 -}
23452 -
23453 static ssize_t queue_nomerges_show(struct request_queue *q, char *page)
23454 {
23455 return queue_var_show(blk_queue_nomerges(q), page);
23456 @@ -167,8 +146,8 @@
23457 queue_flag_set(QUEUE_FLAG_NOMERGES, q);
23458 else
23459 queue_flag_clear(QUEUE_FLAG_NOMERGES, q);
23460 - spin_unlock_irq(q->queue_lock);
23461
23462 + spin_unlock_irq(q->queue_lock);
23463 return ret;
23464 }
23465
23466 @@ -197,27 +176,6 @@
23467 return ret;
23468 }
23469
23470 -static ssize_t queue_iostats_show(struct request_queue *q, char *page)
23471 -{
23472 - return queue_var_show(blk_queue_io_stat(q), page);
23473 -}
23474 -
23475 -static ssize_t queue_iostats_store(struct request_queue *q, const char *page,
23476 - size_t count)
23477 -{
23478 - unsigned long stats;
23479 - ssize_t ret = queue_var_store(&stats, page, count);
23480 -
23481 - spin_lock_irq(q->queue_lock);
23482 - if (stats)
23483 - queue_flag_set(QUEUE_FLAG_IO_STAT, q);
23484 - else
23485 - queue_flag_clear(QUEUE_FLAG_IO_STAT, q);
23486 - spin_unlock_irq(q->queue_lock);
23487 -
23488 - return ret;
23489 -}
23490 -
23491 static struct queue_sysfs_entry queue_requests_entry = {
23492 .attr = {.name = "nr_requests", .mode = S_IRUGO | S_IWUSR },
23493 .show = queue_requests_show,
23494 @@ -252,12 +210,6 @@
23495 .show = queue_hw_sector_size_show,
23496 };
23497
23498 -static struct queue_sysfs_entry queue_nonrot_entry = {
23499 - .attr = {.name = "rotational", .mode = S_IRUGO | S_IWUSR },
23500 - .show = queue_nonrot_show,
23501 - .store = queue_nonrot_store,
23502 -};
23503 -
23504 static struct queue_sysfs_entry queue_nomerges_entry = {
23505 .attr = {.name = "nomerges", .mode = S_IRUGO | S_IWUSR },
23506 .show = queue_nomerges_show,
23507 @@ -270,12 +222,6 @@
23508 .store = queue_rq_affinity_store,
23509 };
23510
23511 -static struct queue_sysfs_entry queue_iostats_entry = {
23512 - .attr = {.name = "iostats", .mode = S_IRUGO | S_IWUSR },
23513 - .show = queue_iostats_show,
23514 - .store = queue_iostats_store,
23515 -};
23516 -
23517 static struct attribute *default_attrs[] = {
23518 &queue_requests_entry.attr,
23519 &queue_ra_entry.attr,
23520 @@ -283,10 +229,8 @@
23521 &queue_max_sectors_entry.attr,
23522 &queue_iosched_entry.attr,
23523 &queue_hw_sector_size_entry.attr,
23524 - &queue_nonrot_entry.attr,
23525 &queue_nomerges_entry.attr,
23526 &queue_rq_affinity_entry.attr,
23527 - &queue_iostats_entry.attr,
23528 NULL,
23529 };
23530
23531 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/block/blk-timeout.c linux-2.6.29-rc3.owrt/block/blk-timeout.c
23532 --- linux-2.6.29.owrt/block/blk-timeout.c 2009-05-10 22:04:39.000000000 +0200
23533 +++ linux-2.6.29-rc3.owrt/block/blk-timeout.c 2009-05-10 23:48:28.000000000 +0200
23534 @@ -209,19 +209,12 @@
23535 {
23536 unsigned long flags;
23537 struct request *rq, *tmp;
23538 - LIST_HEAD(list);
23539
23540 spin_lock_irqsave(q->queue_lock, flags);
23541
23542 elv_abort_queue(q);
23543
23544 - /*
23545 - * Splice entries to local list, to avoid deadlocking if entries
23546 - * get readded to the timeout list by error handling
23547 - */
23548 - list_splice_init(&q->timeout_list, &list);
23549 -
23550 - list_for_each_entry_safe(rq, tmp, &list, timeout_list)
23551 + list_for_each_entry_safe(rq, tmp, &q->timeout_list, timeout_list)
23552 blk_abort_request(rq);
23553
23554 spin_unlock_irqrestore(q->queue_lock, flags);
23555 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/block/blktrace.c linux-2.6.29-rc3.owrt/block/blktrace.c
23556 --- linux-2.6.29.owrt/block/blktrace.c 2009-05-10 22:04:39.000000000 +0200
23557 +++ linux-2.6.29-rc3.owrt/block/blktrace.c 2009-05-10 23:48:28.000000000 +0200
23558 @@ -142,7 +142,7 @@
23559
23560 what |= ddir_act[rw & WRITE];
23561 what |= MASK_TC_BIT(rw, BARRIER);
23562 - what |= MASK_TC_BIT(rw, SYNCIO);
23563 + what |= MASK_TC_BIT(rw, SYNC);
23564 what |= MASK_TC_BIT(rw, AHEAD);
23565 what |= MASK_TC_BIT(rw, META);
23566 what |= MASK_TC_BIT(rw, DISCARD);
23567 @@ -187,12 +187,59 @@
23568
23569 static struct dentry *blk_tree_root;
23570 static DEFINE_MUTEX(blk_tree_mutex);
23571 +static unsigned int root_users;
23572 +
23573 +static inline void blk_remove_root(void)
23574 +{
23575 + if (blk_tree_root) {
23576 + debugfs_remove(blk_tree_root);
23577 + blk_tree_root = NULL;
23578 + }
23579 +}
23580 +
23581 +static void blk_remove_tree(struct dentry *dir)
23582 +{
23583 + mutex_lock(&blk_tree_mutex);
23584 + debugfs_remove(dir);
23585 + if (--root_users == 0)
23586 + blk_remove_root();
23587 + mutex_unlock(&blk_tree_mutex);
23588 +}
23589 +
23590 +static struct dentry *blk_create_tree(const char *blk_name)
23591 +{
23592 + struct dentry *dir = NULL;
23593 + int created = 0;
23594 +
23595 + mutex_lock(&blk_tree_mutex);
23596 +
23597 + if (!blk_tree_root) {
23598 + blk_tree_root = debugfs_create_dir("block", NULL);
23599 + if (!blk_tree_root)
23600 + goto err;
23601 + created = 1;
23602 + }
23603 +
23604 + dir = debugfs_create_dir(blk_name, blk_tree_root);
23605 + if (dir)
23606 + root_users++;
23607 + else {
23608 + /* Delete root only if we created it */
23609 + if (created)
23610 + blk_remove_root();
23611 + }
23612 +
23613 +err:
23614 + mutex_unlock(&blk_tree_mutex);
23615 + return dir;
23616 +}
23617
23618 static void blk_trace_cleanup(struct blk_trace *bt)
23619 {
23620 + relay_close(bt->rchan);
23621 debugfs_remove(bt->msg_file);
23622 debugfs_remove(bt->dropped_file);
23623 - relay_close(bt->rchan);
23624 + blk_remove_tree(bt->dir);
23625 free_percpu(bt->sequence);
23626 free_percpu(bt->msg_data);
23627 kfree(bt);
23628 @@ -299,18 +346,7 @@
23629
23630 static int blk_remove_buf_file_callback(struct dentry *dentry)
23631 {
23632 - struct dentry *parent = dentry->d_parent;
23633 debugfs_remove(dentry);
23634 -
23635 - /*
23636 - * this will fail for all but the last file, but that is ok. what we
23637 - * care about is the top level buts->name directory going away, when
23638 - * the last trace file is gone. Then we don't have to rmdir() that
23639 - * manually on trace stop, so it nicely solves the issue with
23640 - * force killing of running traces.
23641 - */
23642 -
23643 - debugfs_remove(parent);
23644 return 0;
23645 }
23646
23647 @@ -368,15 +404,7 @@
23648 goto err;
23649
23650 ret = -ENOENT;
23651 -
23652 - if (!blk_tree_root) {
23653 - blk_tree_root = debugfs_create_dir("block", NULL);
23654 - if (!blk_tree_root)
23655 - return -ENOMEM;
23656 - }
23657 -
23658 - dir = debugfs_create_dir(buts->name, blk_tree_root);
23659 -
23660 + dir = blk_create_tree(buts->name);
23661 if (!dir)
23662 goto err;
23663
23664 @@ -430,6 +458,8 @@
23665 atomic_dec(&blk_probes_ref);
23666 mutex_unlock(&blk_probe_mutex);
23667 err:
23668 + if (dir)
23669 + blk_remove_tree(dir);
23670 if (bt) {
23671 if (bt->msg_file)
23672 debugfs_remove(bt->msg_file);
23673 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/block/bsg.c linux-2.6.29-rc3.owrt/block/bsg.c
23674 --- linux-2.6.29.owrt/block/bsg.c 2009-05-10 22:04:39.000000000 +0200
23675 +++ linux-2.6.29-rc3.owrt/block/bsg.c 2009-05-10 23:48:28.000000000 +0200
23676 @@ -244,8 +244,7 @@
23677 * map sg_io_v4 to a request.
23678 */
23679 static struct request *
23680 -bsg_map_hdr(struct bsg_device *bd, struct sg_io_v4 *hdr, fmode_t has_write_perm,
23681 - u8 *sense)
23682 +bsg_map_hdr(struct bsg_device *bd, struct sg_io_v4 *hdr, fmode_t has_write_perm)
23683 {
23684 struct request_queue *q = bd->queue;
23685 struct request *rq, *next_rq = NULL;
23686 @@ -307,10 +306,6 @@
23687 if (ret)
23688 goto out;
23689 }
23690 -
23691 - rq->sense = sense;
23692 - rq->sense_len = 0;
23693 -
23694 return rq;
23695 out:
23696 if (rq->cmd != rq->__cmd)
23697 @@ -353,6 +348,9 @@
23698 static void bsg_add_command(struct bsg_device *bd, struct request_queue *q,
23699 struct bsg_command *bc, struct request *rq)
23700 {
23701 + rq->sense = bc->sense;
23702 + rq->sense_len = 0;
23703 +
23704 /*
23705 * add bc command to busy queue and submit rq for io
23706 */
23707 @@ -421,7 +419,7 @@
23708 {
23709 int ret = 0;
23710
23711 - dprintk("rq %p bio %p 0x%x\n", rq, bio, rq->errors);
23712 + dprintk("rq %p bio %p %u\n", rq, bio, rq->errors);
23713 /*
23714 * fill in all the output members
23715 */
23716 @@ -637,7 +635,7 @@
23717 /*
23718 * get a request, fill in the blanks, and add to request queue
23719 */
23720 - rq = bsg_map_hdr(bd, &bc->hdr, has_write_perm, bc->sense);
23721 + rq = bsg_map_hdr(bd, &bc->hdr, has_write_perm);
23722 if (IS_ERR(rq)) {
23723 ret = PTR_ERR(rq);
23724 rq = NULL;
23725 @@ -924,12 +922,11 @@
23726 struct request *rq;
23727 struct bio *bio, *bidi_bio = NULL;
23728 struct sg_io_v4 hdr;
23729 - u8 sense[SCSI_SENSE_BUFFERSIZE];
23730
23731 if (copy_from_user(&hdr, uarg, sizeof(hdr)))
23732 return -EFAULT;
23733
23734 - rq = bsg_map_hdr(bd, &hdr, file->f_mode & FMODE_WRITE, sense);
23735 + rq = bsg_map_hdr(bd, &hdr, file->f_mode & FMODE_WRITE);
23736 if (IS_ERR(rq))
23737 return PTR_ERR(rq);
23738
23739 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/block/cfq-iosched.c linux-2.6.29-rc3.owrt/block/cfq-iosched.c
23740 --- linux-2.6.29.owrt/block/cfq-iosched.c 2009-05-10 22:04:39.000000000 +0200
23741 +++ linux-2.6.29-rc3.owrt/block/cfq-iosched.c 2009-05-10 23:48:28.000000000 +0200
23742 @@ -84,11 +84,6 @@
23743 */
23744 struct cfq_rb_root service_tree;
23745 unsigned int busy_queues;
23746 - /*
23747 - * Used to track any pending rt requests so we can pre-empt current
23748 - * non-RT cfqq in service when this value is non-zero.
23749 - */
23750 - unsigned int busy_rt_queues;
23751
23752 int rq_in_driver;
23753 int sync_flight;
23754 @@ -567,8 +562,6 @@
23755 BUG_ON(cfq_cfqq_on_rr(cfqq));
23756 cfq_mark_cfqq_on_rr(cfqq);
23757 cfqd->busy_queues++;
23758 - if (cfq_class_rt(cfqq))
23759 - cfqd->busy_rt_queues++;
23760
23761 cfq_resort_rr_list(cfqd, cfqq);
23762 }
23763 @@ -588,8 +581,6 @@
23764
23765 BUG_ON(!cfqd->busy_queues);
23766 cfqd->busy_queues--;
23767 - if (cfq_class_rt(cfqq))
23768 - cfqd->busy_rt_queues--;
23769 }
23770
23771 /*
23772 @@ -1014,20 +1005,6 @@
23773 goto expire;
23774
23775 /*
23776 - * If we have a RT cfqq waiting, then we pre-empt the current non-rt
23777 - * cfqq.
23778 - */
23779 - if (!cfq_class_rt(cfqq) && cfqd->busy_rt_queues) {
23780 - /*
23781 - * We simulate this as cfqq timed out so that it gets to bank
23782 - * the remaining of its time slice.
23783 - */
23784 - cfq_log_cfqq(cfqd, cfqq, "preempt");
23785 - cfq_slice_expired(cfqd, 1);
23786 - goto new_queue;
23787 - }
23788 -
23789 - /*
23790 * The active queue has requests and isn't expired, allow it to
23791 * dispatch.
23792 */
23793 @@ -1090,13 +1067,6 @@
23794 if (RB_EMPTY_ROOT(&cfqq->sort_list))
23795 break;
23796
23797 - /*
23798 - * If there is a non-empty RT cfqq waiting for current
23799 - * cfqq's timeslice to complete, pre-empt this cfqq
23800 - */
23801 - if (!cfq_class_rt(cfqq) && cfqd->busy_rt_queues)
23802 - break;
23803 -
23804 } while (dispatched < max_dispatch);
23805
23806 /*
23807 @@ -1831,12 +1801,6 @@
23808 if (rq_is_meta(rq) && !cfqq->meta_pending)
23809 return 1;
23810
23811 - /*
23812 - * Allow an RT request to pre-empt an ongoing non-RT cfqq timeslice.
23813 - */
23814 - if (cfq_class_rt(new_cfqq) && !cfq_class_rt(cfqq))
23815 - return 1;
23816 -
23817 if (!cfqd->active_cic || !cfq_cfqq_wait_request(cfqq))
23818 return 0;
23819
23820 @@ -1906,8 +1870,7 @@
23821 /*
23822 * not the active queue - expire current slice if it is
23823 * idle and has expired it's mean thinktime or this new queue
23824 - * has some old slice time left and is of higher priority or
23825 - * this new queue is RT and the current one is BE
23826 + * has some old slice time left and is of higher priority
23827 */
23828 cfq_preempt_queue(cfqd, cfqq);
23829 cfq_mark_cfqq_must_dispatch(cfqq);
23830 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/block/genhd.c linux-2.6.29-rc3.owrt/block/genhd.c
23831 --- linux-2.6.29.owrt/block/genhd.c 2009-05-10 22:04:39.000000000 +0200
23832 +++ linux-2.6.29-rc3.owrt/block/genhd.c 2009-05-10 23:48:28.000000000 +0200
23833 @@ -256,22 +256,6 @@
23834 }
23835 #endif /* CONFIG_PROC_FS */
23836
23837 -/**
23838 - * register_blkdev - register a new block device
23839 - *
23840 - * @major: the requested major device number [1..255]. If @major=0, try to
23841 - * allocate any unused major number.
23842 - * @name: the name of the new block device as a zero terminated string
23843 - *
23844 - * The @name must be unique within the system.
23845 - *
23846 - * The return value depends on the @major input parameter.
23847 - * - if a major device number was requested in range [1..255] then the
23848 - * function returns zero on success, or a negative error code
23849 - * - if any unused major number was requested with @major=0 parameter
23850 - * then the return value is the allocated major number in range
23851 - * [1..255] or a negative error code otherwise
23852 - */
23853 int register_blkdev(unsigned int major, const char *name)
23854 {
23855 struct blk_major_name **n, *p;
23856 @@ -1103,14 +1087,6 @@
23857 if (strcmp(dev_name(dev), name))
23858 continue;
23859
23860 - if (partno < disk->minors) {
23861 - /* We need to return the right devno, even
23862 - * if the partition doesn't exist yet.
23863 - */
23864 - devt = MKDEV(MAJOR(dev->devt),
23865 - MINOR(dev->devt) + partno);
23866 - break;
23867 - }
23868 part = disk_get_part(disk, partno);
23869 if (part) {
23870 devt = part_devt(part);
23871 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/CREDITS linux-2.6.29-rc3.owrt/CREDITS
23872 --- linux-2.6.29.owrt/CREDITS 2009-05-10 22:04:39.000000000 +0200
23873 +++ linux-2.6.29-rc3.owrt/CREDITS 2009-05-10 23:48:28.000000000 +0200
23874 @@ -2166,6 +2166,7 @@
23875
23876 N: Pavel Machek
23877 E: pavel@ucw.cz
23878 +E: pavel@suse.cz
23879 D: Softcursor for vga, hypertech cdrom support, vcsa bugfix, nbd
23880 D: sun4/330 port, capabilities for elf, speedup for rm on ext2, USB,
23881 D: work on suspend-to-ram/disk, killing duplicates from ioctl32
23882 @@ -3738,7 +3739,7 @@
23883 S: Germany
23884
23885 N: Gertjan van Wingerde
23886 -E: gwingerde@gmail.com
23887 +E: gwingerde@home.nl
23888 D: Ralink rt2x00 WLAN driver
23889 D: Minix V2 file-system
23890 D: Misc fixes
23891 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/crypto/ahash.c linux-2.6.29-rc3.owrt/crypto/ahash.c
23892 --- linux-2.6.29.owrt/crypto/ahash.c 2009-05-10 22:04:39.000000000 +0200
23893 +++ linux-2.6.29-rc3.owrt/crypto/ahash.c 2009-05-10 23:48:28.000000000 +0200
23894 @@ -214,7 +214,7 @@
23895 seq_printf(m, "async : %s\n", alg->cra_flags & CRYPTO_ALG_ASYNC ?
23896 "yes" : "no");
23897 seq_printf(m, "blocksize : %u\n", alg->cra_blocksize);
23898 - seq_printf(m, "digestsize : %u\n", alg->cra_ahash.digestsize);
23899 + seq_printf(m, "digestsize : %u\n", alg->cra_hash.digestsize);
23900 }
23901
23902 const struct crypto_type crypto_ahash_type = {
23903 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/crypto/algapi.c linux-2.6.29-rc3.owrt/crypto/algapi.c
23904 --- linux-2.6.29.owrt/crypto/algapi.c 2009-05-10 22:04:39.000000000 +0200
23905 +++ linux-2.6.29-rc3.owrt/crypto/algapi.c 2009-05-10 23:48:28.000000000 +0200
23906 @@ -149,9 +149,6 @@
23907 if (q == alg)
23908 goto err;
23909
23910 - if (crypto_is_moribund(q))
23911 - continue;
23912 -
23913 if (crypto_is_larval(q)) {
23914 if (!strcmp(alg->cra_driver_name, q->cra_driver_name))
23915 goto err;
23916 @@ -200,7 +197,7 @@
23917
23918 down_write(&crypto_alg_sem);
23919 list_for_each_entry(q, &crypto_alg_list, cra_list) {
23920 - if (crypto_is_moribund(q) || !crypto_is_larval(q))
23921 + if (!crypto_is_larval(q))
23922 continue;
23923
23924 test = (struct crypto_larval *)q;
23925 @@ -213,7 +210,6 @@
23926 goto unlock;
23927
23928 found:
23929 - q->cra_flags |= CRYPTO_ALG_DEAD;
23930 alg = test->adult;
23931 if (err || list_empty(&alg->cra_list))
23932 goto complete;
23933 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/crypto/api.c linux-2.6.29-rc3.owrt/crypto/api.c
23934 --- linux-2.6.29.owrt/crypto/api.c 2009-05-10 22:04:39.000000000 +0200
23935 +++ linux-2.6.29-rc3.owrt/crypto/api.c 2009-05-10 23:48:28.000000000 +0200
23936 @@ -215,19 +215,8 @@
23937 mask &= ~(CRYPTO_ALG_LARVAL | CRYPTO_ALG_DEAD);
23938 type &= mask;
23939
23940 - alg = crypto_alg_lookup(name, type, mask);
23941 - if (!alg) {
23942 - char tmp[CRYPTO_MAX_ALG_NAME];
23943 -
23944 - request_module(name);
23945 -
23946 - if (!((type ^ CRYPTO_ALG_NEED_FALLBACK) & mask) &&
23947 - snprintf(tmp, sizeof(tmp), "%s-all", name) < sizeof(tmp))
23948 - request_module(tmp);
23949 -
23950 - alg = crypto_alg_lookup(name, type, mask);
23951 - }
23952 -
23953 + alg = try_then_request_module(crypto_alg_lookup(name, type, mask),
23954 + name);
23955 if (alg)
23956 return crypto_is_larval(alg) ? crypto_larval_wait(alg) : alg;
23957
23958 @@ -568,34 +557,34 @@
23959 return ERR_PTR(err);
23960 }
23961 EXPORT_SYMBOL_GPL(crypto_alloc_tfm);
23962 -
23963 +
23964 /*
23965 - * crypto_destroy_tfm - Free crypto transform
23966 - * @mem: Start of tfm slab
23967 + * crypto_free_tfm - Free crypto transform
23968 * @tfm: Transform to free
23969 *
23970 - * This function frees up the transform and any associated resources,
23971 + * crypto_free_tfm() frees up the transform and any associated resources,
23972 * then drops the refcount on the associated algorithm.
23973 */
23974 -void crypto_destroy_tfm(void *mem, struct crypto_tfm *tfm)
23975 +void crypto_free_tfm(struct crypto_tfm *tfm)
23976 {
23977 struct crypto_alg *alg;
23978 int size;
23979
23980 - if (unlikely(!mem))
23981 + if (unlikely(!tfm))
23982 return;
23983
23984 alg = tfm->__crt_alg;
23985 - size = ksize(mem);
23986 + size = sizeof(*tfm) + alg->cra_ctxsize;
23987
23988 if (!tfm->exit && alg->cra_exit)
23989 alg->cra_exit(tfm);
23990 crypto_exit_ops(tfm);
23991 crypto_mod_put(alg);
23992 - memset(mem, 0, size);
23993 - kfree(mem);
23994 + memset(tfm, 0, size);
23995 + kfree(tfm);
23996 }
23997 -EXPORT_SYMBOL_GPL(crypto_destroy_tfm);
23998 +
23999 +EXPORT_SYMBOL_GPL(crypto_free_tfm);
24000
24001 int crypto_has_alg(const char *name, u32 type, u32 mask)
24002 {
24003 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/crypto/lrw.c linux-2.6.29-rc3.owrt/crypto/lrw.c
24004 --- linux-2.6.29.owrt/crypto/lrw.c 2009-05-10 22:04:39.000000000 +0200
24005 +++ linux-2.6.29-rc3.owrt/crypto/lrw.c 2009-05-10 23:48:28.000000000 +0200
24006 @@ -45,13 +45,7 @@
24007
24008 static inline void setbit128_bbe(void *b, int bit)
24009 {
24010 - __set_bit(bit ^ (0x80 -
24011 -#ifdef __BIG_ENDIAN
24012 - BITS_PER_LONG
24013 -#else
24014 - BITS_PER_BYTE
24015 -#endif
24016 - ), b);
24017 + __set_bit(bit ^ 0x78, b);
24018 }
24019
24020 static int setkey(struct crypto_tfm *parent, const u8 *key,
24021 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/crypto/scatterwalk.c linux-2.6.29-rc3.owrt/crypto/scatterwalk.c
24022 --- linux-2.6.29.owrt/crypto/scatterwalk.c 2009-05-10 22:04:39.000000000 +0200
24023 +++ linux-2.6.29-rc3.owrt/crypto/scatterwalk.c 2009-05-10 23:48:28.000000000 +0200
24024 @@ -54,8 +54,7 @@
24025 struct page *page;
24026
24027 page = sg_page(walk->sg) + ((walk->offset - 1) >> PAGE_SHIFT);
24028 - if (!PageSlab(page))
24029 - flush_dcache_page(page);
24030 + flush_dcache_page(page);
24031 }
24032
24033 if (more) {
24034 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/crypto/shash.c linux-2.6.29-rc3.owrt/crypto/shash.c
24035 --- linux-2.6.29.owrt/crypto/shash.c 2009-05-10 22:04:39.000000000 +0200
24036 +++ linux-2.6.29-rc3.owrt/crypto/shash.c 2009-05-10 23:48:28.000000000 +0200
24037 @@ -388,15 +388,10 @@
24038 struct shash_desc *desc = crypto_tfm_ctx(tfm);
24039 struct crypto_shash *shash;
24040
24041 - if (!crypto_mod_get(calg))
24042 - return -EAGAIN;
24043 -
24044 shash = __crypto_shash_cast(crypto_create_tfm(
24045 calg, &crypto_shash_type));
24046 - if (IS_ERR(shash)) {
24047 - crypto_mod_put(calg);
24048 + if (IS_ERR(shash))
24049 return PTR_ERR(shash);
24050 - }
24051
24052 desc->tfm = shash;
24053 tfm->exit = crypto_exit_shash_ops_compat;
24054 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/acpi/acpica/tbutils.c linux-2.6.29-rc3.owrt/drivers/acpi/acpica/tbutils.c
24055 --- linux-2.6.29.owrt/drivers/acpi/acpica/tbutils.c 2009-05-10 22:04:38.000000000 +0200
24056 +++ linux-2.6.29-rc3.owrt/drivers/acpi/acpica/tbutils.c 2009-05-10 23:48:28.000000000 +0200
24057 @@ -538,9 +538,10 @@
24058 if (ACPI_FAILURE(status)) {
24059 ACPI_WARNING((AE_INFO,
24060 "Truncating %u table entries!",
24061 - (unsigned) (table_count -
24062 - (acpi_gbl_root_table_list.
24063 - count - 2))));
24064 + (unsigned)
24065 + (acpi_gbl_root_table_list.size -
24066 + acpi_gbl_root_table_list.
24067 + count)));
24068 break;
24069 }
24070 }
24071 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/acpi/acpica/uteval.c linux-2.6.29-rc3.owrt/drivers/acpi/acpica/uteval.c
24072 --- linux-2.6.29.owrt/drivers/acpi/acpica/uteval.c 2009-05-10 22:04:38.000000000 +0200
24073 +++ linux-2.6.29-rc3.owrt/drivers/acpi/acpica/uteval.c 2009-05-10 23:48:28.000000000 +0200
24074 @@ -116,9 +116,9 @@
24075 return_ACPI_STATUS(AE_NO_MEMORY);
24076 }
24077
24078 - /* Default return value is 0, NOT-SUPPORTED */
24079 + /* Default return value is SUPPORTED */
24080
24081 - return_desc->integer.value = 0;
24082 + return_desc->integer.value = ACPI_UINT32_MAX;
24083 walk_state->return_desc = return_desc;
24084
24085 /* Compare input string to static table of supported interfaces */
24086 @@ -127,8 +127,10 @@
24087 if (!ACPI_STRCMP
24088 (string_desc->string.pointer,
24089 acpi_interfaces_supported[i])) {
24090 - return_desc->integer.value = ACPI_UINT32_MAX;
24091 - goto done;
24092 +
24093 + /* The interface is supported */
24094 +
24095 + return_ACPI_STATUS(AE_OK);
24096 }
24097 }
24098
24099 @@ -139,14 +141,15 @@
24100 */
24101 status = acpi_os_validate_interface(string_desc->string.pointer);
24102 if (ACPI_SUCCESS(status)) {
24103 - return_desc->integer.value = ACPI_UINT32_MAX;
24104 +
24105 + /* The interface is supported */
24106 +
24107 + return_ACPI_STATUS(AE_OK);
24108 }
24109
24110 -done:
24111 - ACPI_DEBUG_PRINT_RAW((ACPI_DB_INFO, "ACPI: BIOS _OSI(%s) %ssupported\n",
24112 - string_desc->string.pointer,
24113 - return_desc->integer.value == 0 ? "not-" : ""));
24114 + /* The interface is not supported */
24115
24116 + return_desc->integer.value = 0;
24117 return_ACPI_STATUS(AE_OK);
24118 }
24119
24120 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/acpi/battery.c linux-2.6.29-rc3.owrt/drivers/acpi/battery.c
24121 --- linux-2.6.29.owrt/drivers/acpi/battery.c 2009-05-10 22:04:38.000000000 +0200
24122 +++ linux-2.6.29-rc3.owrt/drivers/acpi/battery.c 2009-05-10 23:48:28.000000000 +0200
24123 @@ -138,29 +138,6 @@
24124
24125 static int acpi_battery_get_state(struct acpi_battery *battery);
24126
24127 -static int acpi_battery_is_charged(struct acpi_battery *battery)
24128 -{
24129 - /* either charging or discharging */
24130 - if (battery->state != 0)
24131 - return 0;
24132 -
24133 - /* battery not reporting charge */
24134 - if (battery->capacity_now == ACPI_BATTERY_VALUE_UNKNOWN ||
24135 - battery->capacity_now == 0)
24136 - return 0;
24137 -
24138 - /* good batteries update full_charge as the batteries degrade */
24139 - if (battery->full_charge_capacity == battery->capacity_now)
24140 - return 1;
24141 -
24142 - /* fallback to using design values for broken batteries */
24143 - if (battery->design_capacity == battery->capacity_now)
24144 - return 1;
24145 -
24146 - /* we don't do any sort of metric based on percentages */
24147 - return 0;
24148 -}
24149 -
24150 static int acpi_battery_get_property(struct power_supply *psy,
24151 enum power_supply_property psp,
24152 union power_supply_propval *val)
24153 @@ -178,7 +155,7 @@
24154 val->intval = POWER_SUPPLY_STATUS_DISCHARGING;
24155 else if (battery->state & 0x02)
24156 val->intval = POWER_SUPPLY_STATUS_CHARGING;
24157 - else if (acpi_battery_is_charged(battery))
24158 + else if (battery->state == 0)
24159 val->intval = POWER_SUPPLY_STATUS_FULL;
24160 else
24161 val->intval = POWER_SUPPLY_STATUS_UNKNOWN;
24162 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/acpi/bus.c linux-2.6.29-rc3.owrt/drivers/acpi/bus.c
24163 --- linux-2.6.29.owrt/drivers/acpi/bus.c 2009-05-10 22:04:38.000000000 +0200
24164 +++ linux-2.6.29-rc3.owrt/drivers/acpi/bus.c 2009-05-10 23:48:28.000000000 +0200
24165 @@ -758,7 +758,8 @@
24166 acpi_status status = AE_OK;
24167 extern acpi_status acpi_os_initialize1(void);
24168
24169 - acpi_os_initialize1();
24170 +
24171 + status = acpi_os_initialize1();
24172
24173 status =
24174 acpi_enable_subsystem(ACPI_NO_HARDWARE_INIT | ACPI_NO_ACPI_ENABLE);
24175 @@ -768,6 +769,12 @@
24176 goto error1;
24177 }
24178
24179 + if (ACPI_FAILURE(status)) {
24180 + printk(KERN_ERR PREFIX
24181 + "Unable to initialize ACPI OS objects\n");
24182 + goto error1;
24183 + }
24184 +
24185 /*
24186 * ACPI 2.0 requires the EC driver to be loaded and work before
24187 * the EC device is found in the namespace (i.e. before acpi_initialize_objects()
24188 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/acpi/container.c linux-2.6.29-rc3.owrt/drivers/acpi/container.c
24189 --- linux-2.6.29.owrt/drivers/acpi/container.c 2009-05-10 22:04:38.000000000 +0200
24190 +++ linux-2.6.29-rc3.owrt/drivers/acpi/container.c 2009-05-10 23:48:28.000000000 +0200
24191 @@ -163,7 +163,7 @@
24192 case ACPI_NOTIFY_BUS_CHECK:
24193 /* Fall through */
24194 case ACPI_NOTIFY_DEVICE_CHECK:
24195 - printk(KERN_WARNING "Container driver received %s event\n",
24196 + printk("Container driver received %s event\n",
24197 (type == ACPI_NOTIFY_BUS_CHECK) ?
24198 "ACPI_NOTIFY_BUS_CHECK" : "ACPI_NOTIFY_DEVICE_CHECK");
24199 status = acpi_bus_get_device(handle, &device);
24200 @@ -174,8 +174,7 @@
24201 kobject_uevent(&device->dev.kobj,
24202 KOBJ_ONLINE);
24203 else
24204 - printk(KERN_WARNING
24205 - "Failed to add container\n");
24206 + printk("Failed to add container\n");
24207 }
24208 } else {
24209 if (ACPI_SUCCESS(status)) {
24210 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/acpi/dock.c linux-2.6.29-rc3.owrt/drivers/acpi/dock.c
24211 --- linux-2.6.29.owrt/drivers/acpi/dock.c 2009-05-10 22:04:38.000000000 +0200
24212 +++ linux-2.6.29-rc3.owrt/drivers/acpi/dock.c 2009-05-10 23:48:28.000000000 +0200
24213 @@ -855,14 +855,10 @@
24214 static ssize_t show_docked(struct device *dev,
24215 struct device_attribute *attr, char *buf)
24216 {
24217 - struct acpi_device *tmp;
24218 -
24219 struct dock_station *dock_station = *((struct dock_station **)
24220 dev->platform_data);
24221 + return snprintf(buf, PAGE_SIZE, "%d\n", dock_present(dock_station));
24222
24223 - if (ACPI_SUCCESS(acpi_bus_get_device(dock_station->handle, &tmp)))
24224 - return snprintf(buf, PAGE_SIZE, "1\n");
24225 - return snprintf(buf, PAGE_SIZE, "0\n");
24226 }
24227 static DEVICE_ATTR(docked, S_IRUGO, show_docked, NULL);
24228
24229 @@ -988,7 +984,7 @@
24230
24231 ret = device_create_file(&dock_device->dev, &dev_attr_docked);
24232 if (ret) {
24233 - printk(KERN_ERR "Error %d adding sysfs file\n", ret);
24234 + printk("Error %d adding sysfs file\n", ret);
24235 platform_device_unregister(dock_device);
24236 kfree(dock_station);
24237 dock_station = NULL;
24238 @@ -996,7 +992,7 @@
24239 }
24240 ret = device_create_file(&dock_device->dev, &dev_attr_undock);
24241 if (ret) {
24242 - printk(KERN_ERR "Error %d adding sysfs file\n", ret);
24243 + printk("Error %d adding sysfs file\n", ret);
24244 device_remove_file(&dock_device->dev, &dev_attr_docked);
24245 platform_device_unregister(dock_device);
24246 kfree(dock_station);
24247 @@ -1005,7 +1001,7 @@
24248 }
24249 ret = device_create_file(&dock_device->dev, &dev_attr_uid);
24250 if (ret) {
24251 - printk(KERN_ERR "Error %d adding sysfs file\n", ret);
24252 + printk("Error %d adding sysfs file\n", ret);
24253 device_remove_file(&dock_device->dev, &dev_attr_docked);
24254 device_remove_file(&dock_device->dev, &dev_attr_undock);
24255 platform_device_unregister(dock_device);
24256 @@ -1015,7 +1011,7 @@
24257 }
24258 ret = device_create_file(&dock_device->dev, &dev_attr_flags);
24259 if (ret) {
24260 - printk(KERN_ERR "Error %d adding sysfs file\n", ret);
24261 + printk("Error %d adding sysfs file\n", ret);
24262 device_remove_file(&dock_device->dev, &dev_attr_docked);
24263 device_remove_file(&dock_device->dev, &dev_attr_undock);
24264 device_remove_file(&dock_device->dev, &dev_attr_uid);
24265 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/acpi/ec.c linux-2.6.29-rc3.owrt/drivers/acpi/ec.c
24266 --- linux-2.6.29.owrt/drivers/acpi/ec.c 2009-05-10 22:04:38.000000000 +0200
24267 +++ linux-2.6.29-rc3.owrt/drivers/acpi/ec.c 2009-05-10 23:48:28.000000000 +0200
24268 @@ -120,8 +120,6 @@
24269 spinlock_t curr_lock;
24270 } *boot_ec, *first_ec;
24271
24272 -static int EC_FLAGS_MSI; /* Out-of-spec MSI controller */
24273 -
24274 /* --------------------------------------------------------------------------
24275 Transaction Management
24276 -------------------------------------------------------------------------- */
24277 @@ -261,8 +259,6 @@
24278 clear_bit(EC_FLAGS_GPE_MODE, &ec->flags);
24279 acpi_disable_gpe(NULL, ec->gpe);
24280 }
24281 - if (EC_FLAGS_MSI)
24282 - udelay(ACPI_EC_DELAY);
24283 /* start transaction */
24284 spin_lock_irqsave(&ec->curr_lock, tmp);
24285 /* following two actions should be kept atomic */
24286 @@ -971,11 +967,6 @@
24287 /*
24288 * Generate a boot ec context
24289 */
24290 - if (dmi_name_in_vendors("Micro-Star") ||
24291 - dmi_name_in_vendors("Notebook")) {
24292 - pr_info(PREFIX "Enabling special treatment for EC from MSI.\n");
24293 - EC_FLAGS_MSI = 1;
24294 - }
24295 status = acpi_get_table(ACPI_SIG_ECDT, 1,
24296 (struct acpi_table_header **)&ecdt_ptr);
24297 if (ACPI_SUCCESS(status)) {
24298 @@ -991,7 +982,7 @@
24299 saved_ec = kmalloc(sizeof(struct acpi_ec), GFP_KERNEL);
24300 if (!saved_ec)
24301 return -ENOMEM;
24302 - memcpy(saved_ec, boot_ec, sizeof(*saved_ec));
24303 + memcpy(&saved_ec, boot_ec, sizeof(saved_ec));
24304 /* fall through */
24305 }
24306 /* This workaround is needed only on some broken machines,
24307 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/acpi/glue.c linux-2.6.29-rc3.owrt/drivers/acpi/glue.c
24308 --- linux-2.6.29.owrt/drivers/acpi/glue.c 2009-05-10 22:04:38.000000000 +0200
24309 +++ linux-2.6.29-rc3.owrt/drivers/acpi/glue.c 2009-05-10 23:48:28.000000000 +0200
24310 @@ -255,12 +255,12 @@
24311 }
24312 type = acpi_get_bus_type(dev->bus);
24313 if (!type) {
24314 - DBG("No ACPI bus support for %s\n", dev_name(dev));
24315 + DBG("No ACPI bus support for %s\n", dev->bus_id);
24316 ret = -EINVAL;
24317 goto end;
24318 }
24319 if ((ret = type->find_device(dev, &handle)) != 0)
24320 - DBG("Can't get handler for %s\n", dev_name(dev));
24321 + DBG("Can't get handler for %s\n", dev->bus_id);
24322 end:
24323 if (!ret)
24324 acpi_bind_one(dev, handle);
24325 @@ -271,10 +271,10 @@
24326
24327 acpi_get_name(dev->archdata.acpi_handle,
24328 ACPI_FULL_PATHNAME, &buffer);
24329 - DBG("Device %s -> %s\n", dev_name(dev), (char *)buffer.pointer);
24330 + DBG("Device %s -> %s\n", dev->bus_id, (char *)buffer.pointer);
24331 kfree(buffer.pointer);
24332 } else
24333 - DBG("Device %s -> No ACPI support\n", dev_name(dev));
24334 + DBG("Device %s -> No ACPI support\n", dev->bus_id);
24335 #endif
24336
24337 return ret;
24338 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/acpi/Kconfig linux-2.6.29-rc3.owrt/drivers/acpi/Kconfig
24339 --- linux-2.6.29.owrt/drivers/acpi/Kconfig 2009-05-10 22:04:38.000000000 +0200
24340 +++ linux-2.6.29-rc3.owrt/drivers/acpi/Kconfig 2009-05-10 23:48:28.000000000 +0200
24341 @@ -9,7 +9,6 @@
24342 depends on PCI
24343 depends on PM
24344 select PNP
24345 - select CPU_IDLE
24346 default y
24347 ---help---
24348 Advanced Configuration and Power Interface (ACPI) support for
24349 @@ -254,6 +253,13 @@
24350 help you correlate PCI bus addresses with the physical geography
24351 of your slots. If you are unsure, say N.
24352
24353 +config ACPI_SYSTEM
24354 + bool
24355 + default y
24356 + help
24357 + This driver will enable your system to shut down using ACPI, and
24358 + dump your ACPI DSDT table using /proc/acpi/dsdt.
24359 +
24360 config X86_PM_TIMER
24361 bool "Power Management Timer Support" if EMBEDDED
24362 depends on X86
24363 @@ -281,7 +287,7 @@
24364 support physical cpu/memory hot-plug.
24365
24366 If one selects "m", this driver can be loaded with
24367 - "modprobe container".
24368 + "modprobe acpi_container".
24369
24370 config ACPI_HOTPLUG_MEMORY
24371 tristate "Memory Hotplug"
24372 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/acpi/Makefile linux-2.6.29-rc3.owrt/drivers/acpi/Makefile
24373 --- linux-2.6.29.owrt/drivers/acpi/Makefile 2009-05-10 22:04:38.000000000 +0200
24374 +++ linux-2.6.29-rc3.owrt/drivers/acpi/Makefile 2009-05-10 23:48:28.000000000 +0200
24375 @@ -52,7 +52,7 @@
24376 obj-$(CONFIG_ACPI_CONTAINER) += container.o
24377 obj-$(CONFIG_ACPI_THERMAL) += thermal.o
24378 obj-y += power.o
24379 -obj-y += system.o event.o
24380 +obj-$(CONFIG_ACPI_SYSTEM) += system.o event.o
24381 obj-$(CONFIG_ACPI_DEBUG) += debug.o
24382 obj-$(CONFIG_ACPI_NUMA) += numa.o
24383 obj-$(CONFIG_ACPI_HOTPLUG_MEMORY) += acpi_memhotplug.o
24384 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/acpi/numa.c linux-2.6.29-rc3.owrt/drivers/acpi/numa.c
24385 --- linux-2.6.29.owrt/drivers/acpi/numa.c 2009-05-10 22:04:38.000000000 +0200
24386 +++ linux-2.6.29-rc3.owrt/drivers/acpi/numa.c 2009-05-10 23:48:28.000000000 +0200
24387 @@ -277,7 +277,7 @@
24388 int pxm, node = -1;
24389
24390 pxm = acpi_get_pxm(handle);
24391 - if (pxm >= 0 && pxm < MAX_PXM_DOMAINS)
24392 + if (pxm >= 0)
24393 node = acpi_map_pxm_to_node(pxm);
24394
24395 return node;
24396 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/acpi/osl.c linux-2.6.29-rc3.owrt/drivers/acpi/osl.c
24397 --- linux-2.6.29.owrt/drivers/acpi/osl.c 2009-05-10 22:04:38.000000000 +0200
24398 +++ linux-2.6.29-rc3.owrt/drivers/acpi/osl.c 2009-05-10 23:48:28.000000000 +0200
24399 @@ -228,10 +228,10 @@
24400 if (acpi_in_debugger) {
24401 kdb_printf("%s", buffer);
24402 } else {
24403 - printk(KERN_CONT "%s", buffer);
24404 + printk("%s", buffer);
24405 }
24406 #else
24407 - printk(KERN_CONT "%s", buffer);
24408 + printk("%s", buffer);
24409 #endif
24410 }
24411
24412 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/acpi/pci_link.c linux-2.6.29-rc3.owrt/drivers/acpi/pci_link.c
24413 --- linux-2.6.29.owrt/drivers/acpi/pci_link.c 2009-05-10 22:04:38.000000000 +0200
24414 +++ linux-2.6.29-rc3.owrt/drivers/acpi/pci_link.c 2009-05-10 23:48:28.000000000 +0200
24415 @@ -593,7 +593,7 @@
24416 return -ENODEV;
24417 } else {
24418 acpi_irq_penalty[link->irq.active] += PIRQ_PENALTY_PCI_USING;
24419 - printk(KERN_WARNING PREFIX "%s [%s] enabled at IRQ %d\n",
24420 + printk(PREFIX "%s [%s] enabled at IRQ %d\n",
24421 acpi_device_name(link->device),
24422 acpi_device_bid(link->device), link->irq.active);
24423 }
24424 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/acpi/processor_idle.c linux-2.6.29-rc3.owrt/drivers/acpi/processor_idle.c
24425 --- linux-2.6.29.owrt/drivers/acpi/processor_idle.c 2009-05-10 22:04:38.000000000 +0200
24426 +++ linux-2.6.29-rc3.owrt/drivers/acpi/processor_idle.c 2009-05-10 23:48:28.000000000 +0200
24427 @@ -66,17 +66,43 @@
24428 #define ACPI_PROCESSOR_FILE_POWER "power"
24429 #define US_TO_PM_TIMER_TICKS(t) ((t * (PM_TIMER_FREQUENCY/1000)) / 1000)
24430 #define PM_TIMER_TICK_NS (1000000000ULL/PM_TIMER_FREQUENCY)
24431 +#ifndef CONFIG_CPU_IDLE
24432 +#define C2_OVERHEAD 4 /* 1us (3.579 ticks per us) */
24433 +#define C3_OVERHEAD 4 /* 1us (3.579 ticks per us) */
24434 +static void (*pm_idle_save) (void) __read_mostly;
24435 +#else
24436 #define C2_OVERHEAD 1 /* 1us */
24437 #define C3_OVERHEAD 1 /* 1us */
24438 +#endif
24439 #define PM_TIMER_TICKS_TO_US(p) (((p) * 1000)/(PM_TIMER_FREQUENCY/1000))
24440
24441 static unsigned int max_cstate __read_mostly = ACPI_PROCESSOR_MAX_POWER;
24442 +#ifdef CONFIG_CPU_IDLE
24443 module_param(max_cstate, uint, 0000);
24444 +#else
24445 +module_param(max_cstate, uint, 0644);
24446 +#endif
24447 static unsigned int nocst __read_mostly;
24448 module_param(nocst, uint, 0000);
24449
24450 +#ifndef CONFIG_CPU_IDLE
24451 +/*
24452 + * bm_history -- bit-mask with a bit per jiffy of bus-master activity
24453 + * 1000 HZ: 0xFFFFFFFF: 32 jiffies = 32ms
24454 + * 800 HZ: 0xFFFFFFFF: 32 jiffies = 40ms
24455 + * 100 HZ: 0x0000000F: 4 jiffies = 40ms
24456 + * reduce history for more aggressive entry into C3
24457 + */
24458 +static unsigned int bm_history __read_mostly =
24459 + (HZ >= 800 ? 0xFFFFFFFF : ((1U << (HZ / 25)) - 1));
24460 +module_param(bm_history, uint, 0644);
24461 +
24462 +static int acpi_processor_set_power_policy(struct acpi_processor *pr);
24463 +
24464 +#else /* CONFIG_CPU_IDLE */
24465 static unsigned int latency_factor __read_mostly = 2;
24466 module_param(latency_factor, uint, 0644);
24467 +#endif
24468
24469 /*
24470 * IBM ThinkPad R40e crashes mysteriously when going into C2 or C3.
24471 @@ -198,6 +224,71 @@
24472 current_thread_info()->status |= TS_POLLING;
24473 }
24474
24475 +#ifndef CONFIG_CPU_IDLE
24476 +
24477 +static void
24478 +acpi_processor_power_activate(struct acpi_processor *pr,
24479 + struct acpi_processor_cx *new)
24480 +{
24481 + struct acpi_processor_cx *old;
24482 +
24483 + if (!pr || !new)
24484 + return;
24485 +
24486 + old = pr->power.state;
24487 +
24488 + if (old)
24489 + old->promotion.count = 0;
24490 + new->demotion.count = 0;
24491 +
24492 + /* Cleanup from old state. */
24493 + if (old) {
24494 + switch (old->type) {
24495 + case ACPI_STATE_C3:
24496 + /* Disable bus master reload */
24497 + if (new->type != ACPI_STATE_C3 && pr->flags.bm_check)
24498 + acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, 0);
24499 + break;
24500 + }
24501 + }
24502 +
24503 + /* Prepare to use new state. */
24504 + switch (new->type) {
24505 + case ACPI_STATE_C3:
24506 + /* Enable bus master reload */
24507 + if (old->type != ACPI_STATE_C3 && pr->flags.bm_check)
24508 + acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, 1);
24509 + break;
24510 + }
24511 +
24512 + pr->power.state = new;
24513 +
24514 + return;
24515 +}
24516 +
24517 +static atomic_t c3_cpu_count;
24518 +
24519 +/* Common C-state entry for C2, C3, .. */
24520 +static void acpi_cstate_enter(struct acpi_processor_cx *cstate)
24521 +{
24522 + /* Don't trace irqs off for idle */
24523 + stop_critical_timings();
24524 + if (cstate->entry_method == ACPI_CSTATE_FFH) {
24525 + /* Call into architectural FFH based C-state */
24526 + acpi_processor_ffh_cstate_enter(cstate);
24527 + } else {
24528 + int unused;
24529 + /* IO port based C-state */
24530 + inb(cstate->address);
24531 + /* Dummy wait op - must do something useless after P_LVL2 read
24532 + because chipsets cannot guarantee that STPCLK# signal
24533 + gets asserted in time to freeze execution properly. */
24534 + unused = inl(acpi_gbl_FADT.xpm_timer_block.address);
24535 + }
24536 + start_critical_timings();
24537 +}
24538 +#endif /* !CONFIG_CPU_IDLE */
24539 +
24540 #ifdef ARCH_APICTIMER_STOPS_ON_C3
24541
24542 /*
24543 @@ -299,6 +390,421 @@
24544 }
24545 #endif
24546
24547 +#ifndef CONFIG_CPU_IDLE
24548 +static void acpi_processor_idle(void)
24549 +{
24550 + struct acpi_processor *pr = NULL;
24551 + struct acpi_processor_cx *cx = NULL;
24552 + struct acpi_processor_cx *next_state = NULL;
24553 + int sleep_ticks = 0;
24554 + u32 t1, t2 = 0;
24555 +
24556 + /*
24557 + * Interrupts must be disabled during bus mastering calculations and
24558 + * for C2/C3 transitions.
24559 + */
24560 + local_irq_disable();
24561 +
24562 + pr = __get_cpu_var(processors);
24563 + if (!pr) {
24564 + local_irq_enable();
24565 + return;
24566 + }
24567 +
24568 + /*
24569 + * Check whether we truly need to go idle, or should
24570 + * reschedule:
24571 + */
24572 + if (unlikely(need_resched())) {
24573 + local_irq_enable();
24574 + return;
24575 + }
24576 +
24577 + cx = pr->power.state;
24578 + if (!cx || acpi_idle_suspend) {
24579 + if (pm_idle_save) {
24580 + pm_idle_save(); /* enables IRQs */
24581 + } else {
24582 + acpi_safe_halt();
24583 + local_irq_enable();
24584 + }
24585 +
24586 + return;
24587 + }
24588 +
24589 + /*
24590 + * Check BM Activity
24591 + * -----------------
24592 + * Check for bus mastering activity (if required), record, and check
24593 + * for demotion.
24594 + */
24595 + if (pr->flags.bm_check) {
24596 + u32 bm_status = 0;
24597 + unsigned long diff = jiffies - pr->power.bm_check_timestamp;
24598 +
24599 + if (diff > 31)
24600 + diff = 31;
24601 +
24602 + pr->power.bm_activity <<= diff;
24603 +
24604 + acpi_get_register(ACPI_BITREG_BUS_MASTER_STATUS, &bm_status);
24605 + if (bm_status) {
24606 + pr->power.bm_activity |= 0x1;
24607 + acpi_set_register(ACPI_BITREG_BUS_MASTER_STATUS, 1);
24608 + }
24609 + /*
24610 + * PIIX4 Erratum #18: Note that BM_STS doesn't always reflect
24611 + * the true state of bus mastering activity; forcing us to
24612 + * manually check the BMIDEA bit of each IDE channel.
24613 + */
24614 + else if (errata.piix4.bmisx) {
24615 + if ((inb_p(errata.piix4.bmisx + 0x02) & 0x01)
24616 + || (inb_p(errata.piix4.bmisx + 0x0A) & 0x01))
24617 + pr->power.bm_activity |= 0x1;
24618 + }
24619 +
24620 + pr->power.bm_check_timestamp = jiffies;
24621 +
24622 + /*
24623 + * If bus mastering is or was active this jiffy, demote
24624 + * to avoid a faulty transition. Note that the processor
24625 + * won't enter a low-power state during this call (to this
24626 + * function) but should upon the next.
24627 + *
24628 + * TBD: A better policy might be to fallback to the demotion
24629 + * state (use it for this quantum only) istead of
24630 + * demoting -- and rely on duration as our sole demotion
24631 + * qualification. This may, however, introduce DMA
24632 + * issues (e.g. floppy DMA transfer overrun/underrun).
24633 + */
24634 + if ((pr->power.bm_activity & 0x1) &&
24635 + cx->demotion.threshold.bm) {
24636 + local_irq_enable();
24637 + next_state = cx->demotion.state;
24638 + goto end;
24639 + }
24640 + }
24641 +
24642 +#ifdef CONFIG_HOTPLUG_CPU
24643 + /*
24644 + * Check for P_LVL2_UP flag before entering C2 and above on
24645 + * an SMP system. We do it here instead of doing it at _CST/P_LVL
24646 + * detection phase, to work cleanly with logical CPU hotplug.
24647 + */
24648 + if ((cx->type != ACPI_STATE_C1) && (num_online_cpus() > 1) &&
24649 + !pr->flags.has_cst && !(acpi_gbl_FADT.flags & ACPI_FADT_C2_MP_SUPPORTED))
24650 + cx = &pr->power.states[ACPI_STATE_C1];
24651 +#endif
24652 +
24653 + /*
24654 + * Sleep:
24655 + * ------
24656 + * Invoke the current Cx state to put the processor to sleep.
24657 + */
24658 + if (cx->type == ACPI_STATE_C2 || cx->type == ACPI_STATE_C3) {
24659 + current_thread_info()->status &= ~TS_POLLING;
24660 + /*
24661 + * TS_POLLING-cleared state must be visible before we
24662 + * test NEED_RESCHED:
24663 + */
24664 + smp_mb();
24665 + if (need_resched()) {
24666 + current_thread_info()->status |= TS_POLLING;
24667 + local_irq_enable();
24668 + return;
24669 + }
24670 + }
24671 +
24672 + switch (cx->type) {
24673 +
24674 + case ACPI_STATE_C1:
24675 + /*
24676 + * Invoke C1.
24677 + * Use the appropriate idle routine, the one that would
24678 + * be used without acpi C-states.
24679 + */
24680 + if (pm_idle_save) {
24681 + pm_idle_save(); /* enables IRQs */
24682 + } else {
24683 + acpi_safe_halt();
24684 + local_irq_enable();
24685 + }
24686 +
24687 + /*
24688 + * TBD: Can't get time duration while in C1, as resumes
24689 + * go to an ISR rather than here. Need to instrument
24690 + * base interrupt handler.
24691 + *
24692 + * Note: the TSC better not stop in C1, sched_clock() will
24693 + * skew otherwise.
24694 + */
24695 + sleep_ticks = 0xFFFFFFFF;
24696 +
24697 + break;
24698 +
24699 + case ACPI_STATE_C2:
24700 + /* Get start time (ticks) */
24701 + t1 = inl(acpi_gbl_FADT.xpm_timer_block.address);
24702 + /* Tell the scheduler that we are going deep-idle: */
24703 + sched_clock_idle_sleep_event();
24704 + /* Invoke C2 */
24705 + acpi_state_timer_broadcast(pr, cx, 1);
24706 + acpi_cstate_enter(cx);
24707 + /* Get end time (ticks) */
24708 + t2 = inl(acpi_gbl_FADT.xpm_timer_block.address);
24709 +
24710 +#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86)
24711 + /* TSC halts in C2, so notify users */
24712 + if (tsc_halts_in_c(ACPI_STATE_C2))
24713 + mark_tsc_unstable("possible TSC halt in C2");
24714 +#endif
24715 + /* Compute time (ticks) that we were actually asleep */
24716 + sleep_ticks = ticks_elapsed(t1, t2);
24717 +
24718 + /* Tell the scheduler how much we idled: */
24719 + sched_clock_idle_wakeup_event(sleep_ticks*PM_TIMER_TICK_NS);
24720 +
24721 + /* Re-enable interrupts */
24722 + local_irq_enable();
24723 + /* Do not account our idle-switching overhead: */
24724 + sleep_ticks -= cx->latency_ticks + C2_OVERHEAD;
24725 +
24726 + current_thread_info()->status |= TS_POLLING;
24727 + acpi_state_timer_broadcast(pr, cx, 0);
24728 + break;
24729 +
24730 + case ACPI_STATE_C3:
24731 + acpi_unlazy_tlb(smp_processor_id());
24732 + /*
24733 + * Must be done before busmaster disable as we might
24734 + * need to access HPET !
24735 + */
24736 + acpi_state_timer_broadcast(pr, cx, 1);
24737 + /*
24738 + * disable bus master
24739 + * bm_check implies we need ARB_DIS
24740 + * !bm_check implies we need cache flush
24741 + * bm_control implies whether we can do ARB_DIS
24742 + *
24743 + * That leaves a case where bm_check is set and bm_control is
24744 + * not set. In that case we cannot do much, we enter C3
24745 + * without doing anything.
24746 + */
24747 + if (pr->flags.bm_check && pr->flags.bm_control) {
24748 + if (atomic_inc_return(&c3_cpu_count) ==
24749 + num_online_cpus()) {
24750 + /*
24751 + * All CPUs are trying to go to C3
24752 + * Disable bus master arbitration
24753 + */
24754 + acpi_set_register(ACPI_BITREG_ARB_DISABLE, 1);
24755 + }
24756 + } else if (!pr->flags.bm_check) {
24757 + /* SMP with no shared cache... Invalidate cache */
24758 + ACPI_FLUSH_CPU_CACHE();
24759 + }
24760 +
24761 + /* Get start time (ticks) */
24762 + t1 = inl(acpi_gbl_FADT.xpm_timer_block.address);
24763 + /* Invoke C3 */
24764 + /* Tell the scheduler that we are going deep-idle: */
24765 + sched_clock_idle_sleep_event();
24766 + acpi_cstate_enter(cx);
24767 + /* Get end time (ticks) */
24768 + t2 = inl(acpi_gbl_FADT.xpm_timer_block.address);
24769 + if (pr->flags.bm_check && pr->flags.bm_control) {
24770 + /* Enable bus master arbitration */
24771 + atomic_dec(&c3_cpu_count);
24772 + acpi_set_register(ACPI_BITREG_ARB_DISABLE, 0);
24773 + }
24774 +
24775 +#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86)
24776 + /* TSC halts in C3, so notify users */
24777 + if (tsc_halts_in_c(ACPI_STATE_C3))
24778 + mark_tsc_unstable("TSC halts in C3");
24779 +#endif
24780 + /* Compute time (ticks) that we were actually asleep */
24781 + sleep_ticks = ticks_elapsed(t1, t2);
24782 + /* Tell the scheduler how much we idled: */
24783 + sched_clock_idle_wakeup_event(sleep_ticks*PM_TIMER_TICK_NS);
24784 +
24785 + /* Re-enable interrupts */
24786 + local_irq_enable();
24787 + /* Do not account our idle-switching overhead: */
24788 + sleep_ticks -= cx->latency_ticks + C3_OVERHEAD;
24789 +
24790 + current_thread_info()->status |= TS_POLLING;
24791 + acpi_state_timer_broadcast(pr, cx, 0);
24792 + break;
24793 +
24794 + default:
24795 + local_irq_enable();
24796 + return;
24797 + }
24798 + cx->usage++;
24799 + if ((cx->type != ACPI_STATE_C1) && (sleep_ticks > 0))
24800 + cx->time += sleep_ticks;
24801 +
24802 + next_state = pr->power.state;
24803 +
24804 +#ifdef CONFIG_HOTPLUG_CPU
24805 + /* Don't do promotion/demotion */
24806 + if ((cx->type == ACPI_STATE_C1) && (num_online_cpus() > 1) &&
24807 + !pr->flags.has_cst && !(acpi_gbl_FADT.flags & ACPI_FADT_C2_MP_SUPPORTED)) {
24808 + next_state = cx;
24809 + goto end;
24810 + }
24811 +#endif
24812 +
24813 + /*
24814 + * Promotion?
24815 + * ----------
24816 + * Track the number of longs (time asleep is greater than threshold)
24817 + * and promote when the count threshold is reached. Note that bus
24818 + * mastering activity may prevent promotions.
24819 + * Do not promote above max_cstate.
24820 + */
24821 + if (cx->promotion.state &&
24822 + ((cx->promotion.state - pr->power.states) <= max_cstate)) {
24823 + if (sleep_ticks > cx->promotion.threshold.ticks &&
24824 + cx->promotion.state->latency <=
24825 + pm_qos_requirement(PM_QOS_CPU_DMA_LATENCY)) {
24826 + cx->promotion.count++;
24827 + cx->demotion.count = 0;
24828 + if (cx->promotion.count >=
24829 + cx->promotion.threshold.count) {
24830 + if (pr->flags.bm_check) {
24831 + if (!
24832 + (pr->power.bm_activity & cx->
24833 + promotion.threshold.bm)) {
24834 + next_state =
24835 + cx->promotion.state;
24836 + goto end;
24837 + }
24838 + } else {
24839 + next_state = cx->promotion.state;
24840 + goto end;
24841 + }
24842 + }
24843 + }
24844 + }
24845 +
24846 + /*
24847 + * Demotion?
24848 + * ---------
24849 + * Track the number of shorts (time asleep is less than time threshold)
24850 + * and demote when the usage threshold is reached.
24851 + */
24852 + if (cx->demotion.state) {
24853 + if (sleep_ticks < cx->demotion.threshold.ticks) {
24854 + cx->demotion.count++;
24855 + cx->promotion.count = 0;
24856 + if (cx->demotion.count >= cx->demotion.threshold.count) {
24857 + next_state = cx->demotion.state;
24858 + goto end;
24859 + }
24860 + }
24861 + }
24862 +
24863 + end:
24864 + /*
24865 + * Demote if current state exceeds max_cstate
24866 + * or if the latency of the current state is unacceptable
24867 + */
24868 + if ((pr->power.state - pr->power.states) > max_cstate ||
24869 + pr->power.state->latency >
24870 + pm_qos_requirement(PM_QOS_CPU_DMA_LATENCY)) {
24871 + if (cx->demotion.state)
24872 + next_state = cx->demotion.state;
24873 + }
24874 +
24875 + /*
24876 + * New Cx State?
24877 + * -------------
24878 + * If we're going to start using a new Cx state we must clean up
24879 + * from the previous and prepare to use the new.
24880 + */
24881 + if (next_state != pr->power.state)
24882 + acpi_processor_power_activate(pr, next_state);
24883 +}
24884 +
24885 +static int acpi_processor_set_power_policy(struct acpi_processor *pr)
24886 +{
24887 + unsigned int i;
24888 + unsigned int state_is_set = 0;
24889 + struct acpi_processor_cx *lower = NULL;
24890 + struct acpi_processor_cx *higher = NULL;
24891 + struct acpi_processor_cx *cx;
24892 +
24893 +
24894 + if (!pr)
24895 + return -EINVAL;
24896 +
24897 + /*
24898 + * This function sets the default Cx state policy (OS idle handler).
24899 + * Our scheme is to promote quickly to C2 but more conservatively
24900 + * to C3. We're favoring C2 for its characteristics of low latency
24901 + * (quick response), good power savings, and ability to allow bus
24902 + * mastering activity. Note that the Cx state policy is completely
24903 + * customizable and can be altered dynamically.
24904 + */
24905 +
24906 + /* startup state */
24907 + for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) {
24908 + cx = &pr->power.states[i];
24909 + if (!cx->valid)
24910 + continue;
24911 +
24912 + if (!state_is_set)
24913 + pr->power.state = cx;
24914 + state_is_set++;
24915 + break;
24916 + }
24917 +
24918 + if (!state_is_set)
24919 + return -ENODEV;
24920 +
24921 + /* demotion */
24922 + for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) {
24923 + cx = &pr->power.states[i];
24924 + if (!cx->valid)
24925 + continue;
24926 +
24927 + if (lower) {
24928 + cx->demotion.state = lower;
24929 + cx->demotion.threshold.ticks = cx->latency_ticks;
24930 + cx->demotion.threshold.count = 1;
24931 + if (cx->type == ACPI_STATE_C3)
24932 + cx->demotion.threshold.bm = bm_history;
24933 + }
24934 +
24935 + lower = cx;
24936 + }
24937 +
24938 + /* promotion */
24939 + for (i = (ACPI_PROCESSOR_MAX_POWER - 1); i > 0; i--) {
24940 + cx = &pr->power.states[i];
24941 + if (!cx->valid)
24942 + continue;
24943 +
24944 + if (higher) {
24945 + cx->promotion.state = higher;
24946 + cx->promotion.threshold.ticks = cx->latency_ticks;
24947 + if (cx->type >= ACPI_STATE_C2)
24948 + cx->promotion.threshold.count = 4;
24949 + else
24950 + cx->promotion.threshold.count = 10;
24951 + if (higher->type == ACPI_STATE_C3)
24952 + cx->promotion.threshold.bm = bm_history;
24953 + }
24954 +
24955 + higher = cx;
24956 + }
24957 +
24958 + return 0;
24959 +}
24960 +#endif /* !CONFIG_CPU_IDLE */
24961 +
24962 static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
24963 {
24964
24965 @@ -541,7 +1047,11 @@
24966 */
24967 cx->valid = 1;
24968
24969 +#ifndef CONFIG_CPU_IDLE
24970 + cx->latency_ticks = US_TO_PM_TIMER_TICKS(cx->latency);
24971 +#else
24972 cx->latency_ticks = cx->latency;
24973 +#endif
24974
24975 return;
24976 }
24977 @@ -611,6 +1121,7 @@
24978 " for C3 to be enabled on SMP systems\n"));
24979 return;
24980 }
24981 + acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, 0);
24982 }
24983
24984 /*
24985 @@ -621,16 +1132,11 @@
24986 */
24987 cx->valid = 1;
24988
24989 +#ifndef CONFIG_CPU_IDLE
24990 + cx->latency_ticks = US_TO_PM_TIMER_TICKS(cx->latency);
24991 +#else
24992 cx->latency_ticks = cx->latency;
24993 - /*
24994 - * On older chipsets, BM_RLD needs to be set
24995 - * in order for Bus Master activity to wake the
24996 - * system from C3. Newer chipsets handle DMA
24997 - * during C3 automatically and BM_RLD is a NOP.
24998 - * In either case, the proper way to
24999 - * handle BM_RLD is to set it and leave it set.
25000 - */
25001 - acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, 1);
25002 +#endif
25003
25004 return;
25005 }
25006 @@ -695,6 +1201,20 @@
25007
25008 pr->power.count = acpi_processor_power_verify(pr);
25009
25010 +#ifndef CONFIG_CPU_IDLE
25011 + /*
25012 + * Set Default Policy
25013 + * ------------------
25014 + * Now that we know which states are supported, set the default
25015 + * policy. Note that this policy can be changed dynamically
25016 + * (e.g. encourage deeper sleeps to conserve battery life when
25017 + * not on AC).
25018 + */
25019 + result = acpi_processor_set_power_policy(pr);
25020 + if (result)
25021 + return result;
25022 +#endif
25023 +
25024 /*
25025 * if one state of type C2 or C3 is available, mark this
25026 * CPU as being "idle manageable"
25027 @@ -792,6 +1312,69 @@
25028 .release = single_release,
25029 };
25030
25031 +#ifndef CONFIG_CPU_IDLE
25032 +
25033 +int acpi_processor_cst_has_changed(struct acpi_processor *pr)
25034 +{
25035 + int result = 0;
25036 +
25037 + if (boot_option_idle_override)
25038 + return 0;
25039 +
25040 + if (!pr)
25041 + return -EINVAL;
25042 +
25043 + if (nocst) {
25044 + return -ENODEV;
25045 + }
25046 +
25047 + if (!pr->flags.power_setup_done)
25048 + return -ENODEV;
25049 +
25050 + /*
25051 + * Fall back to the default idle loop, when pm_idle_save had
25052 + * been initialized.
25053 + */
25054 + if (pm_idle_save) {
25055 + pm_idle = pm_idle_save;
25056 + /* Relies on interrupts forcing exit from idle. */
25057 + synchronize_sched();
25058 + }
25059 +
25060 + pr->flags.power = 0;
25061 + result = acpi_processor_get_power_info(pr);
25062 + if ((pr->flags.power == 1) && (pr->flags.power_setup_done))
25063 + pm_idle = acpi_processor_idle;
25064 +
25065 + return result;
25066 +}
25067 +
25068 +#ifdef CONFIG_SMP
25069 +static void smp_callback(void *v)
25070 +{
25071 + /* we already woke the CPU up, nothing more to do */
25072 +}
25073 +
25074 +/*
25075 + * This function gets called when a part of the kernel has a new latency
25076 + * requirement. This means we need to get all processors out of their C-state,
25077 + * and then recalculate a new suitable C-state. Just do a cross-cpu IPI; that
25078 + * wakes them all right up.
25079 + */
25080 +static int acpi_processor_latency_notify(struct notifier_block *b,
25081 + unsigned long l, void *v)
25082 +{
25083 + smp_call_function(smp_callback, NULL, 1);
25084 + return NOTIFY_OK;
25085 +}
25086 +
25087 +static struct notifier_block acpi_processor_latency_notifier = {
25088 + .notifier_call = acpi_processor_latency_notify,
25089 +};
25090 +
25091 +#endif
25092 +
25093 +#else /* CONFIG_CPU_IDLE */
25094
25095 /**
25096 * acpi_idle_bm_check - checks if bus master activity was detected
25097 @@ -800,7 +1383,7 @@
25098 {
25099 u32 bm_status = 0;
25100
25101 - acpi_get_register_unlocked(ACPI_BITREG_BUS_MASTER_STATUS, &bm_status);
25102 + acpi_get_register(ACPI_BITREG_BUS_MASTER_STATUS, &bm_status);
25103 if (bm_status)
25104 acpi_set_register(ACPI_BITREG_BUS_MASTER_STATUS, 1);
25105 /*
25106 @@ -817,6 +1400,25 @@
25107 }
25108
25109 /**
25110 + * acpi_idle_update_bm_rld - updates the BM_RLD bit depending on target state
25111 + * @pr: the processor
25112 + * @target: the new target state
25113 + */
25114 +static inline void acpi_idle_update_bm_rld(struct acpi_processor *pr,
25115 + struct acpi_processor_cx *target)
25116 +{
25117 + if (pr->flags.bm_rld_set && target->type != ACPI_STATE_C3) {
25118 + acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, 0);
25119 + pr->flags.bm_rld_set = 0;
25120 + }
25121 +
25122 + if (!pr->flags.bm_rld_set && target->type == ACPI_STATE_C3) {
25123 + acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, 1);
25124 + pr->flags.bm_rld_set = 1;
25125 + }
25126 +}
25127 +
25128 +/**
25129 * acpi_idle_do_entry - a helper function that does C2 and C3 type entry
25130 * @cx: cstate data
25131 *
25132 @@ -871,6 +1473,9 @@
25133 return 0;
25134 }
25135
25136 + if (pr->flags.bm_check)
25137 + acpi_idle_update_bm_rld(pr, cx);
25138 +
25139 t1 = inl(acpi_gbl_FADT.xpm_timer_block.address);
25140 acpi_idle_do_entry(cx);
25141 t2 = inl(acpi_gbl_FADT.xpm_timer_block.address);
25142 @@ -922,6 +1527,9 @@
25143 */
25144 acpi_state_timer_broadcast(pr, cx, 1);
25145
25146 + if (pr->flags.bm_check)
25147 + acpi_idle_update_bm_rld(pr, cx);
25148 +
25149 if (cx->type == ACPI_STATE_C3)
25150 ACPI_FLUSH_CPU_CACHE();
25151
25152 @@ -1013,6 +1621,8 @@
25153 */
25154 acpi_state_timer_broadcast(pr, cx, 1);
25155
25156 + acpi_idle_update_bm_rld(pr, cx);
25157 +
25158 /*
25159 * disable bus master
25160 * bm_check implies we need ARB_DIS
25161 @@ -1185,6 +1795,8 @@
25162 return ret;
25163 }
25164
25165 +#endif /* CONFIG_CPU_IDLE */
25166 +
25167 int __cpuinit acpi_processor_power_init(struct acpi_processor *pr,
25168 struct acpi_device *device)
25169 {
25170 @@ -1213,6 +1825,10 @@
25171 "ACPI: processor limited to max C-state %d\n",
25172 max_cstate);
25173 first_run++;
25174 +#if !defined(CONFIG_CPU_IDLE) && defined(CONFIG_SMP)
25175 + pm_qos_add_notifier(PM_QOS_CPU_DMA_LATENCY,
25176 + &acpi_processor_latency_notifier);
25177 +#endif
25178 }
25179
25180 if (!pr)
25181 @@ -1236,9 +1852,11 @@
25182 * platforms that only support C1.
25183 */
25184 if (pr->flags.power) {
25185 +#ifdef CONFIG_CPU_IDLE
25186 acpi_processor_setup_cpuidle(pr);
25187 if (cpuidle_register_device(&pr->power.dev))
25188 return -EIO;
25189 +#endif
25190
25191 printk(KERN_INFO PREFIX "CPU%d (power states:", pr->id);
25192 for (i = 1; i <= pr->power.count; i++)
25193 @@ -1246,6 +1864,13 @@
25194 printk(" C%d[C%d]", i,
25195 pr->power.states[i].type);
25196 printk(")\n");
25197 +
25198 +#ifndef CONFIG_CPU_IDLE
25199 + if (pr->id == 0) {
25200 + pm_idle_save = pm_idle;
25201 + pm_idle = acpi_processor_idle;
25202 + }
25203 +#endif
25204 }
25205
25206 /* 'power' [R] */
25207 @@ -1264,12 +1889,34 @@
25208 if (boot_option_idle_override)
25209 return 0;
25210
25211 +#ifdef CONFIG_CPU_IDLE
25212 cpuidle_unregister_device(&pr->power.dev);
25213 +#endif
25214 pr->flags.power_setup_done = 0;
25215
25216 if (acpi_device_dir(device))
25217 remove_proc_entry(ACPI_PROCESSOR_FILE_POWER,
25218 acpi_device_dir(device));
25219
25220 +#ifndef CONFIG_CPU_IDLE
25221 +
25222 + /* Unregister the idle handler when processor #0 is removed. */
25223 + if (pr->id == 0) {
25224 + if (pm_idle_save)
25225 + pm_idle = pm_idle_save;
25226 +
25227 + /*
25228 + * We are about to unload the current idle thread pm callback
25229 + * (pm_idle), Wait for all processors to update cached/local
25230 + * copies of pm_idle before proceeding.
25231 + */
25232 + cpu_idle_wait();
25233 +#ifdef CONFIG_SMP
25234 + pm_qos_remove_notifier(PM_QOS_CPU_DMA_LATENCY,
25235 + &acpi_processor_latency_notifier);
25236 +#endif
25237 + }
25238 +#endif
25239 +
25240 return 0;
25241 }
25242 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/acpi/processor_perflib.c linux-2.6.29-rc3.owrt/drivers/acpi/processor_perflib.c
25243 --- linux-2.6.29.owrt/drivers/acpi/processor_perflib.c 2009-05-10 22:04:38.000000000 +0200
25244 +++ linux-2.6.29-rc3.owrt/drivers/acpi/processor_perflib.c 2009-05-10 23:48:28.000000000 +0200
25245 @@ -31,6 +31,14 @@
25246 #include <linux/init.h>
25247 #include <linux/cpufreq.h>
25248
25249 +#ifdef CONFIG_X86_ACPI_CPUFREQ_PROC_INTF
25250 +#include <linux/proc_fs.h>
25251 +#include <linux/seq_file.h>
25252 +#include <linux/mutex.h>
25253 +
25254 +#include <asm/uaccess.h>
25255 +#endif
25256 +
25257 #ifdef CONFIG_X86
25258 #include <asm/cpufeature.h>
25259 #endif
25260 @@ -426,6 +434,96 @@
25261
25262 EXPORT_SYMBOL(acpi_processor_notify_smm);
25263
25264 +#ifdef CONFIG_X86_ACPI_CPUFREQ_PROC_INTF
25265 +/* /proc/acpi/processor/../performance interface (DEPRECATED) */
25266 +
25267 +static int acpi_processor_perf_open_fs(struct inode *inode, struct file *file);
25268 +static struct file_operations acpi_processor_perf_fops = {
25269 + .owner = THIS_MODULE,
25270 + .open = acpi_processor_perf_open_fs,
25271 + .read = seq_read,
25272 + .llseek = seq_lseek,
25273 + .release = single_release,
25274 +};
25275 +
25276 +static int acpi_processor_perf_seq_show(struct seq_file *seq, void *offset)
25277 +{
25278 + struct acpi_processor *pr = seq->private;
25279 + int i;
25280 +
25281 +
25282 + if (!pr)
25283 + goto end;
25284 +
25285 + if (!pr->performance) {
25286 + seq_puts(seq, "<not supported>\n");
25287 + goto end;
25288 + }
25289 +
25290 + seq_printf(seq, "state count: %d\n"
25291 + "active state: P%d\n",
25292 + pr->performance->state_count, pr->performance->state);
25293 +
25294 + seq_puts(seq, "states:\n");
25295 + for (i = 0; i < pr->performance->state_count; i++)
25296 + seq_printf(seq,
25297 + " %cP%d: %d MHz, %d mW, %d uS\n",
25298 + (i == pr->performance->state ? '*' : ' '), i,
25299 + (u32) pr->performance->states[i].core_frequency,
25300 + (u32) pr->performance->states[i].power,
25301 + (u32) pr->performance->states[i].transition_latency);
25302 +
25303 + end:
25304 + return 0;
25305 +}
25306 +
25307 +static int acpi_processor_perf_open_fs(struct inode *inode, struct file *file)
25308 +{
25309 + return single_open(file, acpi_processor_perf_seq_show,
25310 + PDE(inode)->data);
25311 +}
25312 +
25313 +static void acpi_cpufreq_add_file(struct acpi_processor *pr)
25314 +{
25315 + struct acpi_device *device = NULL;
25316 +
25317 +
25318 + if (acpi_bus_get_device(pr->handle, &device))
25319 + return;
25320 +
25321 + /* add file 'performance' [R/W] */
25322 + proc_create_data(ACPI_PROCESSOR_FILE_PERFORMANCE, S_IFREG | S_IRUGO,
25323 + acpi_device_dir(device),
25324 + &acpi_processor_perf_fops, acpi_driver_data(device));
25325 + return;
25326 +}
25327 +
25328 +static void acpi_cpufreq_remove_file(struct acpi_processor *pr)
25329 +{
25330 + struct acpi_device *device = NULL;
25331 +
25332 +
25333 + if (acpi_bus_get_device(pr->handle, &device))
25334 + return;
25335 +
25336 + /* remove file 'performance' */
25337 + remove_proc_entry(ACPI_PROCESSOR_FILE_PERFORMANCE,
25338 + acpi_device_dir(device));
25339 +
25340 + return;
25341 +}
25342 +
25343 +#else
25344 +static void acpi_cpufreq_add_file(struct acpi_processor *pr)
25345 +{
25346 + return;
25347 +}
25348 +static void acpi_cpufreq_remove_file(struct acpi_processor *pr)
25349 +{
25350 + return;
25351 +}
25352 +#endif /* CONFIG_X86_ACPI_CPUFREQ_PROC_INTF */
25353 +
25354 static int acpi_processor_get_psd(struct acpi_processor *pr)
25355 {
25356 int result = 0;
25357 @@ -649,12 +747,14 @@
25358 }
25359 EXPORT_SYMBOL(acpi_processor_preregister_performance);
25360
25361 +
25362 int
25363 acpi_processor_register_performance(struct acpi_processor_performance
25364 *performance, unsigned int cpu)
25365 {
25366 struct acpi_processor *pr;
25367
25368 +
25369 if (!(acpi_processor_ppc_status & PPC_REGISTERED))
25370 return -EINVAL;
25371
25372 @@ -681,6 +781,8 @@
25373 return -EIO;
25374 }
25375
25376 + acpi_cpufreq_add_file(pr);
25377 +
25378 mutex_unlock(&performance_mutex);
25379 return 0;
25380 }
25381 @@ -693,6 +795,7 @@
25382 {
25383 struct acpi_processor *pr;
25384
25385 +
25386 mutex_lock(&performance_mutex);
25387
25388 pr = per_cpu(processors, cpu);
25389 @@ -705,6 +808,8 @@
25390 kfree(pr->performance->states);
25391 pr->performance = NULL;
25392
25393 + acpi_cpufreq_remove_file(pr);
25394 +
25395 mutex_unlock(&performance_mutex);
25396
25397 return;
25398 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/acpi/sleep.c linux-2.6.29-rc3.owrt/drivers/acpi/sleep.c
25399 --- linux-2.6.29.owrt/drivers/acpi/sleep.c 2009-05-10 22:04:38.000000000 +0200
25400 +++ linux-2.6.29-rc3.owrt/drivers/acpi/sleep.c 2009-05-10 23:48:28.000000000 +0200
25401 @@ -90,6 +90,31 @@
25402 old_suspend_ordering = true;
25403 }
25404
25405 +/*
25406 + * According to the ACPI specification the BIOS should make sure that ACPI is
25407 + * enabled and SCI_EN bit is set on wake-up from S1 - S3 sleep states. Still,
25408 + * some BIOSes don't do that and therefore we use acpi_enable() to enable ACPI
25409 + * on such systems during resume. Unfortunately that doesn't help in
25410 + * particularly pathological cases in which SCI_EN has to be set directly on
25411 + * resume, although the specification states very clearly that this flag is
25412 + * owned by the hardware. The set_sci_en_on_resume variable will be set in such
25413 + * cases.
25414 + */
25415 +static bool set_sci_en_on_resume;
25416 +/*
25417 + * The ACPI specification wants us to save NVS memory regions during hibernation
25418 + * and to restore them during the subsequent resume. However, it is not certain
25419 + * if this mechanism is going to work on all machines, so we allow the user to
25420 + * disable this mechanism using the 'acpi_sleep=s4_nonvs' kernel command line
25421 + * option.
25422 + */
25423 +static bool s4_no_nvs;
25424 +
25425 +void __init acpi_s4_no_nvs(void)
25426 +{
25427 + s4_no_nvs = true;
25428 +}
25429 +
25430 /**
25431 * acpi_pm_disable_gpes - Disable the GPEs.
25432 */
25433 @@ -168,18 +193,6 @@
25434 #endif /* CONFIG_ACPI_SLEEP */
25435
25436 #ifdef CONFIG_SUSPEND
25437 -/*
25438 - * According to the ACPI specification the BIOS should make sure that ACPI is
25439 - * enabled and SCI_EN bit is set on wake-up from S1 - S3 sleep states. Still,
25440 - * some BIOSes don't do that and therefore we use acpi_enable() to enable ACPI
25441 - * on such systems during resume. Unfortunately that doesn't help in
25442 - * particularly pathological cases in which SCI_EN has to be set directly on
25443 - * resume, although the specification states very clearly that this flag is
25444 - * owned by the hardware. The set_sci_en_on_resume variable will be set in such
25445 - * cases.
25446 - */
25447 -static bool set_sci_en_on_resume;
25448 -
25449 extern void do_suspend_lowlevel(void);
25450
25451 static u32 acpi_suspend_states[] = {
25452 @@ -378,41 +391,11 @@
25453 DMI_MATCH(DMI_PRODUCT_NAME, "Macmini1,1"),
25454 },
25455 },
25456 - {
25457 - .callback = init_old_suspend_ordering,
25458 - .ident = "Asus Pundit P1-AH2 (M2N8L motherboard)",
25459 - .matches = {
25460 - DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTek Computer INC."),
25461 - DMI_MATCH(DMI_BOARD_NAME, "M2N8L"),
25462 - },
25463 - },
25464 - {
25465 - .callback = init_set_sci_en_on_resume,
25466 - .ident = "Toshiba Satellite L300",
25467 - .matches = {
25468 - DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
25469 - DMI_MATCH(DMI_PRODUCT_NAME, "Satellite L300"),
25470 - },
25471 - },
25472 {},
25473 };
25474 #endif /* CONFIG_SUSPEND */
25475
25476 #ifdef CONFIG_HIBERNATION
25477 -/*
25478 - * The ACPI specification wants us to save NVS memory regions during hibernation
25479 - * and to restore them during the subsequent resume. However, it is not certain
25480 - * if this mechanism is going to work on all machines, so we allow the user to
25481 - * disable this mechanism using the 'acpi_sleep=s4_nonvs' kernel command line
25482 - * option.
25483 - */
25484 -static bool s4_no_nvs;
25485 -
25486 -void __init acpi_s4_no_nvs(void)
25487 -{
25488 - s4_no_nvs = true;
25489 -}
25490 -
25491 static unsigned long s4_hardware_signature;
25492 static struct acpi_table_facs *facs;
25493 static bool nosigcheck;
25494 @@ -696,7 +679,7 @@
25495 static void acpi_power_off(void)
25496 {
25497 /* acpi_sleep_prepare(ACPI_STATE_S5) should have already been called */
25498 - printk(KERN_DEBUG "%s called\n", __func__);
25499 + printk("%s called\n", __func__);
25500 local_irq_disable();
25501 acpi_enable_wakeup_device(ACPI_STATE_S5);
25502 acpi_enter_sleep_state(ACPI_STATE_S5);
25503 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/acpi/tables.c linux-2.6.29-rc3.owrt/drivers/acpi/tables.c
25504 --- linux-2.6.29.owrt/drivers/acpi/tables.c 2009-05-10 22:04:38.000000000 +0200
25505 +++ linux-2.6.29-rc3.owrt/drivers/acpi/tables.c 2009-05-10 23:48:28.000000000 +0200
25506 @@ -293,12 +293,7 @@
25507
25508 int __init acpi_table_init(void)
25509 {
25510 - acpi_status status;
25511 -
25512 - status = acpi_initialize_tables(initial_tables, ACPI_MAX_TABLES, 0);
25513 - if (ACPI_FAILURE(status))
25514 - return 1;
25515 -
25516 + acpi_initialize_tables(initial_tables, ACPI_MAX_TABLES, 0);
25517 check_multiple_madt();
25518 return 0;
25519 }
25520 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/acpi/video.c linux-2.6.29-rc3.owrt/drivers/acpi/video.c
25521 --- linux-2.6.29.owrt/drivers/acpi/video.c 2009-05-10 22:04:38.000000000 +0200
25522 +++ linux-2.6.29-rc3.owrt/drivers/acpi/video.c 2009-05-10 23:48:28.000000000 +0200
25523 @@ -1020,7 +1020,7 @@
25524 }
25525
25526 seq_printf(seq, "levels: ");
25527 - for (i = 2; i < dev->brightness->count; i++)
25528 + for (i = 0; i < dev->brightness->count; i++)
25529 seq_printf(seq, " %d", dev->brightness->levels[i]);
25530 seq_printf(seq, "\ncurrent: %d\n", dev->brightness->curr);
25531
25532 @@ -1059,7 +1059,7 @@
25533 return -EFAULT;
25534
25535 /* validate through the list of available levels */
25536 - for (i = 2; i < dev->brightness->count; i++)
25537 + for (i = 0; i < dev->brightness->count; i++)
25538 if (level == dev->brightness->levels[i]) {
25539 if (ACPI_SUCCESS
25540 (acpi_video_device_lcd_set_level(dev, level)))
25541 @@ -1260,7 +1260,7 @@
25542 printk(KERN_WARNING PREFIX
25543 "This indicates a BIOS bug. Please contact the manufacturer.\n");
25544 }
25545 - printk(KERN_WARNING "%llx\n", options);
25546 + printk("%llx\n", options);
25547 seq_printf(seq, "can POST: <integrated video>");
25548 if (options & 2)
25549 seq_printf(seq, " <PCI video>");
25550 @@ -1712,7 +1712,7 @@
25551 max = max_below = 0;
25552 min = min_above = 255;
25553 /* Find closest level to level_current */
25554 - for (i = 2; i < device->brightness->count; i++) {
25555 + for (i = 0; i < device->brightness->count; i++) {
25556 l = device->brightness->levels[i];
25557 if (abs(l - level_current) < abs(delta)) {
25558 delta = l - level_current;
25559 @@ -1722,7 +1722,7 @@
25560 }
25561 /* Ajust level_current to closest available level */
25562 level_current += delta;
25563 - for (i = 2; i < device->brightness->count; i++) {
25564 + for (i = 0; i < device->brightness->count; i++) {
25565 l = device->brightness->levels[i];
25566 if (l < min)
25567 min = l;
25568 @@ -2006,12 +2006,6 @@
25569 device->pnp.bus_id[3] = '0' + instance;
25570 instance ++;
25571 }
25572 - /* a hack to fix the duplicate name "VGA" problem on Pa 3553 */
25573 - if (!strcmp(device->pnp.bus_id, "VGA")) {
25574 - if (instance)
25575 - device->pnp.bus_id[3] = '0' + instance;
25576 - instance++;
25577 - }
25578
25579 video->device = device;
25580 strcpy(acpi_device_name(device), ACPI_VIDEO_BUS_NAME);
25581 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ata/ahci.c linux-2.6.29-rc3.owrt/drivers/ata/ahci.c
25582 --- linux-2.6.29.owrt/drivers/ata/ahci.c 2009-05-10 22:04:38.000000000 +0200
25583 +++ linux-2.6.29-rc3.owrt/drivers/ata/ahci.c 2009-05-10 23:48:28.000000000 +0200
25584 @@ -61,14 +61,9 @@
25585 #define EM_MSG_LED_VALUE_ON 0x00010000
25586
25587 static int ahci_skip_host_reset;
25588 -static int ahci_ignore_sss;
25589 -
25590 module_param_named(skip_host_reset, ahci_skip_host_reset, int, 0444);
25591 MODULE_PARM_DESC(skip_host_reset, "skip global host reset (0=don't skip, 1=skip)");
25592
25593 -module_param_named(ignore_sss, ahci_ignore_sss, int, 0444);
25594 -MODULE_PARM_DESC(ignore_sss, "Ignore staggered spinup flag (0=don't ignore, 1=ignore)");
25595 -
25596 static int ahci_enable_alpm(struct ata_port *ap,
25597 enum link_pm policy);
25598 static void ahci_disable_alpm(struct ata_port *ap);
25599 @@ -582,18 +577,18 @@
25600 { PCI_VDEVICE(NVIDIA, 0x0abd), board_ahci }, /* MCP79 */
25601 { PCI_VDEVICE(NVIDIA, 0x0abe), board_ahci }, /* MCP79 */
25602 { PCI_VDEVICE(NVIDIA, 0x0abf), board_ahci }, /* MCP79 */
25603 - { PCI_VDEVICE(NVIDIA, 0x0d84), board_ahci }, /* MCP89 */
25604 - { PCI_VDEVICE(NVIDIA, 0x0d85), board_ahci }, /* MCP89 */
25605 - { PCI_VDEVICE(NVIDIA, 0x0d86), board_ahci }, /* MCP89 */
25606 - { PCI_VDEVICE(NVIDIA, 0x0d87), board_ahci }, /* MCP89 */
25607 - { PCI_VDEVICE(NVIDIA, 0x0d88), board_ahci }, /* MCP89 */
25608 - { PCI_VDEVICE(NVIDIA, 0x0d89), board_ahci }, /* MCP89 */
25609 - { PCI_VDEVICE(NVIDIA, 0x0d8a), board_ahci }, /* MCP89 */
25610 - { PCI_VDEVICE(NVIDIA, 0x0d8b), board_ahci }, /* MCP89 */
25611 - { PCI_VDEVICE(NVIDIA, 0x0d8c), board_ahci }, /* MCP89 */
25612 - { PCI_VDEVICE(NVIDIA, 0x0d8d), board_ahci }, /* MCP89 */
25613 - { PCI_VDEVICE(NVIDIA, 0x0d8e), board_ahci }, /* MCP89 */
25614 - { PCI_VDEVICE(NVIDIA, 0x0d8f), board_ahci }, /* MCP89 */
25615 + { PCI_VDEVICE(NVIDIA, 0x0bc8), board_ahci }, /* MCP7B */
25616 + { PCI_VDEVICE(NVIDIA, 0x0bc9), board_ahci }, /* MCP7B */
25617 + { PCI_VDEVICE(NVIDIA, 0x0bca), board_ahci }, /* MCP7B */
25618 + { PCI_VDEVICE(NVIDIA, 0x0bcb), board_ahci }, /* MCP7B */
25619 + { PCI_VDEVICE(NVIDIA, 0x0bcc), board_ahci }, /* MCP7B */
25620 + { PCI_VDEVICE(NVIDIA, 0x0bcd), board_ahci }, /* MCP7B */
25621 + { PCI_VDEVICE(NVIDIA, 0x0bce), board_ahci }, /* MCP7B */
25622 + { PCI_VDEVICE(NVIDIA, 0x0bcf), board_ahci }, /* MCP7B */
25623 + { PCI_VDEVICE(NVIDIA, 0x0bc4), board_ahci }, /* MCP7B */
25624 + { PCI_VDEVICE(NVIDIA, 0x0bc5), board_ahci }, /* MCP7B */
25625 + { PCI_VDEVICE(NVIDIA, 0x0bc6), board_ahci }, /* MCP7B */
25626 + { PCI_VDEVICE(NVIDIA, 0x0bc7), board_ahci }, /* MCP7B */
25627
25628 /* SiS */
25629 { PCI_VDEVICE(SI, 0x1184), board_ahci }, /* SiS 966 */
25630 @@ -2697,10 +2692,8 @@
25631 host->iomap = pcim_iomap_table(pdev);
25632 host->private_data = hpriv;
25633
25634 - if (!(hpriv->cap & HOST_CAP_SSS) || ahci_ignore_sss)
25635 + if (!(hpriv->cap & HOST_CAP_SSS))
25636 host->flags |= ATA_HOST_PARALLEL_SCAN;
25637 - else
25638 - printk(KERN_INFO "ahci: SSS flag set, parallel bus scan disabled\n");
25639
25640 if (pi.flags & ATA_FLAG_EM)
25641 ahci_reset_em(host);
25642 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ata/ata_piix.c linux-2.6.29-rc3.owrt/drivers/ata/ata_piix.c
25643 --- linux-2.6.29.owrt/drivers/ata/ata_piix.c 2009-05-10 22:04:38.000000000 +0200
25644 +++ linux-2.6.29-rc3.owrt/drivers/ata/ata_piix.c 2009-05-10 23:48:28.000000000 +0200
25645 @@ -1289,39 +1289,6 @@
25646 return map;
25647 }
25648
25649 -static bool piix_no_sidpr(struct ata_host *host)
25650 -{
25651 - struct pci_dev *pdev = to_pci_dev(host->dev);
25652 -
25653 - /*
25654 - * Samsung DB-P70 only has three ATA ports exposed and
25655 - * curiously the unconnected first port reports link online
25656 - * while not responding to SRST protocol causing excessive
25657 - * detection delay.
25658 - *
25659 - * Unfortunately, the system doesn't carry enough DMI
25660 - * information to identify the machine but does have subsystem
25661 - * vendor and device set. As it's unclear whether the
25662 - * subsystem vendor/device is used only for this specific
25663 - * board, the port can't be disabled solely with the
25664 - * information; however, turning off SIDPR access works around
25665 - * the problem. Turn it off.
25666 - *
25667 - * This problem is reported in bnc#441240.
25668 - *
25669 - * https://bugzilla.novell.com/show_bug.cgi?id=441420
25670 - */
25671 - if (pdev->vendor == PCI_VENDOR_ID_INTEL && pdev->device == 0x2920 &&
25672 - pdev->subsystem_vendor == PCI_VENDOR_ID_SAMSUNG &&
25673 - pdev->subsystem_device == 0xb049) {
25674 - dev_printk(KERN_WARNING, host->dev,
25675 - "Samsung DB-P70 detected, disabling SIDPR\n");
25676 - return true;
25677 - }
25678 -
25679 - return false;
25680 -}
25681 -
25682 static int __devinit piix_init_sidpr(struct ata_host *host)
25683 {
25684 struct pci_dev *pdev = to_pci_dev(host->dev);
25685 @@ -1335,10 +1302,6 @@
25686 if (hpriv->map[i] == IDE)
25687 return 0;
25688
25689 - /* is it blacklisted? */
25690 - if (piix_no_sidpr(host))
25691 - return 0;
25692 -
25693 if (!(host->ports[0]->flags & PIIX_FLAG_SIDPR))
25694 return 0;
25695
25696 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ata/libata-core.c linux-2.6.29-rc3.owrt/drivers/ata/libata-core.c
25697 --- linux-2.6.29.owrt/drivers/ata/libata-core.c 2009-05-10 22:04:38.000000000 +0200
25698 +++ linux-2.6.29-rc3.owrt/drivers/ata/libata-core.c 2009-05-10 23:48:28.000000000 +0200
25699 @@ -164,11 +164,6 @@
25700 MODULE_VERSION(DRV_VERSION);
25701
25702
25703 -static bool ata_sstatus_online(u32 sstatus)
25704 -{
25705 - return (sstatus & 0xf) == 0x3;
25706 -}
25707 -
25708 /**
25709 * ata_link_next - link iteration helper
25710 * @link: the previous link, NULL to start
25711 @@ -1020,6 +1015,18 @@
25712 return spd_str[spd - 1];
25713 }
25714
25715 +void ata_dev_disable(struct ata_device *dev)
25716 +{
25717 + if (ata_dev_enabled(dev)) {
25718 + if (ata_msg_drv(dev->link->ap))
25719 + ata_dev_printk(dev, KERN_WARNING, "disabled\n");
25720 + ata_acpi_on_disable(dev);
25721 + ata_down_xfermask_limit(dev, ATA_DNXFER_FORCE_PIO0 |
25722 + ATA_DNXFER_QUIET);
25723 + dev->class++;
25724 + }
25725 +}
25726 +
25727 static int ata_dev_set_dipm(struct ata_device *dev, enum link_pm policy)
25728 {
25729 struct ata_link *link = dev->link;
25730 @@ -1322,16 +1329,14 @@
25731 {
25732 if (ata_id_has_lba(id)) {
25733 if (ata_id_has_lba48(id))
25734 - return ata_id_u64(id, ATA_ID_LBA_CAPACITY_2);
25735 + return ata_id_u64(id, 100);
25736 else
25737 - return ata_id_u32(id, ATA_ID_LBA_CAPACITY);
25738 + return ata_id_u32(id, 60);
25739 } else {
25740 if (ata_id_current_chs_valid(id))
25741 - return id[ATA_ID_CUR_CYLS] * id[ATA_ID_CUR_HEADS] *
25742 - id[ATA_ID_CUR_SECTORS];
25743 + return ata_id_u32(id, 57);
25744 else
25745 - return id[ATA_ID_CYLS] * id[ATA_ID_HEADS] *
25746 - id[ATA_ID_SECTORS];
25747 + return id[1] * id[3] * id[6];
25748 }
25749 }
25750
25751 @@ -2234,40 +2239,6 @@
25752 return rc;
25753 }
25754
25755 -static int ata_do_link_spd_horkage(struct ata_device *dev)
25756 -{
25757 - struct ata_link *plink = ata_dev_phys_link(dev);
25758 - u32 target, target_limit;
25759 -
25760 - if (!sata_scr_valid(plink))
25761 - return 0;
25762 -
25763 - if (dev->horkage & ATA_HORKAGE_1_5_GBPS)
25764 - target = 1;
25765 - else
25766 - return 0;
25767 -
25768 - target_limit = (1 << target) - 1;
25769 -
25770 - /* if already on stricter limit, no need to push further */
25771 - if (plink->sata_spd_limit <= target_limit)
25772 - return 0;
25773 -
25774 - plink->sata_spd_limit = target_limit;
25775 -
25776 - /* Request another EH round by returning -EAGAIN if link is
25777 - * going faster than the target speed. Forward progress is
25778 - * guaranteed by setting sata_spd_limit to target_limit above.
25779 - */
25780 - if (plink->sata_spd > target) {
25781 - ata_dev_printk(dev, KERN_INFO,
25782 - "applying link speed limit horkage to %s\n",
25783 - sata_spd_string(target));
25784 - return -EAGAIN;
25785 - }
25786 - return 0;
25787 -}
25788 -
25789 static inline u8 ata_dev_knobble(struct ata_device *dev)
25790 {
25791 struct ata_port *ap = dev->link->ap;
25792 @@ -2358,10 +2329,6 @@
25793 return 0;
25794 }
25795
25796 - rc = ata_do_link_spd_horkage(dev);
25797 - if (rc)
25798 - return rc;
25799 -
25800 /* let ACPI work its magic */
25801 rc = ata_acpi_on_devcfg(dev);
25802 if (rc)
25803 @@ -2817,7 +2784,7 @@
25804 /* This is the last chance, better to slow
25805 * down than lose it.
25806 */
25807 - sata_down_spd_limit(&ap->link, 0);
25808 + sata_down_spd_limit(&ap->link);
25809 ata_down_xfermask_limit(dev, ATA_DNXFER_PIO);
25810 }
25811 }
25812 @@ -2913,27 +2880,21 @@
25813 /**
25814 * sata_down_spd_limit - adjust SATA spd limit downward
25815 * @link: Link to adjust SATA spd limit for
25816 - * @spd_limit: Additional limit
25817 *
25818 * Adjust SATA spd limit of @link downward. Note that this
25819 * function only adjusts the limit. The change must be applied
25820 * using sata_set_spd().
25821 *
25822 - * If @spd_limit is non-zero, the speed is limited to equal to or
25823 - * lower than @spd_limit if such speed is supported. If
25824 - * @spd_limit is slower than any supported speed, only the lowest
25825 - * supported speed is allowed.
25826 - *
25827 * LOCKING:
25828 * Inherited from caller.
25829 *
25830 * RETURNS:
25831 * 0 on success, negative errno on failure
25832 */
25833 -int sata_down_spd_limit(struct ata_link *link, u32 spd_limit)
25834 +int sata_down_spd_limit(struct ata_link *link)
25835 {
25836 u32 sstatus, spd, mask;
25837 - int rc, bit;
25838 + int rc, highbit;
25839
25840 if (!sata_scr_valid(link))
25841 return -EOPNOTSUPP;
25842 @@ -2942,7 +2903,7 @@
25843 * If not, use cached value in link->sata_spd.
25844 */
25845 rc = sata_scr_read(link, SCR_STATUS, &sstatus);
25846 - if (rc == 0 && ata_sstatus_online(sstatus))
25847 + if (rc == 0)
25848 spd = (sstatus >> 4) & 0xf;
25849 else
25850 spd = link->sata_spd;
25851 @@ -2952,8 +2913,8 @@
25852 return -EINVAL;
25853
25854 /* unconditionally mask off the highest bit */
25855 - bit = fls(mask) - 1;
25856 - mask &= ~(1 << bit);
25857 + highbit = fls(mask) - 1;
25858 + mask &= ~(1 << highbit);
25859
25860 /* Mask off all speeds higher than or equal to the current
25861 * one. Force 1.5Gbps if current SPD is not available.
25862 @@ -2967,15 +2928,6 @@
25863 if (!mask)
25864 return -EINVAL;
25865
25866 - if (spd_limit) {
25867 - if (mask & ((1 << spd_limit) - 1))
25868 - mask &= (1 << spd_limit) - 1;
25869 - else {
25870 - bit = ffs(mask) - 1;
25871 - mask = 1 << bit;
25872 - }
25873 - }
25874 -
25875 link->sata_spd_limit = mask;
25876
25877 ata_link_printk(link, KERN_WARNING, "limiting SATA link speed to %s\n",
25878 @@ -4263,9 +4215,6 @@
25879 /* Devices that do not need bridging limits applied */
25880 { "MTRON MSP-SATA*", NULL, ATA_HORKAGE_BRIDGE_OK, },
25881
25882 - /* Devices which aren't very happy with higher link speeds */
25883 - { "WD My Book", NULL, ATA_HORKAGE_1_5_GBPS, },
25884 -
25885 /* End Marker */
25886 { }
25887 };
25888 @@ -4614,7 +4563,7 @@
25889 VPRINTK("unmapping %u sg elements\n", qc->n_elem);
25890
25891 if (qc->n_elem)
25892 - dma_unmap_sg(ap->dev, sg, qc->orig_n_elem, dir);
25893 + dma_unmap_sg(ap->dev, sg, qc->n_elem, dir);
25894
25895 qc->flags &= ~ATA_QCFLAG_DMAMAP;
25896 qc->sg = NULL;
25897 @@ -4729,7 +4678,7 @@
25898 return -1;
25899
25900 DPRINTK("%d sg elements mapped\n", n_elem);
25901 - qc->orig_n_elem = qc->n_elem;
25902 +
25903 qc->n_elem = n_elem;
25904 qc->flags |= ATA_QCFLAG_DMAMAP;
25905
25906 @@ -4760,7 +4709,8 @@
25907
25908 /**
25909 * ata_qc_new - Request an available ATA command, for queueing
25910 - * @ap: target port
25911 + * @ap: Port associated with device @dev
25912 + * @dev: Device from whom we request an available command structure
25913 *
25914 * LOCKING:
25915 * None.
25916 @@ -5225,7 +5175,7 @@
25917 u32 sstatus;
25918
25919 if (sata_scr_read(link, SCR_STATUS, &sstatus) == 0 &&
25920 - ata_sstatus_online(sstatus))
25921 + (sstatus & 0xf) == 0x3)
25922 return true;
25923 return false;
25924 }
25925 @@ -5249,7 +5199,7 @@
25926 u32 sstatus;
25927
25928 if (sata_scr_read(link, SCR_STATUS, &sstatus) == 0 &&
25929 - !ata_sstatus_online(sstatus))
25930 + (sstatus & 0xf) != 0x3)
25931 return true;
25932 return false;
25933 }
25934 @@ -5462,8 +5412,8 @@
25935 dev->horkage = 0;
25936 spin_unlock_irqrestore(ap->lock, flags);
25937
25938 - memset((void *)dev + ATA_DEVICE_CLEAR_BEGIN, 0,
25939 - ATA_DEVICE_CLEAR_END - ATA_DEVICE_CLEAR_BEGIN);
25940 + memset((void *)dev + ATA_DEVICE_CLEAR_OFFSET, 0,
25941 + sizeof(*dev) - ATA_DEVICE_CLEAR_OFFSET);
25942 dev->pio_mask = UINT_MAX;
25943 dev->mwdma_mask = UINT_MAX;
25944 dev->udma_mask = UINT_MAX;
25945 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ata/libata-eh.c linux-2.6.29-rc3.owrt/drivers/ata/libata-eh.c
25946 --- linux-2.6.29.owrt/drivers/ata/libata-eh.c 2009-05-10 22:04:38.000000000 +0200
25947 +++ linux-2.6.29-rc3.owrt/drivers/ata/libata-eh.c 2009-05-10 23:48:28.000000000 +0200
25948 @@ -82,10 +82,6 @@
25949 ATA_EH_FASTDRAIN_INTERVAL = 3000,
25950
25951 ATA_EH_UA_TRIES = 5,
25952 -
25953 - /* probe speed down parameters, see ata_eh_schedule_probe() */
25954 - ATA_EH_PROBE_TRIAL_INTERVAL = 60000, /* 1 min */
25955 - ATA_EH_PROBE_TRIALS = 2,
25956 };
25957
25958 /* The following table determines how we sequence resets. Each entry
25959 @@ -1180,32 +1176,6 @@
25960 }
25961
25962 /**
25963 - * ata_dev_disable - disable ATA device
25964 - * @dev: ATA device to disable
25965 - *
25966 - * Disable @dev.
25967 - *
25968 - * Locking:
25969 - * EH context.
25970 - */
25971 -void ata_dev_disable(struct ata_device *dev)
25972 -{
25973 - if (!ata_dev_enabled(dev))
25974 - return;
25975 -
25976 - if (ata_msg_drv(dev->link->ap))
25977 - ata_dev_printk(dev, KERN_WARNING, "disabled\n");
25978 - ata_acpi_on_disable(dev);
25979 - ata_down_xfermask_limit(dev, ATA_DNXFER_FORCE_PIO0 | ATA_DNXFER_QUIET);
25980 - dev->class++;
25981 -
25982 - /* From now till the next successful probe, ering is used to
25983 - * track probe failures. Clear accumulated device error info.
25984 - */
25985 - ata_ering_clear(&dev->ering);
25986 -}
25987 -
25988 -/**
25989 * ata_eh_detach_dev - detach ATA device
25990 * @dev: ATA device to detach
25991 *
25992 @@ -1879,7 +1849,7 @@
25993 /* speed down? */
25994 if (verdict & ATA_EH_SPDN_SPEED_DOWN) {
25995 /* speed down SATA link speed if possible */
25996 - if (sata_down_spd_limit(link, 0) == 0) {
25997 + if (sata_down_spd_limit(link) == 0) {
25998 action |= ATA_EH_RESET;
25999 goto done;
26000 }
26001 @@ -2423,14 +2393,11 @@
26002 }
26003
26004 /* prereset() might have cleared ATA_EH_RESET. If so,
26005 - * bang classes, thaw and return.
26006 + * bang classes and return.
26007 */
26008 if (reset && !(ehc->i.action & ATA_EH_RESET)) {
26009 ata_for_each_dev(dev, link, ALL)
26010 classes[dev->devno] = ATA_DEV_NONE;
26011 - if ((ap->pflags & ATA_PFLAG_FROZEN) &&
26012 - ata_is_host_link(link))
26013 - ata_eh_thaw_port(ap);
26014 rc = 0;
26015 goto out;
26016 }
26017 @@ -2634,11 +2601,11 @@
26018 }
26019
26020 if (try == max_tries - 1) {
26021 - sata_down_spd_limit(link, 0);
26022 + sata_down_spd_limit(link);
26023 if (slave)
26024 - sata_down_spd_limit(slave, 0);
26025 + sata_down_spd_limit(slave);
26026 } else if (rc == -EPIPE)
26027 - sata_down_spd_limit(failed_link, 0);
26028 + sata_down_spd_limit(failed_link);
26029
26030 if (hardreset)
26031 reset = hardreset;
26032 @@ -2777,8 +2744,6 @@
26033 readid_flags, dev->id);
26034 switch (rc) {
26035 case 0:
26036 - /* clear error info accumulated during probe */
26037 - ata_ering_clear(&dev->ering);
26038 new_mask |= 1 << dev->devno;
26039 break;
26040 case -ENOENT:
26041 @@ -2904,7 +2869,7 @@
26042 int i;
26043
26044 for (i = 0; i < ATA_EH_UA_TRIES; i++) {
26045 - u8 *sense_buffer = dev->link->ap->sector_buf;
26046 + u8 sense_buffer[SCSI_SENSE_BUFFERSIZE];
26047 u8 sense_key = 0;
26048 unsigned int err_mask;
26049
26050 @@ -2982,24 +2947,9 @@
26051 return 1;
26052 }
26053
26054 -static int ata_count_probe_trials_cb(struct ata_ering_entry *ent, void *void_arg)
26055 -{
26056 - u64 interval = msecs_to_jiffies(ATA_EH_PROBE_TRIAL_INTERVAL);
26057 - u64 now = get_jiffies_64();
26058 - int *trials = void_arg;
26059 -
26060 - if (ent->timestamp < now - min(now, interval))
26061 - return -1;
26062 -
26063 - (*trials)++;
26064 - return 0;
26065 -}
26066 -
26067 static int ata_eh_schedule_probe(struct ata_device *dev)
26068 {
26069 struct ata_eh_context *ehc = &dev->link->eh_context;
26070 - struct ata_link *link = ata_dev_phys_link(dev);
26071 - int trials = 0;
26072
26073 if (!(ehc->i.probe_mask & (1 << dev->devno)) ||
26074 (ehc->did_probe_mask & (1 << dev->devno)))
26075 @@ -3012,25 +2962,6 @@
26076 ehc->saved_xfer_mode[dev->devno] = 0;
26077 ehc->saved_ncq_enabled &= ~(1 << dev->devno);
26078
26079 - /* Record and count probe trials on the ering. The specific
26080 - * error mask used is irrelevant. Because a successful device
26081 - * detection clears the ering, this count accumulates only if
26082 - * there are consecutive failed probes.
26083 - *
26084 - * If the count is equal to or higher than ATA_EH_PROBE_TRIALS
26085 - * in the last ATA_EH_PROBE_TRIAL_INTERVAL, link speed is
26086 - * forced to 1.5Gbps.
26087 - *
26088 - * This is to work around cases where failed link speed
26089 - * negotiation results in device misdetection leading to
26090 - * infinite DEVXCHG or PHRDY CHG events.
26091 - */
26092 - ata_ering_record(&dev->ering, 0, AC_ERR_OTHER);
26093 - ata_ering_map(&dev->ering, ata_count_probe_trials_cb, &trials);
26094 -
26095 - if (trials > ATA_EH_PROBE_TRIALS)
26096 - sata_down_spd_limit(link, 1);
26097 -
26098 return 1;
26099 }
26100
26101 @@ -3038,11 +2969,7 @@
26102 {
26103 struct ata_eh_context *ehc = &dev->link->eh_context;
26104
26105 - /* -EAGAIN from EH routine indicates retry without prejudice.
26106 - * The requester is responsible for ensuring forward progress.
26107 - */
26108 - if (err != -EAGAIN)
26109 - ehc->tries[dev->devno]--;
26110 + ehc->tries[dev->devno]--;
26111
26112 switch (err) {
26113 case -ENODEV:
26114 @@ -3052,13 +2979,12 @@
26115 /* give it just one more chance */
26116 ehc->tries[dev->devno] = min(ehc->tries[dev->devno], 1);
26117 case -EIO:
26118 - if (ehc->tries[dev->devno] == 1) {
26119 + if (ehc->tries[dev->devno] == 1 && dev->pio_mode > XFER_PIO_0) {
26120 /* This is the last chance, better to slow
26121 * down than lose it.
26122 */
26123 - sata_down_spd_limit(ata_dev_phys_link(dev), 0);
26124 - if (dev->pio_mode > XFER_PIO_0)
26125 - ata_down_xfermask_limit(dev, ATA_DNXFER_PIO);
26126 + sata_down_spd_limit(ata_dev_phys_link(dev));
26127 + ata_down_xfermask_limit(dev, ATA_DNXFER_PIO);
26128 }
26129 }
26130
26131 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ata/libata.h linux-2.6.29-rc3.owrt/drivers/ata/libata.h
26132 --- linux-2.6.29.owrt/drivers/ata/libata.h 2009-05-10 22:04:38.000000000 +0200
26133 +++ linux-2.6.29-rc3.owrt/drivers/ata/libata.h 2009-05-10 23:48:28.000000000 +0200
26134 @@ -79,6 +79,7 @@
26135 u64 block, u32 n_block, unsigned int tf_flags,
26136 unsigned int tag);
26137 extern u64 ata_tf_read_block(struct ata_taskfile *tf, struct ata_device *dev);
26138 +extern void ata_dev_disable(struct ata_device *dev);
26139 extern void ata_pio_queue_task(struct ata_port *ap, void *data,
26140 unsigned long delay);
26141 extern void ata_port_flush_task(struct ata_port *ap);
26142 @@ -99,7 +100,7 @@
26143 extern int ata_dev_revalidate(struct ata_device *dev, unsigned int new_class,
26144 unsigned int readid_flags);
26145 extern int ata_dev_configure(struct ata_device *dev);
26146 -extern int sata_down_spd_limit(struct ata_link *link, u32 spd_limit);
26147 +extern int sata_down_spd_limit(struct ata_link *link);
26148 extern int ata_down_xfermask_limit(struct ata_device *dev, unsigned int sel);
26149 extern void ata_sg_clean(struct ata_queued_cmd *qc);
26150 extern void ata_qc_free(struct ata_queued_cmd *qc);
26151 @@ -159,7 +160,6 @@
26152 extern void ata_port_wait_eh(struct ata_port *ap);
26153 extern void ata_eh_fastdrain_timerfn(unsigned long arg);
26154 extern void ata_qc_schedule_eh(struct ata_queued_cmd *qc);
26155 -extern void ata_dev_disable(struct ata_device *dev);
26156 extern void ata_eh_detach_dev(struct ata_device *dev);
26157 extern void ata_eh_about_to_do(struct ata_link *link, struct ata_device *dev,
26158 unsigned int action);
26159 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ata/libata-pmp.c linux-2.6.29-rc3.owrt/drivers/ata/libata-pmp.c
26160 --- linux-2.6.29.owrt/drivers/ata/libata-pmp.c 2009-05-10 22:04:38.000000000 +0200
26161 +++ linux-2.6.29-rc3.owrt/drivers/ata/libata-pmp.c 2009-05-10 23:48:28.000000000 +0200
26162 @@ -729,7 +729,7 @@
26163 if (tries) {
26164 /* consecutive revalidation failures? speed down */
26165 if (reval_failed)
26166 - sata_down_spd_limit(link, 0);
26167 + sata_down_spd_limit(link);
26168 else
26169 reval_failed = 1;
26170
26171 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ata/libata-scsi.c linux-2.6.29-rc3.owrt/drivers/ata/libata-scsi.c
26172 --- linux-2.6.29.owrt/drivers/ata/libata-scsi.c 2009-05-10 22:04:38.000000000 +0200
26173 +++ linux-2.6.29-rc3.owrt/drivers/ata/libata-scsi.c 2009-05-10 23:48:28.000000000 +0200
26174 @@ -415,7 +415,6 @@
26175
26176 /**
26177 * ata_get_identity - Handler for HDIO_GET_IDENTITY ioctl
26178 - * @ap: target port
26179 * @sdev: SCSI device to get identify data for
26180 * @arg: User buffer area for identify data
26181 *
26182 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ata/libata-sff.c linux-2.6.29-rc3.owrt/drivers/ata/libata-sff.c
26183 --- linux-2.6.29.owrt/drivers/ata/libata-sff.c 2009-05-10 22:04:38.000000000 +0200
26184 +++ linux-2.6.29-rc3.owrt/drivers/ata/libata-sff.c 2009-05-10 23:48:28.000000000 +0200
26185 @@ -773,32 +773,18 @@
26186 else
26187 iowrite32_rep(data_addr, buf, words);
26188
26189 - /* Transfer trailing bytes, if any */
26190 if (unlikely(slop)) {
26191 - unsigned char pad[4];
26192 -
26193 - /* Point buf to the tail of buffer */
26194 - buf += buflen - slop;
26195 -
26196 - /*
26197 - * Use io*_rep() accessors here as well to avoid pointlessly
26198 - * swapping bytes to and fro on the big endian machines...
26199 - */
26200 + __le32 pad;
26201 if (rw == READ) {
26202 - if (slop < 3)
26203 - ioread16_rep(data_addr, pad, 1);
26204 - else
26205 - ioread32_rep(data_addr, pad, 1);
26206 - memcpy(buf, pad, slop);
26207 + pad = cpu_to_le32(ioread32(ap->ioaddr.data_addr));
26208 + memcpy(buf + buflen - slop, &pad, slop);
26209 } else {
26210 - memcpy(pad, buf, slop);
26211 - if (slop < 3)
26212 - iowrite16_rep(data_addr, pad, 1);
26213 - else
26214 - iowrite32_rep(data_addr, pad, 1);
26215 + memcpy(&pad, buf + buflen - slop, slop);
26216 + iowrite32(le32_to_cpu(pad), ap->ioaddr.data_addr);
26217 }
26218 + words++;
26219 }
26220 - return (buflen + 1) & ~1;
26221 + return words << 2;
26222 }
26223 EXPORT_SYMBOL_GPL(ata_sff_data_xfer32);
26224
26225 @@ -2066,7 +2052,6 @@
26226 iowrite8(ap->ctl | ATA_SRST, ioaddr->ctl_addr);
26227 udelay(20); /* FIXME: flush */
26228 iowrite8(ap->ctl, ioaddr->ctl_addr);
26229 - ap->last_ctl = ap->ctl;
26230
26231 /* wait the port to become ready */
26232 return ata_sff_wait_after_reset(&ap->link, devmask, deadline);
26233 @@ -2191,10 +2176,8 @@
26234 }
26235
26236 /* set up device control */
26237 - if (ap->ioaddr.ctl_addr) {
26238 + if (ap->ioaddr.ctl_addr)
26239 iowrite8(ap->ctl, ap->ioaddr.ctl_addr);
26240 - ap->last_ctl = ap->ctl;
26241 - }
26242 }
26243 EXPORT_SYMBOL_GPL(ata_sff_postreset);
26244
26245 @@ -2537,7 +2520,6 @@
26246 if (ap->flags & (ATA_FLAG_SATA_RESET | ATA_FLAG_SRST)) {
26247 /* set up device control for ATA_FLAG_SATA_RESET */
26248 iowrite8(ap->ctl, ioaddr->ctl_addr);
26249 - ap->last_ctl = ap->ctl;
26250 }
26251
26252 DPRINTK("EXIT\n");
26253 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ata/pata_amd.c linux-2.6.29-rc3.owrt/drivers/ata/pata_amd.c
26254 --- linux-2.6.29.owrt/drivers/ata/pata_amd.c 2009-05-10 22:04:38.000000000 +0200
26255 +++ linux-2.6.29-rc3.owrt/drivers/ata/pata_amd.c 2009-05-10 23:48:28.000000000 +0200
26256 @@ -24,7 +24,7 @@
26257 #include <linux/libata.h>
26258
26259 #define DRV_NAME "pata_amd"
26260 -#define DRV_VERSION "0.4.1"
26261 +#define DRV_VERSION "0.3.11"
26262
26263 /**
26264 * timing_setup - shared timing computation and load
26265 @@ -145,13 +145,6 @@
26266 return ata_sff_prereset(link, deadline);
26267 }
26268
26269 -/**
26270 - * amd_cable_detect - report cable type
26271 - * @ap: port
26272 - *
26273 - * AMD controller/BIOS setups record the cable type in word 0x42
26274 - */
26275 -
26276 static int amd_cable_detect(struct ata_port *ap)
26277 {
26278 static const u32 bitmask[2] = {0x03, 0x0C};
26279 @@ -165,40 +158,6 @@
26280 }
26281
26282 /**
26283 - * amd_fifo_setup - set the PIO FIFO for ATA/ATAPI
26284 - * @ap: ATA interface
26285 - * @adev: ATA device
26286 - *
26287 - * Set the PCI fifo for this device according to the devices present
26288 - * on the bus at this point in time. We need to turn the post write buffer
26289 - * off for ATAPI devices as we may need to issue a word sized write to the
26290 - * device as the final I/O
26291 - */
26292 -
26293 -static void amd_fifo_setup(struct ata_port *ap)
26294 -{
26295 - struct ata_device *adev;
26296 - struct pci_dev *pdev = to_pci_dev(ap->host->dev);
26297 - static const u8 fifobit[2] = { 0xC0, 0x30};
26298 - u8 fifo = fifobit[ap->port_no];
26299 - u8 r;
26300 -
26301 -
26302 - ata_for_each_dev(adev, &ap->link, ENABLED) {
26303 - if (adev->class == ATA_DEV_ATAPI)
26304 - fifo = 0;
26305 - }
26306 - if (pdev->device == PCI_DEVICE_ID_AMD_VIPER_7411) /* FIFO is broken */
26307 - fifo = 0;
26308 -
26309 - /* On the later chips the read prefetch bits become no-op bits */
26310 - pci_read_config_byte(pdev, 0x41, &r);
26311 - r &= ~fifobit[ap->port_no];
26312 - r |= fifo;
26313 - pci_write_config_byte(pdev, 0x41, r);
26314 -}
26315 -
26316 -/**
26317 * amd33_set_piomode - set initial PIO mode data
26318 * @ap: ATA interface
26319 * @adev: ATA device
26320 @@ -208,25 +167,21 @@
26321
26322 static void amd33_set_piomode(struct ata_port *ap, struct ata_device *adev)
26323 {
26324 - amd_fifo_setup(ap);
26325 timing_setup(ap, adev, 0x40, adev->pio_mode, 1);
26326 }
26327
26328 static void amd66_set_piomode(struct ata_port *ap, struct ata_device *adev)
26329 {
26330 - amd_fifo_setup(ap);
26331 timing_setup(ap, adev, 0x40, adev->pio_mode, 2);
26332 }
26333
26334 static void amd100_set_piomode(struct ata_port *ap, struct ata_device *adev)
26335 {
26336 - amd_fifo_setup(ap);
26337 timing_setup(ap, adev, 0x40, adev->pio_mode, 3);
26338 }
26339
26340 static void amd133_set_piomode(struct ata_port *ap, struct ata_device *adev)
26341 {
26342 - amd_fifo_setup(ap);
26343 timing_setup(ap, adev, 0x40, adev->pio_mode, 4);
26344 }
26345
26346 @@ -442,16 +397,6 @@
26347 .set_dmamode = nv133_set_dmamode,
26348 };
26349
26350 -static void amd_clear_fifo(struct pci_dev *pdev)
26351 -{
26352 - u8 fifo;
26353 - /* Disable the FIFO, the FIFO logic will re-enable it as
26354 - appropriate */
26355 - pci_read_config_byte(pdev, 0x41, &fifo);
26356 - fifo &= 0x0F;
26357 - pci_write_config_byte(pdev, 0x41, fifo);
26358 -}
26359 -
26360 static int amd_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
26361 {
26362 static const struct ata_port_info info[10] = {
26363 @@ -558,8 +503,14 @@
26364
26365 if (type < 3)
26366 ata_pci_bmdma_clear_simplex(pdev);
26367 - if (pdev->vendor == PCI_VENDOR_ID_AMD)
26368 - amd_clear_fifo(pdev);
26369 +
26370 + /* Check for AMD7411 */
26371 + if (type == 3)
26372 + /* FIFO is broken */
26373 + pci_write_config_byte(pdev, 0x41, fifo & 0x0F);
26374 + else
26375 + pci_write_config_byte(pdev, 0x41, fifo | 0xF0);
26376 +
26377 /* Cable detection on Nvidia chips doesn't work too well,
26378 * cache BIOS programmed UDMA mode.
26379 */
26380 @@ -585,11 +536,18 @@
26381 return rc;
26382
26383 if (pdev->vendor == PCI_VENDOR_ID_AMD) {
26384 - amd_clear_fifo(pdev);
26385 + u8 fifo;
26386 + pci_read_config_byte(pdev, 0x41, &fifo);
26387 + if (pdev->device == PCI_DEVICE_ID_AMD_VIPER_7411)
26388 + /* FIFO is broken */
26389 + pci_write_config_byte(pdev, 0x41, fifo & 0x0F);
26390 + else
26391 + pci_write_config_byte(pdev, 0x41, fifo | 0xF0);
26392 if (pdev->device == PCI_DEVICE_ID_AMD_VIPER_7409 ||
26393 pdev->device == PCI_DEVICE_ID_AMD_COBRA_7401)
26394 ata_pci_bmdma_clear_simplex(pdev);
26395 }
26396 +
26397 ata_host_resume(host);
26398 return 0;
26399 }
26400 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ata/pata_it821x.c linux-2.6.29-rc3.owrt/drivers/ata/pata_it821x.c
26401 --- linux-2.6.29.owrt/drivers/ata/pata_it821x.c 2009-05-10 22:04:38.000000000 +0200
26402 +++ linux-2.6.29-rc3.owrt/drivers/ata/pata_it821x.c 2009-05-10 23:48:28.000000000 +0200
26403 @@ -557,9 +557,6 @@
26404 id[83] |= 0x4400; /* Word 83 is valid and LBA48 */
26405 id[86] |= 0x0400; /* LBA48 on */
26406 id[ATA_ID_MAJOR_VER] |= 0x1F;
26407 - /* Clear the serial number because it's different each boot
26408 - which breaks validation on resume */
26409 - memset(&id[ATA_ID_SERNO], 0x20, ATA_ID_SERNO_LEN);
26410 }
26411 return err_mask;
26412 }
26413 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ata/pata_legacy.c linux-2.6.29-rc3.owrt/drivers/ata/pata_legacy.c
26414 --- linux-2.6.29.owrt/drivers/ata/pata_legacy.c 2009-05-10 22:04:38.000000000 +0200
26415 +++ linux-2.6.29-rc3.owrt/drivers/ata/pata_legacy.c 2009-05-10 23:48:28.000000000 +0200
26416 @@ -283,10 +283,9 @@
26417 static unsigned int pdc_data_xfer_vlb(struct ata_device *dev,
26418 unsigned char *buf, unsigned int buflen, int rw)
26419 {
26420 - int slop = buflen & 3;
26421 - /* 32bit I/O capable *and* we need to write a whole number of dwords */
26422 - if (ata_id_has_dword_io(dev->id) && (slop == 0 || slop == 3)) {
26423 + if (ata_id_has_dword_io(dev->id)) {
26424 struct ata_port *ap = dev->link->ap;
26425 + int slop = buflen & 3;
26426 unsigned long flags;
26427
26428 local_irq_save(flags);
26429 @@ -736,7 +735,7 @@
26430 struct ata_port *ap = adev->link->ap;
26431 int slop = buflen & 3;
26432
26433 - if (ata_id_has_dword_io(adev->id) && (slop == 0 || slop == 3)) {
26434 + if (ata_id_has_dword_io(adev->id)) {
26435 if (rw == WRITE)
26436 iowrite32_rep(ap->ioaddr.data_addr, buf, buflen >> 2);
26437 else
26438 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ata/pata_qdi.c linux-2.6.29-rc3.owrt/drivers/ata/pata_qdi.c
26439 --- linux-2.6.29.owrt/drivers/ata/pata_qdi.c 2009-05-10 22:04:38.000000000 +0200
26440 +++ linux-2.6.29-rc3.owrt/drivers/ata/pata_qdi.c 2009-05-10 23:48:28.000000000 +0200
26441 @@ -12,7 +12,7 @@
26442 *
26443 * Probe code based on drivers/ide/legacy/qd65xx.c
26444 * Rewritten from the work of Colten Edwards <pje120@cs.usask.ca> by
26445 - * Samuel Thibault <samuel.thibault@ens-lyon.org>
26446 + * Samuel Thibault <samuel.thibault@fnac.net>
26447 */
26448
26449 #include <linux/kernel.h>
26450 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ata/pata_via.c linux-2.6.29-rc3.owrt/drivers/ata/pata_via.c
26451 --- linux-2.6.29.owrt/drivers/ata/pata_via.c 2009-05-10 22:04:38.000000000 +0200
26452 +++ linux-2.6.29-rc3.owrt/drivers/ata/pata_via.c 2009-05-10 23:48:28.000000000 +0200
26453 @@ -110,8 +110,7 @@
26454 { "vt8237s", PCI_DEVICE_ID_VIA_8237S, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
26455 { "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
26456 { "cx700", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST | VIA_SATA_PATA },
26457 - { "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST | VIA_NO_ENABLES },
26458 - { "vt6415", PCI_DEVICE_ID_VIA_6415, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST | VIA_NO_ENABLES },
26459 + { "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST | VIA_NO_ENABLES},
26460 { "vt8237a", PCI_DEVICE_ID_VIA_8237A, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
26461 { "vt8237", PCI_DEVICE_ID_VIA_8237, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
26462 { "vt8235", PCI_DEVICE_ID_VIA_8235, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
26463 @@ -594,7 +593,6 @@
26464 #endif
26465
26466 static const struct pci_device_id via[] = {
26467 - { PCI_VDEVICE(VIA, 0x0415), },
26468 { PCI_VDEVICE(VIA, 0x0571), },
26469 { PCI_VDEVICE(VIA, 0x0581), },
26470 { PCI_VDEVICE(VIA, 0x1571), },
26471 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ata/sata_mv.c linux-2.6.29-rc3.owrt/drivers/ata/sata_mv.c
26472 --- linux-2.6.29.owrt/drivers/ata/sata_mv.c 2009-05-10 22:04:38.000000000 +0200
26473 +++ linux-2.6.29-rc3.owrt/drivers/ata/sata_mv.c 2009-05-10 23:48:28.000000000 +0200
26474 @@ -663,8 +663,8 @@
26475 { PCI_VDEVICE(MARVELL, 0x5081), chip_508x },
26476 /* RocketRAID 1720/174x have different identifiers */
26477 { PCI_VDEVICE(TTI, 0x1720), chip_6042 },
26478 - { PCI_VDEVICE(TTI, 0x1740), chip_6042 },
26479 - { PCI_VDEVICE(TTI, 0x1742), chip_6042 },
26480 + { PCI_VDEVICE(TTI, 0x1740), chip_508x },
26481 + { PCI_VDEVICE(TTI, 0x1742), chip_508x },
26482
26483 { PCI_VDEVICE(MARVELL, 0x6040), chip_604x },
26484 { PCI_VDEVICE(MARVELL, 0x6041), chip_604x },
26485 @@ -2218,13 +2218,12 @@
26486 else
26487 handled = mv_host_intr(host, pending_irqs);
26488 }
26489 + spin_unlock(&host->lock);
26490
26491 /* for MSI: unmask; interrupt cause bits will retrigger now */
26492 if (using_msi)
26493 writel(hpriv->main_irq_mask, hpriv->main_irq_mask_addr);
26494
26495 - spin_unlock(&host->lock);
26496 -
26497 return IRQ_RETVAL(handled);
26498 }
26499
26500 @@ -3115,17 +3114,19 @@
26501 writelfl(0, hc_mmio + HC_IRQ_CAUSE_OFS);
26502 }
26503
26504 - /* Clear any currently outstanding host interrupt conditions */
26505 - writelfl(0, mmio + hpriv->irq_cause_ofs);
26506 + if (!IS_SOC(hpriv)) {
26507 + /* Clear any currently outstanding host interrupt conditions */
26508 + writelfl(0, mmio + hpriv->irq_cause_ofs);
26509
26510 - /* and unmask interrupt generation for host regs */
26511 - writelfl(hpriv->unmask_all_irqs, mmio + hpriv->irq_mask_ofs);
26512 + /* and unmask interrupt generation for host regs */
26513 + writelfl(hpriv->unmask_all_irqs, mmio + hpriv->irq_mask_ofs);
26514
26515 - /*
26516 - * enable only global host interrupts for now.
26517 - * The per-port interrupts get done later as ports are set up.
26518 - */
26519 - mv_set_main_irq_mask(host, 0, PCI_ERR);
26520 + /*
26521 + * enable only global host interrupts for now.
26522 + * The per-port interrupts get done later as ports are set up.
26523 + */
26524 + mv_set_main_irq_mask(host, 0, PCI_ERR);
26525 + }
26526 done:
26527 return rc;
26528 }
26529 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ata/sata_nv.c linux-2.6.29-rc3.owrt/drivers/ata/sata_nv.c
26530 --- linux-2.6.29.owrt/drivers/ata/sata_nv.c 2009-05-10 22:04:38.000000000 +0200
26531 +++ linux-2.6.29-rc3.owrt/drivers/ata/sata_nv.c 2009-05-10 23:48:28.000000000 +0200
26532 @@ -421,33 +421,26 @@
26533 .hardreset = ATA_OP_NULL,
26534 };
26535
26536 -/* nf2 is ripe with hardreset related problems.
26537 - *
26538 - * kernel bz#3352 reports nf2/3 controllers can't determine device
26539 - * signature reliably. The following thread reports detection failure
26540 - * on cold boot with the standard debouncing timing.
26541 +/* OSDL bz3352 reports that nf2/3 controllers can't determine device
26542 + * signature reliably. Also, the following thread reports detection
26543 + * failure on cold boot with the standard debouncing timing.
26544 *
26545 * http://thread.gmane.org/gmane.linux.ide/34098
26546 *
26547 - * And bz#12176 reports that hardreset simply doesn't work on nf2.
26548 - * Give up on it and just don't do hardreset.
26549 + * Debounce with hotplug timing and request follow-up SRST.
26550 */
26551 static struct ata_port_operations nv_nf2_ops = {
26552 - .inherits = &nv_generic_ops,
26553 + .inherits = &nv_common_ops,
26554 .freeze = nv_nf2_freeze,
26555 .thaw = nv_nf2_thaw,
26556 + .hardreset = nv_noclassify_hardreset,
26557 };
26558
26559 -/* For initial probing after boot and hot plugging, hardreset mostly
26560 - * works fine on CK804 but curiously, reprobing on the initial port by
26561 - * rescanning or rmmod/insmod fails to acquire the initial D2H Reg FIS
26562 - * in somewhat undeterministic way. Use noclassify hardreset.
26563 - */
26564 +/* CK804 finally gets hardreset right */
26565 static struct ata_port_operations nv_ck804_ops = {
26566 .inherits = &nv_common_ops,
26567 .freeze = nv_ck804_freeze,
26568 .thaw = nv_ck804_thaw,
26569 - .hardreset = nv_noclassify_hardreset,
26570 .host_stop = nv_ck804_host_stop,
26571 };
26572
26573 @@ -2523,7 +2516,7 @@
26574 module_init(nv_init);
26575 module_exit(nv_exit);
26576 module_param_named(adma, adma_enabled, bool, 0444);
26577 -MODULE_PARM_DESC(adma, "Enable use of ADMA (Default: false)");
26578 +MODULE_PARM_DESC(adma, "Enable use of ADMA (Default: true)");
26579 module_param_named(swncq, swncq_enabled, bool, 0444);
26580 MODULE_PARM_DESC(swncq, "Enable use of SWNCQ (Default: true)");
26581
26582 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ata/sata_sil.c linux-2.6.29-rc3.owrt/drivers/ata/sata_sil.c
26583 --- linux-2.6.29.owrt/drivers/ata/sata_sil.c 2009-05-10 22:04:38.000000000 +0200
26584 +++ linux-2.6.29-rc3.owrt/drivers/ata/sata_sil.c 2009-05-10 23:48:28.000000000 +0200
26585 @@ -44,7 +44,6 @@
26586 #include <linux/device.h>
26587 #include <scsi/scsi_host.h>
26588 #include <linux/libata.h>
26589 -#include <linux/dmi.h>
26590
26591 #define DRV_NAME "sata_sil"
26592 #define DRV_VERSION "2.4"
26593 @@ -324,7 +323,7 @@
26594
26595 prd->addr = cpu_to_le32(addr);
26596 prd->flags_len = cpu_to_le32(sg_len);
26597 - VPRINTK("PRD[%u] = (0x%X, 0x%X)\n", si, addr, sg_len);
26598 + VPRINTK("PRD[%u] = (0x%X, 0x%X)\n", pi, addr, sg_len);
26599
26600 last_prd = prd;
26601 prd++;
26602 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/atm/fore200e.c linux-2.6.29-rc3.owrt/drivers/atm/fore200e.c
26603 --- linux-2.6.29.owrt/drivers/atm/fore200e.c 2009-05-10 22:04:38.000000000 +0200
26604 +++ linux-2.6.29-rc3.owrt/drivers/atm/fore200e.c 2009-05-10 23:48:28.000000000 +0200
26605 @@ -2519,8 +2519,8 @@
26606 return err;
26607
26608 sprintf(buf, "%s%s", fore200e->bus->proc_name, FW_EXT);
26609 - if ((err = request_firmware(&firmware, buf, device)) < 0) {
26610 - printk(FORE200E "problem loading firmware image %s\n", fore200e->bus->model_name);
26611 + if (request_firmware(&firmware, buf, device) == 1) {
26612 + printk(FORE200E "missing %s firmware image\n", fore200e->bus->model_name);
26613 return err;
26614 }
26615
26616 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/atm/lanai.c linux-2.6.29-rc3.owrt/drivers/atm/lanai.c
26617 --- linux-2.6.29.owrt/drivers/atm/lanai.c 2009-05-10 22:04:38.000000000 +0200
26618 +++ linux-2.6.29-rc3.owrt/drivers/atm/lanai.c 2009-05-10 23:48:28.000000000 +0200
26619 @@ -901,7 +901,7 @@
26620 clock_l(); udelay(5);
26621 for (i = 128; i != 0; i >>= 1) { /* write command out */
26622 tmp = (lanai->conf1 & ~CONFIG1_PROMDATA) |
26623 - ((data & i) ? CONFIG1_PROMDATA : 0);
26624 + (data & i) ? CONFIG1_PROMDATA : 0;
26625 if (lanai->conf1 != tmp) {
26626 set_config1(tmp);
26627 udelay(5); /* Let new data settle */
26628 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/atm/solos-pci.c linux-2.6.29-rc3.owrt/drivers/atm/solos-pci.c
26629 --- linux-2.6.29.owrt/drivers/atm/solos-pci.c 2009-05-10 22:04:38.000000000 +0200
26630 +++ linux-2.6.29-rc3.owrt/drivers/atm/solos-pci.c 2009-05-10 23:48:28.000000000 +0200
26631 @@ -685,7 +685,6 @@
26632 out_release_regions:
26633 pci_release_regions(dev);
26634 out:
26635 - kfree(card);
26636 return err;
26637 }
26638
26639 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/base/base.h linux-2.6.29-rc3.owrt/drivers/base/base.h
26640 --- linux-2.6.29.owrt/drivers/base/base.h 2009-05-10 22:04:39.000000000 +0200
26641 +++ linux-2.6.29-rc3.owrt/drivers/base/base.h 2009-05-10 23:48:28.000000000 +0200
26642 @@ -88,6 +88,8 @@
26643 extern int driver_probe_device(struct device_driver *drv, struct device *dev);
26644
26645 extern void sysdev_shutdown(void);
26646 +extern int sysdev_suspend(pm_message_t state);
26647 +extern int sysdev_resume(void);
26648
26649 extern char *make_class_name(const char *name, struct kobject *kobj);
26650
26651 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/base/core.c linux-2.6.29-rc3.owrt/drivers/base/core.c
26652 --- linux-2.6.29.owrt/drivers/base/core.c 2009-05-10 22:04:39.000000000 +0200
26653 +++ linux-2.6.29-rc3.owrt/drivers/base/core.c 2009-05-10 23:48:28.000000000 +0200
26654 @@ -1280,7 +1280,7 @@
26655
26656 /**
26657 * root_device_unregister - unregister and free a root device
26658 - * @dev: device going away
26659 + * @root: device going away.
26660 *
26661 * This function unregisters and cleans up a device that was created by
26662 * root_device_register().
26663 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/base/dd.c linux-2.6.29-rc3.owrt/drivers/base/dd.c
26664 --- linux-2.6.29.owrt/drivers/base/dd.c 2009-05-10 22:04:39.000000000 +0200
26665 +++ linux-2.6.29-rc3.owrt/drivers/base/dd.c 2009-05-10 23:48:28.000000000 +0200
26666 @@ -18,11 +18,9 @@
26667 */
26668
26669 #include <linux/device.h>
26670 -#include <linux/delay.h>
26671 #include <linux/module.h>
26672 #include <linux/kthread.h>
26673 #include <linux/wait.h>
26674 -#include <linux/async.h>
26675
26676 #include "base.h"
26677 #include "power/power.h"
26678 @@ -170,21 +168,6 @@
26679 }
26680
26681 /**
26682 - * wait_for_device_probe
26683 - * Wait for device probing to be completed.
26684 - *
26685 - * Note: this function polls at 100 msec intervals.
26686 - */
26687 -int wait_for_device_probe(void)
26688 -{
26689 - /* wait for the known devices to complete their probing */
26690 - while (driver_probe_done() != 0)
26691 - msleep(100);
26692 - async_synchronize_full();
26693 - return 0;
26694 -}
26695 -
26696 -/**
26697 * driver_probe_device - attempt to bind device & driver together
26698 * @drv: driver to bind a device to
26699 * @dev: device to try to bind to the driver
26700 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/base/node.c linux-2.6.29-rc3.owrt/drivers/base/node.c
26701 --- linux-2.6.29.owrt/drivers/base/node.c 2009-05-10 22:04:39.000000000 +0200
26702 +++ linux-2.6.29-rc3.owrt/drivers/base/node.c 2009-05-10 23:48:28.000000000 +0200
26703 @@ -303,7 +303,7 @@
26704 sect_start_pfn = section_nr_to_pfn(mem_blk->phys_index);
26705 sect_end_pfn = sect_start_pfn + PAGES_PER_SECTION - 1;
26706 for (pfn = sect_start_pfn; pfn <= sect_end_pfn; pfn++) {
26707 - int nid;
26708 + unsigned int nid;
26709
26710 nid = get_nid_for_pfn(pfn);
26711 if (nid < 0)
26712 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/base/power/main.c linux-2.6.29-rc3.owrt/drivers/base/power/main.c
26713 --- linux-2.6.29.owrt/drivers/base/power/main.c 2009-05-10 22:04:39.000000000 +0200
26714 +++ linux-2.6.29-rc3.owrt/drivers/base/power/main.c 2009-05-10 23:48:28.000000000 +0200
26715 @@ -333,6 +333,7 @@
26716 */
26717 void device_power_up(pm_message_t state)
26718 {
26719 + sysdev_resume();
26720 dpm_power_up(state);
26721 }
26722 EXPORT_SYMBOL_GPL(device_power_up);
26723 @@ -576,6 +577,8 @@
26724 }
26725 dev->power.status = DPM_OFF_IRQ;
26726 }
26727 + if (!error)
26728 + error = sysdev_suspend(state);
26729 if (error)
26730 dpm_power_up(resume_event(state));
26731 return error;
26732 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/base/sys.c linux-2.6.29-rc3.owrt/drivers/base/sys.c
26733 --- linux-2.6.29.owrt/drivers/base/sys.c 2009-05-10 22:04:39.000000000 +0200
26734 +++ linux-2.6.29-rc3.owrt/drivers/base/sys.c 2009-05-10 23:48:28.000000000 +0200
26735 @@ -303,6 +303,7 @@
26736 * is guaranteed by virtue of the fact that child devices are registered
26737 * after their parents.
26738 */
26739 +
26740 void sysdev_shutdown(void)
26741 {
26742 struct sysdev_class * cls;
26743 @@ -362,6 +363,7 @@
26744 * This is only called by the device PM core, so we let them handle
26745 * all synchronization.
26746 */
26747 +
26748 int sysdev_suspend(pm_message_t state)
26749 {
26750 struct sysdev_class * cls;
26751 @@ -430,7 +432,7 @@
26752 }
26753 return ret;
26754 }
26755 -EXPORT_SYMBOL_GPL(sysdev_suspend);
26756 +
26757
26758 /**
26759 * sysdev_resume - Bring system devices back to life.
26760 @@ -440,6 +442,7 @@
26761 *
26762 * Note: Interrupts are disabled when called.
26763 */
26764 +
26765 int sysdev_resume(void)
26766 {
26767 struct sysdev_class * cls;
26768 @@ -460,7 +463,7 @@
26769 }
26770 return 0;
26771 }
26772 -EXPORT_SYMBOL_GPL(sysdev_resume);
26773 +
26774
26775 int __init system_bus_init(void)
26776 {
26777 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/block/aoe/aoedev.c linux-2.6.29-rc3.owrt/drivers/block/aoe/aoedev.c
26778 --- linux-2.6.29.owrt/drivers/block/aoe/aoedev.c 2009-05-10 22:04:38.000000000 +0200
26779 +++ linux-2.6.29-rc3.owrt/drivers/block/aoe/aoedev.c 2009-05-10 23:48:28.000000000 +0200
26780 @@ -173,7 +173,7 @@
26781 return;
26782 while (atomic_read(&skb_shinfo(skb)->dataref) != 1 && i-- > 0)
26783 msleep(Sms);
26784 - if (i < 0) {
26785 + if (i <= 0) {
26786 printk(KERN_ERR
26787 "aoe: %s holds ref: %s\n",
26788 skb->dev ? skb->dev->name : "netif",
26789 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/block/aoe/aoe.h linux-2.6.29-rc3.owrt/drivers/block/aoe/aoe.h
26790 --- linux-2.6.29.owrt/drivers/block/aoe/aoe.h 2009-05-10 22:04:38.000000000 +0200
26791 +++ linux-2.6.29-rc3.owrt/drivers/block/aoe/aoe.h 2009-05-10 23:48:28.000000000 +0200
26792 @@ -18,7 +18,6 @@
26793 enum {
26794 AOECMD_ATA,
26795 AOECMD_CFG,
26796 - AOECMD_VEND_MIN = 0xf0,
26797
26798 AOEFL_RSP = (1<<3),
26799 AOEFL_ERR = (1<<2),
26800 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/block/aoe/aoenet.c linux-2.6.29-rc3.owrt/drivers/block/aoe/aoenet.c
26801 --- linux-2.6.29.owrt/drivers/block/aoe/aoenet.c 2009-05-10 22:04:38.000000000 +0200
26802 +++ linux-2.6.29-rc3.owrt/drivers/block/aoe/aoenet.c 2009-05-10 23:48:28.000000000 +0200
26803 @@ -142,8 +142,6 @@
26804 aoecmd_cfg_rsp(skb);
26805 break;
26806 default:
26807 - if (h->cmd >= AOECMD_VEND_MIN)
26808 - break; /* don't complain about vendor commands */
26809 printk(KERN_INFO "aoe: unknown cmd %d\n", h->cmd);
26810 }
26811 exit:
26812 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/block/ataflop.c linux-2.6.29-rc3.owrt/drivers/block/ataflop.c
26813 --- linux-2.6.29.owrt/drivers/block/ataflop.c 2009-05-10 22:04:38.000000000 +0200
26814 +++ linux-2.6.29-rc3.owrt/drivers/block/ataflop.c 2009-05-10 23:48:28.000000000 +0200
26815 @@ -1730,7 +1730,7 @@
26816
26817 timeout = jiffies + 2*HZ+HZ/2;
26818 while (time_before(jiffies, timeout))
26819 - if (!(st_mfp.par_dt_reg & 0x20))
26820 + if (!(mfp.par_dt_reg & 0x20))
26821 break;
26822
26823 status = FDC_READ( FDCREG_STATUS );
26824 @@ -1747,7 +1747,7 @@
26825 /* dummy seek command to make WP bit accessible */
26826 FDC_WRITE( FDCREG_DATA, 0 );
26827 FDC_WRITE( FDCREG_CMD, FDCCMD_SEEK );
26828 - while( st_mfp.par_dt_reg & 0x20 )
26829 + while( mfp.par_dt_reg & 0x20 )
26830 ;
26831 status = FDC_READ( FDCREG_STATUS );
26832 }
26833 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/block/cciss.c linux-2.6.29-rc3.owrt/drivers/block/cciss.c
26834 --- linux-2.6.29.owrt/drivers/block/cciss.c 2009-05-10 22:04:38.000000000 +0200
26835 +++ linux-2.6.29-rc3.owrt/drivers/block/cciss.c 2009-05-10 23:48:28.000000000 +0200
26836 @@ -3390,203 +3390,6 @@
26837 kfree(p);
26838 }
26839
26840 -/* Send a message CDB to the firmware. */
26841 -static __devinit int cciss_message(struct pci_dev *pdev, unsigned char opcode, unsigned char type)
26842 -{
26843 - typedef struct {
26844 - CommandListHeader_struct CommandHeader;
26845 - RequestBlock_struct Request;
26846 - ErrDescriptor_struct ErrorDescriptor;
26847 - } Command;
26848 - static const size_t cmd_sz = sizeof(Command) + sizeof(ErrorInfo_struct);
26849 - Command *cmd;
26850 - dma_addr_t paddr64;
26851 - uint32_t paddr32, tag;
26852 - void __iomem *vaddr;
26853 - int i, err;
26854 -
26855 - vaddr = ioremap_nocache(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0));
26856 - if (vaddr == NULL)
26857 - return -ENOMEM;
26858 -
26859 - /* The Inbound Post Queue only accepts 32-bit physical addresses for the
26860 - CCISS commands, so they must be allocated from the lower 4GiB of
26861 - memory. */
26862 - err = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
26863 - if (err) {
26864 - iounmap(vaddr);
26865 - return -ENOMEM;
26866 - }
26867 -
26868 - cmd = pci_alloc_consistent(pdev, cmd_sz, &paddr64);
26869 - if (cmd == NULL) {
26870 - iounmap(vaddr);
26871 - return -ENOMEM;
26872 - }
26873 -
26874 - /* This must fit, because of the 32-bit consistent DMA mask. Also,
26875 - although there's no guarantee, we assume that the address is at
26876 - least 4-byte aligned (most likely, it's page-aligned). */
26877 - paddr32 = paddr64;
26878 -
26879 - cmd->CommandHeader.ReplyQueue = 0;
26880 - cmd->CommandHeader.SGList = 0;
26881 - cmd->CommandHeader.SGTotal = 0;
26882 - cmd->CommandHeader.Tag.lower = paddr32;
26883 - cmd->CommandHeader.Tag.upper = 0;
26884 - memset(&cmd->CommandHeader.LUN.LunAddrBytes, 0, 8);
26885 -
26886 - cmd->Request.CDBLen = 16;
26887 - cmd->Request.Type.Type = TYPE_MSG;
26888 - cmd->Request.Type.Attribute = ATTR_HEADOFQUEUE;
26889 - cmd->Request.Type.Direction = XFER_NONE;
26890 - cmd->Request.Timeout = 0; /* Don't time out */
26891 - cmd->Request.CDB[0] = opcode;
26892 - cmd->Request.CDB[1] = type;
26893 - memset(&cmd->Request.CDB[2], 0, 14); /* the rest of the CDB is reserved */
26894 -
26895 - cmd->ErrorDescriptor.Addr.lower = paddr32 + sizeof(Command);
26896 - cmd->ErrorDescriptor.Addr.upper = 0;
26897 - cmd->ErrorDescriptor.Len = sizeof(ErrorInfo_struct);
26898 -
26899 - writel(paddr32, vaddr + SA5_REQUEST_PORT_OFFSET);
26900 -
26901 - for (i = 0; i < 10; i++) {
26902 - tag = readl(vaddr + SA5_REPLY_PORT_OFFSET);
26903 - if ((tag & ~3) == paddr32)
26904 - break;
26905 - schedule_timeout_uninterruptible(HZ);
26906 - }
26907 -
26908 - iounmap(vaddr);
26909 -
26910 - /* we leak the DMA buffer here ... no choice since the controller could
26911 - still complete the command. */
26912 - if (i == 10) {
26913 - printk(KERN_ERR "cciss: controller message %02x:%02x timed out\n",
26914 - opcode, type);
26915 - return -ETIMEDOUT;
26916 - }
26917 -
26918 - pci_free_consistent(pdev, cmd_sz, cmd, paddr64);
26919 -
26920 - if (tag & 2) {
26921 - printk(KERN_ERR "cciss: controller message %02x:%02x failed\n",
26922 - opcode, type);
26923 - return -EIO;
26924 - }
26925 -
26926 - printk(KERN_INFO "cciss: controller message %02x:%02x succeeded\n",
26927 - opcode, type);
26928 - return 0;
26929 -}
26930 -
26931 -#define cciss_soft_reset_controller(p) cciss_message(p, 1, 0)
26932 -#define cciss_noop(p) cciss_message(p, 3, 0)
26933 -
26934 -static __devinit int cciss_reset_msi(struct pci_dev *pdev)
26935 -{
26936 -/* the #defines are stolen from drivers/pci/msi.h. */
26937 -#define msi_control_reg(base) (base + PCI_MSI_FLAGS)
26938 -#define PCI_MSIX_FLAGS_ENABLE (1 << 15)
26939 -
26940 - int pos;
26941 - u16 control = 0;
26942 -
26943 - pos = pci_find_capability(pdev, PCI_CAP_ID_MSI);
26944 - if (pos) {
26945 - pci_read_config_word(pdev, msi_control_reg(pos), &control);
26946 - if (control & PCI_MSI_FLAGS_ENABLE) {
26947 - printk(KERN_INFO "cciss: resetting MSI\n");
26948 - pci_write_config_word(pdev, msi_control_reg(pos), control & ~PCI_MSI_FLAGS_ENABLE);
26949 - }
26950 - }
26951 -
26952 - pos = pci_find_capability(pdev, PCI_CAP_ID_MSIX);
26953 - if (pos) {
26954 - pci_read_config_word(pdev, msi_control_reg(pos), &control);
26955 - if (control & PCI_MSIX_FLAGS_ENABLE) {
26956 - printk(KERN_INFO "cciss: resetting MSI-X\n");
26957 - pci_write_config_word(pdev, msi_control_reg(pos), control & ~PCI_MSIX_FLAGS_ENABLE);
26958 - }
26959 - }
26960 -
26961 - return 0;
26962 -}
26963 -
26964 -/* This does a hard reset of the controller using PCI power management
26965 - * states. */
26966 -static __devinit int cciss_hard_reset_controller(struct pci_dev *pdev)
26967 -{
26968 - u16 pmcsr, saved_config_space[32];
26969 - int i, pos;
26970 -
26971 - printk(KERN_INFO "cciss: using PCI PM to reset controller\n");
26972 -
26973 - /* This is very nearly the same thing as
26974 -
26975 - pci_save_state(pci_dev);
26976 - pci_set_power_state(pci_dev, PCI_D3hot);
26977 - pci_set_power_state(pci_dev, PCI_D0);
26978 - pci_restore_state(pci_dev);
26979 -
26980 - but we can't use these nice canned kernel routines on
26981 - kexec, because they also check the MSI/MSI-X state in PCI
26982 - configuration space and do the wrong thing when it is
26983 - set/cleared. Also, the pci_save/restore_state functions
26984 - violate the ordering requirements for restoring the
26985 - configuration space from the CCISS document (see the
26986 - comment below). So we roll our own .... */
26987 -
26988 - for (i = 0; i < 32; i++)
26989 - pci_read_config_word(pdev, 2*i, &saved_config_space[i]);
26990 -
26991 - pos = pci_find_capability(pdev, PCI_CAP_ID_PM);
26992 - if (pos == 0) {
26993 - printk(KERN_ERR "cciss_reset_controller: PCI PM not supported\n");
26994 - return -ENODEV;
26995 - }
26996 -
26997 - /* Quoting from the Open CISS Specification: "The Power
26998 - * Management Control/Status Register (CSR) controls the power
26999 - * state of the device. The normal operating state is D0,
27000 - * CSR=00h. The software off state is D3, CSR=03h. To reset
27001 - * the controller, place the interface device in D3 then to
27002 - * D0, this causes a secondary PCI reset which will reset the
27003 - * controller." */
27004 -
27005 - /* enter the D3hot power management state */
27006 - pci_read_config_word(pdev, pos + PCI_PM_CTRL, &pmcsr);
27007 - pmcsr &= ~PCI_PM_CTRL_STATE_MASK;
27008 - pmcsr |= PCI_D3hot;
27009 - pci_write_config_word(pdev, pos + PCI_PM_CTRL, pmcsr);
27010 -
27011 - schedule_timeout_uninterruptible(HZ >> 1);
27012 -
27013 - /* enter the D0 power management state */
27014 - pmcsr &= ~PCI_PM_CTRL_STATE_MASK;
27015 - pmcsr |= PCI_D0;
27016 - pci_write_config_word(pdev, pos + PCI_PM_CTRL, pmcsr);
27017 -
27018 - schedule_timeout_uninterruptible(HZ >> 1);
27019 -
27020 - /* Restore the PCI configuration space. The Open CISS
27021 - * Specification says, "Restore the PCI Configuration
27022 - * Registers, offsets 00h through 60h. It is important to
27023 - * restore the command register, 16-bits at offset 04h,
27024 - * last. Do not restore the configuration status register,
27025 - * 16-bits at offset 06h." Note that the offset is 2*i. */
27026 - for (i = 0; i < 32; i++) {
27027 - if (i == 2 || i == 3)
27028 - continue;
27029 - pci_write_config_word(pdev, 2*i, saved_config_space[i]);
27030 - }
27031 - wmb();
27032 - pci_write_config_word(pdev, 4, saved_config_space[2]);
27033 -
27034 - return 0;
27035 -}
27036 -
27037 /*
27038 * This is it. Find all the controllers and register them. I really hate
27039 * stealing all these major device numbers.
27040 @@ -3601,26 +3404,6 @@
27041 int dac, return_code;
27042 InquiryData_struct *inq_buff = NULL;
27043
27044 - if (reset_devices) {
27045 - /* Reset the controller with a PCI power-cycle */
27046 - if (cciss_hard_reset_controller(pdev) || cciss_reset_msi(pdev))
27047 - return -ENODEV;
27048 -
27049 - /* Now try to get the controller to respond to a no-op. Some
27050 - devices (notably the HP Smart Array 5i Controller) need
27051 - up to 30 seconds to respond. */
27052 - for (i=0; i<30; i++) {
27053 - if (cciss_noop(pdev) == 0)
27054 - break;
27055 -
27056 - schedule_timeout_uninterruptible(HZ);
27057 - }
27058 - if (i == 30) {
27059 - printk(KERN_ERR "cciss: controller seems dead\n");
27060 - return -EBUSY;
27061 - }
27062 - }
27063 -
27064 i = alloc_cciss_hba();
27065 if (i < 0)
27066 return -1;
27067 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/block/floppy.c linux-2.6.29-rc3.owrt/drivers/block/floppy.c
27068 --- linux-2.6.29.owrt/drivers/block/floppy.c 2009-05-10 22:04:38.000000000 +0200
27069 +++ linux-2.6.29-rc3.owrt/drivers/block/floppy.c 2009-05-10 23:48:28.000000000 +0200
27070 @@ -558,8 +558,6 @@
27071 static void recalibrate_floppy(void);
27072 static void floppy_shutdown(unsigned long);
27073
27074 -static int floppy_request_regions(int);
27075 -static void floppy_release_regions(int);
27076 static int floppy_grab_irq_and_dma(void);
27077 static void floppy_release_irq_and_dma(void);
27078
27079 @@ -4276,7 +4274,8 @@
27080 FDCS->rawcmd = 2;
27081 if (user_reset_fdc(-1, FD_RESET_ALWAYS, 0)) {
27082 /* free ioports reserved by floppy_grab_irq_and_dma() */
27083 - floppy_release_regions(fdc);
27084 + release_region(FDCS->address + 2, 4);
27085 + release_region(FDCS->address + 7, 1);
27086 FDCS->address = -1;
27087 FDCS->version = FDC_NONE;
27088 continue;
27089 @@ -4285,7 +4284,8 @@
27090 FDCS->version = get_fdc_version();
27091 if (FDCS->version == FDC_NONE) {
27092 /* free ioports reserved by floppy_grab_irq_and_dma() */
27093 - floppy_release_regions(fdc);
27094 + release_region(FDCS->address + 2, 4);
27095 + release_region(FDCS->address + 7, 1);
27096 FDCS->address = -1;
27097 continue;
27098 }
27099 @@ -4358,47 +4358,6 @@
27100
27101 static DEFINE_SPINLOCK(floppy_usage_lock);
27102
27103 -static const struct io_region {
27104 - int offset;
27105 - int size;
27106 -} io_regions[] = {
27107 - { 2, 1 },
27108 - /* address + 3 is sometimes reserved by pnp bios for motherboard */
27109 - { 4, 2 },
27110 - /* address + 6 is reserved, and may be taken by IDE.
27111 - * Unfortunately, Adaptec doesn't know this :-(, */
27112 - { 7, 1 },
27113 -};
27114 -
27115 -static void floppy_release_allocated_regions(int fdc, const struct io_region *p)
27116 -{
27117 - while (p != io_regions) {
27118 - p--;
27119 - release_region(FDCS->address + p->offset, p->size);
27120 - }
27121 -}
27122 -
27123 -#define ARRAY_END(X) (&((X)[ARRAY_SIZE(X)]))
27124 -
27125 -static int floppy_request_regions(int fdc)
27126 -{
27127 - const struct io_region *p;
27128 -
27129 - for (p = io_regions; p < ARRAY_END(io_regions); p++) {
27130 - if (!request_region(FDCS->address + p->offset, p->size, "floppy")) {
27131 - DPRINT("Floppy io-port 0x%04lx in use\n", FDCS->address + p->offset);
27132 - floppy_release_allocated_regions(fdc, p);
27133 - return -EBUSY;
27134 - }
27135 - }
27136 - return 0;
27137 -}
27138 -
27139 -static void floppy_release_regions(int fdc)
27140 -{
27141 - floppy_release_allocated_regions(fdc, ARRAY_END(io_regions));
27142 -}
27143 -
27144 static int floppy_grab_irq_and_dma(void)
27145 {
27146 unsigned long flags;
27147 @@ -4440,8 +4399,18 @@
27148
27149 for (fdc = 0; fdc < N_FDC; fdc++) {
27150 if (FDCS->address != -1) {
27151 - if (floppy_request_regions(fdc))
27152 - goto cleanup;
27153 + if (!request_region(FDCS->address + 2, 4, "floppy")) {
27154 + DPRINT("Floppy io-port 0x%04lx in use\n",
27155 + FDCS->address + 2);
27156 + goto cleanup1;
27157 + }
27158 + if (!request_region(FDCS->address + 7, 1, "floppy DIR")) {
27159 + DPRINT("Floppy io-port 0x%04lx in use\n",
27160 + FDCS->address + 7);
27161 + goto cleanup2;
27162 + }
27163 + /* address + 6 is reserved, and may be taken by IDE.
27164 + * Unfortunately, Adaptec doesn't know this :-(, */
27165 }
27166 }
27167 for (fdc = 0; fdc < N_FDC; fdc++) {
27168 @@ -4463,11 +4432,15 @@
27169 fdc = 0;
27170 irqdma_allocated = 1;
27171 return 0;
27172 -cleanup:
27173 +cleanup2:
27174 + release_region(FDCS->address + 2, 4);
27175 +cleanup1:
27176 fd_free_irq();
27177 fd_free_dma();
27178 - while (--fdc >= 0)
27179 - floppy_release_regions(fdc);
27180 + while (--fdc >= 0) {
27181 + release_region(FDCS->address + 2, 4);
27182 + release_region(FDCS->address + 7, 1);
27183 + }
27184 spin_lock_irqsave(&floppy_usage_lock, flags);
27185 usage_count--;
27186 spin_unlock_irqrestore(&floppy_usage_lock, flags);
27187 @@ -4528,8 +4501,10 @@
27188 #endif
27189 old_fdc = fdc;
27190 for (fdc = 0; fdc < N_FDC; fdc++)
27191 - if (FDCS->address != -1)
27192 - floppy_release_regions(fdc);
27193 + if (FDCS->address != -1) {
27194 + release_region(FDCS->address + 2, 4);
27195 + release_region(FDCS->address + 7, 1);
27196 + }
27197 fdc = old_fdc;
27198 }
27199
27200 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/block/loop.c linux-2.6.29-rc3.owrt/drivers/block/loop.c
27201 --- linux-2.6.29.owrt/drivers/block/loop.c 2009-05-10 22:04:38.000000000 +0200
27202 +++ linux-2.6.29-rc3.owrt/drivers/block/loop.c 2009-05-10 23:48:28.000000000 +0200
27203 @@ -392,7 +392,8 @@
27204 struct loop_device *lo = p->lo;
27205 struct page *page = buf->page;
27206 sector_t IV;
27207 - int size, ret;
27208 + size_t size;
27209 + int ret;
27210
27211 ret = buf->ops->confirm(pipe, buf);
27212 if (unlikely(ret))
27213 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/block/Makefile linux-2.6.29-rc3.owrt/drivers/block/Makefile
27214 --- linux-2.6.29.owrt/drivers/block/Makefile 2009-05-10 22:04:38.000000000 +0200
27215 +++ linux-2.6.29-rc3.owrt/drivers/block/Makefile 2009-05-10 23:48:28.000000000 +0200
27216 @@ -9,7 +9,6 @@
27217 obj-$(CONFIG_BLK_DEV_FD) += floppy.o
27218 obj-$(CONFIG_AMIGA_FLOPPY) += amiflop.o
27219 obj-$(CONFIG_PS3_DISK) += ps3disk.o
27220 -obj-$(CONFIG_PS3_VRAM) += ps3vram.o
27221 obj-$(CONFIG_ATARI_FLOPPY) += ataflop.o
27222 obj-$(CONFIG_AMIGA_Z2RAM) += z2ram.o
27223 obj-$(CONFIG_BLK_DEV_RAM) += brd.o
27224 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/block/nbd.c linux-2.6.29-rc3.owrt/drivers/block/nbd.c
27225 --- linux-2.6.29.owrt/drivers/block/nbd.c 2009-05-10 22:04:38.000000000 +0200
27226 +++ linux-2.6.29-rc3.owrt/drivers/block/nbd.c 2009-05-10 23:48:28.000000000 +0200
27227 @@ -549,15 +549,6 @@
27228
27229 BUG_ON(lo->magic != LO_MAGIC);
27230
27231 - if (unlikely(!lo->sock)) {
27232 - printk(KERN_ERR "%s: Attempted send on closed socket\n",
27233 - lo->disk->disk_name);
27234 - req->errors++;
27235 - nbd_end_request(req);
27236 - spin_lock_irq(q->queue_lock);
27237 - continue;
27238 - }
27239 -
27240 spin_lock_irq(&lo->queue_lock);
27241 list_add_tail(&req->queuelist, &lo->waiting_queue);
27242 spin_unlock_irq(&lo->queue_lock);
27243 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/block/paride/pg.c linux-2.6.29-rc3.owrt/drivers/block/paride/pg.c
27244 --- linux-2.6.29.owrt/drivers/block/paride/pg.c 2009-05-10 22:04:38.000000000 +0200
27245 +++ linux-2.6.29-rc3.owrt/drivers/block/paride/pg.c 2009-05-10 23:48:28.000000000 +0200
27246 @@ -422,7 +422,7 @@
27247
27248 for (k = 0; k < len; k++) {
27249 char c = *buf++;
27250 - if (c != ' ' && c != l)
27251 + if (c != ' ' || c != l)
27252 l = *targ++ = c;
27253 }
27254 if (l == ' ')
27255 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/block/ps3vram.c linux-2.6.29-rc3.owrt/drivers/block/ps3vram.c
27256 --- linux-2.6.29.owrt/drivers/block/ps3vram.c 2009-05-10 22:04:38.000000000 +0200
27257 +++ linux-2.6.29-rc3.owrt/drivers/block/ps3vram.c 1970-01-01 01:00:00.000000000 +0100
27258 @@ -1,865 +0,0 @@
27259 -/*
27260 - * ps3vram - Use extra PS3 video ram as MTD block device.
27261 - *
27262 - * Copyright 2009 Sony Corporation
27263 - *
27264 - * Based on the MTD ps3vram driver, which is
27265 - * Copyright (c) 2007-2008 Jim Paris <jim@jtan.com>
27266 - * Added support RSX DMA Vivien Chappelier <vivien.chappelier@free.fr>
27267 - */
27268 -
27269 -#include <linux/blkdev.h>
27270 -#include <linux/delay.h>
27271 -#include <linux/proc_fs.h>
27272 -#include <linux/seq_file.h>
27273 -
27274 -#include <asm/firmware.h>
27275 -#include <asm/lv1call.h>
27276 -#include <asm/ps3.h>
27277 -
27278 -
27279 -#define DEVICE_NAME "ps3vram"
27280 -
27281 -
27282 -#define XDR_BUF_SIZE (2 * 1024 * 1024) /* XDR buffer (must be 1MiB aligned) */
27283 -#define XDR_IOIF 0x0c000000
27284 -
27285 -#define FIFO_BASE XDR_IOIF
27286 -#define FIFO_SIZE (64 * 1024)
27287 -
27288 -#define DMA_PAGE_SIZE (4 * 1024)
27289 -
27290 -#define CACHE_PAGE_SIZE (256 * 1024)
27291 -#define CACHE_PAGE_COUNT ((XDR_BUF_SIZE - FIFO_SIZE) / CACHE_PAGE_SIZE)
27292 -
27293 -#define CACHE_OFFSET CACHE_PAGE_SIZE
27294 -#define FIFO_OFFSET 0
27295 -
27296 -#define CTRL_PUT 0x10
27297 -#define CTRL_GET 0x11
27298 -#define CTRL_TOP 0x15
27299 -
27300 -#define UPLOAD_SUBCH 1
27301 -#define DOWNLOAD_SUBCH 2
27302 -
27303 -#define NV_MEMORY_TO_MEMORY_FORMAT_OFFSET_IN 0x0000030c
27304 -#define NV_MEMORY_TO_MEMORY_FORMAT_NOTIFY 0x00000104
27305 -
27306 -#define L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT 0x601
27307 -
27308 -#define CACHE_PAGE_PRESENT 1
27309 -#define CACHE_PAGE_DIRTY 2
27310 -
27311 -struct ps3vram_tag {
27312 - unsigned int address;
27313 - unsigned int flags;
27314 -};
27315 -
27316 -struct ps3vram_cache {
27317 - unsigned int page_count;
27318 - unsigned int page_size;
27319 - struct ps3vram_tag *tags;
27320 - unsigned int hit;
27321 - unsigned int miss;
27322 -};
27323 -
27324 -struct ps3vram_priv {
27325 - struct request_queue *queue;
27326 - struct gendisk *gendisk;
27327 -
27328 - u64 size;
27329 -
27330 - u64 memory_handle;
27331 - u64 context_handle;
27332 - u32 *ctrl;
27333 - u32 *reports;
27334 - u8 __iomem *ddr_base;
27335 - u8 *xdr_buf;
27336 -
27337 - u32 *fifo_base;
27338 - u32 *fifo_ptr;
27339 -
27340 - struct ps3vram_cache cache;
27341 -
27342 - /* Used to serialize cache/DMA operations */
27343 - struct mutex lock;
27344 -};
27345 -
27346 -
27347 -static int ps3vram_major;
27348 -
27349 -
27350 -static struct block_device_operations ps3vram_fops = {
27351 - .owner = THIS_MODULE,
27352 -};
27353 -
27354 -
27355 -#define DMA_NOTIFIER_HANDLE_BASE 0x66604200 /* first DMA notifier handle */
27356 -#define DMA_NOTIFIER_OFFSET_BASE 0x1000 /* first DMA notifier offset */
27357 -#define DMA_NOTIFIER_SIZE 0x40
27358 -#define NOTIFIER 7 /* notifier used for completion report */
27359 -
27360 -static char *size = "256M";
27361 -module_param(size, charp, 0);
27362 -MODULE_PARM_DESC(size, "memory size");
27363 -
27364 -static u32 *ps3vram_get_notifier(u32 *reports, int notifier)
27365 -{
27366 - return (void *)reports + DMA_NOTIFIER_OFFSET_BASE +
27367 - DMA_NOTIFIER_SIZE * notifier;
27368 -}
27369 -
27370 -static void ps3vram_notifier_reset(struct ps3_system_bus_device *dev)
27371 -{
27372 - struct ps3vram_priv *priv = dev->core.driver_data;
27373 - u32 *notify = ps3vram_get_notifier(priv->reports, NOTIFIER);
27374 - int i;
27375 -
27376 - for (i = 0; i < 4; i++)
27377 - notify[i] = 0xffffffff;
27378 -}
27379 -
27380 -static int ps3vram_notifier_wait(struct ps3_system_bus_device *dev,
27381 - unsigned int timeout_ms)
27382 -{
27383 - struct ps3vram_priv *priv = dev->core.driver_data;
27384 - u32 *notify = ps3vram_get_notifier(priv->reports, NOTIFIER);
27385 - unsigned long timeout = jiffies + msecs_to_jiffies(timeout_ms);
27386 -
27387 - do {
27388 - if (!notify[3])
27389 - return 0;
27390 - msleep(1);
27391 - } while (time_before(jiffies, timeout));
27392 -
27393 - return -ETIMEDOUT;
27394 -}
27395 -
27396 -static void ps3vram_init_ring(struct ps3_system_bus_device *dev)
27397 -{
27398 - struct ps3vram_priv *priv = dev->core.driver_data;
27399 -
27400 - priv->ctrl[CTRL_PUT] = FIFO_BASE + FIFO_OFFSET;
27401 - priv->ctrl[CTRL_GET] = FIFO_BASE + FIFO_OFFSET;
27402 -}
27403 -
27404 -static int ps3vram_wait_ring(struct ps3_system_bus_device *dev,
27405 - unsigned int timeout_ms)
27406 -{
27407 - struct ps3vram_priv *priv = dev->core.driver_data;
27408 - unsigned long timeout = jiffies + msecs_to_jiffies(timeout_ms);
27409 -
27410 - do {
27411 - if (priv->ctrl[CTRL_PUT] == priv->ctrl[CTRL_GET])
27412 - return 0;
27413 - msleep(1);
27414 - } while (time_before(jiffies, timeout));
27415 -
27416 - dev_warn(&dev->core, "FIFO timeout (%08x/%08x/%08x)\n",
27417 - priv->ctrl[CTRL_PUT], priv->ctrl[CTRL_GET],
27418 - priv->ctrl[CTRL_TOP]);
27419 -
27420 - return -ETIMEDOUT;
27421 -}
27422 -
27423 -static void ps3vram_out_ring(struct ps3vram_priv *priv, u32 data)
27424 -{
27425 - *(priv->fifo_ptr)++ = data;
27426 -}
27427 -
27428 -static void ps3vram_begin_ring(struct ps3vram_priv *priv, u32 chan, u32 tag,
27429 - u32 size)
27430 -{
27431 - ps3vram_out_ring(priv, (size << 18) | (chan << 13) | tag);
27432 -}
27433 -
27434 -static void ps3vram_rewind_ring(struct ps3_system_bus_device *dev)
27435 -{
27436 - struct ps3vram_priv *priv = dev->core.driver_data;
27437 - int status;
27438 -
27439 - ps3vram_out_ring(priv, 0x20000000 | (FIFO_BASE + FIFO_OFFSET));
27440 -
27441 - priv->ctrl[CTRL_PUT] = FIFO_BASE + FIFO_OFFSET;
27442 -
27443 - /* asking the HV for a blit will kick the FIFO */
27444 - status = lv1_gpu_context_attribute(priv->context_handle,
27445 - L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT, 0,
27446 - 0, 0, 0);
27447 - if (status)
27448 - dev_err(&dev->core,
27449 - "%s: lv1_gpu_context_attribute failed %d\n", __func__,
27450 - status);
27451 -
27452 - priv->fifo_ptr = priv->fifo_base;
27453 -}
27454 -
27455 -static void ps3vram_fire_ring(struct ps3_system_bus_device *dev)
27456 -{
27457 - struct ps3vram_priv *priv = dev->core.driver_data;
27458 - int status;
27459 -
27460 - mutex_lock(&ps3_gpu_mutex);
27461 -
27462 - priv->ctrl[CTRL_PUT] = FIFO_BASE + FIFO_OFFSET +
27463 - (priv->fifo_ptr - priv->fifo_base) * sizeof(u32);
27464 -
27465 - /* asking the HV for a blit will kick the FIFO */
27466 - status = lv1_gpu_context_attribute(priv->context_handle,
27467 - L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT, 0,
27468 - 0, 0, 0);
27469 - if (status)
27470 - dev_err(&dev->core,
27471 - "%s: lv1_gpu_context_attribute failed %d\n", __func__,
27472 - status);
27473 -
27474 - if ((priv->fifo_ptr - priv->fifo_base) * sizeof(u32) >
27475 - FIFO_SIZE - 1024) {
27476 - dev_dbg(&dev->core, "FIFO full, rewinding\n");
27477 - ps3vram_wait_ring(dev, 200);
27478 - ps3vram_rewind_ring(dev);
27479 - }
27480 -
27481 - mutex_unlock(&ps3_gpu_mutex);
27482 -}
27483 -
27484 -static void ps3vram_bind(struct ps3_system_bus_device *dev)
27485 -{
27486 - struct ps3vram_priv *priv = dev->core.driver_data;
27487 -
27488 - ps3vram_begin_ring(priv, UPLOAD_SUBCH, 0, 1);
27489 - ps3vram_out_ring(priv, 0x31337303);
27490 - ps3vram_begin_ring(priv, UPLOAD_SUBCH, 0x180, 3);
27491 - ps3vram_out_ring(priv, DMA_NOTIFIER_HANDLE_BASE + NOTIFIER);
27492 - ps3vram_out_ring(priv, 0xfeed0001); /* DMA system RAM instance */
27493 - ps3vram_out_ring(priv, 0xfeed0000); /* DMA video RAM instance */
27494 -
27495 - ps3vram_begin_ring(priv, DOWNLOAD_SUBCH, 0, 1);
27496 - ps3vram_out_ring(priv, 0x3137c0de);
27497 - ps3vram_begin_ring(priv, DOWNLOAD_SUBCH, 0x180, 3);
27498 - ps3vram_out_ring(priv, DMA_NOTIFIER_HANDLE_BASE + NOTIFIER);
27499 - ps3vram_out_ring(priv, 0xfeed0000); /* DMA video RAM instance */
27500 - ps3vram_out_ring(priv, 0xfeed0001); /* DMA system RAM instance */
27501 -
27502 - ps3vram_fire_ring(dev);
27503 -}
27504 -
27505 -static int ps3vram_upload(struct ps3_system_bus_device *dev,
27506 - unsigned int src_offset, unsigned int dst_offset,
27507 - int len, int count)
27508 -{
27509 - struct ps3vram_priv *priv = dev->core.driver_data;
27510 -
27511 - ps3vram_begin_ring(priv, UPLOAD_SUBCH,
27512 - NV_MEMORY_TO_MEMORY_FORMAT_OFFSET_IN, 8);
27513 - ps3vram_out_ring(priv, XDR_IOIF + src_offset);
27514 - ps3vram_out_ring(priv, dst_offset);
27515 - ps3vram_out_ring(priv, len);
27516 - ps3vram_out_ring(priv, len);
27517 - ps3vram_out_ring(priv, len);
27518 - ps3vram_out_ring(priv, count);
27519 - ps3vram_out_ring(priv, (1 << 8) | 1);
27520 - ps3vram_out_ring(priv, 0);
27521 -
27522 - ps3vram_notifier_reset(dev);
27523 - ps3vram_begin_ring(priv, UPLOAD_SUBCH,
27524 - NV_MEMORY_TO_MEMORY_FORMAT_NOTIFY, 1);
27525 - ps3vram_out_ring(priv, 0);
27526 - ps3vram_begin_ring(priv, UPLOAD_SUBCH, 0x100, 1);
27527 - ps3vram_out_ring(priv, 0);
27528 - ps3vram_fire_ring(dev);
27529 - if (ps3vram_notifier_wait(dev, 200) < 0) {
27530 - dev_warn(&dev->core, "%s: Notifier timeout\n", __func__);
27531 - return -1;
27532 - }
27533 -
27534 - return 0;
27535 -}
27536 -
27537 -static int ps3vram_download(struct ps3_system_bus_device *dev,
27538 - unsigned int src_offset, unsigned int dst_offset,
27539 - int len, int count)
27540 -{
27541 - struct ps3vram_priv *priv = dev->core.driver_data;
27542 -
27543 - ps3vram_begin_ring(priv, DOWNLOAD_SUBCH,
27544 - NV_MEMORY_TO_MEMORY_FORMAT_OFFSET_IN, 8);
27545 - ps3vram_out_ring(priv, src_offset);
27546 - ps3vram_out_ring(priv, XDR_IOIF + dst_offset);
27547 - ps3vram_out_ring(priv, len);
27548 - ps3vram_out_ring(priv, len);
27549 - ps3vram_out_ring(priv, len);
27550 - ps3vram_out_ring(priv, count);
27551 - ps3vram_out_ring(priv, (1 << 8) | 1);
27552 - ps3vram_out_ring(priv, 0);
27553 -
27554 - ps3vram_notifier_reset(dev);
27555 - ps3vram_begin_ring(priv, DOWNLOAD_SUBCH,
27556 - NV_MEMORY_TO_MEMORY_FORMAT_NOTIFY, 1);
27557 - ps3vram_out_ring(priv, 0);
27558 - ps3vram_begin_ring(priv, DOWNLOAD_SUBCH, 0x100, 1);
27559 - ps3vram_out_ring(priv, 0);
27560 - ps3vram_fire_ring(dev);
27561 - if (ps3vram_notifier_wait(dev, 200) < 0) {
27562 - dev_warn(&dev->core, "%s: Notifier timeout\n", __func__);
27563 - return -1;
27564 - }
27565 -
27566 - return 0;
27567 -}
27568 -
27569 -static void ps3vram_cache_evict(struct ps3_system_bus_device *dev, int entry)
27570 -{
27571 - struct ps3vram_priv *priv = dev->core.driver_data;
27572 - struct ps3vram_cache *cache = &priv->cache;
27573 -
27574 - if (!(cache->tags[entry].flags & CACHE_PAGE_DIRTY))
27575 - return;
27576 -
27577 - dev_dbg(&dev->core, "Flushing %d: 0x%08x\n", entry,
27578 - cache->tags[entry].address);
27579 - if (ps3vram_upload(dev, CACHE_OFFSET + entry * cache->page_size,
27580 - cache->tags[entry].address, DMA_PAGE_SIZE,
27581 - cache->page_size / DMA_PAGE_SIZE) < 0) {
27582 - dev_err(&dev->core,
27583 - "Failed to upload from 0x%x to " "0x%x size 0x%x\n",
27584 - entry * cache->page_size, cache->tags[entry].address,
27585 - cache->page_size);
27586 - }
27587 - cache->tags[entry].flags &= ~CACHE_PAGE_DIRTY;
27588 -}
27589 -
27590 -static void ps3vram_cache_load(struct ps3_system_bus_device *dev, int entry,
27591 - unsigned int address)
27592 -{
27593 - struct ps3vram_priv *priv = dev->core.driver_data;
27594 - struct ps3vram_cache *cache = &priv->cache;
27595 -
27596 - dev_dbg(&dev->core, "Fetching %d: 0x%08x\n", entry, address);
27597 - if (ps3vram_download(dev, address,
27598 - CACHE_OFFSET + entry * cache->page_size,
27599 - DMA_PAGE_SIZE,
27600 - cache->page_size / DMA_PAGE_SIZE) < 0) {
27601 - dev_err(&dev->core,
27602 - "Failed to download from 0x%x to 0x%x size 0x%x\n",
27603 - address, entry * cache->page_size, cache->page_size);
27604 - }
27605 -
27606 - cache->tags[entry].address = address;
27607 - cache->tags[entry].flags |= CACHE_PAGE_PRESENT;
27608 -}
27609 -
27610 -
27611 -static void ps3vram_cache_flush(struct ps3_system_bus_device *dev)
27612 -{
27613 - struct ps3vram_priv *priv = dev->core.driver_data;
27614 - struct ps3vram_cache *cache = &priv->cache;
27615 - int i;
27616 -
27617 - dev_dbg(&dev->core, "FLUSH\n");
27618 - for (i = 0; i < cache->page_count; i++) {
27619 - ps3vram_cache_evict(dev, i);
27620 - cache->tags[i].flags = 0;
27621 - }
27622 -}
27623 -
27624 -static unsigned int ps3vram_cache_match(struct ps3_system_bus_device *dev,
27625 - loff_t address)
27626 -{
27627 - struct ps3vram_priv *priv = dev->core.driver_data;
27628 - struct ps3vram_cache *cache = &priv->cache;
27629 - unsigned int base;
27630 - unsigned int offset;
27631 - int i;
27632 - static int counter;
27633 -
27634 - offset = (unsigned int) (address & (cache->page_size - 1));
27635 - base = (unsigned int) (address - offset);
27636 -
27637 - /* fully associative check */
27638 - for (i = 0; i < cache->page_count; i++) {
27639 - if ((cache->tags[i].flags & CACHE_PAGE_PRESENT) &&
27640 - cache->tags[i].address == base) {
27641 - cache->hit++;
27642 - dev_dbg(&dev->core, "Found entry %d: 0x%08x\n", i,
27643 - cache->tags[i].address);
27644 - return i;
27645 - }
27646 - }
27647 -
27648 - /* choose a random entry */
27649 - i = (jiffies + (counter++)) % cache->page_count;
27650 - dev_dbg(&dev->core, "Using entry %d\n", i);
27651 -
27652 - ps3vram_cache_evict(dev, i);
27653 - ps3vram_cache_load(dev, i, base);
27654 -
27655 - cache->miss++;
27656 - return i;
27657 -}
27658 -
27659 -static int ps3vram_cache_init(struct ps3_system_bus_device *dev)
27660 -{
27661 - struct ps3vram_priv *priv = dev->core.driver_data;
27662 -
27663 - priv->cache.page_count = CACHE_PAGE_COUNT;
27664 - priv->cache.page_size = CACHE_PAGE_SIZE;
27665 - priv->cache.tags = kzalloc(sizeof(struct ps3vram_tag) *
27666 - CACHE_PAGE_COUNT, GFP_KERNEL);
27667 - if (priv->cache.tags == NULL) {
27668 - dev_err(&dev->core, "Could not allocate cache tags\n");
27669 - return -ENOMEM;
27670 - }
27671 -
27672 - dev_info(&dev->core, "Created ram cache: %d entries, %d KiB each\n",
27673 - CACHE_PAGE_COUNT, CACHE_PAGE_SIZE / 1024);
27674 -
27675 - return 0;
27676 -}
27677 -
27678 -static void ps3vram_cache_cleanup(struct ps3_system_bus_device *dev)
27679 -{
27680 - struct ps3vram_priv *priv = dev->core.driver_data;
27681 -
27682 - ps3vram_cache_flush(dev);
27683 - kfree(priv->cache.tags);
27684 -}
27685 -
27686 -static int ps3vram_read(struct ps3_system_bus_device *dev, loff_t from,
27687 - size_t len, size_t *retlen, u_char *buf)
27688 -{
27689 - struct ps3vram_priv *priv = dev->core.driver_data;
27690 - unsigned int cached, count;
27691 -
27692 - dev_dbg(&dev->core, "%s: from=0x%08x len=0x%zx\n", __func__,
27693 - (unsigned int)from, len);
27694 -
27695 - if (from >= priv->size)
27696 - return -EIO;
27697 -
27698 - if (len > priv->size - from)
27699 - len = priv->size - from;
27700 -
27701 - /* Copy from vram to buf */
27702 - count = len;
27703 - while (count) {
27704 - unsigned int offset, avail;
27705 - unsigned int entry;
27706 -
27707 - offset = (unsigned int) (from & (priv->cache.page_size - 1));
27708 - avail = priv->cache.page_size - offset;
27709 -
27710 - mutex_lock(&priv->lock);
27711 -
27712 - entry = ps3vram_cache_match(dev, from);
27713 - cached = CACHE_OFFSET + entry * priv->cache.page_size + offset;
27714 -
27715 - dev_dbg(&dev->core, "%s: from=%08x cached=%08x offset=%08x "
27716 - "avail=%08x count=%08x\n", __func__,
27717 - (unsigned int)from, cached, offset, avail, count);
27718 -
27719 - if (avail > count)
27720 - avail = count;
27721 - memcpy(buf, priv->xdr_buf + cached, avail);
27722 -
27723 - mutex_unlock(&priv->lock);
27724 -
27725 - buf += avail;
27726 - count -= avail;
27727 - from += avail;
27728 - }
27729 -
27730 - *retlen = len;
27731 - return 0;
27732 -}
27733 -
27734 -static int ps3vram_write(struct ps3_system_bus_device *dev, loff_t to,
27735 - size_t len, size_t *retlen, const u_char *buf)
27736 -{
27737 - struct ps3vram_priv *priv = dev->core.driver_data;
27738 - unsigned int cached, count;
27739 -
27740 - if (to >= priv->size)
27741 - return -EIO;
27742 -
27743 - if (len > priv->size - to)
27744 - len = priv->size - to;
27745 -
27746 - /* Copy from buf to vram */
27747 - count = len;
27748 - while (count) {
27749 - unsigned int offset, avail;
27750 - unsigned int entry;
27751 -
27752 - offset = (unsigned int) (to & (priv->cache.page_size - 1));
27753 - avail = priv->cache.page_size - offset;
27754 -
27755 - mutex_lock(&priv->lock);
27756 -
27757 - entry = ps3vram_cache_match(dev, to);
27758 - cached = CACHE_OFFSET + entry * priv->cache.page_size + offset;
27759 -
27760 - dev_dbg(&dev->core, "%s: to=%08x cached=%08x offset=%08x "
27761 - "avail=%08x count=%08x\n", __func__, (unsigned int)to,
27762 - cached, offset, avail, count);
27763 -
27764 - if (avail > count)
27765 - avail = count;
27766 - memcpy(priv->xdr_buf + cached, buf, avail);
27767 -
27768 - priv->cache.tags[entry].flags |= CACHE_PAGE_DIRTY;
27769 -
27770 - mutex_unlock(&priv->lock);
27771 -
27772 - buf += avail;
27773 - count -= avail;
27774 - to += avail;
27775 - }
27776 -
27777 - *retlen = len;
27778 - return 0;
27779 -}
27780 -
27781 -static int ps3vram_proc_show(struct seq_file *m, void *v)
27782 -{
27783 - struct ps3vram_priv *priv = m->private;
27784 -
27785 - seq_printf(m, "hit:%u\nmiss:%u\n", priv->cache.hit, priv->cache.miss);
27786 - return 0;
27787 -}
27788 -
27789 -static int ps3vram_proc_open(struct inode *inode, struct file *file)
27790 -{
27791 - return single_open(file, ps3vram_proc_show, PDE(inode)->data);
27792 -}
27793 -
27794 -static const struct file_operations ps3vram_proc_fops = {
27795 - .owner = THIS_MODULE,
27796 - .open = ps3vram_proc_open,
27797 - .read = seq_read,
27798 - .llseek = seq_lseek,
27799 - .release = single_release,
27800 -};
27801 -
27802 -static void __devinit ps3vram_proc_init(struct ps3_system_bus_device *dev)
27803 -{
27804 - struct ps3vram_priv *priv = dev->core.driver_data;
27805 - struct proc_dir_entry *pde;
27806 -
27807 - pde = proc_create(DEVICE_NAME, 0444, NULL, &ps3vram_proc_fops);
27808 - if (!pde) {
27809 - dev_warn(&dev->core, "failed to create /proc entry\n");
27810 - return;
27811 - }
27812 -
27813 - pde->owner = THIS_MODULE;
27814 - pde->data = priv;
27815 -}
27816 -
27817 -static int ps3vram_make_request(struct request_queue *q, struct bio *bio)
27818 -{
27819 - struct ps3_system_bus_device *dev = q->queuedata;
27820 - int write = bio_data_dir(bio) == WRITE;
27821 - const char *op = write ? "write" : "read";
27822 - loff_t offset = bio->bi_sector << 9;
27823 - int error = 0;
27824 - struct bio_vec *bvec;
27825 - unsigned int i;
27826 -
27827 - dev_dbg(&dev->core, "%s\n", __func__);
27828 -
27829 - bio_for_each_segment(bvec, bio, i) {
27830 - /* PS3 is ppc64, so we don't handle highmem */
27831 - char *ptr = page_address(bvec->bv_page) + bvec->bv_offset;
27832 - size_t len = bvec->bv_len, retlen;
27833 -
27834 - dev_dbg(&dev->core, " %s %zu bytes at offset %llu\n", op,
27835 - len, offset);
27836 - if (write)
27837 - error = ps3vram_write(dev, offset, len, &retlen, ptr);
27838 - else
27839 - error = ps3vram_read(dev, offset, len, &retlen, ptr);
27840 -
27841 - if (error) {
27842 - dev_err(&dev->core, "%s failed\n", op);
27843 - goto out;
27844 - }
27845 -
27846 - if (retlen != len) {
27847 - dev_err(&dev->core, "Short %s\n", op);
27848 - goto out;
27849 - }
27850 -
27851 - offset += len;
27852 - }
27853 -
27854 - dev_dbg(&dev->core, "%s completed\n", op);
27855 -
27856 -out:
27857 - bio_endio(bio, error);
27858 - return 0;
27859 -}
27860 -
27861 -static int __devinit ps3vram_probe(struct ps3_system_bus_device *dev)
27862 -{
27863 - struct ps3vram_priv *priv;
27864 - int error, status;
27865 - struct request_queue *queue;
27866 - struct gendisk *gendisk;
27867 - u64 ddr_lpar, ctrl_lpar, info_lpar, reports_lpar, ddr_size,
27868 - reports_size;
27869 - char *rest;
27870 -
27871 - priv = kzalloc(sizeof(*priv), GFP_KERNEL);
27872 - if (!priv) {
27873 - error = -ENOMEM;
27874 - goto fail;
27875 - }
27876 -
27877 - mutex_init(&priv->lock);
27878 - dev->core.driver_data = priv;
27879 -
27880 - priv = dev->core.driver_data;
27881 -
27882 - /* Allocate XDR buffer (1MiB aligned) */
27883 - priv->xdr_buf = (void *)__get_free_pages(GFP_KERNEL,
27884 - get_order(XDR_BUF_SIZE));
27885 - if (priv->xdr_buf == NULL) {
27886 - dev_err(&dev->core, "Could not allocate XDR buffer\n");
27887 - error = -ENOMEM;
27888 - goto fail_free_priv;
27889 - }
27890 -
27891 - /* Put FIFO at begginning of XDR buffer */
27892 - priv->fifo_base = (u32 *) (priv->xdr_buf + FIFO_OFFSET);
27893 - priv->fifo_ptr = priv->fifo_base;
27894 -
27895 - /* XXX: Need to open GPU, in case ps3fb or snd_ps3 aren't loaded */
27896 - if (ps3_open_hv_device(dev)) {
27897 - dev_err(&dev->core, "ps3_open_hv_device failed\n");
27898 - error = -EAGAIN;
27899 - goto out_close_gpu;
27900 - }
27901 -
27902 - /* Request memory */
27903 - status = -1;
27904 - ddr_size = ALIGN(memparse(size, &rest), 1024*1024);
27905 - if (!ddr_size) {
27906 - dev_err(&dev->core, "Specified size is too small\n");
27907 - error = -EINVAL;
27908 - goto out_close_gpu;
27909 - }
27910 -
27911 - while (ddr_size > 0) {
27912 - status = lv1_gpu_memory_allocate(ddr_size, 0, 0, 0, 0,
27913 - &priv->memory_handle,
27914 - &ddr_lpar);
27915 - if (!status)
27916 - break;
27917 - ddr_size -= 1024*1024;
27918 - }
27919 - if (status) {
27920 - dev_err(&dev->core, "lv1_gpu_memory_allocate failed %d\n",
27921 - status);
27922 - error = -ENOMEM;
27923 - goto out_free_xdr_buf;
27924 - }
27925 -
27926 - /* Request context */
27927 - status = lv1_gpu_context_allocate(priv->memory_handle, 0,
27928 - &priv->context_handle, &ctrl_lpar,
27929 - &info_lpar, &reports_lpar,
27930 - &reports_size);
27931 - if (status) {
27932 - dev_err(&dev->core, "lv1_gpu_context_allocate failed %d\n",
27933 - status);
27934 - error = -ENOMEM;
27935 - goto out_free_memory;
27936 - }
27937 -
27938 - /* Map XDR buffer to RSX */
27939 - status = lv1_gpu_context_iomap(priv->context_handle, XDR_IOIF,
27940 - ps3_mm_phys_to_lpar(__pa(priv->xdr_buf)),
27941 - XDR_BUF_SIZE, 0);
27942 - if (status) {
27943 - dev_err(&dev->core, "lv1_gpu_context_iomap failed %d\n",
27944 - status);
27945 - error = -ENOMEM;
27946 - goto out_free_context;
27947 - }
27948 -
27949 - priv->ddr_base = ioremap_flags(ddr_lpar, ddr_size, _PAGE_NO_CACHE);
27950 -
27951 - if (!priv->ddr_base) {
27952 - dev_err(&dev->core, "ioremap DDR failed\n");
27953 - error = -ENOMEM;
27954 - goto out_free_context;
27955 - }
27956 -
27957 - priv->ctrl = ioremap(ctrl_lpar, 64 * 1024);
27958 - if (!priv->ctrl) {
27959 - dev_err(&dev->core, "ioremap CTRL failed\n");
27960 - error = -ENOMEM;
27961 - goto out_unmap_vram;
27962 - }
27963 -
27964 - priv->reports = ioremap(reports_lpar, reports_size);
27965 - if (!priv->reports) {
27966 - dev_err(&dev->core, "ioremap REPORTS failed\n");
27967 - error = -ENOMEM;
27968 - goto out_unmap_ctrl;
27969 - }
27970 -
27971 - mutex_lock(&ps3_gpu_mutex);
27972 - ps3vram_init_ring(dev);
27973 - mutex_unlock(&ps3_gpu_mutex);
27974 -
27975 - priv->size = ddr_size;
27976 -
27977 - ps3vram_bind(dev);
27978 -
27979 - mutex_lock(&ps3_gpu_mutex);
27980 - error = ps3vram_wait_ring(dev, 100);
27981 - mutex_unlock(&ps3_gpu_mutex);
27982 - if (error < 0) {
27983 - dev_err(&dev->core, "Failed to initialize channels\n");
27984 - error = -ETIMEDOUT;
27985 - goto out_unmap_reports;
27986 - }
27987 -
27988 - ps3vram_cache_init(dev);
27989 - ps3vram_proc_init(dev);
27990 -
27991 - queue = blk_alloc_queue(GFP_KERNEL);
27992 - if (!queue) {
27993 - dev_err(&dev->core, "blk_alloc_queue failed\n");
27994 - error = -ENOMEM;
27995 - goto out_cache_cleanup;
27996 - }
27997 -
27998 - priv->queue = queue;
27999 - queue->queuedata = dev;
28000 - blk_queue_make_request(queue, ps3vram_make_request);
28001 - blk_queue_max_phys_segments(queue, MAX_PHYS_SEGMENTS);
28002 - blk_queue_max_hw_segments(queue, MAX_HW_SEGMENTS);
28003 - blk_queue_max_segment_size(queue, MAX_SEGMENT_SIZE);
28004 - blk_queue_max_sectors(queue, SAFE_MAX_SECTORS);
28005 -
28006 - gendisk = alloc_disk(1);
28007 - if (!gendisk) {
28008 - dev_err(&dev->core, "alloc_disk failed\n");
28009 - error = -ENOMEM;
28010 - goto fail_cleanup_queue;
28011 - }
28012 -
28013 - priv->gendisk = gendisk;
28014 - gendisk->major = ps3vram_major;
28015 - gendisk->first_minor = 0;
28016 - gendisk->fops = &ps3vram_fops;
28017 - gendisk->queue = queue;
28018 - gendisk->private_data = dev;
28019 - gendisk->driverfs_dev = &dev->core;
28020 - strlcpy(gendisk->disk_name, DEVICE_NAME, sizeof(gendisk->disk_name));
28021 - set_capacity(gendisk, priv->size >> 9);
28022 -
28023 - dev_info(&dev->core, "%s: Using %lu MiB of GPU memory\n",
28024 - gendisk->disk_name, get_capacity(gendisk) >> 11);
28025 -
28026 - add_disk(gendisk);
28027 - return 0;
28028 -
28029 -fail_cleanup_queue:
28030 - blk_cleanup_queue(queue);
28031 -out_cache_cleanup:
28032 - remove_proc_entry(DEVICE_NAME, NULL);
28033 - ps3vram_cache_cleanup(dev);
28034 -out_unmap_reports:
28035 - iounmap(priv->reports);
28036 -out_unmap_ctrl:
28037 - iounmap(priv->ctrl);
28038 -out_unmap_vram:
28039 - iounmap(priv->ddr_base);
28040 -out_free_context:
28041 - lv1_gpu_context_free(priv->context_handle);
28042 -out_free_memory:
28043 - lv1_gpu_memory_free(priv->memory_handle);
28044 -out_close_gpu:
28045 - ps3_close_hv_device(dev);
28046 -out_free_xdr_buf:
28047 - free_pages((unsigned long) priv->xdr_buf, get_order(XDR_BUF_SIZE));
28048 -fail_free_priv:
28049 - kfree(priv);
28050 - dev->core.driver_data = NULL;
28051 -fail:
28052 - return error;
28053 -}
28054 -
28055 -static int ps3vram_remove(struct ps3_system_bus_device *dev)
28056 -{
28057 - struct ps3vram_priv *priv = dev->core.driver_data;
28058 -
28059 - del_gendisk(priv->gendisk);
28060 - put_disk(priv->gendisk);
28061 - blk_cleanup_queue(priv->queue);
28062 - remove_proc_entry(DEVICE_NAME, NULL);
28063 - ps3vram_cache_cleanup(dev);
28064 - iounmap(priv->reports);
28065 - iounmap(priv->ctrl);
28066 - iounmap(priv->ddr_base);
28067 - lv1_gpu_context_free(priv->context_handle);
28068 - lv1_gpu_memory_free(priv->memory_handle);
28069 - ps3_close_hv_device(dev);
28070 - free_pages((unsigned long) priv->xdr_buf, get_order(XDR_BUF_SIZE));
28071 - kfree(priv);
28072 - dev->core.driver_data = NULL;
28073 - return 0;
28074 -}
28075 -
28076 -static struct ps3_system_bus_driver ps3vram = {
28077 - .match_id = PS3_MATCH_ID_GPU,
28078 - .match_sub_id = PS3_MATCH_SUB_ID_GPU_RAMDISK,
28079 - .core.name = DEVICE_NAME,
28080 - .core.owner = THIS_MODULE,
28081 - .probe = ps3vram_probe,
28082 - .remove = ps3vram_remove,
28083 - .shutdown = ps3vram_remove,
28084 -};
28085 -
28086 -
28087 -static int __init ps3vram_init(void)
28088 -{
28089 - int error;
28090 -
28091 - if (!firmware_has_feature(FW_FEATURE_PS3_LV1))
28092 - return -ENODEV;
28093 -
28094 - error = register_blkdev(0, DEVICE_NAME);
28095 - if (error <= 0) {
28096 - pr_err("%s: register_blkdev failed %d\n", DEVICE_NAME, error);
28097 - return error;
28098 - }
28099 - ps3vram_major = error;
28100 -
28101 - pr_info("%s: registered block device major %d\n", DEVICE_NAME,
28102 - ps3vram_major);
28103 -
28104 - error = ps3_system_bus_driver_register(&ps3vram);
28105 - if (error)
28106 - unregister_blkdev(ps3vram_major, DEVICE_NAME);
28107 -
28108 - return error;
28109 -}
28110 -
28111 -static void __exit ps3vram_exit(void)
28112 -{
28113 - ps3_system_bus_driver_unregister(&ps3vram);
28114 - unregister_blkdev(ps3vram_major, DEVICE_NAME);
28115 -}
28116 -
28117 -module_init(ps3vram_init);
28118 -module_exit(ps3vram_exit);
28119 -
28120 -MODULE_LICENSE("GPL");
28121 -MODULE_DESCRIPTION("PS3 Video RAM Storage Driver");
28122 -MODULE_AUTHOR("Sony Corporation");
28123 -MODULE_ALIAS(PS3_MODULE_ALIAS_GPU_RAMDISK);
28124 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/block/xen-blkfront.c linux-2.6.29-rc3.owrt/drivers/block/xen-blkfront.c
28125 --- linux-2.6.29.owrt/drivers/block/xen-blkfront.c 2009-05-10 22:04:38.000000000 +0200
28126 +++ linux-2.6.29-rc3.owrt/drivers/block/xen-blkfront.c 2009-05-10 23:48:28.000000000 +0200
28127 @@ -40,7 +40,6 @@
28128 #include <linux/hdreg.h>
28129 #include <linux/cdrom.h>
28130 #include <linux/module.h>
28131 -#include <linux/scatterlist.h>
28132
28133 #include <xen/xenbus.h>
28134 #include <xen/grant_table.h>
28135 @@ -83,7 +82,6 @@
28136 enum blkif_state connected;
28137 int ring_ref;
28138 struct blkif_front_ring ring;
28139 - struct scatterlist sg[BLKIF_MAX_SEGMENTS_PER_REQUEST];
28140 unsigned int evtchn, irq;
28141 struct request_queue *rq;
28142 struct work_struct work;
28143 @@ -206,11 +204,12 @@
28144 struct blkfront_info *info = req->rq_disk->private_data;
28145 unsigned long buffer_mfn;
28146 struct blkif_request *ring_req;
28147 + struct req_iterator iter;
28148 + struct bio_vec *bvec;
28149 unsigned long id;
28150 unsigned int fsect, lsect;
28151 - int i, ref;
28152 + int ref;
28153 grant_ref_t gref_head;
28154 - struct scatterlist *sg;
28155
28156 if (unlikely(info->connected != BLKIF_STATE_CONNECTED))
28157 return 1;
28158 @@ -239,13 +238,12 @@
28159 if (blk_barrier_rq(req))
28160 ring_req->operation = BLKIF_OP_WRITE_BARRIER;
28161
28162 - ring_req->nr_segments = blk_rq_map_sg(req->q, req, info->sg);
28163 - BUG_ON(ring_req->nr_segments > BLKIF_MAX_SEGMENTS_PER_REQUEST);
28164 -
28165 - for_each_sg(info->sg, sg, ring_req->nr_segments, i) {
28166 - buffer_mfn = pfn_to_mfn(page_to_pfn(sg_page(sg)));
28167 - fsect = sg->offset >> 9;
28168 - lsect = fsect + (sg->length >> 9) - 1;
28169 + ring_req->nr_segments = 0;
28170 + rq_for_each_segment(bvec, req, iter) {
28171 + BUG_ON(ring_req->nr_segments == BLKIF_MAX_SEGMENTS_PER_REQUEST);
28172 + buffer_mfn = pfn_to_mfn(page_to_pfn(bvec->bv_page));
28173 + fsect = bvec->bv_offset >> 9;
28174 + lsect = fsect + (bvec->bv_len >> 9) - 1;
28175 /* install a grant reference. */
28176 ref = gnttab_claim_grant_reference(&gref_head);
28177 BUG_ON(ref == -ENOSPC);
28178 @@ -256,12 +254,16 @@
28179 buffer_mfn,
28180 rq_data_dir(req) );
28181
28182 - info->shadow[id].frame[i] = mfn_to_pfn(buffer_mfn);
28183 - ring_req->seg[i] =
28184 + info->shadow[id].frame[ring_req->nr_segments] =
28185 + mfn_to_pfn(buffer_mfn);
28186 +
28187 + ring_req->seg[ring_req->nr_segments] =
28188 (struct blkif_request_segment) {
28189 .gref = ref,
28190 .first_sect = fsect,
28191 .last_sect = lsect };
28192 +
28193 + ring_req->nr_segments++;
28194 }
28195
28196 info->ring.req_prod_pvt++;
28197 @@ -620,8 +622,6 @@
28198 SHARED_RING_INIT(sring);
28199 FRONT_RING_INIT(&info->ring, sring, PAGE_SIZE);
28200
28201 - sg_init_table(info->sg, BLKIF_MAX_SEGMENTS_PER_REQUEST);
28202 -
28203 err = xenbus_grant_ring(dev, virt_to_mfn(info->ring.sring));
28204 if (err < 0) {
28205 free_page((unsigned long)sring);
28206 @@ -977,8 +977,6 @@
28207 break;
28208
28209 case XenbusStateClosing:
28210 - if (info->gd == NULL)
28211 - xenbus_dev_fatal(dev, -ENODEV, "gd is NULL");
28212 bd = bdget_disk(info->gd, 0);
28213 if (bd == NULL)
28214 xenbus_dev_fatal(dev, -ENODEV, "bdget failed");
28215 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/block/xsysace.c linux-2.6.29-rc3.owrt/drivers/block/xsysace.c
28216 --- linux-2.6.29.owrt/drivers/block/xsysace.c 2009-05-10 22:04:38.000000000 +0200
28217 +++ linux-2.6.29-rc3.owrt/drivers/block/xsysace.c 2009-05-10 23:48:28.000000000 +0200
28218 @@ -489,28 +489,6 @@
28219 ace->fsm_state, ace->id_req_count);
28220 #endif
28221
28222 - /* Verify that there is actually a CF in the slot. If not, then
28223 - * bail out back to the idle state and wake up all the waiters */
28224 - status = ace_in32(ace, ACE_STATUS);
28225 - if ((status & ACE_STATUS_CFDETECT) == 0) {
28226 - ace->fsm_state = ACE_FSM_STATE_IDLE;
28227 - ace->media_change = 1;
28228 - set_capacity(ace->gd, 0);
28229 - dev_info(ace->dev, "No CF in slot\n");
28230 -
28231 - /* Drop all pending requests */
28232 - while ((req = elv_next_request(ace->queue)) != NULL)
28233 - end_request(req, 0);
28234 -
28235 - /* Drop back to IDLE state and notify waiters */
28236 - ace->fsm_state = ACE_FSM_STATE_IDLE;
28237 - ace->id_result = -EIO;
28238 - while (ace->id_req_count) {
28239 - complete(&ace->id_completion);
28240 - ace->id_req_count--;
28241 - }
28242 - }
28243 -
28244 switch (ace->fsm_state) {
28245 case ACE_FSM_STATE_IDLE:
28246 /* See if there is anything to do */
28247 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/char/agp/amd64-agp.c linux-2.6.29-rc3.owrt/drivers/char/agp/amd64-agp.c
28248 --- linux-2.6.29.owrt/drivers/char/agp/amd64-agp.c 2009-05-10 22:04:38.000000000 +0200
28249 +++ linux-2.6.29-rc3.owrt/drivers/char/agp/amd64-agp.c 2009-05-10 23:48:28.000000000 +0200
28250 @@ -271,15 +271,15 @@
28251 nb_order = (nb_order >> 1) & 7;
28252 pci_read_config_dword(nb, AMD64_GARTAPERTUREBASE, &nb_base);
28253 nb_aper = nb_base << 25;
28254 + if (agp_aperture_valid(nb_aper, (32*1024*1024)<<nb_order)) {
28255 + return 0;
28256 + }
28257
28258 /* Northbridge seems to contain crap. Try the AGP bridge. */
28259
28260 pci_read_config_word(agp, cap+0x14, &apsize);
28261 - if (apsize == 0xffff) {
28262 - if (agp_aperture_valid(nb_aper, (32*1024*1024)<<nb_order))
28263 - return 0;
28264 + if (apsize == 0xffff)
28265 return -1;
28266 - }
28267
28268 apsize &= 0xfff;
28269 /* Some BIOS use weird encodings not in the AGPv3 table. */
28270 @@ -301,11 +301,6 @@
28271 order = nb_order;
28272 }
28273
28274 - if (nb_order >= order) {
28275 - if (agp_aperture_valid(nb_aper, (32*1024*1024)<<nb_order))
28276 - return 0;
28277 - }
28278 -
28279 dev_info(&agp->dev, "aperture from AGP @ %Lx size %u MB\n",
28280 aper, 32 << order);
28281 if (order < 0 || !agp_aperture_valid(aper, (32*1024*1024)<<order))
28282 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/char/agp/intel-agp.c linux-2.6.29-rc3.owrt/drivers/char/agp/intel-agp.c
28283 --- linux-2.6.29.owrt/drivers/char/agp/intel-agp.c 2009-05-10 22:04:38.000000000 +0200
28284 +++ linux-2.6.29-rc3.owrt/drivers/char/agp/intel-agp.c 2009-05-10 23:48:28.000000000 +0200
28285 @@ -633,15 +633,13 @@
28286 break;
28287 }
28288 }
28289 - if (gtt_entries > 0) {
28290 + if (gtt_entries > 0)
28291 dev_info(&agp_bridge->dev->dev, "detected %dK %s memory\n",
28292 gtt_entries / KB(1), local ? "local" : "stolen");
28293 - gtt_entries /= KB(4);
28294 - } else {
28295 + else
28296 dev_info(&agp_bridge->dev->dev,
28297 "no pre-allocated video memory detected\n");
28298 - gtt_entries = 0;
28299 - }
28300 + gtt_entries /= KB(4);
28301
28302 intel_private.gtt_entries = gtt_entries;
28303 }
28304 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/char/agp/parisc-agp.c linux-2.6.29-rc3.owrt/drivers/char/agp/parisc-agp.c
28305 --- linux-2.6.29.owrt/drivers/char/agp/parisc-agp.c 2009-05-10 22:04:38.000000000 +0200
28306 +++ linux-2.6.29-rc3.owrt/drivers/char/agp/parisc-agp.c 2009-05-10 23:48:28.000000000 +0200
28307 @@ -359,16 +359,9 @@
28308 return error;
28309 }
28310
28311 -static int
28312 -find_quicksilver(struct device *dev, void *data)
28313 -{
28314 - struct parisc_device **lba = data;
28315 - struct parisc_device *padev = to_parisc_device(dev);
28316 -
28317 - if (IS_QUICKSILVER(padev))
28318 - *lba = padev;
28319 -
28320 - return 0;
28321 +static struct device *next_device(struct klist_iter *i) {
28322 + struct klist_node * n = klist_next(i);
28323 + return n ? container_of(n, struct device, knode_parent) : NULL;
28324 }
28325
28326 static int
28327 @@ -379,6 +372,8 @@
28328 int err = -1;
28329 struct parisc_device *sba = NULL, *lba = NULL;
28330 struct lba_device *lbadev = NULL;
28331 + struct device *dev = NULL;
28332 + struct klist_iter i;
28333
28334 if (!sba_list)
28335 goto out;
28336 @@ -391,7 +386,13 @@
28337 }
28338
28339 /* Now search our Pluto for our precious AGP device... */
28340 - device_for_each_child(&sba->dev, &lba, find_quicksilver);
28341 + klist_iter_init(&sba->dev.klist_children, &i);
28342 + while ((dev = next_device(&i))) {
28343 + struct parisc_device *padev = to_parisc_device(dev);
28344 + if (IS_QUICKSILVER(padev))
28345 + lba = padev;
28346 + }
28347 + klist_iter_exit(&i);
28348
28349 if (!lba) {
28350 printk(KERN_INFO DRVPFX "No AGP devices found.\n");
28351 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/char/hvcs.c linux-2.6.29-rc3.owrt/drivers/char/hvcs.c
28352 --- linux-2.6.29.owrt/drivers/char/hvcs.c 2009-05-10 22:04:38.000000000 +0200
28353 +++ linux-2.6.29-rc3.owrt/drivers/char/hvcs.c 2009-05-10 23:48:28.000000000 +0200
28354 @@ -1139,6 +1139,15 @@
28355 hvcsd->tty = tty;
28356 tty->driver_data = hvcsd;
28357
28358 + /*
28359 + * Set this driver to low latency so that we actually have a chance at
28360 + * catching a throttled TTY after we flip_buffer_push. Otherwise the
28361 + * flush_to_async may not execute until after the kernel_thread has
28362 + * yielded and resumed the next flip_buffer_push resulting in data
28363 + * loss.
28364 + */
28365 + tty->low_latency = 1;
28366 +
28367 memset(&hvcsd->buffer[0], 0x00, HVCS_BUFF_LEN);
28368
28369 /*
28370 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/char/hvsi.c linux-2.6.29-rc3.owrt/drivers/char/hvsi.c
28371 --- linux-2.6.29.owrt/drivers/char/hvsi.c 2009-05-10 22:04:38.000000000 +0200
28372 +++ linux-2.6.29-rc3.owrt/drivers/char/hvsi.c 2009-05-10 23:48:28.000000000 +0200
28373 @@ -810,6 +810,7 @@
28374 hp = &hvsi_ports[line];
28375
28376 tty->driver_data = hp;
28377 + tty->low_latency = 1; /* avoid throttle/tty_flip_buffer_push race */
28378
28379 mb();
28380 if (hp->state == HVSI_FSP_DIED)
28381 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/char/Kconfig linux-2.6.29-rc3.owrt/drivers/char/Kconfig
28382 --- linux-2.6.29.owrt/drivers/char/Kconfig 2009-05-10 22:04:38.000000000 +0200
28383 +++ linux-2.6.29-rc3.owrt/drivers/char/Kconfig 2009-05-10 23:48:28.000000000 +0200
28384 @@ -761,7 +761,7 @@
28385
28386 config NVRAM
28387 tristate "/dev/nvram support"
28388 - depends on ATARI || X86 || (ARM && RTC_DRV_CMOS) || GENERIC_NVRAM
28389 + depends on ATARI || X86 || ARM || GENERIC_NVRAM
28390 ---help---
28391 If you say Y here and create a character special file /dev/nvram
28392 with major number 10 and minor number 144 using mknod ("man mknod"),
28393 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/char/scc.h linux-2.6.29-rc3.owrt/drivers/char/scc.h
28394 --- linux-2.6.29.owrt/drivers/char/scc.h 2009-05-10 22:04:38.000000000 +0200
28395 +++ linux-2.6.29-rc3.owrt/drivers/char/scc.h 2009-05-10 23:48:28.000000000 +0200
28396 @@ -387,7 +387,7 @@
28397 /* The SCC needs 3.5 PCLK cycles recovery time between to register
28398 * accesses. PCLK runs with 8 MHz on an Atari, so this delay is 3.5 *
28399 * 125 ns = 437.5 ns. This is too short for udelay().
28400 - * 10/16/95: A tstb st_mfp.par_dt_reg takes 600ns (sure?) and thus should be
28401 + * 10/16/95: A tstb mfp.par_dt_reg takes 600ns (sure?) and thus should be
28402 * quite right
28403 */
28404
28405 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/char/selection.c linux-2.6.29-rc3.owrt/drivers/char/selection.c
28406 --- linux-2.6.29.owrt/drivers/char/selection.c 2009-05-10 22:04:38.000000000 +0200
28407 +++ linux-2.6.29-rc3.owrt/drivers/char/selection.c 2009-05-10 23:48:28.000000000 +0200
28408 @@ -268,7 +268,7 @@
28409
28410 /* Allocate a new buffer before freeing the old one ... */
28411 multiplier = use_unicode ? 3 : 1; /* chars can take up to 3 bytes */
28412 - bp = kmalloc(((sel_end-sel_start)/2+1)*multiplier, GFP_KERNEL);
28413 + bp = kmalloc((sel_end-sel_start)/2*multiplier+1, GFP_KERNEL);
28414 if (!bp) {
28415 printk(KERN_WARNING "selection: kmalloc() failed\n");
28416 clear_selection();
28417 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/char/sx.c linux-2.6.29-rc3.owrt/drivers/char/sx.c
28418 --- linux-2.6.29.owrt/drivers/char/sx.c 2009-05-10 22:04:38.000000000 +0200
28419 +++ linux-2.6.29-rc3.owrt/drivers/char/sx.c 2009-05-10 23:48:28.000000000 +0200
28420 @@ -1713,8 +1713,8 @@
28421 for (i = 0; i < SX_NBOARDS; i++)
28422 sx_dprintk(SX_DEBUG_FIRMWARE, "<%x> ", boards[i].flags);
28423 sx_dprintk(SX_DEBUG_FIRMWARE, "\n");
28424 - rc = -EIO;
28425 - goto out;
28426 + unlock_kernel();
28427 + return -EIO;
28428 }
28429
28430 switch (cmd) {
28431 @@ -1746,10 +1746,8 @@
28432 sx_dprintk(SX_DEBUG_FIRMWARE, "returning type= %ld\n", rc);
28433 break;
28434 case SXIO_DO_RAMTEST:
28435 - if (sx_initialized) { /* Already initialized: better not ramtest the board. */
28436 - rc = -EPERM;
28437 - break;
28438 - }
28439 + if (sx_initialized) /* Already initialized: better not ramtest the board. */
28440 + return -EPERM;
28441 if (IS_SX_BOARD(board)) {
28442 rc = do_memtest(board, 0, 0x7000);
28443 if (!rc)
28444 @@ -1789,7 +1787,7 @@
28445 nbytes - i : SX_CHUNK_SIZE)) {
28446 kfree(tmp);
28447 rc = -EFAULT;
28448 - goto out;
28449 + break;
28450 }
28451 memcpy_toio(board->base2 + offset + i, tmp,
28452 (i + SX_CHUNK_SIZE > nbytes) ?
28453 @@ -1846,7 +1844,6 @@
28454 rc = -ENOTTY;
28455 break;
28456 }
28457 -out:
28458 unlock_kernel();
28459 func_exit();
28460 return rc;
28461 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/char/tpm/tpm_infineon.c linux-2.6.29-rc3.owrt/drivers/char/tpm/tpm_infineon.c
28462 --- linux-2.6.29.owrt/drivers/char/tpm/tpm_infineon.c 2009-05-10 22:04:38.000000000 +0200
28463 +++ linux-2.6.29-rc3.owrt/drivers/char/tpm/tpm_infineon.c 2009-05-10 23:48:28.000000000 +0200
28464 @@ -4,7 +4,7 @@
28465 * SLD 9630 TT 1.1 and SLB 9635 TT 1.2 Trusted Platform Module
28466 * Specifications at www.trustedcomputinggroup.org
28467 *
28468 - * Copyright (C) 2005, Marcel Selhorst <m.selhorst@sirrix.com>
28469 + * Copyright (C) 2005, Marcel Selhorst <selhorst@crypto.rub.de>
28470 * Sirrix AG - security technologies, http://www.sirrix.com and
28471 * Applied Data Security Group, Ruhr-University Bochum, Germany
28472 * Project-Homepage: http://www.prosec.rub.de/tpm
28473 @@ -636,7 +636,7 @@
28474 module_init(init_inf);
28475 module_exit(cleanup_inf);
28476
28477 -MODULE_AUTHOR("Marcel Selhorst <m.selhorst@sirrix.com>");
28478 +MODULE_AUTHOR("Marcel Selhorst <selhorst@crypto.rub.de>");
28479 MODULE_DESCRIPTION("Driver for Infineon TPM SLD 9630 TT 1.1 / SLB 9635 TT 1.2");
28480 MODULE_VERSION("1.9");
28481 MODULE_LICENSE("GPL");
28482 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/cpufreq/cpufreq.c linux-2.6.29-rc3.owrt/drivers/cpufreq/cpufreq.c
28483 --- linux-2.6.29.owrt/drivers/cpufreq/cpufreq.c 2009-05-10 22:04:38.000000000 +0200
28484 +++ linux-2.6.29-rc3.owrt/drivers/cpufreq/cpufreq.c 2009-05-10 23:48:28.000000000 +0200
28485 @@ -754,6 +754,11 @@
28486 .release = cpufreq_sysfs_release,
28487 };
28488
28489 +static struct kobj_type ktype_empty_cpufreq = {
28490 + .sysfs_ops = &sysfs_ops,
28491 + .release = cpufreq_sysfs_release,
28492 +};
28493 +
28494
28495 /**
28496 * cpufreq_add_dev - add a CPU device
28497 @@ -887,26 +892,36 @@
28498 memcpy(&new_policy, policy, sizeof(struct cpufreq_policy));
28499
28500 /* prepare interface data */
28501 - ret = kobject_init_and_add(&policy->kobj, &ktype_cpufreq, &sys_dev->kobj,
28502 - "cpufreq");
28503 - if (ret)
28504 - goto err_out_driver_exit;
28505 -
28506 - /* set up files for this cpu device */
28507 - drv_attr = cpufreq_driver->attr;
28508 - while ((drv_attr) && (*drv_attr)) {
28509 - ret = sysfs_create_file(&policy->kobj, &((*drv_attr)->attr));
28510 + if (!cpufreq_driver->hide_interface) {
28511 + ret = kobject_init_and_add(&policy->kobj, &ktype_cpufreq,
28512 + &sys_dev->kobj, "cpufreq");
28513 if (ret)
28514 goto err_out_driver_exit;
28515 - drv_attr++;
28516 - }
28517 - if (cpufreq_driver->get) {
28518 - ret = sysfs_create_file(&policy->kobj, &cpuinfo_cur_freq.attr);
28519 - if (ret)
28520 - goto err_out_driver_exit;
28521 - }
28522 - if (cpufreq_driver->target) {
28523 - ret = sysfs_create_file(&policy->kobj, &scaling_cur_freq.attr);
28524 +
28525 + /* set up files for this cpu device */
28526 + drv_attr = cpufreq_driver->attr;
28527 + while ((drv_attr) && (*drv_attr)) {
28528 + ret = sysfs_create_file(&policy->kobj,
28529 + &((*drv_attr)->attr));
28530 + if (ret)
28531 + goto err_out_driver_exit;
28532 + drv_attr++;
28533 + }
28534 + if (cpufreq_driver->get) {
28535 + ret = sysfs_create_file(&policy->kobj,
28536 + &cpuinfo_cur_freq.attr);
28537 + if (ret)
28538 + goto err_out_driver_exit;
28539 + }
28540 + if (cpufreq_driver->target) {
28541 + ret = sysfs_create_file(&policy->kobj,
28542 + &scaling_cur_freq.attr);
28543 + if (ret)
28544 + goto err_out_driver_exit;
28545 + }
28546 + } else {
28547 + ret = kobject_init_and_add(&policy->kobj, &ktype_empty_cpufreq,
28548 + &sys_dev->kobj, "cpufreq");
28549 if (ret)
28550 goto err_out_driver_exit;
28551 }
28552 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/cpufreq/cpufreq_ondemand.c linux-2.6.29-rc3.owrt/drivers/cpufreq/cpufreq_ondemand.c
28553 --- linux-2.6.29.owrt/drivers/cpufreq/cpufreq_ondemand.c 2009-05-10 22:04:38.000000000 +0200
28554 +++ linux-2.6.29-rc3.owrt/drivers/cpufreq/cpufreq_ondemand.c 2009-05-10 23:48:28.000000000 +0200
28555 @@ -117,7 +117,11 @@
28556 busy_time = cputime64_add(busy_time, kstat_cpu(cpu).cpustat.irq);
28557 busy_time = cputime64_add(busy_time, kstat_cpu(cpu).cpustat.softirq);
28558 busy_time = cputime64_add(busy_time, kstat_cpu(cpu).cpustat.steal);
28559 - busy_time = cputime64_add(busy_time, kstat_cpu(cpu).cpustat.nice);
28560 +
28561 + if (!dbs_tuners_ins.ignore_nice) {
28562 + busy_time = cputime64_add(busy_time,
28563 + kstat_cpu(cpu).cpustat.nice);
28564 + }
28565
28566 idle_time = cputime64_sub(cur_wall_time, busy_time);
28567 if (wall)
28568 @@ -133,6 +137,23 @@
28569 if (idle_time == -1ULL)
28570 return get_cpu_idle_time_jiffy(cpu, wall);
28571
28572 + if (dbs_tuners_ins.ignore_nice) {
28573 + cputime64_t cur_nice;
28574 + unsigned long cur_nice_jiffies;
28575 + struct cpu_dbs_info_s *dbs_info;
28576 +
28577 + dbs_info = &per_cpu(cpu_dbs_info, cpu);
28578 + cur_nice = cputime64_sub(kstat_cpu(cpu).cpustat.nice,
28579 + dbs_info->prev_cpu_nice);
28580 + /*
28581 + * Assumption: nice time between sampling periods will be
28582 + * less than 2^32 jiffies for 32 bit sys
28583 + */
28584 + cur_nice_jiffies = (unsigned long)
28585 + cputime64_to_jiffies64(cur_nice);
28586 + dbs_info->prev_cpu_nice = kstat_cpu(cpu).cpustat.nice;
28587 + return idle_time + jiffies_to_usecs(cur_nice_jiffies);
28588 + }
28589 return idle_time;
28590 }
28591
28592 @@ -298,9 +319,6 @@
28593 dbs_info = &per_cpu(cpu_dbs_info, j);
28594 dbs_info->prev_cpu_idle = get_cpu_idle_time(j,
28595 &dbs_info->prev_cpu_wall);
28596 - if (dbs_tuners_ins.ignore_nice)
28597 - dbs_info->prev_cpu_nice = kstat_cpu(j).cpustat.nice;
28598 -
28599 }
28600 mutex_unlock(&dbs_mutex);
28601
28602 @@ -401,23 +419,6 @@
28603 j_dbs_info->prev_cpu_idle);
28604 j_dbs_info->prev_cpu_idle = cur_idle_time;
28605
28606 - if (dbs_tuners_ins.ignore_nice) {
28607 - cputime64_t cur_nice;
28608 - unsigned long cur_nice_jiffies;
28609 -
28610 - cur_nice = cputime64_sub(kstat_cpu(j).cpustat.nice,
28611 - j_dbs_info->prev_cpu_nice);
28612 - /*
28613 - * Assumption: nice time between sampling periods will
28614 - * be less than 2^32 jiffies for 32 bit sys
28615 - */
28616 - cur_nice_jiffies = (unsigned long)
28617 - cputime64_to_jiffies64(cur_nice);
28618 -
28619 - j_dbs_info->prev_cpu_nice = kstat_cpu(j).cpustat.nice;
28620 - idle_time += jiffies_to_usecs(cur_nice_jiffies);
28621 - }
28622 -
28623 if (unlikely(!wall_time || wall_time < idle_time))
28624 continue;
28625
28626 @@ -574,10 +575,6 @@
28627
28628 j_dbs_info->prev_cpu_idle = get_cpu_idle_time(j,
28629 &j_dbs_info->prev_cpu_wall);
28630 - if (dbs_tuners_ins.ignore_nice) {
28631 - j_dbs_info->prev_cpu_nice =
28632 - kstat_cpu(j).cpustat.nice;
28633 - }
28634 }
28635 this_dbs_info->cpu = cpu;
28636 /*
28637 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/crypto/ixp4xx_crypto.c linux-2.6.29-rc3.owrt/drivers/crypto/ixp4xx_crypto.c
28638 --- linux-2.6.29.owrt/drivers/crypto/ixp4xx_crypto.c 2009-05-10 22:04:38.000000000 +0200
28639 +++ linux-2.6.29-rc3.owrt/drivers/crypto/ixp4xx_crypto.c 2009-05-10 23:48:28.000000000 +0200
28640 @@ -457,12 +457,10 @@
28641 if (!ctx_pool) {
28642 goto err;
28643 }
28644 - ret = qmgr_request_queue(SEND_QID, NPE_QLEN_TOTAL, 0, 0,
28645 - "ixp_crypto:out", NULL);
28646 + ret = qmgr_request_queue(SEND_QID, NPE_QLEN_TOTAL, 0, 0);
28647 if (ret)
28648 goto err;
28649 - ret = qmgr_request_queue(RECV_QID, NPE_QLEN, 0, 0,
28650 - "ixp_crypto:in", NULL);
28651 + ret = qmgr_request_queue(RECV_QID, NPE_QLEN, 0, 0);
28652 if (ret) {
28653 qmgr_release_queue(SEND_QID);
28654 goto err;
28655 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/crypto/padlock-aes.c linux-2.6.29-rc3.owrt/drivers/crypto/padlock-aes.c
28656 --- linux-2.6.29.owrt/drivers/crypto/padlock-aes.c 2009-05-10 22:04:38.000000000 +0200
28657 +++ linux-2.6.29-rc3.owrt/drivers/crypto/padlock-aes.c 2009-05-10 23:48:28.000000000 +0200
28658 @@ -489,4 +489,4 @@
28659 MODULE_LICENSE("GPL");
28660 MODULE_AUTHOR("Michal Ludvig");
28661
28662 -MODULE_ALIAS("aes-all");
28663 +MODULE_ALIAS("aes");
28664 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/crypto/padlock-sha.c linux-2.6.29-rc3.owrt/drivers/crypto/padlock-sha.c
28665 --- linux-2.6.29.owrt/drivers/crypto/padlock-sha.c 2009-05-10 22:04:38.000000000 +0200
28666 +++ linux-2.6.29-rc3.owrt/drivers/crypto/padlock-sha.c 2009-05-10 23:48:28.000000000 +0200
28667 @@ -304,7 +304,7 @@
28668 MODULE_LICENSE("GPL");
28669 MODULE_AUTHOR("Michal Ludvig");
28670
28671 -MODULE_ALIAS("sha1-all");
28672 -MODULE_ALIAS("sha256-all");
28673 +MODULE_ALIAS("sha1");
28674 +MODULE_ALIAS("sha256");
28675 MODULE_ALIAS("sha1-padlock");
28676 MODULE_ALIAS("sha256-padlock");
28677 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/dca/dca-core.c linux-2.6.29-rc3.owrt/drivers/dca/dca-core.c
28678 --- linux-2.6.29.owrt/drivers/dca/dca-core.c 2009-05-10 22:04:38.000000000 +0200
28679 +++ linux-2.6.29-rc3.owrt/drivers/dca/dca-core.c 2009-05-10 23:48:28.000000000 +0200
28680 @@ -1,5 +1,5 @@
28681 /*
28682 - * Copyright(c) 2007 - 2009 Intel Corporation. All rights reserved.
28683 + * Copyright(c) 2007 Intel Corporation. All rights reserved.
28684 *
28685 * This program is free software; you can redistribute it and/or modify it
28686 * under the terms of the GNU General Public License as published by the Free
28687 @@ -28,7 +28,7 @@
28688 #include <linux/device.h>
28689 #include <linux/dca.h>
28690
28691 -#define DCA_VERSION "1.8"
28692 +#define DCA_VERSION "1.4"
28693
28694 MODULE_VERSION(DCA_VERSION);
28695 MODULE_LICENSE("GPL");
28696 @@ -60,17 +60,16 @@
28697 {
28698 struct dca_provider *dca;
28699 int err, slot = -ENODEV;
28700 - unsigned long flags;
28701
28702 if (!dev)
28703 return -EFAULT;
28704
28705 - spin_lock_irqsave(&dca_lock, flags);
28706 + spin_lock(&dca_lock);
28707
28708 /* check if the requester has not been added already */
28709 dca = dca_find_provider_by_dev(dev);
28710 if (dca) {
28711 - spin_unlock_irqrestore(&dca_lock, flags);
28712 + spin_unlock(&dca_lock);
28713 return -EEXIST;
28714 }
28715
28716 @@ -79,21 +78,19 @@
28717 if (slot >= 0)
28718 break;
28719 }
28720 -
28721 - spin_unlock_irqrestore(&dca_lock, flags);
28722 -
28723 - if (slot < 0)
28724 + if (slot < 0) {
28725 + spin_unlock(&dca_lock);
28726 return slot;
28727 + }
28728
28729 err = dca_sysfs_add_req(dca, dev, slot);
28730 if (err) {
28731 - spin_lock_irqsave(&dca_lock, flags);
28732 - if (dca == dca_find_provider_by_dev(dev))
28733 - dca->ops->remove_requester(dca, dev);
28734 - spin_unlock_irqrestore(&dca_lock, flags);
28735 + dca->ops->remove_requester(dca, dev);
28736 + spin_unlock(&dca_lock);
28737 return err;
28738 }
28739
28740 + spin_unlock(&dca_lock);
28741 return 0;
28742 }
28743 EXPORT_SYMBOL_GPL(dca_add_requester);
28744 @@ -106,25 +103,25 @@
28745 {
28746 struct dca_provider *dca;
28747 int slot;
28748 - unsigned long flags;
28749
28750 if (!dev)
28751 return -EFAULT;
28752
28753 - spin_lock_irqsave(&dca_lock, flags);
28754 + spin_lock(&dca_lock);
28755 dca = dca_find_provider_by_dev(dev);
28756 if (!dca) {
28757 - spin_unlock_irqrestore(&dca_lock, flags);
28758 + spin_unlock(&dca_lock);
28759 return -ENODEV;
28760 }
28761 slot = dca->ops->remove_requester(dca, dev);
28762 - spin_unlock_irqrestore(&dca_lock, flags);
28763 -
28764 - if (slot < 0)
28765 + if (slot < 0) {
28766 + spin_unlock(&dca_lock);
28767 return slot;
28768 + }
28769
28770 dca_sysfs_remove_req(dca, slot);
28771
28772 + spin_unlock(&dca_lock);
28773 return 0;
28774 }
28775 EXPORT_SYMBOL_GPL(dca_remove_requester);
28776 @@ -138,18 +135,17 @@
28777 {
28778 struct dca_provider *dca;
28779 u8 tag;
28780 - unsigned long flags;
28781
28782 - spin_lock_irqsave(&dca_lock, flags);
28783 + spin_lock(&dca_lock);
28784
28785 dca = dca_find_provider_by_dev(dev);
28786 if (!dca) {
28787 - spin_unlock_irqrestore(&dca_lock, flags);
28788 + spin_unlock(&dca_lock);
28789 return -ENODEV;
28790 }
28791 tag = dca->ops->get_tag(dca, dev, cpu);
28792
28793 - spin_unlock_irqrestore(&dca_lock, flags);
28794 + spin_unlock(&dca_lock);
28795 return tag;
28796 }
28797
28798 @@ -221,16 +217,11 @@
28799 int register_dca_provider(struct dca_provider *dca, struct device *dev)
28800 {
28801 int err;
28802 - unsigned long flags;
28803
28804 err = dca_sysfs_add_provider(dca, dev);
28805 if (err)
28806 return err;
28807 -
28808 - spin_lock_irqsave(&dca_lock, flags);
28809 list_add(&dca->node, &dca_providers);
28810 - spin_unlock_irqrestore(&dca_lock, flags);
28811 -
28812 blocking_notifier_call_chain(&dca_provider_chain,
28813 DCA_PROVIDER_ADD, NULL);
28814 return 0;
28815 @@ -243,15 +234,9 @@
28816 */
28817 void unregister_dca_provider(struct dca_provider *dca)
28818 {
28819 - unsigned long flags;
28820 -
28821 blocking_notifier_call_chain(&dca_provider_chain,
28822 DCA_PROVIDER_REMOVE, NULL);
28823 -
28824 - spin_lock_irqsave(&dca_lock, flags);
28825 list_del(&dca->node);
28826 - spin_unlock_irqrestore(&dca_lock, flags);
28827 -
28828 dca_sysfs_remove_provider(dca);
28829 }
28830 EXPORT_SYMBOL_GPL(unregister_dca_provider);
28831 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/dca/dca-sysfs.c linux-2.6.29-rc3.owrt/drivers/dca/dca-sysfs.c
28832 --- linux-2.6.29.owrt/drivers/dca/dca-sysfs.c 2009-05-10 22:04:38.000000000 +0200
28833 +++ linux-2.6.29-rc3.owrt/drivers/dca/dca-sysfs.c 2009-05-10 23:48:28.000000000 +0200
28834 @@ -1,24 +1,3 @@
28835 -/*
28836 - * Copyright(c) 2007 - 2009 Intel Corporation. All rights reserved.
28837 - *
28838 - * This program is free software; you can redistribute it and/or modify it
28839 - * under the terms of the GNU General Public License as published by the Free
28840 - * Software Foundation; either version 2 of the License, or (at your option)
28841 - * any later version.
28842 - *
28843 - * This program is distributed in the hope that it will be useful, but WITHOUT
28844 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
28845 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
28846 - * more details.
28847 - *
28848 - * You should have received a copy of the GNU General Public License along with
28849 - * this program; if not, write to the Free Software Foundation, Inc., 59
28850 - * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28851 - *
28852 - * The full GNU General Public License is included in this distribution in the
28853 - * file called COPYING.
28854 - */
28855 -
28856 #include <linux/kernel.h>
28857 #include <linux/spinlock.h>
28858 #include <linux/device.h>
28859 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/dma/dmaengine.c linux-2.6.29-rc3.owrt/drivers/dma/dmaengine.c
28860 --- linux-2.6.29.owrt/drivers/dma/dmaengine.c 2009-05-10 22:04:38.000000000 +0200
28861 +++ linux-2.6.29-rc3.owrt/drivers/dma/dmaengine.c 2009-05-10 23:48:28.000000000 +0200
28862 @@ -518,7 +518,6 @@
28863 dma_chan_name(chan), err);
28864 else
28865 break;
28866 - chan->private = NULL;
28867 chan = NULL;
28868 }
28869 }
28870 @@ -537,7 +536,6 @@
28871 WARN_ONCE(chan->client_count != 1,
28872 "chan reference count %d != 1\n", chan->client_count);
28873 dma_chan_put(chan);
28874 - chan->private = NULL;
28875 mutex_unlock(&dma_list_mutex);
28876 }
28877 EXPORT_SYMBOL_GPL(dma_release_channel);
28878 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/dma/dmatest.c linux-2.6.29-rc3.owrt/drivers/dma/dmatest.c
28879 --- linux-2.6.29.owrt/drivers/dma/dmatest.c 2009-05-10 22:04:38.000000000 +0200
28880 +++ linux-2.6.29-rc3.owrt/drivers/dma/dmatest.c 2009-05-10 23:48:28.000000000 +0200
28881 @@ -430,15 +430,13 @@
28882 static void __exit dmatest_exit(void)
28883 {
28884 struct dmatest_chan *dtc, *_dtc;
28885 - struct dma_chan *chan;
28886
28887 list_for_each_entry_safe(dtc, _dtc, &dmatest_channels, node) {
28888 list_del(&dtc->node);
28889 - chan = dtc->chan;
28890 dmatest_cleanup_channel(dtc);
28891 pr_debug("dmatest: dropped channel %s\n",
28892 - dma_chan_name(chan));
28893 - dma_release_channel(chan);
28894 + dma_chan_name(dtc->chan));
28895 + dma_release_channel(dtc->chan);
28896 }
28897 }
28898 module_exit(dmatest_exit);
28899 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/dma/dw_dmac.c linux-2.6.29-rc3.owrt/drivers/dma/dw_dmac.c
28900 --- linux-2.6.29.owrt/drivers/dma/dw_dmac.c 2009-05-10 22:04:38.000000000 +0200
28901 +++ linux-2.6.29-rc3.owrt/drivers/dma/dw_dmac.c 2009-05-10 23:48:28.000000000 +0200
28902 @@ -560,7 +560,7 @@
28903 unsigned long flags)
28904 {
28905 struct dw_dma_chan *dwc = to_dw_dma_chan(chan);
28906 - struct dw_dma_slave *dws = chan->private;
28907 + struct dw_dma_slave *dws = dwc->dws;
28908 struct dw_desc *prev;
28909 struct dw_desc *first;
28910 u32 ctllo;
28911 @@ -790,7 +790,7 @@
28912 cfghi = DWC_CFGH_FIFO_MODE;
28913 cfglo = 0;
28914
28915 - dws = chan->private;
28916 + dws = dwc->dws;
28917 if (dws) {
28918 /*
28919 * We need controller-specific data to set up slave
28920 @@ -866,6 +866,7 @@
28921 spin_lock_bh(&dwc->lock);
28922 list_splice_init(&dwc->free_list, &list);
28923 dwc->descs_allocated = 0;
28924 + dwc->dws = NULL;
28925
28926 /* Disable interrupts */
28927 channel_clear_bit(dw, MASK.XFER, dwc->mask);
28928 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/dma/dw_dmac_regs.h linux-2.6.29-rc3.owrt/drivers/dma/dw_dmac_regs.h
28929 --- linux-2.6.29.owrt/drivers/dma/dw_dmac_regs.h 2009-05-10 22:04:38.000000000 +0200
28930 +++ linux-2.6.29-rc3.owrt/drivers/dma/dw_dmac_regs.h 2009-05-10 23:48:28.000000000 +0200
28931 @@ -139,6 +139,8 @@
28932 struct list_head queue;
28933 struct list_head free_list;
28934
28935 + struct dw_dma_slave *dws;
28936 +
28937 unsigned int descs_allocated;
28938 };
28939
28940 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/dma/fsldma.c linux-2.6.29-rc3.owrt/drivers/dma/fsldma.c
28941 --- linux-2.6.29.owrt/drivers/dma/fsldma.c 2009-05-10 22:04:38.000000000 +0200
28942 +++ linux-2.6.29-rc3.owrt/drivers/dma/fsldma.c 2009-05-10 23:48:28.000000000 +0200
28943 @@ -158,8 +158,7 @@
28944
28945 static void dma_halt(struct fsl_dma_chan *fsl_chan)
28946 {
28947 - int i;
28948 -
28949 + int i = 0;
28950 DMA_OUT(fsl_chan, &fsl_chan->reg_base->mr,
28951 DMA_IN(fsl_chan, &fsl_chan->reg_base->mr, 32) | FSL_DMA_MR_CA,
28952 32);
28953 @@ -167,11 +166,8 @@
28954 DMA_IN(fsl_chan, &fsl_chan->reg_base->mr, 32) & ~(FSL_DMA_MR_CS
28955 | FSL_DMA_MR_EMS_EN | FSL_DMA_MR_CA), 32);
28956
28957 - for (i = 0; i < 100; i++) {
28958 - if (dma_is_idle(fsl_chan))
28959 - break;
28960 + while (!dma_is_idle(fsl_chan) && (i++ < 100))
28961 udelay(10);
28962 - }
28963 if (i >= 100 && !dma_is_idle(fsl_chan))
28964 dev_err(fsl_chan->dev, "DMA halt timeout!\n");
28965 }
28966 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/dma/ioat.c linux-2.6.29-rc3.owrt/drivers/dma/ioat.c
28967 --- linux-2.6.29.owrt/drivers/dma/ioat.c 2009-05-10 22:04:38.000000000 +0200
28968 +++ linux-2.6.29-rc3.owrt/drivers/dma/ioat.c 2009-05-10 23:48:28.000000000 +0200
28969 @@ -1,6 +1,6 @@
28970 /*
28971 * Intel I/OAT DMA Linux driver
28972 - * Copyright(c) 2007 - 2009 Intel Corporation.
28973 + * Copyright(c) 2007 Intel Corporation.
28974 *
28975 * This program is free software; you can redistribute it and/or modify it
28976 * under the terms and conditions of the GNU General Public License,
28977 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/dma/ioat_dca.c linux-2.6.29-rc3.owrt/drivers/dma/ioat_dca.c
28978 --- linux-2.6.29.owrt/drivers/dma/ioat_dca.c 2009-05-10 22:04:38.000000000 +0200
28979 +++ linux-2.6.29-rc3.owrt/drivers/dma/ioat_dca.c 2009-05-10 23:48:28.000000000 +0200
28980 @@ -1,6 +1,6 @@
28981 /*
28982 * Intel I/OAT DMA Linux driver
28983 - * Copyright(c) 2007 - 2009 Intel Corporation.
28984 + * Copyright(c) 2007 Intel Corporation.
28985 *
28986 * This program is free software; you can redistribute it and/or modify it
28987 * under the terms and conditions of the GNU General Public License,
28988 @@ -49,23 +49,6 @@
28989
28990 #define DCA_TAG_MAP_MASK 0xDF
28991
28992 -/* expected tag map bytes for I/OAT ver.2 */
28993 -#define DCA2_TAG_MAP_BYTE0 0x80
28994 -#define DCA2_TAG_MAP_BYTE1 0x0
28995 -#define DCA2_TAG_MAP_BYTE2 0x81
28996 -#define DCA2_TAG_MAP_BYTE3 0x82
28997 -#define DCA2_TAG_MAP_BYTE4 0x82
28998 -
28999 -/* verify if tag map matches expected values */
29000 -static inline int dca2_tag_map_valid(u8 *tag_map)
29001 -{
29002 - return ((tag_map[0] == DCA2_TAG_MAP_BYTE0) &&
29003 - (tag_map[1] == DCA2_TAG_MAP_BYTE1) &&
29004 - (tag_map[2] == DCA2_TAG_MAP_BYTE2) &&
29005 - (tag_map[3] == DCA2_TAG_MAP_BYTE3) &&
29006 - (tag_map[4] == DCA2_TAG_MAP_BYTE4));
29007 -}
29008 -
29009 /*
29010 * "Legacy" DCA systems do not implement the DCA register set in the
29011 * I/OAT device. Software needs direct support for their tag mappings.
29012 @@ -469,13 +452,6 @@
29013 ioatdca->tag_map[i] = 0;
29014 }
29015
29016 - if (!dca2_tag_map_valid(ioatdca->tag_map)) {
29017 - dev_err(&pdev->dev, "APICID_TAG_MAP set incorrectly by BIOS, "
29018 - "disabling DCA\n");
29019 - free_dca_provider(dca);
29020 - return NULL;
29021 - }
29022 -
29023 err = register_dca_provider(dca, &pdev->dev);
29024 if (err) {
29025 free_dca_provider(dca);
29026 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/dma/ioat_dma.c linux-2.6.29-rc3.owrt/drivers/dma/ioat_dma.c
29027 --- linux-2.6.29.owrt/drivers/dma/ioat_dma.c 2009-05-10 22:04:38.000000000 +0200
29028 +++ linux-2.6.29-rc3.owrt/drivers/dma/ioat_dma.c 2009-05-10 23:48:28.000000000 +0200
29029 @@ -1,6 +1,6 @@
29030 /*
29031 * Intel I/OAT DMA Linux driver
29032 - * Copyright(c) 2004 - 2009 Intel Corporation.
29033 + * Copyright(c) 2004 - 2007 Intel Corporation.
29034 *
29035 * This program is free software; you can redistribute it and/or modify it
29036 * under the terms and conditions of the GNU General Public License,
29037 @@ -189,13 +189,11 @@
29038 ioat_chan->xfercap = xfercap;
29039 ioat_chan->desccount = 0;
29040 INIT_DELAYED_WORK(&ioat_chan->work, ioat_dma_chan_reset_part2);
29041 - if (ioat_chan->device->version == IOAT_VER_2_0)
29042 - writel(IOAT_DCACTRL_CMPL_WRITE_ENABLE |
29043 - IOAT_DMA_DCA_ANY_CPU,
29044 - ioat_chan->reg_base + IOAT_DCACTRL_OFFSET);
29045 - else if (ioat_chan->device->version == IOAT_VER_3_0)
29046 - writel(IOAT_DMA_DCA_ANY_CPU,
29047 - ioat_chan->reg_base + IOAT_DCACTRL_OFFSET);
29048 + if (ioat_chan->device->version != IOAT_VER_1_2) {
29049 + writel(IOAT_DCACTRL_CMPL_WRITE_ENABLE
29050 + | IOAT_DMA_DCA_ANY_CPU,
29051 + ioat_chan->reg_base + IOAT_DCACTRL_OFFSET);
29052 + }
29053 spin_lock_init(&ioat_chan->cleanup_lock);
29054 spin_lock_init(&ioat_chan->desc_lock);
29055 INIT_LIST_HEAD(&ioat_chan->free_desc);
29056 @@ -1171,8 +1169,9 @@
29057 * up if the client is done with the descriptor
29058 */
29059 if (async_tx_test_ack(&desc->async_tx)) {
29060 - list_move_tail(&desc->node,
29061 - &ioat_chan->free_desc);
29062 + list_del(&desc->node);
29063 + list_add_tail(&desc->node,
29064 + &ioat_chan->free_desc);
29065 } else
29066 desc->async_tx.cookie = 0;
29067 } else {
29068 @@ -1363,7 +1362,6 @@
29069 dma_cookie_t cookie;
29070 int err = 0;
29071 struct completion cmp;
29072 - unsigned long tmo;
29073
29074 src = kzalloc(sizeof(u8) * IOAT_TEST_SIZE, GFP_KERNEL);
29075 if (!src)
29076 @@ -1415,10 +1413,9 @@
29077 }
29078 device->common.device_issue_pending(dma_chan);
29079
29080 - tmo = wait_for_completion_timeout(&cmp, msecs_to_jiffies(3000));
29081 + wait_for_completion_timeout(&cmp, msecs_to_jiffies(3000));
29082
29083 - if (tmo == 0 ||
29084 - device->common.device_is_tx_complete(dma_chan, cookie, NULL, NULL)
29085 + if (device->common.device_is_tx_complete(dma_chan, cookie, NULL, NULL)
29086 != DMA_SUCCESS) {
29087 dev_err(&device->pdev->dev,
29088 "Self-test copy timed out, disabling\n");
29089 @@ -1660,13 +1657,6 @@
29090 " %d channels, device version 0x%02x, driver version %s\n",
29091 device->common.chancnt, device->version, IOAT_DMA_VERSION);
29092
29093 - if (!device->common.chancnt) {
29094 - dev_err(&device->pdev->dev,
29095 - "Intel(R) I/OAT DMA Engine problem found: "
29096 - "zero channels detected\n");
29097 - goto err_setup_interrupts;
29098 - }
29099 -
29100 err = ioat_dma_setup_interrupts(device);
29101 if (err)
29102 goto err_setup_interrupts;
29103 @@ -1706,9 +1696,6 @@
29104 struct dma_chan *chan, *_chan;
29105 struct ioat_dma_chan *ioat_chan;
29106
29107 - if (device->version != IOAT_VER_3_0)
29108 - cancel_delayed_work(&device->work);
29109 -
29110 ioat_dma_remove_interrupts(device);
29111
29112 dma_async_device_unregister(&device->common);
29113 @@ -1720,6 +1707,10 @@
29114 pci_release_regions(device->pdev);
29115 pci_disable_device(device->pdev);
29116
29117 + if (device->version != IOAT_VER_3_0) {
29118 + cancel_delayed_work(&device->work);
29119 + }
29120 +
29121 list_for_each_entry_safe(chan, _chan,
29122 &device->common.channels, device_node) {
29123 ioat_chan = to_ioat_chan(chan);
29124 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/dma/ioatdma.h linux-2.6.29-rc3.owrt/drivers/dma/ioatdma.h
29125 --- linux-2.6.29.owrt/drivers/dma/ioatdma.h 2009-05-10 22:04:38.000000000 +0200
29126 +++ linux-2.6.29-rc3.owrt/drivers/dma/ioatdma.h 2009-05-10 23:48:28.000000000 +0200
29127 @@ -1,5 +1,5 @@
29128 /*
29129 - * Copyright(c) 2004 - 2009 Intel Corporation. All rights reserved.
29130 + * Copyright(c) 2004 - 2007 Intel Corporation. All rights reserved.
29131 *
29132 * This program is free software; you can redistribute it and/or modify it
29133 * under the terms of the GNU General Public License as published by the Free
29134 @@ -29,7 +29,7 @@
29135 #include <linux/pci_ids.h>
29136 #include <net/tcp.h>
29137
29138 -#define IOAT_DMA_VERSION "3.64"
29139 +#define IOAT_DMA_VERSION "3.30"
29140
29141 enum ioat_interrupt {
29142 none = 0,
29143 @@ -135,14 +135,12 @@
29144 #ifdef CONFIG_NET_DMA
29145 switch (dev->version) {
29146 case IOAT_VER_1_2:
29147 + case IOAT_VER_3_0:
29148 sysctl_tcp_dma_copybreak = 4096;
29149 break;
29150 case IOAT_VER_2_0:
29151 sysctl_tcp_dma_copybreak = 2048;
29152 break;
29153 - case IOAT_VER_3_0:
29154 - sysctl_tcp_dma_copybreak = 262144;
29155 - break;
29156 }
29157 #endif
29158 }
29159 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/dma/ioatdma_hw.h linux-2.6.29-rc3.owrt/drivers/dma/ioatdma_hw.h
29160 --- linux-2.6.29.owrt/drivers/dma/ioatdma_hw.h 2009-05-10 22:04:38.000000000 +0200
29161 +++ linux-2.6.29-rc3.owrt/drivers/dma/ioatdma_hw.h 2009-05-10 23:48:28.000000000 +0200
29162 @@ -1,5 +1,5 @@
29163 /*
29164 - * Copyright(c) 2004 - 2009 Intel Corporation. All rights reserved.
29165 + * Copyright(c) 2004 - 2007 Intel Corporation. All rights reserved.
29166 *
29167 * This program is free software; you can redistribute it and/or modify it
29168 * under the terms of the GNU General Public License as published by the Free
29169 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/dma/ioatdma_registers.h linux-2.6.29-rc3.owrt/drivers/dma/ioatdma_registers.h
29170 --- linux-2.6.29.owrt/drivers/dma/ioatdma_registers.h 2009-05-10 22:04:38.000000000 +0200
29171 +++ linux-2.6.29-rc3.owrt/drivers/dma/ioatdma_registers.h 2009-05-10 23:48:28.000000000 +0200
29172 @@ -1,5 +1,5 @@
29173 /*
29174 - * Copyright(c) 2004 - 2009 Intel Corporation. All rights reserved.
29175 + * Copyright(c) 2004 - 2007 Intel Corporation. All rights reserved.
29176 *
29177 * This program is free software; you can redistribute it and/or modify it
29178 * under the terms of the GNU General Public License as published by the Free
29179 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/dma/iop-adma.c linux-2.6.29-rc3.owrt/drivers/dma/iop-adma.c
29180 --- linux-2.6.29.owrt/drivers/dma/iop-adma.c 2009-05-10 22:04:38.000000000 +0200
29181 +++ linux-2.6.29-rc3.owrt/drivers/dma/iop-adma.c 2009-05-10 23:48:28.000000000 +0200
29182 @@ -928,19 +928,19 @@
29183
29184 for (src_idx = 0; src_idx < IOP_ADMA_NUM_SRC_TEST; src_idx++) {
29185 xor_srcs[src_idx] = alloc_page(GFP_KERNEL);
29186 - if (!xor_srcs[src_idx]) {
29187 - while (src_idx--)
29188 + if (!xor_srcs[src_idx])
29189 + while (src_idx--) {
29190 __free_page(xor_srcs[src_idx]);
29191 - return -ENOMEM;
29192 - }
29193 + return -ENOMEM;
29194 + }
29195 }
29196
29197 dest = alloc_page(GFP_KERNEL);
29198 - if (!dest) {
29199 - while (src_idx--)
29200 + if (!dest)
29201 + while (src_idx--) {
29202 __free_page(xor_srcs[src_idx]);
29203 - return -ENOMEM;
29204 - }
29205 + return -ENOMEM;
29206 + }
29207
29208 /* Fill in src buffers */
29209 for (src_idx = 0; src_idx < IOP_ADMA_NUM_SRC_TEST; src_idx++) {
29210 @@ -1401,7 +1401,7 @@
29211
29212 static struct platform_driver iop_adma_driver = {
29213 .probe = iop_adma_probe,
29214 - .remove = __devexit_p(iop_adma_remove),
29215 + .remove = iop_adma_remove,
29216 .driver = {
29217 .owner = THIS_MODULE,
29218 .name = "iop-adma",
29219 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/dma/ipu/ipu_idmac.c linux-2.6.29-rc3.owrt/drivers/dma/ipu/ipu_idmac.c
29220 --- linux-2.6.29.owrt/drivers/dma/ipu/ipu_idmac.c 2009-05-10 22:04:38.000000000 +0200
29221 +++ linux-2.6.29-rc3.owrt/drivers/dma/ipu/ipu_idmac.c 2009-05-10 23:48:28.000000000 +0200
29222 @@ -729,7 +729,7 @@
29223
29224 ichan->status = IPU_CHANNEL_READY;
29225
29226 - spin_unlock_irqrestore(&ipu->lock, flags);
29227 + spin_unlock_irqrestore(ipu->lock, flags);
29228
29229 return 0;
29230 }
29231 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/dma/mv_xor.c linux-2.6.29-rc3.owrt/drivers/dma/mv_xor.c
29232 --- linux-2.6.29.owrt/drivers/dma/mv_xor.c 2009-05-10 22:04:38.000000000 +0200
29233 +++ linux-2.6.29-rc3.owrt/drivers/dma/mv_xor.c 2009-05-10 23:48:28.000000000 +0200
29234 @@ -1019,19 +1019,19 @@
29235
29236 for (src_idx = 0; src_idx < MV_XOR_NUM_SRC_TEST; src_idx++) {
29237 xor_srcs[src_idx] = alloc_page(GFP_KERNEL);
29238 - if (!xor_srcs[src_idx]) {
29239 - while (src_idx--)
29240 + if (!xor_srcs[src_idx])
29241 + while (src_idx--) {
29242 __free_page(xor_srcs[src_idx]);
29243 - return -ENOMEM;
29244 - }
29245 + return -ENOMEM;
29246 + }
29247 }
29248
29249 dest = alloc_page(GFP_KERNEL);
29250 - if (!dest) {
29251 - while (src_idx--)
29252 + if (!dest)
29253 + while (src_idx--) {
29254 __free_page(xor_srcs[src_idx]);
29255 - return -ENOMEM;
29256 - }
29257 + return -ENOMEM;
29258 + }
29259
29260 /* Fill in src buffers */
29261 for (src_idx = 0; src_idx < MV_XOR_NUM_SRC_TEST; src_idx++) {
29262 @@ -1287,7 +1287,7 @@
29263
29264 static struct platform_driver mv_xor_driver = {
29265 .probe = mv_xor_probe,
29266 - .remove = __devexit_p(mv_xor_remove),
29267 + .remove = mv_xor_remove,
29268 .driver = {
29269 .owner = THIS_MODULE,
29270 .name = MV_XOR_NAME,
29271 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/firewire/fw-card.c linux-2.6.29-rc3.owrt/drivers/firewire/fw-card.c
29272 --- linux-2.6.29.owrt/drivers/firewire/fw-card.c 2009-05-10 22:04:39.000000000 +0200
29273 +++ linux-2.6.29-rc3.owrt/drivers/firewire/fw-card.c 2009-05-10 23:48:28.000000000 +0200
29274 @@ -232,7 +232,7 @@
29275 root_id = root_node->node_id;
29276 grace = time_after(jiffies, card->reset_jiffies + DIV_ROUND_UP(HZ, 10));
29277
29278 - if (is_next_generation(generation, card->bm_generation) ||
29279 + if (card->bm_generation + 1 == generation ||
29280 (card->bm_generation != generation && grace)) {
29281 /*
29282 * This first step is to figure out who is IRM and
29283 @@ -412,7 +412,6 @@
29284 {
29285 u32 *config_rom;
29286 size_t length;
29287 - int err;
29288
29289 card->max_receive = max_receive;
29290 card->link_speed = link_speed;
29291 @@ -423,13 +422,7 @@
29292 list_add_tail(&card->link, &card_list);
29293 mutex_unlock(&card_mutex);
29294
29295 - err = card->driver->enable(card, config_rom, length);
29296 - if (err < 0) {
29297 - mutex_lock(&card_mutex);
29298 - list_del(&card->link);
29299 - mutex_unlock(&card_mutex);
29300 - }
29301 - return err;
29302 + return card->driver->enable(card, config_rom, length);
29303 }
29304 EXPORT_SYMBOL(fw_card_add);
29305
29306 @@ -519,7 +512,7 @@
29307 fw_core_initiate_bus_reset(card, 1);
29308
29309 mutex_lock(&card_mutex);
29310 - list_del_init(&card->link);
29311 + list_del(&card->link);
29312 mutex_unlock(&card_mutex);
29313
29314 /* Set up the dummy driver. */
29315 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/firewire/fw-device.c linux-2.6.29-rc3.owrt/drivers/firewire/fw-device.c
29316 --- linux-2.6.29.owrt/drivers/firewire/fw-device.c 2009-05-10 22:04:39.000000000 +0200
29317 +++ linux-2.6.29-rc3.owrt/drivers/firewire/fw-device.c 2009-05-10 23:48:28.000000000 +0200
29318 @@ -25,7 +25,6 @@
29319 #include <linux/device.h>
29320 #include <linux/delay.h>
29321 #include <linux/idr.h>
29322 -#include <linux/jiffies.h>
29323 #include <linux/string.h>
29324 #include <linux/rwsem.h>
29325 #include <linux/semaphore.h>
29326 @@ -635,39 +634,12 @@
29327 return device;
29328 }
29329
29330 -/*
29331 - * These defines control the retry behavior for reading the config
29332 - * rom. It shouldn't be necessary to tweak these; if the device
29333 - * doesn't respond to a config rom read within 10 seconds, it's not
29334 - * going to respond at all. As for the initial delay, a lot of
29335 - * devices will be able to respond within half a second after bus
29336 - * reset. On the other hand, it's not really worth being more
29337 - * aggressive than that, since it scales pretty well; if 10 devices
29338 - * are plugged in, they're all getting read within one second.
29339 - */
29340 -
29341 -#define MAX_RETRIES 10
29342 -#define RETRY_DELAY (3 * HZ)
29343 -#define INITIAL_DELAY (HZ / 2)
29344 -#define SHUTDOWN_DELAY (2 * HZ)
29345 -
29346 static void fw_device_shutdown(struct work_struct *work)
29347 {
29348 struct fw_device *device =
29349 container_of(work, struct fw_device, work.work);
29350 int minor = MINOR(device->device.devt);
29351
29352 - if (time_is_after_jiffies(device->card->reset_jiffies + SHUTDOWN_DELAY)
29353 - && !list_empty(&device->card->link)) {
29354 - schedule_delayed_work(&device->work, SHUTDOWN_DELAY);
29355 - return;
29356 - }
29357 -
29358 - if (atomic_cmpxchg(&device->state,
29359 - FW_DEVICE_GONE,
29360 - FW_DEVICE_SHUTDOWN) != FW_DEVICE_GONE)
29361 - return;
29362 -
29363 fw_device_cdev_remove(device);
29364 device_for_each_child(&device->device, NULL, shutdown_unit);
29365 device_unregister(&device->device);
29366 @@ -675,7 +647,6 @@
29367 down_write(&fw_device_rwsem);
29368 idr_remove(&fw_device_idr, minor);
29369 up_write(&fw_device_rwsem);
29370 -
29371 fw_device_put(device);
29372 }
29373
29374 @@ -683,63 +654,25 @@
29375 .release = fw_device_release,
29376 };
29377
29378 -static void fw_device_update(struct work_struct *work);
29379 -
29380 /*
29381 - * If a device was pending for deletion because its node went away but its
29382 - * bus info block and root directory header matches that of a newly discovered
29383 - * device, revive the existing fw_device.
29384 - * The newly allocated fw_device becomes obsolete instead.
29385 + * These defines control the retry behavior for reading the config
29386 + * rom. It shouldn't be necessary to tweak these; if the device
29387 + * doesn't respond to a config rom read within 10 seconds, it's not
29388 + * going to respond at all. As for the initial delay, a lot of
29389 + * devices will be able to respond within half a second after bus
29390 + * reset. On the other hand, it's not really worth being more
29391 + * aggressive than that, since it scales pretty well; if 10 devices
29392 + * are plugged in, they're all getting read within one second.
29393 */
29394 -static int lookup_existing_device(struct device *dev, void *data)
29395 -{
29396 - struct fw_device *old = fw_device(dev);
29397 - struct fw_device *new = data;
29398 - struct fw_card *card = new->card;
29399 - int match = 0;
29400 -
29401 - down_read(&fw_device_rwsem); /* serialize config_rom access */
29402 - spin_lock_irq(&card->lock); /* serialize node access */
29403 -
29404 - if (memcmp(old->config_rom, new->config_rom, 6 * 4) == 0 &&
29405 - atomic_cmpxchg(&old->state,
29406 - FW_DEVICE_GONE,
29407 - FW_DEVICE_RUNNING) == FW_DEVICE_GONE) {
29408 - struct fw_node *current_node = new->node;
29409 - struct fw_node *obsolete_node = old->node;
29410 -
29411 - new->node = obsolete_node;
29412 - new->node->data = new;
29413 - old->node = current_node;
29414 - old->node->data = old;
29415 -
29416 - old->max_speed = new->max_speed;
29417 - old->node_id = current_node->node_id;
29418 - smp_wmb(); /* update node_id before generation */
29419 - old->generation = card->generation;
29420 - old->config_rom_retries = 0;
29421 - fw_notify("rediscovered device %s\n", dev_name(dev));
29422 -
29423 - PREPARE_DELAYED_WORK(&old->work, fw_device_update);
29424 - schedule_delayed_work(&old->work, 0);
29425 -
29426 - if (current_node == card->root_node)
29427 - fw_schedule_bm_work(card, 0);
29428 -
29429 - match = 1;
29430 - }
29431
29432 - spin_unlock_irq(&card->lock);
29433 - up_read(&fw_device_rwsem);
29434 -
29435 - return match;
29436 -}
29437 +#define MAX_RETRIES 10
29438 +#define RETRY_DELAY (3 * HZ)
29439 +#define INITIAL_DELAY (HZ / 2)
29440
29441 static void fw_device_init(struct work_struct *work)
29442 {
29443 struct fw_device *device =
29444 container_of(work, struct fw_device, work.work);
29445 - struct device *revived_dev;
29446 int minor, err;
29447
29448 /*
29449 @@ -763,15 +696,6 @@
29450 return;
29451 }
29452
29453 - revived_dev = device_find_child(device->card->device,
29454 - device, lookup_existing_device);
29455 - if (revived_dev) {
29456 - put_device(revived_dev);
29457 - fw_device_release(&device->device);
29458 -
29459 - return;
29460 - }
29461 -
29462 device_initialize(&device->device);
29463
29464 fw_device_get(device);
29465 @@ -810,10 +734,9 @@
29466 * fw_node_event().
29467 */
29468 if (atomic_cmpxchg(&device->state,
29469 - FW_DEVICE_INITIALIZING,
29470 - FW_DEVICE_RUNNING) == FW_DEVICE_GONE) {
29471 - PREPARE_DELAYED_WORK(&device->work, fw_device_shutdown);
29472 - schedule_delayed_work(&device->work, SHUTDOWN_DELAY);
29473 + FW_DEVICE_INITIALIZING,
29474 + FW_DEVICE_RUNNING) == FW_DEVICE_SHUTDOWN) {
29475 + fw_device_shutdown(work);
29476 } else {
29477 if (device->config_rom_retries)
29478 fw_notify("created device %s: GUID %08x%08x, S%d00, "
29479 @@ -924,8 +847,8 @@
29480
29481 case REREAD_BIB_UNCHANGED:
29482 if (atomic_cmpxchg(&device->state,
29483 - FW_DEVICE_INITIALIZING,
29484 - FW_DEVICE_RUNNING) == FW_DEVICE_GONE)
29485 + FW_DEVICE_INITIALIZING,
29486 + FW_DEVICE_RUNNING) == FW_DEVICE_SHUTDOWN)
29487 goto gone;
29488
29489 fw_device_update(work);
29490 @@ -956,8 +879,8 @@
29491 create_units(device);
29492
29493 if (atomic_cmpxchg(&device->state,
29494 - FW_DEVICE_INITIALIZING,
29495 - FW_DEVICE_RUNNING) == FW_DEVICE_GONE)
29496 + FW_DEVICE_INITIALIZING,
29497 + FW_DEVICE_RUNNING) == FW_DEVICE_SHUTDOWN)
29498 goto gone;
29499
29500 fw_notify("refreshed device %s\n", dev_name(&device->device));
29501 @@ -967,9 +890,8 @@
29502 give_up:
29503 fw_notify("giving up on refresh of device %s\n", dev_name(&device->device));
29504 gone:
29505 - atomic_set(&device->state, FW_DEVICE_GONE);
29506 - PREPARE_DELAYED_WORK(&device->work, fw_device_shutdown);
29507 - schedule_delayed_work(&device->work, SHUTDOWN_DELAY);
29508 + atomic_set(&device->state, FW_DEVICE_SHUTDOWN);
29509 + fw_device_shutdown(work);
29510 out:
29511 if (node_id == card->root_node->node_id)
29512 fw_schedule_bm_work(card, 0);
29513 @@ -1073,10 +995,9 @@
29514 */
29515 device = node->data;
29516 if (atomic_xchg(&device->state,
29517 - FW_DEVICE_GONE) == FW_DEVICE_RUNNING) {
29518 + FW_DEVICE_SHUTDOWN) == FW_DEVICE_RUNNING) {
29519 PREPARE_DELAYED_WORK(&device->work, fw_device_shutdown);
29520 - schedule_delayed_work(&device->work,
29521 - list_empty(&card->link) ? 0 : SHUTDOWN_DELAY);
29522 + schedule_delayed_work(&device->work, 0);
29523 }
29524 break;
29525 }
29526 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/firewire/fw-device.h linux-2.6.29-rc3.owrt/drivers/firewire/fw-device.h
29527 --- linux-2.6.29.owrt/drivers/firewire/fw-device.h 2009-05-10 22:04:39.000000000 +0200
29528 +++ linux-2.6.29-rc3.owrt/drivers/firewire/fw-device.h 2009-05-10 23:48:28.000000000 +0200
29529 @@ -28,7 +28,6 @@
29530 enum fw_device_state {
29531 FW_DEVICE_INITIALIZING,
29532 FW_DEVICE_RUNNING,
29533 - FW_DEVICE_GONE,
29534 FW_DEVICE_SHUTDOWN,
29535 };
29536
29537 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/firewire/fw-ohci.c linux-2.6.29-rc3.owrt/drivers/firewire/fw-ohci.c
29538 --- linux-2.6.29.owrt/drivers/firewire/fw-ohci.c 2009-05-10 22:04:39.000000000 +0200
29539 +++ linux-2.6.29-rc3.owrt/drivers/firewire/fw-ohci.c 2009-05-10 23:48:28.000000000 +0200
29540 @@ -226,7 +226,7 @@
29541 #define CONTEXT_DEAD 0x0800
29542 #define CONTEXT_ACTIVE 0x0400
29543
29544 -#define OHCI1394_MAX_AT_REQ_RETRIES 0xf
29545 +#define OHCI1394_MAX_AT_REQ_RETRIES 0x2
29546 #define OHCI1394_MAX_AT_RESP_RETRIES 0x2
29547 #define OHCI1394_MAX_PHYS_RESP_RETRIES 0x8
29548
29549 @@ -896,11 +896,11 @@
29550 for (i = 0; i < 10; i++) {
29551 reg = reg_read(ctx->ohci, CONTROL_SET(ctx->regs));
29552 if ((reg & CONTEXT_ACTIVE) == 0)
29553 - return;
29554 + break;
29555
29556 + fw_notify("context_stop: still active (0x%08x)\n", reg);
29557 mdelay(1);
29558 }
29559 - fw_error("Error: DMA context still active (0x%08x)\n", reg);
29560 }
29561
29562 struct driver_data {
29563 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/firewire/fw-sbp2.c linux-2.6.29-rc3.owrt/drivers/firewire/fw-sbp2.c
29564 --- linux-2.6.29.owrt/drivers/firewire/fw-sbp2.c 2009-05-10 22:04:39.000000000 +0200
29565 +++ linux-2.6.29-rc3.owrt/drivers/firewire/fw-sbp2.c 2009-05-10 23:48:28.000000000 +0200
29566 @@ -168,7 +168,6 @@
29567 int address_high;
29568 unsigned int workarounds;
29569 unsigned int mgt_orb_timeout;
29570 - unsigned int max_payload;
29571
29572 int dont_block; /* counter for each logical unit */
29573 int blocked; /* ditto */
29574 @@ -311,16 +310,14 @@
29575 dma_addr_t page_table_bus;
29576 };
29577
29578 -#define SBP2_ROM_VALUE_WILDCARD ~0 /* match all */
29579 -#define SBP2_ROM_VALUE_MISSING 0xff000000 /* not present in the unit dir. */
29580 -
29581 /*
29582 * List of devices with known bugs.
29583 *
29584 * The firmware_revision field, masked with 0xffff00, is the best
29585 * indicator for the type of bridge chip of a device. It yields a few
29586 * false positives but this did not break correctly behaving devices
29587 - * so far.
29588 + * so far. We use ~0 as a wildcard, since the 24 bit values we get
29589 + * from the config rom can never match that.
29590 */
29591 static const struct {
29592 u32 firmware_revision;
29593 @@ -342,35 +339,33 @@
29594 },
29595 /* Initio bridges, actually only needed for some older ones */ {
29596 .firmware_revision = 0x000200,
29597 - .model = SBP2_ROM_VALUE_WILDCARD,
29598 + .model = ~0,
29599 .workarounds = SBP2_WORKAROUND_INQUIRY_36,
29600 },
29601 /* PL-3507 bridge with Prolific firmware */ {
29602 .firmware_revision = 0x012800,
29603 - .model = SBP2_ROM_VALUE_WILDCARD,
29604 + .model = ~0,
29605 .workarounds = SBP2_WORKAROUND_POWER_CONDITION,
29606 },
29607 /* Symbios bridge */ {
29608 .firmware_revision = 0xa0b800,
29609 - .model = SBP2_ROM_VALUE_WILDCARD,
29610 + .model = ~0,
29611 .workarounds = SBP2_WORKAROUND_128K_MAX_TRANS,
29612 },
29613 /* Datafab MD2-FW2 with Symbios/LSILogic SYM13FW500 bridge */ {
29614 .firmware_revision = 0x002600,
29615 - .model = SBP2_ROM_VALUE_WILDCARD,
29616 + .model = ~0,
29617 .workarounds = SBP2_WORKAROUND_128K_MAX_TRANS,
29618 },
29619 +
29620 /*
29621 - * iPod 2nd generation: needs 128k max transfer size workaround
29622 - * iPod 3rd generation: needs fix capacity workaround
29623 + * There are iPods (2nd gen, 3rd gen) with model_id == 0, but
29624 + * these iPods do not feature the read_capacity bug according
29625 + * to one report. Read_capacity behaviour as well as model_id
29626 + * could change due to Apple-supplied firmware updates though.
29627 */
29628 - {
29629 - .firmware_revision = 0x0a2700,
29630 - .model = 0x000000,
29631 - .workarounds = SBP2_WORKAROUND_128K_MAX_TRANS |
29632 - SBP2_WORKAROUND_FIX_CAPACITY,
29633 - },
29634 - /* iPod 4th generation */ {
29635 +
29636 + /* iPod 4th generation. */ {
29637 .firmware_revision = 0x0a2700,
29638 .model = 0x000021,
29639 .workarounds = SBP2_WORKAROUND_FIX_CAPACITY,
29640 @@ -1097,7 +1092,7 @@
29641 continue;
29642
29643 if (sbp2_workarounds_table[i].model != model &&
29644 - sbp2_workarounds_table[i].model != SBP2_ROM_VALUE_WILDCARD)
29645 + sbp2_workarounds_table[i].model != ~0)
29646 continue;
29647
29648 w |= sbp2_workarounds_table[i].workarounds;
29649 @@ -1147,28 +1142,20 @@
29650 fw_device_get(device);
29651 fw_unit_get(unit);
29652
29653 + /* Initialize to values that won't match anything in our table. */
29654 + firmware_revision = 0xff000000;
29655 + model = 0xff000000;
29656 +
29657 /* implicit directory ID */
29658 tgt->directory_id = ((unit->directory - device->config_rom) * 4
29659 + CSR_CONFIG_ROM) & 0xffffff;
29660
29661 - firmware_revision = SBP2_ROM_VALUE_MISSING;
29662 - model = SBP2_ROM_VALUE_MISSING;
29663 -
29664 if (sbp2_scan_unit_dir(tgt, unit->directory, &model,
29665 &firmware_revision) < 0)
29666 goto fail_tgt_put;
29667
29668 sbp2_init_workarounds(tgt, model, firmware_revision);
29669
29670 - /*
29671 - * At S100 we can do 512 bytes per packet, at S200 1024 bytes,
29672 - * and so on up to 4096 bytes. The SBP-2 max_payload field
29673 - * specifies the max payload size as 2 ^ (max_payload + 2), so
29674 - * if we set this to max_speed + 7, we get the right value.
29675 - */
29676 - tgt->max_payload = min(device->max_speed + 7, 10U);
29677 - tgt->max_payload = min(tgt->max_payload, device->card->max_receive - 1);
29678 -
29679 /* Do the login in a workqueue so we can easily reschedule retries. */
29680 list_for_each_entry(lu, &tgt->lu_list, link)
29681 sbp2_queue_work(lu, DIV_ROUND_UP(HZ, 5));
29682 @@ -1286,19 +1273,6 @@
29683 .id_table = sbp2_id_table,
29684 };
29685
29686 -static void sbp2_unmap_scatterlist(struct device *card_device,
29687 - struct sbp2_command_orb *orb)
29688 -{
29689 - if (scsi_sg_count(orb->cmd))
29690 - dma_unmap_sg(card_device, scsi_sglist(orb->cmd),
29691 - scsi_sg_count(orb->cmd),
29692 - orb->cmd->sc_data_direction);
29693 -
29694 - if (orb->request.misc & cpu_to_be32(COMMAND_ORB_PAGE_TABLE_PRESENT))
29695 - dma_unmap_single(card_device, orb->page_table_bus,
29696 - sizeof(orb->page_table), DMA_TO_DEVICE);
29697 -}
29698 -
29699 static unsigned int
29700 sbp2_status_to_sense_data(u8 *sbp2_status, u8 *sense_data)
29701 {
29702 @@ -1378,7 +1352,15 @@
29703
29704 dma_unmap_single(device->card->device, orb->base.request_bus,
29705 sizeof(orb->request), DMA_TO_DEVICE);
29706 - sbp2_unmap_scatterlist(device->card->device, orb);
29707 +
29708 + if (scsi_sg_count(orb->cmd) > 0)
29709 + dma_unmap_sg(device->card->device, scsi_sglist(orb->cmd),
29710 + scsi_sg_count(orb->cmd),
29711 + orb->cmd->sc_data_direction);
29712 +
29713 + if (orb->page_table_bus != 0)
29714 + dma_unmap_single(device->card->device, orb->page_table_bus,
29715 + sizeof(orb->page_table), DMA_TO_DEVICE);
29716
29717 orb->cmd->result = result;
29718 orb->done(orb->cmd);
29719 @@ -1452,6 +1434,7 @@
29720 struct sbp2_logical_unit *lu = cmd->device->hostdata;
29721 struct fw_device *device = fw_device(lu->tgt->unit->device.parent);
29722 struct sbp2_command_orb *orb;
29723 + unsigned int max_payload;
29724 int generation, retval = SCSI_MLQUEUE_HOST_BUSY;
29725
29726 /*
29727 @@ -1479,9 +1462,17 @@
29728 orb->done = done;
29729 orb->cmd = cmd;
29730
29731 - orb->request.next.high = cpu_to_be32(SBP2_ORB_NULL);
29732 + orb->request.next.high = cpu_to_be32(SBP2_ORB_NULL);
29733 + /*
29734 + * At speed 100 we can do 512 bytes per packet, at speed 200,
29735 + * 1024 bytes per packet etc. The SBP-2 max_payload field
29736 + * specifies the max payload size as 2 ^ (max_payload + 2), so
29737 + * if we set this to max_speed + 7, we get the right value.
29738 + */
29739 + max_payload = min(device->max_speed + 7,
29740 + device->card->max_receive - 1);
29741 orb->request.misc = cpu_to_be32(
29742 - COMMAND_ORB_MAX_PAYLOAD(lu->tgt->max_payload) |
29743 + COMMAND_ORB_MAX_PAYLOAD(max_payload) |
29744 COMMAND_ORB_SPEED(device->max_speed) |
29745 COMMAND_ORB_NOTIFY);
29746
29747 @@ -1500,10 +1491,8 @@
29748 orb->base.request_bus =
29749 dma_map_single(device->card->device, &orb->request,
29750 sizeof(orb->request), DMA_TO_DEVICE);
29751 - if (dma_mapping_error(device->card->device, orb->base.request_bus)) {
29752 - sbp2_unmap_scatterlist(device->card->device, orb);
29753 + if (dma_mapping_error(device->card->device, orb->base.request_bus))
29754 goto out;
29755 - }
29756
29757 sbp2_send_orb(&orb->base, lu, lu->tgt->node_id, generation,
29758 lu->command_block_agent_address + SBP2_ORB_POINTER);
29759 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/firewire/fw-topology.c linux-2.6.29-rc3.owrt/drivers/firewire/fw-topology.c
29760 --- linux-2.6.29.owrt/drivers/firewire/fw-topology.c 2009-05-10 22:04:39.000000000 +0200
29761 +++ linux-2.6.29-rc3.owrt/drivers/firewire/fw-topology.c 2009-05-10 23:48:28.000000000 +0200
29762 @@ -518,18 +518,6 @@
29763 struct fw_node *local_node;
29764 unsigned long flags;
29765
29766 - /*
29767 - * If the selfID buffer is not the immediate successor of the
29768 - * previously processed one, we cannot reliably compare the
29769 - * old and new topologies.
29770 - */
29771 - if (!is_next_generation(generation, card->generation) &&
29772 - card->local_node != NULL) {
29773 - fw_notify("skipped bus generations, destroying all nodes\n");
29774 - fw_destroy_nodes(card);
29775 - card->bm_retries = 0;
29776 - }
29777 -
29778 spin_lock_irqsave(&card->lock, flags);
29779
29780 card->node_id = node_id;
29781 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/firewire/fw-transaction.h linux-2.6.29-rc3.owrt/drivers/firewire/fw-transaction.h
29782 --- linux-2.6.29.owrt/drivers/firewire/fw-transaction.h 2009-05-10 22:04:39.000000000 +0200
29783 +++ linux-2.6.29-rc3.owrt/drivers/firewire/fw-transaction.h 2009-05-10 23:48:28.000000000 +0200
29784 @@ -276,15 +276,6 @@
29785 extern void fw_schedule_bm_work(struct fw_card *card, unsigned long delay);
29786
29787 /*
29788 - * Check whether new_generation is the immediate successor of old_generation.
29789 - * Take counter roll-over at 255 (as per to OHCI) into account.
29790 - */
29791 -static inline bool is_next_generation(int new_generation, int old_generation)
29792 -{
29793 - return (new_generation & 0xff) == ((old_generation + 1) & 0xff);
29794 -}
29795 -
29796 -/*
29797 * The iso packet format allows for an immediate header/payload part
29798 * stored in 'header' immediately after the packet info plus an
29799 * indirect payload part that is pointer to by the 'payload' field.
29800 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/firmware/memmap.c linux-2.6.29-rc3.owrt/drivers/firmware/memmap.c
29801 --- linux-2.6.29.owrt/drivers/firmware/memmap.c 2009-05-10 22:04:38.000000000 +0200
29802 +++ linux-2.6.29-rc3.owrt/drivers/firmware/memmap.c 2009-05-10 23:48:28.000000000 +0200
29803 @@ -1,7 +1,7 @@
29804 /*
29805 * linux/drivers/firmware/memmap.c
29806 * Copyright (C) 2008 SUSE LINUX Products GmbH
29807 - * by Bernhard Walle <bernhard.walle@gmx.de>
29808 + * by Bernhard Walle <bwalle@suse.de>
29809 *
29810 * This program is free software; you can redistribute it and/or modify
29811 * it under the terms of the GNU General Public License v2.0 as published by
29812 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/gpio/gpiolib.c linux-2.6.29-rc3.owrt/drivers/gpio/gpiolib.c
29813 --- linux-2.6.29.owrt/drivers/gpio/gpiolib.c 2009-05-10 22:04:39.000000000 +0200
29814 +++ linux-2.6.29-rc3.owrt/drivers/gpio/gpiolib.c 2009-05-10 23:48:28.000000000 +0200
29815 @@ -789,7 +789,6 @@
29816 } else {
29817 status = -EBUSY;
29818 module_put(chip->owner);
29819 - goto done;
29820 }
29821
29822 if (chip->request) {
29823 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/gpu/drm/drm_bufs.c linux-2.6.29-rc3.owrt/drivers/gpu/drm/drm_bufs.c
29824 --- linux-2.6.29.owrt/drivers/gpu/drm/drm_bufs.c 2009-05-10 22:04:38.000000000 +0200
29825 +++ linux-2.6.29-rc3.owrt/drivers/gpu/drm/drm_bufs.c 2009-05-10 23:48:28.000000000 +0200
29826 @@ -420,7 +420,7 @@
29827 dev->sigdata.lock = NULL;
29828 master->lock.hw_lock = NULL; /* SHM removed */
29829 master->lock.file_priv = NULL;
29830 - wake_up_interruptible_all(&master->lock.lock_queue);
29831 + wake_up_interruptible(&master->lock.lock_queue);
29832 }
29833 break;
29834 case _DRM_AGP:
29835 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/gpu/drm/drm_crtc.c linux-2.6.29-rc3.owrt/drivers/gpu/drm/drm_crtc.c
29836 --- linux-2.6.29.owrt/drivers/gpu/drm/drm_crtc.c 2009-05-10 22:04:38.000000000 +0200
29837 +++ linux-2.6.29-rc3.owrt/drivers/gpu/drm/drm_crtc.c 2009-05-10 23:48:28.000000000 +0200
29838 @@ -1741,8 +1741,9 @@
29839 * RETURNS:
29840 * Zero on success, errno on failure.
29841 */
29842 -void drm_fb_release(struct drm_file *priv)
29843 +void drm_fb_release(struct file *filp)
29844 {
29845 + struct drm_file *priv = filp->private_data;
29846 struct drm_device *dev = priv->minor->dev;
29847 struct drm_framebuffer *fb, *tfb;
29848
29849 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/gpu/drm/drm_crtc_helper.c linux-2.6.29-rc3.owrt/drivers/gpu/drm/drm_crtc_helper.c
29850 --- linux-2.6.29.owrt/drivers/gpu/drm/drm_crtc_helper.c 2009-05-10 22:04:38.000000000 +0200
29851 +++ linux-2.6.29-rc3.owrt/drivers/gpu/drm/drm_crtc_helper.c 2009-05-10 23:48:28.000000000 +0200
29852 @@ -452,59 +452,6 @@
29853 kfree(modes);
29854 kfree(enabled);
29855 }
29856 -
29857 -/**
29858 - * drm_encoder_crtc_ok - can a given crtc drive a given encoder?
29859 - * @encoder: encoder to test
29860 - * @crtc: crtc to test
29861 - *
29862 - * Return false if @encoder can't be driven by @crtc, true otherwise.
29863 - */
29864 -static bool drm_encoder_crtc_ok(struct drm_encoder *encoder,
29865 - struct drm_crtc *crtc)
29866 -{
29867 - struct drm_device *dev;
29868 - struct drm_crtc *tmp;
29869 - int crtc_mask = 1;
29870 -
29871 - WARN(!crtc, "checking null crtc?");
29872 -
29873 - dev = crtc->dev;
29874 -
29875 - list_for_each_entry(tmp, &dev->mode_config.crtc_list, head) {
29876 - if (tmp == crtc)
29877 - break;
29878 - crtc_mask <<= 1;
29879 - }
29880 -
29881 - if (encoder->possible_crtcs & crtc_mask)
29882 - return true;
29883 - return false;
29884 -}
29885 -
29886 -/*
29887 - * Check the CRTC we're going to map each output to vs. its current
29888 - * CRTC. If they don't match, we have to disable the output and the CRTC
29889 - * since the driver will have to re-route things.
29890 - */
29891 -static void
29892 -drm_crtc_prepare_encoders(struct drm_device *dev)
29893 -{
29894 - struct drm_encoder_helper_funcs *encoder_funcs;
29895 - struct drm_encoder *encoder;
29896 -
29897 - list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
29898 - encoder_funcs = encoder->helper_private;
29899 - /* Disable unused encoders */
29900 - if (encoder->crtc == NULL)
29901 - (*encoder_funcs->dpms)(encoder, DRM_MODE_DPMS_OFF);
29902 - /* Disable encoders whose CRTC is about to change */
29903 - if (encoder_funcs->get_crtc &&
29904 - encoder->crtc != (*encoder_funcs->get_crtc)(encoder))
29905 - (*encoder_funcs->dpms)(encoder, DRM_MODE_DPMS_OFF);
29906 - }
29907 -}
29908 -
29909 /**
29910 * drm_crtc_set_mode - set a mode
29911 * @crtc: CRTC to program
29912 @@ -565,8 +512,8 @@
29913 if (drm_mode_equal(&saved_mode, &crtc->mode)) {
29914 if (saved_x != crtc->x || saved_y != crtc->y ||
29915 depth_changed || bpp_changed) {
29916 - ret = !crtc_funcs->mode_set_base(crtc, crtc->x, crtc->y,
29917 - old_fb);
29918 + crtc_funcs->mode_set_base(crtc, crtc->x, crtc->y,
29919 + old_fb);
29920 goto done;
29921 }
29922 }
29923 @@ -600,16 +547,12 @@
29924 encoder_funcs->prepare(encoder);
29925 }
29926
29927 - drm_crtc_prepare_encoders(dev);
29928 -
29929 crtc_funcs->prepare(crtc);
29930
29931 /* Set up the DPLL and any encoders state that needs to adjust or depend
29932 * on the DPLL.
29933 */
29934 - ret = !crtc_funcs->mode_set(crtc, mode, adjusted_mode, x, y, old_fb);
29935 - if (!ret)
29936 - goto done;
29937 + crtc_funcs->mode_set(crtc, mode, adjusted_mode, x, y, old_fb);
29938
29939 list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
29940
29941 @@ -672,7 +615,7 @@
29942 struct drm_device *dev;
29943 struct drm_crtc **save_crtcs, *new_crtc;
29944 struct drm_encoder **save_encoders, *new_encoder;
29945 - struct drm_framebuffer *old_fb = NULL;
29946 + struct drm_framebuffer *old_fb;
29947 bool save_enabled;
29948 bool mode_changed = false;
29949 bool fb_changed = false;
29950 @@ -723,10 +666,9 @@
29951 * and then just flip_or_move it */
29952 if (set->crtc->fb != set->fb) {
29953 /* If we have no fb then treat it as a full mode set */
29954 - if (set->crtc->fb == NULL) {
29955 - DRM_DEBUG("crtc has no fb, full mode set\n");
29956 + if (set->crtc->fb == NULL)
29957 mode_changed = true;
29958 - } else if ((set->fb->bits_per_pixel !=
29959 + else if ((set->fb->bits_per_pixel !=
29960 set->crtc->fb->bits_per_pixel) ||
29961 set->fb->depth != set->crtc->fb->depth)
29962 fb_changed = true;
29963 @@ -738,7 +680,7 @@
29964 fb_changed = true;
29965
29966 if (set->mode && !drm_mode_equal(set->mode, &set->crtc->mode)) {
29967 - DRM_DEBUG("modes are different, full mode set\n");
29968 + DRM_DEBUG("modes are different\n");
29969 drm_mode_debug_printmodeline(&set->crtc->mode);
29970 drm_mode_debug_printmodeline(set->mode);
29971 mode_changed = true;
29972 @@ -764,7 +706,6 @@
29973 }
29974
29975 if (new_encoder != connector->encoder) {
29976 - DRM_DEBUG("encoder changed, full mode switch\n");
29977 mode_changed = true;
29978 connector->encoder = new_encoder;
29979 }
29980 @@ -791,20 +732,10 @@
29981 if (set->connectors[ro] == connector)
29982 new_crtc = set->crtc;
29983 }
29984 -
29985 - /* Make sure the new CRTC will work with the encoder */
29986 - if (new_crtc &&
29987 - !drm_encoder_crtc_ok(connector->encoder, new_crtc)) {
29988 - ret = -EINVAL;
29989 - goto fail_set_mode;
29990 - }
29991 if (new_crtc != connector->encoder->crtc) {
29992 - DRM_DEBUG("crtc changed, full mode switch\n");
29993 mode_changed = true;
29994 connector->encoder->crtc = new_crtc;
29995 }
29996 - DRM_DEBUG("setting connector %d crtc to %p\n",
29997 - connector->base.id, new_crtc);
29998 }
29999
30000 /* mode_set_base is not a required function */
30001 @@ -821,8 +752,6 @@
30002 if (!drm_crtc_helper_set_mode(set->crtc, set->mode,
30003 set->x, set->y,
30004 old_fb)) {
30005 - DRM_ERROR("failed to set mode on crtc %p\n",
30006 - set->crtc);
30007 ret = -EINVAL;
30008 goto fail_set_mode;
30009 }
30010 @@ -836,10 +765,7 @@
30011 old_fb = set->crtc->fb;
30012 if (set->crtc->fb != set->fb)
30013 set->crtc->fb = set->fb;
30014 - ret = crtc_funcs->mode_set_base(set->crtc,
30015 - set->x, set->y, old_fb);
30016 - if (ret != 0)
30017 - goto fail_set_mode;
30018 + crtc_funcs->mode_set_base(set->crtc, set->x, set->y, old_fb);
30019 }
30020
30021 kfree(save_encoders);
30022 @@ -848,14 +774,9 @@
30023
30024 fail_set_mode:
30025 set->crtc->enabled = save_enabled;
30026 - set->crtc->fb = old_fb;
30027 count = 0;
30028 - list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
30029 - if (!connector->encoder)
30030 - continue;
30031 -
30032 + list_for_each_entry(connector, &dev->mode_config.connector_list, head)
30033 connector->encoder->crtc = save_crtcs[count++];
30034 - }
30035 fail_no_encoder:
30036 kfree(save_crtcs);
30037 count = 0;
30038 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/gpu/drm/drm_edid.c linux-2.6.29-rc3.owrt/drivers/gpu/drm/drm_edid.c
30039 --- linux-2.6.29.owrt/drivers/gpu/drm/drm_edid.c 2009-05-10 22:04:38.000000000 +0200
30040 +++ linux-2.6.29-rc3.owrt/drivers/gpu/drm/drm_edid.c 2009-05-10 23:48:28.000000000 +0200
30041 @@ -125,7 +125,7 @@
30042 DRM_ERROR("EDID has major version %d, instead of 1\n", edid->version);
30043 goto bad;
30044 }
30045 - if (edid->revision > 3) {
30046 + if (edid->revision <= 0 || edid->revision > 3) {
30047 DRM_ERROR("EDID has minor version %d, which is not between 0-3\n", edid->revision);
30048 goto bad;
30049 }
30050 @@ -320,10 +320,10 @@
30051 mode->htotal = mode->hdisplay + ((pt->hblank_hi << 8) | pt->hblank_lo);
30052
30053 mode->vdisplay = (pt->vactive_hi << 8) | pt->vactive_lo;
30054 - mode->vsync_start = mode->vdisplay + ((pt->vsync_offset_hi << 4) |
30055 + mode->vsync_start = mode->vdisplay + ((pt->vsync_offset_hi << 8) |
30056 pt->vsync_offset_lo);
30057 mode->vsync_end = mode->vsync_start +
30058 - ((pt->vsync_pulse_width_hi << 4) |
30059 + ((pt->vsync_pulse_width_hi << 8) |
30060 pt->vsync_pulse_width_lo);
30061 mode->vtotal = mode->vdisplay + ((pt->vblank_hi << 8) | pt->vblank_lo);
30062
30063 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/gpu/drm/drm_fops.c linux-2.6.29-rc3.owrt/drivers/gpu/drm/drm_fops.c
30064 --- linux-2.6.29.owrt/drivers/gpu/drm/drm_fops.c 2009-05-10 22:04:38.000000000 +0200
30065 +++ linux-2.6.29-rc3.owrt/drivers/gpu/drm/drm_fops.c 2009-05-10 23:48:28.000000000 +0200
30066 @@ -457,9 +457,6 @@
30067 if (dev->driver->driver_features & DRIVER_GEM)
30068 drm_gem_release(dev, file_priv);
30069
30070 - if (dev->driver->driver_features & DRIVER_MODESET)
30071 - drm_fb_release(file_priv);
30072 -
30073 mutex_lock(&dev->ctxlist_mutex);
30074 if (!list_empty(&dev->ctxlist)) {
30075 struct drm_ctx_list *pos, *n;
30076 @@ -484,7 +481,6 @@
30077 mutex_lock(&dev->struct_mutex);
30078
30079 if (file_priv->is_master) {
30080 - struct drm_master *master = file_priv->master;
30081 struct drm_file *temp;
30082 list_for_each_entry(temp, &dev->filelist, lhead) {
30083 if ((temp->master == file_priv->master) &&
30084 @@ -492,19 +488,6 @@
30085 temp->authenticated = 0;
30086 }
30087
30088 - /**
30089 - * Since the master is disappearing, so is the
30090 - * possibility to lock.
30091 - */
30092 -
30093 - if (master->lock.hw_lock) {
30094 - if (dev->sigdata.lock == master->lock.hw_lock)
30095 - dev->sigdata.lock = NULL;
30096 - master->lock.hw_lock = NULL;
30097 - master->lock.file_priv = NULL;
30098 - wake_up_interruptible_all(&master->lock.lock_queue);
30099 - }
30100 -
30101 if (file_priv->minor->master == file_priv->master) {
30102 /* drop the reference held my the minor */
30103 drm_master_put(&file_priv->minor->master);
30104 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/gpu/drm/drm_gem.c linux-2.6.29-rc3.owrt/drivers/gpu/drm/drm_gem.c
30105 --- linux-2.6.29.owrt/drivers/gpu/drm/drm_gem.c 2009-05-10 22:04:38.000000000 +0200
30106 +++ linux-2.6.29-rc3.owrt/drivers/gpu/drm/drm_gem.c 2009-05-10 23:48:28.000000000 +0200
30107 @@ -104,8 +104,8 @@
30108
30109 if (drm_mm_init(&mm->offset_manager, DRM_FILE_PAGE_OFFSET_START,
30110 DRM_FILE_PAGE_OFFSET_SIZE)) {
30111 - drm_ht_remove(&mm->offset_hash);
30112 drm_free(mm, sizeof(struct drm_gem_mm), DRM_MEM_MM);
30113 + drm_ht_remove(&mm->offset_hash);
30114 return -ENOMEM;
30115 }
30116
30117 @@ -136,7 +136,7 @@
30118 obj = kcalloc(1, sizeof(*obj), GFP_KERNEL);
30119
30120 obj->dev = dev;
30121 - obj->filp = shmem_file_setup("drm mm object", size, VM_NORESERVE);
30122 + obj->filp = shmem_file_setup("drm mm object", size, 0);
30123 if (IS_ERR(obj->filp)) {
30124 kfree(obj);
30125 return NULL;
30126 @@ -295,37 +295,35 @@
30127 return -EBADF;
30128
30129 again:
30130 - if (idr_pre_get(&dev->object_name_idr, GFP_KERNEL) == 0) {
30131 - ret = -ENOMEM;
30132 - goto err;
30133 - }
30134 + if (idr_pre_get(&dev->object_name_idr, GFP_KERNEL) == 0)
30135 + return -ENOMEM;
30136
30137 spin_lock(&dev->object_name_lock);
30138 - if (!obj->name) {
30139 - ret = idr_get_new_above(&dev->object_name_idr, obj, 1,
30140 - &obj->name);
30141 - args->name = (uint64_t) obj->name;
30142 + if (obj->name) {
30143 + args->name = obj->name;
30144 spin_unlock(&dev->object_name_lock);
30145 + return 0;
30146 + }
30147 + ret = idr_get_new_above(&dev->object_name_idr, obj, 1,
30148 + &obj->name);
30149 + spin_unlock(&dev->object_name_lock);
30150 + if (ret == -EAGAIN)
30151 + goto again;
30152
30153 - if (ret == -EAGAIN)
30154 - goto again;
30155 -
30156 - if (ret != 0)
30157 - goto err;
30158 -
30159 - /* Allocate a reference for the name table. */
30160 - drm_gem_object_reference(obj);
30161 - } else {
30162 - args->name = (uint64_t) obj->name;
30163 - spin_unlock(&dev->object_name_lock);
30164 - ret = 0;
30165 + if (ret != 0) {
30166 + mutex_lock(&dev->struct_mutex);
30167 + drm_gem_object_unreference(obj);
30168 + mutex_unlock(&dev->struct_mutex);
30169 + return ret;
30170 }
30171
30172 -err:
30173 - mutex_lock(&dev->struct_mutex);
30174 - drm_gem_object_unreference(obj);
30175 - mutex_unlock(&dev->struct_mutex);
30176 - return ret;
30177 + /*
30178 + * Leave the reference from the lookup around as the
30179 + * name table now holds one
30180 + */
30181 + args->name = (uint64_t) obj->name;
30182 +
30183 + return 0;
30184 }
30185
30186 /**
30187 @@ -450,7 +448,6 @@
30188 spin_lock(&dev->object_name_lock);
30189 if (obj->name) {
30190 idr_remove(&dev->object_name_idr, obj->name);
30191 - obj->name = 0;
30192 spin_unlock(&dev->object_name_lock);
30193 /*
30194 * The object name held a reference to this object, drop
30195 @@ -463,26 +460,6 @@
30196 }
30197 EXPORT_SYMBOL(drm_gem_object_handle_free);
30198
30199 -void drm_gem_vm_open(struct vm_area_struct *vma)
30200 -{
30201 - struct drm_gem_object *obj = vma->vm_private_data;
30202 -
30203 - drm_gem_object_reference(obj);
30204 -}
30205 -EXPORT_SYMBOL(drm_gem_vm_open);
30206 -
30207 -void drm_gem_vm_close(struct vm_area_struct *vma)
30208 -{
30209 - struct drm_gem_object *obj = vma->vm_private_data;
30210 - struct drm_device *dev = obj->dev;
30211 -
30212 - mutex_lock(&dev->struct_mutex);
30213 - drm_gem_object_unreference(obj);
30214 - mutex_unlock(&dev->struct_mutex);
30215 -}
30216 -EXPORT_SYMBOL(drm_gem_vm_close);
30217 -
30218 -
30219 /**
30220 * drm_gem_mmap - memory map routine for GEM objects
30221 * @filp: DRM file pointer
30222 @@ -544,14 +521,6 @@
30223 #endif
30224 vma->vm_page_prot = __pgprot(prot);
30225
30226 - /* Take a ref for this mapping of the object, so that the fault
30227 - * handler can dereference the mmap offset's pointer to the object.
30228 - * This reference is cleaned up by the corresponding vm_close
30229 - * (which should happen whether the vma was created by this call, or
30230 - * by a vm_open due to mremap or partial unmap or whatever).
30231 - */
30232 - drm_gem_object_reference(obj);
30233 -
30234 vma->vm_file = filp; /* Needed for drm_vm_open() */
30235 drm_vm_open_locked(vma);
30236
30237 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/gpu/drm/drm_irq.c linux-2.6.29-rc3.owrt/drivers/gpu/drm/drm_irq.c
30238 --- linux-2.6.29.owrt/drivers/gpu/drm/drm_irq.c 2009-05-10 22:04:38.000000000 +0200
30239 +++ linux-2.6.29-rc3.owrt/drivers/gpu/drm/drm_irq.c 2009-05-10 23:48:28.000000000 +0200
30240 @@ -276,7 +276,6 @@
30241 for (i = 0; i < dev->num_crtcs; i++) {
30242 DRM_WAKEUP(&dev->vbl_queue[i]);
30243 dev->vblank_enabled[i] = 0;
30244 - dev->last_vblank[i] = dev->driver->get_vblank_counter(dev, i);
30245 }
30246 spin_unlock_irqrestore(&dev->vbl_lock, irqflags);
30247
30248 @@ -435,8 +434,6 @@
30249 */
30250 void drm_vblank_put(struct drm_device *dev, int crtc)
30251 {
30252 - BUG_ON (atomic_read (&dev->vblank_refcount[crtc]) == 0);
30253 -
30254 /* Last user schedules interrupt disable */
30255 if (atomic_dec_and_test(&dev->vblank_refcount[crtc]))
30256 mod_timer(&dev->vblank_disable_timer, jiffies + 5*DRM_HZ);
30257 @@ -462,9 +459,8 @@
30258 * so that interrupts remain enabled in the interim.
30259 */
30260 if (!dev->vblank_inmodeset[crtc]) {
30261 - dev->vblank_inmodeset[crtc] = 0x1;
30262 - if (drm_vblank_get(dev, crtc) == 0)
30263 - dev->vblank_inmodeset[crtc] |= 0x2;
30264 + dev->vblank_inmodeset[crtc] = 1;
30265 + drm_vblank_get(dev, crtc);
30266 }
30267 }
30268 EXPORT_SYMBOL(drm_vblank_pre_modeset);
30269 @@ -476,12 +472,9 @@
30270 if (dev->vblank_inmodeset[crtc]) {
30271 spin_lock_irqsave(&dev->vbl_lock, irqflags);
30272 dev->vblank_disable_allowed = 1;
30273 - spin_unlock_irqrestore(&dev->vbl_lock, irqflags);
30274 -
30275 - if (dev->vblank_inmodeset[crtc] & 0x2)
30276 - drm_vblank_put(dev, crtc);
30277 -
30278 dev->vblank_inmodeset[crtc] = 0;
30279 + spin_unlock_irqrestore(&dev->vbl_lock, irqflags);
30280 + drm_vblank_put(dev, crtc);
30281 }
30282 }
30283 EXPORT_SYMBOL(drm_vblank_post_modeset);
30284 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/gpu/drm/drm_lock.c linux-2.6.29-rc3.owrt/drivers/gpu/drm/drm_lock.c
30285 --- linux-2.6.29.owrt/drivers/gpu/drm/drm_lock.c 2009-05-10 22:04:38.000000000 +0200
30286 +++ linux-2.6.29-rc3.owrt/drivers/gpu/drm/drm_lock.c 2009-05-10 23:48:28.000000000 +0200
30287 @@ -80,7 +80,6 @@
30288 __set_current_state(TASK_INTERRUPTIBLE);
30289 if (!master->lock.hw_lock) {
30290 /* Device has been unregistered */
30291 - send_sig(SIGTERM, current, 0);
30292 ret = -EINTR;
30293 break;
30294 }
30295 @@ -94,7 +93,7 @@
30296 /* Contention */
30297 schedule();
30298 if (signal_pending(current)) {
30299 - ret = -EINTR;
30300 + ret = -ERESTARTSYS;
30301 break;
30302 }
30303 }
30304 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/gpu/drm/drm_memory.c linux-2.6.29-rc3.owrt/drivers/gpu/drm/drm_memory.c
30305 --- linux-2.6.29.owrt/drivers/gpu/drm/drm_memory.c 2009-05-10 22:04:38.000000000 +0200
30306 +++ linux-2.6.29-rc3.owrt/drivers/gpu/drm/drm_memory.c 2009-05-10 23:48:28.000000000 +0200
30307 @@ -171,14 +171,9 @@
30308
30309 void drm_core_ioremap_wc(struct drm_map *map, struct drm_device *dev)
30310 {
30311 - if (drm_core_has_AGP(dev) &&
30312 - dev->agp && dev->agp->cant_use_aperture && map->type == _DRM_AGP)
30313 - map->handle = agp_remap(map->offset, map->size, dev);
30314 - else
30315 - map->handle = ioremap_wc(map->offset, map->size);
30316 + map->handle = ioremap_wc(map->offset, map->size);
30317 }
30318 EXPORT_SYMBOL(drm_core_ioremap_wc);
30319 -
30320 void drm_core_ioremapfree(struct drm_map *map, struct drm_device *dev)
30321 {
30322 if (!map->handle || !map->size)
30323 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/gpu/drm/drm_stub.c linux-2.6.29-rc3.owrt/drivers/gpu/drm/drm_stub.c
30324 --- linux-2.6.29.owrt/drivers/gpu/drm/drm_stub.c 2009-05-10 22:04:38.000000000 +0200
30325 +++ linux-2.6.29-rc3.owrt/drivers/gpu/drm/drm_stub.c 2009-05-10 23:48:28.000000000 +0200
30326 @@ -146,6 +146,14 @@
30327
30328 drm_ht_remove(&master->magiclist);
30329
30330 + if (master->lock.hw_lock) {
30331 + if (dev->sigdata.lock == master->lock.hw_lock)
30332 + dev->sigdata.lock = NULL;
30333 + master->lock.hw_lock = NULL;
30334 + master->lock.file_priv = NULL;
30335 + wake_up_interruptible(&master->lock.lock_queue);
30336 + }
30337 +
30338 drm_free(master, sizeof(*master), DRM_MEM_DRIVER);
30339 }
30340
30341 @@ -168,7 +176,7 @@
30342 file_priv->minor->master != file_priv->master) {
30343 mutex_lock(&dev->struct_mutex);
30344 file_priv->minor->master = drm_master_get(file_priv->master);
30345 - mutex_unlock(&dev->struct_mutex);
30346 + mutex_lock(&dev->struct_mutex);
30347 }
30348
30349 return 0;
30350 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/gpu/drm/i915/i915_dma.c linux-2.6.29-rc3.owrt/drivers/gpu/drm/i915/i915_dma.c
30351 --- linux-2.6.29.owrt/drivers/gpu/drm/i915/i915_dma.c 2009-05-10 22:04:38.000000000 +0200
30352 +++ linux-2.6.29-rc3.owrt/drivers/gpu/drm/i915/i915_dma.c 2009-05-10 23:48:28.000000000 +0200
30353 @@ -202,7 +202,7 @@
30354 dev_priv->ring.map.flags = 0;
30355 dev_priv->ring.map.mtrr = 0;
30356
30357 - drm_core_ioremap_wc(&dev_priv->ring.map, dev);
30358 + drm_core_ioremap(&dev_priv->ring.map, dev);
30359
30360 if (dev_priv->ring.map.handle == NULL) {
30361 i915_dma_cleanup(dev);
30362 @@ -731,11 +731,8 @@
30363 case I915_PARAM_HAS_GEM:
30364 value = dev_priv->has_gem;
30365 break;
30366 - case I915_PARAM_NUM_FENCES_AVAIL:
30367 - value = dev_priv->num_fence_regs - dev_priv->fence_reg_start;
30368 - break;
30369 default:
30370 - DRM_DEBUG("Unknown parameter %d\n", param->param);
30371 + DRM_ERROR("Unknown parameter %d\n", param->param);
30372 return -EINVAL;
30373 }
30374
30375 @@ -767,15 +764,8 @@
30376 case I915_SETPARAM_ALLOW_BATCHBUFFER:
30377 dev_priv->allow_batchbuffer = param->value;
30378 break;
30379 - case I915_SETPARAM_NUM_USED_FENCES:
30380 - if (param->value > dev_priv->num_fence_regs ||
30381 - param->value < 0)
30382 - return -EINVAL;
30383 - /* Userspace can use first N regs */
30384 - dev_priv->fence_reg_start = param->value;
30385 - break;
30386 default:
30387 - DRM_DEBUG("unknown parameter %d\n", param->param);
30388 + DRM_ERROR("unknown parameter %d\n", param->param);
30389 return -EINVAL;
30390 }
30391
30392 @@ -811,7 +801,7 @@
30393 dev_priv->hws_map.flags = 0;
30394 dev_priv->hws_map.mtrr = 0;
30395
30396 - drm_core_ioremap_wc(&dev_priv->hws_map, dev);
30397 + drm_core_ioremap(&dev_priv->hws_map, dev);
30398 if (dev_priv->hws_map.handle == NULL) {
30399 i915_dma_cleanup(dev);
30400 dev_priv->status_gfx_addr = 0;
30401 @@ -976,6 +966,10 @@
30402 if (ret)
30403 goto kfree_devname;
30404
30405 + dev_priv->mm.gtt_mapping =
30406 + io_mapping_create_wc(dev->agp->base,
30407 + dev->agp->agp_info.aper_size * 1024*1024);
30408 +
30409 /* Allow hardware batchbuffers unless told otherwise.
30410 */
30411 dev_priv->allow_batchbuffer = 1;
30412 @@ -1087,28 +1081,6 @@
30413 goto free_priv;
30414 }
30415
30416 - dev_priv->mm.gtt_mapping =
30417 - io_mapping_create_wc(dev->agp->base,
30418 - dev->agp->agp_info.aper_size * 1024*1024);
30419 - if (dev_priv->mm.gtt_mapping == NULL) {
30420 - ret = -EIO;
30421 - goto out_rmmap;
30422 - }
30423 -
30424 - /* Set up a WC MTRR for non-PAT systems. This is more common than
30425 - * one would think, because the kernel disables PAT on first
30426 - * generation Core chips because WC PAT gets overridden by a UC
30427 - * MTRR if present. Even if a UC MTRR isn't present.
30428 - */
30429 - dev_priv->mm.gtt_mtrr = mtrr_add(dev->agp->base,
30430 - dev->agp->agp_info.aper_size *
30431 - 1024 * 1024,
30432 - MTRR_TYPE_WRCOMB, 1);
30433 - if (dev_priv->mm.gtt_mtrr < 0) {
30434 - DRM_INFO("MTRR allocation failed. Graphics "
30435 - "performance may suffer.\n");
30436 - }
30437 -
30438 #ifdef CONFIG_HIGHMEM64G
30439 /* don't enable GEM on PAE - needs agp + set_memory_* interface fixes */
30440 dev_priv->has_gem = 0;
30441 @@ -1117,17 +1089,13 @@
30442 dev_priv->has_gem = 1;
30443 #endif
30444
30445 - dev->driver->get_vblank_counter = i915_get_vblank_counter;
30446 - if (IS_GM45(dev))
30447 - dev->driver->get_vblank_counter = gm45_get_vblank_counter;
30448 -
30449 i915_gem_load(dev);
30450
30451 /* Init HWS */
30452 if (!I915_NEED_GFX_HWS(dev)) {
30453 ret = i915_init_phys_hws(dev);
30454 if (ret != 0)
30455 - goto out_iomapfree;
30456 + goto out_rmmap;
30457 }
30458
30459 /* On the 945G/GM, the chipset reports the MSI capability on the
30460 @@ -1166,8 +1134,6 @@
30461
30462 return 0;
30463
30464 -out_iomapfree:
30465 - io_mapping_free(dev_priv->mm.gtt_mapping);
30466 out_rmmap:
30467 iounmap(dev_priv->regs);
30468 free_priv:
30469 @@ -1179,14 +1145,8 @@
30470 {
30471 struct drm_i915_private *dev_priv = dev->dev_private;
30472
30473 - io_mapping_free(dev_priv->mm.gtt_mapping);
30474 - if (dev_priv->mm.gtt_mtrr >= 0) {
30475 - mtrr_del(dev_priv->mm.gtt_mtrr, dev->agp->base,
30476 - dev->agp->agp_info.aper_size * 1024 * 1024);
30477 - dev_priv->mm.gtt_mtrr = -1;
30478 - }
30479 -
30480 if (drm_core_check_feature(dev, DRIVER_MODESET)) {
30481 + io_mapping_free(dev_priv->mm.gtt_mapping);
30482 drm_irq_uninstall(dev);
30483 }
30484
30485 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/gpu/drm/i915/i915_drv.c linux-2.6.29-rc3.owrt/drivers/gpu/drm/i915/i915_drv.c
30486 --- linux-2.6.29.owrt/drivers/gpu/drm/i915/i915_drv.c 2009-05-10 22:04:38.000000000 +0200
30487 +++ linux-2.6.29-rc3.owrt/drivers/gpu/drm/i915/i915_drv.c 2009-05-10 23:48:28.000000000 +0200
30488 @@ -27,7 +27,6 @@
30489 *
30490 */
30491
30492 -#include <linux/device.h>
30493 #include "drmP.h"
30494 #include "drm.h"
30495 #include "i915_drm.h"
30496 @@ -67,14 +66,6 @@
30497
30498 i915_save_state(dev);
30499
30500 - /* If KMS is active, we do the leavevt stuff here */
30501 - if (drm_core_check_feature(dev, DRIVER_MODESET)) {
30502 - if (i915_gem_idle(dev))
30503 - dev_err(&dev->pdev->dev,
30504 - "GEM idle failed, resume may fail\n");
30505 - drm_irq_uninstall(dev);
30506 - }
30507 -
30508 intel_opregion_free(dev);
30509
30510 if (state.event == PM_EVENT_SUSPEND) {
30511 @@ -88,9 +79,6 @@
30512
30513 static int i915_resume(struct drm_device *dev)
30514 {
30515 - struct drm_i915_private *dev_priv = dev->dev_private;
30516 - int ret = 0;
30517 -
30518 pci_set_power_state(dev->pdev, PCI_D0);
30519 pci_restore_state(dev->pdev);
30520 if (pci_enable_device(dev->pdev))
30521 @@ -101,26 +89,11 @@
30522
30523 intel_opregion_init(dev);
30524
30525 - /* KMS EnterVT equivalent */
30526 - if (drm_core_check_feature(dev, DRIVER_MODESET)) {
30527 - mutex_lock(&dev->struct_mutex);
30528 - dev_priv->mm.suspended = 0;
30529 -
30530 - ret = i915_gem_init_ringbuffer(dev);
30531 - if (ret != 0)
30532 - ret = -1;
30533 - mutex_unlock(&dev->struct_mutex);
30534 -
30535 - drm_irq_install(dev);
30536 - }
30537 -
30538 - return ret;
30539 + return 0;
30540 }
30541
30542 static struct vm_operations_struct i915_gem_vm_ops = {
30543 .fault = i915_gem_fault,
30544 - .open = drm_gem_vm_open,
30545 - .close = drm_gem_vm_close,
30546 };
30547
30548 static struct drm_driver driver = {
30549 @@ -139,6 +112,7 @@
30550 .suspend = i915_suspend,
30551 .resume = i915_resume,
30552 .device_is_agp = i915_driver_device_is_agp,
30553 + .get_vblank_counter = i915_get_vblank_counter,
30554 .enable_vblank = i915_enable_vblank,
30555 .disable_vblank = i915_disable_vblank,
30556 .irq_preinstall = i915_driver_irq_preinstall,
30557 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/gpu/drm/i915/i915_drv.h linux-2.6.29-rc3.owrt/drivers/gpu/drm/i915/i915_drv.h
30558 --- linux-2.6.29.owrt/drivers/gpu/drm/i915/i915_drv.h 2009-05-10 22:04:38.000000000 +0200
30559 +++ linux-2.6.29-rc3.owrt/drivers/gpu/drm/i915/i915_drv.h 2009-05-10 23:48:28.000000000 +0200
30560 @@ -184,8 +184,6 @@
30561 unsigned int lvds_dither:1;
30562 unsigned int lvds_vbt:1;
30563 unsigned int int_crt_support:1;
30564 - unsigned int lvds_use_ssc:1;
30565 - int lvds_ssc_freq;
30566
30567 struct drm_i915_fence_reg fence_regs[16]; /* assume 965 */
30568 int fence_reg_start; /* 4 if userland hasn't ioctl'd us yet */
30569 @@ -279,13 +277,13 @@
30570 u8 saveAR_INDEX;
30571 u8 saveAR[21];
30572 u8 saveDACMASK;
30573 + u8 saveDACDATA[256*3]; /* 256 3-byte colors */
30574 u8 saveCR[37];
30575
30576 struct {
30577 struct drm_mm gtt_space;
30578
30579 struct io_mapping *gtt_mapping;
30580 - int gtt_mtrr;
30581
30582 /**
30583 * List of objects currently involved in rendering from the
30584 @@ -456,12 +454,6 @@
30585
30586 /** for phy allocated objects */
30587 struct drm_i915_gem_phys_object *phys_obj;
30588 -
30589 - /**
30590 - * Used for checking the object doesn't appear more than once
30591 - * in an execbuffer object list.
30592 - */
30593 - int in_execbuffer;
30594 };
30595
30596 /**
30597 @@ -542,7 +534,6 @@
30598 extern int i915_enable_vblank(struct drm_device *dev, int crtc);
30599 extern void i915_disable_vblank(struct drm_device *dev, int crtc);
30600 extern u32 i915_get_vblank_counter(struct drm_device *dev, int crtc);
30601 -extern u32 gm45_get_vblank_counter(struct drm_device *dev, int crtc);
30602 extern int i915_vblank_swap(struct drm_device *dev, void *data,
30603 struct drm_file *file_priv);
30604 extern void i915_enable_irq(drm_i915_private_t *dev_priv, u32 mask);
30605 @@ -610,7 +601,6 @@
30606 void i915_gem_free_object(struct drm_gem_object *obj);
30607 int i915_gem_object_pin(struct drm_gem_object *obj, uint32_t alignment);
30608 void i915_gem_object_unpin(struct drm_gem_object *obj);
30609 -int i915_gem_object_unbind(struct drm_gem_object *obj);
30610 void i915_gem_lastclose(struct drm_device *dev);
30611 uint32_t i915_get_gem_seqno(struct drm_device *dev);
30612 void i915_gem_retire_requests(struct drm_device *dev);
30613 @@ -623,7 +613,6 @@
30614 void i915_gem_cleanup_ringbuffer(struct drm_device *dev);
30615 int i915_gem_do_init(struct drm_device *dev, unsigned long start,
30616 unsigned long end);
30617 -int i915_gem_idle(struct drm_device *dev);
30618 int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf);
30619 int i915_gem_object_set_to_gtt_domain(struct drm_gem_object *obj,
30620 int write);
30621 @@ -795,11 +784,6 @@
30622 IS_I945GM(dev) || IS_I965GM(dev) || IS_GM45(dev))
30623
30624 #define I915_NEED_GFX_HWS(dev) (IS_G33(dev) || IS_GM45(dev) || IS_G4X(dev))
30625 -/* With the 945 and later, Y tiling got adjusted so that it was 32 128-byte
30626 - * rows, which changed the alignment requirements and fence programming.
30627 - */
30628 -#define HAS_128_BYTE_Y_TILING(dev) (IS_I9XX(dev) && !(IS_I915G(dev) || \
30629 - IS_I915GM(dev)))
30630 #define SUPPORTS_INTEGRATED_HDMI(dev) (IS_G4X(dev))
30631
30632 #define PRIMARY_RINGBUFFER_SIZE (128*1024)
30633 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/gpu/drm/i915/i915_gem.c linux-2.6.29-rc3.owrt/drivers/gpu/drm/i915/i915_gem.c
30634 --- linux-2.6.29.owrt/drivers/gpu/drm/i915/i915_gem.c 2009-05-10 22:04:38.000000000 +0200
30635 +++ linux-2.6.29-rc3.owrt/drivers/gpu/drm/i915/i915_gem.c 2009-05-10 23:48:28.000000000 +0200
30636 @@ -34,6 +34,10 @@
30637
30638 #define I915_GEM_GPU_DOMAINS (~(I915_GEM_DOMAIN_CPU | I915_GEM_DOMAIN_GTT))
30639
30640 +static void
30641 +i915_gem_object_set_to_gpu_domain(struct drm_gem_object *obj,
30642 + uint32_t read_domains,
30643 + uint32_t write_domain);
30644 static void i915_gem_object_flush_gpu_write_domain(struct drm_gem_object *obj);
30645 static void i915_gem_object_flush_gtt_write_domain(struct drm_gem_object *obj);
30646 static void i915_gem_object_flush_cpu_write_domain(struct drm_gem_object *obj);
30647 @@ -48,7 +52,7 @@
30648 static int i915_gem_object_wait_rendering(struct drm_gem_object *obj);
30649 static int i915_gem_object_bind_to_gtt(struct drm_gem_object *obj,
30650 unsigned alignment);
30651 -static int i915_gem_object_get_fence_reg(struct drm_gem_object *obj, bool write);
30652 +static void i915_gem_object_get_fence_reg(struct drm_gem_object *obj);
30653 static void i915_gem_clear_fence_reg(struct drm_gem_object *obj);
30654 static int i915_gem_evict_something(struct drm_device *dev);
30655 static int i915_gem_phys_pwrite(struct drm_device *dev, struct drm_gem_object *obj,
30656 @@ -563,7 +567,6 @@
30657 pgoff_t page_offset;
30658 unsigned long pfn;
30659 int ret = 0;
30660 - bool write = !!(vmf->flags & FAULT_FLAG_WRITE);
30661
30662 /* We don't use vmf->pgoff since that has the fake offset */
30663 page_offset = ((unsigned long)vmf->virtual_address - vma->vm_start) >>
30664 @@ -582,13 +585,8 @@
30665
30666 /* Need a new fence register? */
30667 if (obj_priv->fence_reg == I915_FENCE_REG_NONE &&
30668 - obj_priv->tiling_mode != I915_TILING_NONE) {
30669 - ret = i915_gem_object_get_fence_reg(obj, write);
30670 - if (ret) {
30671 - mutex_unlock(&dev->struct_mutex);
30672 - return VM_FAULT_SIGBUS;
30673 - }
30674 - }
30675 + obj_priv->tiling_mode != I915_TILING_NONE)
30676 + i915_gem_object_get_fence_reg(obj);
30677
30678 pfn = ((dev->agp->base + obj_priv->gtt_offset) >> PAGE_SHIFT) +
30679 page_offset;
30680 @@ -603,6 +601,8 @@
30681 case -EAGAIN:
30682 return VM_FAULT_OOM;
30683 case -EFAULT:
30684 + case -EBUSY:
30685 + DRM_ERROR("can't insert pfn?? fault or busy...\n");
30686 return VM_FAULT_SIGBUS;
30687 default:
30688 return VM_FAULT_NOPAGE;
30689 @@ -678,30 +678,6 @@
30690 return ret;
30691 }
30692
30693 -static void
30694 -i915_gem_free_mmap_offset(struct drm_gem_object *obj)
30695 -{
30696 - struct drm_device *dev = obj->dev;
30697 - struct drm_i915_gem_object *obj_priv = obj->driver_private;
30698 - struct drm_gem_mm *mm = dev->mm_private;
30699 - struct drm_map_list *list;
30700 -
30701 - list = &obj->map_list;
30702 - drm_ht_remove_item(&mm->offset_hash, &list->hash);
30703 -
30704 - if (list->file_offset_node) {
30705 - drm_mm_put_block(list->file_offset_node);
30706 - list->file_offset_node = NULL;
30707 - }
30708 -
30709 - if (list->map) {
30710 - drm_free(list->map, sizeof(struct drm_map), DRM_MEM_DRIVER);
30711 - list->map = NULL;
30712 - }
30713 -
30714 - obj_priv->mmap_offset = 0;
30715 -}
30716 -
30717 /**
30718 * i915_gem_get_gtt_alignment - return required GTT alignment for an object
30719 * @obj: object to check
30720 @@ -776,11 +752,8 @@
30721
30722 if (!obj_priv->mmap_offset) {
30723 ret = i915_gem_create_mmap_offset(obj);
30724 - if (ret) {
30725 - drm_gem_object_unreference(obj);
30726 - mutex_unlock(&dev->struct_mutex);
30727 + if (ret)
30728 return ret;
30729 - }
30730 }
30731
30732 args->offset = obj_priv->mmap_offset;
30733 @@ -1051,9 +1024,6 @@
30734 drm_i915_private_t *dev_priv = dev->dev_private;
30735 uint32_t seqno;
30736
30737 - if (!dev_priv->hw_status_page)
30738 - return;
30739 -
30740 seqno = i915_get_gem_seqno(dev);
30741
30742 while (!list_empty(&dev_priv->mm.request_list)) {
30743 @@ -1241,7 +1211,7 @@
30744 /**
30745 * Unbinds an object from the GTT aperture.
30746 */
30747 -int
30748 +static int
30749 i915_gem_object_unbind(struct drm_gem_object *obj)
30750 {
30751 struct drm_device *dev = obj->dev;
30752 @@ -1475,26 +1445,21 @@
30753 drm_i915_private_t *dev_priv = dev->dev_private;
30754 struct drm_i915_gem_object *obj_priv = obj->driver_private;
30755 int regnum = obj_priv->fence_reg;
30756 - int tile_width;
30757 - uint32_t fence_reg, val;
30758 + uint32_t val;
30759 uint32_t pitch_val;
30760
30761 if ((obj_priv->gtt_offset & ~I915_FENCE_START_MASK) ||
30762 (obj_priv->gtt_offset & (obj->size - 1))) {
30763 - WARN(1, "%s: object 0x%08x not 1M or size (0x%zx) aligned\n",
30764 - __func__, obj_priv->gtt_offset, obj->size);
30765 + WARN(1, "%s: object not 1M or size aligned\n", __func__);
30766 return;
30767 }
30768
30769 - if (obj_priv->tiling_mode == I915_TILING_Y &&
30770 - HAS_128_BYTE_Y_TILING(dev))
30771 - tile_width = 128;
30772 + if (obj_priv->tiling_mode == I915_TILING_Y && (IS_I945G(dev) ||
30773 + IS_I945GM(dev) ||
30774 + IS_G33(dev)))
30775 + pitch_val = (obj_priv->stride / 128) - 1;
30776 else
30777 - tile_width = 512;
30778 -
30779 - /* Note: pitch better be a power of two tile widths */
30780 - pitch_val = obj_priv->stride / tile_width;
30781 - pitch_val = ffs(pitch_val) - 1;
30782 + pitch_val = (obj_priv->stride / 512) - 1;
30783
30784 val = obj_priv->gtt_offset;
30785 if (obj_priv->tiling_mode == I915_TILING_Y)
30786 @@ -1503,11 +1468,7 @@
30787 val |= pitch_val << I830_FENCE_PITCH_SHIFT;
30788 val |= I830_FENCE_REG_VALID;
30789
30790 - if (regnum < 8)
30791 - fence_reg = FENCE_REG_830_0 + (regnum * 4);
30792 - else
30793 - fence_reg = FENCE_REG_945_8 + ((regnum - 8) * 4);
30794 - I915_WRITE(fence_reg, val);
30795 + I915_WRITE(FENCE_REG_830_0 + (regnum * 4), val);
30796 }
30797
30798 static void i830_write_fence_reg(struct drm_i915_fence_reg *reg)
30799 @@ -1522,8 +1483,7 @@
30800
30801 if ((obj_priv->gtt_offset & ~I915_FENCE_START_MASK) ||
30802 (obj_priv->gtt_offset & (obj->size - 1))) {
30803 - WARN(1, "%s: object 0x%08x not 1M or size aligned\n",
30804 - __func__, obj_priv->gtt_offset);
30805 + WARN(1, "%s: object not 1M or size aligned\n", __func__);
30806 return;
30807 }
30808
30809 @@ -1543,7 +1503,6 @@
30810 /**
30811 * i915_gem_object_get_fence_reg - set up a fence reg for an object
30812 * @obj: object to map through a fence reg
30813 - * @write: object is about to be written
30814 *
30815 * When mapping objects through the GTT, userspace wants to be able to write
30816 * to them without having to worry about swizzling if the object is tiled.
30817 @@ -1554,77 +1513,49 @@
30818 * It then sets up the reg based on the object's properties: address, pitch
30819 * and tiling format.
30820 */
30821 -static int
30822 -i915_gem_object_get_fence_reg(struct drm_gem_object *obj, bool write)
30823 +static void
30824 +i915_gem_object_get_fence_reg(struct drm_gem_object *obj)
30825 {
30826 struct drm_device *dev = obj->dev;
30827 struct drm_i915_private *dev_priv = dev->dev_private;
30828 struct drm_i915_gem_object *obj_priv = obj->driver_private;
30829 struct drm_i915_fence_reg *reg = NULL;
30830 - struct drm_i915_gem_object *old_obj_priv = NULL;
30831 - int i, ret, avail;
30832 + int i, ret;
30833
30834 switch (obj_priv->tiling_mode) {
30835 case I915_TILING_NONE:
30836 WARN(1, "allocating a fence for non-tiled object?\n");
30837 break;
30838 case I915_TILING_X:
30839 - if (!obj_priv->stride)
30840 - return -EINVAL;
30841 - WARN((obj_priv->stride & (512 - 1)),
30842 - "object 0x%08x is X tiled but has non-512B pitch\n",
30843 - obj_priv->gtt_offset);
30844 + WARN(obj_priv->stride & (512 - 1),
30845 + "object is X tiled but has non-512B pitch\n");
30846 break;
30847 case I915_TILING_Y:
30848 - if (!obj_priv->stride)
30849 - return -EINVAL;
30850 - WARN((obj_priv->stride & (128 - 1)),
30851 - "object 0x%08x is Y tiled but has non-128B pitch\n",
30852 - obj_priv->gtt_offset);
30853 + WARN(obj_priv->stride & (128 - 1),
30854 + "object is Y tiled but has non-128B pitch\n");
30855 break;
30856 }
30857
30858 /* First try to find a free reg */
30859 -try_again:
30860 - avail = 0;
30861 for (i = dev_priv->fence_reg_start; i < dev_priv->num_fence_regs; i++) {
30862 reg = &dev_priv->fence_regs[i];
30863 if (!reg->obj)
30864 break;
30865 -
30866 - old_obj_priv = reg->obj->driver_private;
30867 - if (!old_obj_priv->pin_count)
30868 - avail++;
30869 }
30870
30871 /* None available, try to steal one or wait for a user to finish */
30872 if (i == dev_priv->num_fence_regs) {
30873 - uint32_t seqno = dev_priv->mm.next_gem_seqno;
30874 + struct drm_i915_gem_object *old_obj_priv = NULL;
30875 loff_t offset;
30876
30877 - if (avail == 0)
30878 - return -ENOMEM;
30879 -
30880 +try_again:
30881 + /* Could try to use LRU here instead... */
30882 for (i = dev_priv->fence_reg_start;
30883 i < dev_priv->num_fence_regs; i++) {
30884 - uint32_t this_seqno;
30885 -
30886 reg = &dev_priv->fence_regs[i];
30887 old_obj_priv = reg->obj->driver_private;
30888 -
30889 - if (old_obj_priv->pin_count)
30890 - continue;
30891 -
30892 - /* i915 uses fences for GPU access to tiled buffers */
30893 - if (IS_I965G(dev) || !old_obj_priv->active)
30894 + if (!old_obj_priv->pin_count)
30895 break;
30896 -
30897 - /* find the seqno of the first available fence */
30898 - this_seqno = old_obj_priv->last_rendering_seqno;
30899 - if (this_seqno != 0 &&
30900 - reg->obj->write_domain == 0 &&
30901 - i915_seqno_passed(seqno, this_seqno))
30902 - seqno = this_seqno;
30903 }
30904
30905 /*
30906 @@ -1632,25 +1563,14 @@
30907 * objects to finish before trying again.
30908 */
30909 if (i == dev_priv->num_fence_regs) {
30910 - if (seqno == dev_priv->mm.next_gem_seqno) {
30911 - i915_gem_flush(dev,
30912 - I915_GEM_GPU_DOMAINS,
30913 - I915_GEM_GPU_DOMAINS);
30914 - seqno = i915_add_request(dev,
30915 - I915_GEM_GPU_DOMAINS);
30916 - if (seqno == 0)
30917 - return -ENOMEM;
30918 + ret = i915_gem_object_wait_rendering(reg->obj);
30919 + if (ret) {
30920 + WARN(ret, "wait_rendering failed: %d\n", ret);
30921 + return;
30922 }
30923 -
30924 - ret = i915_wait_request(dev, seqno);
30925 - if (ret)
30926 - return ret;
30927 goto try_again;
30928 }
30929
30930 - BUG_ON(old_obj_priv->active ||
30931 - (reg->obj->write_domain & I915_GEM_GPU_DOMAINS));
30932 -
30933 /*
30934 * Zap this virtual mapping so we can set up a fence again
30935 * for this object next time we need it.
30936 @@ -1671,8 +1591,6 @@
30937 i915_write_fence_reg(reg);
30938 else
30939 i830_write_fence_reg(reg);
30940 -
30941 - return 0;
30942 }
30943
30944 /**
30945 @@ -1691,17 +1609,8 @@
30946
30947 if (IS_I965G(dev))
30948 I915_WRITE64(FENCE_REG_965_0 + (obj_priv->fence_reg * 8), 0);
30949 - else {
30950 - uint32_t fence_reg;
30951 -
30952 - if (obj_priv->fence_reg < 8)
30953 - fence_reg = FENCE_REG_830_0 + obj_priv->fence_reg * 4;
30954 - else
30955 - fence_reg = FENCE_REG_945_8 + (obj_priv->fence_reg -
30956 - 8) * 4;
30957 -
30958 - I915_WRITE(fence_reg, 0);
30959 - }
30960 + else
30961 + I915_WRITE(FENCE_REG_830_0 + (obj_priv->fence_reg * 4), 0);
30962
30963 dev_priv->fence_regs[obj_priv->fence_reg].obj = NULL;
30964 obj_priv->fence_reg = I915_FENCE_REG_NONE;
30965 @@ -1722,7 +1631,7 @@
30966 if (dev_priv->mm.suspended)
30967 return -EBUSY;
30968 if (alignment == 0)
30969 - alignment = i915_gem_get_gtt_alignment(obj);
30970 + alignment = PAGE_SIZE;
30971 if (alignment & (PAGE_SIZE - 1)) {
30972 DRM_ERROR("Invalid object alignment requested %u\n", alignment);
30973 return -EINVAL;
30974 @@ -2065,28 +1974,30 @@
30975 * drm_agp_chipset_flush
30976 */
30977 static void
30978 -i915_gem_object_set_to_gpu_domain(struct drm_gem_object *obj)
30979 +i915_gem_object_set_to_gpu_domain(struct drm_gem_object *obj,
30980 + uint32_t read_domains,
30981 + uint32_t write_domain)
30982 {
30983 struct drm_device *dev = obj->dev;
30984 struct drm_i915_gem_object *obj_priv = obj->driver_private;
30985 uint32_t invalidate_domains = 0;
30986 uint32_t flush_domains = 0;
30987
30988 - BUG_ON(obj->pending_read_domains & I915_GEM_DOMAIN_CPU);
30989 - BUG_ON(obj->pending_write_domain == I915_GEM_DOMAIN_CPU);
30990 + BUG_ON(read_domains & I915_GEM_DOMAIN_CPU);
30991 + BUG_ON(write_domain == I915_GEM_DOMAIN_CPU);
30992
30993 #if WATCH_BUF
30994 DRM_INFO("%s: object %p read %08x -> %08x write %08x -> %08x\n",
30995 __func__, obj,
30996 - obj->read_domains, obj->pending_read_domains,
30997 - obj->write_domain, obj->pending_write_domain);
30998 + obj->read_domains, read_domains,
30999 + obj->write_domain, write_domain);
31000 #endif
31001 /*
31002 * If the object isn't moving to a new write domain,
31003 * let the object stay in multiple read domains
31004 */
31005 - if (obj->pending_write_domain == 0)
31006 - obj->pending_read_domains |= obj->read_domains;
31007 + if (write_domain == 0)
31008 + read_domains |= obj->read_domains;
31009 else
31010 obj_priv->dirty = 1;
31011
31012 @@ -2096,17 +2007,15 @@
31013 * any read domains which differ from the old
31014 * write domain
31015 */
31016 - if (obj->write_domain &&
31017 - obj->write_domain != obj->pending_read_domains) {
31018 + if (obj->write_domain && obj->write_domain != read_domains) {
31019 flush_domains |= obj->write_domain;
31020 - invalidate_domains |=
31021 - obj->pending_read_domains & ~obj->write_domain;
31022 + invalidate_domains |= read_domains & ~obj->write_domain;
31023 }
31024 /*
31025 * Invalidate any read caches which may have
31026 * stale data. That is, any new read domains.
31027 */
31028 - invalidate_domains |= obj->pending_read_domains & ~obj->read_domains;
31029 + invalidate_domains |= read_domains & ~obj->read_domains;
31030 if ((flush_domains | invalidate_domains) & I915_GEM_DOMAIN_CPU) {
31031 #if WATCH_BUF
31032 DRM_INFO("%s: CPU domain flush %08x invalidate %08x\n",
31033 @@ -2115,15 +2024,9 @@
31034 i915_gem_clflush_object(obj);
31035 }
31036
31037 - /* The actual obj->write_domain will be updated with
31038 - * pending_write_domain after we emit the accumulated flush for all
31039 - * of our domain changes in execbuffers (which clears objects'
31040 - * write_domains). So if we have a current write domain that we
31041 - * aren't changing, set pending_write_domain to that.
31042 - */
31043 - if (flush_domains == 0 && obj->pending_write_domain == 0)
31044 - obj->pending_write_domain = obj->write_domain;
31045 - obj->read_domains = obj->pending_read_domains;
31046 + if ((write_domain | flush_domains) != 0)
31047 + obj->write_domain = write_domain;
31048 + obj->read_domains = read_domains;
31049
31050 dev->invalidate_domains |= invalidate_domains;
31051 dev->flush_domains |= flush_domains;
31052 @@ -2326,8 +2229,6 @@
31053 (int) reloc.offset,
31054 reloc.read_domains,
31055 reloc.write_domain);
31056 - drm_gem_object_unreference(target_obj);
31057 - i915_gem_object_unpin(obj);
31058 return -EINVAL;
31059 }
31060
31061 @@ -2514,7 +2415,6 @@
31062 struct drm_i915_gem_exec_object *exec_list = NULL;
31063 struct drm_gem_object **object_list = NULL;
31064 struct drm_gem_object *batch_obj;
31065 - struct drm_i915_gem_object *obj_priv;
31066 int ret, i, pinned = 0;
31067 uint64_t exec_offset;
31068 uint32_t seqno, flush_domains;
31069 @@ -2558,15 +2458,13 @@
31070 if (dev_priv->mm.wedged) {
31071 DRM_ERROR("Execbuf while wedged\n");
31072 mutex_unlock(&dev->struct_mutex);
31073 - ret = -EIO;
31074 - goto pre_mutex_err;
31075 + return -EIO;
31076 }
31077
31078 if (dev_priv->mm.suspended) {
31079 DRM_ERROR("Execbuf while VT-switched.\n");
31080 mutex_unlock(&dev->struct_mutex);
31081 - ret = -EBUSY;
31082 - goto pre_mutex_err;
31083 + return -EBUSY;
31084 }
31085
31086 /* Look up object handles */
31087 @@ -2579,15 +2477,6 @@
31088 ret = -EBADF;
31089 goto err;
31090 }
31091 -
31092 - obj_priv = object_list[i]->driver_private;
31093 - if (obj_priv->in_execbuffer) {
31094 - DRM_ERROR("Object %p appears more than once in object list\n",
31095 - object_list[i]);
31096 - ret = -EBADF;
31097 - goto err;
31098 - }
31099 - obj_priv->in_execbuffer = true;
31100 }
31101
31102 /* Pin and relocate */
31103 @@ -2643,7 +2532,9 @@
31104 struct drm_gem_object *obj = object_list[i];
31105
31106 /* Compute new gpu domains and update invalidate/flush */
31107 - i915_gem_object_set_to_gpu_domain(obj);
31108 + i915_gem_object_set_to_gpu_domain(obj,
31109 + obj->pending_read_domains,
31110 + obj->pending_write_domain);
31111 }
31112
31113 i915_verify_inactive(dev, __FILE__, __LINE__);
31114 @@ -2662,12 +2553,6 @@
31115 (void)i915_add_request(dev, dev->flush_domains);
31116 }
31117
31118 - for (i = 0; i < args->buffer_count; i++) {
31119 - struct drm_gem_object *obj = object_list[i];
31120 -
31121 - obj->write_domain = obj->pending_write_domain;
31122 - }
31123 -
31124 i915_verify_inactive(dev, __FILE__, __LINE__);
31125
31126 #if WATCH_COHERENCY
31127 @@ -2725,32 +2610,24 @@
31128
31129 i915_verify_inactive(dev, __FILE__, __LINE__);
31130
31131 + /* Copy the new buffer offsets back to the user's exec list. */
31132 + ret = copy_to_user((struct drm_i915_relocation_entry __user *)
31133 + (uintptr_t) args->buffers_ptr,
31134 + exec_list,
31135 + sizeof(*exec_list) * args->buffer_count);
31136 + if (ret)
31137 + DRM_ERROR("failed to copy %d exec entries "
31138 + "back to user (%d)\n",
31139 + args->buffer_count, ret);
31140 err:
31141 for (i = 0; i < pinned; i++)
31142 i915_gem_object_unpin(object_list[i]);
31143
31144 - for (i = 0; i < args->buffer_count; i++) {
31145 - if (object_list[i]) {
31146 - obj_priv = object_list[i]->driver_private;
31147 - obj_priv->in_execbuffer = false;
31148 - }
31149 + for (i = 0; i < args->buffer_count; i++)
31150 drm_gem_object_unreference(object_list[i]);
31151 - }
31152
31153 mutex_unlock(&dev->struct_mutex);
31154
31155 - if (!ret) {
31156 - /* Copy the new buffer offsets back to the user's exec list. */
31157 - ret = copy_to_user((struct drm_i915_relocation_entry __user *)
31158 - (uintptr_t) args->buffers_ptr,
31159 - exec_list,
31160 - sizeof(*exec_list) * args->buffer_count);
31161 - if (ret)
31162 - DRM_ERROR("failed to copy %d exec entries "
31163 - "back to user (%d)\n",
31164 - args->buffer_count, ret);
31165 - }
31166 -
31167 pre_mutex_err:
31168 drm_free(object_list, sizeof(*object_list) * args->buffer_count,
31169 DRM_MEM_DRIVER);
31170 @@ -2772,22 +2649,7 @@
31171 ret = i915_gem_object_bind_to_gtt(obj, alignment);
31172 if (ret != 0) {
31173 if (ret != -EBUSY && ret != -ERESTARTSYS)
31174 - DRM_ERROR("Failure to bind: %d\n", ret);
31175 - return ret;
31176 - }
31177 - }
31178 - /*
31179 - * Pre-965 chips need a fence register set up in order to
31180 - * properly handle tiled surfaces.
31181 - */
31182 - if (!IS_I965G(dev) &&
31183 - obj_priv->fence_reg == I915_FENCE_REG_NONE &&
31184 - obj_priv->tiling_mode != I915_TILING_NONE) {
31185 - ret = i915_gem_object_get_fence_reg(obj, true);
31186 - if (ret != 0) {
31187 - if (ret != -EBUSY && ret != -ERESTARTSYS)
31188 - DRM_ERROR("Failure to install fence: %d\n",
31189 - ret);
31190 + DRM_ERROR("Failure to bind: %d", ret);
31191 return ret;
31192 }
31193 }
31194 @@ -2861,7 +2723,6 @@
31195 if (obj_priv->pin_filp != NULL && obj_priv->pin_filp != file_priv) {
31196 DRM_ERROR("Already pinned in i915_gem_pin_ioctl(): %d\n",
31197 args->handle);
31198 - drm_gem_object_unreference(obj);
31199 mutex_unlock(&dev->struct_mutex);
31200 return -EINVAL;
31201 }
31202 @@ -2942,13 +2803,6 @@
31203 return -EBADF;
31204 }
31205
31206 - /* Update the active list for the hardware's current position.
31207 - * Otherwise this only updates on a delayed timer or when irqs are
31208 - * actually unmasked, and our working set ends up being larger than
31209 - * required.
31210 - */
31211 - i915_gem_retire_requests(dev);
31212 -
31213 obj_priv = obj->driver_private;
31214 /* Don't count being on the flushing list against the object being
31215 * done. Otherwise, a buffer left on the flushing list but not getting
31216 @@ -3001,6 +2855,9 @@
31217 void i915_gem_free_object(struct drm_gem_object *obj)
31218 {
31219 struct drm_device *dev = obj->dev;
31220 + struct drm_gem_mm *mm = dev->mm_private;
31221 + struct drm_map_list *list;
31222 + struct drm_map *map;
31223 struct drm_i915_gem_object *obj_priv = obj->driver_private;
31224
31225 while (obj_priv->pin_count > 0)
31226 @@ -3011,7 +2868,19 @@
31227
31228 i915_gem_object_unbind(obj);
31229
31230 - i915_gem_free_mmap_offset(obj);
31231 + list = &obj->map_list;
31232 + drm_ht_remove_item(&mm->offset_hash, &list->hash);
31233 +
31234 + if (list->file_offset_node) {
31235 + drm_mm_put_block(list->file_offset_node);
31236 + list->file_offset_node = NULL;
31237 + }
31238 +
31239 + map = list->map;
31240 + if (map) {
31241 + drm_free(map, sizeof(*map), DRM_MEM_DRIVER);
31242 + list->map = NULL;
31243 + }
31244
31245 drm_free(obj_priv->page_cpu_valid, 1, DRM_MEM_DRIVER);
31246 drm_free(obj->driver_private, 1, DRM_MEM_DRIVER);
31247 @@ -3050,7 +2919,7 @@
31248 return 0;
31249 }
31250
31251 -int
31252 +static int
31253 i915_gem_idle(struct drm_device *dev)
31254 {
31255 drm_i915_private_t *dev_priv = dev->dev_private;
31256 @@ -3196,7 +3065,6 @@
31257 if (dev_priv->hw_status_page == NULL) {
31258 DRM_ERROR("Failed to map status page.\n");
31259 memset(&dev_priv->hws_map, 0, sizeof(dev_priv->hws_map));
31260 - i915_gem_object_unpin(obj);
31261 drm_gem_object_unreference(obj);
31262 return -EINVAL;
31263 }
31264 @@ -3209,31 +3077,6 @@
31265 return 0;
31266 }
31267
31268 -static void
31269 -i915_gem_cleanup_hws(struct drm_device *dev)
31270 -{
31271 - drm_i915_private_t *dev_priv = dev->dev_private;
31272 - struct drm_gem_object *obj;
31273 - struct drm_i915_gem_object *obj_priv;
31274 -
31275 - if (dev_priv->hws_obj == NULL)
31276 - return;
31277 -
31278 - obj = dev_priv->hws_obj;
31279 - obj_priv = obj->driver_private;
31280 -
31281 - kunmap(obj_priv->page_list[0]);
31282 - i915_gem_object_unpin(obj);
31283 - drm_gem_object_unreference(obj);
31284 - dev_priv->hws_obj = NULL;
31285 -
31286 - memset(&dev_priv->hws_map, 0, sizeof(dev_priv->hws_map));
31287 - dev_priv->hw_status_page = NULL;
31288 -
31289 - /* Write high address into HWS_PGA when disabling. */
31290 - I915_WRITE(HWS_PGA, 0x1ffff000);
31291 -}
31292 -
31293 int
31294 i915_gem_init_ringbuffer(struct drm_device *dev)
31295 {
31296 @@ -3251,7 +3094,6 @@
31297 obj = drm_gem_object_alloc(dev, 128 * 1024);
31298 if (obj == NULL) {
31299 DRM_ERROR("Failed to allocate ringbuffer\n");
31300 - i915_gem_cleanup_hws(dev);
31301 return -ENOMEM;
31302 }
31303 obj_priv = obj->driver_private;
31304 @@ -3259,7 +3101,6 @@
31305 ret = i915_gem_object_pin(obj, 4096);
31306 if (ret != 0) {
31307 drm_gem_object_unreference(obj);
31308 - i915_gem_cleanup_hws(dev);
31309 return ret;
31310 }
31311
31312 @@ -3277,9 +3118,7 @@
31313 if (ring->map.handle == NULL) {
31314 DRM_ERROR("Failed to map ringbuffer.\n");
31315 memset(&dev_priv->ring, 0, sizeof(dev_priv->ring));
31316 - i915_gem_object_unpin(obj);
31317 drm_gem_object_unreference(obj);
31318 - i915_gem_cleanup_hws(dev);
31319 return -EINVAL;
31320 }
31321 ring->ring_obj = obj;
31322 @@ -3359,7 +3198,20 @@
31323 dev_priv->ring.ring_obj = NULL;
31324 memset(&dev_priv->ring, 0, sizeof(dev_priv->ring));
31325
31326 - i915_gem_cleanup_hws(dev);
31327 + if (dev_priv->hws_obj != NULL) {
31328 + struct drm_gem_object *obj = dev_priv->hws_obj;
31329 + struct drm_i915_gem_object *obj_priv = obj->driver_private;
31330 +
31331 + kunmap(obj_priv->page_list[0]);
31332 + i915_gem_object_unpin(obj);
31333 + drm_gem_object_unreference(obj);
31334 + dev_priv->hws_obj = NULL;
31335 + memset(&dev_priv->hws_map, 0, sizeof(dev_priv->hws_map));
31336 + dev_priv->hw_status_page = NULL;
31337 +
31338 + /* Write high address into HWS_PGA when disabling. */
31339 + I915_WRITE(HWS_PGA, 0x1ffff000);
31340 + }
31341 }
31342
31343 int
31344 @@ -3377,6 +3229,10 @@
31345 dev_priv->mm.wedged = 0;
31346 }
31347
31348 + dev_priv->mm.gtt_mapping = io_mapping_create_wc(dev->agp->base,
31349 + dev->agp->agp_info.aper_size
31350 + * 1024 * 1024);
31351 +
31352 mutex_lock(&dev->struct_mutex);
31353 dev_priv->mm.suspended = 0;
31354
31355 @@ -3399,6 +3255,7 @@
31356 i915_gem_leavevt_ioctl(struct drm_device *dev, void *data,
31357 struct drm_file *file_priv)
31358 {
31359 + drm_i915_private_t *dev_priv = dev->dev_private;
31360 int ret;
31361
31362 if (drm_core_check_feature(dev, DRIVER_MODESET))
31363 @@ -3407,6 +3264,7 @@
31364 ret = i915_gem_idle(dev);
31365 drm_irq_uninstall(dev);
31366
31367 + io_mapping_free(dev_priv->mm.gtt_mapping);
31368 return ret;
31369 }
31370
31371 @@ -3415,9 +3273,6 @@
31372 {
31373 int ret;
31374
31375 - if (drm_core_check_feature(dev, DRIVER_MODESET))
31376 - return;
31377 -
31378 ret = i915_gem_idle(dev);
31379 if (ret)
31380 DRM_ERROR("failed to idle hardware: %d\n", ret);
31381 @@ -3439,7 +3294,7 @@
31382 /* Old X drivers will take 0-2 for front, back, depth buffers */
31383 dev_priv->fence_reg_start = 3;
31384
31385 - if (IS_I965G(dev) || IS_I945G(dev) || IS_I945GM(dev) || IS_G33(dev))
31386 + if (IS_I965G(dev))
31387 dev_priv->num_fence_regs = 16;
31388 else
31389 dev_priv->num_fence_regs = 8;
31390 @@ -3615,7 +3470,7 @@
31391 user_data = (char __user *) (uintptr_t) args->data_ptr;
31392 obj_addr = obj_priv->phys_obj->handle->vaddr + args->offset;
31393
31394 - DRM_DEBUG("obj_addr %p, %lld\n", obj_addr, args->size);
31395 + DRM_ERROR("obj_addr %p, %lld\n", obj_addr, args->size);
31396 ret = copy_from_user(obj_addr, user_data, args->size);
31397 if (ret)
31398 return -EFAULT;
31399 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/gpu/drm/i915/i915_gem_tiling.c linux-2.6.29-rc3.owrt/drivers/gpu/drm/i915/i915_gem_tiling.c
31400 --- linux-2.6.29.owrt/drivers/gpu/drm/i915/i915_gem_tiling.c 2009-05-10 22:04:38.000000000 +0200
31401 +++ linux-2.6.29-rc3.owrt/drivers/gpu/drm/i915/i915_gem_tiling.c 2009-05-10 23:48:28.000000000 +0200
31402 @@ -173,73 +173,6 @@
31403 dev_priv->mm.bit_6_swizzle_y = swizzle_y;
31404 }
31405
31406 -
31407 -/**
31408 - * Returns the size of the fence for a tiled object of the given size.
31409 - */
31410 -static int
31411 -i915_get_fence_size(struct drm_device *dev, int size)
31412 -{
31413 - int i;
31414 - int start;
31415 -
31416 - if (IS_I965G(dev)) {
31417 - /* The 965 can have fences at any page boundary. */
31418 - return ALIGN(size, 4096);
31419 - } else {
31420 - /* Align the size to a power of two greater than the smallest
31421 - * fence size.
31422 - */
31423 - if (IS_I9XX(dev))
31424 - start = 1024 * 1024;
31425 - else
31426 - start = 512 * 1024;
31427 -
31428 - for (i = start; i < size; i <<= 1)
31429 - ;
31430 -
31431 - return i;
31432 - }
31433 -}
31434 -
31435 -/* Check pitch constriants for all chips & tiling formats */
31436 -static bool
31437 -i915_tiling_ok(struct drm_device *dev, int stride, int size, int tiling_mode)
31438 -{
31439 - int tile_width;
31440 -
31441 - /* Linear is always fine */
31442 - if (tiling_mode == I915_TILING_NONE)
31443 - return true;
31444 -
31445 - if (tiling_mode == I915_TILING_Y && HAS_128_BYTE_Y_TILING(dev))
31446 - tile_width = 128;
31447 - else
31448 - tile_width = 512;
31449 -
31450 - /* 965+ just needs multiples of tile width */
31451 - if (IS_I965G(dev)) {
31452 - if (stride & (tile_width - 1))
31453 - return false;
31454 - return true;
31455 - }
31456 -
31457 - /* Pre-965 needs power of two tile widths */
31458 - if (stride < tile_width)
31459 - return false;
31460 -
31461 - if (stride & (stride - 1))
31462 - return false;
31463 -
31464 - /* We don't handle the aperture area covered by the fence being bigger
31465 - * than the object size.
31466 - */
31467 - if (i915_get_fence_size(dev, size) != size)
31468 - return false;
31469 -
31470 - return true;
31471 -}
31472 -
31473 /**
31474 * Sets the tiling mode of an object, returning the required swizzling of
31475 * bit 6 of addresses in the object.
31476 @@ -258,11 +191,6 @@
31477 return -EINVAL;
31478 obj_priv = obj->driver_private;
31479
31480 - if (!i915_tiling_ok(dev, args->stride, obj->size, args->tiling_mode)) {
31481 - drm_gem_object_unreference(obj);
31482 - return -EINVAL;
31483 - }
31484 -
31485 mutex_lock(&dev->struct_mutex);
31486
31487 if (args->tiling_mode == I915_TILING_NONE) {
31488 @@ -279,29 +207,13 @@
31489 args->swizzle_mode = I915_BIT_6_SWIZZLE_NONE;
31490 }
31491 }
31492 - if (args->tiling_mode != obj_priv->tiling_mode) {
31493 - int ret;
31494 -
31495 - /* Unbind the object, as switching tiling means we're
31496 - * switching the cache organization due to fencing, probably.
31497 - */
31498 - ret = i915_gem_object_unbind(obj);
31499 - if (ret != 0) {
31500 - WARN(ret != -ERESTARTSYS,
31501 - "failed to unbind object for tiling switch");
31502 - args->tiling_mode = obj_priv->tiling_mode;
31503 - mutex_unlock(&dev->struct_mutex);
31504 - drm_gem_object_unreference(obj);
31505 -
31506 - return ret;
31507 - }
31508 - obj_priv->tiling_mode = args->tiling_mode;
31509 - }
31510 + obj_priv->tiling_mode = args->tiling_mode;
31511 obj_priv->stride = args->stride;
31512
31513 - drm_gem_object_unreference(obj);
31514 mutex_unlock(&dev->struct_mutex);
31515
31516 + drm_gem_object_unreference(obj);
31517 +
31518 return 0;
31519 }
31520
31521 @@ -339,8 +251,9 @@
31522 DRM_ERROR("unknown tiling mode\n");
31523 }
31524
31525 - drm_gem_object_unreference(obj);
31526 mutex_unlock(&dev->struct_mutex);
31527
31528 + drm_gem_object_unreference(obj);
31529 +
31530 return 0;
31531 }
31532 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/gpu/drm/i915/i915_irq.c linux-2.6.29-rc3.owrt/drivers/gpu/drm/i915/i915_irq.c
31533 --- linux-2.6.29.owrt/drivers/gpu/drm/i915/i915_irq.c 2009-05-10 22:04:38.000000000 +0200
31534 +++ linux-2.6.29-rc3.owrt/drivers/gpu/drm/i915/i915_irq.c 2009-05-10 23:48:28.000000000 +0200
31535 @@ -174,19 +174,6 @@
31536 return count;
31537 }
31538
31539 -u32 gm45_get_vblank_counter(struct drm_device *dev, int pipe)
31540 -{
31541 - drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
31542 - int reg = pipe ? PIPEB_FRMCOUNT_GM45 : PIPEA_FRMCOUNT_GM45;
31543 -
31544 - if (!i915_pipe_enabled(dev, pipe)) {
31545 - DRM_ERROR("trying to get vblank count for disabled pipe %d\n", pipe);
31546 - return 0;
31547 - }
31548 -
31549 - return I915_READ(reg);
31550 -}
31551 -
31552 irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS)
31553 {
31554 struct drm_device *dev = (struct drm_device *) arg;
31555 @@ -383,13 +370,12 @@
31556 drm_i915_irq_emit_t *emit = data;
31557 int result;
31558
31559 + RING_LOCK_TEST_WITH_RETURN(dev, file_priv);
31560 +
31561 if (!dev_priv) {
31562 DRM_ERROR("called with no initialization\n");
31563 return -EINVAL;
31564 }
31565 -
31566 - RING_LOCK_TEST_WITH_RETURN(dev, file_priv);
31567 -
31568 mutex_lock(&dev->struct_mutex);
31569 result = i915_emit_irq(dev);
31570 mutex_unlock(&dev->struct_mutex);
31571 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/gpu/drm/i915/i915_reg.h linux-2.6.29-rc3.owrt/drivers/gpu/drm/i915/i915_reg.h
31572 --- linux-2.6.29.owrt/drivers/gpu/drm/i915/i915_reg.h 2009-05-10 22:04:38.000000000 +0200
31573 +++ linux-2.6.29-rc3.owrt/drivers/gpu/drm/i915/i915_reg.h 2009-05-10 23:48:28.000000000 +0200
31574 @@ -184,15 +184,14 @@
31575 * Fence registers
31576 */
31577 #define FENCE_REG_830_0 0x2000
31578 -#define FENCE_REG_945_8 0x3000
31579 #define I830_FENCE_START_MASK 0x07f80000
31580 #define I830_FENCE_TILING_Y_SHIFT 12
31581 -#define I830_FENCE_SIZE_BITS(size) ((ffs((size) >> 19) - 1) << 8)
31582 +#define I830_FENCE_SIZE_BITS(size) ((get_order(size >> 19) - 1) << 8)
31583 #define I830_FENCE_PITCH_SHIFT 4
31584 #define I830_FENCE_REG_VALID (1<<0)
31585
31586 #define I915_FENCE_START_MASK 0x0ff00000
31587 -#define I915_FENCE_SIZE_BITS(size) ((ffs((size) >> 20) - 1) << 8)
31588 +#define I915_FENCE_SIZE_BITS(size) ((get_order(size >> 20) - 1) << 8)
31589
31590 #define FENCE_REG_965_0 0x03000
31591 #define I965_FENCE_PITCH_SHIFT 2
31592 @@ -1372,9 +1371,6 @@
31593 #define PIPE_FRAME_LOW_SHIFT 24
31594 #define PIPE_PIXEL_MASK 0x00ffffff
31595 #define PIPE_PIXEL_SHIFT 0
31596 -/* GM45+ just has to be different */
31597 -#define PIPEA_FRMCOUNT_GM45 0x70040
31598 -#define PIPEA_FLIPCOUNT_GM45 0x70044
31599
31600 /* Cursor A & B regs */
31601 #define CURACNTR 0x70080
31602 @@ -1443,9 +1439,6 @@
31603 #define PIPEBSTAT 0x71024
31604 #define PIPEBFRAMEHIGH 0x71040
31605 #define PIPEBFRAMEPIXEL 0x71044
31606 -#define PIPEB_FRMCOUNT_GM45 0x71040
31607 -#define PIPEB_FLIPCOUNT_GM45 0x71044
31608 -
31609
31610 /* Display B control */
31611 #define DSPBCNTR 0x71180
31612 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/gpu/drm/i915/i915_suspend.c linux-2.6.29-rc3.owrt/drivers/gpu/drm/i915/i915_suspend.c
31613 --- linux-2.6.29.owrt/drivers/gpu/drm/i915/i915_suspend.c 2009-05-10 22:04:38.000000000 +0200
31614 +++ linux-2.6.29-rc3.owrt/drivers/gpu/drm/i915/i915_suspend.c 2009-05-10 23:48:28.000000000 +0200
31615 @@ -119,6 +119,11 @@
31616
31617 /* VGA color palette registers */
31618 dev_priv->saveDACMASK = I915_READ8(VGA_DACMASK);
31619 + /* DACCRX automatically increments during read */
31620 + I915_WRITE8(VGA_DACRX, 0);
31621 + /* Read 3 bytes of color data from each index */
31622 + for (i = 0; i < 256 * 3; i++)
31623 + dev_priv->saveDACDATA[i] = I915_READ8(VGA_DACDATA);
31624
31625 /* MSR bits */
31626 dev_priv->saveMSR = I915_READ8(VGA_MSR_READ);
31627 @@ -220,6 +225,12 @@
31628
31629 /* VGA color palette registers */
31630 I915_WRITE8(VGA_DACMASK, dev_priv->saveDACMASK);
31631 + /* DACCRX automatically increments during read */
31632 + I915_WRITE8(VGA_DACWX, 0);
31633 + /* Read 3 bytes of color data from each index */
31634 + for (i = 0; i < 256 * 3; i++)
31635 + I915_WRITE8(VGA_DACDATA, dev_priv->saveDACDATA[i]);
31636 +
31637 }
31638
31639 int i915_save_state(struct drm_device *dev)
31640 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/gpu/drm/i915/intel_bios.c linux-2.6.29-rc3.owrt/drivers/gpu/drm/i915/intel_bios.c
31641 --- linux-2.6.29.owrt/drivers/gpu/drm/i915/intel_bios.c 2009-05-10 22:04:38.000000000 +0200
31642 +++ linux-2.6.29-rc3.owrt/drivers/gpu/drm/i915/intel_bios.c 2009-05-10 23:48:28.000000000 +0200
31643 @@ -111,12 +111,6 @@
31644 panel_fixed_mode->clock = dvo_timing->clock * 10;
31645 panel_fixed_mode->type = DRM_MODE_TYPE_PREFERRED;
31646
31647 - /* Some VBTs have bogus h/vtotal values */
31648 - if (panel_fixed_mode->hsync_end > panel_fixed_mode->htotal)
31649 - panel_fixed_mode->htotal = panel_fixed_mode->hsync_end + 1;
31650 - if (panel_fixed_mode->vsync_end > panel_fixed_mode->vtotal)
31651 - panel_fixed_mode->vtotal = panel_fixed_mode->vsync_end + 1;
31652 -
31653 drm_mode_set_name(panel_fixed_mode);
31654
31655 dev_priv->vbt_mode = panel_fixed_mode;
31656 @@ -141,14 +135,6 @@
31657 if (general) {
31658 dev_priv->int_tv_support = general->int_tv_support;
31659 dev_priv->int_crt_support = general->int_crt_support;
31660 - dev_priv->lvds_use_ssc = general->enable_ssc;
31661 -
31662 - if (dev_priv->lvds_use_ssc) {
31663 - if (IS_I855(dev_priv->dev))
31664 - dev_priv->lvds_ssc_freq = general->ssc_freq ? 66 : 48;
31665 - else
31666 - dev_priv->lvds_ssc_freq = general->ssc_freq ? 100 : 96;
31667 - }
31668 }
31669 }
31670
31671 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/gpu/drm/i915/intel_display.c linux-2.6.29-rc3.owrt/drivers/gpu/drm/i915/intel_display.c
31672 --- linux-2.6.29.owrt/drivers/gpu/drm/i915/intel_display.c 2009-05-10 22:04:38.000000000 +0200
31673 +++ linux-2.6.29-rc3.owrt/drivers/gpu/drm/i915/intel_display.c 2009-05-10 23:48:28.000000000 +0200
31674 @@ -90,12 +90,12 @@
31675 #define I9XX_DOT_MAX 400000
31676 #define I9XX_VCO_MIN 1400000
31677 #define I9XX_VCO_MAX 2800000
31678 -#define I9XX_N_MIN 1
31679 -#define I9XX_N_MAX 6
31680 +#define I9XX_N_MIN 3
31681 +#define I9XX_N_MAX 8
31682 #define I9XX_M_MIN 70
31683 #define I9XX_M_MAX 120
31684 #define I9XX_M1_MIN 10
31685 -#define I9XX_M1_MAX 22
31686 +#define I9XX_M1_MAX 20
31687 #define I9XX_M2_MIN 5
31688 #define I9XX_M2_MAX 9
31689 #define I9XX_P_SDVO_DAC_MIN 5
31690 @@ -189,7 +189,9 @@
31691 return limit;
31692 }
31693
31694 -static void intel_clock(int refclk, intel_clock_t *clock)
31695 +/** Derive the pixel clock for the given refclk and divisors for 8xx chips. */
31696 +
31697 +static void i8xx_clock(int refclk, intel_clock_t *clock)
31698 {
31699 clock->m = 5 * (clock->m1 + 2) + (clock->m2 + 2);
31700 clock->p = clock->p1 * clock->p2;
31701 @@ -197,6 +199,25 @@
31702 clock->dot = clock->vco / clock->p;
31703 }
31704
31705 +/** Derive the pixel clock for the given refclk and divisors for 9xx chips. */
31706 +
31707 +static void i9xx_clock(int refclk, intel_clock_t *clock)
31708 +{
31709 + clock->m = 5 * (clock->m1 + 2) + (clock->m2 + 2);
31710 + clock->p = clock->p1 * clock->p2;
31711 + clock->vco = refclk * clock->m / (clock->n + 2);
31712 + clock->dot = clock->vco / clock->p;
31713 +}
31714 +
31715 +static void intel_clock(struct drm_device *dev, int refclk,
31716 + intel_clock_t *clock)
31717 +{
31718 + if (IS_I9XX(dev))
31719 + i9xx_clock (refclk, clock);
31720 + else
31721 + i8xx_clock (refclk, clock);
31722 +}
31723 +
31724 /**
31725 * Returns whether any output on the specified pipe is of the specified type
31726 */
31727 @@ -217,7 +238,7 @@
31728 return false;
31729 }
31730
31731 -#define INTELPllInvalid(s) do { /* DRM_DEBUG(s); */ return false; } while (0)
31732 +#define INTELPllInvalid(s) { /* ErrorF (s) */; return false; }
31733 /**
31734 * Returns whether the given set of divisors are valid for a given refclk with
31735 * the given connectors.
31736 @@ -297,7 +318,7 @@
31737 clock.p1 <= limit->p1.max; clock.p1++) {
31738 int this_err;
31739
31740 - intel_clock(refclk, &clock);
31741 + intel_clock(dev, refclk, &clock);
31742
31743 if (!intel_PLL_is_valid(crtc, &clock))
31744 continue;
31745 @@ -322,7 +343,7 @@
31746 udelay(20000);
31747 }
31748
31749 -static int
31750 +static void
31751 intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
31752 struct drm_framebuffer *old_fb)
31753 {
31754 @@ -340,21 +361,11 @@
31755 int dspstride = (pipe == 0) ? DSPASTRIDE : DSPBSTRIDE;
31756 int dspcntr_reg = (pipe == 0) ? DSPACNTR : DSPBCNTR;
31757 u32 dspcntr, alignment;
31758 - int ret;
31759
31760 /* no fb bound */
31761 if (!crtc->fb) {
31762 DRM_DEBUG("No FB bound\n");
31763 - return 0;
31764 - }
31765 -
31766 - switch (pipe) {
31767 - case 0:
31768 - case 1:
31769 - break;
31770 - default:
31771 - DRM_ERROR("Can't update pipe %d in SAREA\n", pipe);
31772 - return -EINVAL;
31773 + return;
31774 }
31775
31776 intel_fb = to_intel_framebuffer(crtc->fb);
31777 @@ -366,30 +377,28 @@
31778 alignment = 64 * 1024;
31779 break;
31780 case I915_TILING_X:
31781 - /* pin() will align the object as required by fence */
31782 - alignment = 0;
31783 + if (IS_I9XX(dev))
31784 + alignment = 1024 * 1024;
31785 + else
31786 + alignment = 512 * 1024;
31787 break;
31788 case I915_TILING_Y:
31789 /* FIXME: Is this true? */
31790 DRM_ERROR("Y tiled not allowed for scan out buffers\n");
31791 - return -EINVAL;
31792 + return;
31793 default:
31794 BUG();
31795 }
31796
31797 - mutex_lock(&dev->struct_mutex);
31798 - ret = i915_gem_object_pin(intel_fb->obj, alignment);
31799 - if (ret != 0) {
31800 - mutex_unlock(&dev->struct_mutex);
31801 - return ret;
31802 - }
31803 + if (i915_gem_object_pin(intel_fb->obj, alignment))
31804 + return;
31805
31806 - ret = i915_gem_object_set_to_gtt_domain(intel_fb->obj, 1);
31807 - if (ret != 0) {
31808 - i915_gem_object_unpin(intel_fb->obj);
31809 - mutex_unlock(&dev->struct_mutex);
31810 - return ret;
31811 - }
31812 + i915_gem_object_set_to_gtt_domain(intel_fb->obj, 1);
31813 +
31814 + Start = obj_priv->gtt_offset;
31815 + Offset = y * crtc->fb->pitch + x * (crtc->fb->bits_per_pixel / 8);
31816 +
31817 + I915_WRITE(dspstride, crtc->fb->pitch);
31818
31819 dspcntr = I915_READ(dspcntr_reg);
31820 /* Mask out pixel format bits in case we change it */
31821 @@ -410,17 +419,11 @@
31822 break;
31823 default:
31824 DRM_ERROR("Unknown color depth\n");
31825 - i915_gem_object_unpin(intel_fb->obj);
31826 - mutex_unlock(&dev->struct_mutex);
31827 - return -EINVAL;
31828 + return;
31829 }
31830 I915_WRITE(dspcntr_reg, dspcntr);
31831
31832 - Start = obj_priv->gtt_offset;
31833 - Offset = y * crtc->fb->pitch + x * (crtc->fb->bits_per_pixel / 8);
31834 -
31835 DRM_DEBUG("Writing base %08lX %08lX %d %d\n", Start, Offset, x, y);
31836 - I915_WRITE(dspstride, crtc->fb->pitch);
31837 if (IS_I965G(dev)) {
31838 I915_WRITE(dspbase, Offset);
31839 I915_READ(dspbase);
31840 @@ -437,24 +440,27 @@
31841 intel_fb = to_intel_framebuffer(old_fb);
31842 i915_gem_object_unpin(intel_fb->obj);
31843 }
31844 - mutex_unlock(&dev->struct_mutex);
31845
31846 if (!dev->primary->master)
31847 - return 0;
31848 + return;
31849
31850 master_priv = dev->primary->master->driver_priv;
31851 if (!master_priv->sarea_priv)
31852 - return 0;
31853 + return;
31854
31855 - if (pipe) {
31856 - master_priv->sarea_priv->pipeB_x = x;
31857 - master_priv->sarea_priv->pipeB_y = y;
31858 - } else {
31859 + switch (pipe) {
31860 + case 0:
31861 master_priv->sarea_priv->pipeA_x = x;
31862 master_priv->sarea_priv->pipeA_y = y;
31863 + break;
31864 + case 1:
31865 + master_priv->sarea_priv->pipeB_x = x;
31866 + master_priv->sarea_priv->pipeB_y = y;
31867 + break;
31868 + default:
31869 + DRM_ERROR("Can't update pipe %d in SAREA\n", pipe);
31870 + break;
31871 }
31872 -
31873 - return 0;
31874 }
31875
31876
31877 @@ -702,11 +708,11 @@
31878 return 1;
31879 }
31880
31881 -static int intel_crtc_mode_set(struct drm_crtc *crtc,
31882 - struct drm_display_mode *mode,
31883 - struct drm_display_mode *adjusted_mode,
31884 - int x, int y,
31885 - struct drm_framebuffer *old_fb)
31886 +static void intel_crtc_mode_set(struct drm_crtc *crtc,
31887 + struct drm_display_mode *mode,
31888 + struct drm_display_mode *adjusted_mode,
31889 + int x, int y,
31890 + struct drm_framebuffer *old_fb)
31891 {
31892 struct drm_device *dev = crtc->dev;
31893 struct drm_i915_private *dev_priv = dev->dev_private;
31894 @@ -726,14 +732,13 @@
31895 int dspsize_reg = (pipe == 0) ? DSPASIZE : DSPBSIZE;
31896 int dsppos_reg = (pipe == 0) ? DSPAPOS : DSPBPOS;
31897 int pipesrc_reg = (pipe == 0) ? PIPEASRC : PIPEBSRC;
31898 - int refclk, num_outputs = 0;
31899 + int refclk;
31900 intel_clock_t clock;
31901 u32 dpll = 0, fp = 0, dspcntr, pipeconf;
31902 bool ok, is_sdvo = false, is_dvo = false;
31903 bool is_crt = false, is_lvds = false, is_tv = false;
31904 struct drm_mode_config *mode_config = &dev->mode_config;
31905 struct drm_connector *connector;
31906 - int ret;
31907
31908 drm_vblank_pre_modeset(dev, pipe);
31909
31910 @@ -750,8 +755,6 @@
31911 case INTEL_OUTPUT_SDVO:
31912 case INTEL_OUTPUT_HDMI:
31913 is_sdvo = true;
31914 - if (intel_output->needs_tv_clock)
31915 - is_tv = true;
31916 break;
31917 case INTEL_OUTPUT_DVO:
31918 is_dvo = true;
31919 @@ -763,14 +766,9 @@
31920 is_crt = true;
31921 break;
31922 }
31923 -
31924 - num_outputs++;
31925 }
31926
31927 - if (is_lvds && dev_priv->lvds_use_ssc && num_outputs < 2) {
31928 - refclk = dev_priv->lvds_ssc_freq * 1000;
31929 - DRM_DEBUG("using SSC reference clock of %d MHz\n", refclk / 1000);
31930 - } else if (IS_I9XX(dev)) {
31931 + if (IS_I9XX(dev)) {
31932 refclk = 96000;
31933 } else {
31934 refclk = 48000;
31935 @@ -779,7 +777,7 @@
31936 ok = intel_find_best_PLL(crtc, adjusted_mode->clock, refclk, &clock);
31937 if (!ok) {
31938 DRM_ERROR("Couldn't find PLL settings for mode!\n");
31939 - return -EINVAL;
31940 + return;
31941 }
31942
31943 fp = clock.n << 16 | clock.m1 << 8 | clock.m2;
31944 @@ -829,14 +827,11 @@
31945 }
31946 }
31947
31948 - if (is_sdvo && is_tv)
31949 - dpll |= PLL_REF_INPUT_TVCLKINBC;
31950 - else if (is_tv)
31951 + if (is_tv) {
31952 /* XXX: just matching BIOS for now */
31953 - /* dpll |= PLL_REF_INPUT_TVCLKINBC; */
31954 +/* dpll |= PLL_REF_INPUT_TVCLKINBC; */
31955 dpll |= 3;
31956 - else if (is_lvds && dev_priv->lvds_use_ssc && num_outputs < 2)
31957 - dpll |= PLLB_REF_INPUT_SPREADSPECTRUMIN;
31958 + }
31959 else
31960 dpll |= PLL_REF_INPUT_DREFCLK;
31961
31962 @@ -953,13 +948,9 @@
31963 I915_WRITE(dspcntr_reg, dspcntr);
31964
31965 /* Flush the plane changes */
31966 - ret = intel_pipe_set_base(crtc, x, y, old_fb);
31967 - if (ret != 0)
31968 - return ret;
31969 + intel_pipe_set_base(crtc, x, y, old_fb);
31970
31971 drm_vblank_post_modeset(dev, pipe);
31972 -
31973 - return 0;
31974 }
31975
31976 /** Loads the palette/gamma unit for the CRTC with the prepared values */
31977 @@ -1008,7 +999,6 @@
31978 temp = CURSOR_MODE_DISABLE;
31979 addr = 0;
31980 bo = NULL;
31981 - mutex_lock(&dev->struct_mutex);
31982 goto finish;
31983 }
31984
31985 @@ -1031,19 +1021,18 @@
31986 }
31987
31988 /* we only need to pin inside GTT if cursor is non-phy */
31989 - mutex_lock(&dev->struct_mutex);
31990 if (!dev_priv->cursor_needs_physical) {
31991 ret = i915_gem_object_pin(bo, PAGE_SIZE);
31992 if (ret) {
31993 DRM_ERROR("failed to pin cursor bo\n");
31994 - goto fail_locked;
31995 + goto fail;
31996 }
31997 addr = obj_priv->gtt_offset;
31998 } else {
31999 ret = i915_gem_attach_phys_object(dev, bo, (pipe == 0) ? I915_GEM_PHYS_CURSOR_0 : I915_GEM_PHYS_CURSOR_1);
32000 if (ret) {
32001 DRM_ERROR("failed to attach phys object\n");
32002 - goto fail_locked;
32003 + goto fail;
32004 }
32005 addr = obj_priv->phys_obj->handle->busaddr;
32006 }
32007 @@ -1063,9 +1052,10 @@
32008 i915_gem_detach_phys_object(dev, intel_crtc->cursor_bo);
32009 } else
32010 i915_gem_object_unpin(intel_crtc->cursor_bo);
32011 + mutex_lock(&dev->struct_mutex);
32012 drm_gem_object_unreference(intel_crtc->cursor_bo);
32013 + mutex_unlock(&dev->struct_mutex);
32014 }
32015 - mutex_unlock(&dev->struct_mutex);
32016
32017 intel_crtc->cursor_addr = addr;
32018 intel_crtc->cursor_bo = bo;
32019 @@ -1073,7 +1063,6 @@
32020 return 0;
32021 fail:
32022 mutex_lock(&dev->struct_mutex);
32023 -fail_locked:
32024 drm_gem_object_unreference(bo);
32025 mutex_unlock(&dev->struct_mutex);
32026 return ret;
32027 @@ -1301,7 +1290,7 @@
32028 }
32029
32030 /* XXX: Handle the 100Mhz refclk */
32031 - intel_clock(96000, &clock);
32032 + i9xx_clock(96000, &clock);
32033 } else {
32034 bool is_lvds = (pipe == 1) && (I915_READ(LVDS) & LVDS_PORT_EN);
32035
32036 @@ -1313,9 +1302,9 @@
32037 if ((dpll & PLL_REF_INPUT_MASK) ==
32038 PLLB_REF_INPUT_SPREADSPECTRUMIN) {
32039 /* XXX: might not be 66MHz */
32040 - intel_clock(66000, &clock);
32041 + i8xx_clock(66000, &clock);
32042 } else
32043 - intel_clock(48000, &clock);
32044 + i8xx_clock(48000, &clock);
32045 } else {
32046 if (dpll & PLL_P1_DIVIDE_BY_TWO)
32047 clock.p1 = 2;
32048 @@ -1328,7 +1317,7 @@
32049 else
32050 clock.p2 = 2;
32051
32052 - intel_clock(48000, &clock);
32053 + i8xx_clock(48000, &clock);
32054 }
32055 }
32056
32057 @@ -1463,7 +1452,6 @@
32058
32059 static void intel_setup_outputs(struct drm_device *dev)
32060 {
32061 - struct drm_i915_private *dev_priv = dev->dev_private;
32062 struct drm_connector *connector;
32063
32064 intel_crt_init(dev);
32065 @@ -1475,16 +1463,13 @@
32066 if (IS_I9XX(dev)) {
32067 int found;
32068
32069 - if (I915_READ(SDVOB) & SDVO_DETECTED) {
32070 - found = intel_sdvo_init(dev, SDVOB);
32071 - if (!found && SUPPORTS_INTEGRATED_HDMI(dev))
32072 - intel_hdmi_init(dev, SDVOB);
32073 - }
32074 - if (!IS_G4X(dev) || (I915_READ(SDVOB) & SDVO_DETECTED)) {
32075 - found = intel_sdvo_init(dev, SDVOC);
32076 - if (!found && SUPPORTS_INTEGRATED_HDMI(dev))
32077 - intel_hdmi_init(dev, SDVOC);
32078 - }
32079 + found = intel_sdvo_init(dev, SDVOB);
32080 + if (!found && SUPPORTS_INTEGRATED_HDMI(dev))
32081 + intel_hdmi_init(dev, SDVOB);
32082 +
32083 + found = intel_sdvo_init(dev, SDVOC);
32084 + if (!found && SUPPORTS_INTEGRATED_HDMI(dev))
32085 + intel_hdmi_init(dev, SDVOC);
32086 } else
32087 intel_dvo_init(dev);
32088
32089 @@ -1607,9 +1592,7 @@
32090
32091 ret = intel_framebuffer_create(dev, mode_cmd, &fb, obj);
32092 if (ret) {
32093 - mutex_lock(&dev->struct_mutex);
32094 drm_gem_object_unreference(obj);
32095 - mutex_unlock(&dev->struct_mutex);
32096 return NULL;
32097 }
32098
32099 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/gpu/drm/i915/intel_drv.h linux-2.6.29-rc3.owrt/drivers/gpu/drm/i915/intel_drv.h
32100 --- linux-2.6.29.owrt/drivers/gpu/drm/i915/intel_drv.h 2009-05-10 22:04:38.000000000 +0200
32101 +++ linux-2.6.29-rc3.owrt/drivers/gpu/drm/i915/intel_drv.h 2009-05-10 23:48:28.000000000 +0200
32102 @@ -82,7 +82,6 @@
32103 struct intel_i2c_chan *i2c_bus; /* for control functions */
32104 struct intel_i2c_chan *ddc_bus; /* for DDC only stuff */
32105 bool load_detect_temp;
32106 - bool needs_tv_clock;
32107 void *dev_priv;
32108 };
32109
32110 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/gpu/drm/i915/intel_fb.c linux-2.6.29-rc3.owrt/drivers/gpu/drm/i915/intel_fb.c
32111 --- linux-2.6.29.owrt/drivers/gpu/drm/i915/intel_fb.c 2009-05-10 22:04:38.000000000 +0200
32112 +++ linux-2.6.29-rc3.owrt/drivers/gpu/drm/i915/intel_fb.c 2009-05-10 23:48:28.000000000 +0200
32113 @@ -473,7 +473,7 @@
32114 ret = intel_framebuffer_create(dev, &mode_cmd, &fb, fbo);
32115 if (ret) {
32116 DRM_ERROR("failed to allocate fb.\n");
32117 - goto out_unpin;
32118 + goto out_unref;
32119 }
32120
32121 list_add(&fb->filp_head, &dev->mode_config.fb_kernel_list);
32122 @@ -484,7 +484,7 @@
32123 info = framebuffer_alloc(sizeof(struct intelfb_par), device);
32124 if (!info) {
32125 ret = -ENOMEM;
32126 - goto out_unpin;
32127 + goto out_unref;
32128 }
32129
32130 par = info->par;
32131 @@ -513,7 +513,7 @@
32132 size);
32133 if (!info->screen_base) {
32134 ret = -ENOSPC;
32135 - goto out_unpin;
32136 + goto out_unref;
32137 }
32138 info->screen_size = size;
32139
32140 @@ -608,8 +608,6 @@
32141 mutex_unlock(&dev->struct_mutex);
32142 return 0;
32143
32144 -out_unpin:
32145 - i915_gem_object_unpin(fbo);
32146 out_unref:
32147 drm_gem_object_unreference(fbo);
32148 mutex_unlock(&dev->struct_mutex);
32149 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/gpu/drm/i915/intel_lvds.c linux-2.6.29-rc3.owrt/drivers/gpu/drm/i915/intel_lvds.c
32150 --- linux-2.6.29.owrt/drivers/gpu/drm/i915/intel_lvds.c 2009-05-10 22:04:38.000000000 +0200
32151 +++ linux-2.6.29-rc3.owrt/drivers/gpu/drm/i915/intel_lvds.c 2009-05-10 23:48:28.000000000 +0200
32152 @@ -27,7 +27,6 @@
32153 * Jesse Barnes <jesse.barnes@intel.com>
32154 */
32155
32156 -#include <linux/dmi.h>
32157 #include <linux/i2c.h>
32158 #include "drmP.h"
32159 #include "drm.h"
32160 @@ -312,8 +311,10 @@
32161 if (dev_priv->panel_fixed_mode != NULL) {
32162 struct drm_display_mode *mode;
32163
32164 + mutex_unlock(&dev->mode_config.mutex);
32165 mode = drm_mode_duplicate(dev, dev_priv->panel_fixed_mode);
32166 drm_mode_probed_add(connector, mode);
32167 + mutex_unlock(&dev->mode_config.mutex);
32168
32169 return 1;
32170 }
32171 @@ -404,16 +405,6 @@
32172 u32 lvds;
32173 int pipe;
32174
32175 - /* Blacklist machines that we know falsely report LVDS. */
32176 - /* FIXME: add a check for the Aopen Mini PC */
32177 -
32178 - /* Apple Mac Mini Core Duo and Mac Mini Core 2 Duo */
32179 - if(dmi_match(DMI_PRODUCT_NAME, "Macmini1,1") ||
32180 - dmi_match(DMI_PRODUCT_NAME, "Macmini2,1")) {
32181 - DRM_DEBUG("Skipping LVDS initialization for Apple Mac Mini\n");
32182 - return;
32183 - }
32184 -
32185 intel_output = kzalloc(sizeof(struct intel_output), GFP_KERNEL);
32186 if (!intel_output) {
32187 return;
32188 @@ -467,7 +458,7 @@
32189 dev_priv->panel_fixed_mode =
32190 drm_mode_duplicate(dev, scan);
32191 mutex_unlock(&dev->mode_config.mutex);
32192 - goto out;
32193 + goto out; /* FIXME: check for quirks */
32194 }
32195 mutex_unlock(&dev->mode_config.mutex);
32196 }
32197 @@ -481,6 +472,8 @@
32198 if (dev_priv->panel_fixed_mode) {
32199 dev_priv->panel_fixed_mode->type |=
32200 DRM_MODE_TYPE_PREFERRED;
32201 + drm_mode_probed_add(connector,
32202 + dev_priv->panel_fixed_mode);
32203 goto out;
32204 }
32205 }
32206 @@ -499,7 +492,7 @@
32207 if (dev_priv->panel_fixed_mode) {
32208 dev_priv->panel_fixed_mode->type |=
32209 DRM_MODE_TYPE_PREFERRED;
32210 - goto out;
32211 + goto out; /* FIXME: check for quirks */
32212 }
32213 }
32214
32215 @@ -507,6 +500,38 @@
32216 if (!dev_priv->panel_fixed_mode)
32217 goto failed;
32218
32219 + /* FIXME: detect aopen & mac mini type stuff automatically? */
32220 + /*
32221 + * Blacklist machines with BIOSes that list an LVDS panel without
32222 + * actually having one.
32223 + */
32224 + if (IS_I945GM(dev)) {
32225 + /* aopen mini pc */
32226 + if (dev->pdev->subsystem_vendor == 0xa0a0)
32227 + goto failed;
32228 +
32229 + if ((dev->pdev->subsystem_vendor == 0x8086) &&
32230 + (dev->pdev->subsystem_device == 0x7270)) {
32231 + /* It's a Mac Mini or Macbook Pro.
32232 + *
32233 + * Apple hardware is out to get us. The macbook pro
32234 + * has a real LVDS panel, but the mac mini does not,
32235 + * and they have the same device IDs. We'll
32236 + * distinguish by panel size, on the assumption
32237 + * that Apple isn't about to make any machines with an
32238 + * 800x600 display.
32239 + */
32240 +
32241 + if (dev_priv->panel_fixed_mode != NULL &&
32242 + dev_priv->panel_fixed_mode->hdisplay == 800 &&
32243 + dev_priv->panel_fixed_mode->vdisplay == 600) {
32244 + DRM_DEBUG("Suspected Mac Mini, ignoring the LVDS\n");
32245 + goto failed;
32246 + }
32247 + }
32248 + }
32249 +
32250 +
32251 out:
32252 drm_sysfs_connector_add(connector);
32253 return;
32254 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/gpu/drm/i915/intel_sdvo.c linux-2.6.29-rc3.owrt/drivers/gpu/drm/i915/intel_sdvo.c
32255 --- linux-2.6.29.owrt/drivers/gpu/drm/i915/intel_sdvo.c 2009-05-10 22:04:38.000000000 +0200
32256 +++ linux-2.6.29-rc3.owrt/drivers/gpu/drm/i915/intel_sdvo.c 2009-05-10 23:48:28.000000000 +0200
32257 @@ -40,59 +40,13 @@
32258 struct intel_sdvo_priv {
32259 struct intel_i2c_chan *i2c_bus;
32260 int slaveaddr;
32261 -
32262 - /* Register for the SDVO device: SDVOB or SDVOC */
32263 int output_device;
32264
32265 - /* Active outputs controlled by this SDVO output */
32266 - uint16_t controlled_output;
32267 + u16 active_outputs;
32268
32269 - /*
32270 - * Capabilities of the SDVO device returned by
32271 - * i830_sdvo_get_capabilities()
32272 - */
32273 struct intel_sdvo_caps caps;
32274 -
32275 - /* Pixel clock limitations reported by the SDVO device, in kHz */
32276 int pixel_clock_min, pixel_clock_max;
32277
32278 - /**
32279 - * This is set if we're going to treat the device as TV-out.
32280 - *
32281 - * While we have these nice friendly flags for output types that ought
32282 - * to decide this for us, the S-Video output on our HDMI+S-Video card
32283 - * shows up as RGB1 (VGA).
32284 - */
32285 - bool is_tv;
32286 -
32287 - /**
32288 - * This is set if we treat the device as HDMI, instead of DVI.
32289 - */
32290 - bool is_hdmi;
32291 -
32292 - /**
32293 - * Returned SDTV resolutions allowed for the current format, if the
32294 - * device reported it.
32295 - */
32296 - struct intel_sdvo_sdtv_resolution_reply sdtv_resolutions;
32297 -
32298 - /**
32299 - * Current selected TV format.
32300 - *
32301 - * This is stored in the same structure that's passed to the device, for
32302 - * convenience.
32303 - */
32304 - struct intel_sdvo_tv_format tv_format;
32305 -
32306 - /*
32307 - * supported encoding mode, used to determine whether HDMI is
32308 - * supported
32309 - */
32310 - struct intel_sdvo_encode encode;
32311 -
32312 - /* DDC bus used by this SDVO output */
32313 - uint8_t ddc_bus;
32314 -
32315 int save_sdvo_mult;
32316 u16 save_active_outputs;
32317 struct intel_sdvo_dtd save_input_dtd_1, save_input_dtd_2;
32318 @@ -193,9 +147,9 @@
32319
32320 #define SDVO_CMD_NAME_ENTRY(cmd) {cmd, #cmd}
32321 /** Mapping of command numbers to names, for debug output */
32322 -static const struct _sdvo_cmd_name {
32323 - u8 cmd;
32324 - char *name;
32325 +const static struct _sdvo_cmd_name {
32326 + u8 cmd;
32327 + char *name;
32328 } sdvo_cmd_names[] = {
32329 SDVO_CMD_NAME_ENTRY(SDVO_CMD_RESET),
32330 SDVO_CMD_NAME_ENTRY(SDVO_CMD_GET_DEVICE_CAPS),
32331 @@ -232,35 +186,8 @@
32332 SDVO_CMD_NAME_ENTRY(SDVO_CMD_GET_SUPPORTED_TV_FORMATS),
32333 SDVO_CMD_NAME_ENTRY(SDVO_CMD_GET_TV_FORMAT),
32334 SDVO_CMD_NAME_ENTRY(SDVO_CMD_SET_TV_FORMAT),
32335 - SDVO_CMD_NAME_ENTRY(SDVO_CMD_GET_SUPPORTED_POWER_STATES),
32336 - SDVO_CMD_NAME_ENTRY(SDVO_CMD_GET_POWER_STATE),
32337 - SDVO_CMD_NAME_ENTRY(SDVO_CMD_SET_ENCODER_POWER_STATE),
32338 - SDVO_CMD_NAME_ENTRY(SDVO_CMD_SET_DISPLAY_POWER_STATE),
32339 + SDVO_CMD_NAME_ENTRY(SDVO_CMD_SET_TV_RESOLUTION_SUPPORT),
32340 SDVO_CMD_NAME_ENTRY(SDVO_CMD_SET_CONTROL_BUS_SWITCH),
32341 - SDVO_CMD_NAME_ENTRY(SDVO_CMD_GET_SDTV_RESOLUTION_SUPPORT),
32342 - SDVO_CMD_NAME_ENTRY(SDVO_CMD_GET_SCALED_HDTV_RESOLUTION_SUPPORT),
32343 - SDVO_CMD_NAME_ENTRY(SDVO_CMD_GET_SUPPORTED_ENHANCEMENTS),
32344 - /* HDMI op code */
32345 - SDVO_CMD_NAME_ENTRY(SDVO_CMD_GET_SUPP_ENCODE),
32346 - SDVO_CMD_NAME_ENTRY(SDVO_CMD_GET_ENCODE),
32347 - SDVO_CMD_NAME_ENTRY(SDVO_CMD_SET_ENCODE),
32348 - SDVO_CMD_NAME_ENTRY(SDVO_CMD_SET_PIXEL_REPLI),
32349 - SDVO_CMD_NAME_ENTRY(SDVO_CMD_GET_PIXEL_REPLI),
32350 - SDVO_CMD_NAME_ENTRY(SDVO_CMD_GET_COLORIMETRY_CAP),
32351 - SDVO_CMD_NAME_ENTRY(SDVO_CMD_SET_COLORIMETRY),
32352 - SDVO_CMD_NAME_ENTRY(SDVO_CMD_GET_COLORIMETRY),
32353 - SDVO_CMD_NAME_ENTRY(SDVO_CMD_GET_AUDIO_ENCRYPT_PREFER),
32354 - SDVO_CMD_NAME_ENTRY(SDVO_CMD_SET_AUDIO_STAT),
32355 - SDVO_CMD_NAME_ENTRY(SDVO_CMD_GET_AUDIO_STAT),
32356 - SDVO_CMD_NAME_ENTRY(SDVO_CMD_GET_HBUF_INDEX),
32357 - SDVO_CMD_NAME_ENTRY(SDVO_CMD_SET_HBUF_INDEX),
32358 - SDVO_CMD_NAME_ENTRY(SDVO_CMD_GET_HBUF_INFO),
32359 - SDVO_CMD_NAME_ENTRY(SDVO_CMD_GET_HBUF_AV_SPLIT),
32360 - SDVO_CMD_NAME_ENTRY(SDVO_CMD_SET_HBUF_AV_SPLIT),
32361 - SDVO_CMD_NAME_ENTRY(SDVO_CMD_GET_HBUF_TXRATE),
32362 - SDVO_CMD_NAME_ENTRY(SDVO_CMD_SET_HBUF_TXRATE),
32363 - SDVO_CMD_NAME_ENTRY(SDVO_CMD_SET_HBUF_DATA),
32364 - SDVO_CMD_NAME_ENTRY(SDVO_CMD_GET_HBUF_DATA),
32365 };
32366
32367 #define SDVO_NAME(dev_priv) ((dev_priv)->output_device == SDVOB ? "SDVOB" : "SDVOC")
32368 @@ -579,50 +506,6 @@
32369 SDVO_CMD_SET_OUTPUT_TIMINGS_PART1, dtd);
32370 }
32371
32372 -static bool
32373 -intel_sdvo_create_preferred_input_timing(struct intel_output *output,
32374 - uint16_t clock,
32375 - uint16_t width,
32376 - uint16_t height)
32377 -{
32378 - struct intel_sdvo_preferred_input_timing_args args;
32379 - uint8_t status;
32380 -
32381 - args.clock = clock;
32382 - args.width = width;
32383 - args.height = height;
32384 - intel_sdvo_write_cmd(output, SDVO_CMD_CREATE_PREFERRED_INPUT_TIMING,
32385 - &args, sizeof(args));
32386 - status = intel_sdvo_read_response(output, NULL, 0);
32387 - if (status != SDVO_CMD_STATUS_SUCCESS)
32388 - return false;
32389 -
32390 - return true;
32391 -}
32392 -
32393 -static bool intel_sdvo_get_preferred_input_timing(struct intel_output *output,
32394 - struct intel_sdvo_dtd *dtd)
32395 -{
32396 - bool status;
32397 -
32398 - intel_sdvo_write_cmd(output, SDVO_CMD_GET_PREFERRED_INPUT_TIMING_PART1,
32399 - NULL, 0);
32400 -
32401 - status = intel_sdvo_read_response(output, &dtd->part1,
32402 - sizeof(dtd->part1));
32403 - if (status != SDVO_CMD_STATUS_SUCCESS)
32404 - return false;
32405 -
32406 - intel_sdvo_write_cmd(output, SDVO_CMD_GET_PREFERRED_INPUT_TIMING_PART2,
32407 - NULL, 0);
32408 -
32409 - status = intel_sdvo_read_response(output, &dtd->part2,
32410 - sizeof(dtd->part2));
32411 - if (status != SDVO_CMD_STATUS_SUCCESS)
32412 - return false;
32413 -
32414 - return false;
32415 -}
32416
32417 static int intel_sdvo_get_clock_rate_mult(struct intel_output *intel_output)
32418 {
32419 @@ -653,12 +536,36 @@
32420 return true;
32421 }
32422
32423 -static void intel_sdvo_get_dtd_from_mode(struct intel_sdvo_dtd *dtd,
32424 - struct drm_display_mode *mode)
32425 +static bool intel_sdvo_mode_fixup(struct drm_encoder *encoder,
32426 + struct drm_display_mode *mode,
32427 + struct drm_display_mode *adjusted_mode)
32428 {
32429 - uint16_t width, height;
32430 - uint16_t h_blank_len, h_sync_len, v_blank_len, v_sync_len;
32431 - uint16_t h_sync_offset, v_sync_offset;
32432 + /* Make the CRTC code factor in the SDVO pixel multiplier. The SDVO
32433 + * device will be told of the multiplier during mode_set.
32434 + */
32435 + adjusted_mode->clock *= intel_sdvo_get_pixel_multiplier(mode);
32436 + return true;
32437 +}
32438 +
32439 +static void intel_sdvo_mode_set(struct drm_encoder *encoder,
32440 + struct drm_display_mode *mode,
32441 + struct drm_display_mode *adjusted_mode)
32442 +{
32443 + struct drm_device *dev = encoder->dev;
32444 + struct drm_i915_private *dev_priv = dev->dev_private;
32445 + struct drm_crtc *crtc = encoder->crtc;
32446 + struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
32447 + struct intel_output *intel_output = enc_to_intel_output(encoder);
32448 + struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv;
32449 + u16 width, height;
32450 + u16 h_blank_len, h_sync_len, v_blank_len, v_sync_len;
32451 + u16 h_sync_offset, v_sync_offset;
32452 + u32 sdvox;
32453 + struct intel_sdvo_dtd output_dtd;
32454 + int sdvo_pixel_multiply;
32455 +
32456 + if (!mode)
32457 + return;
32458
32459 width = mode->crtc_hdisplay;
32460 height = mode->crtc_vdisplay;
32461 @@ -673,423 +580,93 @@
32462 h_sync_offset = mode->crtc_hsync_start - mode->crtc_hblank_start;
32463 v_sync_offset = mode->crtc_vsync_start - mode->crtc_vblank_start;
32464
32465 - dtd->part1.clock = mode->clock / 10;
32466 - dtd->part1.h_active = width & 0xff;
32467 - dtd->part1.h_blank = h_blank_len & 0xff;
32468 - dtd->part1.h_high = (((width >> 8) & 0xf) << 4) |
32469 + output_dtd.part1.clock = mode->clock / 10;
32470 + output_dtd.part1.h_active = width & 0xff;
32471 + output_dtd.part1.h_blank = h_blank_len & 0xff;
32472 + output_dtd.part1.h_high = (((width >> 8) & 0xf) << 4) |
32473 ((h_blank_len >> 8) & 0xf);
32474 - dtd->part1.v_active = height & 0xff;
32475 - dtd->part1.v_blank = v_blank_len & 0xff;
32476 - dtd->part1.v_high = (((height >> 8) & 0xf) << 4) |
32477 + output_dtd.part1.v_active = height & 0xff;
32478 + output_dtd.part1.v_blank = v_blank_len & 0xff;
32479 + output_dtd.part1.v_high = (((height >> 8) & 0xf) << 4) |
32480 ((v_blank_len >> 8) & 0xf);
32481
32482 - dtd->part2.h_sync_off = h_sync_offset;
32483 - dtd->part2.h_sync_width = h_sync_len & 0xff;
32484 - dtd->part2.v_sync_off_width = (v_sync_offset & 0xf) << 4 |
32485 + output_dtd.part2.h_sync_off = h_sync_offset;
32486 + output_dtd.part2.h_sync_width = h_sync_len & 0xff;
32487 + output_dtd.part2.v_sync_off_width = (v_sync_offset & 0xf) << 4 |
32488 (v_sync_len & 0xf);
32489 - dtd->part2.sync_off_width_high = ((h_sync_offset & 0x300) >> 2) |
32490 + output_dtd.part2.sync_off_width_high = ((h_sync_offset & 0x300) >> 2) |
32491 ((h_sync_len & 0x300) >> 4) | ((v_sync_offset & 0x30) >> 2) |
32492 ((v_sync_len & 0x30) >> 4);
32493
32494 - dtd->part2.dtd_flags = 0x18;
32495 + output_dtd.part2.dtd_flags = 0x18;
32496 if (mode->flags & DRM_MODE_FLAG_PHSYNC)
32497 - dtd->part2.dtd_flags |= 0x2;
32498 + output_dtd.part2.dtd_flags |= 0x2;
32499 if (mode->flags & DRM_MODE_FLAG_PVSYNC)
32500 - dtd->part2.dtd_flags |= 0x4;
32501 -
32502 - dtd->part2.sdvo_flags = 0;
32503 - dtd->part2.v_sync_off_high = v_sync_offset & 0xc0;
32504 - dtd->part2.reserved = 0;
32505 -}
32506 -
32507 -static void intel_sdvo_get_mode_from_dtd(struct drm_display_mode * mode,
32508 - struct intel_sdvo_dtd *dtd)
32509 -{
32510 - uint16_t width, height;
32511 - uint16_t h_blank_len, h_sync_len, v_blank_len, v_sync_len;
32512 - uint16_t h_sync_offset, v_sync_offset;
32513 -
32514 - width = mode->crtc_hdisplay;
32515 - height = mode->crtc_vdisplay;
32516 -
32517 - /* do some mode translations */
32518 - h_blank_len = mode->crtc_hblank_end - mode->crtc_hblank_start;
32519 - h_sync_len = mode->crtc_hsync_end - mode->crtc_hsync_start;
32520 -
32521 - v_blank_len = mode->crtc_vblank_end - mode->crtc_vblank_start;
32522 - v_sync_len = mode->crtc_vsync_end - mode->crtc_vsync_start;
32523 -
32524 - h_sync_offset = mode->crtc_hsync_start - mode->crtc_hblank_start;
32525 - v_sync_offset = mode->crtc_vsync_start - mode->crtc_vblank_start;
32526 -
32527 - mode->hdisplay = dtd->part1.h_active;
32528 - mode->hdisplay += ((dtd->part1.h_high >> 4) & 0x0f) << 8;
32529 - mode->hsync_start = mode->hdisplay + dtd->part2.h_sync_off;
32530 - mode->hsync_start += (dtd->part2.sync_off_width_high & 0xa0) << 2;
32531 - mode->hsync_end = mode->hsync_start + dtd->part2.h_sync_width;
32532 - mode->hsync_end += (dtd->part2.sync_off_width_high & 0x30) << 4;
32533 - mode->htotal = mode->hdisplay + dtd->part1.h_blank;
32534 - mode->htotal += (dtd->part1.h_high & 0xf) << 8;
32535 -
32536 - mode->vdisplay = dtd->part1.v_active;
32537 - mode->vdisplay += ((dtd->part1.v_high >> 4) & 0x0f) << 8;
32538 - mode->vsync_start = mode->vdisplay;
32539 - mode->vsync_start += (dtd->part2.v_sync_off_width >> 4) & 0xf;
32540 - mode->vsync_start += (dtd->part2.sync_off_width_high & 0x0a) << 2;
32541 - mode->vsync_start += dtd->part2.v_sync_off_high & 0xc0;
32542 - mode->vsync_end = mode->vsync_start +
32543 - (dtd->part2.v_sync_off_width & 0xf);
32544 - mode->vsync_end += (dtd->part2.sync_off_width_high & 0x3) << 4;
32545 - mode->vtotal = mode->vdisplay + dtd->part1.v_blank;
32546 - mode->vtotal += (dtd->part1.v_high & 0xf) << 8;
32547 -
32548 - mode->clock = dtd->part1.clock * 10;
32549 -
32550 - mode->flags &= (DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC);
32551 - if (dtd->part2.dtd_flags & 0x2)
32552 - mode->flags |= DRM_MODE_FLAG_PHSYNC;
32553 - if (dtd->part2.dtd_flags & 0x4)
32554 - mode->flags |= DRM_MODE_FLAG_PVSYNC;
32555 -}
32556 -
32557 -static bool intel_sdvo_get_supp_encode(struct intel_output *output,
32558 - struct intel_sdvo_encode *encode)
32559 -{
32560 - uint8_t status;
32561 -
32562 - intel_sdvo_write_cmd(output, SDVO_CMD_GET_SUPP_ENCODE, NULL, 0);
32563 - status = intel_sdvo_read_response(output, encode, sizeof(*encode));
32564 - if (status != SDVO_CMD_STATUS_SUCCESS) { /* non-support means DVI */
32565 - memset(encode, 0, sizeof(*encode));
32566 - return false;
32567 - }
32568 -
32569 - return true;
32570 -}
32571 -
32572 -static bool intel_sdvo_set_encode(struct intel_output *output, uint8_t mode)
32573 -{
32574 - uint8_t status;
32575 -
32576 - intel_sdvo_write_cmd(output, SDVO_CMD_SET_ENCODE, &mode, 1);
32577 - status = intel_sdvo_read_response(output, NULL, 0);
32578 -
32579 - return (status == SDVO_CMD_STATUS_SUCCESS);
32580 -}
32581 -
32582 -static bool intel_sdvo_set_colorimetry(struct intel_output *output,
32583 - uint8_t mode)
32584 -{
32585 - uint8_t status;
32586 -
32587 - intel_sdvo_write_cmd(output, SDVO_CMD_SET_COLORIMETRY, &mode, 1);
32588 - status = intel_sdvo_read_response(output, NULL, 0);
32589 -
32590 - return (status == SDVO_CMD_STATUS_SUCCESS);
32591 -}
32592 -
32593 -#if 0
32594 -static void intel_sdvo_dump_hdmi_buf(struct intel_output *output)
32595 -{
32596 - int i, j;
32597 - uint8_t set_buf_index[2];
32598 - uint8_t av_split;
32599 - uint8_t buf_size;
32600 - uint8_t buf[48];
32601 - uint8_t *pos;
32602 -
32603 - intel_sdvo_write_cmd(output, SDVO_CMD_GET_HBUF_AV_SPLIT, NULL, 0);
32604 - intel_sdvo_read_response(output, &av_split, 1);
32605 -
32606 - for (i = 0; i <= av_split; i++) {
32607 - set_buf_index[0] = i; set_buf_index[1] = 0;
32608 - intel_sdvo_write_cmd(output, SDVO_CMD_SET_HBUF_INDEX,
32609 - set_buf_index, 2);
32610 - intel_sdvo_write_cmd(output, SDVO_CMD_GET_HBUF_INFO, NULL, 0);
32611 - intel_sdvo_read_response(output, &buf_size, 1);
32612 -
32613 - pos = buf;
32614 - for (j = 0; j <= buf_size; j += 8) {
32615 - intel_sdvo_write_cmd(output, SDVO_CMD_GET_HBUF_DATA,
32616 - NULL, 0);
32617 - intel_sdvo_read_response(output, pos, 8);
32618 - pos += 8;
32619 - }
32620 - }
32621 -}
32622 -#endif
32623 -
32624 -static void intel_sdvo_set_hdmi_buf(struct intel_output *output, int index,
32625 - uint8_t *data, int8_t size, uint8_t tx_rate)
32626 -{
32627 - uint8_t set_buf_index[2];
32628 -
32629 - set_buf_index[0] = index;
32630 - set_buf_index[1] = 0;
32631 -
32632 - intel_sdvo_write_cmd(output, SDVO_CMD_SET_HBUF_INDEX, set_buf_index, 2);
32633 -
32634 - for (; size > 0; size -= 8) {
32635 - intel_sdvo_write_cmd(output, SDVO_CMD_SET_HBUF_DATA, data, 8);
32636 - data += 8;
32637 - }
32638 -
32639 - intel_sdvo_write_cmd(output, SDVO_CMD_SET_HBUF_TXRATE, &tx_rate, 1);
32640 -}
32641 -
32642 -static uint8_t intel_sdvo_calc_hbuf_csum(uint8_t *data, uint8_t size)
32643 -{
32644 - uint8_t csum = 0;
32645 - int i;
32646 -
32647 - for (i = 0; i < size; i++)
32648 - csum += data[i];
32649 -
32650 - return 0x100 - csum;
32651 -}
32652 -
32653 -#define DIP_TYPE_AVI 0x82
32654 -#define DIP_VERSION_AVI 0x2
32655 -#define DIP_LEN_AVI 13
32656 -
32657 -struct dip_infoframe {
32658 - uint8_t type;
32659 - uint8_t version;
32660 - uint8_t len;
32661 - uint8_t checksum;
32662 - union {
32663 - struct {
32664 - /* Packet Byte #1 */
32665 - uint8_t S:2;
32666 - uint8_t B:2;
32667 - uint8_t A:1;
32668 - uint8_t Y:2;
32669 - uint8_t rsvd1:1;
32670 - /* Packet Byte #2 */
32671 - uint8_t R:4;
32672 - uint8_t M:2;
32673 - uint8_t C:2;
32674 - /* Packet Byte #3 */
32675 - uint8_t SC:2;
32676 - uint8_t Q:2;
32677 - uint8_t EC:3;
32678 - uint8_t ITC:1;
32679 - /* Packet Byte #4 */
32680 - uint8_t VIC:7;
32681 - uint8_t rsvd2:1;
32682 - /* Packet Byte #5 */
32683 - uint8_t PR:4;
32684 - uint8_t rsvd3:4;
32685 - /* Packet Byte #6~13 */
32686 - uint16_t top_bar_end;
32687 - uint16_t bottom_bar_start;
32688 - uint16_t left_bar_end;
32689 - uint16_t right_bar_start;
32690 - } avi;
32691 - struct {
32692 - /* Packet Byte #1 */
32693 - uint8_t channel_count:3;
32694 - uint8_t rsvd1:1;
32695 - uint8_t coding_type:4;
32696 - /* Packet Byte #2 */
32697 - uint8_t sample_size:2; /* SS0, SS1 */
32698 - uint8_t sample_frequency:3;
32699 - uint8_t rsvd2:3;
32700 - /* Packet Byte #3 */
32701 - uint8_t coding_type_private:5;
32702 - uint8_t rsvd3:3;
32703 - /* Packet Byte #4 */
32704 - uint8_t channel_allocation;
32705 - /* Packet Byte #5 */
32706 - uint8_t rsvd4:3;
32707 - uint8_t level_shift:4;
32708 - uint8_t downmix_inhibit:1;
32709 - } audio;
32710 - uint8_t payload[28];
32711 - } __attribute__ ((packed)) u;
32712 -} __attribute__((packed));
32713 -
32714 -static void intel_sdvo_set_avi_infoframe(struct intel_output *output,
32715 - struct drm_display_mode * mode)
32716 -{
32717 - struct dip_infoframe avi_if = {
32718 - .type = DIP_TYPE_AVI,
32719 - .version = DIP_VERSION_AVI,
32720 - .len = DIP_LEN_AVI,
32721 - };
32722 -
32723 - avi_if.checksum = intel_sdvo_calc_hbuf_csum((uint8_t *)&avi_if,
32724 - 4 + avi_if.len);
32725 - intel_sdvo_set_hdmi_buf(output, 1, (uint8_t *)&avi_if, 4 + avi_if.len,
32726 - SDVO_HBUF_TX_VSYNC);
32727 -}
32728 -
32729 -static bool intel_sdvo_mode_fixup(struct drm_encoder *encoder,
32730 - struct drm_display_mode *mode,
32731 - struct drm_display_mode *adjusted_mode)
32732 -{
32733 - struct intel_output *output = enc_to_intel_output(encoder);
32734 - struct intel_sdvo_priv *dev_priv = output->dev_priv;
32735 -
32736 - if (!dev_priv->is_tv) {
32737 - /* Make the CRTC code factor in the SDVO pixel multiplier. The
32738 - * SDVO device will be told of the multiplier during mode_set.
32739 - */
32740 - adjusted_mode->clock *= intel_sdvo_get_pixel_multiplier(mode);
32741 - } else {
32742 - struct intel_sdvo_dtd output_dtd;
32743 - bool success;
32744 -
32745 - /* We need to construct preferred input timings based on our
32746 - * output timings. To do that, we have to set the output
32747 - * timings, even though this isn't really the right place in
32748 - * the sequence to do it. Oh well.
32749 - */
32750 -
32751 -
32752 - /* Set output timings */
32753 - intel_sdvo_get_dtd_from_mode(&output_dtd, mode);
32754 - intel_sdvo_set_target_output(output,
32755 - dev_priv->controlled_output);
32756 - intel_sdvo_set_output_timing(output, &output_dtd);
32757 -
32758 - /* Set the input timing to the screen. Assume always input 0. */
32759 - intel_sdvo_set_target_input(output, true, false);
32760 -
32761 -
32762 - success = intel_sdvo_create_preferred_input_timing(output,
32763 - mode->clock / 10,
32764 - mode->hdisplay,
32765 - mode->vdisplay);
32766 - if (success) {
32767 - struct intel_sdvo_dtd input_dtd;
32768 -
32769 - intel_sdvo_get_preferred_input_timing(output,
32770 - &input_dtd);
32771 - intel_sdvo_get_mode_from_dtd(adjusted_mode, &input_dtd);
32772 -
32773 - } else {
32774 - return false;
32775 - }
32776 - }
32777 - return true;
32778 -}
32779 -
32780 -static void intel_sdvo_mode_set(struct drm_encoder *encoder,
32781 - struct drm_display_mode *mode,
32782 - struct drm_display_mode *adjusted_mode)
32783 -{
32784 - struct drm_device *dev = encoder->dev;
32785 - struct drm_i915_private *dev_priv = dev->dev_private;
32786 - struct drm_crtc *crtc = encoder->crtc;
32787 - struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
32788 - struct intel_output *output = enc_to_intel_output(encoder);
32789 - struct intel_sdvo_priv *sdvo_priv = output->dev_priv;
32790 - u32 sdvox = 0;
32791 - int sdvo_pixel_multiply;
32792 - struct intel_sdvo_in_out_map in_out;
32793 - struct intel_sdvo_dtd input_dtd;
32794 - u8 status;
32795 -
32796 - if (!mode)
32797 - return;
32798 -
32799 - /* First, set the input mapping for the first input to our controlled
32800 - * output. This is only correct if we're a single-input device, in
32801 - * which case the first input is the output from the appropriate SDVO
32802 - * channel on the motherboard. In a two-input device, the first input
32803 - * will be SDVOB and the second SDVOC.
32804 - */
32805 - in_out.in0 = sdvo_priv->controlled_output;
32806 - in_out.in1 = 0;
32807 -
32808 - intel_sdvo_write_cmd(output, SDVO_CMD_SET_IN_OUT_MAP,
32809 - &in_out, sizeof(in_out));
32810 - status = intel_sdvo_read_response(output, NULL, 0);
32811 -
32812 - if (sdvo_priv->is_hdmi) {
32813 - intel_sdvo_set_avi_infoframe(output, mode);
32814 - sdvox |= SDVO_AUDIO_ENABLE;
32815 - }
32816 -
32817 - intel_sdvo_get_dtd_from_mode(&input_dtd, mode);
32818 + output_dtd.part2.dtd_flags |= 0x4;
32819
32820 - /* If it's a TV, we already set the output timing in mode_fixup.
32821 - * Otherwise, the output timing is equal to the input timing.
32822 - */
32823 - if (!sdvo_priv->is_tv) {
32824 - /* Set the output timing to the screen */
32825 - intel_sdvo_set_target_output(output,
32826 - sdvo_priv->controlled_output);
32827 - intel_sdvo_set_output_timing(output, &input_dtd);
32828 - }
32829 + output_dtd.part2.sdvo_flags = 0;
32830 + output_dtd.part2.v_sync_off_high = v_sync_offset & 0xc0;
32831 + output_dtd.part2.reserved = 0;
32832 +
32833 + /* Set the output timing to the screen */
32834 + intel_sdvo_set_target_output(intel_output, sdvo_priv->active_outputs);
32835 + intel_sdvo_set_output_timing(intel_output, &output_dtd);
32836
32837 /* Set the input timing to the screen. Assume always input 0. */
32838 - intel_sdvo_set_target_input(output, true, false);
32839 + intel_sdvo_set_target_input(intel_output, true, false);
32840
32841 - /* We would like to use intel_sdvo_create_preferred_input_timing() to
32842 + /* We would like to use i830_sdvo_create_preferred_input_timing() to
32843 * provide the device with a timing it can support, if it supports that
32844 * feature. However, presumably we would need to adjust the CRTC to
32845 * output the preferred timing, and we don't support that currently.
32846 */
32847 -#if 0
32848 - success = intel_sdvo_create_preferred_input_timing(output, clock,
32849 - width, height);
32850 - if (success) {
32851 - struct intel_sdvo_dtd *input_dtd;
32852 -
32853 - intel_sdvo_get_preferred_input_timing(output, &input_dtd);
32854 - intel_sdvo_set_input_timing(output, &input_dtd);
32855 - }
32856 -#else
32857 - intel_sdvo_set_input_timing(output, &input_dtd);
32858 -#endif
32859 + intel_sdvo_set_input_timing(intel_output, &output_dtd);
32860
32861 switch (intel_sdvo_get_pixel_multiplier(mode)) {
32862 case 1:
32863 - intel_sdvo_set_clock_rate_mult(output,
32864 + intel_sdvo_set_clock_rate_mult(intel_output,
32865 SDVO_CLOCK_RATE_MULT_1X);
32866 break;
32867 case 2:
32868 - intel_sdvo_set_clock_rate_mult(output,
32869 + intel_sdvo_set_clock_rate_mult(intel_output,
32870 SDVO_CLOCK_RATE_MULT_2X);
32871 break;
32872 case 4:
32873 - intel_sdvo_set_clock_rate_mult(output,
32874 + intel_sdvo_set_clock_rate_mult(intel_output,
32875 SDVO_CLOCK_RATE_MULT_4X);
32876 break;
32877 }
32878
32879 /* Set the SDVO control regs. */
32880 - if (IS_I965G(dev)) {
32881 - sdvox |= SDVO_BORDER_ENABLE |
32882 - SDVO_VSYNC_ACTIVE_HIGH |
32883 - SDVO_HSYNC_ACTIVE_HIGH;
32884 - } else {
32885 - sdvox |= I915_READ(sdvo_priv->output_device);
32886 - switch (sdvo_priv->output_device) {
32887 - case SDVOB:
32888 - sdvox &= SDVOB_PRESERVE_MASK;
32889 - break;
32890 - case SDVOC:
32891 - sdvox &= SDVOC_PRESERVE_MASK;
32892 - break;
32893 - }
32894 - sdvox |= (9 << 19) | SDVO_BORDER_ENABLE;
32895 - }
32896 + if (0/*IS_I965GM(dev)*/) {
32897 + sdvox = SDVO_BORDER_ENABLE;
32898 + } else {
32899 + sdvox = I915_READ(sdvo_priv->output_device);
32900 + switch (sdvo_priv->output_device) {
32901 + case SDVOB:
32902 + sdvox &= SDVOB_PRESERVE_MASK;
32903 + break;
32904 + case SDVOC:
32905 + sdvox &= SDVOC_PRESERVE_MASK;
32906 + break;
32907 + }
32908 + sdvox |= (9 << 19) | SDVO_BORDER_ENABLE;
32909 + }
32910 if (intel_crtc->pipe == 1)
32911 sdvox |= SDVO_PIPE_B_SELECT;
32912
32913 sdvo_pixel_multiply = intel_sdvo_get_pixel_multiplier(mode);
32914 if (IS_I965G(dev)) {
32915 - /* done in crtc_mode_set as the dpll_md reg must be written early */
32916 - } else if (IS_I945G(dev) || IS_I945GM(dev) || IS_G33(dev)) {
32917 - /* done in crtc_mode_set as it lives inside the dpll register */
32918 + /* done in crtc_mode_set as the dpll_md reg must be written
32919 + early */
32920 + } else if (IS_I945G(dev) || IS_I945GM(dev)) {
32921 + /* done in crtc_mode_set as it lives inside the
32922 + dpll register */
32923 } else {
32924 sdvox |= (sdvo_pixel_multiply - 1) << SDVO_PORT_MULTIPLY_SHIFT;
32925 }
32926
32927 - intel_sdvo_write_sdvox(output, sdvox);
32928 + intel_sdvo_write_sdvox(intel_output, sdvox);
32929 }
32930
32931 static void intel_sdvo_dpms(struct drm_encoder *encoder, int mode)
32932 @@ -1137,7 +714,7 @@
32933
32934 if (0)
32935 intel_sdvo_set_encoder_power_state(intel_output, mode);
32936 - intel_sdvo_set_active_outputs(intel_output, sdvo_priv->controlled_output);
32937 + intel_sdvo_set_active_outputs(intel_output, sdvo_priv->active_outputs);
32938 }
32939 return;
32940 }
32941 @@ -1175,9 +752,6 @@
32942 &sdvo_priv->save_output_dtd[o]);
32943 }
32944 }
32945 - if (sdvo_priv->is_tv) {
32946 - /* XXX: Save TV format/enhancements. */
32947 - }
32948
32949 sdvo_priv->save_SDVOX = I915_READ(sdvo_priv->output_device);
32950 }
32951 @@ -1185,6 +759,7 @@
32952 static void intel_sdvo_restore(struct drm_connector *connector)
32953 {
32954 struct drm_device *dev = connector->dev;
32955 + struct drm_i915_private *dev_priv = dev->dev_private;
32956 struct intel_output *intel_output = to_intel_output(connector);
32957 struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv;
32958 int o;
32959 @@ -1215,11 +790,7 @@
32960
32961 intel_sdvo_set_clock_rate_mult(intel_output, sdvo_priv->save_sdvo_mult);
32962
32963 - if (sdvo_priv->is_tv) {
32964 - /* XXX: Restore TV format/enhancements. */
32965 - }
32966 -
32967 - intel_sdvo_write_sdvox(intel_output, sdvo_priv->save_SDVOX);
32968 + I915_WRITE(sdvo_priv->output_device, sdvo_priv->save_SDVOX);
32969
32970 if (sdvo_priv->save_SDVOX & SDVO_ENABLE)
32971 {
32972 @@ -1345,173 +916,20 @@
32973 status = intel_sdvo_read_response(intel_output, &response, 2);
32974
32975 DRM_DEBUG("SDVO response %d %d\n", response[0], response[1]);
32976 -
32977 - if (status != SDVO_CMD_STATUS_SUCCESS)
32978 - return connector_status_unknown;
32979 -
32980 if ((response[0] != 0) || (response[1] != 0))
32981 return connector_status_connected;
32982 else
32983 return connector_status_disconnected;
32984 }
32985
32986 -static void intel_sdvo_get_ddc_modes(struct drm_connector *connector)
32987 +static int intel_sdvo_get_modes(struct drm_connector *connector)
32988 {
32989 struct intel_output *intel_output = to_intel_output(connector);
32990 - struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv;
32991
32992 /* set the bus switch and get the modes */
32993 - intel_sdvo_set_control_bus_switch(intel_output, sdvo_priv->ddc_bus);
32994 + intel_sdvo_set_control_bus_switch(intel_output, SDVO_CONTROL_BUS_DDC2);
32995 intel_ddc_get_modes(intel_output);
32996
32997 -#if 0
32998 - struct drm_device *dev = encoder->dev;
32999 - struct drm_i915_private *dev_priv = dev->dev_private;
33000 - /* Mac mini hack. On this device, I get DDC through the analog, which
33001 - * load-detects as disconnected. I fail to DDC through the SDVO DDC,
33002 - * but it does load-detect as connected. So, just steal the DDC bits
33003 - * from analog when we fail at finding it the right way.
33004 - */
33005 - crt = xf86_config->output[0];
33006 - intel_output = crt->driver_private;
33007 - if (intel_output->type == I830_OUTPUT_ANALOG &&
33008 - crt->funcs->detect(crt) == XF86OutputStatusDisconnected) {
33009 - I830I2CInit(pScrn, &intel_output->pDDCBus, GPIOA, "CRTDDC_A");
33010 - edid_mon = xf86OutputGetEDID(crt, intel_output->pDDCBus);
33011 - xf86DestroyI2CBusRec(intel_output->pDDCBus, true, true);
33012 - }
33013 - if (edid_mon) {
33014 - xf86OutputSetEDID(output, edid_mon);
33015 - modes = xf86OutputGetEDIDModes(output);
33016 - }
33017 -#endif
33018 -}
33019 -
33020 -/**
33021 - * This function checks the current TV format, and chooses a default if
33022 - * it hasn't been set.
33023 - */
33024 -static void
33025 -intel_sdvo_check_tv_format(struct intel_output *output)
33026 -{
33027 - struct intel_sdvo_priv *dev_priv = output->dev_priv;
33028 - struct intel_sdvo_tv_format format, unset;
33029 - uint8_t status;
33030 -
33031 - intel_sdvo_write_cmd(output, SDVO_CMD_GET_TV_FORMAT, NULL, 0);
33032 - status = intel_sdvo_read_response(output, &format, sizeof(format));
33033 - if (status != SDVO_CMD_STATUS_SUCCESS)
33034 - return;
33035 -
33036 - memset(&unset, 0, sizeof(unset));
33037 - if (memcmp(&format, &unset, sizeof(format))) {
33038 - DRM_DEBUG("%s: Choosing default TV format of NTSC-M\n",
33039 - SDVO_NAME(dev_priv));
33040 -
33041 - format.ntsc_m = true;
33042 - intel_sdvo_write_cmd(output, SDVO_CMD_SET_TV_FORMAT, NULL, 0);
33043 - status = intel_sdvo_read_response(output, NULL, 0);
33044 - }
33045 -}
33046 -
33047 -/*
33048 - * Set of SDVO TV modes.
33049 - * Note! This is in reply order (see loop in get_tv_modes).
33050 - * XXX: all 60Hz refresh?
33051 - */
33052 -struct drm_display_mode sdvo_tv_modes[] = {
33053 - { DRM_MODE("320x200", DRM_MODE_TYPE_DRIVER, 5815680, 321, 384, 416,
33054 - 200, 0, 232, 201, 233, 4196112, 0,
33055 - DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
33056 - { DRM_MODE("320x240", DRM_MODE_TYPE_DRIVER, 6814080, 321, 384, 416,
33057 - 240, 0, 272, 241, 273, 4196112, 0,
33058 - DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
33059 - { DRM_MODE("400x300", DRM_MODE_TYPE_DRIVER, 9910080, 401, 464, 496,
33060 - 300, 0, 332, 301, 333, 4196112, 0,
33061 - DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
33062 - { DRM_MODE("640x350", DRM_MODE_TYPE_DRIVER, 16913280, 641, 704, 736,
33063 - 350, 0, 382, 351, 383, 4196112, 0,
33064 - DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
33065 - { DRM_MODE("640x400", DRM_MODE_TYPE_DRIVER, 19121280, 641, 704, 736,
33066 - 400, 0, 432, 401, 433, 4196112, 0,
33067 - DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
33068 - { DRM_MODE("640x400", DRM_MODE_TYPE_DRIVER, 19121280, 641, 704, 736,
33069 - 400, 0, 432, 401, 433, 4196112, 0,
33070 - DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
33071 - { DRM_MODE("704x480", DRM_MODE_TYPE_DRIVER, 24624000, 705, 768, 800,
33072 - 480, 0, 512, 481, 513, 4196112, 0,
33073 - DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
33074 - { DRM_MODE("704x576", DRM_MODE_TYPE_DRIVER, 29232000, 705, 768, 800,
33075 - 576, 0, 608, 577, 609, 4196112, 0,
33076 - DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
33077 - { DRM_MODE("720x350", DRM_MODE_TYPE_DRIVER, 18751680, 721, 784, 816,
33078 - 350, 0, 382, 351, 383, 4196112, 0,
33079 - DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
33080 - { DRM_MODE("720x400", DRM_MODE_TYPE_DRIVER, 21199680, 721, 784, 816,
33081 - 400, 0, 432, 401, 433, 4196112, 0,
33082 - DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
33083 - { DRM_MODE("720x480", DRM_MODE_TYPE_DRIVER, 25116480, 721, 784, 816,
33084 - 480, 0, 512, 481, 513, 4196112, 0,
33085 - DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
33086 - { DRM_MODE("720x540", DRM_MODE_TYPE_DRIVER, 28054080, 721, 784, 816,
33087 - 540, 0, 572, 541, 573, 4196112, 0,
33088 - DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
33089 - { DRM_MODE("720x576", DRM_MODE_TYPE_DRIVER, 29816640, 721, 784, 816,
33090 - 576, 0, 608, 577, 609, 4196112, 0,
33091 - DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
33092 - { DRM_MODE("768x576", DRM_MODE_TYPE_DRIVER, 31570560, 769, 832, 864,
33093 - 576, 0, 608, 577, 609, 4196112, 0,
33094 - DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
33095 - { DRM_MODE("800x600", DRM_MODE_TYPE_DRIVER, 34030080, 801, 864, 896,
33096 - 600, 0, 632, 601, 633, 4196112, 0,
33097 - DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
33098 - { DRM_MODE("832x624", DRM_MODE_TYPE_DRIVER, 36581760, 833, 896, 928,
33099 - 624, 0, 656, 625, 657, 4196112, 0,
33100 - DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
33101 - { DRM_MODE("920x766", DRM_MODE_TYPE_DRIVER, 48707040, 921, 984, 1016,
33102 - 766, 0, 798, 767, 799, 4196112, 0,
33103 - DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
33104 - { DRM_MODE("1024x768", DRM_MODE_TYPE_DRIVER, 53827200, 1025, 1088, 1120,
33105 - 768, 0, 800, 769, 801, 4196112, 0,
33106 - DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
33107 - { DRM_MODE("1280x1024", DRM_MODE_TYPE_DRIVER, 87265920, 1281, 1344, 1376,
33108 - 1024, 0, 1056, 1025, 1057, 4196112, 0,
33109 - DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
33110 -};
33111 -
33112 -static void intel_sdvo_get_tv_modes(struct drm_connector *connector)
33113 -{
33114 - struct intel_output *output = to_intel_output(connector);
33115 - uint32_t reply = 0;
33116 - uint8_t status;
33117 - int i = 0;
33118 -
33119 - intel_sdvo_check_tv_format(output);
33120 -
33121 - /* Read the list of supported input resolutions for the selected TV
33122 - * format.
33123 - */
33124 - intel_sdvo_write_cmd(output, SDVO_CMD_GET_SDTV_RESOLUTION_SUPPORT,
33125 - NULL, 0);
33126 - status = intel_sdvo_read_response(output, &reply, 3);
33127 - if (status != SDVO_CMD_STATUS_SUCCESS)
33128 - return;
33129 -
33130 - for (i = 0; i < ARRAY_SIZE(sdvo_tv_modes); i++)
33131 - if (reply & (1 << i))
33132 - drm_mode_probed_add(connector, &sdvo_tv_modes[i]);
33133 -}
33134 -
33135 -static int intel_sdvo_get_modes(struct drm_connector *connector)
33136 -{
33137 - struct intel_output *output = to_intel_output(connector);
33138 - struct intel_sdvo_priv *sdvo_priv = output->dev_priv;
33139 -
33140 - if (sdvo_priv->is_tv)
33141 - intel_sdvo_get_tv_modes(connector);
33142 - else
33143 - intel_sdvo_get_ddc_modes(connector);
33144 -
33145 if (list_empty(&connector->probed_modes))
33146 return 0;
33147 return 1;
33148 @@ -1560,65 +978,6 @@
33149 };
33150
33151
33152 -/**
33153 - * Choose the appropriate DDC bus for control bus switch command for this
33154 - * SDVO output based on the controlled output.
33155 - *
33156 - * DDC bus number assignment is in a priority order of RGB outputs, then TMDS
33157 - * outputs, then LVDS outputs.
33158 - */
33159 -static void
33160 -intel_sdvo_select_ddc_bus(struct intel_sdvo_priv *dev_priv)
33161 -{
33162 - uint16_t mask = 0;
33163 - unsigned int num_bits;
33164 -
33165 - /* Make a mask of outputs less than or equal to our own priority in the
33166 - * list.
33167 - */
33168 - switch (dev_priv->controlled_output) {
33169 - case SDVO_OUTPUT_LVDS1:
33170 - mask |= SDVO_OUTPUT_LVDS1;
33171 - case SDVO_OUTPUT_LVDS0:
33172 - mask |= SDVO_OUTPUT_LVDS0;
33173 - case SDVO_OUTPUT_TMDS1:
33174 - mask |= SDVO_OUTPUT_TMDS1;
33175 - case SDVO_OUTPUT_TMDS0:
33176 - mask |= SDVO_OUTPUT_TMDS0;
33177 - case SDVO_OUTPUT_RGB1:
33178 - mask |= SDVO_OUTPUT_RGB1;
33179 - case SDVO_OUTPUT_RGB0:
33180 - mask |= SDVO_OUTPUT_RGB0;
33181 - break;
33182 - }
33183 -
33184 - /* Count bits to find what number we are in the priority list. */
33185 - mask &= dev_priv->caps.output_flags;
33186 - num_bits = hweight16(mask);
33187 - if (num_bits > 3) {
33188 - /* if more than 3 outputs, default to DDC bus 3 for now */
33189 - num_bits = 3;
33190 - }
33191 -
33192 - /* Corresponds to SDVO_CONTROL_BUS_DDCx */
33193 - dev_priv->ddc_bus = 1 << num_bits;
33194 -}
33195 -
33196 -static bool
33197 -intel_sdvo_get_digital_encoding_mode(struct intel_output *output)
33198 -{
33199 - struct intel_sdvo_priv *sdvo_priv = output->dev_priv;
33200 - uint8_t status;
33201 -
33202 - intel_sdvo_set_target_output(output, sdvo_priv->controlled_output);
33203 -
33204 - intel_sdvo_write_cmd(output, SDVO_CMD_GET_ENCODE, NULL, 0);
33205 - status = intel_sdvo_read_response(output, &sdvo_priv->is_hdmi, 1);
33206 - if (status != SDVO_CMD_STATUS_SUCCESS)
33207 - return false;
33208 - return true;
33209 -}
33210 -
33211 bool intel_sdvo_init(struct drm_device *dev, int output_device)
33212 {
33213 struct drm_connector *connector;
33214 @@ -1681,76 +1040,45 @@
33215
33216 intel_sdvo_get_capabilities(intel_output, &sdvo_priv->caps);
33217
33218 - if (sdvo_priv->caps.output_flags &
33219 - (SDVO_OUTPUT_TMDS0 | SDVO_OUTPUT_TMDS1)) {
33220 - if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_TMDS0)
33221 - sdvo_priv->controlled_output = SDVO_OUTPUT_TMDS0;
33222 - else
33223 - sdvo_priv->controlled_output = SDVO_OUTPUT_TMDS1;
33224 -
33225 - connector->display_info.subpixel_order = SubPixelHorizontalRGB;
33226 - encoder_type = DRM_MODE_ENCODER_TMDS;
33227 - connector_type = DRM_MODE_CONNECTOR_DVID;
33228 + memset(&sdvo_priv->active_outputs, 0, sizeof(sdvo_priv->active_outputs));
33229
33230 - if (intel_sdvo_get_supp_encode(intel_output,
33231 - &sdvo_priv->encode) &&
33232 - intel_sdvo_get_digital_encoding_mode(intel_output) &&
33233 - sdvo_priv->is_hdmi) {
33234 - /* enable hdmi encoding mode if supported */
33235 - intel_sdvo_set_encode(intel_output, SDVO_ENCODE_HDMI);
33236 - intel_sdvo_set_colorimetry(intel_output,
33237 - SDVO_COLORIMETRY_RGB256);
33238 - connector_type = DRM_MODE_CONNECTOR_HDMIA;
33239 - }
33240 - }
33241 - else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_SVID0)
33242 + /* TODO, CVBS, SVID, YPRPB & SCART outputs. */
33243 + if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_RGB0)
33244 {
33245 - sdvo_priv->controlled_output = SDVO_OUTPUT_SVID0;
33246 - connector->display_info.subpixel_order = SubPixelHorizontalRGB;
33247 - encoder_type = DRM_MODE_ENCODER_TVDAC;
33248 - connector_type = DRM_MODE_CONNECTOR_SVIDEO;
33249 - sdvo_priv->is_tv = true;
33250 - intel_output->needs_tv_clock = true;
33251 - }
33252 - else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_RGB0)
33253 - {
33254 - sdvo_priv->controlled_output = SDVO_OUTPUT_RGB0;
33255 + sdvo_priv->active_outputs = SDVO_OUTPUT_RGB0;
33256 connector->display_info.subpixel_order = SubPixelHorizontalRGB;
33257 encoder_type = DRM_MODE_ENCODER_DAC;
33258 connector_type = DRM_MODE_CONNECTOR_VGA;
33259 }
33260 else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_RGB1)
33261 {
33262 - sdvo_priv->controlled_output = SDVO_OUTPUT_RGB1;
33263 + sdvo_priv->active_outputs = SDVO_OUTPUT_RGB1;
33264 connector->display_info.subpixel_order = SubPixelHorizontalRGB;
33265 encoder_type = DRM_MODE_ENCODER_DAC;
33266 connector_type = DRM_MODE_CONNECTOR_VGA;
33267 }
33268 - else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_LVDS0)
33269 + else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_TMDS0)
33270 {
33271 - sdvo_priv->controlled_output = SDVO_OUTPUT_LVDS0;
33272 + sdvo_priv->active_outputs = SDVO_OUTPUT_TMDS0;
33273 connector->display_info.subpixel_order = SubPixelHorizontalRGB;
33274 - encoder_type = DRM_MODE_ENCODER_LVDS;
33275 - connector_type = DRM_MODE_CONNECTOR_LVDS;
33276 + encoder_type = DRM_MODE_ENCODER_TMDS;
33277 + connector_type = DRM_MODE_CONNECTOR_DVID;
33278 }
33279 - else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_LVDS1)
33280 + else if (sdvo_priv->caps.output_flags & SDVO_OUTPUT_TMDS1)
33281 {
33282 - sdvo_priv->controlled_output = SDVO_OUTPUT_LVDS1;
33283 + sdvo_priv->active_outputs = SDVO_OUTPUT_TMDS1;
33284 connector->display_info.subpixel_order = SubPixelHorizontalRGB;
33285 - encoder_type = DRM_MODE_ENCODER_LVDS;
33286 - connector_type = DRM_MODE_CONNECTOR_LVDS;
33287 + encoder_type = DRM_MODE_ENCODER_TMDS;
33288 + connector_type = DRM_MODE_CONNECTOR_DVID;
33289 }
33290 else
33291 {
33292 unsigned char bytes[2];
33293
33294 - sdvo_priv->controlled_output = 0;
33295 memcpy (bytes, &sdvo_priv->caps.output_flags, 2);
33296 - DRM_DEBUG("%s: Unknown SDVO output type (0x%02x%02x)\n",
33297 + DRM_DEBUG("%s: No active RGB or TMDS outputs (0x%02x%02x)\n",
33298 SDVO_NAME(sdvo_priv),
33299 bytes[0], bytes[1]);
33300 - encoder_type = DRM_MODE_ENCODER_NONE;
33301 - connector_type = DRM_MODE_CONNECTOR_Unknown;
33302 goto err_i2c;
33303 }
33304
33305 @@ -1761,8 +1089,6 @@
33306 drm_mode_connector_attach_encoder(&intel_output->base, &intel_output->enc);
33307 drm_sysfs_connector_add(connector);
33308
33309 - intel_sdvo_select_ddc_bus(sdvo_priv);
33310 -
33311 /* Set the input timing to the screen. Assume always input 0. */
33312 intel_sdvo_set_target_input(intel_output, true, false);
33313
33314 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/gpu/drm/i915/intel_sdvo_regs.h linux-2.6.29-rc3.owrt/drivers/gpu/drm/i915/intel_sdvo_regs.h
33315 --- linux-2.6.29.owrt/drivers/gpu/drm/i915/intel_sdvo_regs.h 2009-05-10 22:04:38.000000000 +0200
33316 +++ linux-2.6.29-rc3.owrt/drivers/gpu/drm/i915/intel_sdvo_regs.h 2009-05-10 23:48:28.000000000 +0200
33317 @@ -173,9 +173,6 @@
33318 * Returns two struct intel_sdvo_output_flags structures.
33319 */
33320 #define SDVO_CMD_GET_IN_OUT_MAP 0x06
33321 -struct intel_sdvo_in_out_map {
33322 - u16 in0, in1;
33323 -};
33324
33325 /**
33326 * Sets the current mapping of SDVO inputs to outputs on the device.
33327 @@ -209,8 +206,7 @@
33328 struct intel_sdvo_get_interrupt_event_source_response {
33329 u16 interrupt_status;
33330 unsigned int ambient_light_interrupt:1;
33331 - unsigned int hdmi_audio_encrypt_change:1;
33332 - unsigned int pad:6;
33333 + unsigned int pad:7;
33334 } __attribute__((packed));
33335
33336 /**
33337 @@ -309,411 +305,23 @@
33338 # define SDVO_CLOCK_RATE_MULT_4X (1 << 3)
33339
33340 #define SDVO_CMD_GET_SUPPORTED_TV_FORMATS 0x27
33341 -/** 5 bytes of bit flags for TV formats shared by all TV format functions */
33342 -struct intel_sdvo_tv_format {
33343 - unsigned int ntsc_m:1;
33344 - unsigned int ntsc_j:1;
33345 - unsigned int ntsc_443:1;
33346 - unsigned int pal_b:1;
33347 - unsigned int pal_d:1;
33348 - unsigned int pal_g:1;
33349 - unsigned int pal_h:1;
33350 - unsigned int pal_i:1;
33351 -
33352 - unsigned int pal_m:1;
33353 - unsigned int pal_n:1;
33354 - unsigned int pal_nc:1;
33355 - unsigned int pal_60:1;
33356 - unsigned int secam_b:1;
33357 - unsigned int secam_d:1;
33358 - unsigned int secam_g:1;
33359 - unsigned int secam_k:1;
33360 -
33361 - unsigned int secam_k1:1;
33362 - unsigned int secam_l:1;
33363 - unsigned int secam_60:1;
33364 - unsigned int hdtv_std_smpte_240m_1080i_59:1;
33365 - unsigned int hdtv_std_smpte_240m_1080i_60:1;
33366 - unsigned int hdtv_std_smpte_260m_1080i_59:1;
33367 - unsigned int hdtv_std_smpte_260m_1080i_60:1;
33368 - unsigned int hdtv_std_smpte_274m_1080i_50:1;
33369 -
33370 - unsigned int hdtv_std_smpte_274m_1080i_59:1;
33371 - unsigned int hdtv_std_smpte_274m_1080i_60:1;
33372 - unsigned int hdtv_std_smpte_274m_1080p_23:1;
33373 - unsigned int hdtv_std_smpte_274m_1080p_24:1;
33374 - unsigned int hdtv_std_smpte_274m_1080p_25:1;
33375 - unsigned int hdtv_std_smpte_274m_1080p_29:1;
33376 - unsigned int hdtv_std_smpte_274m_1080p_30:1;
33377 - unsigned int hdtv_std_smpte_274m_1080p_50:1;
33378 -
33379 - unsigned int hdtv_std_smpte_274m_1080p_59:1;
33380 - unsigned int hdtv_std_smpte_274m_1080p_60:1;
33381 - unsigned int hdtv_std_smpte_295m_1080i_50:1;
33382 - unsigned int hdtv_std_smpte_295m_1080p_50:1;
33383 - unsigned int hdtv_std_smpte_296m_720p_59:1;
33384 - unsigned int hdtv_std_smpte_296m_720p_60:1;
33385 - unsigned int hdtv_std_smpte_296m_720p_50:1;
33386 - unsigned int hdtv_std_smpte_293m_480p_59:1;
33387 -
33388 - unsigned int hdtv_std_smpte_170m_480i_59:1;
33389 - unsigned int hdtv_std_iturbt601_576i_50:1;
33390 - unsigned int hdtv_std_iturbt601_576p_50:1;
33391 - unsigned int hdtv_std_eia_7702a_480i_60:1;
33392 - unsigned int hdtv_std_eia_7702a_480p_60:1;
33393 - unsigned int pad:3;
33394 -} __attribute__((packed));
33395
33396 #define SDVO_CMD_GET_TV_FORMAT 0x28
33397
33398 #define SDVO_CMD_SET_TV_FORMAT 0x29
33399
33400 -/** Returns the resolutiosn that can be used with the given TV format */
33401 -#define SDVO_CMD_GET_SDTV_RESOLUTION_SUPPORT 0x83
33402 -struct intel_sdvo_sdtv_resolution_request {
33403 - unsigned int ntsc_m:1;
33404 - unsigned int ntsc_j:1;
33405 - unsigned int ntsc_443:1;
33406 - unsigned int pal_b:1;
33407 - unsigned int pal_d:1;
33408 - unsigned int pal_g:1;
33409 - unsigned int pal_h:1;
33410 - unsigned int pal_i:1;
33411 -
33412 - unsigned int pal_m:1;
33413 - unsigned int pal_n:1;
33414 - unsigned int pal_nc:1;
33415 - unsigned int pal_60:1;
33416 - unsigned int secam_b:1;
33417 - unsigned int secam_d:1;
33418 - unsigned int secam_g:1;
33419 - unsigned int secam_k:1;
33420 -
33421 - unsigned int secam_k1:1;
33422 - unsigned int secam_l:1;
33423 - unsigned int secam_60:1;
33424 - unsigned int pad:5;
33425 -} __attribute__((packed));
33426 -
33427 -struct intel_sdvo_sdtv_resolution_reply {
33428 - unsigned int res_320x200:1;
33429 - unsigned int res_320x240:1;
33430 - unsigned int res_400x300:1;
33431 - unsigned int res_640x350:1;
33432 - unsigned int res_640x400:1;
33433 - unsigned int res_640x480:1;
33434 - unsigned int res_704x480:1;
33435 - unsigned int res_704x576:1;
33436 -
33437 - unsigned int res_720x350:1;
33438 - unsigned int res_720x400:1;
33439 - unsigned int res_720x480:1;
33440 - unsigned int res_720x540:1;
33441 - unsigned int res_720x576:1;
33442 - unsigned int res_768x576:1;
33443 - unsigned int res_800x600:1;
33444 - unsigned int res_832x624:1;
33445 -
33446 - unsigned int res_920x766:1;
33447 - unsigned int res_1024x768:1;
33448 - unsigned int res_1280x1024:1;
33449 - unsigned int pad:5;
33450 -} __attribute__((packed));
33451 -
33452 -/* Get supported resolution with squire pixel aspect ratio that can be
33453 - scaled for the requested HDTV format */
33454 -#define SDVO_CMD_GET_SCALED_HDTV_RESOLUTION_SUPPORT 0x85
33455 -
33456 -struct intel_sdvo_hdtv_resolution_request {
33457 - unsigned int hdtv_std_smpte_240m_1080i_59:1;
33458 - unsigned int hdtv_std_smpte_240m_1080i_60:1;
33459 - unsigned int hdtv_std_smpte_260m_1080i_59:1;
33460 - unsigned int hdtv_std_smpte_260m_1080i_60:1;
33461 - unsigned int hdtv_std_smpte_274m_1080i_50:1;
33462 - unsigned int hdtv_std_smpte_274m_1080i_59:1;
33463 - unsigned int hdtv_std_smpte_274m_1080i_60:1;
33464 - unsigned int hdtv_std_smpte_274m_1080p_23:1;
33465 -
33466 - unsigned int hdtv_std_smpte_274m_1080p_24:1;
33467 - unsigned int hdtv_std_smpte_274m_1080p_25:1;
33468 - unsigned int hdtv_std_smpte_274m_1080p_29:1;
33469 - unsigned int hdtv_std_smpte_274m_1080p_30:1;
33470 - unsigned int hdtv_std_smpte_274m_1080p_50:1;
33471 - unsigned int hdtv_std_smpte_274m_1080p_59:1;
33472 - unsigned int hdtv_std_smpte_274m_1080p_60:1;
33473 - unsigned int hdtv_std_smpte_295m_1080i_50:1;
33474 -
33475 - unsigned int hdtv_std_smpte_295m_1080p_50:1;
33476 - unsigned int hdtv_std_smpte_296m_720p_59:1;
33477 - unsigned int hdtv_std_smpte_296m_720p_60:1;
33478 - unsigned int hdtv_std_smpte_296m_720p_50:1;
33479 - unsigned int hdtv_std_smpte_293m_480p_59:1;
33480 - unsigned int hdtv_std_smpte_170m_480i_59:1;
33481 - unsigned int hdtv_std_iturbt601_576i_50:1;
33482 - unsigned int hdtv_std_iturbt601_576p_50:1;
33483 -
33484 - unsigned int hdtv_std_eia_7702a_480i_60:1;
33485 - unsigned int hdtv_std_eia_7702a_480p_60:1;
33486 - unsigned int pad:6;
33487 -} __attribute__((packed));
33488 -
33489 -struct intel_sdvo_hdtv_resolution_reply {
33490 - unsigned int res_640x480:1;
33491 - unsigned int res_800x600:1;
33492 - unsigned int res_1024x768:1;
33493 - unsigned int res_1280x960:1;
33494 - unsigned int res_1400x1050:1;
33495 - unsigned int res_1600x1200:1;
33496 - unsigned int res_1920x1440:1;
33497 - unsigned int res_2048x1536:1;
33498 -
33499 - unsigned int res_2560x1920:1;
33500 - unsigned int res_3200x2400:1;
33501 - unsigned int res_3840x2880:1;
33502 - unsigned int pad1:5;
33503 -
33504 - unsigned int res_848x480:1;
33505 - unsigned int res_1064x600:1;
33506 - unsigned int res_1280x720:1;
33507 - unsigned int res_1360x768:1;
33508 - unsigned int res_1704x960:1;
33509 - unsigned int res_1864x1050:1;
33510 - unsigned int res_1920x1080:1;
33511 - unsigned int res_2128x1200:1;
33512 -
33513 - unsigned int res_2560x1400:1;
33514 - unsigned int res_2728x1536:1;
33515 - unsigned int res_3408x1920:1;
33516 - unsigned int res_4264x2400:1;
33517 - unsigned int res_5120x2880:1;
33518 - unsigned int pad2:3;
33519 -
33520 - unsigned int res_768x480:1;
33521 - unsigned int res_960x600:1;
33522 - unsigned int res_1152x720:1;
33523 - unsigned int res_1124x768:1;
33524 - unsigned int res_1536x960:1;
33525 - unsigned int res_1680x1050:1;
33526 - unsigned int res_1728x1080:1;
33527 - unsigned int res_1920x1200:1;
33528 -
33529 - unsigned int res_2304x1440:1;
33530 - unsigned int res_2456x1536:1;
33531 - unsigned int res_3072x1920:1;
33532 - unsigned int res_3840x2400:1;
33533 - unsigned int res_4608x2880:1;
33534 - unsigned int pad3:3;
33535 -
33536 - unsigned int res_1280x1024:1;
33537 - unsigned int pad4:7;
33538 -
33539 - unsigned int res_1280x768:1;
33540 - unsigned int pad5:7;
33541 -} __attribute__((packed));
33542 -
33543 -/* Get supported power state returns info for encoder and monitor, rely on
33544 - last SetTargetInput and SetTargetOutput calls */
33545 #define SDVO_CMD_GET_SUPPORTED_POWER_STATES 0x2a
33546 -/* Get power state returns info for encoder and monitor, rely on last
33547 - SetTargetInput and SetTargetOutput calls */
33548 -#define SDVO_CMD_GET_POWER_STATE 0x2b
33549 #define SDVO_CMD_GET_ENCODER_POWER_STATE 0x2b
33550 #define SDVO_CMD_SET_ENCODER_POWER_STATE 0x2c
33551 # define SDVO_ENCODER_STATE_ON (1 << 0)
33552 # define SDVO_ENCODER_STATE_STANDBY (1 << 1)
33553 # define SDVO_ENCODER_STATE_SUSPEND (1 << 2)
33554 # define SDVO_ENCODER_STATE_OFF (1 << 3)
33555 -# define SDVO_MONITOR_STATE_ON (1 << 4)
33556 -# define SDVO_MONITOR_STATE_STANDBY (1 << 5)
33557 -# define SDVO_MONITOR_STATE_SUSPEND (1 << 6)
33558 -# define SDVO_MONITOR_STATE_OFF (1 << 7)
33559 -
33560 -#define SDVO_CMD_GET_MAX_PANEL_POWER_SEQUENCING 0x2d
33561 -#define SDVO_CMD_GET_PANEL_POWER_SEQUENCING 0x2e
33562 -#define SDVO_CMD_SET_PANEL_POWER_SEQUENCING 0x2f
33563 -/**
33564 - * The panel power sequencing parameters are in units of milliseconds.
33565 - * The high fields are bits 8:9 of the 10-bit values.
33566 - */
33567 -struct sdvo_panel_power_sequencing {
33568 - u8 t0;
33569 - u8 t1;
33570 - u8 t2;
33571 - u8 t3;
33572 - u8 t4;
33573 -
33574 - unsigned int t0_high:2;
33575 - unsigned int t1_high:2;
33576 - unsigned int t2_high:2;
33577 - unsigned int t3_high:2;
33578 -
33579 - unsigned int t4_high:2;
33580 - unsigned int pad:6;
33581 -} __attribute__((packed));
33582 -
33583 -#define SDVO_CMD_GET_MAX_BACKLIGHT_LEVEL 0x30
33584 -struct sdvo_max_backlight_reply {
33585 - u8 max_value;
33586 - u8 default_value;
33587 -} __attribute__((packed));
33588 -
33589 -#define SDVO_CMD_GET_BACKLIGHT_LEVEL 0x31
33590 -#define SDVO_CMD_SET_BACKLIGHT_LEVEL 0x32
33591 -
33592 -#define SDVO_CMD_GET_AMBIENT_LIGHT 0x33
33593 -struct sdvo_get_ambient_light_reply {
33594 - u16 trip_low;
33595 - u16 trip_high;
33596 - u16 value;
33597 -} __attribute__((packed));
33598 -#define SDVO_CMD_SET_AMBIENT_LIGHT 0x34
33599 -struct sdvo_set_ambient_light_reply {
33600 - u16 trip_low;
33601 - u16 trip_high;
33602 - unsigned int enable:1;
33603 - unsigned int pad:7;
33604 -} __attribute__((packed));
33605 -
33606 -/* Set display power state */
33607 -#define SDVO_CMD_SET_DISPLAY_POWER_STATE 0x7d
33608 -# define SDVO_DISPLAY_STATE_ON (1 << 0)
33609 -# define SDVO_DISPLAY_STATE_STANDBY (1 << 1)
33610 -# define SDVO_DISPLAY_STATE_SUSPEND (1 << 2)
33611 -# define SDVO_DISPLAY_STATE_OFF (1 << 3)
33612 -
33613 -#define SDVO_CMD_GET_SUPPORTED_ENHANCEMENTS 0x84
33614 -struct intel_sdvo_enhancements_reply {
33615 - unsigned int flicker_filter:1;
33616 - unsigned int flicker_filter_adaptive:1;
33617 - unsigned int flicker_filter_2d:1;
33618 - unsigned int saturation:1;
33619 - unsigned int hue:1;
33620 - unsigned int brightness:1;
33621 - unsigned int contrast:1;
33622 - unsigned int overscan_h:1;
33623 -
33624 - unsigned int overscan_v:1;
33625 - unsigned int position_h:1;
33626 - unsigned int position_v:1;
33627 - unsigned int sharpness:1;
33628 - unsigned int dot_crawl:1;
33629 - unsigned int dither:1;
33630 - unsigned int max_tv_chroma_filter:1;
33631 - unsigned int max_tv_luma_filter:1;
33632 -} __attribute__((packed));
33633 -
33634 -/* Picture enhancement limits below are dependent on the current TV format,
33635 - * and thus need to be queried and set after it.
33636 - */
33637 -#define SDVO_CMD_GET_MAX_FLICKER_FITER 0x4d
33638 -#define SDVO_CMD_GET_MAX_ADAPTIVE_FLICKER_FITER 0x7b
33639 -#define SDVO_CMD_GET_MAX_2D_FLICKER_FITER 0x52
33640 -#define SDVO_CMD_GET_MAX_SATURATION 0x55
33641 -#define SDVO_CMD_GET_MAX_HUE 0x58
33642 -#define SDVO_CMD_GET_MAX_BRIGHTNESS 0x5b
33643 -#define SDVO_CMD_GET_MAX_CONTRAST 0x5e
33644 -#define SDVO_CMD_GET_MAX_OVERSCAN_H 0x61
33645 -#define SDVO_CMD_GET_MAX_OVERSCAN_V 0x64
33646 -#define SDVO_CMD_GET_MAX_POSITION_H 0x67
33647 -#define SDVO_CMD_GET_MAX_POSITION_V 0x6a
33648 -#define SDVO_CMD_GET_MAX_SHARPNESS_V 0x6d
33649 -#define SDVO_CMD_GET_MAX_TV_CHROMA 0x74
33650 -#define SDVO_CMD_GET_MAX_TV_LUMA 0x77
33651 -struct intel_sdvo_enhancement_limits_reply {
33652 - u16 max_value;
33653 - u16 default_value;
33654 -} __attribute__((packed));
33655
33656 -#define SDVO_CMD_GET_LVDS_PANEL_INFORMATION 0x7f
33657 -#define SDVO_CMD_SET_LVDS_PANEL_INFORMATION 0x80
33658 -# define SDVO_LVDS_COLOR_DEPTH_18 (0 << 0)
33659 -# define SDVO_LVDS_COLOR_DEPTH_24 (1 << 0)
33660 -# define SDVO_LVDS_CONNECTOR_SPWG (0 << 2)
33661 -# define SDVO_LVDS_CONNECTOR_OPENLDI (1 << 2)
33662 -# define SDVO_LVDS_SINGLE_CHANNEL (0 << 4)
33663 -# define SDVO_LVDS_DUAL_CHANNEL (1 << 4)
33664 -
33665 -#define SDVO_CMD_GET_FLICKER_FILTER 0x4e
33666 -#define SDVO_CMD_SET_FLICKER_FILTER 0x4f
33667 -#define SDVO_CMD_GET_ADAPTIVE_FLICKER_FITER 0x50
33668 -#define SDVO_CMD_SET_ADAPTIVE_FLICKER_FITER 0x51
33669 -#define SDVO_CMD_GET_2D_FLICKER_FITER 0x53
33670 -#define SDVO_CMD_SET_2D_FLICKER_FITER 0x54
33671 -#define SDVO_CMD_GET_SATURATION 0x56
33672 -#define SDVO_CMD_SET_SATURATION 0x57
33673 -#define SDVO_CMD_GET_HUE 0x59
33674 -#define SDVO_CMD_SET_HUE 0x5a
33675 -#define SDVO_CMD_GET_BRIGHTNESS 0x5c
33676 -#define SDVO_CMD_SET_BRIGHTNESS 0x5d
33677 -#define SDVO_CMD_GET_CONTRAST 0x5f
33678 -#define SDVO_CMD_SET_CONTRAST 0x60
33679 -#define SDVO_CMD_GET_OVERSCAN_H 0x62
33680 -#define SDVO_CMD_SET_OVERSCAN_H 0x63
33681 -#define SDVO_CMD_GET_OVERSCAN_V 0x65
33682 -#define SDVO_CMD_SET_OVERSCAN_V 0x66
33683 -#define SDVO_CMD_GET_POSITION_H 0x68
33684 -#define SDVO_CMD_SET_POSITION_H 0x69
33685 -#define SDVO_CMD_GET_POSITION_V 0x6b
33686 -#define SDVO_CMD_SET_POSITION_V 0x6c
33687 -#define SDVO_CMD_GET_SHARPNESS 0x6e
33688 -#define SDVO_CMD_SET_SHARPNESS 0x6f
33689 -#define SDVO_CMD_GET_TV_CHROMA 0x75
33690 -#define SDVO_CMD_SET_TV_CHROMA 0x76
33691 -#define SDVO_CMD_GET_TV_LUMA 0x78
33692 -#define SDVO_CMD_SET_TV_LUMA 0x79
33693 -struct intel_sdvo_enhancements_arg {
33694 - u16 value;
33695 -}__attribute__((packed));
33696 -
33697 -#define SDVO_CMD_GET_DOT_CRAWL 0x70
33698 -#define SDVO_CMD_SET_DOT_CRAWL 0x71
33699 -# define SDVO_DOT_CRAWL_ON (1 << 0)
33700 -# define SDVO_DOT_CRAWL_DEFAULT_ON (1 << 1)
33701 -
33702 -#define SDVO_CMD_GET_DITHER 0x72
33703 -#define SDVO_CMD_SET_DITHER 0x73
33704 -# define SDVO_DITHER_ON (1 << 0)
33705 -# define SDVO_DITHER_DEFAULT_ON (1 << 1)
33706 +#define SDVO_CMD_SET_TV_RESOLUTION_SUPPORT 0x93
33707
33708 #define SDVO_CMD_SET_CONTROL_BUS_SWITCH 0x7a
33709 -# define SDVO_CONTROL_BUS_PROM (1 << 0)
33710 -# define SDVO_CONTROL_BUS_DDC1 (1 << 1)
33711 -# define SDVO_CONTROL_BUS_DDC2 (1 << 2)
33712 -# define SDVO_CONTROL_BUS_DDC3 (1 << 3)
33713 -
33714 -/* HDMI op codes */
33715 -#define SDVO_CMD_GET_SUPP_ENCODE 0x9d
33716 -#define SDVO_CMD_GET_ENCODE 0x9e
33717 -#define SDVO_CMD_SET_ENCODE 0x9f
33718 - #define SDVO_ENCODE_DVI 0x0
33719 - #define SDVO_ENCODE_HDMI 0x1
33720 -#define SDVO_CMD_SET_PIXEL_REPLI 0x8b
33721 -#define SDVO_CMD_GET_PIXEL_REPLI 0x8c
33722 -#define SDVO_CMD_GET_COLORIMETRY_CAP 0x8d
33723 -#define SDVO_CMD_SET_COLORIMETRY 0x8e
33724 - #define SDVO_COLORIMETRY_RGB256 0x0
33725 - #define SDVO_COLORIMETRY_RGB220 0x1
33726 - #define SDVO_COLORIMETRY_YCrCb422 0x3
33727 - #define SDVO_COLORIMETRY_YCrCb444 0x4
33728 -#define SDVO_CMD_GET_COLORIMETRY 0x8f
33729 -#define SDVO_CMD_GET_AUDIO_ENCRYPT_PREFER 0x90
33730 -#define SDVO_CMD_SET_AUDIO_STAT 0x91
33731 -#define SDVO_CMD_GET_AUDIO_STAT 0x92
33732 -#define SDVO_CMD_SET_HBUF_INDEX 0x93
33733 -#define SDVO_CMD_GET_HBUF_INDEX 0x94
33734 -#define SDVO_CMD_GET_HBUF_INFO 0x95
33735 -#define SDVO_CMD_SET_HBUF_AV_SPLIT 0x96
33736 -#define SDVO_CMD_GET_HBUF_AV_SPLIT 0x97
33737 -#define SDVO_CMD_SET_HBUF_DATA 0x98
33738 -#define SDVO_CMD_GET_HBUF_DATA 0x99
33739 -#define SDVO_CMD_SET_HBUF_TXRATE 0x9a
33740 -#define SDVO_CMD_GET_HBUF_TXRATE 0x9b
33741 - #define SDVO_HBUF_TX_DISABLED (0 << 6)
33742 - #define SDVO_HBUF_TX_ONCE (2 << 6)
33743 - #define SDVO_HBUF_TX_VSYNC (3 << 6)
33744 -#define SDVO_CMD_GET_AUDIO_TX_INFO 0x9c
33745 -
33746 -struct intel_sdvo_encode{
33747 - u8 dvi_rev;
33748 - u8 hdmi_rev;
33749 -} __attribute__ ((packed));
33750 +# define SDVO_CONTROL_BUS_PROM 0x0
33751 +# define SDVO_CONTROL_BUS_DDC1 0x1
33752 +# define SDVO_CONTROL_BUS_DDC2 0x2
33753 +# define SDVO_CONTROL_BUS_DDC3 0x3
33754 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/gpu/drm/i915/intel_tv.c linux-2.6.29-rc3.owrt/drivers/gpu/drm/i915/intel_tv.c
33755 --- linux-2.6.29.owrt/drivers/gpu/drm/i915/intel_tv.c 2009-05-10 22:04:38.000000000 +0200
33756 +++ linux-2.6.29-rc3.owrt/drivers/gpu/drm/i915/intel_tv.c 2009-05-10 23:48:28.000000000 +0200
33757 @@ -411,7 +411,7 @@
33758 * These values account for -1s required.
33759 */
33760
33761 -static const struct tv_mode tv_modes[] = {
33762 +const static struct tv_mode tv_modes[] = {
33763 {
33764 .name = "NTSC-M",
33765 .clock = 107520,
33766 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/gpu/drm/Kconfig linux-2.6.29-rc3.owrt/drivers/gpu/drm/Kconfig
33767 --- linux-2.6.29.owrt/drivers/gpu/drm/Kconfig 2009-05-10 22:04:38.000000000 +0200
33768 +++ linux-2.6.29-rc3.owrt/drivers/gpu/drm/Kconfig 2009-05-10 23:48:28.000000000 +0200
33769 @@ -70,7 +70,7 @@
33770 select FB_CFB_FILLRECT
33771 select FB_CFB_COPYAREA
33772 select FB_CFB_IMAGEBLIT
33773 - select FB
33774 + depends on FB
33775 tristate "i915 driver"
33776 help
33777 Choose this option if you have a system that has Intel 830M, 845G,
33778 @@ -80,17 +80,18 @@
33779 XFree86 4.4 and above. If unsure, build this and i830 as modules and
33780 the X server will load the correct one.
33781
33782 +endchoice
33783 +
33784 config DRM_I915_KMS
33785 bool "Enable modesetting on intel by default"
33786 depends on DRM_I915
33787 help
33788 - Choose this option if you want kernel modesetting enabled by default,
33789 - and you have a new enough userspace to support this. Running old
33790 - userspaces with this enabled will cause pain. Note that this causes
33791 - the driver to bind to PCI devices, which precludes loading things
33792 - like intelfb.
33793 + Choose this option if you want kernel modesetting enabled by default,
33794 + and you have a new enough userspace to support this. Running old
33795 + userspaces with this enabled will cause pain. Note that this causes
33796 + the driver to bind to PCI devices, which precludes loading things
33797 + like intelfb.
33798
33799 -endchoice
33800
33801 config DRM_MGA
33802 tristate "Matrox g200/g400"
33803 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/gpu/drm/radeon/radeon_cp.c linux-2.6.29-rc3.owrt/drivers/gpu/drm/radeon/radeon_cp.c
33804 --- linux-2.6.29.owrt/drivers/gpu/drm/radeon/radeon_cp.c 2009-05-10 22:04:38.000000000 +0200
33805 +++ linux-2.6.29-rc3.owrt/drivers/gpu/drm/radeon/radeon_cp.c 2009-05-10 23:48:28.000000000 +0200
33806 @@ -557,10 +557,8 @@
33807 }
33808
33809 static void radeon_cp_init_ring_buffer(struct drm_device * dev,
33810 - drm_radeon_private_t *dev_priv,
33811 - struct drm_file *file_priv)
33812 + drm_radeon_private_t * dev_priv)
33813 {
33814 - struct drm_radeon_master_private *master_priv;
33815 u32 ring_start, cur_read_ptr;
33816 u32 tmp;
33817
33818 @@ -679,14 +677,6 @@
33819 dev_priv->scratch[2] = 0;
33820 RADEON_WRITE(RADEON_LAST_CLEAR_REG, 0);
33821
33822 - /* reset sarea copies of these */
33823 - master_priv = file_priv->master->driver_priv;
33824 - if (master_priv->sarea_priv) {
33825 - master_priv->sarea_priv->last_frame = 0;
33826 - master_priv->sarea_priv->last_dispatch = 0;
33827 - master_priv->sarea_priv->last_clear = 0;
33828 - }
33829 -
33830 radeon_do_wait_for_idle(dev_priv);
33831
33832 /* Sync everything up */
33833 @@ -1049,9 +1039,9 @@
33834
33835 #if __OS_HAS_AGP
33836 if (dev_priv->flags & RADEON_IS_AGP) {
33837 - drm_core_ioremap_wc(dev_priv->cp_ring, dev);
33838 - drm_core_ioremap_wc(dev_priv->ring_rptr, dev);
33839 - drm_core_ioremap_wc(dev->agp_buffer_map, dev);
33840 + drm_core_ioremap(dev_priv->cp_ring, dev);
33841 + drm_core_ioremap(dev_priv->ring_rptr, dev);
33842 + drm_core_ioremap(dev->agp_buffer_map, dev);
33843 if (!dev_priv->cp_ring->handle ||
33844 !dev_priv->ring_rptr->handle ||
33845 !dev->agp_buffer_map->handle) {
33846 @@ -1225,7 +1215,7 @@
33847 }
33848
33849 radeon_cp_load_microcode(dev_priv);
33850 - radeon_cp_init_ring_buffer(dev, dev_priv, file_priv);
33851 + radeon_cp_init_ring_buffer(dev, dev_priv);
33852
33853 dev_priv->last_buf = 0;
33854
33855 @@ -1291,7 +1281,7 @@
33856 *
33857 * Charl P. Botha <http://cpbotha.net>
33858 */
33859 -static int radeon_do_resume_cp(struct drm_device *dev, struct drm_file *file_priv)
33860 +static int radeon_do_resume_cp(struct drm_device * dev)
33861 {
33862 drm_radeon_private_t *dev_priv = dev->dev_private;
33863
33864 @@ -1314,7 +1304,7 @@
33865 }
33866
33867 radeon_cp_load_microcode(dev_priv);
33868 - radeon_cp_init_ring_buffer(dev, dev_priv, file_priv);
33869 + radeon_cp_init_ring_buffer(dev, dev_priv);
33870
33871 radeon_do_engine_reset(dev);
33872 radeon_irq_set_state(dev, RADEON_SW_INT_ENABLE, 1);
33873 @@ -1489,7 +1479,8 @@
33874 */
33875 int radeon_cp_resume(struct drm_device *dev, void *data, struct drm_file *file_priv)
33876 {
33877 - return radeon_do_resume_cp(dev, file_priv);
33878 +
33879 + return radeon_do_resume_cp(dev);
33880 }
33881
33882 int radeon_engine_reset(struct drm_device *dev, void *data, struct drm_file *file_priv)
33883 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/hid/hid-core.c linux-2.6.29-rc3.owrt/drivers/hid/hid-core.c
33884 --- linux-2.6.29.owrt/drivers/hid/hid-core.c 2009-05-10 22:04:38.000000000 +0200
33885 +++ linux-2.6.29-rc3.owrt/drivers/hid/hid-core.c 2009-05-10 23:48:28.000000000 +0200
33886 @@ -1218,7 +1218,6 @@
33887 }
33888 EXPORT_SYMBOL_GPL(hid_connect);
33889
33890 -/* a list of devices for which there is a specialized driver on HID bus */
33891 static const struct hid_device_id hid_blacklist[] = {
33892 { HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU) },
33893 { HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_X5_005D) },
33894 @@ -1300,13 +1299,7 @@
33895 { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) },
33896 { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE) },
33897 { HID_USB_DEVICE(USB_VENDOR_ID_SUNPLUS, USB_DEVICE_ID_SUNPLUS_WDESKTOP) },
33898 - { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb300) },
33899 - { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb304) },
33900 - { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb651) },
33901 - { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb654) },
33902 { HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED, USB_DEVICE_ID_TOPSEED_CYBERLINK) },
33903 - { HID_USB_DEVICE(USB_VENDOR_ID_ZEROPLUS, 0x0005) },
33904 - { HID_USB_DEVICE(USB_VENDOR_ID_ZEROPLUS, 0x0030) },
33905
33906 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, 0x030c) },
33907 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PRESENTER_8K_BT) },
33908 @@ -1483,7 +1476,6 @@
33909 .uevent = hid_uevent,
33910 };
33911
33912 -/* a list of devices that shouldn't be handled by HID core at all */
33913 static const struct hid_device_id hid_ignore_list[] = {
33914 { HID_USB_DEVICE(USB_VENDOR_ID_ACECAD, USB_DEVICE_ID_ACECAD_FLAIR) },
33915 { HID_USB_DEVICE(USB_VENDOR_ID_ACECAD, USB_DEVICE_ID_ACECAD_302) },
33916 @@ -1611,14 +1603,15 @@
33917 { HID_USB_DEVICE(USB_VENDOR_ID_PANJIT, 0x0002) },
33918 { HID_USB_DEVICE(USB_VENDOR_ID_PANJIT, 0x0003) },
33919 { HID_USB_DEVICE(USB_VENDOR_ID_PANJIT, 0x0004) },
33920 - { HID_USB_DEVICE(USB_VENDOR_ID_POWERCOM, USB_DEVICE_ID_POWERCOM_UPS) },
33921 { HID_USB_DEVICE(USB_VENDOR_ID_SOUNDGRAPH, USB_DEVICE_ID_SOUNDGRAPH_IMON_LCD) },
33922 { HID_USB_DEVICE(USB_VENDOR_ID_SOUNDGRAPH, USB_DEVICE_ID_SOUNDGRAPH_IMON_LCD2) },
33923 { HID_USB_DEVICE(USB_VENDOR_ID_SOUNDGRAPH, USB_DEVICE_ID_SOUNDGRAPH_IMON_LCD3) },
33924 - { HID_USB_DEVICE(USB_VENDOR_ID_SOUNDGRAPH, USB_DEVICE_ID_SOUNDGRAPH_IMON_LCD4) },
33925 - { HID_USB_DEVICE(USB_VENDOR_ID_SOUNDGRAPH, USB_DEVICE_ID_SOUNDGRAPH_IMON_LCD5) },
33926 { HID_USB_DEVICE(USB_VENDOR_ID_TENX, USB_DEVICE_ID_TENX_IBUDDY1) },
33927 { HID_USB_DEVICE(USB_VENDOR_ID_TENX, USB_DEVICE_ID_TENX_IBUDDY2) },
33928 + { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb300) },
33929 + { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb304) },
33930 + { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb651) },
33931 + { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb654) },
33932 { HID_USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_LABPRO) },
33933 { HID_USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_GOTEMP) },
33934 { HID_USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_SKIP) },
33935 @@ -1629,6 +1622,8 @@
33936 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_1_PHIDGETSERVO_20) },
33937 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_8_8_4_IF_KIT) },
33938 { HID_USB_DEVICE(USB_VENDOR_ID_YEALINK, USB_DEVICE_ID_YEALINK_P1K_P4K_B2K) },
33939 + { HID_USB_DEVICE(USB_VENDOR_ID_ZEROPLUS, 0x0005) },
33940 + { HID_USB_DEVICE(USB_VENDOR_ID_ZEROPLUS, 0x0030) },
33941 { }
33942 };
33943
33944 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/hid/hid-ids.h linux-2.6.29-rc3.owrt/drivers/hid/hid-ids.h
33945 --- linux-2.6.29.owrt/drivers/hid/hid-ids.h 2009-05-10 22:04:38.000000000 +0200
33946 +++ linux-2.6.29-rc3.owrt/drivers/hid/hid-ids.h 2009-05-10 23:48:28.000000000 +0200
33947 @@ -348,9 +348,6 @@
33948 #define USB_VENDOR_ID_PLAYDOTCOM 0x0b43
33949 #define USB_DEVICE_ID_PLAYDOTCOM_EMS_USBII 0x0003
33950
33951 -#define USB_VENDOR_ID_POWERCOM 0x0d9f
33952 -#define USB_DEVICE_ID_POWERCOM_UPS 0x0002
33953 -
33954 #define USB_VENDOR_ID_SAITEK 0x06a3
33955 #define USB_DEVICE_ID_SAITEK_RUMBLEPAD 0xff17
33956
33957 @@ -365,8 +362,6 @@
33958 #define USB_DEVICE_ID_SOUNDGRAPH_IMON_LCD 0x0038
33959 #define USB_DEVICE_ID_SOUNDGRAPH_IMON_LCD2 0x0036
33960 #define USB_DEVICE_ID_SOUNDGRAPH_IMON_LCD3 0x0034
33961 -#define USB_DEVICE_ID_SOUNDGRAPH_IMON_LCD4 0x0044
33962 -#define USB_DEVICE_ID_SOUNDGRAPH_IMON_LCD5 0x0045
33963
33964 #define USB_VENDOR_ID_SUN 0x0430
33965 #define USB_DEVICE_ID_RARITAN_KVM_DONGLE 0xcdab
33966 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/hid/hid-microsoft.c linux-2.6.29-rc3.owrt/drivers/hid/hid-microsoft.c
33967 --- linux-2.6.29.owrt/drivers/hid/hid-microsoft.c 2009-05-10 22:04:38.000000000 +0200
33968 +++ linux-2.6.29-rc3.owrt/drivers/hid/hid-microsoft.c 2009-05-10 23:48:28.000000000 +0200
33969 @@ -30,7 +30,7 @@
33970 #define MS_NOGET 0x10
33971
33972 /*
33973 - * Microsoft Wireless Desktop Receiver (Model 1028) has
33974 + * Microsoft Wireless Desktop Receiver (Model 1028) has several
33975 * 'Usage Min/Max' where it ought to have 'Physical Min/Max'
33976 */
33977 static void ms_report_fixup(struct hid_device *hdev, __u8 *rdesc,
33978 @@ -38,12 +38,17 @@
33979 {
33980 unsigned long quirks = (unsigned long)hid_get_drvdata(hdev);
33981
33982 - if ((quirks & MS_RDESC) && rsize == 571 && rdesc[557] == 0x19 &&
33983 + if ((quirks & MS_RDESC) && rsize == 571 && rdesc[284] == 0x19 &&
33984 + rdesc[286] == 0x2a && rdesc[304] == 0x19 &&
33985 + rdesc[306] == 0x29 && rdesc[352] == 0x1a &&
33986 + rdesc[355] == 0x2a && rdesc[557] == 0x19 &&
33987 rdesc[559] == 0x29) {
33988 dev_info(&hdev->dev, "fixing up Microsoft Wireless Receiver "
33989 "Model 1028 report descriptor\n");
33990 - rdesc[557] = 0x35;
33991 - rdesc[559] = 0x45;
33992 + rdesc[284] = rdesc[304] = rdesc[557] = 0x35;
33993 + rdesc[352] = 0x36;
33994 + rdesc[286] = rdesc[355] = 0x46;
33995 + rdesc[306] = rdesc[559] = 0x45;
33996 }
33997 }
33998
33999 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/hid/hidraw.c linux-2.6.29-rc3.owrt/drivers/hid/hidraw.c
34000 --- linux-2.6.29.owrt/drivers/hid/hidraw.c 2009-05-10 22:04:38.000000000 +0200
34001 +++ linux-2.6.29-rc3.owrt/drivers/hid/hidraw.c 2009-05-10 23:48:28.000000000 +0200
34002 @@ -267,10 +267,8 @@
34003 default:
34004 {
34005 struct hid_device *hid = dev->hid;
34006 - if (_IOC_TYPE(cmd) != 'H' || _IOC_DIR(cmd) != _IOC_READ) {
34007 - ret = -EINVAL;
34008 - break;
34009 - }
34010 + if (_IOC_TYPE(cmd) != 'H' || _IOC_DIR(cmd) != _IOC_READ)
34011 + return -EINVAL;
34012
34013 if (_IOC_NR(cmd) == _IOC_NR(HIDIOCGRAWNAME(0))) {
34014 int len;
34015 @@ -279,9 +277,8 @@
34016 len = strlen(hid->name) + 1;
34017 if (len > _IOC_SIZE(cmd))
34018 len = _IOC_SIZE(cmd);
34019 - ret = copy_to_user(user_arg, hid->name, len) ?
34020 + return copy_to_user(user_arg, hid->name, len) ?
34021 -EFAULT : len;
34022 - break;
34023 }
34024
34025 if (_IOC_NR(cmd) == _IOC_NR(HIDIOCGRAWPHYS(0))) {
34026 @@ -291,13 +288,12 @@
34027 len = strlen(hid->phys) + 1;
34028 if (len > _IOC_SIZE(cmd))
34029 len = _IOC_SIZE(cmd);
34030 - ret = copy_to_user(user_arg, hid->phys, len) ?
34031 + return copy_to_user(user_arg, hid->phys, len) ?
34032 -EFAULT : len;
34033 - break;
34034 }
34035 }
34036
34037 - ret = -ENOTTY;
34038 + ret = -ENOTTY;
34039 }
34040 unlock_kernel();
34041 return ret;
34042 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/hid/usbhid/hiddev.c linux-2.6.29-rc3.owrt/drivers/hid/usbhid/hiddev.c
34043 --- linux-2.6.29.owrt/drivers/hid/usbhid/hiddev.c 2009-05-10 22:04:38.000000000 +0200
34044 +++ linux-2.6.29-rc3.owrt/drivers/hid/usbhid/hiddev.c 2009-05-10 23:48:28.000000000 +0200
34045 @@ -306,7 +306,7 @@
34046 return 0;
34047 bail:
34048 file->private_data = NULL;
34049 - kfree(list);
34050 + kfree(list->hiddev);
34051 return res;
34052 }
34053
34054 @@ -323,7 +323,7 @@
34055 */
34056 static ssize_t hiddev_read(struct file * file, char __user * buffer, size_t count, loff_t *ppos)
34057 {
34058 - DEFINE_WAIT(wait);
34059 + DECLARE_WAITQUEUE(wait, current);
34060 struct hiddev_list *list = file->private_data;
34061 int event_size;
34062 int retval;
34063 @@ -656,7 +656,7 @@
34064
34065 case HIDIOCGSTRING:
34066 mutex_lock(&hiddev->existancelock);
34067 - if (hiddev->exist)
34068 + if (!hiddev->exist)
34069 r = hiddev_ioctl_string(hiddev, cmd, user_arg);
34070 else
34071 r = -ENODEV;
34072 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/hwmon/abituguru3.c linux-2.6.29-rc3.owrt/drivers/hwmon/abituguru3.c
34073 --- linux-2.6.29.owrt/drivers/hwmon/abituguru3.c 2009-05-10 22:04:39.000000000 +0200
34074 +++ linux-2.6.29-rc3.owrt/drivers/hwmon/abituguru3.c 2009-05-10 23:48:28.000000000 +0200
34075 @@ -760,11 +760,8 @@
34076
34077 for (i = 0; i < offset_count; i++)
34078 if ((x = abituguru3_read(data, bank, offset + i, count,
34079 - buf + i * count)) != count) {
34080 - if (x < 0)
34081 - return x;
34082 - return i * count + x;
34083 - }
34084 + buf + i * count)) != count)
34085 + return i * count + (i && (x < 0)) ? 0 : x;
34086
34087 return i * count;
34088 }
34089 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/hwmon/applesmc.c linux-2.6.29-rc3.owrt/drivers/hwmon/applesmc.c
34090 --- linux-2.6.29.owrt/drivers/hwmon/applesmc.c 2009-05-10 22:04:39.000000000 +0200
34091 +++ linux-2.6.29-rc3.owrt/drivers/hwmon/applesmc.c 2009-05-10 23:48:28.000000000 +0200
34092 @@ -83,7 +83,7 @@
34093 /*
34094 * Temperature sensors keys (sp78 - 2 bytes).
34095 */
34096 -static const char *temperature_sensors_sets[][41] = {
34097 +static const char* temperature_sensors_sets[][36] = {
34098 /* Set 0: Macbook Pro */
34099 { "TA0P", "TB0T", "TC0D", "TC0P", "TG0H", "TG0P", "TG0T", "Th0H",
34100 "Th1H", "Tm0P", "Ts0P", "Ts1P", NULL },
34101 @@ -135,13 +135,6 @@
34102 { "TB0T", "TB1S", "TB1T", "TB2S", "TB2T", "TC0D", "TN0D", "TTF0",
34103 "TV0P", "TVFP", "TW0P", "Th0P", "Tp0P", "Tp1P", "TpFP", "Ts0P",
34104 "Ts0S", NULL },
34105 -/* Set 16: Mac Pro 3,1 (2 x Quad-Core) */
34106 - { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", "TC0C", "TC0D", "TC0P",
34107 - "TC1C", "TC1D", "TC2C", "TC2D", "TC3C", "TC3D", "TH0P", "TH1P",
34108 - "TH2P", "TH3P", "TMAP", "TMAS", "TMBS", "TM0P", "TM0S", "TM1P",
34109 - "TM1S", "TM2P", "TM2S", "TM3S", "TM8P", "TM8S", "TM9P", "TM9S",
34110 - "TN0C", "TN0D", "TN0H", "TS0C", "Tp0C", "Tp1C", "Tv0S", "Tv1S",
34111 - NULL },
34112 };
34113
34114 /* List of keys used to read/write fan speeds */
34115 @@ -1160,16 +1153,6 @@
34116 applesmc_show_temperature, NULL, 33);
34117 static SENSOR_DEVICE_ATTR(temp35_input, S_IRUGO,
34118 applesmc_show_temperature, NULL, 34);
34119 -static SENSOR_DEVICE_ATTR(temp36_input, S_IRUGO,
34120 - applesmc_show_temperature, NULL, 35);
34121 -static SENSOR_DEVICE_ATTR(temp37_input, S_IRUGO,
34122 - applesmc_show_temperature, NULL, 36);
34123 -static SENSOR_DEVICE_ATTR(temp38_input, S_IRUGO,
34124 - applesmc_show_temperature, NULL, 37);
34125 -static SENSOR_DEVICE_ATTR(temp39_input, S_IRUGO,
34126 - applesmc_show_temperature, NULL, 38);
34127 -static SENSOR_DEVICE_ATTR(temp40_input, S_IRUGO,
34128 - applesmc_show_temperature, NULL, 39);
34129
34130 static struct attribute *temperature_attributes[] = {
34131 &sensor_dev_attr_temp1_input.dev_attr.attr,
34132 @@ -1207,11 +1190,6 @@
34133 &sensor_dev_attr_temp33_input.dev_attr.attr,
34134 &sensor_dev_attr_temp34_input.dev_attr.attr,
34135 &sensor_dev_attr_temp35_input.dev_attr.attr,
34136 - &sensor_dev_attr_temp36_input.dev_attr.attr,
34137 - &sensor_dev_attr_temp37_input.dev_attr.attr,
34138 - &sensor_dev_attr_temp38_input.dev_attr.attr,
34139 - &sensor_dev_attr_temp39_input.dev_attr.attr,
34140 - &sensor_dev_attr_temp40_input.dev_attr.attr,
34141 NULL
34142 };
34143
34144 @@ -1334,8 +1312,6 @@
34145 { .accelerometer = 0, .light = 0, .temperature_set = 14 },
34146 /* MacBook Air 2,1: accelerometer, backlight and temperature set 15 */
34147 { .accelerometer = 1, .light = 1, .temperature_set = 15 },
34148 -/* MacPro3,1: temperature set 16 */
34149 - { .accelerometer = 0, .light = 0, .temperature_set = 16 },
34150 };
34151
34152 /* Note that DMI_MATCH(...,"MacBook") will match "MacBookPro1,1".
34153 @@ -1393,10 +1369,6 @@
34154 DMI_MATCH(DMI_BOARD_VENDOR,"Apple"),
34155 DMI_MATCH(DMI_PRODUCT_NAME,"MacPro2") },
34156 &applesmc_dmi_data[4]},
34157 - { applesmc_dmi_match, "Apple MacPro3", {
34158 - DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
34159 - DMI_MATCH(DMI_PRODUCT_NAME, "MacPro3") },
34160 - &applesmc_dmi_data[16]},
34161 { applesmc_dmi_match, "Apple MacPro", {
34162 DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
34163 DMI_MATCH(DMI_PRODUCT_NAME, "MacPro") },
34164 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/hwmon/f71882fg.c linux-2.6.29-rc3.owrt/drivers/hwmon/f71882fg.c
34165 --- linux-2.6.29.owrt/drivers/hwmon/f71882fg.c 2009-05-10 22:04:39.000000000 +0200
34166 +++ linux-2.6.29-rc3.owrt/drivers/hwmon/f71882fg.c 2009-05-10 23:48:28.000000000 +0200
34167 @@ -1872,7 +1872,7 @@
34168
34169 devid = superio_inw(sioaddr, SIO_REG_MANID);
34170 if (devid != SIO_FINTEK_ID) {
34171 - pr_debug(DRVNAME ": Not a Fintek device\n");
34172 + printk(KERN_INFO DRVNAME ": Not a Fintek device\n");
34173 goto exit;
34174 }
34175
34176 @@ -1932,7 +1932,7 @@
34177 res.name = f71882fg_pdev->name;
34178 err = acpi_check_resource_conflict(&res);
34179 if (err)
34180 - goto exit_device_put;
34181 + return err;
34182
34183 err = platform_device_add_resources(f71882fg_pdev, &res, 1);
34184 if (err) {
34185 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/hwmon/f75375s.c linux-2.6.29-rc3.owrt/drivers/hwmon/f75375s.c
34186 --- linux-2.6.29.owrt/drivers/hwmon/f75375s.c 2009-05-10 22:04:39.000000000 +0200
34187 +++ linux-2.6.29-rc3.owrt/drivers/hwmon/f75375s.c 2009-05-10 23:48:28.000000000 +0200
34188 @@ -617,7 +617,7 @@
34189 static int f75375_probe(struct i2c_client *client,
34190 const struct i2c_device_id *id)
34191 {
34192 - struct f75375_data *data;
34193 + struct f75375_data *data = i2c_get_clientdata(client);
34194 struct f75375s_platform_data *f75375s_pdata = client->dev.platform_data;
34195 int err;
34196
34197 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/hwmon/hp_accel.c linux-2.6.29-rc3.owrt/drivers/hwmon/hp_accel.c
34198 --- linux-2.6.29.owrt/drivers/hwmon/hp_accel.c 2009-05-10 22:04:39.000000000 +0200
34199 +++ linux-2.6.29-rc3.owrt/drivers/hwmon/hp_accel.c 2009-05-10 23:48:28.000000000 +0200
34200 @@ -153,10 +153,7 @@
34201 static struct axis_conversion lis3lv02d_axis_x_inverted = {-1, 2, 3};
34202 static struct axis_conversion lis3lv02d_axis_z_inverted = {1, 2, -3};
34203 static struct axis_conversion lis3lv02d_axis_xy_rotated_left = {-2, 1, 3};
34204 -static struct axis_conversion lis3lv02d_axis_xy_rotated_left_usd = {-2, 1, -3};
34205 static struct axis_conversion lis3lv02d_axis_xy_swap_inverted = {-2, -1, 3};
34206 -static struct axis_conversion lis3lv02d_axis_xy_rotated_right = {2, -1, 3};
34207 -static struct axis_conversion lis3lv02d_axis_xy_swap_yz_inverted = {2, -1, -3};
34208
34209 #define AXIS_DMI_MATCH(_ident, _name, _axis) { \
34210 .ident = _ident, \
34211 @@ -166,18 +163,6 @@
34212 }, \
34213 .driver_data = &lis3lv02d_axis_##_axis \
34214 }
34215 -
34216 -#define AXIS_DMI_MATCH2(_ident, _class1, _name1, \
34217 - _class2, _name2, \
34218 - _axis) { \
34219 - .ident = _ident, \
34220 - .callback = lis3lv02d_dmi_matched, \
34221 - .matches = { \
34222 - DMI_MATCH(DMI_##_class1, _name1), \
34223 - DMI_MATCH(DMI_##_class2, _name2), \
34224 - }, \
34225 - .driver_data = &lis3lv02d_axis_##_axis \
34226 -}
34227 static struct dmi_system_id lis3lv02d_dmi_ids[] = {
34228 /* product names are truncated to match all kinds of a same model */
34229 AXIS_DMI_MATCH("NC64x0", "HP Compaq nc64", x_inverted),
34230 @@ -187,22 +172,10 @@
34231 AXIS_DMI_MATCH("NC2510", "HP Compaq 2510", y_inverted),
34232 AXIS_DMI_MATCH("NC8510", "HP Compaq 8510", xy_swap_inverted),
34233 AXIS_DMI_MATCH("HP2133", "HP 2133", xy_rotated_left),
34234 - AXIS_DMI_MATCH("NC653x", "HP Compaq 653", xy_rotated_left_usd),
34235 - AXIS_DMI_MATCH("NC673x", "HP Compaq 673", xy_rotated_left_usd),
34236 - AXIS_DMI_MATCH("NC651xx", "HP Compaq 651", xy_rotated_right),
34237 - AXIS_DMI_MATCH("NC671xx", "HP Compaq 671", xy_swap_yz_inverted),
34238 - /* Intel-based HP Pavilion dv5 */
34239 - AXIS_DMI_MATCH2("HPDV5_I",
34240 - PRODUCT_NAME, "HP Pavilion dv5",
34241 - BOARD_NAME, "3603",
34242 - x_inverted),
34243 - /* AMD-based HP Pavilion dv5 */
34244 - AXIS_DMI_MATCH2("HPDV5_A",
34245 - PRODUCT_NAME, "HP Pavilion dv5",
34246 - BOARD_NAME, "3600",
34247 - y_inverted),
34248 { NULL, }
34249 /* Laptop models without axis info (yet):
34250 + * "NC651xx" "HP Compaq 651"
34251 + * "NC671xx" "HP Compaq 671"
34252 * "NC6910" "HP Compaq 6910"
34253 * HP Compaq 8710x Notebook PC / Mobile Workstation
34254 * "NC2400" "HP Compaq nc2400"
34255 @@ -235,49 +208,9 @@
34256 .set_brightness = hpled_set,
34257 };
34258
34259 -static acpi_status
34260 -lis3lv02d_get_resource(struct acpi_resource *resource, void *context)
34261 -{
34262 - if (resource->type == ACPI_RESOURCE_TYPE_EXTENDED_IRQ) {
34263 - struct acpi_resource_extended_irq *irq;
34264 - u32 *device_irq = context;
34265 -
34266 - irq = &resource->data.extended_irq;
34267 - *device_irq = irq->interrupts[0];
34268 - }
34269 -
34270 - return AE_OK;
34271 -}
34272 -
34273 -static void lis3lv02d_enum_resources(struct acpi_device *device)
34274 -{
34275 - acpi_status status;
34276 -
34277 - status = acpi_walk_resources(device->handle, METHOD_NAME__CRS,
34278 - lis3lv02d_get_resource, &adev.irq);
34279 - if (ACPI_FAILURE(status))
34280 - printk(KERN_DEBUG DRIVER_NAME ": Error getting resources\n");
34281 -}
34282 -
34283 -static s16 lis3lv02d_read_16(acpi_handle handle, int reg)
34284 -{
34285 - u8 lo, hi;
34286 -
34287 - adev.read(handle, reg - 1, &lo);
34288 - adev.read(handle, reg, &hi);
34289 - /* In "12 bit right justified" mode, bit 6, bit 7, bit 8 = bit 5 */
34290 - return (s16)((hi << 8) | lo);
34291 -}
34292 -
34293 -static s16 lis3lv02d_read_8(acpi_handle handle, int reg)
34294 -{
34295 - s8 lo;
34296 - adev.read(handle, reg, &lo);
34297 - return lo;
34298 -}
34299 -
34300 static int lis3lv02d_add(struct acpi_device *device)
34301 {
34302 + u8 val;
34303 int ret;
34304
34305 if (!device)
34306 @@ -291,22 +224,10 @@
34307 strcpy(acpi_device_class(device), ACPI_MDPS_CLASS);
34308 device->driver_data = &adev;
34309
34310 - lis3lv02d_acpi_read(device->handle, WHO_AM_I, &adev.whoami);
34311 - switch (adev.whoami) {
34312 - case LIS_DOUBLE_ID:
34313 - printk(KERN_INFO DRIVER_NAME ": 2-byte sensor found\n");
34314 - adev.read_data = lis3lv02d_read_16;
34315 - adev.mdps_max_val = 2048;
34316 - break;
34317 - case LIS_SINGLE_ID:
34318 - printk(KERN_INFO DRIVER_NAME ": 1-byte sensor found\n");
34319 - adev.read_data = lis3lv02d_read_8;
34320 - adev.mdps_max_val = 128;
34321 - break;
34322 - default:
34323 + lis3lv02d_acpi_read(device->handle, WHO_AM_I, &val);
34324 + if ((val != LIS3LV02DL_ID) && (val != LIS302DL_ID)) {
34325 printk(KERN_ERR DRIVER_NAME
34326 - ": unknown sensor type 0x%X\n", adev.whoami);
34327 - return -EINVAL;
34328 + ": Accelerometer chip not LIS3LV02D{L,Q}\n");
34329 }
34330
34331 /* If possible use a "standard" axes order */
34332 @@ -321,9 +242,6 @@
34333 if (ret)
34334 return ret;
34335
34336 - /* obtain IRQ number of our device from ACPI */
34337 - lis3lv02d_enum_resources(adev.device);
34338 -
34339 ret = lis3lv02d_init_device(&adev);
34340 if (ret) {
34341 flush_work(&hpled_led.work);
34342 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/hwmon/it87.c linux-2.6.29-rc3.owrt/drivers/hwmon/it87.c
34343 --- linux-2.6.29.owrt/drivers/hwmon/it87.c 2009-05-10 22:04:39.000000000 +0200
34344 +++ linux-2.6.29-rc3.owrt/drivers/hwmon/it87.c 2009-05-10 23:48:28.000000000 +0200
34345 @@ -213,7 +213,7 @@
34346
34347 #define TEMP_TO_REG(val) (SENSORS_LIMIT(((val)<0?(((val)-500)/1000):\
34348 ((val)+500)/1000),-128,127))
34349 -#define TEMP_FROM_REG(val) ((val) * 1000)
34350 +#define TEMP_FROM_REG(val) (((val)>0x80?(val)-0x100:(val))*1000)
34351
34352 #define PWM_TO_REG(val) ((val) >> 1)
34353 #define PWM_FROM_REG(val) (((val)&0x7f) << 1)
34354 @@ -267,9 +267,9 @@
34355 u8 has_fan; /* Bitfield, fans enabled */
34356 u16 fan[5]; /* Register values, possibly combined */
34357 u16 fan_min[5]; /* Register values, possibly combined */
34358 - s8 temp[3]; /* Register value */
34359 - s8 temp_high[3]; /* Register value */
34360 - s8 temp_low[3]; /* Register value */
34361 + u8 temp[3]; /* Register value */
34362 + u8 temp_high[3]; /* Register value */
34363 + u8 temp_low[3]; /* Register value */
34364 u8 sensor; /* Register value */
34365 u8 fan_div[3]; /* Register encoding, shifted right */
34366 u8 vid; /* Register encoding, combined */
34367 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/hwmon/Kconfig linux-2.6.29-rc3.owrt/drivers/hwmon/Kconfig
34368 --- linux-2.6.29.owrt/drivers/hwmon/Kconfig 2009-05-10 22:04:39.000000000 +0200
34369 +++ linux-2.6.29-rc3.owrt/drivers/hwmon/Kconfig 2009-05-10 23:48:28.000000000 +0200
34370 @@ -543,8 +543,8 @@
34371 help
34372 If you say yes here you get support for National Semiconductor LM90,
34373 LM86, LM89 and LM99, Analog Devices ADM1032 and ADT7461, and Maxim
34374 - MAX6646, MAX6647, MAX6648, MAX6649, MAX6657, MAX6658, MAX6659,
34375 - MAX6680, MAX6681 and MAX6692 sensor chips.
34376 + MAX6646, MAX6647, MAX6649, MAX6657, MAX6658, MAX6659, MAX6680 and
34377 + MAX6681 sensor chips.
34378
34379 This driver can also be built as a module. If so, the module
34380 will be called lm90.
34381 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/hwmon/lis3lv02d.c linux-2.6.29-rc3.owrt/drivers/hwmon/lis3lv02d.c
34382 --- linux-2.6.29.owrt/drivers/hwmon/lis3lv02d.c 2009-05-10 22:04:39.000000000 +0200
34383 +++ linux-2.6.29-rc3.owrt/drivers/hwmon/lis3lv02d.c 2009-05-10 23:48:28.000000000 +0200
34384 @@ -3,7 +3,7 @@
34385 *
34386 * Copyright (C) 2007-2008 Yan Burman
34387 * Copyright (C) 2008 Eric Piel
34388 - * Copyright (C) 2008-2009 Pavel Machek
34389 + * Copyright (C) 2008 Pavel Machek
34390 *
34391 * This program is free software; you can redistribute it and/or modify
34392 * it under the terms of the GNU General Public License as published by
34393 @@ -35,7 +35,6 @@
34394 #include <linux/poll.h>
34395 #include <linux/freezer.h>
34396 #include <linux/uaccess.h>
34397 -#include <linux/miscdevice.h>
34398 #include <acpi/acpi_drivers.h>
34399 #include <asm/atomic.h>
34400 #include "lis3lv02d.h"
34401 @@ -53,14 +52,24 @@
34402 * joystick.
34403 */
34404
34405 -struct acpi_lis3lv02d adev = {
34406 - .misc_wait = __WAIT_QUEUE_HEAD_INITIALIZER(adev.misc_wait),
34407 -};
34408 +/* Maximum value our axis may get for the input device (signed 12 bits) */
34409 +#define MDPS_MAX_VAL 2048
34410
34411 +struct acpi_lis3lv02d adev;
34412 EXPORT_SYMBOL_GPL(adev);
34413
34414 static int lis3lv02d_add_fs(struct acpi_device *device);
34415
34416 +static s16 lis3lv02d_read_16(acpi_handle handle, int reg)
34417 +{
34418 + u8 lo, hi;
34419 +
34420 + adev.read(handle, reg, &lo);
34421 + adev.read(handle, reg + 1, &hi);
34422 + /* In "12 bit right justified" mode, bit 6, bit 7, bit 8 = bit 5 */
34423 + return (s16)((hi << 8) | lo);
34424 +}
34425 +
34426 /**
34427 * lis3lv02d_get_axis - For the given axis, give the value converted
34428 * @axis: 1,2,3 - can also be negative
34429 @@ -89,9 +98,9 @@
34430 {
34431 int position[3];
34432
34433 - position[0] = adev.read_data(handle, OUTX);
34434 - position[1] = adev.read_data(handle, OUTY);
34435 - position[2] = adev.read_data(handle, OUTZ);
34436 + position[0] = lis3lv02d_read_16(handle, OUTX_L);
34437 + position[1] = lis3lv02d_read_16(handle, OUTY_L);
34438 + position[2] = lis3lv02d_read_16(handle, OUTZ_L);
34439
34440 *x = lis3lv02d_get_axis(adev.ac.x, position);
34441 *y = lis3lv02d_get_axis(adev.ac.y, position);
34442 @@ -101,13 +110,26 @@
34443 void lis3lv02d_poweroff(acpi_handle handle)
34444 {
34445 adev.is_on = 0;
34446 + /* disable X,Y,Z axis and power down */
34447 + adev.write(handle, CTRL_REG1, 0x00);
34448 }
34449 EXPORT_SYMBOL_GPL(lis3lv02d_poweroff);
34450
34451 void lis3lv02d_poweron(acpi_handle handle)
34452 {
34453 + u8 val;
34454 +
34455 adev.is_on = 1;
34456 adev.init(handle);
34457 + adev.write(handle, FF_WU_CFG, 0);
34458 + /*
34459 + * BDU: LSB and MSB values are not updated until both have been read.
34460 + * So the value read will always be correct.
34461 + * IEN: Interrupt for free-fall and DD, not for data-ready.
34462 + */
34463 + adev.read(handle, CTRL_REG2, &val);
34464 + val |= CTRL2_BDU | CTRL2_IEN;
34465 + adev.write(handle, CTRL_REG2, val);
34466 }
34467 EXPORT_SYMBOL_GPL(lis3lv02d_poweron);
34468
34469 @@ -140,140 +162,6 @@
34470 mutex_unlock(&dev->lock);
34471 }
34472
34473 -static irqreturn_t lis302dl_interrupt(int irq, void *dummy)
34474 -{
34475 - /*
34476 - * Be careful: on some HP laptops the bios force DD when on battery and
34477 - * the lid is closed. This leads to interrupts as soon as a little move
34478 - * is done.
34479 - */
34480 - atomic_inc(&adev.count);
34481 -
34482 - wake_up_interruptible(&adev.misc_wait);
34483 - kill_fasync(&adev.async_queue, SIGIO, POLL_IN);
34484 - return IRQ_HANDLED;
34485 -}
34486 -
34487 -static int lis3lv02d_misc_open(struct inode *inode, struct file *file)
34488 -{
34489 - int ret;
34490 -
34491 - if (test_and_set_bit(0, &adev.misc_opened))
34492 - return -EBUSY; /* already open */
34493 -
34494 - atomic_set(&adev.count, 0);
34495 -
34496 - /*
34497 - * The sensor can generate interrupts for free-fall and direction
34498 - * detection (distinguishable with FF_WU_SRC and DD_SRC) but to keep
34499 - * the things simple and _fast_ we activate it only for free-fall, so
34500 - * no need to read register (very slow with ACPI). For the same reason,
34501 - * we forbid shared interrupts.
34502 - *
34503 - * IRQF_TRIGGER_RISING seems pointless on HP laptops because the
34504 - * io-apic is not configurable (and generates a warning) but I keep it
34505 - * in case of support for other hardware.
34506 - */
34507 - ret = request_irq(adev.irq, lis302dl_interrupt, IRQF_TRIGGER_RISING,
34508 - DRIVER_NAME, &adev);
34509 -
34510 - if (ret) {
34511 - clear_bit(0, &adev.misc_opened);
34512 - printk(KERN_ERR DRIVER_NAME ": IRQ%d allocation failed\n", adev.irq);
34513 - return -EBUSY;
34514 - }
34515 - lis3lv02d_increase_use(&adev);
34516 - printk("lis3: registered interrupt %d\n", adev.irq);
34517 - return 0;
34518 -}
34519 -
34520 -static int lis3lv02d_misc_release(struct inode *inode, struct file *file)
34521 -{
34522 - fasync_helper(-1, file, 0, &adev.async_queue);
34523 - lis3lv02d_decrease_use(&adev);
34524 - free_irq(adev.irq, &adev);
34525 - clear_bit(0, &adev.misc_opened); /* release the device */
34526 - return 0;
34527 -}
34528 -
34529 -static ssize_t lis3lv02d_misc_read(struct file *file, char __user *buf,
34530 - size_t count, loff_t *pos)
34531 -{
34532 - DECLARE_WAITQUEUE(wait, current);
34533 - u32 data;
34534 - unsigned char byte_data;
34535 - ssize_t retval = 1;
34536 -
34537 - if (count < 1)
34538 - return -EINVAL;
34539 -
34540 - add_wait_queue(&adev.misc_wait, &wait);
34541 - while (true) {
34542 - set_current_state(TASK_INTERRUPTIBLE);
34543 - data = atomic_xchg(&adev.count, 0);
34544 - if (data)
34545 - break;
34546 -
34547 - if (file->f_flags & O_NONBLOCK) {
34548 - retval = -EAGAIN;
34549 - goto out;
34550 - }
34551 -
34552 - if (signal_pending(current)) {
34553 - retval = -ERESTARTSYS;
34554 - goto out;
34555 - }
34556 -
34557 - schedule();
34558 - }
34559 -
34560 - if (data < 255)
34561 - byte_data = data;
34562 - else
34563 - byte_data = 255;
34564 -
34565 - /* make sure we are not going into copy_to_user() with
34566 - * TASK_INTERRUPTIBLE state */
34567 - set_current_state(TASK_RUNNING);
34568 - if (copy_to_user(buf, &byte_data, sizeof(byte_data)))
34569 - retval = -EFAULT;
34570 -
34571 -out:
34572 - __set_current_state(TASK_RUNNING);
34573 - remove_wait_queue(&adev.misc_wait, &wait);
34574 -
34575 - return retval;
34576 -}
34577 -
34578 -static unsigned int lis3lv02d_misc_poll(struct file *file, poll_table *wait)
34579 -{
34580 - poll_wait(file, &adev.misc_wait, wait);
34581 - if (atomic_read(&adev.count))
34582 - return POLLIN | POLLRDNORM;
34583 - return 0;
34584 -}
34585 -
34586 -static int lis3lv02d_misc_fasync(int fd, struct file *file, int on)
34587 -{
34588 - return fasync_helper(fd, file, on, &adev.async_queue);
34589 -}
34590 -
34591 -static const struct file_operations lis3lv02d_misc_fops = {
34592 - .owner = THIS_MODULE,
34593 - .llseek = no_llseek,
34594 - .read = lis3lv02d_misc_read,
34595 - .open = lis3lv02d_misc_open,
34596 - .release = lis3lv02d_misc_release,
34597 - .poll = lis3lv02d_misc_poll,
34598 - .fasync = lis3lv02d_misc_fasync,
34599 -};
34600 -
34601 -static struct miscdevice lis3lv02d_misc_device = {
34602 - .minor = MISC_DYNAMIC_MINOR,
34603 - .name = "freefall",
34604 - .fops = &lis3lv02d_misc_fops,
34605 -};
34606 -
34607 /**
34608 * lis3lv02d_joystick_kthread - Kthread polling function
34609 * @data: unused - here to conform to threadfn prototype
34610 @@ -315,6 +203,7 @@
34611 lis3lv02d_decrease_use(&adev);
34612 }
34613
34614 +
34615 static inline void lis3lv02d_calibrate_joystick(void)
34616 {
34617 lis3lv02d_get_xyz(adev.device->handle, &adev.xcalib, &adev.ycalib, &adev.zcalib);
34618 @@ -342,9 +231,9 @@
34619 adev.idev->close = lis3lv02d_joystick_close;
34620
34621 set_bit(EV_ABS, adev.idev->evbit);
34622 - input_set_abs_params(adev.idev, ABS_X, -adev.mdps_max_val, adev.mdps_max_val, 3, 3);
34623 - input_set_abs_params(adev.idev, ABS_Y, -adev.mdps_max_val, adev.mdps_max_val, 3, 3);
34624 - input_set_abs_params(adev.idev, ABS_Z, -adev.mdps_max_val, adev.mdps_max_val, 3, 3);
34625 + input_set_abs_params(adev.idev, ABS_X, -MDPS_MAX_VAL, MDPS_MAX_VAL, 3, 3);
34626 + input_set_abs_params(adev.idev, ABS_Y, -MDPS_MAX_VAL, MDPS_MAX_VAL, 3, 3);
34627 + input_set_abs_params(adev.idev, ABS_Z, -MDPS_MAX_VAL, MDPS_MAX_VAL, 3, 3);
34628
34629 err = input_register_device(adev.idev);
34630 if (err) {
34631 @@ -361,7 +250,6 @@
34632 if (!adev.idev)
34633 return;
34634
34635 - misc_deregister(&lis3lv02d_misc_device);
34636 input_unregister_device(adev.idev);
34637 adev.idev = NULL;
34638 }
34639 @@ -380,19 +268,6 @@
34640 if (lis3lv02d_joystick_enable())
34641 printk(KERN_ERR DRIVER_NAME ": joystick initialization failed\n");
34642
34643 - printk("lis3_init_device: irq %d\n", dev->irq);
34644 -
34645 - /* if we did not get an IRQ from ACPI - we have nothing more to do */
34646 - if (!dev->irq) {
34647 - printk(KERN_ERR DRIVER_NAME
34648 - ": No IRQ in ACPI. Disabling /dev/freefall\n");
34649 - goto out;
34650 - }
34651 -
34652 - printk("lis3: registering device\n");
34653 - if (misc_register(&lis3lv02d_misc_device))
34654 - printk(KERN_ERR DRIVER_NAME ": misc_register failed\n");
34655 -out:
34656 lis3lv02d_decrease_use(dev);
34657 return 0;
34658 }
34659 @@ -476,6 +351,6 @@
34660 EXPORT_SYMBOL_GPL(lis3lv02d_remove_fs);
34661
34662 MODULE_DESCRIPTION("ST LIS3LV02Dx three-axis digital accelerometer driver");
34663 -MODULE_AUTHOR("Yan Burman, Eric Piel, Pavel Machek");
34664 +MODULE_AUTHOR("Yan Burman and Eric Piel");
34665 MODULE_LICENSE("GPL");
34666
34667 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/hwmon/lis3lv02d.h linux-2.6.29-rc3.owrt/drivers/hwmon/lis3lv02d.h
34668 --- linux-2.6.29.owrt/drivers/hwmon/lis3lv02d.h 2009-05-10 22:04:39.000000000 +0200
34669 +++ linux-2.6.29-rc3.owrt/drivers/hwmon/lis3lv02d.h 2009-05-10 23:48:28.000000000 +0200
34670 @@ -22,15 +22,12 @@
34671 /*
34672 * The actual chip is STMicroelectronics LIS3LV02DL or LIS3LV02DQ that seems to
34673 * be connected via SPI. There exists also several similar chips (such as LIS302DL or
34674 - * LIS3L02DQ) and they have slightly different registers, but we can provide a
34675 - * common interface for all of them.
34676 + * LIS3L02DQ) but not in the HP laptops and they have slightly different registers.
34677 * They can also be connected via I²C.
34678 */
34679
34680 -/* 2-byte registers */
34681 -#define LIS_DOUBLE_ID 0x3A /* LIS3LV02D[LQ] */
34682 -/* 1-byte registers */
34683 -#define LIS_SINGLE_ID 0x3B /* LIS[32]02DL and others */
34684 +#define LIS3LV02DL_ID 0x3A /* Also the LIS3LV02DQ */
34685 +#define LIS302DL_ID 0x3B /* Also the LIS202DL! */
34686
34687 enum lis3lv02d_reg {
34688 WHO_AM_I = 0x0F,
34689 @@ -47,13 +44,10 @@
34690 STATUS_REG = 0x27,
34691 OUTX_L = 0x28,
34692 OUTX_H = 0x29,
34693 - OUTX = 0x29,
34694 OUTY_L = 0x2A,
34695 OUTY_H = 0x2B,
34696 - OUTY = 0x2B,
34697 OUTZ_L = 0x2C,
34698 OUTZ_H = 0x2D,
34699 - OUTZ = 0x2D,
34700 FF_WU_CFG = 0x30,
34701 FF_WU_SRC = 0x31,
34702 FF_WU_ACK = 0x32,
34703 @@ -165,10 +159,6 @@
34704 acpi_status (*write) (acpi_handle handle, int reg, u8 val);
34705 acpi_status (*read) (acpi_handle handle, int reg, u8 *ret);
34706
34707 - u8 whoami; /* 3Ah: 2-byte registries, 3Bh: 1-byte registries */
34708 - s16 (*read_data) (acpi_handle handle, int reg);
34709 - int mdps_max_val;
34710 -
34711 struct input_dev *idev; /* input device */
34712 struct task_struct *kthread; /* kthread for input */
34713 struct mutex lock;
34714 @@ -180,11 +170,6 @@
34715 unsigned char is_on; /* whether the device is on or off */
34716 unsigned char usage; /* usage counter */
34717 struct axis_conversion ac; /* hw -> logical axis */
34718 -
34719 - u32 irq; /* IRQ number */
34720 - struct fasync_struct *async_queue; /* queue for the misc device */
34721 - wait_queue_head_t misc_wait; /* Wait queue for the misc device */
34722 - unsigned long misc_opened; /* bit0: whether the device is open */
34723 };
34724
34725 int lis3lv02d_init_device(struct acpi_lis3lv02d *dev);
34726 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/hwmon/lm85.c linux-2.6.29-rc3.owrt/drivers/hwmon/lm85.c
34727 --- linux-2.6.29.owrt/drivers/hwmon/lm85.c 2009-05-10 22:04:39.000000000 +0200
34728 +++ linux-2.6.29-rc3.owrt/drivers/hwmon/lm85.c 2009-05-10 23:48:28.000000000 +0200
34729 @@ -72,7 +72,6 @@
34730 #define LM85_COMPANY_SMSC 0x5c
34731 #define LM85_VERSTEP_VMASK 0xf0
34732 #define LM85_VERSTEP_GENERIC 0x60
34733 -#define LM85_VERSTEP_GENERIC2 0x70
34734 #define LM85_VERSTEP_LM85C 0x60
34735 #define LM85_VERSTEP_LM85B 0x62
34736 #define LM85_VERSTEP_ADM1027 0x60
34737 @@ -335,7 +334,6 @@
34738 static const struct i2c_device_id lm85_id[] = {
34739 { "adm1027", adm1027 },
34740 { "adt7463", adt7463 },
34741 - { "adt7468", adt7468 },
34742 { "lm85", any_chip },
34743 { "lm85b", lm85b },
34744 { "lm85c", lm85c },
34745 @@ -410,8 +408,7 @@
34746 struct lm85_data *data = lm85_update_device(dev);
34747 int vid;
34748
34749 - if ((data->type == adt7463 || data->type == adt7468) &&
34750 - (data->vid & 0x80)) {
34751 + if (data->type == adt7463 && (data->vid & 0x80)) {
34752 /* 6-pin VID (VRM 10) */
34753 vid = vid_from_reg(data->vid & 0x3f, data->vrm);
34754 } else {
34755 @@ -1156,8 +1153,7 @@
34756 address, company, verstep);
34757
34758 /* All supported chips have the version in common */
34759 - if ((verstep & LM85_VERSTEP_VMASK) != LM85_VERSTEP_GENERIC &&
34760 - (verstep & LM85_VERSTEP_VMASK) != LM85_VERSTEP_GENERIC2) {
34761 + if ((verstep & LM85_VERSTEP_VMASK) != LM85_VERSTEP_GENERIC) {
34762 dev_dbg(&adapter->dev, "Autodetection failed: "
34763 "unsupported version\n");
34764 return -ENODEV;
34765 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/hwmon/lm90.c linux-2.6.29-rc3.owrt/drivers/hwmon/lm90.c
34766 --- linux-2.6.29.owrt/drivers/hwmon/lm90.c 2009-05-10 22:04:39.000000000 +0200
34767 +++ linux-2.6.29-rc3.owrt/drivers/hwmon/lm90.c 2009-05-10 23:48:28.000000000 +0200
34768 @@ -32,10 +32,10 @@
34769 * supported by this driver. These chips lack the remote temperature
34770 * offset feature.
34771 *
34772 - * This driver also supports the MAX6646, MAX6647, MAX6648, MAX6649 and
34773 - * MAX6692 chips made by Maxim. These are again similar to the LM86,
34774 - * but they use unsigned temperature values and can report temperatures
34775 - * from 0 to 145 degrees.
34776 + * This driver also supports the MAX6646, MAX6647 and MAX6649 chips
34777 + * made by Maxim. These are again similar to the LM86, but they use
34778 + * unsigned temperature values and can report temperatures from 0 to
34779 + * 145 degrees.
34780 *
34781 * This driver also supports the MAX6680 and MAX6681, two other sensor
34782 * chips made by Maxim. These are quite similar to the other Maxim
34783 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/hwmon/vt1211.c linux-2.6.29-rc3.owrt/drivers/hwmon/vt1211.c
34784 --- linux-2.6.29.owrt/drivers/hwmon/vt1211.c 2009-05-10 22:04:39.000000000 +0200
34785 +++ linux-2.6.29-rc3.owrt/drivers/hwmon/vt1211.c 2009-05-10 23:48:28.000000000 +0200
34786 @@ -1262,7 +1262,7 @@
34787 res.name = pdev->name;
34788 err = acpi_check_resource_conflict(&res);
34789 if (err)
34790 - goto EXIT_DEV_PUT;
34791 + goto EXIT;
34792
34793 err = platform_device_add_resources(pdev, &res, 1);
34794 if (err) {
34795 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/hwmon/w83627ehf.c linux-2.6.29-rc3.owrt/drivers/hwmon/w83627ehf.c
34796 --- linux-2.6.29.owrt/drivers/hwmon/w83627ehf.c 2009-05-10 22:04:39.000000000 +0200
34797 +++ linux-2.6.29-rc3.owrt/drivers/hwmon/w83627ehf.c 2009-05-10 23:48:28.000000000 +0200
34798 @@ -1548,7 +1548,7 @@
34799
34800 err = acpi_check_resource_conflict(&res);
34801 if (err)
34802 - goto exit_device_put;
34803 + goto exit;
34804
34805 err = platform_device_add_resources(pdev, &res, 1);
34806 if (err) {
34807 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/i2c/busses/i2c-acorn.c linux-2.6.29-rc3.owrt/drivers/i2c/busses/i2c-acorn.c
34808 --- linux-2.6.29.owrt/drivers/i2c/busses/i2c-acorn.c 2009-05-10 22:04:39.000000000 +0200
34809 +++ linux-2.6.29-rc3.owrt/drivers/i2c/busses/i2c-acorn.c 2009-05-10 23:48:28.000000000 +0200
34810 @@ -79,11 +79,10 @@
34811 .getsda = ioc_getsda,
34812 .getscl = ioc_getscl,
34813 .udelay = 80,
34814 - .timeout = HZ,
34815 + .timeout = 100
34816 };
34817
34818 static struct i2c_adapter ioc_ops = {
34819 - .nr = 0,
34820 .algo_data = &ioc_data,
34821 };
34822
34823 @@ -91,7 +90,7 @@
34824 {
34825 force_ones = FORCE_ONES | SCL | SDA;
34826
34827 - return i2c_bit_add_numbered_bus(&ioc_ops);
34828 + return i2c_bit_add_bus(&ioc_ops);
34829 }
34830
34831 module_init(i2c_ioc_init);
34832 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/i2c/busses/i2c-amd8111.c linux-2.6.29-rc3.owrt/drivers/i2c/busses/i2c-amd8111.c
34833 --- linux-2.6.29.owrt/drivers/i2c/busses/i2c-amd8111.c 2009-05-10 22:04:39.000000000 +0200
34834 +++ linux-2.6.29-rc3.owrt/drivers/i2c/busses/i2c-amd8111.c 2009-05-10 23:48:28.000000000 +0200
34835 @@ -72,7 +72,7 @@
34836 {
34837 int timeout = 500;
34838
34839 - while ((inb(smbus->base + AMD_EC_SC) & AMD_EC_SC_IBF) && --timeout)
34840 + while (timeout-- && (inb(smbus->base + AMD_EC_SC) & AMD_EC_SC_IBF))
34841 udelay(1);
34842
34843 if (!timeout) {
34844 @@ -88,7 +88,7 @@
34845 {
34846 int timeout = 500;
34847
34848 - while ((~inb(smbus->base + AMD_EC_SC) & AMD_EC_SC_OBF) && --timeout)
34849 + while (timeout-- && (~inb(smbus->base + AMD_EC_SC) & AMD_EC_SC_OBF))
34850 udelay(1);
34851
34852 if (!timeout) {
34853 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/i2c/busses/i2c-ixp2000.c linux-2.6.29-rc3.owrt/drivers/i2c/busses/i2c-ixp2000.c
34854 --- linux-2.6.29.owrt/drivers/i2c/busses/i2c-ixp2000.c 2009-05-10 22:04:39.000000000 +0200
34855 +++ linux-2.6.29-rc3.owrt/drivers/i2c/busses/i2c-ixp2000.c 2009-05-10 23:48:28.000000000 +0200
34856 @@ -114,7 +114,7 @@
34857 drv_data->algo_data.getsda = ixp2000_bit_getsda;
34858 drv_data->algo_data.getscl = ixp2000_bit_getscl;
34859 drv_data->algo_data.udelay = 6;
34860 - drv_data->algo_data.timeout = HZ;
34861 + drv_data->algo_data.timeout = 100;
34862
34863 strlcpy(drv_data->adapter.name, plat_dev->dev.driver->name,
34864 sizeof(drv_data->adapter.name));
34865 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/i2c/busses/i2c-mv64xxx.c linux-2.6.29-rc3.owrt/drivers/i2c/busses/i2c-mv64xxx.c
34866 --- linux-2.6.29.owrt/drivers/i2c/busses/i2c-mv64xxx.c 2009-05-10 22:04:39.000000000 +0200
34867 +++ linux-2.6.29-rc3.owrt/drivers/i2c/busses/i2c-mv64xxx.c 2009-05-10 23:48:28.000000000 +0200
34868 @@ -482,7 +482,7 @@
34869 return 0;
34870 }
34871
34872 -static void
34873 +static void __devexit
34874 mv64xxx_i2c_unmap_regs(struct mv64xxx_i2c_data *drv_data)
34875 {
34876 if (drv_data->reg_base) {
34877 @@ -577,7 +577,7 @@
34878
34879 static struct platform_driver mv64xxx_i2c_driver = {
34880 .probe = mv64xxx_i2c_probe,
34881 - .remove = __devexit_p(mv64xxx_i2c_remove),
34882 + .remove = mv64xxx_i2c_remove,
34883 .driver = {
34884 .owner = THIS_MODULE,
34885 .name = MV64XXX_I2C_CTLR_NAME,
34886 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/i2c/busses/i2c-pxa.c linux-2.6.29-rc3.owrt/drivers/i2c/busses/i2c-pxa.c
34887 --- linux-2.6.29.owrt/drivers/i2c/busses/i2c-pxa.c 2009-05-10 22:04:39.000000000 +0200
34888 +++ linux-2.6.29-rc3.owrt/drivers/i2c/busses/i2c-pxa.c 2009-05-10 23:48:28.000000000 +0200
34889 @@ -644,7 +644,7 @@
34890
34891 i2c_pxa_start_message(i2c);
34892
34893 - while (i2c->msg_num > 0 && --timeout) {
34894 + while (timeout-- && i2c->msg_num > 0) {
34895 i2c_pxa_handler(0, i2c);
34896 udelay(10);
34897 }
34898 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/i2c/busses/scx200_i2c.c linux-2.6.29-rc3.owrt/drivers/i2c/busses/scx200_i2c.c
34899 --- linux-2.6.29.owrt/drivers/i2c/busses/scx200_i2c.c 2009-05-10 22:04:39.000000000 +0200
34900 +++ linux-2.6.29-rc3.owrt/drivers/i2c/busses/scx200_i2c.c 2009-05-10 23:48:28.000000000 +0200
34901 @@ -76,7 +76,7 @@
34902 .getsda = scx200_i2c_getsda,
34903 .getscl = scx200_i2c_getscl,
34904 .udelay = 10,
34905 - .timeout = HZ,
34906 + .timeout = 100,
34907 };
34908
34909 static struct i2c_adapter scx200_i2c_ops = {
34910 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/i2c/i2c-core.c linux-2.6.29-rc3.owrt/drivers/i2c/i2c-core.c
34911 --- linux-2.6.29.owrt/drivers/i2c/i2c-core.c 2009-05-10 22:04:39.000000000 +0200
34912 +++ linux-2.6.29-rc3.owrt/drivers/i2c/i2c-core.c 2009-05-10 23:48:28.000000000 +0200
34913 @@ -1831,8 +1831,7 @@
34914 case I2C_SMBUS_QUICK:
34915 msg[0].len = 0;
34916 /* Special case: The read/write field is used as data */
34917 - msg[0].flags = flags | (read_write == I2C_SMBUS_READ ?
34918 - I2C_M_RD : 0);
34919 + msg[0].flags = flags | (read_write==I2C_SMBUS_READ)?I2C_M_RD:0;
34920 num = 1;
34921 break;
34922 case I2C_SMBUS_BYTE:
34923 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/i2c/i2c-dev.c linux-2.6.29-rc3.owrt/drivers/i2c/i2c-dev.c
34924 --- linux-2.6.29.owrt/drivers/i2c/i2c-dev.c 2009-05-10 22:04:39.000000000 +0200
34925 +++ linux-2.6.29-rc3.owrt/drivers/i2c/i2c-dev.c 2009-05-10 23:48:28.000000000 +0200
34926 @@ -35,7 +35,6 @@
34927 #include <linux/i2c.h>
34928 #include <linux/i2c-dev.h>
34929 #include <linux/smp_lock.h>
34930 -#include <linux/jiffies.h>
34931 #include <asm/uaccess.h>
34932
34933 static struct i2c_driver i2cdev_driver;
34934 @@ -423,10 +422,7 @@
34935 client->adapter->retries = arg;
34936 break;
34937 case I2C_TIMEOUT:
34938 - /* For historical reasons, user-space sets the timeout
34939 - * value in units of 10 ms.
34940 - */
34941 - client->adapter->timeout = msecs_to_jiffies(arg * 10);
34942 + client->adapter->timeout = arg;
34943 break;
34944 default:
34945 /* NOTE: returning a fault code here could cause trouble
34946 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ide/amd74xx.c linux-2.6.29-rc3.owrt/drivers/ide/amd74xx.c
34947 --- linux-2.6.29.owrt/drivers/ide/amd74xx.c 2009-05-10 22:04:39.000000000 +0200
34948 +++ linux-2.6.29-rc3.owrt/drivers/ide/amd74xx.c 2009-05-10 23:48:28.000000000 +0200
34949 @@ -166,7 +166,7 @@
34950 * Check for broken FIFO support.
34951 */
34952 if (dev->vendor == PCI_VENDOR_ID_AMD &&
34953 - dev->device == PCI_DEVICE_ID_AMD_VIPER_7411)
34954 + dev->vendor == PCI_DEVICE_ID_AMD_VIPER_7411)
34955 t &= 0x0f;
34956 else
34957 t |= 0xf0;
34958 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ide/at91_ide.c linux-2.6.29-rc3.owrt/drivers/ide/at91_ide.c
34959 --- linux-2.6.29.owrt/drivers/ide/at91_ide.c 2009-05-10 22:04:39.000000000 +0200
34960 +++ linux-2.6.29-rc3.owrt/drivers/ide/at91_ide.c 1970-01-01 01:00:00.000000000 +0100
34961 @@ -1,467 +0,0 @@
34962 -/*
34963 - * IDE host driver for AT91 (SAM9, CAP9, AT572D940HF) Static Memory Controller
34964 - * with Compact Flash True IDE logic
34965 - *
34966 - * Copyright (c) 2008, 2009 Kelvatek Ltd.
34967 - *
34968 - * This program is free software; you can redistribute it and/or modify
34969 - * it under the terms of the GNU General Public License as published by
34970 - * the Free Software Foundation; either version 2 of the License, or
34971 - * (at your option) any later version.
34972 - *
34973 - * This program is distributed in the hope that it will be useful,
34974 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
34975 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34976 - * GNU General Public License for more details.
34977 - *
34978 - * You should have received a copy of the GNU General Public License
34979 - * along with this program; if not, write to the Free Software
34980 - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
34981 - *
34982 - */
34983 -
34984 -#include <linux/version.h>
34985 -#include <linux/kernel.h>
34986 -#include <linux/module.h>
34987 -#include <linux/clk.h>
34988 -#include <linux/err.h>
34989 -#include <linux/ide.h>
34990 -#include <linux/platform_device.h>
34991 -
34992 -#include <mach/board.h>
34993 -#include <mach/gpio.h>
34994 -#include <mach/at91sam9263.h>
34995 -#include <mach/at91sam9_smc.h>
34996 -#include <mach/at91sam9263_matrix.h>
34997 -
34998 -#define DRV_NAME "at91_ide"
34999 -
35000 -#define perr(fmt, args...) pr_err(DRV_NAME ": " fmt, ##args)
35001 -#define pdbg(fmt, args...) pr_debug("%s " fmt, __func__, ##args)
35002 -
35003 -/*
35004 - * Access to IDE device is possible through EBI Static Memory Controller
35005 - * with Compact Flash logic. For details see EBI and SMC datasheet sections
35006 - * of any microcontroller from AT91SAM9 family.
35007 - *
35008 - * Within SMC chip select address space, lines A[23:21] distinguish Compact
35009 - * Flash modes (I/O, common memory, attribute memory, True IDE). IDE modes are:
35010 - * 0x00c0000 - True IDE
35011 - * 0x00e0000 - Alternate True IDE (Alt Status Register)
35012 - *
35013 - * On True IDE mode Task File and Data Register are mapped at the same address.
35014 - * To distinguish access between these two different bus data width is used:
35015 - * 8Bit for Task File, 16Bit for Data I/O.
35016 - *
35017 - * After initialization we do 8/16 bit flipping (changes in SMC MODE register)
35018 - * only inside IDE callback routines which are serialized by IDE layer,
35019 - * so no additional locking needed.
35020 - */
35021 -
35022 -#define TASK_FILE 0x00c00000
35023 -#define ALT_MODE 0x00e00000
35024 -#define REGS_SIZE 8
35025 -
35026 -#define enter_16bit(cs, mode) do { \
35027 - mode = at91_sys_read(AT91_SMC_MODE(cs)); \
35028 - at91_sys_write(AT91_SMC_MODE(cs), mode | AT91_SMC_DBW_16); \
35029 -} while (0)
35030 -
35031 -#define leave_16bit(cs, mode) at91_sys_write(AT91_SMC_MODE(cs), mode);
35032 -
35033 -static void set_smc_timings(const u8 chipselect, const u16 cycle,
35034 - const u16 setup, const u16 pulse,
35035 - const u16 data_float, int use_iordy)
35036 -{
35037 - unsigned long mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
35038 - AT91_SMC_BAT_SELECT;
35039 -
35040 - /* disable or enable waiting for IORDY signal */
35041 - if (use_iordy)
35042 - mode |= AT91_SMC_EXNWMODE_READY;
35043 -
35044 - /* add data float cycles if needed */
35045 - if (data_float)
35046 - mode |= AT91_SMC_TDF_(data_float);
35047 -
35048 - at91_sys_write(AT91_SMC_MODE(chipselect), mode);
35049 -
35050 - /* setup timings in SMC */
35051 - at91_sys_write(AT91_SMC_SETUP(chipselect), AT91_SMC_NWESETUP_(setup) |
35052 - AT91_SMC_NCS_WRSETUP_(0) |
35053 - AT91_SMC_NRDSETUP_(setup) |
35054 - AT91_SMC_NCS_RDSETUP_(0));
35055 - at91_sys_write(AT91_SMC_PULSE(chipselect), AT91_SMC_NWEPULSE_(pulse) |
35056 - AT91_SMC_NCS_WRPULSE_(cycle) |
35057 - AT91_SMC_NRDPULSE_(pulse) |
35058 - AT91_SMC_NCS_RDPULSE_(cycle));
35059 - at91_sys_write(AT91_SMC_CYCLE(chipselect), AT91_SMC_NWECYCLE_(cycle) |
35060 - AT91_SMC_NRDCYCLE_(cycle));
35061 -}
35062 -
35063 -static unsigned int calc_mck_cycles(unsigned int ns, unsigned int mck_hz)
35064 -{
35065 - u64 tmp = ns;
35066 -
35067 - tmp *= mck_hz;
35068 - tmp += 1000*1000*1000 - 1; /* round up */
35069 - do_div(tmp, 1000*1000*1000);
35070 - return (unsigned int) tmp;
35071 -}
35072 -
35073 -static void apply_timings(const u8 chipselect, const u8 pio,
35074 - const struct ide_timing *timing, int use_iordy)
35075 -{
35076 - unsigned int t0, t1, t2, t6z;
35077 - unsigned int cycle, setup, pulse, data_float;
35078 - unsigned int mck_hz;
35079 - struct clk *mck;
35080 -
35081 - /* see table 22 of Compact Flash standard 4.1 for the meaning,
35082 - * we do not stretch active (t2) time, so setup (t1) + hold time (th)
35083 - * assure at least minimal recovery (t2i) time */
35084 - t0 = timing->cyc8b;
35085 - t1 = timing->setup;
35086 - t2 = timing->act8b;
35087 - t6z = (pio < 5) ? 30 : 20;
35088 -
35089 - pdbg("t0=%u t1=%u t2=%u t6z=%u\n", t0, t1, t2, t6z);
35090 -
35091 - mck = clk_get(NULL, "mck");
35092 - BUG_ON(IS_ERR(mck));
35093 - mck_hz = clk_get_rate(mck);
35094 - pdbg("mck_hz=%u\n", mck_hz);
35095 -
35096 - cycle = calc_mck_cycles(t0, mck_hz);
35097 - setup = calc_mck_cycles(t1, mck_hz);
35098 - pulse = calc_mck_cycles(t2, mck_hz);
35099 - data_float = calc_mck_cycles(t6z, mck_hz);
35100 -
35101 - pdbg("cycle=%u setup=%u pulse=%u data_float=%u\n",
35102 - cycle, setup, pulse, data_float);
35103 -
35104 - set_smc_timings(chipselect, cycle, setup, pulse, data_float, use_iordy);
35105 -}
35106 -
35107 -static void at91_ide_input_data(ide_drive_t *drive, struct request *rq,
35108 - void *buf, unsigned int len)
35109 -{
35110 - ide_hwif_t *hwif = drive->hwif;
35111 - struct ide_io_ports *io_ports = &hwif->io_ports;
35112 - u8 chipselect = hwif->select_data;
35113 - unsigned long mode;
35114 -
35115 - pdbg("cs %u buf %p len %d\n", chipselect, buf, len);
35116 -
35117 - len++;
35118 -
35119 - enter_16bit(chipselect, mode);
35120 - __ide_mm_insw((void __iomem *) io_ports->data_addr, buf, len / 2);
35121 - leave_16bit(chipselect, mode);
35122 -}
35123 -
35124 -static void at91_ide_output_data(ide_drive_t *drive, struct request *rq,
35125 - void *buf, unsigned int len)
35126 -{
35127 - ide_hwif_t *hwif = drive->hwif;
35128 - struct ide_io_ports *io_ports = &hwif->io_ports;
35129 - u8 chipselect = hwif->select_data;
35130 - unsigned long mode;
35131 -
35132 - pdbg("cs %u buf %p len %d\n", chipselect, buf, len);
35133 -
35134 - enter_16bit(chipselect, mode);
35135 - __ide_mm_outsw((void __iomem *) io_ports->data_addr, buf, len / 2);
35136 - leave_16bit(chipselect, mode);
35137 -}
35138 -
35139 -static u8 ide_mm_inb(unsigned long port)
35140 -{
35141 - return readb((void __iomem *) port);
35142 -}
35143 -
35144 -static void ide_mm_outb(u8 value, unsigned long port)
35145 -{
35146 - writeb(value, (void __iomem *) port);
35147 -}
35148 -
35149 -static void at91_ide_tf_load(ide_drive_t *drive, ide_task_t *task)
35150 -{
35151 - ide_hwif_t *hwif = drive->hwif;
35152 - struct ide_io_ports *io_ports = &hwif->io_ports;
35153 - struct ide_taskfile *tf = &task->tf;
35154 - u8 HIHI = (task->tf_flags & IDE_TFLAG_LBA48) ? 0xE0 : 0xEF;
35155 -
35156 - if (task->tf_flags & IDE_TFLAG_FLAGGED)
35157 - HIHI = 0xFF;
35158 -
35159 - if (task->tf_flags & IDE_TFLAG_OUT_DATA) {
35160 - u16 data = (tf->hob_data << 8) | tf->data;
35161 -
35162 - at91_ide_output_data(drive, NULL, &data, 2);
35163 - }
35164 -
35165 - if (task->tf_flags & IDE_TFLAG_OUT_HOB_FEATURE)
35166 - ide_mm_outb(tf->hob_feature, io_ports->feature_addr);
35167 - if (task->tf_flags & IDE_TFLAG_OUT_HOB_NSECT)
35168 - ide_mm_outb(tf->hob_nsect, io_ports->nsect_addr);
35169 - if (task->tf_flags & IDE_TFLAG_OUT_HOB_LBAL)
35170 - ide_mm_outb(tf->hob_lbal, io_ports->lbal_addr);
35171 - if (task->tf_flags & IDE_TFLAG_OUT_HOB_LBAM)
35172 - ide_mm_outb(tf->hob_lbam, io_ports->lbam_addr);
35173 - if (task->tf_flags & IDE_TFLAG_OUT_HOB_LBAH)
35174 - ide_mm_outb(tf->hob_lbah, io_ports->lbah_addr);
35175 -
35176 - if (task->tf_flags & IDE_TFLAG_OUT_FEATURE)
35177 - ide_mm_outb(tf->feature, io_ports->feature_addr);
35178 - if (task->tf_flags & IDE_TFLAG_OUT_NSECT)
35179 - ide_mm_outb(tf->nsect, io_ports->nsect_addr);
35180 - if (task->tf_flags & IDE_TFLAG_OUT_LBAL)
35181 - ide_mm_outb(tf->lbal, io_ports->lbal_addr);
35182 - if (task->tf_flags & IDE_TFLAG_OUT_LBAM)
35183 - ide_mm_outb(tf->lbam, io_ports->lbam_addr);
35184 - if (task->tf_flags & IDE_TFLAG_OUT_LBAH)
35185 - ide_mm_outb(tf->lbah, io_ports->lbah_addr);
35186 -
35187 - if (task->tf_flags & IDE_TFLAG_OUT_DEVICE)
35188 - ide_mm_outb((tf->device & HIHI) | drive->select, io_ports->device_addr);
35189 -}
35190 -
35191 -static void at91_ide_tf_read(ide_drive_t *drive, ide_task_t *task)
35192 -{
35193 - ide_hwif_t *hwif = drive->hwif;
35194 - struct ide_io_ports *io_ports = &hwif->io_ports;
35195 - struct ide_taskfile *tf = &task->tf;
35196 -
35197 - if (task->tf_flags & IDE_TFLAG_IN_DATA) {
35198 - u16 data;
35199 -
35200 - at91_ide_input_data(drive, NULL, &data, 2);
35201 - tf->data = data & 0xff;
35202 - tf->hob_data = (data >> 8) & 0xff;
35203 - }
35204 -
35205 - /* be sure we're looking at the low order bits */
35206 - ide_mm_outb(ATA_DEVCTL_OBS & ~0x80, io_ports->ctl_addr);
35207 -
35208 - if (task->tf_flags & IDE_TFLAG_IN_FEATURE)
35209 - tf->feature = ide_mm_inb(io_ports->feature_addr);
35210 - if (task->tf_flags & IDE_TFLAG_IN_NSECT)
35211 - tf->nsect = ide_mm_inb(io_ports->nsect_addr);
35212 - if (task->tf_flags & IDE_TFLAG_IN_LBAL)
35213 - tf->lbal = ide_mm_inb(io_ports->lbal_addr);
35214 - if (task->tf_flags & IDE_TFLAG_IN_LBAM)
35215 - tf->lbam = ide_mm_inb(io_ports->lbam_addr);
35216 - if (task->tf_flags & IDE_TFLAG_IN_LBAH)
35217 - tf->lbah = ide_mm_inb(io_ports->lbah_addr);
35218 - if (task->tf_flags & IDE_TFLAG_IN_DEVICE)
35219 - tf->device = ide_mm_inb(io_ports->device_addr);
35220 -
35221 - if (task->tf_flags & IDE_TFLAG_LBA48) {
35222 - ide_mm_outb(ATA_DEVCTL_OBS | 0x80, io_ports->ctl_addr);
35223 -
35224 - if (task->tf_flags & IDE_TFLAG_IN_HOB_FEATURE)
35225 - tf->hob_feature = ide_mm_inb(io_ports->feature_addr);
35226 - if (task->tf_flags & IDE_TFLAG_IN_HOB_NSECT)
35227 - tf->hob_nsect = ide_mm_inb(io_ports->nsect_addr);
35228 - if (task->tf_flags & IDE_TFLAG_IN_HOB_LBAL)
35229 - tf->hob_lbal = ide_mm_inb(io_ports->lbal_addr);
35230 - if (task->tf_flags & IDE_TFLAG_IN_HOB_LBAM)
35231 - tf->hob_lbam = ide_mm_inb(io_ports->lbam_addr);
35232 - if (task->tf_flags & IDE_TFLAG_IN_HOB_LBAH)
35233 - tf->hob_lbah = ide_mm_inb(io_ports->lbah_addr);
35234 - }
35235 -}
35236 -
35237 -static void at91_ide_set_pio_mode(ide_drive_t *drive, const u8 pio)
35238 -{
35239 - struct ide_timing *timing;
35240 - u8 chipselect = drive->hwif->select_data;
35241 - int use_iordy = 0;
35242 -
35243 - pdbg("chipselect %u pio %u\n", chipselect, pio);
35244 -
35245 - timing = ide_timing_find_mode(XFER_PIO_0 + pio);
35246 - BUG_ON(!timing);
35247 -
35248 - if ((pio > 2 || ata_id_has_iordy(drive->id)) &&
35249 - !(ata_id_is_cfa(drive->id) && pio > 4))
35250 - use_iordy = 1;
35251 -
35252 - apply_timings(chipselect, pio, timing, use_iordy);
35253 -}
35254 -
35255 -static const struct ide_tp_ops at91_ide_tp_ops = {
35256 - .exec_command = ide_exec_command,
35257 - .read_status = ide_read_status,
35258 - .read_altstatus = ide_read_altstatus,
35259 - .set_irq = ide_set_irq,
35260 -
35261 - .tf_load = at91_ide_tf_load,
35262 - .tf_read = at91_ide_tf_read,
35263 -
35264 - .input_data = at91_ide_input_data,
35265 - .output_data = at91_ide_output_data,
35266 -};
35267 -
35268 -static const struct ide_port_ops at91_ide_port_ops = {
35269 - .set_pio_mode = at91_ide_set_pio_mode,
35270 -};
35271 -
35272 -static const struct ide_port_info at91_ide_port_info __initdata = {
35273 - .port_ops = &at91_ide_port_ops,
35274 - .tp_ops = &at91_ide_tp_ops,
35275 - .host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_NO_DMA | IDE_HFLAG_SINGLE |
35276 - IDE_HFLAG_NO_IO_32BIT | IDE_HFLAG_UNMASK_IRQS,
35277 - .pio_mask = ATA_PIO5,
35278 -};
35279 -
35280 -/*
35281 - * If interrupt is delivered through GPIO, IRQ are triggered on falling
35282 - * and rising edge of signal. Whereas IDE device request interrupt on high
35283 - * level (rising edge in our case). This mean we have fake interrupts, so
35284 - * we need to check interrupt pin and exit instantly from ISR when line
35285 - * is on low level.
35286 - */
35287 -
35288 -irqreturn_t at91_irq_handler(int irq, void *dev_id)
35289 -{
35290 - int ntries = 8;
35291 - int pin_val1, pin_val2;
35292 -
35293 - /* additional deglitch, line can be noisy in badly designed PCB */
35294 - do {
35295 - pin_val1 = at91_get_gpio_value(irq);
35296 - pin_val2 = at91_get_gpio_value(irq);
35297 - } while (pin_val1 != pin_val2 && --ntries > 0);
35298 -
35299 - if (pin_val1 == 0 || ntries <= 0)
35300 - return IRQ_HANDLED;
35301 -
35302 - return ide_intr(irq, dev_id);
35303 -}
35304 -
35305 -static int __init at91_ide_probe(struct platform_device *pdev)
35306 -{
35307 - int ret;
35308 - hw_regs_t hw;
35309 - hw_regs_t *hws[] = { &hw, NULL, NULL, NULL };
35310 - struct ide_host *host;
35311 - struct resource *res;
35312 - unsigned long tf_base = 0, ctl_base = 0;
35313 - struct at91_cf_data *board = pdev->dev.platform_data;
35314 -
35315 - if (!board)
35316 - return -ENODEV;
35317 -
35318 - if (board->det_pin && at91_get_gpio_value(board->det_pin) != 0) {
35319 - perr("no device detected\n");
35320 - return -ENODEV;
35321 - }
35322 -
35323 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
35324 - if (!res) {
35325 - perr("can't get memory resource\n");
35326 - return -ENODEV;
35327 - }
35328 -
35329 - if (!devm_request_mem_region(&pdev->dev, res->start + TASK_FILE,
35330 - REGS_SIZE, "ide") ||
35331 - !devm_request_mem_region(&pdev->dev, res->start + ALT_MODE,
35332 - REGS_SIZE, "alt")) {
35333 - perr("memory resources in use\n");
35334 - return -EBUSY;
35335 - }
35336 -
35337 - pdbg("chipselect %u irq %u res %08lx\n", board->chipselect,
35338 - board->irq_pin, (unsigned long) res->start);
35339 -
35340 - tf_base = (unsigned long) devm_ioremap(&pdev->dev, res->start + TASK_FILE,
35341 - REGS_SIZE);
35342 - ctl_base = (unsigned long) devm_ioremap(&pdev->dev, res->start + ALT_MODE,
35343 - REGS_SIZE);
35344 - if (!tf_base || !ctl_base) {
35345 - perr("can't map memory regions\n");
35346 - return -EBUSY;
35347 - }
35348 -
35349 - memset(&hw, 0, sizeof(hw));
35350 -
35351 - if (board->flags & AT91_IDE_SWAP_A0_A2) {
35352 - /* workaround for stupid hardware bug */
35353 - hw.io_ports.data_addr = tf_base + 0;
35354 - hw.io_ports.error_addr = tf_base + 4;
35355 - hw.io_ports.nsect_addr = tf_base + 2;
35356 - hw.io_ports.lbal_addr = tf_base + 6;
35357 - hw.io_ports.lbam_addr = tf_base + 1;
35358 - hw.io_ports.lbah_addr = tf_base + 5;
35359 - hw.io_ports.device_addr = tf_base + 3;
35360 - hw.io_ports.command_addr = tf_base + 7;
35361 - hw.io_ports.ctl_addr = ctl_base + 3;
35362 - } else
35363 - ide_std_init_ports(&hw, tf_base, ctl_base + 6);
35364 -
35365 - hw.irq = board->irq_pin;
35366 - hw.chipset = ide_generic;
35367 - hw.dev = &pdev->dev;
35368 -
35369 - host = ide_host_alloc(&at91_ide_port_info, hws);
35370 - if (!host) {
35371 - perr("failed to allocate ide host\n");
35372 - return -ENOMEM;
35373 - }
35374 -
35375 - /* setup Static Memory Controller - PIO 0 as default */
35376 - apply_timings(board->chipselect, 0, ide_timing_find_mode(XFER_PIO_0), 0);
35377 -
35378 - /* with GPIO interrupt we have to do quirks in handler */
35379 - if (board->irq_pin >= PIN_BASE)
35380 - host->irq_handler = at91_irq_handler;
35381 -
35382 - host->ports[0]->select_data = board->chipselect;
35383 -
35384 - ret = ide_host_register(host, &at91_ide_port_info, hws);
35385 - if (ret) {
35386 - perr("failed to register ide host\n");
35387 - goto err_free_host;
35388 - }
35389 - platform_set_drvdata(pdev, host);
35390 - return 0;
35391 -
35392 -err_free_host:
35393 - ide_host_free(host);
35394 - return ret;
35395 -}
35396 -
35397 -static int __exit at91_ide_remove(struct platform_device *pdev)
35398 -{
35399 - struct ide_host *host = platform_get_drvdata(pdev);
35400 -
35401 - ide_host_remove(host);
35402 - return 0;
35403 -}
35404 -
35405 -static struct platform_driver at91_ide_driver = {
35406 - .driver = {
35407 - .name = DRV_NAME,
35408 - .owner = THIS_MODULE,
35409 - },
35410 - .remove = __exit_p(at91_ide_remove),
35411 -};
35412 -
35413 -static int __init at91_ide_init(void)
35414 -{
35415 - return platform_driver_probe(&at91_ide_driver, at91_ide_probe);
35416 -}
35417 -
35418 -static void __exit at91_ide_exit(void)
35419 -{
35420 - platform_driver_unregister(&at91_ide_driver);
35421 -}
35422 -
35423 -module_init(at91_ide_init);
35424 -module_exit(at91_ide_exit);
35425 -
35426 -MODULE_LICENSE("GPL");
35427 -MODULE_AUTHOR("Stanislaw Gruszka <stf_xl@wp.pl>");
35428 -
35429 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ide/atiixp.c linux-2.6.29-rc3.owrt/drivers/ide/atiixp.c
35430 --- linux-2.6.29.owrt/drivers/ide/atiixp.c 2009-05-10 22:04:39.000000000 +0200
35431 +++ linux-2.6.29-rc3.owrt/drivers/ide/atiixp.c 2009-05-10 23:48:28.000000000 +0200
35432 @@ -52,7 +52,7 @@
35433 {
35434 struct pci_dev *dev = to_pci_dev(drive->hwif->dev);
35435 unsigned long flags;
35436 - int timing_shift = (drive->dn ^ 1) * 8;
35437 + int timing_shift = (drive->dn & 2) ? 16 : 0 + (drive->dn & 1) ? 0 : 8;
35438 u32 pio_timing_data;
35439 u16 pio_mode_data;
35440
35441 @@ -85,7 +85,7 @@
35442 {
35443 struct pci_dev *dev = to_pci_dev(drive->hwif->dev);
35444 unsigned long flags;
35445 - int timing_shift = (drive->dn ^ 1) * 8;
35446 + int timing_shift = (drive->dn & 2) ? 16 : 0 + (drive->dn & 1) ? 0 : 8;
35447 u32 tmp32;
35448 u16 tmp16;
35449 u16 udma_ctl = 0;
35450 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ide/cs5536.c linux-2.6.29-rc3.owrt/drivers/ide/cs5536.c
35451 --- linux-2.6.29.owrt/drivers/ide/cs5536.c 2009-05-10 22:04:39.000000000 +0200
35452 +++ linux-2.6.29-rc3.owrt/drivers/ide/cs5536.c 1970-01-01 01:00:00.000000000 +0100
35453 @@ -1,308 +0,0 @@
35454 -/*
35455 - * CS5536 PATA support
35456 - * (C) 2007 Martin K. Petersen <mkp@mkp.net>
35457 - * (C) 2009 Bartlomiej Zolnierkiewicz
35458 - *
35459 - * This program is free software; you can redistribute it and/or modify
35460 - * it under the terms of the GNU General Public License version 2 as
35461 - * published by the Free Software Foundation.
35462 - *
35463 - * This program is distributed in the hope that it will be useful,
35464 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
35465 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
35466 - * GNU General Public License for more details.
35467 - *
35468 - * You should have received a copy of the GNU General Public License
35469 - * along with this program; if not, write to the Free Software
35470 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
35471 - *
35472 - * Documentation:
35473 - * Available from AMD web site.
35474 - *
35475 - * The IDE timing registers for the CS5536 live in the Geode Machine
35476 - * Specific Register file and not PCI config space. Most BIOSes
35477 - * virtualize the PCI registers so the chip looks like a standard IDE
35478 - * controller. Unfortunately not all implementations get this right.
35479 - * In particular some have problems with unaligned accesses to the
35480 - * virtualized PCI registers. This driver always does full dword
35481 - * writes to work around the issue. Also, in case of a bad BIOS this
35482 - * driver can be loaded with the "msr=1" parameter which forces using
35483 - * the Machine Specific Registers to configure the device.
35484 - */
35485 -
35486 -#include <linux/kernel.h>
35487 -#include <linux/module.h>
35488 -#include <linux/pci.h>
35489 -#include <linux/init.h>
35490 -#include <linux/ide.h>
35491 -#include <asm/msr.h>
35492 -
35493 -#define DRV_NAME "cs5536"
35494 -
35495 -enum {
35496 - MSR_IDE_CFG = 0x51300010,
35497 - PCI_IDE_CFG = 0x40,
35498 -
35499 - CFG = 0,
35500 - DTC = 2,
35501 - CAST = 3,
35502 - ETC = 4,
35503 -
35504 - IDE_CFG_CHANEN = (1 << 1),
35505 - IDE_CFG_CABLE = (1 << 17) | (1 << 16),
35506 -
35507 - IDE_D0_SHIFT = 24,
35508 - IDE_D1_SHIFT = 16,
35509 - IDE_DRV_MASK = 0xff,
35510 -
35511 - IDE_CAST_D0_SHIFT = 6,
35512 - IDE_CAST_D1_SHIFT = 4,
35513 - IDE_CAST_DRV_MASK = 0x3,
35514 -
35515 - IDE_CAST_CMD_SHIFT = 24,
35516 - IDE_CAST_CMD_MASK = 0xff,
35517 -
35518 - IDE_ETC_UDMA_MASK = 0xc0,
35519 -};
35520 -
35521 -static int use_msr;
35522 -
35523 -static int cs5536_read(struct pci_dev *pdev, int reg, u32 *val)
35524 -{
35525 - if (unlikely(use_msr)) {
35526 - u32 dummy;
35527 -
35528 - rdmsr(MSR_IDE_CFG + reg, *val, dummy);
35529 - return 0;
35530 - }
35531 -
35532 - return pci_read_config_dword(pdev, PCI_IDE_CFG + reg * 4, val);
35533 -}
35534 -
35535 -static int cs5536_write(struct pci_dev *pdev, int reg, int val)
35536 -{
35537 - if (unlikely(use_msr)) {
35538 - wrmsr(MSR_IDE_CFG + reg, val, 0);
35539 - return 0;
35540 - }
35541 -
35542 - return pci_write_config_dword(pdev, PCI_IDE_CFG + reg * 4, val);
35543 -}
35544 -
35545 -static void cs5536_program_dtc(ide_drive_t *drive, u8 tim)
35546 -{
35547 - struct pci_dev *pdev = to_pci_dev(drive->hwif->dev);
35548 - int dshift = (drive->dn & 1) ? IDE_D1_SHIFT : IDE_D0_SHIFT;
35549 - u32 dtc;
35550 -
35551 - cs5536_read(pdev, DTC, &dtc);
35552 - dtc &= ~(IDE_DRV_MASK << dshift);
35553 - dtc |= tim << dshift;
35554 - cs5536_write(pdev, DTC, dtc);
35555 -}
35556 -
35557 -/**
35558 - * cs5536_cable_detect - detect cable type
35559 - * @hwif: Port to detect on
35560 - *
35561 - * Perform cable detection for ATA66 capable cable.
35562 - *
35563 - * Returns a cable type.
35564 - */
35565 -
35566 -static u8 cs5536_cable_detect(ide_hwif_t *hwif)
35567 -{
35568 - struct pci_dev *pdev = to_pci_dev(hwif->dev);
35569 - u32 cfg;
35570 -
35571 - cs5536_read(pdev, CFG, &cfg);
35572 -
35573 - if (cfg & IDE_CFG_CABLE)
35574 - return ATA_CBL_PATA80;
35575 - else
35576 - return ATA_CBL_PATA40;
35577 -}
35578 -
35579 -/**
35580 - * cs5536_set_pio_mode - PIO timing setup
35581 - * @drive: ATA device
35582 - * @pio: PIO mode number
35583 - */
35584 -
35585 -static void cs5536_set_pio_mode(ide_drive_t *drive, const u8 pio)
35586 -{
35587 - static const u8 drv_timings[5] = {
35588 - 0x98, 0x55, 0x32, 0x21, 0x20,
35589 - };
35590 -
35591 - static const u8 addr_timings[5] = {
35592 - 0x2, 0x1, 0x0, 0x0, 0x0,
35593 - };
35594 -
35595 - static const u8 cmd_timings[5] = {
35596 - 0x99, 0x92, 0x90, 0x22, 0x20,
35597 - };
35598 -
35599 - struct pci_dev *pdev = to_pci_dev(drive->hwif->dev);
35600 - ide_drive_t *pair = ide_get_pair_dev(drive);
35601 - int cshift = (drive->dn & 1) ? IDE_CAST_D1_SHIFT : IDE_CAST_D0_SHIFT;
35602 - u32 cast;
35603 - u8 cmd_pio = pio;
35604 -
35605 - if (pair)
35606 - cmd_pio = min(pio, ide_get_best_pio_mode(pair, 255, 4));
35607 -
35608 - drive->drive_data &= (IDE_DRV_MASK << 8);
35609 - drive->drive_data |= drv_timings[pio];
35610 -
35611 - cs5536_program_dtc(drive, drv_timings[pio]);
35612 -
35613 - cs5536_read(pdev, CAST, &cast);
35614 -
35615 - cast &= ~(IDE_CAST_DRV_MASK << cshift);
35616 - cast |= addr_timings[pio] << cshift;
35617 -
35618 - cast &= ~(IDE_CAST_CMD_MASK << IDE_CAST_CMD_SHIFT);
35619 - cast |= cmd_timings[cmd_pio] << IDE_CAST_CMD_SHIFT;
35620 -
35621 - cs5536_write(pdev, CAST, cast);
35622 -}
35623 -
35624 -/**
35625 - * cs5536_set_dma_mode - DMA timing setup
35626 - * @drive: ATA device
35627 - * @mode: DMA mode
35628 - */
35629 -
35630 -static void cs5536_set_dma_mode(ide_drive_t *drive, const u8 mode)
35631 -{
35632 - static const u8 udma_timings[6] = {
35633 - 0xc2, 0xc1, 0xc0, 0xc4, 0xc5, 0xc6,
35634 - };
35635 -
35636 - static const u8 mwdma_timings[3] = {
35637 - 0x67, 0x21, 0x20,
35638 - };
35639 -
35640 - struct pci_dev *pdev = to_pci_dev(drive->hwif->dev);
35641 - int dshift = (drive->dn & 1) ? IDE_D1_SHIFT : IDE_D0_SHIFT;
35642 - u32 etc;
35643 -
35644 - cs5536_read(pdev, ETC, &etc);
35645 -
35646 - if (mode >= XFER_UDMA_0) {
35647 - etc &= ~(IDE_DRV_MASK << dshift);
35648 - etc |= udma_timings[mode - XFER_UDMA_0] << dshift;
35649 - } else { /* MWDMA */
35650 - etc &= ~(IDE_ETC_UDMA_MASK << dshift);
35651 - drive->drive_data &= IDE_DRV_MASK;
35652 - drive->drive_data |= mwdma_timings[mode - XFER_MW_DMA_0] << 8;
35653 - }
35654 -
35655 - cs5536_write(pdev, ETC, etc);
35656 -}
35657 -
35658 -static void cs5536_dma_start(ide_drive_t *drive)
35659 -{
35660 - if (drive->current_speed < XFER_UDMA_0 &&
35661 - (drive->drive_data >> 8) != (drive->drive_data & IDE_DRV_MASK))
35662 - cs5536_program_dtc(drive, drive->drive_data >> 8);
35663 -
35664 - ide_dma_start(drive);
35665 -}
35666 -
35667 -static int cs5536_dma_end(ide_drive_t *drive)
35668 -{
35669 - int ret = ide_dma_end(drive);
35670 -
35671 - if (drive->current_speed < XFER_UDMA_0 &&
35672 - (drive->drive_data >> 8) != (drive->drive_data & IDE_DRV_MASK))
35673 - cs5536_program_dtc(drive, drive->drive_data & IDE_DRV_MASK);
35674 -
35675 - return ret;
35676 -}
35677 -
35678 -static const struct ide_port_ops cs5536_port_ops = {
35679 - .set_pio_mode = cs5536_set_pio_mode,
35680 - .set_dma_mode = cs5536_set_dma_mode,
35681 - .cable_detect = cs5536_cable_detect,
35682 -};
35683 -
35684 -static const struct ide_dma_ops cs5536_dma_ops = {
35685 - .dma_host_set = ide_dma_host_set,
35686 - .dma_setup = ide_dma_setup,
35687 - .dma_exec_cmd = ide_dma_exec_cmd,
35688 - .dma_start = cs5536_dma_start,
35689 - .dma_end = cs5536_dma_end,
35690 - .dma_test_irq = ide_dma_test_irq,
35691 - .dma_lost_irq = ide_dma_lost_irq,
35692 - .dma_timeout = ide_dma_timeout,
35693 -};
35694 -
35695 -static const struct ide_port_info cs5536_info = {
35696 - .name = DRV_NAME,
35697 - .port_ops = &cs5536_port_ops,
35698 - .dma_ops = &cs5536_dma_ops,
35699 - .host_flags = IDE_HFLAG_SINGLE,
35700 - .pio_mask = ATA_PIO4,
35701 - .mwdma_mask = ATA_MWDMA2,
35702 - .udma_mask = ATA_UDMA5,
35703 -};
35704 -
35705 -/**
35706 - * cs5536_init_one
35707 - * @dev: PCI device
35708 - * @id: Entry in match table
35709 - */
35710 -
35711 -static int cs5536_init_one(struct pci_dev *dev, const struct pci_device_id *id)
35712 -{
35713 - u32 cfg;
35714 -
35715 - if (use_msr)
35716 - printk(KERN_INFO DRV_NAME ": Using MSR regs instead of PCI\n");
35717 -
35718 - cs5536_read(dev, CFG, &cfg);
35719 -
35720 - if ((cfg & IDE_CFG_CHANEN) == 0) {
35721 - printk(KERN_ERR DRV_NAME ": disabled by BIOS\n");
35722 - return -ENODEV;
35723 - }
35724 -
35725 - return ide_pci_init_one(dev, &cs5536_info, NULL);
35726 -}
35727 -
35728 -static const struct pci_device_id cs5536_pci_tbl[] = {
35729 - { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_CS5536_IDE), },
35730 - { },
35731 -};
35732 -
35733 -static struct pci_driver cs5536_pci_driver = {
35734 - .name = DRV_NAME,
35735 - .id_table = cs5536_pci_tbl,
35736 - .probe = cs5536_init_one,
35737 - .remove = ide_pci_remove,
35738 - .suspend = ide_pci_suspend,
35739 - .resume = ide_pci_resume,
35740 -};
35741 -
35742 -static int __init cs5536_init(void)
35743 -{
35744 - return pci_register_driver(&cs5536_pci_driver);
35745 -}
35746 -
35747 -static void __exit cs5536_exit(void)
35748 -{
35749 - pci_unregister_driver(&cs5536_pci_driver);
35750 -}
35751 -
35752 -MODULE_AUTHOR("Martin K. Petersen, Bartlomiej Zolnierkiewicz");
35753 -MODULE_DESCRIPTION("low-level driver for the CS5536 IDE controller");
35754 -MODULE_LICENSE("GPL");
35755 -MODULE_DEVICE_TABLE(pci, cs5536_pci_tbl);
35756 -
35757 -module_param_named(msr, use_msr, int, 0644);
35758 -MODULE_PARM_DESC(msr, "Force using MSR to configure IDE function (Default: 0)");
35759 -
35760 -module_init(cs5536_init);
35761 -module_exit(cs5536_exit);
35762 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ide/icside.c linux-2.6.29-rc3.owrt/drivers/ide/icside.c
35763 --- linux-2.6.29.owrt/drivers/ide/icside.c 2009-05-10 22:04:39.000000000 +0200
35764 +++ linux-2.6.29-rc3.owrt/drivers/ide/icside.c 2009-05-10 23:48:28.000000000 +0200
35765 @@ -534,7 +534,7 @@
35766 d.dma_ops = NULL;
35767 }
35768
35769 - ret = ide_host_register(host, &d, hws);
35770 + ret = ide_host_register(host, NULL, hws);
35771 if (ret)
35772 goto err_free;
35773
35774 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ide/ide-acpi.c linux-2.6.29-rc3.owrt/drivers/ide/ide-acpi.c
35775 --- linux-2.6.29.owrt/drivers/ide/ide-acpi.c 2009-05-10 22:04:39.000000000 +0200
35776 +++ linux-2.6.29-rc3.owrt/drivers/ide/ide-acpi.c 2009-05-10 23:48:28.000000000 +0200
35777 @@ -282,7 +282,7 @@
35778 port = hwif->channel ? drive->dn - 2: drive->dn;
35779
35780 DEBPRINT("ENTER: %s at %s, port#: %d, hard_port#: %d\n",
35781 - hwif->name, dev_name(dev), port, hwif->channel);
35782 + hwif->name, dev->bus_id, port, hwif->channel);
35783
35784 if ((drive->dev_flags & IDE_DFLAG_PRESENT) == 0) {
35785 DEBPRINT("%s drive %d:%d not present\n",
35786 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ide/ide-atapi.c linux-2.6.29-rc3.owrt/drivers/ide/ide-atapi.c
35787 --- linux-2.6.29.owrt/drivers/ide/ide-atapi.c 2009-05-10 22:04:39.000000000 +0200
35788 +++ linux-2.6.29-rc3.owrt/drivers/ide/ide-atapi.c 2009-05-10 23:48:28.000000000 +0200
35789 @@ -140,12 +140,6 @@
35790 rq->cmd_flags |= REQ_PREEMPT;
35791 rq->buffer = (char *)pc;
35792 rq->rq_disk = disk;
35793 -
35794 - if (pc->req_xfer) {
35795 - rq->data = pc->buf;
35796 - rq->data_len = pc->req_xfer;
35797 - }
35798 -
35799 memcpy(rq->cmd, pc->c, 12);
35800 if (drive->media == ide_tape)
35801 rq->cmd[13] = REQ_IDETAPE_PC1;
35802 @@ -165,12 +159,6 @@
35803 rq = blk_get_request(drive->queue, READ, __GFP_WAIT);
35804 rq->cmd_type = REQ_TYPE_SPECIAL;
35805 rq->buffer = (char *)pc;
35806 -
35807 - if (pc->req_xfer) {
35808 - rq->data = pc->buf;
35809 - rq->data_len = pc->req_xfer;
35810 - }
35811 -
35812 memcpy(rq->cmd, pc->c, 12);
35813 if (drive->media == ide_tape)
35814 rq->cmd[13] = REQ_IDETAPE_PC1;
35815 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ide/ide.c linux-2.6.29-rc3.owrt/drivers/ide/ide.c
35816 --- linux-2.6.29.owrt/drivers/ide/ide.c 2009-05-10 22:04:39.000000000 +0200
35817 +++ linux-2.6.29-rc3.owrt/drivers/ide/ide.c 2009-05-10 23:48:28.000000000 +0200
35818 @@ -337,7 +337,6 @@
35819 int a, b, i, j = 1;
35820 unsigned int *dev_param_mask = (unsigned int *)kp->arg;
35821
35822 - /* controller . device (0 or 1) [ : 1 (set) | 0 (clear) ] */
35823 if (sscanf(s, "%d.%d:%d", &a, &b, &j) != 3 &&
35824 sscanf(s, "%d.%d", &a, &b) != 2)
35825 return -EINVAL;
35826 @@ -350,7 +349,7 @@
35827 if (j)
35828 *dev_param_mask |= (1 << i);
35829 else
35830 - *dev_param_mask &= ~(1 << i);
35831 + *dev_param_mask &= (1 << i);
35832
35833 return 0;
35834 }
35835 @@ -393,8 +392,6 @@
35836 {
35837 int a, b, c = 0, h = 0, s = 0, i, j = 1;
35838
35839 - /* controller . device (0 or 1) : Cylinders , Heads , Sectors */
35840 - /* controller . device (0 or 1) : 1 (use CHS) | 0 (ignore CHS) */
35841 if (sscanf(str, "%d.%d:%d,%d,%d", &a, &b, &c, &h, &s) != 5 &&
35842 sscanf(str, "%d.%d:%d", &a, &b, &j) != 3)
35843 return -EINVAL;
35844 @@ -410,7 +407,7 @@
35845 if (j)
35846 ide_disks |= (1 << i);
35847 else
35848 - ide_disks &= ~(1 << i);
35849 + ide_disks &= (1 << i);
35850
35851 ide_disks_chs[i].cyl = c;
35852 ide_disks_chs[i].head = h;
35853 @@ -472,8 +469,6 @@
35854 {
35855 int i, j = 1;
35856
35857 - /* controller (ignore) */
35858 - /* controller : 1 (ignore) | 0 (use) */
35859 if (sscanf(s, "%d:%d", &i, &j) != 2 && sscanf(s, "%d", &i) != 1)
35860 return -EINVAL;
35861
35862 @@ -483,7 +478,7 @@
35863 if (j)
35864 ide_ignore_cable |= (1 << i);
35865 else
35866 - ide_ignore_cable &= ~(1 << i);
35867 + ide_ignore_cable &= (1 << i);
35868
35869 return 0;
35870 }
35871 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ide/ide-cd.c linux-2.6.29-rc3.owrt/drivers/ide/ide-cd.c
35872 --- linux-2.6.29.owrt/drivers/ide/ide-cd.c 2009-05-10 22:04:39.000000000 +0200
35873 +++ linux-2.6.29-rc3.owrt/drivers/ide/ide-cd.c 2009-05-10 23:48:28.000000000 +0200
35874 @@ -55,7 +55,7 @@
35875
35876 static DEFINE_MUTEX(idecd_ref_mutex);
35877
35878 -static void ide_cd_release(struct device *);
35879 +static void ide_cd_release(struct kref *);
35880
35881 static struct cdrom_info *ide_cd_get(struct gendisk *disk)
35882 {
35883 @@ -67,7 +67,7 @@
35884 if (ide_device_get(cd->drive))
35885 cd = NULL;
35886 else
35887 - get_device(&cd->dev);
35888 + kref_get(&cd->kref);
35889
35890 }
35891 mutex_unlock(&idecd_ref_mutex);
35892 @@ -79,7 +79,7 @@
35893 ide_drive_t *drive = cd->drive;
35894
35895 mutex_lock(&idecd_ref_mutex);
35896 - put_device(&cd->dev);
35897 + kref_put(&cd->kref, ide_cd_release);
35898 ide_device_put(drive);
35899 mutex_unlock(&idecd_ref_mutex);
35900 }
35901 @@ -194,14 +194,6 @@
35902 bio_sectors = max(bio_sectors(failed_command->bio), 4U);
35903 sector &= ~(bio_sectors - 1);
35904
35905 - /*
35906 - * The SCSI specification allows for the value
35907 - * returned by READ CAPACITY to be up to 75 2K
35908 - * sectors past the last readable block.
35909 - * Therefore, if we hit a medium error within the
35910 - * last 75 2K sectors, we decrease the saved size
35911 - * value.
35912 - */
35913 if (sector < get_capacity(info->disk) &&
35914 drive->probed_capacity - sector < 4 * 75)
35915 set_capacity(info->disk, sector);
35916 @@ -795,9 +787,6 @@
35917 if (blk_fs_request(rq)) {
35918 ide_end_request(drive, 1, rq->nr_sectors);
35919 return ide_stopped;
35920 - } else if (rq->cmd_type == REQ_TYPE_ATA_PC && !rq->bio) {
35921 - ide_end_request(drive, 1, 1);
35922 - return ide_stopped;
35923 }
35924 goto end_request;
35925 }
35926 @@ -1798,17 +1787,15 @@
35927 ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__);
35928
35929 ide_proc_unregister_driver(drive, info->driver);
35930 - device_del(&info->dev);
35931 +
35932 del_gendisk(info->disk);
35933
35934 - mutex_lock(&idecd_ref_mutex);
35935 - put_device(&info->dev);
35936 - mutex_unlock(&idecd_ref_mutex);
35937 + ide_cd_put(info);
35938 }
35939
35940 -static void ide_cd_release(struct device *dev)
35941 +static void ide_cd_release(struct kref *kref)
35942 {
35943 - struct cdrom_info *info = to_ide_drv(dev, cdrom_info);
35944 + struct cdrom_info *info = to_ide_drv(kref, cdrom_info);
35945 struct cdrom_device_info *devinfo = &info->devinfo;
35946 ide_drive_t *drive = info->drive;
35947 struct gendisk *g = info->disk;
35948 @@ -2007,12 +1994,7 @@
35949
35950 ide_init_disk(g, drive);
35951
35952 - info->dev.parent = &drive->gendev;
35953 - info->dev.release = ide_cd_release;
35954 - dev_set_name(&info->dev, dev_name(&drive->gendev));
35955 -
35956 - if (device_register(&info->dev))
35957 - goto out_free_disk;
35958 + kref_init(&info->kref);
35959
35960 info->drive = drive;
35961 info->driver = &ide_cdrom_driver;
35962 @@ -2026,7 +2008,7 @@
35963 g->driverfs_dev = &drive->gendev;
35964 g->flags = GENHD_FL_CD | GENHD_FL_REMOVABLE;
35965 if (ide_cdrom_setup(drive)) {
35966 - put_device(&info->dev);
35967 + ide_cd_release(&info->kref);
35968 goto failed;
35969 }
35970
35971 @@ -2036,8 +2018,6 @@
35972 add_disk(g);
35973 return 0;
35974
35975 -out_free_disk:
35976 - put_disk(g);
35977 out_free_cd:
35978 kfree(info);
35979 failed:
35980 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ide/ide-cd.h linux-2.6.29-rc3.owrt/drivers/ide/ide-cd.h
35981 --- linux-2.6.29.owrt/drivers/ide/ide-cd.h 2009-05-10 22:04:39.000000000 +0200
35982 +++ linux-2.6.29-rc3.owrt/drivers/ide/ide-cd.h 2009-05-10 23:48:28.000000000 +0200
35983 @@ -80,7 +80,7 @@
35984 ide_drive_t *drive;
35985 struct ide_driver *driver;
35986 struct gendisk *disk;
35987 - struct device dev;
35988 + struct kref kref;
35989
35990 /* Buffer for table of contents. NULL if we haven't allocated
35991 a TOC buffer for this device yet. */
35992 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ide/ide-disk_proc.c linux-2.6.29-rc3.owrt/drivers/ide/ide-disk_proc.c
35993 --- linux-2.6.29.owrt/drivers/ide/ide-disk_proc.c 2009-05-10 22:04:39.000000000 +0200
35994 +++ linux-2.6.29-rc3.owrt/drivers/ide/ide-disk_proc.c 2009-05-10 23:48:28.000000000 +0200
35995 @@ -125,5 +125,5 @@
35996 IDE_PROC_DEVSET(multcount, 0, 16),
35997 IDE_PROC_DEVSET(nowerr, 0, 1),
35998 IDE_PROC_DEVSET(wcache, 0, 1),
35999 - { NULL },
36000 + { 0 },
36001 };
36002 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ide/ide-dma.c linux-2.6.29-rc3.owrt/drivers/ide/ide-dma.c
36003 --- linux-2.6.29.owrt/drivers/ide/ide-dma.c 2009-05-10 22:04:39.000000000 +0200
36004 +++ linux-2.6.29-rc3.owrt/drivers/ide/ide-dma.c 2009-05-10 23:48:28.000000000 +0200
36005 @@ -128,7 +128,6 @@
36006 {
36007 ide_hwif_t *hwif = drive->hwif;
36008 struct scatterlist *sg = hwif->sg_table;
36009 - int i;
36010
36011 ide_map_sg(drive, rq);
36012
36013 @@ -137,13 +136,8 @@
36014 else
36015 hwif->sg_dma_direction = DMA_TO_DEVICE;
36016
36017 - i = dma_map_sg(hwif->dev, sg, hwif->sg_nents, hwif->sg_dma_direction);
36018 - if (i) {
36019 - hwif->orig_sg_nents = hwif->sg_nents;
36020 - hwif->sg_nents = i;
36021 - }
36022 -
36023 - return i;
36024 + return dma_map_sg(hwif->dev, sg, hwif->sg_nents,
36025 + hwif->sg_dma_direction);
36026 }
36027 EXPORT_SYMBOL_GPL(ide_build_sglist);
36028
36029 @@ -162,7 +156,7 @@
36030 {
36031 ide_hwif_t *hwif = drive->hwif;
36032
36033 - dma_unmap_sg(hwif->dev, hwif->sg_table, hwif->orig_sg_nents,
36034 + dma_unmap_sg(hwif->dev, hwif->sg_table, hwif->sg_nents,
36035 hwif->sg_dma_direction);
36036 }
36037 EXPORT_SYMBOL_GPL(ide_destroy_dmatable);
36038 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ide/ide-floppy.c linux-2.6.29-rc3.owrt/drivers/ide/ide-floppy.c
36039 --- linux-2.6.29.owrt/drivers/ide/ide-floppy.c 2009-05-10 22:04:39.000000000 +0200
36040 +++ linux-2.6.29-rc3.owrt/drivers/ide/ide-floppy.c 2009-05-10 23:48:28.000000000 +0200
36041 @@ -327,10 +327,8 @@
36042 return ide_stopped;
36043 }
36044
36045 - if (blk_fs_request(rq) || pc->req_xfer) {
36046 - ide_init_sg_cmd(drive, rq);
36047 - ide_map_sg(drive, rq);
36048 - }
36049 + ide_init_sg_cmd(drive, rq);
36050 + ide_map_sg(drive, rq);
36051
36052 pc->sg = hwif->sg_table;
36053 pc->sg_cnt = hwif->sg_nents;
36054 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ide/ide-floppy_proc.c linux-2.6.29-rc3.owrt/drivers/ide/ide-floppy_proc.c
36055 --- linux-2.6.29.owrt/drivers/ide/ide-floppy_proc.c 2009-05-10 22:04:39.000000000 +0200
36056 +++ linux-2.6.29-rc3.owrt/drivers/ide/ide-floppy_proc.c 2009-05-10 23:48:28.000000000 +0200
36057 @@ -29,5 +29,5 @@
36058 IDE_PROC_DEVSET(bios_head, 0, 255),
36059 IDE_PROC_DEVSET(bios_sect, 0, 63),
36060 IDE_PROC_DEVSET(ticks, 0, 255),
36061 - { NULL },
36062 + { 0 },
36063 };
36064 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ide/ide-gd.c linux-2.6.29-rc3.owrt/drivers/ide/ide-gd.c
36065 --- linux-2.6.29.owrt/drivers/ide/ide-gd.c 2009-05-10 22:04:39.000000000 +0200
36066 +++ linux-2.6.29-rc3.owrt/drivers/ide/ide-gd.c 2009-05-10 23:48:28.000000000 +0200
36067 @@ -25,7 +25,7 @@
36068
36069 static DEFINE_MUTEX(ide_disk_ref_mutex);
36070
36071 -static void ide_disk_release(struct device *);
36072 +static void ide_disk_release(struct kref *);
36073
36074 static struct ide_disk_obj *ide_disk_get(struct gendisk *disk)
36075 {
36076 @@ -37,7 +37,7 @@
36077 if (ide_device_get(idkp->drive))
36078 idkp = NULL;
36079 else
36080 - get_device(&idkp->dev);
36081 + kref_get(&idkp->kref);
36082 }
36083 mutex_unlock(&ide_disk_ref_mutex);
36084 return idkp;
36085 @@ -48,7 +48,7 @@
36086 ide_drive_t *drive = idkp->drive;
36087
36088 mutex_lock(&ide_disk_ref_mutex);
36089 - put_device(&idkp->dev);
36090 + kref_put(&idkp->kref, ide_disk_release);
36091 ide_device_put(drive);
36092 mutex_unlock(&ide_disk_ref_mutex);
36093 }
36094 @@ -66,18 +66,17 @@
36095 struct gendisk *g = idkp->disk;
36096
36097 ide_proc_unregister_driver(drive, idkp->driver);
36098 - device_del(&idkp->dev);
36099 +
36100 del_gendisk(g);
36101 +
36102 drive->disk_ops->flush(drive);
36103
36104 - mutex_lock(&ide_disk_ref_mutex);
36105 - put_device(&idkp->dev);
36106 - mutex_unlock(&ide_disk_ref_mutex);
36107 + ide_disk_put(idkp);
36108 }
36109
36110 -static void ide_disk_release(struct device *dev)
36111 +static void ide_disk_release(struct kref *kref)
36112 {
36113 - struct ide_disk_obj *idkp = to_ide_drv(dev, ide_disk_obj);
36114 + struct ide_disk_obj *idkp = to_ide_drv(kref, ide_disk_obj);
36115 ide_drive_t *drive = idkp->drive;
36116 struct gendisk *g = idkp->disk;
36117
36118 @@ -349,12 +348,7 @@
36119
36120 ide_init_disk(g, drive);
36121
36122 - idkp->dev.parent = &drive->gendev;
36123 - idkp->dev.release = ide_disk_release;
36124 - dev_set_name(&idkp->dev, dev_name(&drive->gendev));
36125 -
36126 - if (device_register(&idkp->dev))
36127 - goto out_free_disk;
36128 + kref_init(&idkp->kref);
36129
36130 idkp->drive = drive;
36131 idkp->driver = &ide_gd_driver;
36132 @@ -379,8 +373,6 @@
36133 add_disk(g);
36134 return 0;
36135
36136 -out_free_disk:
36137 - put_disk(g);
36138 out_free_idkp:
36139 kfree(idkp);
36140 failed:
36141 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ide/ide-gd.h linux-2.6.29-rc3.owrt/drivers/ide/ide-gd.h
36142 --- linux-2.6.29.owrt/drivers/ide/ide-gd.h 2009-05-10 22:04:39.000000000 +0200
36143 +++ linux-2.6.29-rc3.owrt/drivers/ide/ide-gd.h 2009-05-10 23:48:28.000000000 +0200
36144 @@ -17,7 +17,7 @@
36145 ide_drive_t *drive;
36146 struct ide_driver *driver;
36147 struct gendisk *disk;
36148 - struct device dev;
36149 + struct kref kref;
36150 unsigned int openers; /* protected by BKL for now */
36151
36152 /* Last failed packet command */
36153 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ide/ide-io.c linux-2.6.29-rc3.owrt/drivers/ide/ide-io.c
36154 --- linux-2.6.29.owrt/drivers/ide/ide-io.c 2009-05-10 22:04:39.000000000 +0200
36155 +++ linux-2.6.29-rc3.owrt/drivers/ide/ide-io.c 2009-05-10 23:48:28.000000000 +0200
36156 @@ -418,14 +418,11 @@
36157 ide_hwif_t *hwif = drive->hwif;
36158 struct scatterlist *sg = hwif->sg_table;
36159
36160 - if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
36161 + if (rq->cmd_type != REQ_TYPE_ATA_TASKFILE) {
36162 + hwif->sg_nents = blk_rq_map_sg(drive->queue, rq, sg);
36163 + } else {
36164 sg_init_one(sg, rq->buffer, rq->nr_sectors * SECTOR_SIZE);
36165 hwif->sg_nents = 1;
36166 - } else if (!rq->bio) {
36167 - sg_init_one(sg, rq->data, rq->data_len);
36168 - hwif->sg_nents = 1;
36169 - } else {
36170 - hwif->sg_nents = blk_rq_map_sg(drive->queue, rq, sg);
36171 }
36172 }
36173
36174 @@ -908,7 +905,7 @@
36175 ide_drive_t *uninitialized_var(drive);
36176 ide_handler_t *handler;
36177 unsigned long flags;
36178 - int wait = -1;
36179 + unsigned long wait = -1;
36180 int plug_device = 0;
36181
36182 spin_lock_irqsave(&hwif->lock, flags);
36183 @@ -1162,7 +1159,6 @@
36184
36185 return irq_ret;
36186 }
36187 -EXPORT_SYMBOL_GPL(ide_intr);
36188
36189 /**
36190 * ide_do_drive_cmd - issue IDE special command
36191 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ide/ide-iops.c linux-2.6.29-rc3.owrt/drivers/ide/ide-iops.c
36192 --- linux-2.6.29.owrt/drivers/ide/ide-iops.c 2009-05-10 22:04:39.000000000 +0200
36193 +++ linux-2.6.29-rc3.owrt/drivers/ide/ide-iops.c 2009-05-10 23:48:28.000000000 +0200
36194 @@ -315,8 +315,6 @@
36195 u8 io_32bit = drive->io_32bit;
36196 u8 mmio = (hwif->host_flags & IDE_HFLAG_MMIO) ? 1 : 0;
36197
36198 - len++;
36199 -
36200 if (io_32bit) {
36201 unsigned long uninitialized_var(flags);
36202
36203 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ide/ide-probe.c linux-2.6.29-rc3.owrt/drivers/ide/ide-probe.c
36204 --- linux-2.6.29.owrt/drivers/ide/ide-probe.c 2009-05-10 22:04:39.000000000 +0200
36205 +++ linux-2.6.29-rc3.owrt/drivers/ide/ide-probe.c 2009-05-10 23:48:28.000000000 +0200
36206 @@ -950,7 +950,6 @@
36207 static int init_irq (ide_hwif_t *hwif)
36208 {
36209 struct ide_io_ports *io_ports = &hwif->io_ports;
36210 - irq_handler_t irq_handler;
36211 int sa = 0;
36212
36213 mutex_lock(&ide_cfg_mtx);
36214 @@ -960,10 +959,6 @@
36215 hwif->timer.function = &ide_timer_expiry;
36216 hwif->timer.data = (unsigned long)hwif;
36217
36218 - irq_handler = hwif->host->irq_handler;
36219 - if (irq_handler == NULL)
36220 - irq_handler = ide_intr;
36221 -
36222 #if defined(__mc68000__)
36223 sa = IRQF_SHARED;
36224 #endif /* __mc68000__ */
36225 @@ -974,7 +969,7 @@
36226 if (io_ports->ctl_addr)
36227 hwif->tp_ops->set_irq(hwif, 1);
36228
36229 - if (request_irq(hwif->irq, irq_handler, sa, hwif->name, hwif))
36230 + if (request_irq(hwif->irq, &ide_intr, sa, hwif->name, hwif))
36231 goto out_up;
36232
36233 if (!hwif->rqsize) {
36234 @@ -1472,30 +1467,6 @@
36235 }
36236 EXPORT_SYMBOL_GPL(ide_host_alloc);
36237
36238 -static void ide_port_free(ide_hwif_t *hwif)
36239 -{
36240 - ide_port_free_devices(hwif);
36241 - ide_free_port_slot(hwif->index);
36242 - kfree(hwif);
36243 -}
36244 -
36245 -static void ide_disable_port(ide_hwif_t *hwif)
36246 -{
36247 - struct ide_host *host = hwif->host;
36248 - int i;
36249 -
36250 - printk(KERN_INFO "%s: disabling port\n", hwif->name);
36251 -
36252 - for (i = 0; i < MAX_HOST_PORTS; i++) {
36253 - if (host->ports[i] == hwif) {
36254 - host->ports[i] = NULL;
36255 - host->n_ports--;
36256 - }
36257 - }
36258 -
36259 - ide_port_free(hwif);
36260 -}
36261 -
36262 int ide_host_register(struct ide_host *host, const struct ide_port_info *d,
36263 hw_regs_t **hws)
36264 {
36265 @@ -1536,12 +1507,8 @@
36266 hwif->present = 1;
36267
36268 if (hwif->chipset != ide_4drives || !hwif->mate ||
36269 - !hwif->mate->present) {
36270 - if (ide_register_port(hwif)) {
36271 - ide_disable_port(hwif);
36272 - continue;
36273 - }
36274 - }
36275 + !hwif->mate->present)
36276 + ide_register_port(hwif);
36277
36278 if (hwif->present)
36279 ide_port_tune_devices(hwif);
36280 @@ -1554,8 +1521,7 @@
36281 if (hwif_init(hwif) == 0) {
36282 printk(KERN_INFO "%s: failed to initialize IDE "
36283 "interface\n", hwif->name);
36284 - device_unregister(&hwif->gendev);
36285 - ide_disable_port(hwif);
36286 + hwif->present = 0;
36287 continue;
36288 }
36289
36290 @@ -1694,8 +1660,12 @@
36291 int i;
36292
36293 ide_host_for_each_port(i, hwif, host) {
36294 - if (hwif)
36295 - ide_port_free(hwif);
36296 + if (hwif == NULL)
36297 + continue;
36298 +
36299 + ide_port_free_devices(hwif);
36300 + ide_free_port_slot(hwif->index);
36301 + kfree(hwif);
36302 }
36303
36304 kfree(host);
36305 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ide/ide-proc.c linux-2.6.29-rc3.owrt/drivers/ide/ide-proc.c
36306 --- linux-2.6.29.owrt/drivers/ide/ide-proc.c 2009-05-10 22:04:39.000000000 +0200
36307 +++ linux-2.6.29-rc3.owrt/drivers/ide/ide-proc.c 2009-05-10 23:48:28.000000000 +0200
36308 @@ -231,7 +231,7 @@
36309 IDE_PROC_DEVSET(pio_mode, 0, 255),
36310 IDE_PROC_DEVSET(unmaskirq, 0, 1),
36311 IDE_PROC_DEVSET(using_dma, 0, 1),
36312 - { NULL },
36313 + { 0 },
36314 };
36315
36316 static void proc_ide_settings_warn(void)
36317 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ide/ide-tape.c linux-2.6.29-rc3.owrt/drivers/ide/ide-tape.c
36318 --- linux-2.6.29.owrt/drivers/ide/ide-tape.c 2009-05-10 22:04:39.000000000 +0200
36319 +++ linux-2.6.29-rc3.owrt/drivers/ide/ide-tape.c 2009-05-10 23:48:28.000000000 +0200
36320 @@ -169,7 +169,7 @@
36321 ide_drive_t *drive;
36322 struct ide_driver *driver;
36323 struct gendisk *disk;
36324 - struct device dev;
36325 + struct kref kref;
36326
36327 /*
36328 * failed_pc points to the last failed packet command, or contains
36329 @@ -267,7 +267,7 @@
36330
36331 static struct class *idetape_sysfs_class;
36332
36333 -static void ide_tape_release(struct device *);
36334 +static void ide_tape_release(struct kref *);
36335
36336 static struct ide_tape_obj *ide_tape_get(struct gendisk *disk)
36337 {
36338 @@ -279,7 +279,7 @@
36339 if (ide_device_get(tape->drive))
36340 tape = NULL;
36341 else
36342 - get_device(&tape->dev);
36343 + kref_get(&tape->kref);
36344 }
36345 mutex_unlock(&idetape_ref_mutex);
36346 return tape;
36347 @@ -290,7 +290,7 @@
36348 ide_drive_t *drive = tape->drive;
36349
36350 mutex_lock(&idetape_ref_mutex);
36351 - put_device(&tape->dev);
36352 + kref_put(&tape->kref, ide_tape_release);
36353 ide_device_put(drive);
36354 mutex_unlock(&idetape_ref_mutex);
36355 }
36356 @@ -308,7 +308,7 @@
36357 mutex_lock(&idetape_ref_mutex);
36358 tape = idetape_devs[i];
36359 if (tape)
36360 - get_device(&tape->dev);
36361 + kref_get(&tape->kref);
36362 mutex_unlock(&idetape_ref_mutex);
36363 return tape;
36364 }
36365 @@ -2166,7 +2166,7 @@
36366 __IDE_PROC_DEVSET(speed, 0, 0xffff, NULL, NULL),
36367 __IDE_PROC_DEVSET(tdsc, IDETAPE_DSC_RW_MIN, IDETAPE_DSC_RW_MAX,
36368 mulf_tdsc, divf_tdsc),
36369 - { NULL },
36370 + { 0 },
36371 };
36372 #endif
36373
36374 @@ -2256,17 +2256,15 @@
36375 idetape_tape_t *tape = drive->driver_data;
36376
36377 ide_proc_unregister_driver(drive, tape->driver);
36378 - device_del(&tape->dev);
36379 +
36380 ide_unregister_region(tape->disk);
36381
36382 - mutex_lock(&idetape_ref_mutex);
36383 - put_device(&tape->dev);
36384 - mutex_unlock(&idetape_ref_mutex);
36385 + ide_tape_put(tape);
36386 }
36387
36388 -static void ide_tape_release(struct device *dev)
36389 +static void ide_tape_release(struct kref *kref)
36390 {
36391 - struct ide_tape_obj *tape = to_ide_drv(dev, ide_tape_obj);
36392 + struct ide_tape_obj *tape = to_ide_drv(kref, ide_tape_obj);
36393 ide_drive_t *drive = tape->drive;
36394 struct gendisk *g = tape->disk;
36395
36396 @@ -2409,12 +2407,7 @@
36397
36398 ide_init_disk(g, drive);
36399
36400 - tape->dev.parent = &drive->gendev;
36401 - tape->dev.release = ide_tape_release;
36402 - dev_set_name(&tape->dev, dev_name(&drive->gendev));
36403 -
36404 - if (device_register(&tape->dev))
36405 - goto out_free_disk;
36406 + kref_init(&tape->kref);
36407
36408 tape->drive = drive;
36409 tape->driver = &idetape_driver;
36410 @@ -2443,8 +2436,6 @@
36411
36412 return 0;
36413
36414 -out_free_disk:
36415 - put_disk(g);
36416 out_free_tape:
36417 kfree(tape);
36418 failed:
36419 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ide/it821x.c linux-2.6.29-rc3.owrt/drivers/ide/it821x.c
36420 --- linux-2.6.29.owrt/drivers/ide/it821x.c 2009-05-10 22:04:39.000000000 +0200
36421 +++ linux-2.6.29-rc3.owrt/drivers/ide/it821x.c 2009-05-10 23:48:28.000000000 +0200
36422 @@ -5,8 +5,9 @@
36423 * May be copied or modified under the terms of the GNU General Public License
36424 * Based in part on the ITE vendor provided SCSI driver.
36425 *
36426 - * Documentation:
36427 - * Datasheet is freely available, some other documents under NDA.
36428 + * Documentation available from
36429 + * http://www.ite.com.tw/pc/IT8212F_V04.pdf
36430 + * Some other documents are NDA.
36431 *
36432 * The ITE8212 isn't exactly a standard IDE controller. It has two
36433 * modes. In pass through mode then it is an IDE controller. In its smart
36434 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ide/Kconfig linux-2.6.29-rc3.owrt/drivers/ide/Kconfig
36435 --- linux-2.6.29.owrt/drivers/ide/Kconfig 2009-05-10 22:04:39.000000000 +0200
36436 +++ linux-2.6.29-rc3.owrt/drivers/ide/Kconfig 2009-05-10 23:48:28.000000000 +0200
36437 @@ -46,7 +46,7 @@
36438 SMART parameters from disk drives.
36439
36440 To compile this driver as a module, choose M here: the
36441 - module will be called ide-core.ko.
36442 + module will be called ide.
36443
36444 For further information, please read <file:Documentation/ide/ide.txt>.
36445
36446 @@ -465,16 +465,6 @@
36447
36448 It is safe to say Y to this question.
36449
36450 -config BLK_DEV_CS5536
36451 - tristate "CS5536 chipset support"
36452 - depends on X86_32
36453 - select BLK_DEV_IDEDMA_PCI
36454 - help
36455 - This option enables support for the AMD CS5536
36456 - companion chip used with the Geode LX processor family.
36457 -
36458 - If unsure, say N.
36459 -
36460 config BLK_DEV_HPT366
36461 tristate "HPT36X/37X chipset support"
36462 select BLK_DEV_IDEDMA_PCI
36463 @@ -721,11 +711,6 @@
36464 depends on SOC_TX4939
36465 select BLK_DEV_IDEDMA_SFF
36466
36467 -config BLK_DEV_IDE_AT91
36468 - tristate "Atmel AT91 (SAM9, CAP9, AT572D940HF) IDE support"
36469 - depends on ARM && ARCH_AT91 && !ARCH_AT91RM9200 && !ARCH_AT91X40
36470 - select IDE_TIMINGS
36471 -
36472 config IDE_ARM
36473 tristate "ARM IDE support"
36474 depends on ARM && (ARCH_RPC || ARCH_SHARK)
36475 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ide/Makefile linux-2.6.29-rc3.owrt/drivers/ide/Makefile
36476 --- linux-2.6.29.owrt/drivers/ide/Makefile 2009-05-10 22:04:39.000000000 +0200
36477 +++ linux-2.6.29-rc3.owrt/drivers/ide/Makefile 2009-05-10 23:48:28.000000000 +0200
36478 @@ -43,7 +43,6 @@
36479 obj-$(CONFIG_BLK_DEV_CS5520) += cs5520.o
36480 obj-$(CONFIG_BLK_DEV_CS5530) += cs5530.o
36481 obj-$(CONFIG_BLK_DEV_CS5535) += cs5535.o
36482 -obj-$(CONFIG_BLK_DEV_CS5536) += cs5536.o
36483 obj-$(CONFIG_BLK_DEV_SC1200) += sc1200.o
36484 obj-$(CONFIG_BLK_DEV_CY82C693) += cy82c693.o
36485 obj-$(CONFIG_BLK_DEV_DELKIN) += delkin_cb.o
36486 @@ -116,4 +115,3 @@
36487
36488 obj-$(CONFIG_BLK_DEV_IDE_TX4938) += tx4938ide.o
36489 obj-$(CONFIG_BLK_DEV_IDE_TX4939) += tx4939ide.o
36490 -obj-$(CONFIG_BLK_DEV_IDE_AT91) += at91_ide.o
36491 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ide/qd65xx.c linux-2.6.29-rc3.owrt/drivers/ide/qd65xx.c
36492 --- linux-2.6.29.owrt/drivers/ide/qd65xx.c 2009-05-10 22:04:39.000000000 +0200
36493 +++ linux-2.6.29-rc3.owrt/drivers/ide/qd65xx.c 2009-05-10 23:48:28.000000000 +0200
36494 @@ -16,7 +16,7 @@
36495
36496 /*
36497 * Rewritten from the work of Colten Edwards <pje120@cs.usask.ca> by
36498 - * Samuel Thibault <samuel.thibault@ens-lyon.org>
36499 + * Samuel Thibault <samuel.thibault@fnac.net>
36500 */
36501
36502 #include <linux/module.h>
36503 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ide/qd65xx.h linux-2.6.29-rc3.owrt/drivers/ide/qd65xx.h
36504 --- linux-2.6.29.owrt/drivers/ide/qd65xx.h 2009-05-10 22:04:39.000000000 +0200
36505 +++ linux-2.6.29-rc3.owrt/drivers/ide/qd65xx.h 2009-05-10 23:48:28.000000000 +0200
36506 @@ -4,7 +4,7 @@
36507
36508 /*
36509 * Authors: Petr Soucek <petr@ryston.cz>
36510 - * Samuel Thibault <samuel.thibault@ens-lyon.org>
36511 + * Samuel Thibault <samuel.thibault@fnac.net>
36512 */
36513
36514 /* truncates a in [b,c] */
36515 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ide/tx4939ide.c linux-2.6.29-rc3.owrt/drivers/ide/tx4939ide.c
36516 --- linux-2.6.29.owrt/drivers/ide/tx4939ide.c 2009-05-10 22:04:39.000000000 +0200
36517 +++ linux-2.6.29-rc3.owrt/drivers/ide/tx4939ide.c 2009-05-10 23:48:28.000000000 +0200
36518 @@ -261,9 +261,9 @@
36519 bcount = cur_len;
36520 /*
36521 * This workaround for zero count seems required.
36522 - * (standard ide_build_dmatable does it too)
36523 + * (standard ide_build_dmatable do it too)
36524 */
36525 - if (bcount == 0x10000)
36526 + if ((bcount & 0xffff) == 0x0000)
36527 bcount = 0x8000;
36528 *table++ = bcount & 0xffff;
36529 *table++ = cur_addr;
36530 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ide/via82cxxx.c linux-2.6.29-rc3.owrt/drivers/ide/via82cxxx.c
36531 --- linux-2.6.29.owrt/drivers/ide/via82cxxx.c 2009-05-10 22:04:39.000000000 +0200
36532 +++ linux-2.6.29-rc3.owrt/drivers/ide/via82cxxx.c 2009-05-10 23:48:28.000000000 +0200
36533 @@ -448,11 +448,6 @@
36534 d.host_flags |= IDE_HFLAG_FORCE_LEGACY_IRQS;
36535 #endif
36536
36537 -#ifdef CONFIG_AMIGAONE
36538 - if (machine_is(amigaone))
36539 - d.host_flags |= IDE_HFLAG_FORCE_LEGACY_IRQS;
36540 -#endif
36541 -
36542 d.udma_mask = via_config->udma_mask;
36543
36544 vdev = kzalloc(sizeof(*vdev), GFP_KERNEL);
36545 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ieee1394/dma.h linux-2.6.29-rc3.owrt/drivers/ieee1394/dma.h
36546 --- linux-2.6.29.owrt/drivers/ieee1394/dma.h 2009-05-10 22:04:38.000000000 +0200
36547 +++ linux-2.6.29-rc3.owrt/drivers/ieee1394/dma.h 2009-05-10 23:48:28.000000000 +0200
36548 @@ -12,7 +12,6 @@
36549
36550 #include <asm/types.h>
36551
36552 -struct file;
36553 struct pci_dev;
36554 struct scatterlist;
36555 struct vm_area_struct;
36556 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ieee1394/dv1394.c linux-2.6.29-rc3.owrt/drivers/ieee1394/dv1394.c
36557 --- linux-2.6.29.owrt/drivers/ieee1394/dv1394.c 2009-05-10 22:04:38.000000000 +0200
36558 +++ linux-2.6.29-rc3.owrt/drivers/ieee1394/dv1394.c 2009-05-10 23:48:28.000000000 +0200
36559 @@ -1823,10 +1823,6 @@
36560
36561 #endif
36562
36563 - printk(KERN_INFO "%s: NOTE, the dv1394 interface is unsupported "
36564 - "and will not be available in the new firewire driver stack. "
36565 - "Try libraw1394 based programs instead.\n", current->comm);
36566 -
36567 return 0;
36568 }
36569
36570 @@ -2571,6 +2567,10 @@
36571 {
36572 int ret;
36573
36574 + printk(KERN_WARNING
36575 + "NOTE: The dv1394 driver is unsupported and may be removed in a "
36576 + "future Linux release. Use raw1394 instead.\n");
36577 +
36578 cdev_init(&dv1394_cdev, &dv1394_fops);
36579 dv1394_cdev.owner = THIS_MODULE;
36580 ret = cdev_add(&dv1394_cdev, IEEE1394_DV1394_DEV, 16);
36581 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ieee1394/ieee1394_core.c linux-2.6.29-rc3.owrt/drivers/ieee1394/ieee1394_core.c
36582 --- linux-2.6.29.owrt/drivers/ieee1394/ieee1394_core.c 2009-05-10 22:04:38.000000000 +0200
36583 +++ linux-2.6.29-rc3.owrt/drivers/ieee1394/ieee1394_core.c 2009-05-10 23:48:28.000000000 +0200
36584 @@ -338,7 +338,6 @@
36585 u8 cldcnt[nodecount];
36586 u8 *map = host->speed_map;
36587 u8 *speedcap = host->speed;
36588 - u8 local_link_speed = host->csr.lnk_spd;
36589 struct selfid *sid;
36590 struct ext_selfid *esid;
36591 int i, j, n;
36592 @@ -374,8 +373,8 @@
36593 if (sid->port2 == SELFID_PORT_CHILD) cldcnt[n]++;
36594
36595 speedcap[n] = sid->speed;
36596 - if (speedcap[n] > local_link_speed)
36597 - speedcap[n] = local_link_speed;
36598 + if (speedcap[n] > host->csr.lnk_spd)
36599 + speedcap[n] = host->csr.lnk_spd;
36600 n--;
36601 }
36602 }
36603 @@ -408,11 +407,12 @@
36604 }
36605 }
36606
36607 - /* assume a maximum speed for 1394b PHYs, nodemgr will correct it */
36608 - if (local_link_speed > SELFID_SPEED_UNKNOWN)
36609 - for (i = 0; i < nodecount; i++)
36610 - if (speedcap[i] == SELFID_SPEED_UNKNOWN)
36611 - speedcap[i] = local_link_speed;
36612 +#if SELFID_SPEED_UNKNOWN != IEEE1394_SPEED_MAX
36613 + /* assume maximum speed for 1394b PHYs, nodemgr will correct it */
36614 + for (n = 0; n < nodecount; n++)
36615 + if (speedcap[n] == SELFID_SPEED_UNKNOWN)
36616 + speedcap[n] = IEEE1394_SPEED_MAX;
36617 +#endif
36618 }
36619
36620
36621 @@ -1275,7 +1275,7 @@
36622 unregister_chrdev_region(IEEE1394_CORE_DEV, 256);
36623 }
36624
36625 -fs_initcall(ieee1394_init);
36626 +module_init(ieee1394_init);
36627 module_exit(ieee1394_cleanup);
36628
36629 /* Exported symbols */
36630 @@ -1314,7 +1314,6 @@
36631 EXPORT_SYMBOL(hpsb_make_phypacket);
36632 EXPORT_SYMBOL(hpsb_read);
36633 EXPORT_SYMBOL(hpsb_write);
36634 -EXPORT_SYMBOL(hpsb_lock);
36635 EXPORT_SYMBOL(hpsb_packet_success);
36636
36637 /** highlevel.c **/
36638 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ieee1394/ieee1394.h linux-2.6.29-rc3.owrt/drivers/ieee1394/ieee1394.h
36639 --- linux-2.6.29.owrt/drivers/ieee1394/ieee1394.h 2009-05-10 22:04:38.000000000 +0200
36640 +++ linux-2.6.29-rc3.owrt/drivers/ieee1394/ieee1394.h 2009-05-10 23:48:28.000000000 +0200
36641 @@ -54,7 +54,9 @@
36642 #define IEEE1394_SPEED_800 0x03
36643 #define IEEE1394_SPEED_1600 0x04
36644 #define IEEE1394_SPEED_3200 0x05
36645 -#define IEEE1394_SPEED_MAX IEEE1394_SPEED_3200
36646 +
36647 +/* The current highest tested speed supported by the subsystem */
36648 +#define IEEE1394_SPEED_MAX IEEE1394_SPEED_800
36649
36650 /* Maps speed values above to a string representation */
36651 extern const char *hpsb_speedto_str[];
36652 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ieee1394/ieee1394_transactions.c linux-2.6.29-rc3.owrt/drivers/ieee1394/ieee1394_transactions.c
36653 --- linux-2.6.29.owrt/drivers/ieee1394/ieee1394_transactions.c 2009-05-10 22:04:38.000000000 +0200
36654 +++ linux-2.6.29-rc3.owrt/drivers/ieee1394/ieee1394_transactions.c 2009-05-10 23:48:28.000000000 +0200
36655 @@ -501,6 +501,8 @@
36656 if (length == 0)
36657 return -EINVAL;
36658
36659 + BUG_ON(in_interrupt()); // We can't be called in an interrupt, yet
36660 +
36661 packet = hpsb_make_readpacket(host, node, addr, length);
36662
36663 if (!packet) {
36664 @@ -548,6 +550,8 @@
36665 if (length == 0)
36666 return -EINVAL;
36667
36668 + BUG_ON(in_interrupt()); // We can't be called in an interrupt, yet
36669 +
36670 packet = hpsb_make_writepacket(host, node, addr, buffer, length);
36671
36672 if (!packet)
36673 @@ -566,30 +570,3 @@
36674
36675 return retval;
36676 }
36677 -
36678 -int hpsb_lock(struct hpsb_host *host, nodeid_t node, unsigned int generation,
36679 - u64 addr, int extcode, quadlet_t *data, quadlet_t arg)
36680 -{
36681 - struct hpsb_packet *packet;
36682 - int retval = 0;
36683 -
36684 - packet = hpsb_make_lockpacket(host, node, addr, extcode, data, arg);
36685 - if (!packet)
36686 - return -ENOMEM;
36687 -
36688 - packet->generation = generation;
36689 - retval = hpsb_send_packet_and_wait(packet);
36690 - if (retval < 0)
36691 - goto hpsb_lock_fail;
36692 -
36693 - retval = hpsb_packet_success(packet);
36694 -
36695 - if (retval == 0)
36696 - *data = packet->data[0];
36697 -
36698 -hpsb_lock_fail:
36699 - hpsb_free_tlabel(packet);
36700 - hpsb_free_packet(packet);
36701 -
36702 - return retval;
36703 -}
36704 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ieee1394/ieee1394_transactions.h linux-2.6.29-rc3.owrt/drivers/ieee1394/ieee1394_transactions.h
36705 --- linux-2.6.29.owrt/drivers/ieee1394/ieee1394_transactions.h 2009-05-10 22:04:38.000000000 +0200
36706 +++ linux-2.6.29-rc3.owrt/drivers/ieee1394/ieee1394_transactions.h 2009-05-10 23:48:28.000000000 +0200
36707 @@ -30,8 +30,6 @@
36708 u64 addr, quadlet_t *buffer, size_t length);
36709 int hpsb_write(struct hpsb_host *host, nodeid_t node, unsigned int generation,
36710 u64 addr, quadlet_t *buffer, size_t length);
36711 -int hpsb_lock(struct hpsb_host *host, nodeid_t node, unsigned int generation,
36712 - u64 addr, int extcode, quadlet_t *data, quadlet_t arg);
36713
36714 #ifdef HPSB_DEBUG_TLABELS
36715 extern spinlock_t hpsb_tlabel_lock;
36716 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ieee1394/iso.h linux-2.6.29-rc3.owrt/drivers/ieee1394/iso.h
36717 --- linux-2.6.29.owrt/drivers/ieee1394/iso.h 2009-05-10 22:04:38.000000000 +0200
36718 +++ linux-2.6.29-rc3.owrt/drivers/ieee1394/iso.h 2009-05-10 23:48:28.000000000 +0200
36719 @@ -13,7 +13,6 @@
36720 #define IEEE1394_ISO_H
36721
36722 #include <linux/spinlock_types.h>
36723 -#include <linux/wait.h>
36724 #include <asm/atomic.h>
36725 #include <asm/types.h>
36726
36727 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ieee1394/nodemgr.c linux-2.6.29-rc3.owrt/drivers/ieee1394/nodemgr.c
36728 --- linux-2.6.29.owrt/drivers/ieee1394/nodemgr.c 2009-05-10 22:04:38.000000000 +0200
36729 +++ linux-2.6.29-rc3.owrt/drivers/ieee1394/nodemgr.c 2009-05-10 23:48:28.000000000 +0200
36730 @@ -971,9 +971,6 @@
36731 ud->ud_kv = ud_kv;
36732 ud->id = (*id)++;
36733
36734 - /* inherit vendor_id from root directory if none exists in unit dir */
36735 - ud->vendor_id = ne->vendor_id;
36736 -
36737 csr1212_for_each_dir_entry(ne->csr, kv, ud_kv, dentry) {
36738 switch (kv->key.id) {
36739 case CSR1212_KV_ID_VENDOR:
36740 @@ -1268,8 +1265,7 @@
36741 csr1212_destroy_csr(csr);
36742 }
36743
36744 - /* Finally, mark the node current */
36745 - smp_wmb();
36746 + /* Mark the node current */
36747 ne->generation = generation;
36748
36749 if (ne->in_limbo) {
36750 @@ -1802,7 +1798,7 @@
36751 {
36752 packet->host = ne->host;
36753 packet->generation = ne->generation;
36754 - smp_rmb();
36755 + barrier();
36756 packet->node_id = ne->nodeid;
36757 }
36758
36759 @@ -1811,7 +1807,7 @@
36760 {
36761 unsigned int generation = ne->generation;
36762
36763 - smp_rmb();
36764 + barrier();
36765 return hpsb_write(ne->host, ne->nodeid, generation,
36766 addr, buffer, length);
36767 }
36768 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ieee1394/nodemgr.h linux-2.6.29-rc3.owrt/drivers/ieee1394/nodemgr.h
36769 --- linux-2.6.29.owrt/drivers/ieee1394/nodemgr.h 2009-05-10 22:04:38.000000000 +0200
36770 +++ linux-2.6.29-rc3.owrt/drivers/ieee1394/nodemgr.h 2009-05-10 23:48:28.000000000 +0200
36771 @@ -21,11 +21,9 @@
36772 #define _IEEE1394_NODEMGR_H
36773
36774 #include <linux/device.h>
36775 -#include <asm/system.h>
36776 #include <asm/types.h>
36777
36778 #include "ieee1394_core.h"
36779 -#include "ieee1394_transactions.h"
36780 #include "ieee1394_types.h"
36781
36782 struct csr1212_csr;
36783 @@ -156,22 +154,6 @@
36784 void hpsb_node_fill_packet(struct node_entry *ne, struct hpsb_packet *packet);
36785 int hpsb_node_write(struct node_entry *ne, u64 addr,
36786 quadlet_t *buffer, size_t length);
36787 -static inline int hpsb_node_read(struct node_entry *ne, u64 addr,
36788 - quadlet_t *buffer, size_t length)
36789 -{
36790 - unsigned int g = ne->generation;
36791 -
36792 - smp_rmb();
36793 - return hpsb_read(ne->host, ne->nodeid, g, addr, buffer, length);
36794 -}
36795 -static inline int hpsb_node_lock(struct node_entry *ne, u64 addr, int extcode,
36796 - quadlet_t *buffer, quadlet_t arg)
36797 -{
36798 - unsigned int g = ne->generation;
36799 -
36800 - smp_rmb();
36801 - return hpsb_lock(ne->host, ne->nodeid, g, addr, extcode, buffer, arg);
36802 -}
36803 int nodemgr_for_each_host(void *data, int (*cb)(struct hpsb_host *, void *));
36804
36805 int init_ieee1394_nodemgr(void);
36806 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ieee1394/ohci1394.h linux-2.6.29-rc3.owrt/drivers/ieee1394/ohci1394.h
36807 --- linux-2.6.29.owrt/drivers/ieee1394/ohci1394.h 2009-05-10 22:04:38.000000000 +0200
36808 +++ linux-2.6.29-rc3.owrt/drivers/ieee1394/ohci1394.h 2009-05-10 23:48:28.000000000 +0200
36809 @@ -26,7 +26,7 @@
36810
36811 #define OHCI1394_DRIVER_NAME "ohci1394"
36812
36813 -#define OHCI1394_MAX_AT_REQ_RETRIES 0xf
36814 +#define OHCI1394_MAX_AT_REQ_RETRIES 0x2
36815 #define OHCI1394_MAX_AT_RESP_RETRIES 0x2
36816 #define OHCI1394_MAX_PHYS_RESP_RETRIES 0x8
36817 #define OHCI1394_MAX_SELF_ID_ERRORS 16
36818 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/ieee1394/sbp2.c linux-2.6.29-rc3.owrt/drivers/ieee1394/sbp2.c
36819 --- linux-2.6.29.owrt/drivers/ieee1394/sbp2.c 2009-05-10 22:04:38.000000000 +0200
36820 +++ linux-2.6.29-rc3.owrt/drivers/ieee1394/sbp2.c 2009-05-10 23:48:28.000000000 +0200
36821 @@ -115,8 +115,8 @@
36822 */
36823 static int sbp2_max_speed = IEEE1394_SPEED_MAX;
36824 module_param_named(max_speed, sbp2_max_speed, int, 0644);
36825 -MODULE_PARM_DESC(max_speed, "Limit data transfer speed (5 <= 3200, "
36826 - "4 <= 1600, 3 <= 800, 2 <= 400, 1 <= 200, 0 = 100 Mb/s)");
36827 +MODULE_PARM_DESC(max_speed, "Force max speed "
36828 + "(3 = 800Mb/s, 2 = 400Mb/s, 1 = 200Mb/s, 0 = 100Mb/s)");
36829
36830 /*
36831 * Set serialize_io to 0 or N to use dynamically appended lists of command ORBs.
36832 @@ -256,7 +256,7 @@
36833 static int sbp2_max_speed_and_size(struct sbp2_lu *);
36834
36835
36836 -static const u8 sbp2_speedto_max_payload[] = { 0x7, 0x8, 0x9, 0xa, 0xa, 0xa };
36837 +static const u8 sbp2_speedto_max_payload[] = { 0x7, 0x8, 0x9, 0xA, 0xB, 0xC };
36838
36839 static DEFINE_RWLOCK(sbp2_hi_logical_units_lock);
36840
36841 @@ -347,8 +347,8 @@
36842 .sdev_attrs = sbp2_sysfs_sdev_attrs,
36843 };
36844
36845 -#define SBP2_ROM_VALUE_WILDCARD ~0 /* match all */
36846 -#define SBP2_ROM_VALUE_MISSING 0xff000000 /* not present in the unit dir. */
36847 +/* for match-all entries in sbp2_workarounds_table */
36848 +#define SBP2_ROM_VALUE_WILDCARD 0x1000000
36849
36850 /*
36851 * List of devices with known bugs.
36852 @@ -359,70 +359,60 @@
36853 */
36854 static const struct {
36855 u32 firmware_revision;
36856 - u32 model;
36857 + u32 model_id;
36858 unsigned workarounds;
36859 } sbp2_workarounds_table[] = {
36860 /* DViCO Momobay CX-1 with TSB42AA9 bridge */ {
36861 .firmware_revision = 0x002800,
36862 - .model = 0x001010,
36863 + .model_id = 0x001010,
36864 .workarounds = SBP2_WORKAROUND_INQUIRY_36 |
36865 SBP2_WORKAROUND_MODE_SENSE_8 |
36866 SBP2_WORKAROUND_POWER_CONDITION,
36867 },
36868 /* DViCO Momobay FX-3A with TSB42AA9A bridge */ {
36869 .firmware_revision = 0x002800,
36870 - .model = 0x000000,
36871 + .model_id = 0x000000,
36872 .workarounds = SBP2_WORKAROUND_DELAY_INQUIRY |
36873 SBP2_WORKAROUND_POWER_CONDITION,
36874 },
36875 /* Initio bridges, actually only needed for some older ones */ {
36876 .firmware_revision = 0x000200,
36877 - .model = SBP2_ROM_VALUE_WILDCARD,
36878 + .model_id = SBP2_ROM_VALUE_WILDCARD,
36879 .workarounds = SBP2_WORKAROUND_INQUIRY_36,
36880 },
36881 /* PL-3507 bridge with Prolific firmware */ {
36882 .firmware_revision = 0x012800,
36883 - .model = SBP2_ROM_VALUE_WILDCARD,
36884 + .model_id = SBP2_ROM_VALUE_WILDCARD,
36885 .workarounds = SBP2_WORKAROUND_POWER_CONDITION,
36886 },
36887 /* Symbios bridge */ {
36888 .firmware_revision = 0xa0b800,
36889 - .model = SBP2_ROM_VALUE_WILDCARD,
36890 + .model_id = SBP2_ROM_VALUE_WILDCARD,
36891 .workarounds = SBP2_WORKAROUND_128K_MAX_TRANS,
36892 },
36893 /* Datafab MD2-FW2 with Symbios/LSILogic SYM13FW500 bridge */ {
36894 .firmware_revision = 0x002600,
36895 - .model = SBP2_ROM_VALUE_WILDCARD,
36896 + .model_id = SBP2_ROM_VALUE_WILDCARD,
36897 .workarounds = SBP2_WORKAROUND_128K_MAX_TRANS,
36898 },
36899 - /*
36900 - * iPod 2nd generation: needs 128k max transfer size workaround
36901 - * iPod 3rd generation: needs fix capacity workaround
36902 - */
36903 - {
36904 - .firmware_revision = 0x0a2700,
36905 - .model = 0x000000,
36906 - .workarounds = SBP2_WORKAROUND_128K_MAX_TRANS |
36907 - SBP2_WORKAROUND_FIX_CAPACITY,
36908 - },
36909 /* iPod 4th generation */ {
36910 .firmware_revision = 0x0a2700,
36911 - .model = 0x000021,
36912 + .model_id = 0x000021,
36913 .workarounds = SBP2_WORKAROUND_FIX_CAPACITY,
36914 },
36915 /* iPod mini */ {
36916 .firmware_revision = 0x0a2700,
36917 - .model = 0x000022,
36918 + .model_id = 0x000022,
36919 .workarounds = SBP2_WORKAROUND_FIX_CAPACITY,
36920 },
36921 /* iPod mini */ {
36922 .firmware_revision = 0x0a2700,
36923 - .model = 0x000023,
36924 + .model_id = 0x000023,
36925 .workarounds = SBP2_WORKAROUND_FIX_CAPACITY,
36926 },
36927 /* iPod Photo */ {
36928 .firmware_revision = 0x0a2700,
36929 - .model = 0x00007e,
36930 + .model_id = 0x00007e,
36931 .workarounds = SBP2_WORKAROUND_FIX_CAPACITY,
36932 }
36933 };
36934 @@ -1351,15 +1341,13 @@
36935 struct csr1212_keyval *kv;
36936 struct csr1212_dentry *dentry;
36937 u64 management_agent_addr;
36938 - u32 unit_characteristics, firmware_revision, model;
36939 + u32 unit_characteristics, firmware_revision;
36940 unsigned workarounds;
36941 int i;
36942
36943 management_agent_addr = 0;
36944 unit_characteristics = 0;
36945 - firmware_revision = SBP2_ROM_VALUE_MISSING;
36946 - model = ud->flags & UNIT_DIRECTORY_MODEL_ID ?
36947 - ud->model_id : SBP2_ROM_VALUE_MISSING;
36948 + firmware_revision = 0;
36949
36950 csr1212_for_each_dir_entry(ud->ne->csr, kv, ud->ud_kv, dentry) {
36951 switch (kv->key.id) {
36952 @@ -1400,9 +1388,9 @@
36953 sbp2_workarounds_table[i].firmware_revision !=
36954 (firmware_revision & 0xffff00))
36955 continue;
36956 - if (sbp2_workarounds_table[i].model !=
36957 + if (sbp2_workarounds_table[i].model_id !=
36958 SBP2_ROM_VALUE_WILDCARD &&
36959 - sbp2_workarounds_table[i].model != model)
36960 + sbp2_workarounds_table[i].model_id != ud->model_id)
36961 continue;
36962 workarounds |= sbp2_workarounds_table[i].workarounds;
36963 break;
36964 @@ -1415,7 +1403,7 @@
36965 NODE_BUS_ARGS(ud->ne->host, ud->ne->nodeid),
36966 workarounds, firmware_revision,
36967 ud->vendor_id ? ud->vendor_id : ud->ne->vendor_id,
36968 - model);
36969 + ud->model_id);
36970
36971 /* We would need one SCSI host template for each target to adjust
36972 * max_sectors on the fly, therefore warn only. */
36973 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/infiniband/hw/nes/nes_cm.c linux-2.6.29-rc3.owrt/drivers/infiniband/hw/nes/nes_cm.c
36974 --- linux-2.6.29.owrt/drivers/infiniband/hw/nes/nes_cm.c 2009-05-10 22:04:38.000000000 +0200
36975 +++ linux-2.6.29-rc3.owrt/drivers/infiniband/hw/nes/nes_cm.c 2009-05-10 23:48:28.000000000 +0200
36976 @@ -2490,14 +2490,12 @@
36977 int ret = 0;
36978 struct nes_vnic *nesvnic;
36979 struct nes_device *nesdev;
36980 - struct nes_ib_device *nesibdev;
36981
36982 nesvnic = to_nesvnic(nesqp->ibqp.device);
36983 if (!nesvnic)
36984 return -EINVAL;
36985
36986 nesdev = nesvnic->nesdev;
36987 - nesibdev = nesvnic->nesibdev;
36988
36989 nes_debug(NES_DBG_CM, "netdev refcnt = %u.\n",
36990 atomic_read(&nesvnic->netdev->refcnt));
36991 @@ -2509,8 +2507,6 @@
36992 } else {
36993 /* Need to free the Last Streaming Mode Message */
36994 if (nesqp->ietf_frame) {
36995 - if (nesqp->lsmm_mr)
36996 - nesibdev->ibdev.dereg_mr(nesqp->lsmm_mr);
36997 pci_free_consistent(nesdev->pcidev,
36998 nesqp->private_data_len+sizeof(struct ietf_mpa_frame),
36999 nesqp->ietf_frame, nesqp->ietf_frame_pbase);
37000 @@ -2547,12 +2543,6 @@
37001 u32 crc_value;
37002 int ret;
37003 int passive_state;
37004 - struct nes_ib_device *nesibdev;
37005 - struct ib_mr *ibmr = NULL;
37006 - struct ib_phys_buf ibphysbuf;
37007 - struct nes_pd *nespd;
37008 -
37009 -
37010
37011 ibqp = nes_get_qp(cm_id->device, conn_param->qpn);
37012 if (!ibqp)
37013 @@ -2611,26 +2601,6 @@
37014 if (cm_id->remote_addr.sin_addr.s_addr !=
37015 cm_id->local_addr.sin_addr.s_addr) {
37016 u64temp = (unsigned long)nesqp;
37017 - nesibdev = nesvnic->nesibdev;
37018 - nespd = nesqp->nespd;
37019 - ibphysbuf.addr = nesqp->ietf_frame_pbase;
37020 - ibphysbuf.size = conn_param->private_data_len +
37021 - sizeof(struct ietf_mpa_frame);
37022 - ibmr = nesibdev->ibdev.reg_phys_mr((struct ib_pd *)nespd,
37023 - &ibphysbuf, 1,
37024 - IB_ACCESS_LOCAL_WRITE,
37025 - (u64 *)&nesqp->ietf_frame);
37026 - if (!ibmr) {
37027 - nes_debug(NES_DBG_CM, "Unable to register memory region"
37028 - "for lSMM for cm_node = %p \n",
37029 - cm_node);
37030 - return -ENOMEM;
37031 - }
37032 -
37033 - ibmr->pd = &nespd->ibpd;
37034 - ibmr->device = nespd->ibpd.device;
37035 - nesqp->lsmm_mr = ibmr;
37036 -
37037 u64temp |= NES_SW_CONTEXT_ALIGN>>1;
37038 set_wqe_64bit_value(wqe->wqe_words,
37039 NES_IWARP_SQ_WQE_COMP_CTX_LOW_IDX,
37040 @@ -2641,13 +2611,14 @@
37041 wqe->wqe_words[NES_IWARP_SQ_WQE_TOTAL_PAYLOAD_IDX] =
37042 cpu_to_le32(conn_param->private_data_len +
37043 sizeof(struct ietf_mpa_frame));
37044 - set_wqe_64bit_value(wqe->wqe_words,
37045 - NES_IWARP_SQ_WQE_FRAG0_LOW_IDX,
37046 - (u64)nesqp->ietf_frame);
37047 + wqe->wqe_words[NES_IWARP_SQ_WQE_FRAG0_LOW_IDX] =
37048 + cpu_to_le32((u32)nesqp->ietf_frame_pbase);
37049 + wqe->wqe_words[NES_IWARP_SQ_WQE_FRAG0_HIGH_IDX] =
37050 + cpu_to_le32((u32)((u64)nesqp->ietf_frame_pbase >> 32));
37051 wqe->wqe_words[NES_IWARP_SQ_WQE_LENGTH0_IDX] =
37052 cpu_to_le32(conn_param->private_data_len +
37053 sizeof(struct ietf_mpa_frame));
37054 - wqe->wqe_words[NES_IWARP_SQ_WQE_STAG0_IDX] = ibmr->lkey;
37055 + wqe->wqe_words[NES_IWARP_SQ_WQE_STAG0_IDX] = 0;
37056
37057 nesqp->nesqp_context->ird_ord_sizes |=
37058 cpu_to_le32(NES_QPCONTEXT_ORDIRD_LSMM_PRESENT |
37059 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/infiniband/hw/nes/nes_verbs.c linux-2.6.29-rc3.owrt/drivers/infiniband/hw/nes/nes_verbs.c
37060 --- linux-2.6.29.owrt/drivers/infiniband/hw/nes/nes_verbs.c 2009-05-10 22:04:38.000000000 +0200
37061 +++ linux-2.6.29-rc3.owrt/drivers/infiniband/hw/nes/nes_verbs.c 2009-05-10 23:48:28.000000000 +0200
37062 @@ -1360,10 +1360,8 @@
37063 NES_QPCONTEXT_MISC_RQ_SIZE_SHIFT);
37064 nesqp->nesqp_context->misc |= cpu_to_le32((u32)nesqp->hwqp.sq_encoded_size <<
37065 NES_QPCONTEXT_MISC_SQ_SIZE_SHIFT);
37066 - if (!udata) {
37067 nesqp->nesqp_context->misc |= cpu_to_le32(NES_QPCONTEXT_MISC_PRIV_EN);
37068 nesqp->nesqp_context->misc |= cpu_to_le32(NES_QPCONTEXT_MISC_FAST_REGISTER_EN);
37069 - }
37070 nesqp->nesqp_context->cqs = cpu_to_le32(nesqp->nesscq->hw_cq.cq_number +
37071 ((u32)nesqp->nesrcq->hw_cq.cq_number << 16));
37072 u64temp = (u64)nesqp->hwqp.sq_pbase;
37073 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/infiniband/hw/nes/nes_verbs.h linux-2.6.29-rc3.owrt/drivers/infiniband/hw/nes/nes_verbs.h
37074 --- linux-2.6.29.owrt/drivers/infiniband/hw/nes/nes_verbs.h 2009-05-10 22:04:38.000000000 +0200
37075 +++ linux-2.6.29-rc3.owrt/drivers/infiniband/hw/nes/nes_verbs.h 2009-05-10 23:48:28.000000000 +0200
37076 @@ -134,7 +134,6 @@
37077 struct ietf_mpa_frame *ietf_frame;
37078 dma_addr_t ietf_frame_pbase;
37079 wait_queue_head_t state_waitq;
37080 - struct ib_mr *lsmm_mr;
37081 unsigned long socket;
37082 struct nes_hw_qp hwqp;
37083 struct work_struct work;
37084 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/input/keyboard/atkbd.c linux-2.6.29-rc3.owrt/drivers/input/keyboard/atkbd.c
37085 --- linux-2.6.29.owrt/drivers/input/keyboard/atkbd.c 2009-05-10 22:04:39.000000000 +0200
37086 +++ linux-2.6.29-rc3.owrt/drivers/input/keyboard/atkbd.c 2009-05-10 23:48:28.000000000 +0200
37087 @@ -839,7 +839,7 @@
37088 */
37089 static void atkbd_dell_laptop_keymap_fixup(struct atkbd *atkbd)
37090 {
37091 - static const unsigned int forced_release_keys[] = {
37092 + const unsigned int forced_release_keys[] = {
37093 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8f, 0x93,
37094 };
37095 int i;
37096 @@ -856,7 +856,7 @@
37097 */
37098 static void atkbd_hp_keymap_fixup(struct atkbd *atkbd)
37099 {
37100 - static const unsigned int forced_release_keys[] = {
37101 + const unsigned int forced_release_keys[] = {
37102 0x94,
37103 };
37104 int i;
37105 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/input/keyboard/bf54x-keys.c linux-2.6.29-rc3.owrt/drivers/input/keyboard/bf54x-keys.c
37106 --- linux-2.6.29.owrt/drivers/input/keyboard/bf54x-keys.c 2009-05-10 22:04:39.000000000 +0200
37107 +++ linux-2.6.29-rc3.owrt/drivers/input/keyboard/bf54x-keys.c 2009-05-10 23:48:28.000000000 +0200
37108 @@ -209,8 +209,8 @@
37109 goto out;
37110 }
37111
37112 - if (!pdata->debounce_time || pdata->debounce_time > MAX_MULT ||
37113 - !pdata->coldrive_time || pdata->coldrive_time > MAX_MULT) {
37114 + if (!pdata->debounce_time || !pdata->debounce_time > MAX_MULT ||
37115 + !pdata->coldrive_time || !pdata->coldrive_time > MAX_MULT) {
37116 printk(KERN_ERR DRV_NAME
37117 ": Invalid Debounce/Columdrive Time from pdata\n");
37118 bfin_write_KPAD_MSEL(0xFF0); /* Default MSEL */
37119 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/input/keyboard/corgikbd.c linux-2.6.29-rc3.owrt/drivers/input/keyboard/corgikbd.c
37120 --- linux-2.6.29.owrt/drivers/input/keyboard/corgikbd.c 2009-05-10 22:04:39.000000000 +0200
37121 +++ linux-2.6.29-rc3.owrt/drivers/input/keyboard/corgikbd.c 2009-05-10 23:48:28.000000000 +0200
37122 @@ -288,7 +288,7 @@
37123 #define corgikbd_resume NULL
37124 #endif
37125
37126 -static int __devinit corgikbd_probe(struct platform_device *pdev)
37127 +static int __init corgikbd_probe(struct platform_device *pdev)
37128 {
37129 struct corgikbd *corgikbd;
37130 struct input_dev *input_dev;
37131 @@ -368,7 +368,7 @@
37132 return err;
37133 }
37134
37135 -static int __devexit corgikbd_remove(struct platform_device *pdev)
37136 +static int corgikbd_remove(struct platform_device *pdev)
37137 {
37138 int i;
37139 struct corgikbd *corgikbd = platform_get_drvdata(pdev);
37140 @@ -388,7 +388,7 @@
37141
37142 static struct platform_driver corgikbd_driver = {
37143 .probe = corgikbd_probe,
37144 - .remove = __devexit_p(corgikbd_remove),
37145 + .remove = corgikbd_remove,
37146 .suspend = corgikbd_suspend,
37147 .resume = corgikbd_resume,
37148 .driver = {
37149 @@ -397,7 +397,7 @@
37150 },
37151 };
37152
37153 -static int __init corgikbd_init(void)
37154 +static int __devinit corgikbd_init(void)
37155 {
37156 return platform_driver_register(&corgikbd_driver);
37157 }
37158 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/input/keyboard/omap-keypad.c linux-2.6.29-rc3.owrt/drivers/input/keyboard/omap-keypad.c
37159 --- linux-2.6.29.owrt/drivers/input/keyboard/omap-keypad.c 2009-05-10 22:04:39.000000000 +0200
37160 +++ linux-2.6.29-rc3.owrt/drivers/input/keyboard/omap-keypad.c 2009-05-10 23:48:28.000000000 +0200
37161 @@ -279,7 +279,7 @@
37162 #define omap_kp_resume NULL
37163 #endif
37164
37165 -static int __devinit omap_kp_probe(struct platform_device *pdev)
37166 +static int __init omap_kp_probe(struct platform_device *pdev)
37167 {
37168 struct omap_kp *omap_kp;
37169 struct input_dev *input_dev;
37170 @@ -422,7 +422,7 @@
37171 return -EINVAL;
37172 }
37173
37174 -static int __devexit omap_kp_remove(struct platform_device *pdev)
37175 +static int omap_kp_remove(struct platform_device *pdev)
37176 {
37177 struct omap_kp *omap_kp = platform_get_drvdata(pdev);
37178
37179 @@ -454,7 +454,7 @@
37180
37181 static struct platform_driver omap_kp_driver = {
37182 .probe = omap_kp_probe,
37183 - .remove = __devexit_p(omap_kp_remove),
37184 + .remove = omap_kp_remove,
37185 .suspend = omap_kp_suspend,
37186 .resume = omap_kp_resume,
37187 .driver = {
37188 @@ -463,7 +463,7 @@
37189 },
37190 };
37191
37192 -static int __init omap_kp_init(void)
37193 +static int __devinit omap_kp_init(void)
37194 {
37195 printk(KERN_INFO "OMAP Keypad Driver\n");
37196 return platform_driver_register(&omap_kp_driver);
37197 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/input/keyboard/spitzkbd.c linux-2.6.29-rc3.owrt/drivers/input/keyboard/spitzkbd.c
37198 --- linux-2.6.29.owrt/drivers/input/keyboard/spitzkbd.c 2009-05-10 22:04:39.000000000 +0200
37199 +++ linux-2.6.29-rc3.owrt/drivers/input/keyboard/spitzkbd.c 2009-05-10 23:48:28.000000000 +0200
37200 @@ -343,7 +343,7 @@
37201 #define spitzkbd_resume NULL
37202 #endif
37203
37204 -static int __devinit spitzkbd_probe(struct platform_device *dev)
37205 +static int __init spitzkbd_probe(struct platform_device *dev)
37206 {
37207 struct spitzkbd *spitzkbd;
37208 struct input_dev *input_dev;
37209 @@ -444,7 +444,7 @@
37210 return err;
37211 }
37212
37213 -static int __devexit spitzkbd_remove(struct platform_device *dev)
37214 +static int spitzkbd_remove(struct platform_device *dev)
37215 {
37216 int i;
37217 struct spitzkbd *spitzkbd = platform_get_drvdata(dev);
37218 @@ -470,7 +470,7 @@
37219
37220 static struct platform_driver spitzkbd_driver = {
37221 .probe = spitzkbd_probe,
37222 - .remove = __devexit_p(spitzkbd_remove),
37223 + .remove = spitzkbd_remove,
37224 .suspend = spitzkbd_suspend,
37225 .resume = spitzkbd_resume,
37226 .driver = {
37227 @@ -479,7 +479,7 @@
37228 },
37229 };
37230
37231 -static int __init spitzkbd_init(void)
37232 +static int __devinit spitzkbd_init(void)
37233 {
37234 return platform_driver_register(&spitzkbd_driver);
37235 }
37236 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/input/mouse/elantech.c linux-2.6.29-rc3.owrt/drivers/input/mouse/elantech.c
37237 --- linux-2.6.29.owrt/drivers/input/mouse/elantech.c 2009-05-10 22:04:39.000000000 +0200
37238 +++ linux-2.6.29-rc3.owrt/drivers/input/mouse/elantech.c 2009-05-10 23:48:28.000000000 +0200
37239 @@ -542,7 +542,7 @@
37240 ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) ||
37241 ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) ||
37242 ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO)) {
37243 - pr_debug("elantech.c: sending Elantech magic knock failed.\n");
37244 + pr_err("elantech.c: sending Elantech magic knock failed.\n");
37245 return -1;
37246 }
37247
37248 @@ -551,27 +551,8 @@
37249 * set of magic numbers
37250 */
37251 if (param[0] != 0x3c || param[1] != 0x03 || param[2] != 0xc8) {
37252 - pr_debug("elantech.c: "
37253 - "unexpected magic knock result 0x%02x, 0x%02x, 0x%02x.\n",
37254 - param[0], param[1], param[2]);
37255 - return -1;
37256 - }
37257 -
37258 - /*
37259 - * Query touchpad's firmware version and see if it reports known
37260 - * value to avoid mis-detection. Logitech mice are known to respond
37261 - * to Elantech magic knock and there might be more.
37262 - */
37263 - if (synaptics_send_cmd(psmouse, ETP_FW_VERSION_QUERY, param)) {
37264 - pr_debug("elantech.c: failed to query firmware version.\n");
37265 - return -1;
37266 - }
37267 -
37268 - pr_debug("elantech.c: Elantech version query result 0x%02x, 0x%02x, 0x%02x.\n",
37269 - param[0], param[1], param[2]);
37270 -
37271 - if (param[0] == 0 || param[1] != 0) {
37272 - pr_debug("elantech.c: Probably not a real Elantech touchpad. Aborting.\n");
37273 + pr_info("elantech.c: unexpected magic knock result 0x%02x, 0x%02x, 0x%02x.\n",
37274 + param[0], param[1], param[2]);
37275 return -1;
37276 }
37277
37278 @@ -619,7 +600,8 @@
37279 int i, error;
37280 unsigned char param[3];
37281
37282 - psmouse->private = etd = kzalloc(sizeof(struct elantech_data), GFP_KERNEL);
37283 + etd = kzalloc(sizeof(struct elantech_data), GFP_KERNEL);
37284 + psmouse->private = etd;
37285 if (!etd)
37286 return -1;
37287
37288 @@ -628,12 +610,14 @@
37289 etd->parity[i] = etd->parity[i & (i - 1)] ^ 1;
37290
37291 /*
37292 - * Do the version query again so we can store the result
37293 + * Find out what version hardware this is
37294 */
37295 if (synaptics_send_cmd(psmouse, ETP_FW_VERSION_QUERY, param)) {
37296 pr_err("elantech.c: failed to query firmware version.\n");
37297 goto init_fail;
37298 }
37299 + pr_info("elantech.c: Elantech version query result 0x%02x, 0x%02x, 0x%02x.\n",
37300 + param[0], param[1], param[2]);
37301 etd->fw_version_maj = param[0];
37302 etd->fw_version_min = param[2];
37303
37304 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/input/mouse/Kconfig linux-2.6.29-rc3.owrt/drivers/input/mouse/Kconfig
37305 --- linux-2.6.29.owrt/drivers/input/mouse/Kconfig 2009-05-10 22:04:39.000000000 +0200
37306 +++ linux-2.6.29-rc3.owrt/drivers/input/mouse/Kconfig 2009-05-10 23:48:28.000000000 +0200
37307 @@ -70,7 +70,7 @@
37308 config MOUSE_PS2_LIFEBOOK
37309 bool "Fujitsu Lifebook PS/2 mouse protocol extension" if EMBEDDED
37310 default y
37311 - depends on MOUSE_PS2 && X86
37312 + depends on MOUSE_PS2
37313 help
37314 Say Y here if you have a Fujitsu B-series Lifebook PS/2
37315 TouchScreen connected to your system.
37316 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/input/mouse/pxa930_trkball.c linux-2.6.29-rc3.owrt/drivers/input/mouse/pxa930_trkball.c
37317 --- linux-2.6.29.owrt/drivers/input/mouse/pxa930_trkball.c 2009-05-10 22:04:39.000000000 +0200
37318 +++ linux-2.6.29-rc3.owrt/drivers/input/mouse/pxa930_trkball.c 2009-05-10 23:48:28.000000000 +0200
37319 @@ -83,7 +83,7 @@
37320
37321 __raw_writel(v, trkball->mmio_base + TBCR);
37322
37323 - while (--i) {
37324 + while (i--) {
37325 if (__raw_readl(trkball->mmio_base + TBCR) == v)
37326 break;
37327 msleep(1);
37328 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/input/mouse/synaptics.c linux-2.6.29-rc3.owrt/drivers/input/mouse/synaptics.c
37329 --- linux-2.6.29.owrt/drivers/input/mouse/synaptics.c 2009-05-10 22:04:39.000000000 +0200
37330 +++ linux-2.6.29-rc3.owrt/drivers/input/mouse/synaptics.c 2009-05-10 23:48:28.000000000 +0200
37331 @@ -182,6 +182,11 @@
37332
37333 static int synaptics_query_hardware(struct psmouse *psmouse)
37334 {
37335 + int retries = 0;
37336 +
37337 + while ((retries++ < 3) && psmouse_reset(psmouse))
37338 + /* empty */;
37339 +
37340 if (synaptics_identify(psmouse))
37341 return -1;
37342 if (synaptics_model_id(psmouse))
37343 @@ -577,8 +582,6 @@
37344 struct synaptics_data *priv = psmouse->private;
37345 struct synaptics_data old_priv = *priv;
37346
37347 - psmouse_reset(psmouse);
37348 -
37349 if (synaptics_detect(psmouse, 0))
37350 return -1;
37351
37352 @@ -637,8 +640,6 @@
37353 if (!priv)
37354 return -1;
37355
37356 - psmouse_reset(psmouse);
37357 -
37358 if (synaptics_query_hardware(psmouse)) {
37359 printk(KERN_ERR "Unable to query Synaptics hardware.\n");
37360 goto init_fail;
37361 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/input/serio/ambakmi.c linux-2.6.29-rc3.owrt/drivers/input/serio/ambakmi.c
37362 --- linux-2.6.29.owrt/drivers/input/serio/ambakmi.c 2009-05-10 22:04:39.000000000 +0200
37363 +++ linux-2.6.29-rc3.owrt/drivers/input/serio/ambakmi.c 2009-05-10 23:48:28.000000000 +0200
37364 @@ -57,7 +57,7 @@
37365 struct amba_kmi_port *kmi = io->port_data;
37366 unsigned int timeleft = 10000; /* timeout in 100ms */
37367
37368 - while ((readb(KMISTAT) & KMISTAT_TXEMPTY) == 0 && --timeleft)
37369 + while ((readb(KMISTAT) & KMISTAT_TXEMPTY) == 0 && timeleft--)
37370 udelay(10);
37371
37372 if (timeleft)
37373 @@ -129,8 +129,8 @@
37374 io->write = amba_kmi_write;
37375 io->open = amba_kmi_open;
37376 io->close = amba_kmi_close;
37377 - strlcpy(io->name, dev_name(&dev->dev), sizeof(io->name));
37378 - strlcpy(io->phys, dev_name(&dev->dev), sizeof(io->phys));
37379 + strlcpy(io->name, dev->dev.bus_id, sizeof(io->name));
37380 + strlcpy(io->phys, dev->dev.bus_id, sizeof(io->phys));
37381 io->port_data = kmi;
37382 io->dev.parent = &dev->dev;
37383
37384 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/input/serio/gscps2.c linux-2.6.29-rc3.owrt/drivers/input/serio/gscps2.c
37385 --- linux-2.6.29.owrt/drivers/input/serio/gscps2.c 2009-05-10 22:04:39.000000000 +0200
37386 +++ linux-2.6.29-rc3.owrt/drivers/input/serio/gscps2.c 2009-05-10 23:48:28.000000000 +0200
37387 @@ -359,7 +359,7 @@
37388
37389 snprintf(serio->name, sizeof(serio->name), "GSC PS/2 %s",
37390 (ps2port->id == GSC_ID_KEYBOARD) ? "keyboard" : "mouse");
37391 - strlcpy(serio->phys, dev_name(&dev->dev), sizeof(serio->phys));
37392 + strlcpy(serio->phys, dev->dev.bus_id, sizeof(serio->phys));
37393 serio->id.type = SERIO_8042;
37394 serio->write = gscps2_write;
37395 serio->open = gscps2_open;
37396 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/input/serio/sa1111ps2.c linux-2.6.29-rc3.owrt/drivers/input/serio/sa1111ps2.c
37397 --- linux-2.6.29.owrt/drivers/input/serio/sa1111ps2.c 2009-05-10 22:04:39.000000000 +0200
37398 +++ linux-2.6.29-rc3.owrt/drivers/input/serio/sa1111ps2.c 2009-05-10 23:48:28.000000000 +0200
37399 @@ -246,8 +246,8 @@
37400 serio->write = ps2_write;
37401 serio->open = ps2_open;
37402 serio->close = ps2_close;
37403 - strlcpy(serio->name, dev_name(&dev->dev), sizeof(serio->name));
37404 - strlcpy(serio->phys, dev_name(&dev->dev), sizeof(serio->phys));
37405 + strlcpy(serio->name, dev->dev.bus_id, sizeof(serio->name));
37406 + strlcpy(serio->phys, dev->dev.bus_id, sizeof(serio->phys));
37407 serio->port_data = ps2if;
37408 serio->dev.parent = &dev->dev;
37409 ps2if->io = serio;
37410 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/input/touchscreen/atmel_tsadcc.c linux-2.6.29-rc3.owrt/drivers/input/touchscreen/atmel_tsadcc.c
37411 --- linux-2.6.29.owrt/drivers/input/touchscreen/atmel_tsadcc.c 2009-05-10 22:04:39.000000000 +0200
37412 +++ linux-2.6.29-rc3.owrt/drivers/input/touchscreen/atmel_tsadcc.c 2009-05-10 23:48:28.000000000 +0200
37413 @@ -236,7 +236,7 @@
37414 ts_dev->bufferedmeasure = 0;
37415
37416 snprintf(ts_dev->phys, sizeof(ts_dev->phys),
37417 - "%s/input0", dev_name(&pdev->dev));
37418 + "%s/input0", pdev->dev.bus_id);
37419
37420 input_dev->name = "atmel touch screen controller";
37421 input_dev->phys = ts_dev->phys;
37422 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/input/touchscreen/corgi_ts.c linux-2.6.29-rc3.owrt/drivers/input/touchscreen/corgi_ts.c
37423 --- linux-2.6.29.owrt/drivers/input/touchscreen/corgi_ts.c 2009-05-10 22:04:39.000000000 +0200
37424 +++ linux-2.6.29-rc3.owrt/drivers/input/touchscreen/corgi_ts.c 2009-05-10 23:48:28.000000000 +0200
37425 @@ -268,7 +268,7 @@
37426 #define corgits_resume NULL
37427 #endif
37428
37429 -static int __devinit corgits_probe(struct platform_device *pdev)
37430 +static int __init corgits_probe(struct platform_device *pdev)
37431 {
37432 struct corgi_ts *corgi_ts;
37433 struct input_dev *input_dev;
37434 @@ -343,7 +343,7 @@
37435 return err;
37436 }
37437
37438 -static int __devexit corgits_remove(struct platform_device *pdev)
37439 +static int corgits_remove(struct platform_device *pdev)
37440 {
37441 struct corgi_ts *corgi_ts = platform_get_drvdata(pdev);
37442
37443 @@ -352,13 +352,12 @@
37444 corgi_ts->machinfo->put_hsync();
37445 input_unregister_device(corgi_ts->input);
37446 kfree(corgi_ts);
37447 -
37448 return 0;
37449 }
37450
37451 static struct platform_driver corgits_driver = {
37452 .probe = corgits_probe,
37453 - .remove = __devexit_p(corgits_remove),
37454 + .remove = corgits_remove,
37455 .suspend = corgits_suspend,
37456 .resume = corgits_resume,
37457 .driver = {
37458 @@ -367,7 +366,7 @@
37459 },
37460 };
37461
37462 -static int __init corgits_init(void)
37463 +static int __devinit corgits_init(void)
37464 {
37465 return platform_driver_register(&corgits_driver);
37466 }
37467 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/input/touchscreen/tsc2007.c linux-2.6.29-rc3.owrt/drivers/input/touchscreen/tsc2007.c
37468 --- linux-2.6.29.owrt/drivers/input/touchscreen/tsc2007.c 2009-05-10 22:04:39.000000000 +0200
37469 +++ linux-2.6.29-rc3.owrt/drivers/input/touchscreen/tsc2007.c 2009-05-10 23:48:28.000000000 +0200
37470 @@ -289,8 +289,7 @@
37471
37472 pdata->init_platform_hw();
37473
37474 - snprintf(ts->phys, sizeof(ts->phys),
37475 - "%s/input0", dev_name(&client->dev));
37476 + snprintf(ts->phys, sizeof(ts->phys), "%s/input0", client->dev.bus_id);
37477
37478 input_dev->name = "TSC2007 Touchscreen";
37479 input_dev->phys = ts->phys;
37480 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/input/touchscreen/usbtouchscreen.c linux-2.6.29-rc3.owrt/drivers/input/touchscreen/usbtouchscreen.c
37481 --- linux-2.6.29.owrt/drivers/input/touchscreen/usbtouchscreen.c 2009-05-10 22:04:39.000000000 +0200
37482 +++ linux-2.6.29-rc3.owrt/drivers/input/touchscreen/usbtouchscreen.c 2009-05-10 23:48:28.000000000 +0200
37483 @@ -60,10 +60,6 @@
37484 module_param(swap_xy, bool, 0644);
37485 MODULE_PARM_DESC(swap_xy, "If set X and Y axes are swapped.");
37486
37487 -static int hwcalib_xy;
37488 -module_param(hwcalib_xy, bool, 0644);
37489 -MODULE_PARM_DESC(hwcalib_xy, "If set hw-calibrated X/Y are used if available");
37490 -
37491 /* device specifc data/functions */
37492 struct usbtouch_usb;
37493 struct usbtouch_device_info {
37494 @@ -122,7 +118,6 @@
37495
37496 #define USB_DEVICE_HID_CLASS(vend, prod) \
37497 .match_flags = USB_DEVICE_ID_MATCH_INT_CLASS \
37498 - | USB_DEVICE_ID_MATCH_INT_PROTOCOL \
37499 | USB_DEVICE_ID_MATCH_DEVICE, \
37500 .idVendor = (vend), \
37501 .idProduct = (prod), \
37502 @@ -265,13 +260,8 @@
37503
37504 static int mtouch_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
37505 {
37506 - if (hwcalib_xy) {
37507 - dev->x = (pkt[4] << 8) | pkt[3];
37508 - dev->y = 0xffff - ((pkt[6] << 8) | pkt[5]);
37509 - } else {
37510 - dev->x = (pkt[8] << 8) | pkt[7];
37511 - dev->y = (pkt[10] << 8) | pkt[9];
37512 - }
37513 + dev->x = (pkt[8] << 8) | pkt[7];
37514 + dev->y = (pkt[10] << 8) | pkt[9];
37515 dev->touch = (pkt[2] & 0x40) ? 1 : 0;
37516
37517 return 1;
37518 @@ -304,12 +294,6 @@
37519 return ret;
37520 }
37521
37522 - /* Default min/max xy are the raw values, override if using hw-calib */
37523 - if (hwcalib_xy) {
37524 - input_set_abs_params(usbtouch->input, ABS_X, 0, 0xffff, 0, 0);
37525 - input_set_abs_params(usbtouch->input, ABS_Y, 0, 0xffff, 0, 0);
37526 - }
37527 -
37528 return 0;
37529 }
37530 #endif
37531 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/isdn/gigaset/bas-gigaset.c linux-2.6.29-rc3.owrt/drivers/isdn/gigaset/bas-gigaset.c
37532 --- linux-2.6.29.owrt/drivers/isdn/gigaset/bas-gigaset.c 2009-05-10 22:04:38.000000000 +0200
37533 +++ linux-2.6.29-rc3.owrt/drivers/isdn/gigaset/bas-gigaset.c 2009-05-10 23:48:28.000000000 +0200
37534 @@ -46,9 +46,6 @@
37535 /* length limit according to Siemens 3070usb-protokoll.doc ch. 2.1 */
37536 #define IF_WRITEBUF 264
37537
37538 -/* interrupt pipe message size according to ibid. ch. 2.2 */
37539 -#define IP_MSGSIZE 3
37540 -
37541 /* Values for the Gigaset 307x */
37542 #define USB_GIGA_VENDOR_ID 0x0681
37543 #define USB_3070_PRODUCT_ID 0x0001
37544 @@ -113,7 +110,7 @@
37545 unsigned char *rcvbuf; /* AT reply receive buffer */
37546
37547 struct urb *urb_int_in; /* URB for interrupt pipe */
37548 - unsigned char *int_in_buf;
37549 + unsigned char int_in_buf[3];
37550
37551 spinlock_t lock; /* locks all following */
37552 int basstate; /* bitmap (BS_*) */
37553 @@ -660,7 +657,7 @@
37554 }
37555
37556 /* drop incomplete packets even if the missing bytes wouldn't matter */
37557 - if (unlikely(urb->actual_length < IP_MSGSIZE)) {
37558 + if (unlikely(urb->actual_length < 3)) {
37559 dev_warn(cs->dev, "incomplete interrupt packet (%d bytes)\n",
37560 urb->actual_length);
37561 goto resubmit;
37562 @@ -2130,7 +2127,6 @@
37563 static void gigaset_freecshw(struct cardstate *cs)
37564 {
37565 /* timers, URBs and rcvbuf are disposed of in disconnect */
37566 - kfree(cs->hw.bas->int_in_buf);
37567 kfree(cs->hw.bas);
37568 cs->hw.bas = NULL;
37569 }
37570 @@ -2144,12 +2140,6 @@
37571 pr_err("out of memory\n");
37572 return 0;
37573 }
37574 - ucs->int_in_buf = kmalloc(IP_MSGSIZE, GFP_KERNEL);
37575 - if (!ucs->int_in_buf) {
37576 - kfree(ucs);
37577 - pr_err("out of memory\n");
37578 - return 0;
37579 - }
37580
37581 ucs->urb_cmd_in = NULL;
37582 ucs->urb_cmd_out = NULL;
37583 @@ -2302,7 +2292,7 @@
37584 usb_fill_int_urb(ucs->urb_int_in, udev,
37585 usb_rcvintpipe(udev,
37586 (endpoint->bEndpointAddress) & 0x0f),
37587 - ucs->int_in_buf, IP_MSGSIZE, read_int_callback, cs,
37588 + ucs->int_in_buf, 3, read_int_callback, cs,
37589 endpoint->bInterval);
37590 if ((rc = usb_submit_urb(ucs->urb_int_in, GFP_KERNEL)) != 0) {
37591 dev_err(cs->dev, "could not submit interrupt URB: %s\n",
37592 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/isdn/hardware/mISDN/hfcmulti.c linux-2.6.29-rc3.owrt/drivers/isdn/hardware/mISDN/hfcmulti.c
37593 --- linux-2.6.29.owrt/drivers/isdn/hardware/mISDN/hfcmulti.c 2009-05-10 22:04:38.000000000 +0200
37594 +++ linux-2.6.29-rc3.owrt/drivers/isdn/hardware/mISDN/hfcmulti.c 2009-05-10 23:48:28.000000000 +0200
37595 @@ -4599,7 +4599,6 @@
37596 printk(KERN_ERR "%s: no memory for coeffs\n",
37597 __func__);
37598 ret = -ENOMEM;
37599 - kfree(bch);
37600 goto free_chan;
37601 }
37602 bch->nr = ch;
37603 @@ -4768,7 +4767,6 @@
37604 printk(KERN_ERR "%s: no memory for coeffs\n",
37605 __func__);
37606 ret = -ENOMEM;
37607 - kfree(bch);
37608 goto free_chan;
37609 }
37610 bch->nr = ch + 1;
37611 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/isdn/sc/shmem.c linux-2.6.29-rc3.owrt/drivers/isdn/sc/shmem.c
37612 --- linux-2.6.29.owrt/drivers/isdn/sc/shmem.c 2009-05-10 22:04:38.000000000 +0200
37613 +++ linux-2.6.29-rc3.owrt/drivers/isdn/sc/shmem.c 2009-05-10 23:48:28.000000000 +0200
37614 @@ -54,7 +54,7 @@
37615 spin_unlock_irqrestore(&sc_adapter[card]->lock, flags);
37616 pr_debug("%s: set page to %#x\n",sc_adapter[card]->devicename,
37617 ((sc_adapter[card]->shmem_magic + ch * SRAM_PAGESIZE)>>14)|0x80);
37618 - pr_debug("%s: copying %zu bytes from %#lx to %#lx\n",
37619 + pr_debug("%s: copying %d bytes from %#lx to %#lx\n",
37620 sc_adapter[card]->devicename, n,
37621 (unsigned long) src,
37622 sc_adapter[card]->rambase + ((unsigned long) dest %0x4000));
37623 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/lguest/core.c linux-2.6.29-rc3.owrt/drivers/lguest/core.c
37624 --- linux-2.6.29.owrt/drivers/lguest/core.c 2009-05-10 22:04:38.000000000 +0200
37625 +++ linux-2.6.29-rc3.owrt/drivers/lguest/core.c 2009-05-10 23:48:28.000000000 +0200
37626 @@ -224,7 +224,7 @@
37627 break;
37628
37629 /* If the Guest asked to be stopped, we sleep. The Guest's
37630 - * clock timer or LHREQ_BREAK from the Waker will wake us. */
37631 + * clock timer or LHCALL_BREAK from the Waker will wake us. */
37632 if (cpu->halted) {
37633 set_current_state(TASK_INTERRUPTIBLE);
37634 schedule();
37635 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/lguest/lguest_device.c linux-2.6.29-rc3.owrt/drivers/lguest/lguest_device.c
37636 --- linux-2.6.29.owrt/drivers/lguest/lguest_device.c 2009-05-10 22:04:38.000000000 +0200
37637 +++ linux-2.6.29-rc3.owrt/drivers/lguest/lguest_device.c 2009-05-10 23:48:28.000000000 +0200
37638 @@ -212,9 +212,6 @@
37639 hcall(LHCALL_NOTIFY, lvq->config.pfn << PAGE_SHIFT, 0, 0);
37640 }
37641
37642 -/* An extern declaration inside a C file is bad form. Don't do it. */
37643 -extern void lguest_setup_irq(unsigned int irq);
37644 -
37645 /* This routine finds the first virtqueue described in the configuration of
37646 * this device and sets it up.
37647 *
37648 @@ -269,9 +266,6 @@
37649 goto unmap;
37650 }
37651
37652 - /* Make sure the interrupt is allocated. */
37653 - lguest_setup_irq(lvq->config.irq);
37654 -
37655 /* Tell the interrupt for this virtqueue to go to the virtio_ring
37656 * interrupt handler. */
37657 /* FIXME: We used to have a flag for the Host to tell us we could use
37658 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/lguest/lguest_user.c linux-2.6.29-rc3.owrt/drivers/lguest/lguest_user.c
37659 --- linux-2.6.29.owrt/drivers/lguest/lguest_user.c 2009-05-10 22:04:38.000000000 +0200
37660 +++ linux-2.6.29-rc3.owrt/drivers/lguest/lguest_user.c 2009-05-10 23:48:28.000000000 +0200
37661 @@ -307,8 +307,9 @@
37662 * kmalloc()ed string, either of which is ok to hand to kfree(). */
37663 if (!IS_ERR(lg->dead))
37664 kfree(lg->dead);
37665 - /* Free the memory allocated to the lguest_struct */
37666 - kfree(lg);
37667 + /* We clear the entire structure, which also marks it as free for the
37668 + * next user. */
37669 + memset(lg, 0, sizeof(*lg));
37670 /* Release lock and exit. */
37671 mutex_unlock(&lguest_lock);
37672
37673 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/md/dm.c linux-2.6.29-rc3.owrt/drivers/md/dm.c
37674 --- linux-2.6.29.owrt/drivers/md/dm.c 2009-05-10 22:04:38.000000000 +0200
37675 +++ linux-2.6.29-rc3.owrt/drivers/md/dm.c 2009-05-10 23:48:28.000000000 +0200
37676 @@ -525,12 +525,9 @@
37677 static void dec_pending(struct dm_io *io, int error)
37678 {
37679 unsigned long flags;
37680 - int io_error;
37681 - struct bio *bio;
37682 - struct mapped_device *md = io->md;
37683
37684 /* Push-back supersedes any I/O errors */
37685 - if (error && !(io->error > 0 && __noflush_suspending(md)))
37686 + if (error && !(io->error > 0 && __noflush_suspending(io->md)))
37687 io->error = error;
37688
37689 if (atomic_dec_and_test(&io->io_count)) {
37690 @@ -540,27 +537,24 @@
37691 * This must be handled before the sleeper on
37692 * suspend queue merges the pushback list.
37693 */
37694 - spin_lock_irqsave(&md->pushback_lock, flags);
37695 - if (__noflush_suspending(md))
37696 - bio_list_add(&md->pushback, io->bio);
37697 + spin_lock_irqsave(&io->md->pushback_lock, flags);
37698 + if (__noflush_suspending(io->md))
37699 + bio_list_add(&io->md->pushback, io->bio);
37700 else
37701 /* noflush suspend was interrupted. */
37702 io->error = -EIO;
37703 - spin_unlock_irqrestore(&md->pushback_lock, flags);
37704 + spin_unlock_irqrestore(&io->md->pushback_lock, flags);
37705 }
37706
37707 end_io_acct(io);
37708
37709 - io_error = io->error;
37710 - bio = io->bio;
37711 -
37712 - free_io(md, io);
37713 + if (io->error != DM_ENDIO_REQUEUE) {
37714 + trace_block_bio_complete(io->md->queue, io->bio);
37715
37716 - if (io_error != DM_ENDIO_REQUEUE) {
37717 - trace_block_bio_complete(md->queue, bio);
37718 -
37719 - bio_endio(bio, io_error);
37720 + bio_endio(io->bio, io->error);
37721 }
37722 +
37723 + free_io(io->md, io);
37724 }
37725 }
37726
37727 @@ -568,7 +562,6 @@
37728 {
37729 int r = 0;
37730 struct dm_target_io *tio = bio->bi_private;
37731 - struct dm_io *io = tio->io;
37732 struct mapped_device *md = tio->io->md;
37733 dm_endio_fn endio = tio->ti->type->end_io;
37734
37735 @@ -592,14 +585,15 @@
37736 }
37737 }
37738
37739 + dec_pending(tio->io, error);
37740 +
37741 /*
37742 * Store md for cleanup instead of tio which is about to get freed.
37743 */
37744 bio->bi_private = md->bs;
37745
37746 - free_tio(md, tio);
37747 bio_put(bio);
37748 - dec_pending(io, error);
37749 + free_tio(md, tio);
37750 }
37751
37752 static sector_t max_io_len(struct mapped_device *md,
37753 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/md/dm-crypt.c linux-2.6.29-rc3.owrt/drivers/md/dm-crypt.c
37754 --- linux-2.6.29.owrt/drivers/md/dm-crypt.c 2009-05-10 22:04:38.000000000 +0200
37755 +++ linux-2.6.29-rc3.owrt/drivers/md/dm-crypt.c 2009-05-10 23:48:28.000000000 +0200
37756 @@ -60,7 +60,6 @@
37757 };
37758
37759 struct dm_crypt_request {
37760 - struct convert_context *ctx;
37761 struct scatterlist sg_in;
37762 struct scatterlist sg_out;
37763 };
37764 @@ -336,18 +335,6 @@
37765 init_completion(&ctx->restart);
37766 }
37767
37768 -static struct dm_crypt_request *dmreq_of_req(struct crypt_config *cc,
37769 - struct ablkcipher_request *req)
37770 -{
37771 - return (struct dm_crypt_request *)((char *)req + cc->dmreq_start);
37772 -}
37773 -
37774 -static struct ablkcipher_request *req_of_dmreq(struct crypt_config *cc,
37775 - struct dm_crypt_request *dmreq)
37776 -{
37777 - return (struct ablkcipher_request *)((char *)dmreq - cc->dmreq_start);
37778 -}
37779 -
37780 static int crypt_convert_block(struct crypt_config *cc,
37781 struct convert_context *ctx,
37782 struct ablkcipher_request *req)
37783 @@ -358,11 +345,10 @@
37784 u8 *iv;
37785 int r = 0;
37786
37787 - dmreq = dmreq_of_req(cc, req);
37788 + dmreq = (struct dm_crypt_request *)((char *)req + cc->dmreq_start);
37789 iv = (u8 *)ALIGN((unsigned long)(dmreq + 1),
37790 crypto_ablkcipher_alignmask(cc->tfm) + 1);
37791
37792 - dmreq->ctx = ctx;
37793 sg_init_table(&dmreq->sg_in, 1);
37794 sg_set_page(&dmreq->sg_in, bv_in->bv_page, 1 << SECTOR_SHIFT,
37795 bv_in->bv_offset + ctx->offset_in);
37796 @@ -409,9 +395,8 @@
37797 cc->req = mempool_alloc(cc->req_pool, GFP_NOIO);
37798 ablkcipher_request_set_tfm(cc->req, cc->tfm);
37799 ablkcipher_request_set_callback(cc->req, CRYPTO_TFM_REQ_MAY_BACKLOG |
37800 - CRYPTO_TFM_REQ_MAY_SLEEP,
37801 - kcryptd_async_done,
37802 - dmreq_of_req(cc, cc->req));
37803 + CRYPTO_TFM_REQ_MAY_SLEEP,
37804 + kcryptd_async_done, ctx);
37805 }
37806
37807 /*
37808 @@ -568,22 +553,19 @@
37809 static void crypt_dec_pending(struct dm_crypt_io *io)
37810 {
37811 struct crypt_config *cc = io->target->private;
37812 - struct bio *base_bio = io->base_bio;
37813 - struct dm_crypt_io *base_io = io->base_io;
37814 - int error = io->error;
37815
37816 if (!atomic_dec_and_test(&io->pending))
37817 return;
37818
37819 - mempool_free(io, cc->io_pool);
37820 -
37821 - if (likely(!base_io))
37822 - bio_endio(base_bio, error);
37823 + if (likely(!io->base_io))
37824 + bio_endio(io->base_bio, io->error);
37825 else {
37826 - if (error && !base_io->error)
37827 - base_io->error = error;
37828 - crypt_dec_pending(base_io);
37829 + if (io->error && !io->base_io->error)
37830 + io->base_io->error = io->error;
37831 + crypt_dec_pending(io->base_io);
37832 }
37833 +
37834 + mempool_free(io, cc->io_pool);
37835 }
37836
37837 /*
37838 @@ -839,8 +821,7 @@
37839 static void kcryptd_async_done(struct crypto_async_request *async_req,
37840 int error)
37841 {
37842 - struct dm_crypt_request *dmreq = async_req->data;
37843 - struct convert_context *ctx = dmreq->ctx;
37844 + struct convert_context *ctx = async_req->data;
37845 struct dm_crypt_io *io = container_of(ctx, struct dm_crypt_io, ctx);
37846 struct crypt_config *cc = io->target->private;
37847
37848 @@ -849,7 +830,7 @@
37849 return;
37850 }
37851
37852 - mempool_free(req_of_dmreq(cc, dmreq), cc->req_pool);
37853 + mempool_free(ablkcipher_request_cast(async_req), cc->req_pool);
37854
37855 if (!atomic_dec_and_test(&ctx->pending))
37856 return;
37857 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/md/dm-io.c linux-2.6.29-rc3.owrt/drivers/md/dm-io.c
37858 --- linux-2.6.29.owrt/drivers/md/dm-io.c 2009-05-10 22:04:38.000000000 +0200
37859 +++ linux-2.6.29-rc3.owrt/drivers/md/dm-io.c 2009-05-10 23:48:28.000000000 +0200
37860 @@ -292,8 +292,6 @@
37861 (PAGE_SIZE >> SECTOR_SHIFT));
37862 num_bvecs = 1 + min_t(int, bio_get_nr_vecs(where->bdev),
37863 num_bvecs);
37864 - if (unlikely(num_bvecs > BIO_MAX_PAGES))
37865 - num_bvecs = BIO_MAX_PAGES;
37866 bio = bio_alloc_bioset(GFP_NOIO, num_bvecs, io->client->bios);
37867 bio->bi_sector = where->sector + (where->count - remaining);
37868 bio->bi_bdev = where->bdev;
37869 @@ -330,7 +328,7 @@
37870 struct dpages old_pages = *dp;
37871
37872 if (sync)
37873 - rw |= (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG);
37874 + rw |= (1 << BIO_RW_SYNC);
37875
37876 /*
37877 * For multiple regions we need to be careful to rewind
37878 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/md/dm-ioctl.c linux-2.6.29-rc3.owrt/drivers/md/dm-ioctl.c
37879 --- linux-2.6.29.owrt/drivers/md/dm-ioctl.c 2009-05-10 22:04:38.000000000 +0200
37880 +++ linux-2.6.29-rc3.owrt/drivers/md/dm-ioctl.c 2009-05-10 23:48:28.000000000 +0200
37881 @@ -704,8 +704,7 @@
37882 char *new_name = (char *) param + param->data_start;
37883
37884 if (new_name < param->data ||
37885 - invalid_str(new_name, (void *) param + param_size) ||
37886 - strlen(new_name) > DM_NAME_LEN - 1) {
37887 + invalid_str(new_name, (void *) param + param_size)) {
37888 DMWARN("Invalid new logical volume name supplied.");
37889 return -EINVAL;
37890 }
37891 @@ -1064,7 +1063,7 @@
37892
37893 r = populate_table(t, param, param_size);
37894 if (r) {
37895 - dm_table_destroy(t);
37896 + dm_table_put(t);
37897 goto out;
37898 }
37899
37900 @@ -1072,7 +1071,7 @@
37901 hc = dm_get_mdptr(md);
37902 if (!hc || hc->md != md) {
37903 DMWARN("device has been removed from the dev hash table.");
37904 - dm_table_destroy(t);
37905 + dm_table_put(t);
37906 up_write(&_hash_lock);
37907 r = -ENXIO;
37908 goto out;
37909 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/md/dm-kcopyd.c linux-2.6.29-rc3.owrt/drivers/md/dm-kcopyd.c
37910 --- linux-2.6.29.owrt/drivers/md/dm-kcopyd.c 2009-05-10 22:04:38.000000000 +0200
37911 +++ linux-2.6.29-rc3.owrt/drivers/md/dm-kcopyd.c 2009-05-10 23:48:28.000000000 +0200
37912 @@ -344,7 +344,7 @@
37913 {
37914 int r;
37915 struct dm_io_request io_req = {
37916 - .bi_rw = job->rw | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG),
37917 + .bi_rw = job->rw | (1 << BIO_RW_SYNC),
37918 .mem.type = DM_IO_PAGE_LIST,
37919 .mem.ptr.pl = job->pages,
37920 .mem.offset = job->offset,
37921 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/md/linear.c linux-2.6.29-rc3.owrt/drivers/md/linear.c
37922 --- linux-2.6.29.owrt/drivers/md/linear.c 2009-05-10 22:04:38.000000000 +0200
37923 +++ linux-2.6.29-rc3.owrt/drivers/md/linear.c 2009-05-10 23:48:28.000000000 +0200
37924 @@ -25,13 +25,13 @@
37925 {
37926 dev_info_t *hash;
37927 linear_conf_t *conf = mddev_to_conf(mddev);
37928 - sector_t idx = sector >> conf->sector_shift;
37929
37930 /*
37931 * sector_div(a,b) returns the remainer and sets a to a/b
37932 */
37933 - (void)sector_div(idx, conf->spacing);
37934 - hash = conf->hash_table[idx];
37935 + sector >>= conf->sector_shift;
37936 + (void)sector_div(sector, conf->spacing);
37937 + hash = conf->hash_table[sector];
37938
37939 while (sector >= hash->num_sectors + hash->start_sector)
37940 hash++;
37941 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/md/md.c linux-2.6.29-rc3.owrt/drivers/md/md.c
37942 --- linux-2.6.29.owrt/drivers/md/md.c 2009-05-10 22:04:38.000000000 +0200
37943 +++ linux-2.6.29-rc3.owrt/drivers/md/md.c 2009-05-10 23:48:28.000000000 +0200
37944 @@ -214,7 +214,12 @@
37945 return mddev;
37946 }
37947
37948 -static void mddev_delayed_delete(struct work_struct *ws);
37949 +static void mddev_delayed_delete(struct work_struct *ws)
37950 +{
37951 + mddev_t *mddev = container_of(ws, mddev_t, del_work);
37952 + kobject_del(&mddev->kobj);
37953 + kobject_put(&mddev->kobj);
37954 +}
37955
37956 static void mddev_put(mddev_t *mddev)
37957 {
37958 @@ -469,7 +474,7 @@
37959 * causes ENOTSUPP, we allocate a spare bio...
37960 */
37961 struct bio *bio = bio_alloc(GFP_NOIO, 1);
37962 - int rw = (1<<BIO_RW) | (1<<BIO_RW_SYNCIO) | (1<<BIO_RW_UNPLUG);
37963 + int rw = (1<<BIO_RW) | (1<<BIO_RW_SYNC);
37964
37965 bio->bi_bdev = rdev->bdev;
37966 bio->bi_sector = sector;
37967 @@ -526,7 +531,7 @@
37968 struct completion event;
37969 int ret;
37970
37971 - rw |= (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG);
37972 + rw |= (1 << BIO_RW_SYNC);
37973
37974 bio->bi_bdev = bdev;
37975 bio->bi_sector = sector;
37976 @@ -1476,11 +1481,6 @@
37977 if (find_rdev_nr(mddev, rdev->desc_nr))
37978 return -EBUSY;
37979 }
37980 - if (mddev->max_disks && rdev->desc_nr >= mddev->max_disks) {
37981 - printk(KERN_WARNING "md: %s: array is limited to %d devices\n",
37982 - mdname(mddev), mddev->max_disks);
37983 - return -EBUSY;
37984 - }
37985 bdevname(rdev->bdev,b);
37986 while ( (s=strchr(b, '/')) != NULL)
37987 *s = '!';
37988 @@ -2441,15 +2441,6 @@
37989
37990 i = 0;
37991 rdev_for_each(rdev, tmp, mddev) {
37992 - if (rdev->desc_nr >= mddev->max_disks ||
37993 - i > mddev->max_disks) {
37994 - printk(KERN_WARNING
37995 - "md: %s: %s: only %d devices permitted\n",
37996 - mdname(mddev), bdevname(rdev->bdev, b),
37997 - mddev->max_disks);
37998 - kick_rdev_from_array(rdev);
37999 - continue;
38000 - }
38001 if (rdev != freshest)
38002 if (super_types[mddev->major_version].
38003 validate_super(mddev, rdev)) {
38004 @@ -3537,21 +3528,6 @@
38005
38006 int mdp_major = 0;
38007
38008 -static void mddev_delayed_delete(struct work_struct *ws)
38009 -{
38010 - mddev_t *mddev = container_of(ws, mddev_t, del_work);
38011 -
38012 - if (mddev->private == &md_redundancy_group) {
38013 - sysfs_remove_group(&mddev->kobj, &md_redundancy_group);
38014 - if (mddev->sysfs_action)
38015 - sysfs_put(mddev->sysfs_action);
38016 - mddev->sysfs_action = NULL;
38017 - mddev->private = NULL;
38018 - }
38019 - kobject_del(&mddev->kobj);
38020 - kobject_put(&mddev->kobj);
38021 -}
38022 -
38023 static int md_alloc(dev_t dev, char *name)
38024 {
38025 static DEFINE_MUTEX(disks_mutex);
38026 @@ -4043,9 +4019,13 @@
38027 mddev->queue->merge_bvec_fn = NULL;
38028 mddev->queue->unplug_fn = NULL;
38029 mddev->queue->backing_dev_info.congested_fn = NULL;
38030 + if (mddev->pers->sync_request) {
38031 + sysfs_remove_group(&mddev->kobj, &md_redundancy_group);
38032 + if (mddev->sysfs_action)
38033 + sysfs_put(mddev->sysfs_action);
38034 + mddev->sysfs_action = NULL;
38035 + }
38036 module_put(mddev->pers->owner);
38037 - if (mddev->pers->sync_request)
38038 - mddev->private = &md_redundancy_group;
38039 mddev->pers = NULL;
38040 /* tell userspace to handle 'inactive' */
38041 sysfs_notify_dirent(mddev->sysfs_state);
38042 @@ -4634,6 +4614,13 @@
38043 * noticed in interrupt contexts ...
38044 */
38045
38046 + if (rdev->desc_nr == mddev->max_disks) {
38047 + printk(KERN_WARNING "%s: can not hot-add to full array!\n",
38048 + mdname(mddev));
38049 + err = -EBUSY;
38050 + goto abort_unbind_export;
38051 + }
38052 +
38053 rdev->raid_disk = -1;
38054
38055 md_update_sb(mddev, 1);
38056 @@ -4647,6 +4634,9 @@
38057 md_new_event(mddev);
38058 return 0;
38059
38060 +abort_unbind_export:
38061 + unbind_rdev_from_array(rdev);
38062 +
38063 abort_export:
38064 export_rdev(rdev);
38065 return err;
38066 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/md/raid10.c linux-2.6.29-rc3.owrt/drivers/md/raid10.c
38067 --- linux-2.6.29.owrt/drivers/md/raid10.c 2009-05-10 22:04:38.000000000 +0200
38068 +++ linux-2.6.29-rc3.owrt/drivers/md/raid10.c 2009-05-10 23:48:28.000000000 +0200
38069 @@ -1236,7 +1236,6 @@
38070 /* for reconstruct, we always reschedule after a read.
38071 * for resync, only after all reads
38072 */
38073 - rdev_dec_pending(conf->mirrors[d].rdev, conf->mddev);
38074 if (test_bit(R10BIO_IsRecover, &r10_bio->state) ||
38075 atomic_dec_and_test(&r10_bio->remaining)) {
38076 /* we have read all the blocks,
38077 @@ -1244,6 +1243,7 @@
38078 */
38079 reschedule_retry(r10_bio);
38080 }
38081 + rdev_dec_pending(conf->mirrors[d].rdev, conf->mddev);
38082 }
38083
38084 static void end_sync_write(struct bio *bio, int error)
38085 @@ -1264,13 +1264,11 @@
38086
38087 update_head_pos(i, r10_bio);
38088
38089 - rdev_dec_pending(conf->mirrors[d].rdev, mddev);
38090 while (atomic_dec_and_test(&r10_bio->remaining)) {
38091 if (r10_bio->master_bio == NULL) {
38092 /* the primary of several recovery bios */
38093 - sector_t s = r10_bio->sectors;
38094 + md_done_sync(mddev, r10_bio->sectors, 1);
38095 put_buf(r10_bio);
38096 - md_done_sync(mddev, s, 1);
38097 break;
38098 } else {
38099 r10bio_t *r10_bio2 = (r10bio_t *)r10_bio->master_bio;
38100 @@ -1278,6 +1276,7 @@
38101 r10_bio = r10_bio2;
38102 }
38103 }
38104 + rdev_dec_pending(conf->mirrors[d].rdev, mddev);
38105 }
38106
38107 /*
38108 @@ -1750,6 +1749,8 @@
38109 if (!go_faster && conf->nr_waiting)
38110 msleep_interruptible(1000);
38111
38112 + bitmap_cond_end_sync(mddev->bitmap, sector_nr);
38113 +
38114 /* Again, very different code for resync and recovery.
38115 * Both must result in an r10bio with a list of bios that
38116 * have bi_end_io, bi_sector, bi_bdev set,
38117 @@ -1885,8 +1886,6 @@
38118 /* resync. Schedule a read for every block at this virt offset */
38119 int count = 0;
38120
38121 - bitmap_cond_end_sync(mddev->bitmap, sector_nr);
38122 -
38123 if (!bitmap_start_sync(mddev->bitmap, sector_nr,
38124 &sync_blocks, mddev->degraded) &&
38125 !conf->fullsync && !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) {
38126 @@ -2011,13 +2010,13 @@
38127 /* There is nowhere to write, so all non-sync
38128 * drives must be failed, so try the next chunk...
38129 */
38130 - if (sector_nr + max_sync < max_sector)
38131 - max_sector = sector_nr + max_sync;
38132 -
38133 - sectors_skipped += (max_sector - sector_nr);
38134 + {
38135 + sector_t sec = max_sector - sector_nr;
38136 + sectors_skipped += sec;
38137 chunks_skipped ++;
38138 sector_nr = max_sector;
38139 goto skipped;
38140 + }
38141 }
38142
38143 static int run(mddev_t *mddev)
38144 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/md/raid1.c linux-2.6.29-rc3.owrt/drivers/md/raid1.c
38145 --- linux-2.6.29.owrt/drivers/md/raid1.c 2009-05-10 22:04:38.000000000 +0200
38146 +++ linux-2.6.29-rc3.owrt/drivers/md/raid1.c 2009-05-10 23:48:28.000000000 +0200
38147 @@ -1237,9 +1237,8 @@
38148 update_head_pos(mirror, r1_bio);
38149
38150 if (atomic_dec_and_test(&r1_bio->remaining)) {
38151 - sector_t s = r1_bio->sectors;
38152 + md_done_sync(mddev, r1_bio->sectors, uptodate);
38153 put_buf(r1_bio);
38154 - md_done_sync(mddev, s, uptodate);
38155 }
38156 }
38157
38158 @@ -1641,8 +1640,7 @@
38159 }
38160
38161 bio = r1_bio->bios[r1_bio->read_disk];
38162 - if ((disk=read_balance(conf, r1_bio)) == -1 ||
38163 - disk == r1_bio->read_disk) {
38164 + if ((disk=read_balance(conf, r1_bio)) == -1) {
38165 printk(KERN_ALERT "raid1: %s: unrecoverable I/O"
38166 " read error for block %llu\n",
38167 bdevname(bio->bi_bdev,b),
38168 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/common/saa7146_video.c linux-2.6.29-rc3.owrt/drivers/media/common/saa7146_video.c
38169 --- linux-2.6.29.owrt/drivers/media/common/saa7146_video.c 2009-05-10 22:04:39.000000000 +0200
38170 +++ linux-2.6.29-rc3.owrt/drivers/media/common/saa7146_video.c 2009-05-10 23:48:28.000000000 +0200
38171 @@ -576,7 +576,6 @@
38172 vv->vflip = c->value;
38173 break;
38174 default: {
38175 - mutex_unlock(&dev->lock);
38176 return -EINVAL;
38177 }
38178 }
38179 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/common/tuners/mxl5007t.c linux-2.6.29-rc3.owrt/drivers/media/common/tuners/mxl5007t.c
38180 --- linux-2.6.29.owrt/drivers/media/common/tuners/mxl5007t.c 2009-05-10 22:04:39.000000000 +0200
38181 +++ linux-2.6.29-rc3.owrt/drivers/media/common/tuners/mxl5007t.c 2009-05-10 23:48:28.000000000 +0200
38182 @@ -657,7 +657,7 @@
38183 {
38184 struct mxl5007t_state *state = fe->tuner_priv;
38185 int rf_locked, ref_locked;
38186 - s32 rf_input_level = 0;
38187 + s32 rf_input_level;
38188 int ret;
38189
38190 if (fe->ops.i2c_gate_ctrl)
38191 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/common/tuners/tuner-simple.c linux-2.6.29-rc3.owrt/drivers/media/common/tuners/tuner-simple.c
38192 --- linux-2.6.29.owrt/drivers/media/common/tuners/tuner-simple.c 2009-05-10 22:04:39.000000000 +0200
38193 +++ linux-2.6.29-rc3.owrt/drivers/media/common/tuners/tuner-simple.c 2009-05-10 23:48:28.000000000 +0200
38194 @@ -318,6 +318,7 @@
38195 u8 *config, u8 *cb)
38196 {
38197 struct tuner_simple_priv *priv = fe->tuner_priv;
38198 + u8 tuneraddr;
38199 int rc;
38200
38201 /* tv norm specific stuff for multi-norm tuners */
38202 @@ -386,7 +387,6 @@
38203
38204 case TUNER_PHILIPS_TUV1236D:
38205 {
38206 - struct tuner_i2c_props i2c = priv->i2c_props;
38207 /* 0x40 -> ATSC antenna input 1 */
38208 /* 0x48 -> ATSC antenna input 2 */
38209 /* 0x00 -> NTSC antenna input 1 */
38210 @@ -398,15 +398,17 @@
38211 buffer[1] = 0x04;
38212 }
38213 /* set to the correct mode (analog or digital) */
38214 - i2c.addr = 0x0a;
38215 - rc = tuner_i2c_xfer_send(&i2c, &buffer[0], 2);
38216 + tuneraddr = priv->i2c_props.addr;
38217 + priv->i2c_props.addr = 0x0a;
38218 + rc = tuner_i2c_xfer_send(&priv->i2c_props, &buffer[0], 2);
38219 if (2 != rc)
38220 tuner_warn("i2c i/o error: rc == %d "
38221 "(should be 2)\n", rc);
38222 - rc = tuner_i2c_xfer_send(&i2c, &buffer[2], 2);
38223 + rc = tuner_i2c_xfer_send(&priv->i2c_props, &buffer[2], 2);
38224 if (2 != rc)
38225 tuner_warn("i2c i/o error: rc == %d "
38226 "(should be 2)\n", rc);
38227 + priv->i2c_props.addr = tuneraddr;
38228 break;
38229 }
38230 }
38231 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/dvb/b2c2/flexcop.c linux-2.6.29-rc3.owrt/drivers/media/dvb/b2c2/flexcop.c
38232 --- linux-2.6.29.owrt/drivers/media/dvb/b2c2/flexcop.c 2009-05-10 22:04:39.000000000 +0200
38233 +++ linux-2.6.29-rc3.owrt/drivers/media/dvb/b2c2/flexcop.c 2009-05-10 23:48:28.000000000 +0200
38234 @@ -212,7 +212,8 @@
38235 v210.sw_reset_210.Block_reset_enable = 0xb2;
38236
38237 fc->write_ibi_reg(fc,sw_reset_210,v210);
38238 - udelay(1000);
38239 + msleep(1);
38240 +
38241 fc->write_ibi_reg(fc,ctrl_208,v208_save);
38242 }
38243
38244 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/dvb/b2c2/flexcop-hw-filter.c linux-2.6.29-rc3.owrt/drivers/media/dvb/b2c2/flexcop-hw-filter.c
38245 --- linux-2.6.29.owrt/drivers/media/dvb/b2c2/flexcop-hw-filter.c 2009-05-10 22:04:39.000000000 +0200
38246 +++ linux-2.6.29-rc3.owrt/drivers/media/dvb/b2c2/flexcop-hw-filter.c 2009-05-10 23:48:28.000000000 +0200
38247 @@ -192,7 +192,6 @@
38248
38249 return 0;
38250 }
38251 -EXPORT_SYMBOL(flexcop_pid_feed_control);
38252
38253 void flexcop_hw_filter_init(struct flexcop_device *fc)
38254 {
38255 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/dvb/b2c2/flexcop-pci.c linux-2.6.29-rc3.owrt/drivers/media/dvb/b2c2/flexcop-pci.c
38256 --- linux-2.6.29.owrt/drivers/media/dvb/b2c2/flexcop-pci.c 2009-05-10 22:04:39.000000000 +0200
38257 +++ linux-2.6.29-rc3.owrt/drivers/media/dvb/b2c2/flexcop-pci.c 2009-05-10 23:48:28.000000000 +0200
38258 @@ -13,9 +13,9 @@
38259 module_param(enable_pid_filtering, int, 0444);
38260 MODULE_PARM_DESC(enable_pid_filtering, "enable hardware pid filtering: supported values: 0 (fullts), 1");
38261
38262 -static int irq_chk_intv = 100;
38263 +static int irq_chk_intv;
38264 module_param(irq_chk_intv, int, 0644);
38265 -MODULE_PARM_DESC(irq_chk_intv, "set the interval for IRQ streaming watchdog.");
38266 +MODULE_PARM_DESC(irq_chk_intv, "set the interval for IRQ watchdog (currently just debugging).");
38267
38268 #ifdef CONFIG_DVB_B2C2_FLEXCOP_DEBUG
38269 #define dprintk(level,args...) \
38270 @@ -34,9 +34,7 @@
38271
38272 static int debug;
38273 module_param(debug, int, 0644);
38274 -MODULE_PARM_DESC(debug,
38275 - "set debug level (1=info,2=regs,4=TS,8=irqdma,16=check (|-able))."
38276 - DEBSTATUS);
38277 +MODULE_PARM_DESC(debug, "set debug level (1=info,2=regs,4=TS,8=irqdma (|-able))." DEBSTATUS);
38278
38279 #define DRIVER_VERSION "0.1"
38280 #define DRIVER_NAME "Technisat/B2C2 FlexCop II/IIb/III Digital TV PCI Driver"
38281 @@ -60,8 +58,6 @@
38282 int active_dma1_addr; /* 0 = addr0 of dma1; 1 = addr1 of dma1 */
38283 u32 last_dma1_cur_pos; /* position of the pointer last time the timer/packet irq occured */
38284 int count;
38285 - int count_prev;
38286 - int stream_problem;
38287
38288 spinlock_t irq_lock;
38289
38290 @@ -107,32 +103,18 @@
38291 container_of(work, struct flexcop_pci, irq_check_work.work);
38292 struct flexcop_device *fc = fc_pci->fc_dev;
38293
38294 - if (fc->feedcount) {
38295 + flexcop_ibi_value v = fc->read_ibi_reg(fc,sram_dest_reg_714);
38296
38297 - if (fc_pci->count == fc_pci->count_prev) {
38298 - deb_chk("no IRQ since the last check\n");
38299 - if (fc_pci->stream_problem++ == 3) {
38300 - struct dvb_demux_feed *feed;
38301 -
38302 - spin_lock_irq(&fc->demux.lock);
38303 - list_for_each_entry(feed, &fc->demux.feed_list,
38304 - list_head) {
38305 - flexcop_pid_feed_control(fc, feed, 0);
38306 - }
38307 -
38308 - list_for_each_entry(feed, &fc->demux.feed_list,
38309 - list_head) {
38310 - flexcop_pid_feed_control(fc, feed, 1);
38311 - }
38312 - spin_unlock_irq(&fc->demux.lock);
38313 -
38314 - fc_pci->stream_problem = 0;
38315 - }
38316 - } else {
38317 - fc_pci->stream_problem = 0;
38318 - fc_pci->count_prev = fc_pci->count;
38319 - }
38320 - }
38321 + flexcop_dump_reg(fc_pci->fc_dev,dma1_000,4);
38322 +
38323 + if (v.sram_dest_reg_714.net_ovflow_error)
38324 + deb_chk("sram net_ovflow_error\n");
38325 + if (v.sram_dest_reg_714.media_ovflow_error)
38326 + deb_chk("sram media_ovflow_error\n");
38327 + if (v.sram_dest_reg_714.cai_ovflow_error)
38328 + deb_chk("sram cai_ovflow_error\n");
38329 + if (v.sram_dest_reg_714.cai_ovflow_error)
38330 + deb_chk("sram cai_ovflow_error\n");
38331
38332 schedule_delayed_work(&fc_pci->irq_check_work,
38333 msecs_to_jiffies(irq_chk_intv < 100 ? 100 : irq_chk_intv));
38334 @@ -234,12 +216,16 @@
38335 flexcop_dma_control_timer_irq(fc,FC_DMA_1,1);
38336 deb_irq("IRQ enabled\n");
38337
38338 - fc_pci->count_prev = fc_pci->count;
38339 -
38340 // fc_pci->active_dma1_addr = 0;
38341 // flexcop_dma_control_size_irq(fc,FC_DMA_1,1);
38342
38343 + if (irq_chk_intv > 0)
38344 + schedule_delayed_work(&fc_pci->irq_check_work,
38345 + msecs_to_jiffies(irq_chk_intv < 100 ? 100 : irq_chk_intv));
38346 } else {
38347 + if (irq_chk_intv > 0)
38348 + cancel_delayed_work(&fc_pci->irq_check_work);
38349 +
38350 flexcop_dma_control_timer_irq(fc,FC_DMA_1,0);
38351 deb_irq("IRQ disabled\n");
38352
38353 @@ -313,6 +299,8 @@
38354 IRQF_SHARED, DRIVER_NAME, fc_pci)) != 0)
38355 goto err_pci_iounmap;
38356
38357 +
38358 +
38359 fc_pci->init_state |= FC_PCI_INIT;
38360 return ret;
38361
38362 @@ -387,10 +375,6 @@
38363
38364 INIT_DELAYED_WORK(&fc_pci->irq_check_work, flexcop_pci_irq_check_work);
38365
38366 - if (irq_chk_intv > 0)
38367 - schedule_delayed_work(&fc_pci->irq_check_work,
38368 - msecs_to_jiffies(irq_chk_intv < 100 ? 100 : irq_chk_intv));
38369 -
38370 return ret;
38371
38372 err_fc_exit:
38373 @@ -409,9 +393,6 @@
38374 {
38375 struct flexcop_pci *fc_pci = pci_get_drvdata(pdev);
38376
38377 - if (irq_chk_intv > 0)
38378 - cancel_delayed_work(&fc_pci->irq_check_work);
38379 -
38380 flexcop_pci_dma_exit(fc_pci);
38381 flexcop_device_exit(fc_pci->fc_dev);
38382 flexcop_pci_exit(fc_pci);
38383 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/dvb/bt8xx/dst.c linux-2.6.29-rc3.owrt/drivers/media/dvb/bt8xx/dst.c
38384 --- linux-2.6.29.owrt/drivers/media/dvb/bt8xx/dst.c 2009-05-10 22:04:39.000000000 +0200
38385 +++ linux-2.6.29-rc3.owrt/drivers/media/dvb/bt8xx/dst.c 2009-05-10 23:48:28.000000000 +0200
38386 @@ -1683,7 +1683,7 @@
38387
38388 static int dst_get_tuning_algo(struct dvb_frontend *fe)
38389 {
38390 - return dst_algo ? DVBFE_ALGO_HW : DVBFE_ALGO_SW;
38391 + return dst_algo;
38392 }
38393
38394 static int dst_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_parameters *p)
38395 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/dvb/dvb-core/dmxdev.c linux-2.6.29-rc3.owrt/drivers/media/dvb/dvb-core/dmxdev.c
38396 --- linux-2.6.29.owrt/drivers/media/dvb/dvb-core/dmxdev.c 2009-05-10 22:04:39.000000000 +0200
38397 +++ linux-2.6.29-rc3.owrt/drivers/media/dvb/dvb-core/dmxdev.c 2009-05-10 23:48:28.000000000 +0200
38398 @@ -364,15 +364,16 @@
38399 enum dmx_success success)
38400 {
38401 struct dmxdev_filter *dmxdevfilter = filter->priv;
38402 + unsigned long flags;
38403 int ret;
38404
38405 if (dmxdevfilter->buffer.error) {
38406 wake_up(&dmxdevfilter->buffer.queue);
38407 return 0;
38408 }
38409 - spin_lock(&dmxdevfilter->dev->lock);
38410 + spin_lock_irqsave(&dmxdevfilter->dev->lock, flags);
38411 if (dmxdevfilter->state != DMXDEV_STATE_GO) {
38412 - spin_unlock(&dmxdevfilter->dev->lock);
38413 + spin_unlock_irqrestore(&dmxdevfilter->dev->lock, flags);
38414 return 0;
38415 }
38416 del_timer(&dmxdevfilter->timer);
38417 @@ -391,7 +392,7 @@
38418 }
38419 if (dmxdevfilter->params.sec.flags & DMX_ONESHOT)
38420 dmxdevfilter->state = DMXDEV_STATE_DONE;
38421 - spin_unlock(&dmxdevfilter->dev->lock);
38422 + spin_unlock_irqrestore(&dmxdevfilter->dev->lock, flags);
38423 wake_up(&dmxdevfilter->buffer.queue);
38424 return 0;
38425 }
38426 @@ -403,11 +404,12 @@
38427 {
38428 struct dmxdev_filter *dmxdevfilter = feed->priv;
38429 struct dvb_ringbuffer *buffer;
38430 + unsigned long flags;
38431 int ret;
38432
38433 - spin_lock(&dmxdevfilter->dev->lock);
38434 + spin_lock_irqsave(&dmxdevfilter->dev->lock, flags);
38435 if (dmxdevfilter->params.pes.output == DMX_OUT_DECODER) {
38436 - spin_unlock(&dmxdevfilter->dev->lock);
38437 + spin_unlock_irqrestore(&dmxdevfilter->dev->lock, flags);
38438 return 0;
38439 }
38440
38441 @@ -417,7 +419,7 @@
38442 else
38443 buffer = &dmxdevfilter->dev->dvr_buffer;
38444 if (buffer->error) {
38445 - spin_unlock(&dmxdevfilter->dev->lock);
38446 + spin_unlock_irqrestore(&dmxdevfilter->dev->lock, flags);
38447 wake_up(&buffer->queue);
38448 return 0;
38449 }
38450 @@ -428,7 +430,7 @@
38451 dvb_ringbuffer_flush(buffer);
38452 buffer->error = ret;
38453 }
38454 - spin_unlock(&dmxdevfilter->dev->lock);
38455 + spin_unlock_irqrestore(&dmxdevfilter->dev->lock, flags);
38456 wake_up(&buffer->queue);
38457 return 0;
38458 }
38459 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/dvb/dvb-core/dvb_ca_en50221.c linux-2.6.29-rc3.owrt/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
38460 --- linux-2.6.29.owrt/drivers/media/dvb/dvb-core/dvb_ca_en50221.c 2009-05-10 22:04:39.000000000 +0200
38461 +++ linux-2.6.29-rc3.owrt/drivers/media/dvb/dvb-core/dvb_ca_en50221.c 2009-05-10 23:48:28.000000000 +0200
38462 @@ -93,9 +93,6 @@
38463 /* current state of the CAM */
38464 int slot_state;
38465
38466 - /* mutex used for serializing access to one CI slot */
38467 - struct mutex slot_lock;
38468 -
38469 /* Number of CAMCHANGES that have occurred since last processing */
38470 atomic_t camchange_count;
38471
38472 @@ -714,20 +711,14 @@
38473 dprintk("%s\n", __func__);
38474
38475
38476 - /* sanity check */
38477 + // sanity check
38478 if (bytes_write > ca->slot_info[slot].link_buf_size)
38479 return -EINVAL;
38480
38481 - /* it is possible we are dealing with a single buffer implementation,
38482 - thus if there is data available for read or if there is even a read
38483 - already in progress, we do nothing but awake the kernel thread to
38484 - process the data if necessary. */
38485 + /* check if interface is actually waiting for us to read from it, or if a read is in progress */
38486 if ((status = ca->pub->read_cam_control(ca->pub, slot, CTRLIF_STATUS)) < 0)
38487 goto exitnowrite;
38488 if (status & (STATUSREG_DA | STATUSREG_RE)) {
38489 - if (status & STATUSREG_DA)
38490 - dvb_ca_en50221_thread_wakeup(ca);
38491 -
38492 status = -EAGAIN;
38493 goto exitnowrite;
38494 }
38495 @@ -996,8 +987,6 @@
38496 /* go through all the slots processing them */
38497 for (slot = 0; slot < ca->slot_count; slot++) {
38498
38499 - mutex_lock(&ca->slot_info[slot].slot_lock);
38500 -
38501 // check the cam status + deal with CAMCHANGEs
38502 while (dvb_ca_en50221_check_camstatus(ca, slot)) {
38503 /* clear down an old CI slot if necessary */
38504 @@ -1133,7 +1122,7 @@
38505
38506 case DVB_CA_SLOTSTATE_RUNNING:
38507 if (!ca->open)
38508 - break;
38509 + continue;
38510
38511 // poll slots for data
38512 pktcount = 0;
38513 @@ -1157,8 +1146,6 @@
38514 }
38515 break;
38516 }
38517 -
38518 - mutex_unlock(&ca->slot_info[slot].slot_lock);
38519 }
38520 }
38521
38522 @@ -1194,7 +1181,6 @@
38523 switch (cmd) {
38524 case CA_RESET:
38525 for (slot = 0; slot < ca->slot_count; slot++) {
38526 - mutex_lock(&ca->slot_info[slot].slot_lock);
38527 if (ca->slot_info[slot].slot_state != DVB_CA_SLOTSTATE_NONE) {
38528 dvb_ca_en50221_slot_shutdown(ca, slot);
38529 if (ca->flags & DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE)
38530 @@ -1202,7 +1188,6 @@
38531 slot,
38532 DVB_CA_EN50221_CAMCHANGE_INSERTED);
38533 }
38534 - mutex_unlock(&ca->slot_info[slot].slot_lock);
38535 }
38536 ca->next_read_slot = 0;
38537 dvb_ca_en50221_thread_wakeup(ca);
38538 @@ -1323,9 +1308,7 @@
38539 goto exit;
38540 }
38541
38542 - mutex_lock(&ca->slot_info[slot].slot_lock);
38543 status = dvb_ca_en50221_write_data(ca, slot, fragbuf, fraglen + 2);
38544 - mutex_unlock(&ca->slot_info[slot].slot_lock);
38545 if (status == (fraglen + 2)) {
38546 written = 1;
38547 break;
38548 @@ -1681,7 +1664,6 @@
38549 ca->slot_info[i].slot_state = DVB_CA_SLOTSTATE_NONE;
38550 atomic_set(&ca->slot_info[i].camchange_count, 0);
38551 ca->slot_info[i].camchange_type = DVB_CA_EN50221_CAMCHANGE_REMOVED;
38552 - mutex_init(&ca->slot_info[i].slot_lock);
38553 }
38554
38555 if (signal_pending(current)) {
38556 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/dvb/dvb-core/dvb_ca_en50221.h linux-2.6.29-rc3.owrt/drivers/media/dvb/dvb-core/dvb_ca_en50221.h
38557 --- linux-2.6.29.owrt/drivers/media/dvb/dvb-core/dvb_ca_en50221.h 2009-05-10 22:04:39.000000000 +0200
38558 +++ linux-2.6.29-rc3.owrt/drivers/media/dvb/dvb-core/dvb_ca_en50221.h 2009-05-10 23:48:28.000000000 +0200
38559 @@ -45,10 +45,8 @@
38560 /* the module owning this structure */
38561 struct module* owner;
38562
38563 - /* NOTE: the read_*, write_* and poll_slot_status functions will be
38564 - * called for different slots concurrently and need to use locks where
38565 - * and if appropriate. There will be no concurrent access to one slot.
38566 - */
38567 + /* NOTE: the read_*, write_* and poll_slot_status functions must use locks as
38568 + * they may be called from several threads at once */
38569
38570 /* functions for accessing attribute memory on the CAM */
38571 int (*read_attribute_mem)(struct dvb_ca_en50221* ca, int slot, int address);
38572 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/dvb/dvb-core/dvb_demux.c linux-2.6.29-rc3.owrt/drivers/media/dvb/dvb-core/dvb_demux.c
38573 --- linux-2.6.29.owrt/drivers/media/dvb/dvb-core/dvb_demux.c 2009-05-10 22:04:39.000000000 +0200
38574 +++ linux-2.6.29-rc3.owrt/drivers/media/dvb/dvb-core/dvb_demux.c 2009-05-10 23:48:28.000000000 +0200
38575 @@ -399,7 +399,9 @@
38576 void dvb_dmx_swfilter_packets(struct dvb_demux *demux, const u8 *buf,
38577 size_t count)
38578 {
38579 - spin_lock(&demux->lock);
38580 + unsigned long flags;
38581 +
38582 + spin_lock_irqsave(&demux->lock, flags);
38583
38584 while (count--) {
38585 if (buf[0] == 0x47)
38586 @@ -407,16 +409,17 @@
38587 buf += 188;
38588 }
38589
38590 - spin_unlock(&demux->lock);
38591 + spin_unlock_irqrestore(&demux->lock, flags);
38592 }
38593
38594 EXPORT_SYMBOL(dvb_dmx_swfilter_packets);
38595
38596 void dvb_dmx_swfilter(struct dvb_demux *demux, const u8 *buf, size_t count)
38597 {
38598 + unsigned long flags;
38599 int p = 0, i, j;
38600
38601 - spin_lock(&demux->lock);
38602 + spin_lock_irqsave(&demux->lock, flags);
38603
38604 if (demux->tsbufp) {
38605 i = demux->tsbufp;
38606 @@ -449,17 +452,18 @@
38607 }
38608
38609 bailout:
38610 - spin_unlock(&demux->lock);
38611 + spin_unlock_irqrestore(&demux->lock, flags);
38612 }
38613
38614 EXPORT_SYMBOL(dvb_dmx_swfilter);
38615
38616 void dvb_dmx_swfilter_204(struct dvb_demux *demux, const u8 *buf, size_t count)
38617 {
38618 + unsigned long flags;
38619 int p = 0, i, j;
38620 u8 tmppack[188];
38621
38622 - spin_lock(&demux->lock);
38623 + spin_lock_irqsave(&demux->lock, flags);
38624
38625 if (demux->tsbufp) {
38626 i = demux->tsbufp;
38627 @@ -500,7 +504,7 @@
38628 }
38629
38630 bailout:
38631 - spin_unlock(&demux->lock);
38632 + spin_unlock_irqrestore(&demux->lock, flags);
38633 }
38634
38635 EXPORT_SYMBOL(dvb_dmx_swfilter_204);
38636 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/dvb/dvb-core/dvb_frontend.c linux-2.6.29-rc3.owrt/drivers/media/dvb/dvb-core/dvb_frontend.c
38637 --- linux-2.6.29.owrt/drivers/media/dvb/dvb-core/dvb_frontend.c 2009-05-10 22:04:39.000000000 +0200
38638 +++ linux-2.6.29-rc3.owrt/drivers/media/dvb/dvb-core/dvb_frontend.c 2009-05-10 23:48:28.000000000 +0200
38639 @@ -1290,6 +1290,9 @@
38640 dprintk("%s() Finalised property cache\n", __func__);
38641 dtv_property_cache_submit(fe);
38642
38643 + /* Request the search algorithm to search */
38644 + fepriv->algo_status |= DVBFE_ALGO_SEARCH_AGAIN;
38645 +
38646 r |= dvb_frontend_ioctl_legacy(inode, file, FE_SET_FRONTEND,
38647 &fepriv->parameters);
38648 break;
38649 @@ -1714,10 +1717,6 @@
38650 fepriv->min_delay = (dvb_override_tune_delay * HZ) / 1000;
38651
38652 fepriv->state = FESTATE_RETUNE;
38653 -
38654 - /* Request the search algorithm to search */
38655 - fepriv->algo_status |= DVBFE_ALGO_SEARCH_AGAIN;
38656 -
38657 dvb_frontend_wakeup(fe);
38658 dvb_frontend_add_event(fe, 0);
38659 fepriv->status = 0;
38660 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/dvb/dvb-usb/af9005-fe.c linux-2.6.29-rc3.owrt/drivers/media/dvb/dvb-usb/af9005-fe.c
38661 --- linux-2.6.29.owrt/drivers/media/dvb/dvb-usb/af9005-fe.c 2009-05-10 22:04:39.000000000 +0200
38662 +++ linux-2.6.29-rc3.owrt/drivers/media/dvb/dvb-usb/af9005-fe.c 2009-05-10 23:48:28.000000000 +0200
38663 @@ -220,7 +220,7 @@
38664 u16 * abort_count)
38665 {
38666 u32 loc_cw_count = 0, loc_err_count;
38667 - u16 loc_abort_count = 0;
38668 + u16 loc_abort_count;
38669 int ret;
38670
38671 ret =
38672 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/dvb/dvb-usb/af9015.c linux-2.6.29-rc3.owrt/drivers/media/dvb/dvb-usb/af9015.c
38673 --- linux-2.6.29.owrt/drivers/media/dvb/dvb-usb/af9015.c 2009-05-10 22:04:39.000000000 +0200
38674 +++ linux-2.6.29-rc3.owrt/drivers/media/dvb/dvb-usb/af9015.c 2009-05-10 23:48:28.000000000 +0200
38675 @@ -694,12 +694,7 @@
38676
38677 /* IR remote controller */
38678 req.addr = AF9015_EEPROM_IR_MODE;
38679 - /* first message will timeout often due to possible hw bug */
38680 - for (i = 0; i < 4; i++) {
38681 - ret = af9015_rw_udev(udev, &req);
38682 - if (!ret)
38683 - break;
38684 - }
38685 + ret = af9015_rw_udev(udev, &req);
38686 if (ret)
38687 goto error;
38688 deb_info("%s: IR mode:%d\n", __func__, val);
38689 @@ -840,19 +835,18 @@
38690 if (!dvb_usb_af9015_dual_mode)
38691 af9015_config.dual_mode = 0;
38692
38693 - /* Set adapter0 buffer size according to USB port speed, adapter1 buffer
38694 - size can be static because it is enabled only USB2.0 */
38695 + /* set buffer size according to USB port speed */
38696 for (i = 0; i < af9015_properties_count; i++) {
38697 /* USB1.1 set smaller buffersize and disable 2nd adapter */
38698 if (udev->speed == USB_SPEED_FULL) {
38699 - af9015_properties[i].adapter[0].stream.u.bulk.buffersize
38700 - = TS_USB11_MAX_PACKET_SIZE;
38701 + af9015_properties[i].adapter->stream.u.bulk.buffersize =
38702 + TS_USB11_MAX_PACKET_SIZE;
38703 /* disable 2nd adapter because we don't have
38704 PID-filters */
38705 af9015_config.dual_mode = 0;
38706 } else {
38707 - af9015_properties[i].adapter[0].stream.u.bulk.buffersize
38708 - = TS_USB20_MAX_PACKET_SIZE;
38709 + af9015_properties[i].adapter->stream.u.bulk.buffersize =
38710 + TS_USB20_MAX_PACKET_SIZE;
38711 }
38712 }
38713
38714 @@ -1260,12 +1254,6 @@
38715 .type = USB_BULK,
38716 .count = 6,
38717 .endpoint = 0x85,
38718 - .u = {
38719 - .bulk = {
38720 - .buffersize =
38721 - TS_USB20_MAX_PACKET_SIZE,
38722 - }
38723 - }
38724 },
38725 }
38726 },
38727 @@ -1365,12 +1353,6 @@
38728 .type = USB_BULK,
38729 .count = 6,
38730 .endpoint = 0x85,
38731 - .u = {
38732 - .bulk = {
38733 - .buffersize =
38734 - TS_USB20_MAX_PACKET_SIZE,
38735 - }
38736 - }
38737 },
38738 }
38739 },
38740 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/dvb/dvb-usb/dib0700_devices.c linux-2.6.29-rc3.owrt/drivers/media/dvb/dvb-usb/dib0700_devices.c
38741 --- linux-2.6.29.owrt/drivers/media/dvb/dvb-usb/dib0700_devices.c 2009-05-10 22:04:39.000000000 +0200
38742 +++ linux-2.6.29-rc3.owrt/drivers/media/dvb/dvb-usb/dib0700_devices.c 2009-05-10 23:48:28.000000000 +0200
38743 @@ -1393,9 +1393,6 @@
38744 { USB_DEVICE(USB_VID_ASUS, USB_PID_ASUS_U3000H) },
38745 /* 40 */{ USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV801E) },
38746 { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV801E_SE) },
38747 - { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_T_EXPRESS) },
38748 - { USB_DEVICE(USB_VID_TERRATEC,
38749 - USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY_2) },
38750 { 0 } /* Terminating entry */
38751 };
38752 MODULE_DEVICE_TABLE(usb, dib0700_usb_id_table);
38753 @@ -1540,8 +1537,7 @@
38754 { "DiBcom STK7700D reference design",
38755 { &dib0700_usb_id_table[14], NULL },
38756 { NULL },
38757 - },
38758 -
38759 + }
38760 },
38761
38762 .rc_interval = DEFAULT_RC_INTERVAL,
38763 @@ -1561,7 +1557,7 @@
38764 },
38765 },
38766
38767 - .num_device_descs = 3,
38768 + .num_device_descs = 2,
38769 .devices = {
38770 { "ASUS My Cinema U3000 Mini DVBT Tuner",
38771 { &dib0700_usb_id_table[23], NULL },
38772 @@ -1570,10 +1566,6 @@
38773 { "Yuan EC372S",
38774 { &dib0700_usb_id_table[31], NULL },
38775 { NULL },
38776 - },
38777 - { "Terratec Cinergy T Express",
38778 - { &dib0700_usb_id_table[42], NULL },
38779 - { NULL },
38780 }
38781 },
38782
38783 @@ -1661,7 +1653,7 @@
38784 }
38785 },
38786
38787 - .num_device_descs = 5,
38788 + .num_device_descs = 4,
38789 .devices = {
38790 { "DiBcom STK7070PD reference design",
38791 { &dib0700_usb_id_table[17], NULL },
38792 @@ -1678,10 +1670,6 @@
38793 { "Hauppauge Nova-TD-500 (84xxx)",
38794 { &dib0700_usb_id_table[36], NULL },
38795 { NULL },
38796 - },
38797 - { "Terratec Cinergy DT USB XS Diversity",
38798 - { &dib0700_usb_id_table[43], NULL },
38799 - { NULL },
38800 }
38801 }
38802 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
38803 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/dvb/dvb-usb/dvb-usb-ids.h linux-2.6.29-rc3.owrt/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
38804 --- linux-2.6.29.owrt/drivers/media/dvb/dvb-usb/dvb-usb-ids.h 2009-05-10 22:04:39.000000000 +0200
38805 +++ linux-2.6.29-rc3.owrt/drivers/media/dvb/dvb-usb/dvb-usb-ids.h 2009-05-10 23:48:28.000000000 +0200
38806 @@ -162,10 +162,8 @@
38807 #define USB_PID_AVERMEDIA_A309 0xa309
38808 #define USB_PID_TECHNOTREND_CONNECT_S2400 0x3006
38809 #define USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY 0x005a
38810 -#define USB_PID_TERRATEC_CINERGY_DT_XS_DIVERSITY_2 0x0081
38811 #define USB_PID_TERRATEC_CINERGY_HT_USB_XE 0x0058
38812 #define USB_PID_TERRATEC_CINERGY_HT_EXPRESS 0x0060
38813 -#define USB_PID_TERRATEC_CINERGY_T_EXPRESS 0x0062
38814 #define USB_PID_TERRATEC_CINERGY_T_XXS 0x0078
38815 #define USB_PID_PINNACLE_EXPRESSCARD_320CX 0x022e
38816 #define USB_PID_PINNACLE_PCTV2000E 0x022c
38817 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/dvb/firewire/firedtv-1394.c linux-2.6.29-rc3.owrt/drivers/media/dvb/firewire/firedtv-1394.c
38818 --- linux-2.6.29.owrt/drivers/media/dvb/firewire/firedtv-1394.c 2009-05-10 22:04:39.000000000 +0200
38819 +++ linux-2.6.29-rc3.owrt/drivers/media/dvb/firewire/firedtv-1394.c 1970-01-01 01:00:00.000000000 +0100
38820 @@ -1,285 +0,0 @@
38821 -/*
38822 - * FireDTV driver (formerly known as FireSAT)
38823 - *
38824 - * Copyright (C) 2004 Andreas Monitzer <andy@monitzer.com>
38825 - * Copyright (C) 2007-2008 Ben Backx <ben@bbackx.com>
38826 - * Copyright (C) 2008 Henrik Kurelid <henrik@kurelid.se>
38827 - *
38828 - * This program is free software; you can redistribute it and/or
38829 - * modify it under the terms of the GNU General Public License as
38830 - * published by the Free Software Foundation; either version 2 of
38831 - * the License, or (at your option) any later version.
38832 - */
38833 -
38834 -#include <linux/device.h>
38835 -#include <linux/errno.h>
38836 -#include <linux/kernel.h>
38837 -#include <linux/list.h>
38838 -#include <linux/spinlock.h>
38839 -#include <linux/types.h>
38840 -
38841 -#include <dma.h>
38842 -#include <csr1212.h>
38843 -#include <highlevel.h>
38844 -#include <hosts.h>
38845 -#include <ieee1394.h>
38846 -#include <iso.h>
38847 -#include <nodemgr.h>
38848 -
38849 -#include "firedtv.h"
38850 -
38851 -static LIST_HEAD(node_list);
38852 -static DEFINE_SPINLOCK(node_list_lock);
38853 -
38854 -#define FIREWIRE_HEADER_SIZE 4
38855 -#define CIP_HEADER_SIZE 8
38856 -
38857 -static void rawiso_activity_cb(struct hpsb_iso *iso)
38858 -{
38859 - struct firedtv *f, *fdtv = NULL;
38860 - unsigned int i, num, packet;
38861 - unsigned char *buf;
38862 - unsigned long flags;
38863 - int count;
38864 -
38865 - spin_lock_irqsave(&node_list_lock, flags);
38866 - list_for_each_entry(f, &node_list, list)
38867 - if (f->backend_data == iso) {
38868 - fdtv = f;
38869 - break;
38870 - }
38871 - spin_unlock_irqrestore(&node_list_lock, flags);
38872 -
38873 - packet = iso->first_packet;
38874 - num = hpsb_iso_n_ready(iso);
38875 -
38876 - if (!fdtv) {
38877 - dev_err(fdtv->device, "received at unknown iso channel\n");
38878 - goto out;
38879 - }
38880 -
38881 - for (i = 0; i < num; i++, packet = (packet + 1) % iso->buf_packets) {
38882 - buf = dma_region_i(&iso->data_buf, unsigned char,
38883 - iso->infos[packet].offset + CIP_HEADER_SIZE);
38884 - count = (iso->infos[packet].len - CIP_HEADER_SIZE) /
38885 - (188 + FIREWIRE_HEADER_SIZE);
38886 -
38887 - /* ignore empty packet */
38888 - if (iso->infos[packet].len <= CIP_HEADER_SIZE)
38889 - continue;
38890 -
38891 - while (count--) {
38892 - if (buf[FIREWIRE_HEADER_SIZE] == 0x47)
38893 - dvb_dmx_swfilter_packets(&fdtv->demux,
38894 - &buf[FIREWIRE_HEADER_SIZE], 1);
38895 - else
38896 - dev_err(fdtv->device,
38897 - "skipping invalid packet\n");
38898 - buf += 188 + FIREWIRE_HEADER_SIZE;
38899 - }
38900 - }
38901 -out:
38902 - hpsb_iso_recv_release_packets(iso, num);
38903 -}
38904 -
38905 -static inline struct node_entry *node_of(struct firedtv *fdtv)
38906 -{
38907 - return container_of(fdtv->device, struct unit_directory, device)->ne;
38908 -}
38909 -
38910 -static int node_lock(struct firedtv *fdtv, u64 addr, void *data, __be32 arg)
38911 -{
38912 - return hpsb_node_lock(node_of(fdtv), addr, EXTCODE_COMPARE_SWAP, data,
38913 - (__force quadlet_t)arg);
38914 -}
38915 -
38916 -static int node_read(struct firedtv *fdtv, u64 addr, void *data, size_t len)
38917 -{
38918 - return hpsb_node_read(node_of(fdtv), addr, data, len);
38919 -}
38920 -
38921 -static int node_write(struct firedtv *fdtv, u64 addr, void *data, size_t len)
38922 -{
38923 - return hpsb_node_write(node_of(fdtv), addr, data, len);
38924 -}
38925 -
38926 -#define FDTV_ISO_BUFFER_PACKETS 256
38927 -#define FDTV_ISO_BUFFER_SIZE (FDTV_ISO_BUFFER_PACKETS * 200)
38928 -
38929 -static int start_iso(struct firedtv *fdtv)
38930 -{
38931 - struct hpsb_iso *iso_handle;
38932 - int ret;
38933 -
38934 - iso_handle = hpsb_iso_recv_init(node_of(fdtv)->host,
38935 - FDTV_ISO_BUFFER_SIZE, FDTV_ISO_BUFFER_PACKETS,
38936 - fdtv->isochannel, HPSB_ISO_DMA_DEFAULT,
38937 - -1, /* stat.config.irq_interval */
38938 - rawiso_activity_cb);
38939 - if (iso_handle == NULL) {
38940 - dev_err(fdtv->device, "cannot initialize iso receive\n");
38941 - return -ENOMEM;
38942 - }
38943 - fdtv->backend_data = iso_handle;
38944 -
38945 - ret = hpsb_iso_recv_start(iso_handle, -1, -1, 0);
38946 - if (ret != 0) {
38947 - dev_err(fdtv->device, "cannot start iso receive\n");
38948 - hpsb_iso_shutdown(iso_handle);
38949 - fdtv->backend_data = NULL;
38950 - }
38951 - return ret;
38952 -}
38953 -
38954 -static void stop_iso(struct firedtv *fdtv)
38955 -{
38956 - struct hpsb_iso *iso_handle = fdtv->backend_data;
38957 -
38958 - if (iso_handle != NULL) {
38959 - hpsb_iso_stop(iso_handle);
38960 - hpsb_iso_shutdown(iso_handle);
38961 - }
38962 - fdtv->backend_data = NULL;
38963 -}
38964 -
38965 -static const struct firedtv_backend fdtv_1394_backend = {
38966 - .lock = node_lock,
38967 - .read = node_read,
38968 - .write = node_write,
38969 - .start_iso = start_iso,
38970 - .stop_iso = stop_iso,
38971 -};
38972 -
38973 -static void fcp_request(struct hpsb_host *host, int nodeid, int direction,
38974 - int cts, u8 *data, size_t length)
38975 -{
38976 - struct firedtv *f, *fdtv = NULL;
38977 - unsigned long flags;
38978 - int su;
38979 -
38980 - if (length == 0 || (data[0] & 0xf0) != 0)
38981 - return;
38982 -
38983 - su = data[1] & 0x7;
38984 -
38985 - spin_lock_irqsave(&node_list_lock, flags);
38986 - list_for_each_entry(f, &node_list, list)
38987 - if (node_of(f)->host == host &&
38988 - node_of(f)->nodeid == nodeid &&
38989 - (f->subunit == su || (f->subunit == 0 && su == 0x7))) {
38990 - fdtv = f;
38991 - break;
38992 - }
38993 - spin_unlock_irqrestore(&node_list_lock, flags);
38994 -
38995 - if (fdtv)
38996 - avc_recv(fdtv, data, length);
38997 -}
38998 -
38999 -static int node_probe(struct device *dev)
39000 -{
39001 - struct unit_directory *ud =
39002 - container_of(dev, struct unit_directory, device);
39003 - struct firedtv *fdtv;
39004 - int kv_len, err;
39005 - void *kv_str;
39006 -
39007 - kv_len = (ud->model_name_kv->value.leaf.len - 2) * sizeof(quadlet_t);
39008 - kv_str = CSR1212_TEXTUAL_DESCRIPTOR_LEAF_DATA(ud->model_name_kv);
39009 -
39010 - fdtv = fdtv_alloc(dev, &fdtv_1394_backend, kv_str, kv_len);
39011 - if (!fdtv)
39012 - return -ENOMEM;
39013 -
39014 - /*
39015 - * Work around a bug in udev's path_id script: Use the fw-host's dev
39016 - * instead of the unit directory's dev as parent of the input device.
39017 - */
39018 - err = fdtv_register_rc(fdtv, dev->parent->parent);
39019 - if (err)
39020 - goto fail_free;
39021 -
39022 - spin_lock_irq(&node_list_lock);
39023 - list_add_tail(&fdtv->list, &node_list);
39024 - spin_unlock_irq(&node_list_lock);
39025 -
39026 - err = avc_identify_subunit(fdtv);
39027 - if (err)
39028 - goto fail;
39029 -
39030 - err = fdtv_dvb_register(fdtv);
39031 - if (err)
39032 - goto fail;
39033 -
39034 - avc_register_remote_control(fdtv);
39035 - return 0;
39036 -fail:
39037 - spin_lock_irq(&node_list_lock);
39038 - list_del(&fdtv->list);
39039 - spin_unlock_irq(&node_list_lock);
39040 - fdtv_unregister_rc(fdtv);
39041 -fail_free:
39042 - kfree(fdtv);
39043 - return err;
39044 -}
39045 -
39046 -static int node_remove(struct device *dev)
39047 -{
39048 - struct firedtv *fdtv = dev->driver_data;
39049 -
39050 - fdtv_dvb_unregister(fdtv);
39051 -
39052 - spin_lock_irq(&node_list_lock);
39053 - list_del(&fdtv->list);
39054 - spin_unlock_irq(&node_list_lock);
39055 -
39056 - cancel_work_sync(&fdtv->remote_ctrl_work);
39057 - fdtv_unregister_rc(fdtv);
39058 -
39059 - kfree(fdtv);
39060 - return 0;
39061 -}
39062 -
39063 -static int node_update(struct unit_directory *ud)
39064 -{
39065 - struct firedtv *fdtv = ud->device.driver_data;
39066 -
39067 - if (fdtv->isochannel >= 0)
39068 - cmp_establish_pp_connection(fdtv, fdtv->subunit,
39069 - fdtv->isochannel);
39070 - return 0;
39071 -}
39072 -
39073 -static struct hpsb_protocol_driver fdtv_driver = {
39074 - .name = "firedtv",
39075 - .update = node_update,
39076 - .driver = {
39077 - .probe = node_probe,
39078 - .remove = node_remove,
39079 - },
39080 -};
39081 -
39082 -static struct hpsb_highlevel fdtv_highlevel = {
39083 - .name = "firedtv",
39084 - .fcp_request = fcp_request,
39085 -};
39086 -
39087 -int __init fdtv_1394_init(struct ieee1394_device_id id_table[])
39088 -{
39089 - int ret;
39090 -
39091 - hpsb_register_highlevel(&fdtv_highlevel);
39092 - fdtv_driver.id_table = id_table;
39093 - ret = hpsb_register_protocol(&fdtv_driver);
39094 - if (ret) {
39095 - printk(KERN_ERR "firedtv: failed to register protocol\n");
39096 - hpsb_unregister_highlevel(&fdtv_highlevel);
39097 - }
39098 - return ret;
39099 -}
39100 -
39101 -void __exit fdtv_1394_exit(void)
39102 -{
39103 - hpsb_unregister_protocol(&fdtv_driver);
39104 - hpsb_unregister_highlevel(&fdtv_highlevel);
39105 -}
39106 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/dvb/firewire/firedtv-avc.c linux-2.6.29-rc3.owrt/drivers/media/dvb/firewire/firedtv-avc.c
39107 --- linux-2.6.29.owrt/drivers/media/dvb/firewire/firedtv-avc.c 2009-05-10 22:04:39.000000000 +0200
39108 +++ linux-2.6.29-rc3.owrt/drivers/media/dvb/firewire/firedtv-avc.c 1970-01-01 01:00:00.000000000 +0100
39109 @@ -1,1315 +0,0 @@
39110 -/*
39111 - * FireDTV driver (formerly known as FireSAT)
39112 - *
39113 - * Copyright (C) 2004 Andreas Monitzer <andy@monitzer.com>
39114 - * Copyright (C) 2008 Ben Backx <ben@bbackx.com>
39115 - * Copyright (C) 2008 Henrik Kurelid <henrik@kurelid.se>
39116 - *
39117 - * This program is free software; you can redistribute it and/or
39118 - * modify it under the terms of the GNU General Public License as
39119 - * published by the Free Software Foundation; either version 2 of
39120 - * the License, or (at your option) any later version.
39121 - */
39122 -
39123 -#include <linux/bug.h>
39124 -#include <linux/crc32.h>
39125 -#include <linux/delay.h>
39126 -#include <linux/device.h>
39127 -#include <linux/jiffies.h>
39128 -#include <linux/kernel.h>
39129 -#include <linux/moduleparam.h>
39130 -#include <linux/mutex.h>
39131 -#include <linux/string.h>
39132 -#include <linux/stringify.h>
39133 -#include <linux/wait.h>
39134 -#include <linux/workqueue.h>
39135 -
39136 -#include "firedtv.h"
39137 -
39138 -#define FCP_COMMAND_REGISTER 0xfffff0000b00ULL
39139 -
39140 -#define AVC_CTYPE_CONTROL 0x0
39141 -#define AVC_CTYPE_STATUS 0x1
39142 -#define AVC_CTYPE_NOTIFY 0x3
39143 -
39144 -#define AVC_RESPONSE_ACCEPTED 0x9
39145 -#define AVC_RESPONSE_STABLE 0xc
39146 -#define AVC_RESPONSE_CHANGED 0xd
39147 -#define AVC_RESPONSE_INTERIM 0xf
39148 -
39149 -#define AVC_SUBUNIT_TYPE_TUNER (0x05 << 3)
39150 -#define AVC_SUBUNIT_TYPE_UNIT (0x1f << 3)
39151 -
39152 -#define AVC_OPCODE_VENDOR 0x00
39153 -#define AVC_OPCODE_READ_DESCRIPTOR 0x09
39154 -#define AVC_OPCODE_DSIT 0xc8
39155 -#define AVC_OPCODE_DSD 0xcb
39156 -
39157 -#define DESCRIPTOR_TUNER_STATUS 0x80
39158 -#define DESCRIPTOR_SUBUNIT_IDENTIFIER 0x00
39159 -
39160 -#define SFE_VENDOR_DE_COMPANYID_0 0x00 /* OUI of Digital Everywhere */
39161 -#define SFE_VENDOR_DE_COMPANYID_1 0x12
39162 -#define SFE_VENDOR_DE_COMPANYID_2 0x87
39163 -
39164 -#define SFE_VENDOR_OPCODE_REGISTER_REMOTE_CONTROL 0x0a
39165 -#define SFE_VENDOR_OPCODE_LNB_CONTROL 0x52
39166 -#define SFE_VENDOR_OPCODE_TUNE_QPSK 0x58 /* for DVB-S */
39167 -
39168 -#define SFE_VENDOR_OPCODE_GET_FIRMWARE_VERSION 0x00
39169 -#define SFE_VENDOR_OPCODE_HOST2CA 0x56
39170 -#define SFE_VENDOR_OPCODE_CA2HOST 0x57
39171 -#define SFE_VENDOR_OPCODE_CISTATUS 0x59
39172 -#define SFE_VENDOR_OPCODE_TUNE_QPSK2 0x60 /* for DVB-S2 */
39173 -
39174 -#define SFE_VENDOR_TAG_CA_RESET 0x00
39175 -#define SFE_VENDOR_TAG_CA_APPLICATION_INFO 0x01
39176 -#define SFE_VENDOR_TAG_CA_PMT 0x02
39177 -#define SFE_VENDOR_TAG_CA_DATE_TIME 0x04
39178 -#define SFE_VENDOR_TAG_CA_MMI 0x05
39179 -#define SFE_VENDOR_TAG_CA_ENTER_MENU 0x07
39180 -
39181 -#define EN50221_LIST_MANAGEMENT_ONLY 0x03
39182 -#define EN50221_TAG_APP_INFO 0x9f8021
39183 -#define EN50221_TAG_CA_INFO 0x9f8031
39184 -
39185 -struct avc_command_frame {
39186 - int length;
39187 - u8 ctype;
39188 - u8 subunit;
39189 - u8 opcode;
39190 - u8 operand[509];
39191 -};
39192 -
39193 -struct avc_response_frame {
39194 - int length;
39195 - u8 response;
39196 - u8 subunit;
39197 - u8 opcode;
39198 - u8 operand[509];
39199 -};
39200 -
39201 -#define AVC_DEBUG_FCP_SUBACTIONS 1
39202 -#define AVC_DEBUG_FCP_PAYLOADS 2
39203 -
39204 -static int avc_debug;
39205 -module_param_named(debug, avc_debug, int, 0644);
39206 -MODULE_PARM_DESC(debug, "Verbose logging (default = 0"
39207 - ", FCP subactions = " __stringify(AVC_DEBUG_FCP_SUBACTIONS)
39208 - ", FCP payloads = " __stringify(AVC_DEBUG_FCP_PAYLOADS)
39209 - ", or all = -1)");
39210 -
39211 -static const char *debug_fcp_ctype(unsigned int ctype)
39212 -{
39213 - static const char *ctypes[] = {
39214 - [0x0] = "CONTROL", [0x1] = "STATUS",
39215 - [0x2] = "SPECIFIC INQUIRY", [0x3] = "NOTIFY",
39216 - [0x4] = "GENERAL INQUIRY", [0x8] = "NOT IMPLEMENTED",
39217 - [0x9] = "ACCEPTED", [0xa] = "REJECTED",
39218 - [0xb] = "IN TRANSITION", [0xc] = "IMPLEMENTED/STABLE",
39219 - [0xd] = "CHANGED", [0xf] = "INTERIM",
39220 - };
39221 - const char *ret = ctype < ARRAY_SIZE(ctypes) ? ctypes[ctype] : NULL;
39222 -
39223 - return ret ? ret : "?";
39224 -}
39225 -
39226 -static const char *debug_fcp_opcode(unsigned int opcode,
39227 - const u8 *data, size_t length)
39228 -{
39229 - switch (opcode) {
39230 - case AVC_OPCODE_VENDOR: break;
39231 - case AVC_OPCODE_READ_DESCRIPTOR: return "ReadDescriptor";
39232 - case AVC_OPCODE_DSIT: return "DirectSelectInfo.Type";
39233 - case AVC_OPCODE_DSD: return "DirectSelectData";
39234 - default: return "?";
39235 - }
39236 -
39237 - if (length < 7 ||
39238 - data[3] != SFE_VENDOR_DE_COMPANYID_0 ||
39239 - data[4] != SFE_VENDOR_DE_COMPANYID_1 ||
39240 - data[5] != SFE_VENDOR_DE_COMPANYID_2)
39241 - return "Vendor";
39242 -
39243 - switch (data[6]) {
39244 - case SFE_VENDOR_OPCODE_REGISTER_REMOTE_CONTROL: return "RegisterRC";
39245 - case SFE_VENDOR_OPCODE_LNB_CONTROL: return "LNBControl";
39246 - case SFE_VENDOR_OPCODE_TUNE_QPSK: return "TuneQPSK";
39247 - case SFE_VENDOR_OPCODE_HOST2CA: return "Host2CA";
39248 - case SFE_VENDOR_OPCODE_CA2HOST: return "CA2Host";
39249 - }
39250 - return "Vendor";
39251 -}
39252 -
39253 -static void debug_fcp(const u8 *data, size_t length)
39254 -{
39255 - unsigned int subunit_type, subunit_id, op;
39256 - const char *prefix = data[0] > 7 ? "FCP <- " : "FCP -> ";
39257 -
39258 - if (avc_debug & AVC_DEBUG_FCP_SUBACTIONS) {
39259 - subunit_type = data[1] >> 3;
39260 - subunit_id = data[1] & 7;
39261 - op = subunit_type == 0x1e || subunit_id == 5 ? ~0 : data[2];
39262 - printk(KERN_INFO "%ssu=%x.%x l=%d: %-8s - %s\n",
39263 - prefix, subunit_type, subunit_id, length,
39264 - debug_fcp_ctype(data[0]),
39265 - debug_fcp_opcode(op, data, length));
39266 - }
39267 -
39268 - if (avc_debug & AVC_DEBUG_FCP_PAYLOADS)
39269 - print_hex_dump(KERN_INFO, prefix, DUMP_PREFIX_NONE, 16, 1,
39270 - data, length, false);
39271 -}
39272 -
39273 -static int __avc_write(struct firedtv *fdtv,
39274 - const struct avc_command_frame *c, struct avc_response_frame *r)
39275 -{
39276 - int err, retry;
39277 -
39278 - if (r)
39279 - fdtv->avc_reply_received = false;
39280 -
39281 - for (retry = 0; retry < 6; retry++) {
39282 - if (unlikely(avc_debug))
39283 - debug_fcp(&c->ctype, c->length);
39284 -
39285 - err = fdtv->backend->write(fdtv, FCP_COMMAND_REGISTER,
39286 - (void *)&c->ctype, c->length);
39287 - if (err) {
39288 - fdtv->avc_reply_received = true;
39289 - dev_err(fdtv->device, "FCP command write failed\n");
39290 - return err;
39291 - }
39292 -
39293 - if (!r)
39294 - return 0;
39295 -
39296 - /*
39297 - * AV/C specs say that answers should be sent within 150 ms.
39298 - * Time out after 200 ms.
39299 - */
39300 - if (wait_event_timeout(fdtv->avc_wait,
39301 - fdtv->avc_reply_received,
39302 - msecs_to_jiffies(200)) != 0) {
39303 - r->length = fdtv->response_length;
39304 - memcpy(&r->response, fdtv->response, r->length);
39305 -
39306 - return 0;
39307 - }
39308 - }
39309 - dev_err(fdtv->device, "FCP response timed out\n");
39310 - return -ETIMEDOUT;
39311 -}
39312 -
39313 -static int avc_write(struct firedtv *fdtv,
39314 - const struct avc_command_frame *c, struct avc_response_frame *r)
39315 -{
39316 - int ret;
39317 -
39318 - if (mutex_lock_interruptible(&fdtv->avc_mutex))
39319 - return -EINTR;
39320 -
39321 - ret = __avc_write(fdtv, c, r);
39322 -
39323 - mutex_unlock(&fdtv->avc_mutex);
39324 - return ret;
39325 -}
39326 -
39327 -int avc_recv(struct firedtv *fdtv, void *data, size_t length)
39328 -{
39329 - struct avc_response_frame *r =
39330 - data - offsetof(struct avc_response_frame, response);
39331 -
39332 - if (unlikely(avc_debug))
39333 - debug_fcp(data, length);
39334 -
39335 - if (length >= 8 &&
39336 - r->operand[0] == SFE_VENDOR_DE_COMPANYID_0 &&
39337 - r->operand[1] == SFE_VENDOR_DE_COMPANYID_1 &&
39338 - r->operand[2] == SFE_VENDOR_DE_COMPANYID_2 &&
39339 - r->operand[3] == SFE_VENDOR_OPCODE_REGISTER_REMOTE_CONTROL) {
39340 - if (r->response == AVC_RESPONSE_CHANGED) {
39341 - fdtv_handle_rc(fdtv,
39342 - r->operand[4] << 8 | r->operand[5]);
39343 - schedule_work(&fdtv->remote_ctrl_work);
39344 - } else if (r->response != AVC_RESPONSE_INTERIM) {
39345 - dev_info(fdtv->device,
39346 - "remote control result = %d\n", r->response);
39347 - }
39348 - return 0;
39349 - }
39350 -
39351 - if (fdtv->avc_reply_received) {
39352 - dev_err(fdtv->device, "out-of-order AVC response, ignored\n");
39353 - return -EIO;
39354 - }
39355 -
39356 - memcpy(fdtv->response, data, length);
39357 - fdtv->response_length = length;
39358 -
39359 - fdtv->avc_reply_received = true;
39360 - wake_up(&fdtv->avc_wait);
39361 -
39362 - return 0;
39363 -}
39364 -
39365 -/*
39366 - * tuning command for setting the relative LNB frequency
39367 - * (not supported by the AVC standard)
39368 - */
39369 -static void avc_tuner_tuneqpsk(struct firedtv *fdtv,
39370 - struct dvb_frontend_parameters *params,
39371 - struct avc_command_frame *c)
39372 -{
39373 - c->opcode = AVC_OPCODE_VENDOR;
39374 -
39375 - c->operand[0] = SFE_VENDOR_DE_COMPANYID_0;
39376 - c->operand[1] = SFE_VENDOR_DE_COMPANYID_1;
39377 - c->operand[2] = SFE_VENDOR_DE_COMPANYID_2;
39378 - c->operand[3] = SFE_VENDOR_OPCODE_TUNE_QPSK;
39379 -
39380 - c->operand[4] = (params->frequency >> 24) & 0xff;
39381 - c->operand[5] = (params->frequency >> 16) & 0xff;
39382 - c->operand[6] = (params->frequency >> 8) & 0xff;
39383 - c->operand[7] = params->frequency & 0xff;
39384 -
39385 - c->operand[8] = ((params->u.qpsk.symbol_rate / 1000) >> 8) & 0xff;
39386 - c->operand[9] = (params->u.qpsk.symbol_rate / 1000) & 0xff;
39387 -
39388 - switch (params->u.qpsk.fec_inner) {
39389 - case FEC_1_2: c->operand[10] = 0x1; break;
39390 - case FEC_2_3: c->operand[10] = 0x2; break;
39391 - case FEC_3_4: c->operand[10] = 0x3; break;
39392 - case FEC_5_6: c->operand[10] = 0x4; break;
39393 - case FEC_7_8: c->operand[10] = 0x5; break;
39394 - case FEC_4_5:
39395 - case FEC_8_9:
39396 - case FEC_AUTO:
39397 - default: c->operand[10] = 0x0;
39398 - }
39399 -
39400 - if (fdtv->voltage == 0xff)
39401 - c->operand[11] = 0xff;
39402 - else if (fdtv->voltage == SEC_VOLTAGE_18) /* polarisation */
39403 - c->operand[11] = 0;
39404 - else
39405 - c->operand[11] = 1;
39406 -
39407 - if (fdtv->tone == 0xff)
39408 - c->operand[12] = 0xff;
39409 - else if (fdtv->tone == SEC_TONE_ON) /* band */
39410 - c->operand[12] = 1;
39411 - else
39412 - c->operand[12] = 0;
39413 -
39414 - if (fdtv->type == FIREDTV_DVB_S2) {
39415 - c->operand[13] = 0x1;
39416 - c->operand[14] = 0xff;
39417 - c->operand[15] = 0xff;
39418 - c->length = 20;
39419 - } else {
39420 - c->length = 16;
39421 - }
39422 -}
39423 -
39424 -static void avc_tuner_dsd_dvb_c(struct dvb_frontend_parameters *params,
39425 - struct avc_command_frame *c)
39426 -{
39427 - c->opcode = AVC_OPCODE_DSD;
39428 -
39429 - c->operand[0] = 0; /* source plug */
39430 - c->operand[1] = 0xd2; /* subfunction replace */
39431 - c->operand[2] = 0x20; /* system id = DVB */
39432 - c->operand[3] = 0x00; /* antenna number */
39433 - c->operand[4] = 0x11; /* system_specific_multiplex selection_length */
39434 -
39435 - /* multiplex_valid_flags, high byte */
39436 - c->operand[5] = 0 << 7 /* reserved */
39437 - | 0 << 6 /* Polarisation */
39438 - | 0 << 5 /* Orbital_Pos */
39439 - | 1 << 4 /* Frequency */
39440 - | 1 << 3 /* Symbol_Rate */
39441 - | 0 << 2 /* FEC_outer */
39442 - | (params->u.qam.fec_inner != FEC_AUTO ? 1 << 1 : 0)
39443 - | (params->u.qam.modulation != QAM_AUTO ? 1 << 0 : 0);
39444 -
39445 - /* multiplex_valid_flags, low byte */
39446 - c->operand[6] = 0 << 7 /* NetworkID */
39447 - | 0 << 0 /* reserved */ ;
39448 -
39449 - c->operand[7] = 0x00;
39450 - c->operand[8] = 0x00;
39451 - c->operand[9] = 0x00;
39452 - c->operand[10] = 0x00;
39453 -
39454 - c->operand[11] = (((params->frequency / 4000) >> 16) & 0xff) | (2 << 6);
39455 - c->operand[12] = ((params->frequency / 4000) >> 8) & 0xff;
39456 - c->operand[13] = (params->frequency / 4000) & 0xff;
39457 - c->operand[14] = ((params->u.qpsk.symbol_rate / 1000) >> 12) & 0xff;
39458 - c->operand[15] = ((params->u.qpsk.symbol_rate / 1000) >> 4) & 0xff;
39459 - c->operand[16] = ((params->u.qpsk.symbol_rate / 1000) << 4) & 0xf0;
39460 - c->operand[17] = 0x00;
39461 -
39462 - switch (params->u.qpsk.fec_inner) {
39463 - case FEC_1_2: c->operand[18] = 0x1; break;
39464 - case FEC_2_3: c->operand[18] = 0x2; break;
39465 - case FEC_3_4: c->operand[18] = 0x3; break;
39466 - case FEC_5_6: c->operand[18] = 0x4; break;
39467 - case FEC_7_8: c->operand[18] = 0x5; break;
39468 - case FEC_8_9: c->operand[18] = 0x6; break;
39469 - case FEC_4_5: c->operand[18] = 0x8; break;
39470 - case FEC_AUTO:
39471 - default: c->operand[18] = 0x0;
39472 - }
39473 -
39474 - switch (params->u.qam.modulation) {
39475 - case QAM_16: c->operand[19] = 0x08; break;
39476 - case QAM_32: c->operand[19] = 0x10; break;
39477 - case QAM_64: c->operand[19] = 0x18; break;
39478 - case QAM_128: c->operand[19] = 0x20; break;
39479 - case QAM_256: c->operand[19] = 0x28; break;
39480 - case QAM_AUTO:
39481 - default: c->operand[19] = 0x00;
39482 - }
39483 -
39484 - c->operand[20] = 0x00;
39485 - c->operand[21] = 0x00;
39486 - /* Nr_of_dsd_sel_specs = 0 -> no PIDs are transmitted */
39487 - c->operand[22] = 0x00;
39488 -
39489 - c->length = 28;
39490 -}
39491 -
39492 -static void avc_tuner_dsd_dvb_t(struct dvb_frontend_parameters *params,
39493 - struct avc_command_frame *c)
39494 -{
39495 - struct dvb_ofdm_parameters *ofdm = &params->u.ofdm;
39496 -
39497 - c->opcode = AVC_OPCODE_DSD;
39498 -
39499 - c->operand[0] = 0; /* source plug */
39500 - c->operand[1] = 0xd2; /* subfunction replace */
39501 - c->operand[2] = 0x20; /* system id = DVB */
39502 - c->operand[3] = 0x00; /* antenna number */
39503 - c->operand[4] = 0x0c; /* system_specific_multiplex selection_length */
39504 -
39505 - /* multiplex_valid_flags, high byte */
39506 - c->operand[5] =
39507 - 0 << 7 /* reserved */
39508 - | 1 << 6 /* CenterFrequency */
39509 - | (ofdm->bandwidth != BANDWIDTH_AUTO ? 1 << 5 : 0)
39510 - | (ofdm->constellation != QAM_AUTO ? 1 << 4 : 0)
39511 - | (ofdm->hierarchy_information != HIERARCHY_AUTO ? 1 << 3 : 0)
39512 - | (ofdm->code_rate_HP != FEC_AUTO ? 1 << 2 : 0)
39513 - | (ofdm->code_rate_LP != FEC_AUTO ? 1 << 1 : 0)
39514 - | (ofdm->guard_interval != GUARD_INTERVAL_AUTO ? 1 << 0 : 0);
39515 -
39516 - /* multiplex_valid_flags, low byte */
39517 - c->operand[6] =
39518 - 0 << 7 /* NetworkID */
39519 - | (ofdm->transmission_mode != TRANSMISSION_MODE_AUTO ? 1 << 6 : 0)
39520 - | 0 << 5 /* OtherFrequencyFlag */
39521 - | 0 << 0 /* reserved */ ;
39522 -
39523 - c->operand[7] = 0x0;
39524 - c->operand[8] = (params->frequency / 10) >> 24;
39525 - c->operand[9] = ((params->frequency / 10) >> 16) & 0xff;
39526 - c->operand[10] = ((params->frequency / 10) >> 8) & 0xff;
39527 - c->operand[11] = (params->frequency / 10) & 0xff;
39528 -
39529 - switch (ofdm->bandwidth) {
39530 - case BANDWIDTH_7_MHZ: c->operand[12] = 0x20; break;
39531 - case BANDWIDTH_8_MHZ:
39532 - case BANDWIDTH_6_MHZ: /* not defined by AVC spec */
39533 - case BANDWIDTH_AUTO:
39534 - default: c->operand[12] = 0x00;
39535 - }
39536 -
39537 - switch (ofdm->constellation) {
39538 - case QAM_16: c->operand[13] = 1 << 6; break;
39539 - case QAM_64: c->operand[13] = 2 << 6; break;
39540 - case QPSK:
39541 - default: c->operand[13] = 0x00;
39542 - }
39543 -
39544 - switch (ofdm->hierarchy_information) {
39545 - case HIERARCHY_1: c->operand[13] |= 1 << 3; break;
39546 - case HIERARCHY_2: c->operand[13] |= 2 << 3; break;
39547 - case HIERARCHY_4: c->operand[13] |= 3 << 3; break;
39548 - case HIERARCHY_AUTO:
39549 - case HIERARCHY_NONE:
39550 - default: break;
39551 - }
39552 -
39553 - switch (ofdm->code_rate_HP) {
39554 - case FEC_2_3: c->operand[13] |= 1; break;
39555 - case FEC_3_4: c->operand[13] |= 2; break;
39556 - case FEC_5_6: c->operand[13] |= 3; break;
39557 - case FEC_7_8: c->operand[13] |= 4; break;
39558 - case FEC_1_2:
39559 - default: break;
39560 - }
39561 -
39562 - switch (ofdm->code_rate_LP) {
39563 - case FEC_2_3: c->operand[14] = 1 << 5; break;
39564 - case FEC_3_4: c->operand[14] = 2 << 5; break;
39565 - case FEC_5_6: c->operand[14] = 3 << 5; break;
39566 - case FEC_7_8: c->operand[14] = 4 << 5; break;
39567 - case FEC_1_2:
39568 - default: c->operand[14] = 0x00; break;
39569 - }
39570 -
39571 - switch (ofdm->guard_interval) {
39572 - case GUARD_INTERVAL_1_16: c->operand[14] |= 1 << 3; break;
39573 - case GUARD_INTERVAL_1_8: c->operand[14] |= 2 << 3; break;
39574 - case GUARD_INTERVAL_1_4: c->operand[14] |= 3 << 3; break;
39575 - case GUARD_INTERVAL_1_32:
39576 - case GUARD_INTERVAL_AUTO:
39577 - default: break;
39578 - }
39579 -
39580 - switch (ofdm->transmission_mode) {
39581 - case TRANSMISSION_MODE_8K: c->operand[14] |= 1 << 1; break;
39582 - case TRANSMISSION_MODE_2K:
39583 - case TRANSMISSION_MODE_AUTO:
39584 - default: break;
39585 - }
39586 -
39587 - c->operand[15] = 0x00; /* network_ID[0] */
39588 - c->operand[16] = 0x00; /* network_ID[1] */
39589 - /* Nr_of_dsd_sel_specs = 0 -> no PIDs are transmitted */
39590 - c->operand[17] = 0x00;
39591 -
39592 - c->length = 24;
39593 -}
39594 -
39595 -int avc_tuner_dsd(struct firedtv *fdtv,
39596 - struct dvb_frontend_parameters *params)
39597 -{
39598 - char buffer[sizeof(struct avc_command_frame)];
39599 - struct avc_command_frame *c = (void *)buffer;
39600 - struct avc_response_frame *r = (void *)buffer; /* FIXME: unused */
39601 -
39602 - memset(c, 0, sizeof(*c));
39603 -
39604 - c->ctype = AVC_CTYPE_CONTROL;
39605 - c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit;
39606 -
39607 - switch (fdtv->type) {
39608 - case FIREDTV_DVB_S:
39609 - case FIREDTV_DVB_S2: avc_tuner_tuneqpsk(fdtv, params, c); break;
39610 - case FIREDTV_DVB_C: avc_tuner_dsd_dvb_c(params, c); break;
39611 - case FIREDTV_DVB_T: avc_tuner_dsd_dvb_t(params, c); break;
39612 - default:
39613 - BUG();
39614 - }
39615 -
39616 - if (avc_write(fdtv, c, r) < 0)
39617 - return -EIO;
39618 -
39619 - msleep(500);
39620 -#if 0
39621 - /* FIXME: */
39622 - /* u8 *status was an out-parameter of avc_tuner_dsd, unused by caller */
39623 - if (status)
39624 - *status = r->operand[2];
39625 -#endif
39626 - return 0;
39627 -}
39628 -
39629 -int avc_tuner_set_pids(struct firedtv *fdtv, unsigned char pidc, u16 pid[])
39630 -{
39631 - char buffer[sizeof(struct avc_command_frame)];
39632 - struct avc_command_frame *c = (void *)buffer;
39633 - struct avc_response_frame *r = (void *)buffer; /* FIXME: unused */
39634 - int pos, k;
39635 -
39636 - if (pidc > 16 && pidc != 0xff)
39637 - return -EINVAL;
39638 -
39639 - memset(c, 0, sizeof(*c));
39640 -
39641 - c->ctype = AVC_CTYPE_CONTROL;
39642 - c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit;
39643 - c->opcode = AVC_OPCODE_DSD;
39644 -
39645 - c->operand[0] = 0; /* source plug */
39646 - c->operand[1] = 0xd2; /* subfunction replace */
39647 - c->operand[2] = 0x20; /* system id = DVB */
39648 - c->operand[3] = 0x00; /* antenna number */
39649 - c->operand[4] = 0x00; /* system_specific_multiplex selection_length */
39650 - c->operand[5] = pidc; /* Nr_of_dsd_sel_specs */
39651 -
39652 - pos = 6;
39653 - if (pidc != 0xff)
39654 - for (k = 0; k < pidc; k++) {
39655 - c->operand[pos++] = 0x13; /* flowfunction relay */
39656 - c->operand[pos++] = 0x80; /* dsd_sel_spec_valid_flags -> PID */
39657 - c->operand[pos++] = (pid[k] >> 8) & 0x1f;
39658 - c->operand[pos++] = pid[k] & 0xff;
39659 - c->operand[pos++] = 0x00; /* tableID */
39660 - c->operand[pos++] = 0x00; /* filter_length */
39661 - }
39662 -
39663 - c->length = ALIGN(3 + pos, 4);
39664 -
39665 - if (avc_write(fdtv, c, r) < 0)
39666 - return -EIO;
39667 -
39668 - msleep(50);
39669 - return 0;
39670 -}
39671 -
39672 -int avc_tuner_get_ts(struct firedtv *fdtv)
39673 -{
39674 - char buffer[sizeof(struct avc_command_frame)];
39675 - struct avc_command_frame *c = (void *)buffer;
39676 - struct avc_response_frame *r = (void *)buffer; /* FIXME: unused */
39677 - int sl;
39678 -
39679 - memset(c, 0, sizeof(*c));
39680 -
39681 - c->ctype = AVC_CTYPE_CONTROL;
39682 - c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit;
39683 - c->opcode = AVC_OPCODE_DSIT;
39684 -
39685 - sl = fdtv->type == FIREDTV_DVB_T ? 0x0c : 0x11;
39686 -
39687 - c->operand[0] = 0; /* source plug */
39688 - c->operand[1] = 0xd2; /* subfunction replace */
39689 - c->operand[2] = 0xff; /* status */
39690 - c->operand[3] = 0x20; /* system id = DVB */
39691 - c->operand[4] = 0x00; /* antenna number */
39692 - c->operand[5] = 0x0; /* system_specific_search_flags */
39693 - c->operand[6] = sl; /* system_specific_multiplex selection_length */
39694 - c->operand[7] = 0x00; /* valid_flags [0] */
39695 - c->operand[8] = 0x00; /* valid_flags [1] */
39696 - c->operand[7 + sl] = 0x00; /* nr_of_dsit_sel_specs (always 0) */
39697 -
39698 - c->length = fdtv->type == FIREDTV_DVB_T ? 24 : 28;
39699 -
39700 - if (avc_write(fdtv, c, r) < 0)
39701 - return -EIO;
39702 -
39703 - msleep(250);
39704 - return 0;
39705 -}
39706 -
39707 -int avc_identify_subunit(struct firedtv *fdtv)
39708 -{
39709 - char buffer[sizeof(struct avc_command_frame)];
39710 - struct avc_command_frame *c = (void *)buffer;
39711 - struct avc_response_frame *r = (void *)buffer;
39712 -
39713 - memset(c, 0, sizeof(*c));
39714 -
39715 - c->ctype = AVC_CTYPE_CONTROL;
39716 - c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit;
39717 - c->opcode = AVC_OPCODE_READ_DESCRIPTOR;
39718 -
39719 - c->operand[0] = DESCRIPTOR_SUBUNIT_IDENTIFIER;
39720 - c->operand[1] = 0xff;
39721 - c->operand[2] = 0x00;
39722 - c->operand[3] = 0x00; /* length highbyte */
39723 - c->operand[4] = 0x08; /* length lowbyte */
39724 - c->operand[5] = 0x00; /* offset highbyte */
39725 - c->operand[6] = 0x0d; /* offset lowbyte */
39726 -
39727 - c->length = 12;
39728 -
39729 - if (avc_write(fdtv, c, r) < 0)
39730 - return -EIO;
39731 -
39732 - if ((r->response != AVC_RESPONSE_STABLE &&
39733 - r->response != AVC_RESPONSE_ACCEPTED) ||
39734 - (r->operand[3] << 8) + r->operand[4] != 8) {
39735 - dev_err(fdtv->device, "cannot read subunit identifier\n");
39736 - return -EINVAL;
39737 - }
39738 - return 0;
39739 -}
39740 -
39741 -#define SIZEOF_ANTENNA_INPUT_INFO 22
39742 -
39743 -int avc_tuner_status(struct firedtv *fdtv, struct firedtv_tuner_status *stat)
39744 -{
39745 - char buffer[sizeof(struct avc_command_frame)];
39746 - struct avc_command_frame *c = (void *)buffer;
39747 - struct avc_response_frame *r = (void *)buffer;
39748 - int length;
39749 -
39750 - memset(c, 0, sizeof(*c));
39751 -
39752 - c->ctype = AVC_CTYPE_CONTROL;
39753 - c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit;
39754 - c->opcode = AVC_OPCODE_READ_DESCRIPTOR;
39755 -
39756 - c->operand[0] = DESCRIPTOR_TUNER_STATUS;
39757 - c->operand[1] = 0xff; /* read_result_status */
39758 - c->operand[2] = 0x00; /* reserved */
39759 - c->operand[3] = 0; /* SIZEOF_ANTENNA_INPUT_INFO >> 8; */
39760 - c->operand[4] = 0; /* SIZEOF_ANTENNA_INPUT_INFO & 0xff; */
39761 - c->operand[5] = 0x00;
39762 - c->operand[6] = 0x00;
39763 -
39764 - c->length = 12;
39765 -
39766 - if (avc_write(fdtv, c, r) < 0)
39767 - return -EIO;
39768 -
39769 - if (r->response != AVC_RESPONSE_STABLE &&
39770 - r->response != AVC_RESPONSE_ACCEPTED) {
39771 - dev_err(fdtv->device, "cannot read tuner status\n");
39772 - return -EINVAL;
39773 - }
39774 -
39775 - length = r->operand[9];
39776 - if (r->operand[1] != 0x10 || length != SIZEOF_ANTENNA_INPUT_INFO) {
39777 - dev_err(fdtv->device, "got invalid tuner status\n");
39778 - return -EINVAL;
39779 - }
39780 -
39781 - stat->active_system = r->operand[10];
39782 - stat->searching = r->operand[11] >> 7 & 1;
39783 - stat->moving = r->operand[11] >> 6 & 1;
39784 - stat->no_rf = r->operand[11] >> 5 & 1;
39785 - stat->input = r->operand[12] >> 7 & 1;
39786 - stat->selected_antenna = r->operand[12] & 0x7f;
39787 - stat->ber = r->operand[13] << 24 |
39788 - r->operand[14] << 16 |
39789 - r->operand[15] << 8 |
39790 - r->operand[16];
39791 - stat->signal_strength = r->operand[17];
39792 - stat->raster_frequency = r->operand[18] >> 6 & 2;
39793 - stat->rf_frequency = (r->operand[18] & 0x3f) << 16 |
39794 - r->operand[19] << 8 |
39795 - r->operand[20];
39796 - stat->man_dep_info_length = r->operand[21];
39797 - stat->front_end_error = r->operand[22] >> 4 & 1;
39798 - stat->antenna_error = r->operand[22] >> 3 & 1;
39799 - stat->front_end_power_status = r->operand[22] >> 1 & 1;
39800 - stat->power_supply = r->operand[22] & 1;
39801 - stat->carrier_noise_ratio = r->operand[23] << 8 |
39802 - r->operand[24];
39803 - stat->power_supply_voltage = r->operand[27];
39804 - stat->antenna_voltage = r->operand[28];
39805 - stat->firewire_bus_voltage = r->operand[29];
39806 - stat->ca_mmi = r->operand[30] & 1;
39807 - stat->ca_pmt_reply = r->operand[31] >> 7 & 1;
39808 - stat->ca_date_time_request = r->operand[31] >> 6 & 1;
39809 - stat->ca_application_info = r->operand[31] >> 5 & 1;
39810 - stat->ca_module_present_status = r->operand[31] >> 4 & 1;
39811 - stat->ca_dvb_flag = r->operand[31] >> 3 & 1;
39812 - stat->ca_error_flag = r->operand[31] >> 2 & 1;
39813 - stat->ca_initialization_status = r->operand[31] >> 1 & 1;
39814 -
39815 - return 0;
39816 -}
39817 -
39818 -int avc_lnb_control(struct firedtv *fdtv, char voltage, char burst,
39819 - char conttone, char nrdiseq,
39820 - struct dvb_diseqc_master_cmd *diseqcmd)
39821 -{
39822 - char buffer[sizeof(struct avc_command_frame)];
39823 - struct avc_command_frame *c = (void *)buffer;
39824 - struct avc_response_frame *r = (void *)buffer;
39825 - int i, j, k;
39826 -
39827 - memset(c, 0, sizeof(*c));
39828 -
39829 - c->ctype = AVC_CTYPE_CONTROL;
39830 - c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit;
39831 - c->opcode = AVC_OPCODE_VENDOR;
39832 -
39833 - c->operand[0] = SFE_VENDOR_DE_COMPANYID_0;
39834 - c->operand[1] = SFE_VENDOR_DE_COMPANYID_1;
39835 - c->operand[2] = SFE_VENDOR_DE_COMPANYID_2;
39836 - c->operand[3] = SFE_VENDOR_OPCODE_LNB_CONTROL;
39837 -
39838 - c->operand[4] = voltage;
39839 - c->operand[5] = nrdiseq;
39840 -
39841 - i = 6;
39842 -
39843 - for (j = 0; j < nrdiseq; j++) {
39844 - c->operand[i++] = diseqcmd[j].msg_len;
39845 -
39846 - for (k = 0; k < diseqcmd[j].msg_len; k++)
39847 - c->operand[i++] = diseqcmd[j].msg[k];
39848 - }
39849 -
39850 - c->operand[i++] = burst;
39851 - c->operand[i++] = conttone;
39852 -
39853 - c->length = ALIGN(3 + i, 4);
39854 -
39855 - if (avc_write(fdtv, c, r) < 0)
39856 - return -EIO;
39857 -
39858 - if (r->response != AVC_RESPONSE_ACCEPTED) {
39859 - dev_err(fdtv->device, "LNB control failed\n");
39860 - return -EINVAL;
39861 - }
39862 -
39863 - return 0;
39864 -}
39865 -
39866 -int avc_register_remote_control(struct firedtv *fdtv)
39867 -{
39868 - char buffer[sizeof(struct avc_command_frame)];
39869 - struct avc_command_frame *c = (void *)buffer;
39870 -
39871 - memset(c, 0, sizeof(*c));
39872 -
39873 - c->ctype = AVC_CTYPE_NOTIFY;
39874 - c->subunit = AVC_SUBUNIT_TYPE_UNIT | 7;
39875 - c->opcode = AVC_OPCODE_VENDOR;
39876 -
39877 - c->operand[0] = SFE_VENDOR_DE_COMPANYID_0;
39878 - c->operand[1] = SFE_VENDOR_DE_COMPANYID_1;
39879 - c->operand[2] = SFE_VENDOR_DE_COMPANYID_2;
39880 - c->operand[3] = SFE_VENDOR_OPCODE_REGISTER_REMOTE_CONTROL;
39881 -
39882 - c->length = 8;
39883 -
39884 - return avc_write(fdtv, c, NULL);
39885 -}
39886 -
39887 -void avc_remote_ctrl_work(struct work_struct *work)
39888 -{
39889 - struct firedtv *fdtv =
39890 - container_of(work, struct firedtv, remote_ctrl_work);
39891 -
39892 - /* Should it be rescheduled in failure cases? */
39893 - avc_register_remote_control(fdtv);
39894 -}
39895 -
39896 -#if 0 /* FIXME: unused */
39897 -int avc_tuner_host2ca(struct firedtv *fdtv)
39898 -{
39899 - char buffer[sizeof(struct avc_command_frame)];
39900 - struct avc_command_frame *c = (void *)buffer;
39901 - struct avc_response_frame *r = (void *)buffer; /* FIXME: unused */
39902 -
39903 - memset(c, 0, sizeof(*c));
39904 -
39905 - c->ctype = AVC_CTYPE_CONTROL;
39906 - c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit;
39907 - c->opcode = AVC_OPCODE_VENDOR;
39908 -
39909 - c->operand[0] = SFE_VENDOR_DE_COMPANYID_0;
39910 - c->operand[1] = SFE_VENDOR_DE_COMPANYID_1;
39911 - c->operand[2] = SFE_VENDOR_DE_COMPANYID_2;
39912 - c->operand[3] = SFE_VENDOR_OPCODE_HOST2CA;
39913 - c->operand[4] = 0; /* slot */
39914 - c->operand[5] = SFE_VENDOR_TAG_CA_APPLICATION_INFO; /* ca tag */
39915 - c->operand[6] = 0; /* more/last */
39916 - c->operand[7] = 0; /* length */
39917 -
39918 - c->length = 12;
39919 -
39920 - if (avc_write(fdtv, c, r) < 0)
39921 - return -EIO;
39922 -
39923 - return 0;
39924 -}
39925 -#endif
39926 -
39927 -static int get_ca_object_pos(struct avc_response_frame *r)
39928 -{
39929 - int length = 1;
39930 -
39931 - /* Check length of length field */
39932 - if (r->operand[7] & 0x80)
39933 - length = (r->operand[7] & 0x7f) + 1;
39934 - return length + 7;
39935 -}
39936 -
39937 -static int get_ca_object_length(struct avc_response_frame *r)
39938 -{
39939 -#if 0 /* FIXME: unused */
39940 - int size = 0;
39941 - int i;
39942 -
39943 - if (r->operand[7] & 0x80)
39944 - for (i = 0; i < (r->operand[7] & 0x7f); i++) {
39945 - size <<= 8;
39946 - size += r->operand[8 + i];
39947 - }
39948 -#endif
39949 - return r->operand[7];
39950 -}
39951 -
39952 -int avc_ca_app_info(struct firedtv *fdtv, char *app_info, unsigned int *len)
39953 -{
39954 - char buffer[sizeof(struct avc_command_frame)];
39955 - struct avc_command_frame *c = (void *)buffer;
39956 - struct avc_response_frame *r = (void *)buffer;
39957 - int pos;
39958 -
39959 - memset(c, 0, sizeof(*c));
39960 -
39961 - c->ctype = AVC_CTYPE_STATUS;
39962 - c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit;
39963 - c->opcode = AVC_OPCODE_VENDOR;
39964 -
39965 - c->operand[0] = SFE_VENDOR_DE_COMPANYID_0;
39966 - c->operand[1] = SFE_VENDOR_DE_COMPANYID_1;
39967 - c->operand[2] = SFE_VENDOR_DE_COMPANYID_2;
39968 - c->operand[3] = SFE_VENDOR_OPCODE_CA2HOST;
39969 - c->operand[4] = 0; /* slot */
39970 - c->operand[5] = SFE_VENDOR_TAG_CA_APPLICATION_INFO; /* ca tag */
39971 -
39972 - c->length = 12;
39973 -
39974 - if (avc_write(fdtv, c, r) < 0)
39975 - return -EIO;
39976 -
39977 - /* FIXME: check response code and validate response data */
39978 -
39979 - pos = get_ca_object_pos(r);
39980 - app_info[0] = (EN50221_TAG_APP_INFO >> 16) & 0xff;
39981 - app_info[1] = (EN50221_TAG_APP_INFO >> 8) & 0xff;
39982 - app_info[2] = (EN50221_TAG_APP_INFO >> 0) & 0xff;
39983 - app_info[3] = 6 + r->operand[pos + 4];
39984 - app_info[4] = 0x01;
39985 - memcpy(&app_info[5], &r->operand[pos], 5 + r->operand[pos + 4]);
39986 - *len = app_info[3] + 4;
39987 -
39988 - return 0;
39989 -}
39990 -
39991 -int avc_ca_info(struct firedtv *fdtv, char *app_info, unsigned int *len)
39992 -{
39993 - char buffer[sizeof(struct avc_command_frame)];
39994 - struct avc_command_frame *c = (void *)buffer;
39995 - struct avc_response_frame *r = (void *)buffer;
39996 - int pos;
39997 -
39998 - memset(c, 0, sizeof(*c));
39999 -
40000 - c->ctype = AVC_CTYPE_STATUS;
40001 - c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit;
40002 - c->opcode = AVC_OPCODE_VENDOR;
40003 -
40004 - c->operand[0] = SFE_VENDOR_DE_COMPANYID_0;
40005 - c->operand[1] = SFE_VENDOR_DE_COMPANYID_1;
40006 - c->operand[2] = SFE_VENDOR_DE_COMPANYID_2;
40007 - c->operand[3] = SFE_VENDOR_OPCODE_CA2HOST;
40008 - c->operand[4] = 0; /* slot */
40009 - c->operand[5] = SFE_VENDOR_TAG_CA_APPLICATION_INFO; /* ca tag */
40010 -
40011 - c->length = 12;
40012 -
40013 - if (avc_write(fdtv, c, r) < 0)
40014 - return -EIO;
40015 -
40016 - pos = get_ca_object_pos(r);
40017 - app_info[0] = (EN50221_TAG_CA_INFO >> 16) & 0xff;
40018 - app_info[1] = (EN50221_TAG_CA_INFO >> 8) & 0xff;
40019 - app_info[2] = (EN50221_TAG_CA_INFO >> 0) & 0xff;
40020 - app_info[3] = 2;
40021 - app_info[4] = r->operand[pos + 0];
40022 - app_info[5] = r->operand[pos + 1];
40023 - *len = app_info[3] + 4;
40024 -
40025 - return 0;
40026 -}
40027 -
40028 -int avc_ca_reset(struct firedtv *fdtv)
40029 -{
40030 - char buffer[sizeof(struct avc_command_frame)];
40031 - struct avc_command_frame *c = (void *)buffer;
40032 - struct avc_response_frame *r = (void *)buffer; /* FIXME: unused */
40033 -
40034 - memset(c, 0, sizeof(*c));
40035 -
40036 - c->ctype = AVC_CTYPE_CONTROL;
40037 - c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit;
40038 - c->opcode = AVC_OPCODE_VENDOR;
40039 -
40040 - c->operand[0] = SFE_VENDOR_DE_COMPANYID_0;
40041 - c->operand[1] = SFE_VENDOR_DE_COMPANYID_1;
40042 - c->operand[2] = SFE_VENDOR_DE_COMPANYID_2;
40043 - c->operand[3] = SFE_VENDOR_OPCODE_HOST2CA;
40044 - c->operand[4] = 0; /* slot */
40045 - c->operand[5] = SFE_VENDOR_TAG_CA_RESET; /* ca tag */
40046 - c->operand[6] = 0; /* more/last */
40047 - c->operand[7] = 1; /* length */
40048 - c->operand[8] = 0; /* force hardware reset */
40049 -
40050 - c->length = 12;
40051 -
40052 - if (avc_write(fdtv, c, r) < 0)
40053 - return -EIO;
40054 -
40055 - return 0;
40056 -}
40057 -
40058 -int avc_ca_pmt(struct firedtv *fdtv, char *msg, int length)
40059 -{
40060 - char buffer[sizeof(struct avc_command_frame)];
40061 - struct avc_command_frame *c = (void *)buffer;
40062 - struct avc_response_frame *r = (void *)buffer;
40063 - int list_management;
40064 - int program_info_length;
40065 - int pmt_cmd_id;
40066 - int read_pos;
40067 - int write_pos;
40068 - int es_info_length;
40069 - int crc32_csum;
40070 -
40071 - memset(c, 0, sizeof(*c));
40072 -
40073 - c->ctype = AVC_CTYPE_CONTROL;
40074 - c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit;
40075 - c->opcode = AVC_OPCODE_VENDOR;
40076 -
40077 - if (msg[0] != EN50221_LIST_MANAGEMENT_ONLY) {
40078 - dev_info(fdtv->device, "forcing list_management to ONLY\n");
40079 - msg[0] = EN50221_LIST_MANAGEMENT_ONLY;
40080 - }
40081 - /* We take the cmd_id from the programme level only! */
40082 - list_management = msg[0];
40083 - program_info_length = ((msg[4] & 0x0f) << 8) + msg[5];
40084 - if (program_info_length > 0)
40085 - program_info_length--; /* Remove pmt_cmd_id */
40086 - pmt_cmd_id = msg[6];
40087 -
40088 - c->operand[0] = SFE_VENDOR_DE_COMPANYID_0;
40089 - c->operand[1] = SFE_VENDOR_DE_COMPANYID_1;
40090 - c->operand[2] = SFE_VENDOR_DE_COMPANYID_2;
40091 - c->operand[3] = SFE_VENDOR_OPCODE_HOST2CA;
40092 - c->operand[4] = 0; /* slot */
40093 - c->operand[5] = SFE_VENDOR_TAG_CA_PMT; /* ca tag */
40094 - c->operand[6] = 0; /* more/last */
40095 - /* c->operand[7] = XXXprogram_info_length + 17; */ /* length */
40096 - c->operand[8] = list_management;
40097 - c->operand[9] = 0x01; /* pmt_cmd=OK_descramble */
40098 -
40099 - /* TS program map table */
40100 -
40101 - c->operand[10] = 0x02; /* Table id=2 */
40102 - c->operand[11] = 0x80; /* Section syntax + length */
40103 - /* c->operand[12] = XXXprogram_info_length + 12; */
40104 - c->operand[13] = msg[1]; /* Program number */
40105 - c->operand[14] = msg[2];
40106 - c->operand[15] = 0x01; /* Version number=0 + current/next=1 */
40107 - c->operand[16] = 0x00; /* Section number=0 */
40108 - c->operand[17] = 0x00; /* Last section number=0 */
40109 - c->operand[18] = 0x1f; /* PCR_PID=1FFF */
40110 - c->operand[19] = 0xff;
40111 - c->operand[20] = (program_info_length >> 8); /* Program info length */
40112 - c->operand[21] = (program_info_length & 0xff);
40113 -
40114 - /* CA descriptors at programme level */
40115 - read_pos = 6;
40116 - write_pos = 22;
40117 - if (program_info_length > 0) {
40118 - pmt_cmd_id = msg[read_pos++];
40119 - if (pmt_cmd_id != 1 && pmt_cmd_id != 4)
40120 - dev_err(fdtv->device,
40121 - "invalid pmt_cmd_id %d\n", pmt_cmd_id);
40122 -
40123 - memcpy(&c->operand[write_pos], &msg[read_pos],
40124 - program_info_length);
40125 - read_pos += program_info_length;
40126 - write_pos += program_info_length;
40127 - }
40128 - while (read_pos < length) {
40129 - c->operand[write_pos++] = msg[read_pos++];
40130 - c->operand[write_pos++] = msg[read_pos++];
40131 - c->operand[write_pos++] = msg[read_pos++];
40132 - es_info_length =
40133 - ((msg[read_pos] & 0x0f) << 8) + msg[read_pos + 1];
40134 - read_pos += 2;
40135 - if (es_info_length > 0)
40136 - es_info_length--; /* Remove pmt_cmd_id */
40137 - c->operand[write_pos++] = es_info_length >> 8;
40138 - c->operand[write_pos++] = es_info_length & 0xff;
40139 - if (es_info_length > 0) {
40140 - pmt_cmd_id = msg[read_pos++];
40141 - if (pmt_cmd_id != 1 && pmt_cmd_id != 4)
40142 - dev_err(fdtv->device, "invalid pmt_cmd_id %d "
40143 - "at stream level\n", pmt_cmd_id);
40144 -
40145 - memcpy(&c->operand[write_pos], &msg[read_pos],
40146 - es_info_length);
40147 - read_pos += es_info_length;
40148 - write_pos += es_info_length;
40149 - }
40150 - }
40151 -
40152 - /* CRC */
40153 - c->operand[write_pos++] = 0x00;
40154 - c->operand[write_pos++] = 0x00;
40155 - c->operand[write_pos++] = 0x00;
40156 - c->operand[write_pos++] = 0x00;
40157 -
40158 - c->operand[7] = write_pos - 8;
40159 - c->operand[12] = write_pos - 13;
40160 -
40161 - crc32_csum = crc32_be(0, &c->operand[10], c->operand[12] - 1);
40162 - c->operand[write_pos - 4] = (crc32_csum >> 24) & 0xff;
40163 - c->operand[write_pos - 3] = (crc32_csum >> 16) & 0xff;
40164 - c->operand[write_pos - 2] = (crc32_csum >> 8) & 0xff;
40165 - c->operand[write_pos - 1] = (crc32_csum >> 0) & 0xff;
40166 -
40167 - c->length = ALIGN(3 + write_pos, 4);
40168 -
40169 - if (avc_write(fdtv, c, r) < 0)
40170 - return -EIO;
40171 -
40172 - if (r->response != AVC_RESPONSE_ACCEPTED) {
40173 - dev_err(fdtv->device,
40174 - "CA PMT failed with response 0x%x\n", r->response);
40175 - return -EFAULT;
40176 - }
40177 -
40178 - return 0;
40179 -}
40180 -
40181 -int avc_ca_get_time_date(struct firedtv *fdtv, int *interval)
40182 -{
40183 - char buffer[sizeof(struct avc_command_frame)];
40184 - struct avc_command_frame *c = (void *)buffer;
40185 - struct avc_response_frame *r = (void *)buffer;
40186 -
40187 - memset(c, 0, sizeof(*c));
40188 -
40189 - c->ctype = AVC_CTYPE_STATUS;
40190 - c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit;
40191 - c->opcode = AVC_OPCODE_VENDOR;
40192 -
40193 - c->operand[0] = SFE_VENDOR_DE_COMPANYID_0;
40194 - c->operand[1] = SFE_VENDOR_DE_COMPANYID_1;
40195 - c->operand[2] = SFE_VENDOR_DE_COMPANYID_2;
40196 - c->operand[3] = SFE_VENDOR_OPCODE_CA2HOST;
40197 - c->operand[4] = 0; /* slot */
40198 - c->operand[5] = SFE_VENDOR_TAG_CA_DATE_TIME; /* ca tag */
40199 - c->operand[6] = 0; /* more/last */
40200 - c->operand[7] = 0; /* length */
40201 -
40202 - c->length = 12;
40203 -
40204 - if (avc_write(fdtv, c, r) < 0)
40205 - return -EIO;
40206 -
40207 - /* FIXME: check response code and validate response data */
40208 -
40209 - *interval = r->operand[get_ca_object_pos(r)];
40210 -
40211 - return 0;
40212 -}
40213 -
40214 -int avc_ca_enter_menu(struct firedtv *fdtv)
40215 -{
40216 - char buffer[sizeof(struct avc_command_frame)];
40217 - struct avc_command_frame *c = (void *)buffer;
40218 - struct avc_response_frame *r = (void *)buffer; /* FIXME: unused */
40219 -
40220 - memset(c, 0, sizeof(*c));
40221 -
40222 - c->ctype = AVC_CTYPE_STATUS;
40223 - c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit;
40224 - c->opcode = AVC_OPCODE_VENDOR;
40225 -
40226 - c->operand[0] = SFE_VENDOR_DE_COMPANYID_0;
40227 - c->operand[1] = SFE_VENDOR_DE_COMPANYID_1;
40228 - c->operand[2] = SFE_VENDOR_DE_COMPANYID_2;
40229 - c->operand[3] = SFE_VENDOR_OPCODE_HOST2CA;
40230 - c->operand[4] = 0; /* slot */
40231 - c->operand[5] = SFE_VENDOR_TAG_CA_ENTER_MENU;
40232 - c->operand[6] = 0; /* more/last */
40233 - c->operand[7] = 0; /* length */
40234 -
40235 - c->length = 12;
40236 -
40237 - if (avc_write(fdtv, c, r) < 0)
40238 - return -EIO;
40239 -
40240 - return 0;
40241 -}
40242 -
40243 -int avc_ca_get_mmi(struct firedtv *fdtv, char *mmi_object, unsigned int *len)
40244 -{
40245 - char buffer[sizeof(struct avc_command_frame)];
40246 - struct avc_command_frame *c = (void *)buffer;
40247 - struct avc_response_frame *r = (void *)buffer;
40248 -
40249 - memset(c, 0, sizeof(*c));
40250 -
40251 - c->ctype = AVC_CTYPE_STATUS;
40252 - c->subunit = AVC_SUBUNIT_TYPE_TUNER | fdtv->subunit;
40253 - c->opcode = AVC_OPCODE_VENDOR;
40254 -
40255 - c->operand[0] = SFE_VENDOR_DE_COMPANYID_0;
40256 - c->operand[1] = SFE_VENDOR_DE_COMPANYID_1;
40257 - c->operand[2] = SFE_VENDOR_DE_COMPANYID_2;
40258 - c->operand[3] = SFE_VENDOR_OPCODE_CA2HOST;
40259 - c->operand[4] = 0; /* slot */
40260 - c->operand[5] = SFE_VENDOR_TAG_CA_MMI;
40261 - c->operand[6] = 0; /* more/last */
40262 - c->operand[7] = 0; /* length */
40263 -
40264 - c->length = 12;
40265 -
40266 - if (avc_write(fdtv, c, r) < 0)
40267 - return -EIO;
40268 -
40269 - /* FIXME: check response code and validate response data */
40270 -
40271 - *len = get_ca_object_length(r);
40272 - memcpy(mmi_object, &r->operand[get_ca_object_pos(r)], *len);
40273 -
40274 - return 0;
40275 -}
40276 -
40277 -#define CMP_OUTPUT_PLUG_CONTROL_REG_0 0xfffff0000904ULL
40278 -
40279 -static int cmp_read(struct firedtv *fdtv, void *buf, u64 addr, size_t len)
40280 -{
40281 - int ret;
40282 -
40283 - if (mutex_lock_interruptible(&fdtv->avc_mutex))
40284 - return -EINTR;
40285 -
40286 - ret = fdtv->backend->read(fdtv, addr, buf, len);
40287 - if (ret < 0)
40288 - dev_err(fdtv->device, "CMP: read I/O error\n");
40289 -
40290 - mutex_unlock(&fdtv->avc_mutex);
40291 - return ret;
40292 -}
40293 -
40294 -static int cmp_lock(struct firedtv *fdtv, void *data, u64 addr, __be32 arg)
40295 -{
40296 - int ret;
40297 -
40298 - if (mutex_lock_interruptible(&fdtv->avc_mutex))
40299 - return -EINTR;
40300 -
40301 - ret = fdtv->backend->lock(fdtv, addr, data, arg);
40302 - if (ret < 0)
40303 - dev_err(fdtv->device, "CMP: lock I/O error\n");
40304 -
40305 - mutex_unlock(&fdtv->avc_mutex);
40306 - return ret;
40307 -}
40308 -
40309 -static inline u32 get_opcr(__be32 opcr, u32 mask, u32 shift)
40310 -{
40311 - return (be32_to_cpu(opcr) >> shift) & mask;
40312 -}
40313 -
40314 -static inline void set_opcr(__be32 *opcr, u32 value, u32 mask, u32 shift)
40315 -{
40316 - *opcr &= ~cpu_to_be32(mask << shift);
40317 - *opcr |= cpu_to_be32((value & mask) << shift);
40318 -}
40319 -
40320 -#define get_opcr_online(v) get_opcr((v), 0x1, 31)
40321 -#define get_opcr_p2p_connections(v) get_opcr((v), 0x3f, 24)
40322 -#define get_opcr_channel(v) get_opcr((v), 0x3f, 16)
40323 -
40324 -#define set_opcr_p2p_connections(p, v) set_opcr((p), (v), 0x3f, 24)
40325 -#define set_opcr_channel(p, v) set_opcr((p), (v), 0x3f, 16)
40326 -#define set_opcr_data_rate(p, v) set_opcr((p), (v), 0x3, 14)
40327 -#define set_opcr_overhead_id(p, v) set_opcr((p), (v), 0xf, 10)
40328 -
40329 -int cmp_establish_pp_connection(struct firedtv *fdtv, int plug, int channel)
40330 -{
40331 - __be32 old_opcr, opcr;
40332 - u64 opcr_address = CMP_OUTPUT_PLUG_CONTROL_REG_0 + (plug << 2);
40333 - int attempts = 0;
40334 - int ret;
40335 -
40336 - ret = cmp_read(fdtv, &opcr, opcr_address, 4);
40337 - if (ret < 0)
40338 - return ret;
40339 -
40340 -repeat:
40341 - if (!get_opcr_online(opcr)) {
40342 - dev_err(fdtv->device, "CMP: output offline\n");
40343 - return -EBUSY;
40344 - }
40345 -
40346 - old_opcr = opcr;
40347 -
40348 - if (get_opcr_p2p_connections(opcr)) {
40349 - if (get_opcr_channel(opcr) != channel) {
40350 - dev_err(fdtv->device, "CMP: cannot change channel\n");
40351 - return -EBUSY;
40352 - }
40353 - dev_info(fdtv->device, "CMP: overlaying connection\n");
40354 -
40355 - /* We don't allocate isochronous resources. */
40356 - } else {
40357 - set_opcr_channel(&opcr, channel);
40358 - set_opcr_data_rate(&opcr, 2); /* S400 */
40359 -
40360 - /* FIXME: this is for the worst case - optimize */
40361 - set_opcr_overhead_id(&opcr, 0);
40362 -
40363 - /*
40364 - * FIXME: allocate isochronous channel and bandwidth at IRM
40365 - * fdtv->backend->alloc_resources(fdtv, channels_mask, bw);
40366 - */
40367 - }
40368 -
40369 - set_opcr_p2p_connections(&opcr, get_opcr_p2p_connections(opcr) + 1);
40370 -
40371 - ret = cmp_lock(fdtv, &opcr, opcr_address, old_opcr);
40372 - if (ret < 0)
40373 - return ret;
40374 -
40375 - if (old_opcr != opcr) {
40376 - /*
40377 - * FIXME: if old_opcr.P2P_Connections > 0,
40378 - * deallocate isochronous channel and bandwidth at IRM
40379 - * if (...)
40380 - * fdtv->backend->dealloc_resources(fdtv, channel, bw);
40381 - */
40382 -
40383 - if (++attempts < 6) /* arbitrary limit */
40384 - goto repeat;
40385 - return -EBUSY;
40386 - }
40387 -
40388 - return 0;
40389 -}
40390 -
40391 -void cmp_break_pp_connection(struct firedtv *fdtv, int plug, int channel)
40392 -{
40393 - __be32 old_opcr, opcr;
40394 - u64 opcr_address = CMP_OUTPUT_PLUG_CONTROL_REG_0 + (plug << 2);
40395 - int attempts = 0;
40396 -
40397 - if (cmp_read(fdtv, &opcr, opcr_address, 4) < 0)
40398 - return;
40399 -
40400 -repeat:
40401 - if (!get_opcr_online(opcr) || !get_opcr_p2p_connections(opcr) ||
40402 - get_opcr_channel(opcr) != channel) {
40403 - dev_err(fdtv->device, "CMP: no connection to break\n");
40404 - return;
40405 - }
40406 -
40407 - old_opcr = opcr;
40408 - set_opcr_p2p_connections(&opcr, get_opcr_p2p_connections(opcr) - 1);
40409 -
40410 - if (cmp_lock(fdtv, &opcr, opcr_address, old_opcr) < 0)
40411 - return;
40412 -
40413 - if (old_opcr != opcr) {
40414 - /*
40415 - * FIXME: if old_opcr.P2P_Connections == 1, i.e. we were last
40416 - * owner, deallocate isochronous channel and bandwidth at IRM
40417 - * if (...)
40418 - * fdtv->backend->dealloc_resources(fdtv, channel, bw);
40419 - */
40420 -
40421 - if (++attempts < 6) /* arbitrary limit */
40422 - goto repeat;
40423 - }
40424 -}
40425 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/dvb/firewire/firedtv-ci.c linux-2.6.29-rc3.owrt/drivers/media/dvb/firewire/firedtv-ci.c
40426 --- linux-2.6.29.owrt/drivers/media/dvb/firewire/firedtv-ci.c 2009-05-10 22:04:39.000000000 +0200
40427 +++ linux-2.6.29-rc3.owrt/drivers/media/dvb/firewire/firedtv-ci.c 1970-01-01 01:00:00.000000000 +0100
40428 @@ -1,260 +0,0 @@
40429 -/*
40430 - * FireDTV driver (formerly known as FireSAT)
40431 - *
40432 - * Copyright (C) 2004 Andreas Monitzer <andy@monitzer.com>
40433 - * Copyright (C) 2008 Henrik Kurelid <henrik@kurelid.se>
40434 - *
40435 - * This program is free software; you can redistribute it and/or
40436 - * modify it under the terms of the GNU General Public License as
40437 - * published by the Free Software Foundation; either version 2 of
40438 - * the License, or (at your option) any later version.
40439 - */
40440 -
40441 -#include <linux/device.h>
40442 -#include <linux/dvb/ca.h>
40443 -#include <linux/fs.h>
40444 -#include <linux/module.h>
40445 -
40446 -#include <dvbdev.h>
40447 -
40448 -#include "firedtv.h"
40449 -
40450 -#define EN50221_TAG_APP_INFO_ENQUIRY 0x9f8020
40451 -#define EN50221_TAG_CA_INFO_ENQUIRY 0x9f8030
40452 -#define EN50221_TAG_CA_PMT 0x9f8032
40453 -#define EN50221_TAG_ENTER_MENU 0x9f8022
40454 -
40455 -static int fdtv_ca_ready(struct firedtv_tuner_status *stat)
40456 -{
40457 - return stat->ca_initialization_status == 1 &&
40458 - stat->ca_error_flag == 0 &&
40459 - stat->ca_dvb_flag == 1 &&
40460 - stat->ca_module_present_status == 1;
40461 -}
40462 -
40463 -static int fdtv_get_ca_flags(struct firedtv_tuner_status *stat)
40464 -{
40465 - int flags = 0;
40466 -
40467 - if (stat->ca_module_present_status == 1)
40468 - flags |= CA_CI_MODULE_PRESENT;
40469 - if (stat->ca_initialization_status == 1 &&
40470 - stat->ca_error_flag == 0 &&
40471 - stat->ca_dvb_flag == 1)
40472 - flags |= CA_CI_MODULE_READY;
40473 - return flags;
40474 -}
40475 -
40476 -static int fdtv_ca_reset(struct firedtv *fdtv)
40477 -{
40478 - return avc_ca_reset(fdtv) ? -EFAULT : 0;
40479 -}
40480 -
40481 -static int fdtv_ca_get_caps(void *arg)
40482 -{
40483 - struct ca_caps *cap = arg;
40484 -
40485 - cap->slot_num = 1;
40486 - cap->slot_type = CA_CI;
40487 - cap->descr_num = 1;
40488 - cap->descr_type = CA_ECD;
40489 - return 0;
40490 -}
40491 -
40492 -static int fdtv_ca_get_slot_info(struct firedtv *fdtv, void *arg)
40493 -{
40494 - struct firedtv_tuner_status stat;
40495 - struct ca_slot_info *slot = arg;
40496 -
40497 - if (avc_tuner_status(fdtv, &stat))
40498 - return -EFAULT;
40499 -
40500 - if (slot->num != 0)
40501 - return -EFAULT;
40502 -
40503 - slot->type = CA_CI;
40504 - slot->flags = fdtv_get_ca_flags(&stat);
40505 - return 0;
40506 -}
40507 -
40508 -static int fdtv_ca_app_info(struct firedtv *fdtv, void *arg)
40509 -{
40510 - struct ca_msg *reply = arg;
40511 -
40512 - return avc_ca_app_info(fdtv, reply->msg, &reply->length) ? -EFAULT : 0;
40513 -}
40514 -
40515 -static int fdtv_ca_info(struct firedtv *fdtv, void *arg)
40516 -{
40517 - struct ca_msg *reply = arg;
40518 -
40519 - return avc_ca_info(fdtv, reply->msg, &reply->length) ? -EFAULT : 0;
40520 -}
40521 -
40522 -static int fdtv_ca_get_mmi(struct firedtv *fdtv, void *arg)
40523 -{
40524 - struct ca_msg *reply = arg;
40525 -
40526 - return avc_ca_get_mmi(fdtv, reply->msg, &reply->length) ? -EFAULT : 0;
40527 -}
40528 -
40529 -static int fdtv_ca_get_msg(struct firedtv *fdtv, void *arg)
40530 -{
40531 - struct firedtv_tuner_status stat;
40532 - int err;
40533 -
40534 - switch (fdtv->ca_last_command) {
40535 - case EN50221_TAG_APP_INFO_ENQUIRY:
40536 - err = fdtv_ca_app_info(fdtv, arg);
40537 - break;
40538 - case EN50221_TAG_CA_INFO_ENQUIRY:
40539 - err = fdtv_ca_info(fdtv, arg);
40540 - break;
40541 - default:
40542 - if (avc_tuner_status(fdtv, &stat))
40543 - err = -EFAULT;
40544 - else if (stat.ca_mmi == 1)
40545 - err = fdtv_ca_get_mmi(fdtv, arg);
40546 - else {
40547 - dev_info(fdtv->device, "unhandled CA message 0x%08x\n",
40548 - fdtv->ca_last_command);
40549 - err = -EFAULT;
40550 - }
40551 - }
40552 - fdtv->ca_last_command = 0;
40553 - return err;
40554 -}
40555 -
40556 -static int fdtv_ca_pmt(struct firedtv *fdtv, void *arg)
40557 -{
40558 - struct ca_msg *msg = arg;
40559 - int data_pos;
40560 - int data_length;
40561 - int i;
40562 -
40563 - data_pos = 4;
40564 - if (msg->msg[3] & 0x80) {
40565 - data_length = 0;
40566 - for (i = 0; i < (msg->msg[3] & 0x7f); i++)
40567 - data_length = (data_length << 8) + msg->msg[data_pos++];
40568 - } else {
40569 - data_length = msg->msg[3];
40570 - }
40571 -
40572 - return avc_ca_pmt(fdtv, &msg->msg[data_pos], data_length) ? -EFAULT : 0;
40573 -}
40574 -
40575 -static int fdtv_ca_send_msg(struct firedtv *fdtv, void *arg)
40576 -{
40577 - struct ca_msg *msg = arg;
40578 - int err;
40579 -
40580 - /* Do we need a semaphore for this? */
40581 - fdtv->ca_last_command =
40582 - (msg->msg[0] << 16) + (msg->msg[1] << 8) + msg->msg[2];
40583 - switch (fdtv->ca_last_command) {
40584 - case EN50221_TAG_CA_PMT:
40585 - err = fdtv_ca_pmt(fdtv, arg);
40586 - break;
40587 - case EN50221_TAG_APP_INFO_ENQUIRY:
40588 - /* handled in ca_get_msg */
40589 - err = 0;
40590 - break;
40591 - case EN50221_TAG_CA_INFO_ENQUIRY:
40592 - /* handled in ca_get_msg */
40593 - err = 0;
40594 - break;
40595 - case EN50221_TAG_ENTER_MENU:
40596 - err = avc_ca_enter_menu(fdtv);
40597 - break;
40598 - default:
40599 - dev_err(fdtv->device, "unhandled CA message 0x%08x\n",
40600 - fdtv->ca_last_command);
40601 - err = -EFAULT;
40602 - }
40603 - return err;
40604 -}
40605 -
40606 -static int fdtv_ca_ioctl(struct inode *inode, struct file *file,
40607 - unsigned int cmd, void *arg)
40608 -{
40609 - struct dvb_device *dvbdev = file->private_data;
40610 - struct firedtv *fdtv = dvbdev->priv;
40611 - struct firedtv_tuner_status stat;
40612 - int err;
40613 -
40614 - switch (cmd) {
40615 - case CA_RESET:
40616 - err = fdtv_ca_reset(fdtv);
40617 - break;
40618 - case CA_GET_CAP:
40619 - err = fdtv_ca_get_caps(arg);
40620 - break;
40621 - case CA_GET_SLOT_INFO:
40622 - err = fdtv_ca_get_slot_info(fdtv, arg);
40623 - break;
40624 - case CA_GET_MSG:
40625 - err = fdtv_ca_get_msg(fdtv, arg);
40626 - break;
40627 - case CA_SEND_MSG:
40628 - err = fdtv_ca_send_msg(fdtv, arg);
40629 - break;
40630 - default:
40631 - dev_info(fdtv->device, "unhandled CA ioctl %u\n", cmd);
40632 - err = -EOPNOTSUPP;
40633 - }
40634 -
40635 - /* FIXME Is this necessary? */
40636 - avc_tuner_status(fdtv, &stat);
40637 -
40638 - return err;
40639 -}
40640 -
40641 -static unsigned int fdtv_ca_io_poll(struct file *file, poll_table *wait)
40642 -{
40643 - return POLLIN;
40644 -}
40645 -
40646 -static struct file_operations fdtv_ca_fops = {
40647 - .owner = THIS_MODULE,
40648 - .ioctl = dvb_generic_ioctl,
40649 - .open = dvb_generic_open,
40650 - .release = dvb_generic_release,
40651 - .poll = fdtv_ca_io_poll,
40652 -};
40653 -
40654 -static struct dvb_device fdtv_ca = {
40655 - .users = 1,
40656 - .readers = 1,
40657 - .writers = 1,
40658 - .fops = &fdtv_ca_fops,
40659 - .kernel_ioctl = fdtv_ca_ioctl,
40660 -};
40661 -
40662 -int fdtv_ca_register(struct firedtv *fdtv)
40663 -{
40664 - struct firedtv_tuner_status stat;
40665 - int err;
40666 -
40667 - if (avc_tuner_status(fdtv, &stat))
40668 - return -EINVAL;
40669 -
40670 - if (!fdtv_ca_ready(&stat))
40671 - return -EFAULT;
40672 -
40673 - err = dvb_register_device(&fdtv->adapter, &fdtv->cadev,
40674 - &fdtv_ca, fdtv, DVB_DEVICE_CA);
40675 -
40676 - if (stat.ca_application_info == 0)
40677 - dev_err(fdtv->device, "CaApplicationInfo is not set\n");
40678 - if (stat.ca_date_time_request == 1)
40679 - avc_ca_get_time_date(fdtv, &fdtv->ca_time_interval);
40680 -
40681 - return err;
40682 -}
40683 -
40684 -void fdtv_ca_release(struct firedtv *fdtv)
40685 -{
40686 - if (fdtv->cadev)
40687 - dvb_unregister_device(fdtv->cadev);
40688 -}
40689 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/dvb/firewire/firedtv-dvb.c linux-2.6.29-rc3.owrt/drivers/media/dvb/firewire/firedtv-dvb.c
40690 --- linux-2.6.29.owrt/drivers/media/dvb/firewire/firedtv-dvb.c 2009-05-10 22:04:39.000000000 +0200
40691 +++ linux-2.6.29-rc3.owrt/drivers/media/dvb/firewire/firedtv-dvb.c 1970-01-01 01:00:00.000000000 +0100
40692 @@ -1,364 +0,0 @@
40693 -/*
40694 - * FireDTV driver (formerly known as FireSAT)
40695 - *
40696 - * Copyright (C) 2004 Andreas Monitzer <andy@monitzer.com>
40697 - * Copyright (C) 2008 Henrik Kurelid <henrik@kurelid.se>
40698 - *
40699 - * This program is free software; you can redistribute it and/or
40700 - * modify it under the terms of the GNU General Public License as
40701 - * published by the Free Software Foundation; either version 2 of
40702 - * the License, or (at your option) any later version.
40703 - */
40704 -
40705 -#include <linux/bitops.h>
40706 -#include <linux/device.h>
40707 -#include <linux/errno.h>
40708 -#include <linux/kernel.h>
40709 -#include <linux/mod_devicetable.h>
40710 -#include <linux/module.h>
40711 -#include <linux/mutex.h>
40712 -#include <linux/slab.h>
40713 -#include <linux/string.h>
40714 -#include <linux/types.h>
40715 -#include <linux/wait.h>
40716 -#include <linux/workqueue.h>
40717 -
40718 -#include <dmxdev.h>
40719 -#include <dvb_demux.h>
40720 -#include <dvbdev.h>
40721 -#include <dvb_frontend.h>
40722 -
40723 -#include "firedtv.h"
40724 -
40725 -static int alloc_channel(struct firedtv *fdtv)
40726 -{
40727 - int i;
40728 -
40729 - for (i = 0; i < 16; i++)
40730 - if (!__test_and_set_bit(i, &fdtv->channel_active))
40731 - break;
40732 - return i;
40733 -}
40734 -
40735 -static void collect_channels(struct firedtv *fdtv, int *pidc, u16 pid[])
40736 -{
40737 - int i, n;
40738 -
40739 - for (i = 0, n = 0; i < 16; i++)
40740 - if (test_bit(i, &fdtv->channel_active))
40741 - pid[n++] = fdtv->channel_pid[i];
40742 - *pidc = n;
40743 -}
40744 -
40745 -static inline void dealloc_channel(struct firedtv *fdtv, int i)
40746 -{
40747 - __clear_bit(i, &fdtv->channel_active);
40748 -}
40749 -
40750 -int fdtv_start_feed(struct dvb_demux_feed *dvbdmxfeed)
40751 -{
40752 - struct firedtv *fdtv = dvbdmxfeed->demux->priv;
40753 - int pidc, c, ret;
40754 - u16 pids[16];
40755 -
40756 - switch (dvbdmxfeed->type) {
40757 - case DMX_TYPE_TS:
40758 - case DMX_TYPE_SEC:
40759 - break;
40760 - default:
40761 - dev_err(fdtv->device, "can't start dmx feed: invalid type %u\n",
40762 - dvbdmxfeed->type);
40763 - return -EINVAL;
40764 - }
40765 -
40766 - if (mutex_lock_interruptible(&fdtv->demux_mutex))
40767 - return -EINTR;
40768 -
40769 - if (dvbdmxfeed->type == DMX_TYPE_TS) {
40770 - switch (dvbdmxfeed->pes_type) {
40771 - case DMX_TS_PES_VIDEO:
40772 - case DMX_TS_PES_AUDIO:
40773 - case DMX_TS_PES_TELETEXT:
40774 - case DMX_TS_PES_PCR:
40775 - case DMX_TS_PES_OTHER:
40776 - c = alloc_channel(fdtv);
40777 - break;
40778 - default:
40779 - dev_err(fdtv->device,
40780 - "can't start dmx feed: invalid pes type %u\n",
40781 - dvbdmxfeed->pes_type);
40782 - ret = -EINVAL;
40783 - goto out;
40784 - }
40785 - } else {
40786 - c = alloc_channel(fdtv);
40787 - }
40788 -
40789 - if (c > 15) {
40790 - dev_err(fdtv->device, "can't start dmx feed: busy\n");
40791 - ret = -EBUSY;
40792 - goto out;
40793 - }
40794 -
40795 - dvbdmxfeed->priv = (typeof(dvbdmxfeed->priv))(unsigned long)c;
40796 - fdtv->channel_pid[c] = dvbdmxfeed->pid;
40797 - collect_channels(fdtv, &pidc, pids);
40798 -
40799 - if (dvbdmxfeed->pid == 8192) {
40800 - ret = avc_tuner_get_ts(fdtv);
40801 - if (ret) {
40802 - dealloc_channel(fdtv, c);
40803 - dev_err(fdtv->device, "can't get TS\n");
40804 - goto out;
40805 - }
40806 - } else {
40807 - ret = avc_tuner_set_pids(fdtv, pidc, pids);
40808 - if (ret) {
40809 - dealloc_channel(fdtv, c);
40810 - dev_err(fdtv->device, "can't set PIDs\n");
40811 - goto out;
40812 - }
40813 - }
40814 -out:
40815 - mutex_unlock(&fdtv->demux_mutex);
40816 -
40817 - return ret;
40818 -}
40819 -
40820 -int fdtv_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
40821 -{
40822 - struct dvb_demux *demux = dvbdmxfeed->demux;
40823 - struct firedtv *fdtv = demux->priv;
40824 - int pidc, c, ret;
40825 - u16 pids[16];
40826 -
40827 - if (dvbdmxfeed->type == DMX_TYPE_TS &&
40828 - !((dvbdmxfeed->ts_type & TS_PACKET) &&
40829 - (demux->dmx.frontend->source != DMX_MEMORY_FE))) {
40830 -
40831 - if (dvbdmxfeed->ts_type & TS_DECODER) {
40832 - if (dvbdmxfeed->pes_type >= DMX_TS_PES_OTHER ||
40833 - !demux->pesfilter[dvbdmxfeed->pes_type])
40834 - return -EINVAL;
40835 -
40836 - demux->pids[dvbdmxfeed->pes_type] |= 0x8000;
40837 - demux->pesfilter[dvbdmxfeed->pes_type] = NULL;
40838 - }
40839 -
40840 - if (!(dvbdmxfeed->ts_type & TS_DECODER &&
40841 - dvbdmxfeed->pes_type < DMX_TS_PES_OTHER))
40842 - return 0;
40843 - }
40844 -
40845 - if (mutex_lock_interruptible(&fdtv->demux_mutex))
40846 - return -EINTR;
40847 -
40848 - c = (unsigned long)dvbdmxfeed->priv;
40849 - dealloc_channel(fdtv, c);
40850 - collect_channels(fdtv, &pidc, pids);
40851 -
40852 - ret = avc_tuner_set_pids(fdtv, pidc, pids);
40853 -
40854 - mutex_unlock(&fdtv->demux_mutex);
40855 -
40856 - return ret;
40857 -}
40858 -
40859 -DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
40860 -
40861 -int fdtv_dvb_register(struct firedtv *fdtv)
40862 -{
40863 - int err;
40864 -
40865 - err = dvb_register_adapter(&fdtv->adapter, fdtv_model_names[fdtv->type],
40866 - THIS_MODULE, fdtv->device, adapter_nr);
40867 - if (err < 0)
40868 - goto fail_log;
40869 -
40870 - /*DMX_TS_FILTERING | DMX_SECTION_FILTERING*/
40871 - fdtv->demux.dmx.capabilities = 0;
40872 -
40873 - fdtv->demux.priv = fdtv;
40874 - fdtv->demux.filternum = 16;
40875 - fdtv->demux.feednum = 16;
40876 - fdtv->demux.start_feed = fdtv_start_feed;
40877 - fdtv->demux.stop_feed = fdtv_stop_feed;
40878 - fdtv->demux.write_to_decoder = NULL;
40879 -
40880 - err = dvb_dmx_init(&fdtv->demux);
40881 - if (err)
40882 - goto fail_unreg_adapter;
40883 -
40884 - fdtv->dmxdev.filternum = 16;
40885 - fdtv->dmxdev.demux = &fdtv->demux.dmx;
40886 - fdtv->dmxdev.capabilities = 0;
40887 -
40888 - err = dvb_dmxdev_init(&fdtv->dmxdev, &fdtv->adapter);
40889 - if (err)
40890 - goto fail_dmx_release;
40891 -
40892 - fdtv->frontend.source = DMX_FRONTEND_0;
40893 -
40894 - err = fdtv->demux.dmx.add_frontend(&fdtv->demux.dmx, &fdtv->frontend);
40895 - if (err)
40896 - goto fail_dmxdev_release;
40897 -
40898 - err = fdtv->demux.dmx.connect_frontend(&fdtv->demux.dmx,
40899 - &fdtv->frontend);
40900 - if (err)
40901 - goto fail_rem_frontend;
40902 -
40903 - dvb_net_init(&fdtv->adapter, &fdtv->dvbnet, &fdtv->demux.dmx);
40904 -
40905 - fdtv_frontend_init(fdtv);
40906 - err = dvb_register_frontend(&fdtv->adapter, &fdtv->fe);
40907 - if (err)
40908 - goto fail_net_release;
40909 -
40910 - err = fdtv_ca_register(fdtv);
40911 - if (err)
40912 - dev_info(fdtv->device,
40913 - "Conditional Access Module not enabled\n");
40914 - return 0;
40915 -
40916 -fail_net_release:
40917 - dvb_net_release(&fdtv->dvbnet);
40918 - fdtv->demux.dmx.close(&fdtv->demux.dmx);
40919 -fail_rem_frontend:
40920 - fdtv->demux.dmx.remove_frontend(&fdtv->demux.dmx, &fdtv->frontend);
40921 -fail_dmxdev_release:
40922 - dvb_dmxdev_release(&fdtv->dmxdev);
40923 -fail_dmx_release:
40924 - dvb_dmx_release(&fdtv->demux);
40925 -fail_unreg_adapter:
40926 - dvb_unregister_adapter(&fdtv->adapter);
40927 -fail_log:
40928 - dev_err(fdtv->device, "DVB initialization failed\n");
40929 - return err;
40930 -}
40931 -
40932 -void fdtv_dvb_unregister(struct firedtv *fdtv)
40933 -{
40934 - fdtv_ca_release(fdtv);
40935 - dvb_unregister_frontend(&fdtv->fe);
40936 - dvb_net_release(&fdtv->dvbnet);
40937 - fdtv->demux.dmx.close(&fdtv->demux.dmx);
40938 - fdtv->demux.dmx.remove_frontend(&fdtv->demux.dmx, &fdtv->frontend);
40939 - dvb_dmxdev_release(&fdtv->dmxdev);
40940 - dvb_dmx_release(&fdtv->demux);
40941 - dvb_unregister_adapter(&fdtv->adapter);
40942 -}
40943 -
40944 -const char *fdtv_model_names[] = {
40945 - [FIREDTV_UNKNOWN] = "unknown type",
40946 - [FIREDTV_DVB_S] = "FireDTV S/CI",
40947 - [FIREDTV_DVB_C] = "FireDTV C/CI",
40948 - [FIREDTV_DVB_T] = "FireDTV T/CI",
40949 - [FIREDTV_DVB_S2] = "FireDTV S2 ",
40950 -};
40951 -
40952 -struct firedtv *fdtv_alloc(struct device *dev,
40953 - const struct firedtv_backend *backend,
40954 - const char *name, size_t name_len)
40955 -{
40956 - struct firedtv *fdtv;
40957 - int i;
40958 -
40959 - fdtv = kzalloc(sizeof(*fdtv), GFP_KERNEL);
40960 - if (!fdtv)
40961 - return NULL;
40962 -
40963 - dev->driver_data = fdtv;
40964 - fdtv->device = dev;
40965 - fdtv->isochannel = -1;
40966 - fdtv->voltage = 0xff;
40967 - fdtv->tone = 0xff;
40968 - fdtv->backend = backend;
40969 -
40970 - mutex_init(&fdtv->avc_mutex);
40971 - init_waitqueue_head(&fdtv->avc_wait);
40972 - fdtv->avc_reply_received = true;
40973 - mutex_init(&fdtv->demux_mutex);
40974 - INIT_WORK(&fdtv->remote_ctrl_work, avc_remote_ctrl_work);
40975 -
40976 - for (i = ARRAY_SIZE(fdtv_model_names); --i; )
40977 - if (strlen(fdtv_model_names[i]) <= name_len &&
40978 - strncmp(name, fdtv_model_names[i], name_len) == 0)
40979 - break;
40980 - fdtv->type = i;
40981 -
40982 - return fdtv;
40983 -}
40984 -
40985 -#define MATCH_FLAGS (IEEE1394_MATCH_VENDOR_ID | IEEE1394_MATCH_MODEL_ID | \
40986 - IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION)
40987 -
40988 -#define DIGITAL_EVERYWHERE_OUI 0x001287
40989 -#define AVC_UNIT_SPEC_ID_ENTRY 0x00a02d
40990 -#define AVC_SW_VERSION_ENTRY 0x010001
40991 -
40992 -static struct ieee1394_device_id fdtv_id_table[] = {
40993 - {
40994 - /* FloppyDTV S/CI and FloppyDTV S2 */
40995 - .match_flags = MATCH_FLAGS,
40996 - .vendor_id = DIGITAL_EVERYWHERE_OUI,
40997 - .model_id = 0x000024,
40998 - .specifier_id = AVC_UNIT_SPEC_ID_ENTRY,
40999 - .version = AVC_SW_VERSION_ENTRY,
41000 - }, {
41001 - /* FloppyDTV T/CI */
41002 - .match_flags = MATCH_FLAGS,
41003 - .vendor_id = DIGITAL_EVERYWHERE_OUI,
41004 - .model_id = 0x000025,
41005 - .specifier_id = AVC_UNIT_SPEC_ID_ENTRY,
41006 - .version = AVC_SW_VERSION_ENTRY,
41007 - }, {
41008 - /* FloppyDTV C/CI */
41009 - .match_flags = MATCH_FLAGS,
41010 - .vendor_id = DIGITAL_EVERYWHERE_OUI,
41011 - .model_id = 0x000026,
41012 - .specifier_id = AVC_UNIT_SPEC_ID_ENTRY,
41013 - .version = AVC_SW_VERSION_ENTRY,
41014 - }, {
41015 - /* FireDTV S/CI and FloppyDTV S2 */
41016 - .match_flags = MATCH_FLAGS,
41017 - .vendor_id = DIGITAL_EVERYWHERE_OUI,
41018 - .model_id = 0x000034,
41019 - .specifier_id = AVC_UNIT_SPEC_ID_ENTRY,
41020 - .version = AVC_SW_VERSION_ENTRY,
41021 - }, {
41022 - /* FireDTV T/CI */
41023 - .match_flags = MATCH_FLAGS,
41024 - .vendor_id = DIGITAL_EVERYWHERE_OUI,
41025 - .model_id = 0x000035,
41026 - .specifier_id = AVC_UNIT_SPEC_ID_ENTRY,
41027 - .version = AVC_SW_VERSION_ENTRY,
41028 - }, {
41029 - /* FireDTV C/CI */
41030 - .match_flags = MATCH_FLAGS,
41031 - .vendor_id = DIGITAL_EVERYWHERE_OUI,
41032 - .model_id = 0x000036,
41033 - .specifier_id = AVC_UNIT_SPEC_ID_ENTRY,
41034 - .version = AVC_SW_VERSION_ENTRY,
41035 - }, {}
41036 -};
41037 -MODULE_DEVICE_TABLE(ieee1394, fdtv_id_table);
41038 -
41039 -static int __init fdtv_init(void)
41040 -{
41041 - return fdtv_1394_init(fdtv_id_table);
41042 -}
41043 -
41044 -static void __exit fdtv_exit(void)
41045 -{
41046 - fdtv_1394_exit();
41047 -}
41048 -
41049 -module_init(fdtv_init);
41050 -module_exit(fdtv_exit);
41051 -
41052 -MODULE_AUTHOR("Andreas Monitzer <andy@monitzer.com>");
41053 -MODULE_AUTHOR("Ben Backx <ben@bbackx.com>");
41054 -MODULE_DESCRIPTION("FireDTV DVB Driver");
41055 -MODULE_LICENSE("GPL");
41056 -MODULE_SUPPORTED_DEVICE("FireDTV DVB");
41057 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/dvb/firewire/firedtv-fe.c linux-2.6.29-rc3.owrt/drivers/media/dvb/firewire/firedtv-fe.c
41058 --- linux-2.6.29.owrt/drivers/media/dvb/firewire/firedtv-fe.c 2009-05-10 22:04:39.000000000 +0200
41059 +++ linux-2.6.29-rc3.owrt/drivers/media/dvb/firewire/firedtv-fe.c 1970-01-01 01:00:00.000000000 +0100
41060 @@ -1,247 +0,0 @@
41061 -/*
41062 - * FireDTV driver (formerly known as FireSAT)
41063 - *
41064 - * Copyright (C) 2004 Andreas Monitzer <andy@monitzer.com>
41065 - * Copyright (C) 2008 Henrik Kurelid <henrik@kurelid.se>
41066 - *
41067 - * This program is free software; you can redistribute it and/or
41068 - * modify it under the terms of the GNU General Public License as
41069 - * published by the Free Software Foundation; either version 2 of
41070 - * the License, or (at your option) any later version.
41071 - */
41072 -
41073 -#include <linux/device.h>
41074 -#include <linux/errno.h>
41075 -#include <linux/kernel.h>
41076 -#include <linux/string.h>
41077 -#include <linux/types.h>
41078 -
41079 -#include <dvb_frontend.h>
41080 -
41081 -#include "firedtv.h"
41082 -
41083 -static int fdtv_dvb_init(struct dvb_frontend *fe)
41084 -{
41085 - struct firedtv *fdtv = fe->sec_priv;
41086 - int err;
41087 -
41088 - /* FIXME - allocate free channel at IRM */
41089 - fdtv->isochannel = fdtv->adapter.num;
41090 -
41091 - err = cmp_establish_pp_connection(fdtv, fdtv->subunit,
41092 - fdtv->isochannel);
41093 - if (err) {
41094 - dev_err(fdtv->device,
41095 - "could not establish point to point connection\n");
41096 - return err;
41097 - }
41098 -
41099 - return fdtv->backend->start_iso(fdtv);
41100 -}
41101 -
41102 -static int fdtv_sleep(struct dvb_frontend *fe)
41103 -{
41104 - struct firedtv *fdtv = fe->sec_priv;
41105 -
41106 - fdtv->backend->stop_iso(fdtv);
41107 - cmp_break_pp_connection(fdtv, fdtv->subunit, fdtv->isochannel);
41108 - fdtv->isochannel = -1;
41109 - return 0;
41110 -}
41111 -
41112 -#define LNBCONTROL_DONTCARE 0xff
41113 -
41114 -static int fdtv_diseqc_send_master_cmd(struct dvb_frontend *fe,
41115 - struct dvb_diseqc_master_cmd *cmd)
41116 -{
41117 - struct firedtv *fdtv = fe->sec_priv;
41118 -
41119 - return avc_lnb_control(fdtv, LNBCONTROL_DONTCARE, LNBCONTROL_DONTCARE,
41120 - LNBCONTROL_DONTCARE, 1, cmd);
41121 -}
41122 -
41123 -static int fdtv_diseqc_send_burst(struct dvb_frontend *fe,
41124 - fe_sec_mini_cmd_t minicmd)
41125 -{
41126 - return 0;
41127 -}
41128 -
41129 -static int fdtv_set_tone(struct dvb_frontend *fe, fe_sec_tone_mode_t tone)
41130 -{
41131 - struct firedtv *fdtv = fe->sec_priv;
41132 -
41133 - fdtv->tone = tone;
41134 - return 0;
41135 -}
41136 -
41137 -static int fdtv_set_voltage(struct dvb_frontend *fe,
41138 - fe_sec_voltage_t voltage)
41139 -{
41140 - struct firedtv *fdtv = fe->sec_priv;
41141 -
41142 - fdtv->voltage = voltage;
41143 - return 0;
41144 -}
41145 -
41146 -static int fdtv_read_status(struct dvb_frontend *fe, fe_status_t *status)
41147 -{
41148 - struct firedtv *fdtv = fe->sec_priv;
41149 - struct firedtv_tuner_status stat;
41150 -
41151 - if (avc_tuner_status(fdtv, &stat))
41152 - return -EINVAL;
41153 -
41154 - if (stat.no_rf)
41155 - *status = 0;
41156 - else
41157 - *status = FE_HAS_SIGNAL | FE_HAS_VITERBI | FE_HAS_SYNC |
41158 - FE_HAS_CARRIER | FE_HAS_LOCK;
41159 - return 0;
41160 -}
41161 -
41162 -static int fdtv_read_ber(struct dvb_frontend *fe, u32 *ber)
41163 -{
41164 - struct firedtv *fdtv = fe->sec_priv;
41165 - struct firedtv_tuner_status stat;
41166 -
41167 - if (avc_tuner_status(fdtv, &stat))
41168 - return -EINVAL;
41169 -
41170 - *ber = stat.ber;
41171 - return 0;
41172 -}
41173 -
41174 -static int fdtv_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
41175 -{
41176 - struct firedtv *fdtv = fe->sec_priv;
41177 - struct firedtv_tuner_status stat;
41178 -
41179 - if (avc_tuner_status(fdtv, &stat))
41180 - return -EINVAL;
41181 -
41182 - *strength = stat.signal_strength << 8;
41183 - return 0;
41184 -}
41185 -
41186 -static int fdtv_read_snr(struct dvb_frontend *fe, u16 *snr)
41187 -{
41188 - struct firedtv *fdtv = fe->sec_priv;
41189 - struct firedtv_tuner_status stat;
41190 -
41191 - if (avc_tuner_status(fdtv, &stat))
41192 - return -EINVAL;
41193 -
41194 - /* C/N[dB] = -10 * log10(snr / 65535) */
41195 - *snr = stat.carrier_noise_ratio * 257;
41196 - return 0;
41197 -}
41198 -
41199 -static int fdtv_read_uncorrected_blocks(struct dvb_frontend *fe, u32 *ucblocks)
41200 -{
41201 - return -EOPNOTSUPP;
41202 -}
41203 -
41204 -#define ACCEPTED 0x9
41205 -
41206 -static int fdtv_set_frontend(struct dvb_frontend *fe,
41207 - struct dvb_frontend_parameters *params)
41208 -{
41209 - struct firedtv *fdtv = fe->sec_priv;
41210 -
41211 - /* FIXME: avc_tuner_dsd never returns ACCEPTED. Check status? */
41212 - if (avc_tuner_dsd(fdtv, params) != ACCEPTED)
41213 - return -EINVAL;
41214 - else
41215 - return 0; /* not sure of this... */
41216 -}
41217 -
41218 -static int fdtv_get_frontend(struct dvb_frontend *fe,
41219 - struct dvb_frontend_parameters *params)
41220 -{
41221 - return -EOPNOTSUPP;
41222 -}
41223 -
41224 -void fdtv_frontend_init(struct firedtv *fdtv)
41225 -{
41226 - struct dvb_frontend_ops *ops = &fdtv->fe.ops;
41227 - struct dvb_frontend_info *fi = &ops->info;
41228 -
41229 - ops->init = fdtv_dvb_init;
41230 - ops->sleep = fdtv_sleep;
41231 -
41232 - ops->set_frontend = fdtv_set_frontend;
41233 - ops->get_frontend = fdtv_get_frontend;
41234 -
41235 - ops->read_status = fdtv_read_status;
41236 - ops->read_ber = fdtv_read_ber;
41237 - ops->read_signal_strength = fdtv_read_signal_strength;
41238 - ops->read_snr = fdtv_read_snr;
41239 - ops->read_ucblocks = fdtv_read_uncorrected_blocks;
41240 -
41241 - ops->diseqc_send_master_cmd = fdtv_diseqc_send_master_cmd;
41242 - ops->diseqc_send_burst = fdtv_diseqc_send_burst;
41243 - ops->set_tone = fdtv_set_tone;
41244 - ops->set_voltage = fdtv_set_voltage;
41245 -
41246 - switch (fdtv->type) {
41247 - case FIREDTV_DVB_S:
41248 - case FIREDTV_DVB_S2:
41249 - fi->type = FE_QPSK;
41250 -
41251 - fi->frequency_min = 950000;
41252 - fi->frequency_max = 2150000;
41253 - fi->frequency_stepsize = 125;
41254 - fi->symbol_rate_min = 1000000;
41255 - fi->symbol_rate_max = 40000000;
41256 -
41257 - fi->caps = FE_CAN_INVERSION_AUTO |
41258 - FE_CAN_FEC_1_2 |
41259 - FE_CAN_FEC_2_3 |
41260 - FE_CAN_FEC_3_4 |
41261 - FE_CAN_FEC_5_6 |
41262 - FE_CAN_FEC_7_8 |
41263 - FE_CAN_FEC_AUTO |
41264 - FE_CAN_QPSK;
41265 - break;
41266 -
41267 - case FIREDTV_DVB_C:
41268 - fi->type = FE_QAM;
41269 -
41270 - fi->frequency_min = 47000000;
41271 - fi->frequency_max = 866000000;
41272 - fi->frequency_stepsize = 62500;
41273 - fi->symbol_rate_min = 870000;
41274 - fi->symbol_rate_max = 6900000;
41275 -
41276 - fi->caps = FE_CAN_INVERSION_AUTO |
41277 - FE_CAN_QAM_16 |
41278 - FE_CAN_QAM_32 |
41279 - FE_CAN_QAM_64 |
41280 - FE_CAN_QAM_128 |
41281 - FE_CAN_QAM_256 |
41282 - FE_CAN_QAM_AUTO;
41283 - break;
41284 -
41285 - case FIREDTV_DVB_T:
41286 - fi->type = FE_OFDM;
41287 -
41288 - fi->frequency_min = 49000000;
41289 - fi->frequency_max = 861000000;
41290 - fi->frequency_stepsize = 62500;
41291 -
41292 - fi->caps = FE_CAN_INVERSION_AUTO |
41293 - FE_CAN_FEC_2_3 |
41294 - FE_CAN_TRANSMISSION_MODE_AUTO |
41295 - FE_CAN_GUARD_INTERVAL_AUTO |
41296 - FE_CAN_HIERARCHY_AUTO;
41297 - break;
41298 -
41299 - default:
41300 - dev_err(fdtv->device, "no frontend for model type %d\n",
41301 - fdtv->type);
41302 - }
41303 - strcpy(fi->name, fdtv_model_names[fdtv->type]);
41304 -
41305 - fdtv->fe.dvb = &fdtv->adapter;
41306 - fdtv->fe.sec_priv = fdtv;
41307 -}
41308 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/dvb/firewire/firedtv.h linux-2.6.29-rc3.owrt/drivers/media/dvb/firewire/firedtv.h
41309 --- linux-2.6.29.owrt/drivers/media/dvb/firewire/firedtv.h 2009-05-10 22:04:39.000000000 +0200
41310 +++ linux-2.6.29-rc3.owrt/drivers/media/dvb/firewire/firedtv.h 1970-01-01 01:00:00.000000000 +0100
41311 @@ -1,182 +0,0 @@
41312 -/*
41313 - * FireDTV driver (formerly known as FireSAT)
41314 - *
41315 - * Copyright (C) 2004 Andreas Monitzer <andy@monitzer.com>
41316 - * Copyright (C) 2008 Henrik Kurelid <henrik@kurelid.se>
41317 - *
41318 - * This program is free software; you can redistribute it and/or
41319 - * modify it under the terms of the GNU General Public License as
41320 - * published by the Free Software Foundation; either version 2 of
41321 - * the License, or (at your option) any later version.
41322 - */
41323 -
41324 -#ifndef _FIREDTV_H
41325 -#define _FIREDTV_H
41326 -
41327 -#include <linux/dvb/dmx.h>
41328 -#include <linux/dvb/frontend.h>
41329 -#include <linux/list.h>
41330 -#include <linux/mutex.h>
41331 -#include <linux/spinlock_types.h>
41332 -#include <linux/types.h>
41333 -#include <linux/wait.h>
41334 -#include <linux/workqueue.h>
41335 -
41336 -#include <demux.h>
41337 -#include <dmxdev.h>
41338 -#include <dvb_demux.h>
41339 -#include <dvb_frontend.h>
41340 -#include <dvb_net.h>
41341 -#include <dvbdev.h>
41342 -
41343 -struct firedtv_tuner_status {
41344 - unsigned active_system:8;
41345 - unsigned searching:1;
41346 - unsigned moving:1;
41347 - unsigned no_rf:1;
41348 - unsigned input:1;
41349 - unsigned selected_antenna:7;
41350 - unsigned ber:32;
41351 - unsigned signal_strength:8;
41352 - unsigned raster_frequency:2;
41353 - unsigned rf_frequency:22;
41354 - unsigned man_dep_info_length:8;
41355 - unsigned front_end_error:1;
41356 - unsigned antenna_error:1;
41357 - unsigned front_end_power_status:1;
41358 - unsigned power_supply:1;
41359 - unsigned carrier_noise_ratio:16;
41360 - unsigned power_supply_voltage:8;
41361 - unsigned antenna_voltage:8;
41362 - unsigned firewire_bus_voltage:8;
41363 - unsigned ca_mmi:1;
41364 - unsigned ca_pmt_reply:1;
41365 - unsigned ca_date_time_request:1;
41366 - unsigned ca_application_info:1;
41367 - unsigned ca_module_present_status:1;
41368 - unsigned ca_dvb_flag:1;
41369 - unsigned ca_error_flag:1;
41370 - unsigned ca_initialization_status:1;
41371 -};
41372 -
41373 -enum model_type {
41374 - FIREDTV_UNKNOWN = 0,
41375 - FIREDTV_DVB_S = 1,
41376 - FIREDTV_DVB_C = 2,
41377 - FIREDTV_DVB_T = 3,
41378 - FIREDTV_DVB_S2 = 4,
41379 -};
41380 -
41381 -struct device;
41382 -struct input_dev;
41383 -struct firedtv;
41384 -
41385 -struct firedtv_backend {
41386 - int (*lock)(struct firedtv *fdtv, u64 addr, void *data, __be32 arg);
41387 - int (*read)(struct firedtv *fdtv, u64 addr, void *data, size_t len);
41388 - int (*write)(struct firedtv *fdtv, u64 addr, void *data, size_t len);
41389 - int (*start_iso)(struct firedtv *fdtv);
41390 - void (*stop_iso)(struct firedtv *fdtv);
41391 -};
41392 -
41393 -struct firedtv {
41394 - struct device *device;
41395 - struct list_head list;
41396 -
41397 - struct dvb_adapter adapter;
41398 - struct dmxdev dmxdev;
41399 - struct dvb_demux demux;
41400 - struct dmx_frontend frontend;
41401 - struct dvb_net dvbnet;
41402 - struct dvb_frontend fe;
41403 -
41404 - struct dvb_device *cadev;
41405 - int ca_last_command;
41406 - int ca_time_interval;
41407 -
41408 - struct mutex avc_mutex;
41409 - wait_queue_head_t avc_wait;
41410 - bool avc_reply_received;
41411 - struct work_struct remote_ctrl_work;
41412 - struct input_dev *remote_ctrl_dev;
41413 -
41414 - enum model_type type;
41415 - char subunit;
41416 - char isochannel;
41417 - fe_sec_voltage_t voltage;
41418 - fe_sec_tone_mode_t tone;
41419 -
41420 - const struct firedtv_backend *backend;
41421 - void *backend_data;
41422 -
41423 - struct mutex demux_mutex;
41424 - unsigned long channel_active;
41425 - u16 channel_pid[16];
41426 -
41427 - size_t response_length;
41428 - u8 response[512];
41429 -};
41430 -
41431 -/* firedtv-1394.c */
41432 -#ifdef CONFIG_DVB_FIREDTV_IEEE1394
41433 -int fdtv_1394_init(struct ieee1394_device_id id_table[]);
41434 -void fdtv_1394_exit(void);
41435 -#else
41436 -static inline int fdtv_1394_init(struct ieee1394_device_id it[]) { return 0; }
41437 -static inline void fdtv_1394_exit(void) {}
41438 -#endif
41439 -
41440 -/* firedtv-avc.c */
41441 -int avc_recv(struct firedtv *fdtv, void *data, size_t length);
41442 -int avc_tuner_status(struct firedtv *fdtv, struct firedtv_tuner_status *stat);
41443 -struct dvb_frontend_parameters;
41444 -int avc_tuner_dsd(struct firedtv *fdtv, struct dvb_frontend_parameters *params);
41445 -int avc_tuner_set_pids(struct firedtv *fdtv, unsigned char pidc, u16 pid[]);
41446 -int avc_tuner_get_ts(struct firedtv *fdtv);
41447 -int avc_identify_subunit(struct firedtv *fdtv);
41448 -struct dvb_diseqc_master_cmd;
41449 -int avc_lnb_control(struct firedtv *fdtv, char voltage, char burst,
41450 - char conttone, char nrdiseq,
41451 - struct dvb_diseqc_master_cmd *diseqcmd);
41452 -void avc_remote_ctrl_work(struct work_struct *work);
41453 -int avc_register_remote_control(struct firedtv *fdtv);
41454 -int avc_ca_app_info(struct firedtv *fdtv, char *app_info, unsigned int *len);
41455 -int avc_ca_info(struct firedtv *fdtv, char *app_info, unsigned int *len);
41456 -int avc_ca_reset(struct firedtv *fdtv);
41457 -int avc_ca_pmt(struct firedtv *fdtv, char *app_info, int length);
41458 -int avc_ca_get_time_date(struct firedtv *fdtv, int *interval);
41459 -int avc_ca_enter_menu(struct firedtv *fdtv);
41460 -int avc_ca_get_mmi(struct firedtv *fdtv, char *mmi_object, unsigned int *len);
41461 -int cmp_establish_pp_connection(struct firedtv *fdtv, int plug, int channel);
41462 -void cmp_break_pp_connection(struct firedtv *fdtv, int plug, int channel);
41463 -
41464 -/* firedtv-ci.c */
41465 -int fdtv_ca_register(struct firedtv *fdtv);
41466 -void fdtv_ca_release(struct firedtv *fdtv);
41467 -
41468 -/* firedtv-dvb.c */
41469 -int fdtv_start_feed(struct dvb_demux_feed *dvbdmxfeed);
41470 -int fdtv_stop_feed(struct dvb_demux_feed *dvbdmxfeed);
41471 -int fdtv_dvb_register(struct firedtv *fdtv);
41472 -void fdtv_dvb_unregister(struct firedtv *fdtv);
41473 -struct firedtv *fdtv_alloc(struct device *dev,
41474 - const struct firedtv_backend *backend,
41475 - const char *name, size_t name_len);
41476 -extern const char *fdtv_model_names[];
41477 -
41478 -/* firedtv-fe.c */
41479 -void fdtv_frontend_init(struct firedtv *fdtv);
41480 -
41481 -/* firedtv-rc.c */
41482 -#ifdef CONFIG_DVB_FIREDTV_INPUT
41483 -int fdtv_register_rc(struct firedtv *fdtv, struct device *dev);
41484 -void fdtv_unregister_rc(struct firedtv *fdtv);
41485 -void fdtv_handle_rc(struct firedtv *fdtv, unsigned int code);
41486 -#else
41487 -static inline int fdtv_register_rc(struct firedtv *fdtv,
41488 - struct device *dev) { return 0; }
41489 -static inline void fdtv_unregister_rc(struct firedtv *fdtv) {}
41490 -static inline void fdtv_handle_rc(struct firedtv *fdtv, unsigned int code) {}
41491 -#endif
41492 -
41493 -#endif /* _FIREDTV_H */
41494 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/dvb/firewire/firedtv-rc.c linux-2.6.29-rc3.owrt/drivers/media/dvb/firewire/firedtv-rc.c
41495 --- linux-2.6.29.owrt/drivers/media/dvb/firewire/firedtv-rc.c 2009-05-10 22:04:39.000000000 +0200
41496 +++ linux-2.6.29-rc3.owrt/drivers/media/dvb/firewire/firedtv-rc.c 1970-01-01 01:00:00.000000000 +0100
41497 @@ -1,190 +0,0 @@
41498 -/*
41499 - * FireDTV driver (formerly known as FireSAT)
41500 - *
41501 - * Copyright (C) 2004 Andreas Monitzer <andy@monitzer.com>
41502 - *
41503 - * This program is free software; you can redistribute it and/or
41504 - * modify it under the terms of the GNU General Public License as
41505 - * published by the Free Software Foundation; either version 2 of
41506 - * the License, or (at your option) any later version.
41507 - */
41508 -
41509 -#include <linux/bitops.h>
41510 -#include <linux/input.h>
41511 -#include <linux/kernel.h>
41512 -#include <linux/string.h>
41513 -#include <linux/types.h>
41514 -
41515 -#include "firedtv.h"
41516 -
41517 -/* fixed table with older keycodes, geared towards MythTV */
41518 -const static u16 oldtable[] = {
41519 -
41520 - /* code from device: 0x4501...0x451f */
41521 -
41522 - KEY_ESC,
41523 - KEY_F9,
41524 - KEY_1,
41525 - KEY_2,
41526 - KEY_3,
41527 - KEY_4,
41528 - KEY_5,
41529 - KEY_6,
41530 - KEY_7,
41531 - KEY_8,
41532 - KEY_9,
41533 - KEY_I,
41534 - KEY_0,
41535 - KEY_ENTER,
41536 - KEY_RED,
41537 - KEY_UP,
41538 - KEY_GREEN,
41539 - KEY_F10,
41540 - KEY_SPACE,
41541 - KEY_F11,
41542 - KEY_YELLOW,
41543 - KEY_DOWN,
41544 - KEY_BLUE,
41545 - KEY_Z,
41546 - KEY_P,
41547 - KEY_PAGEDOWN,
41548 - KEY_LEFT,
41549 - KEY_W,
41550 - KEY_RIGHT,
41551 - KEY_P,
41552 - KEY_M,
41553 -
41554 - /* code from device: 0x4540...0x4542 */
41555 -
41556 - KEY_R,
41557 - KEY_V,
41558 - KEY_C,
41559 -};
41560 -
41561 -/* user-modifiable table for a remote as sold in 2008 */
41562 -const static u16 keytable[] = {
41563 -
41564 - /* code from device: 0x0300...0x031f */
41565 -
41566 - [0x00] = KEY_POWER,
41567 - [0x01] = KEY_SLEEP,
41568 - [0x02] = KEY_STOP,
41569 - [0x03] = KEY_OK,
41570 - [0x04] = KEY_RIGHT,
41571 - [0x05] = KEY_1,
41572 - [0x06] = KEY_2,
41573 - [0x07] = KEY_3,
41574 - [0x08] = KEY_LEFT,
41575 - [0x09] = KEY_4,
41576 - [0x0a] = KEY_5,
41577 - [0x0b] = KEY_6,
41578 - [0x0c] = KEY_UP,
41579 - [0x0d] = KEY_7,
41580 - [0x0e] = KEY_8,
41581 - [0x0f] = KEY_9,
41582 - [0x10] = KEY_DOWN,
41583 - [0x11] = KEY_TITLE, /* "OSD" - fixme */
41584 - [0x12] = KEY_0,
41585 - [0x13] = KEY_F20, /* "16:9" - fixme */
41586 - [0x14] = KEY_SCREEN, /* "FULL" - fixme */
41587 - [0x15] = KEY_MUTE,
41588 - [0x16] = KEY_SUBTITLE,
41589 - [0x17] = KEY_RECORD,
41590 - [0x18] = KEY_TEXT,
41591 - [0x19] = KEY_AUDIO,
41592 - [0x1a] = KEY_RED,
41593 - [0x1b] = KEY_PREVIOUS,
41594 - [0x1c] = KEY_REWIND,
41595 - [0x1d] = KEY_PLAYPAUSE,
41596 - [0x1e] = KEY_NEXT,
41597 - [0x1f] = KEY_VOLUMEUP,
41598 -
41599 - /* code from device: 0x0340...0x0354 */
41600 -
41601 - [0x20] = KEY_CHANNELUP,
41602 - [0x21] = KEY_F21, /* "4:3" - fixme */
41603 - [0x22] = KEY_TV,
41604 - [0x23] = KEY_DVD,
41605 - [0x24] = KEY_VCR,
41606 - [0x25] = KEY_AUX,
41607 - [0x26] = KEY_GREEN,
41608 - [0x27] = KEY_YELLOW,
41609 - [0x28] = KEY_BLUE,
41610 - [0x29] = KEY_CHANNEL, /* "CH.LIST" */
41611 - [0x2a] = KEY_VENDOR, /* "CI" - fixme */
41612 - [0x2b] = KEY_VOLUMEDOWN,
41613 - [0x2c] = KEY_CHANNELDOWN,
41614 - [0x2d] = KEY_LAST,
41615 - [0x2e] = KEY_INFO,
41616 - [0x2f] = KEY_FORWARD,
41617 - [0x30] = KEY_LIST,
41618 - [0x31] = KEY_FAVORITES,
41619 - [0x32] = KEY_MENU,
41620 - [0x33] = KEY_EPG,
41621 - [0x34] = KEY_EXIT,
41622 -};
41623 -
41624 -int fdtv_register_rc(struct firedtv *fdtv, struct device *dev)
41625 -{
41626 - struct input_dev *idev;
41627 - int i, err;
41628 -
41629 - idev = input_allocate_device();
41630 - if (!idev)
41631 - return -ENOMEM;
41632 -
41633 - fdtv->remote_ctrl_dev = idev;
41634 - idev->name = "FireDTV remote control";
41635 - idev->dev.parent = dev;
41636 - idev->evbit[0] = BIT_MASK(EV_KEY);
41637 - idev->keycode = kmemdup(keytable, sizeof(keytable), GFP_KERNEL);
41638 - if (!idev->keycode) {
41639 - err = -ENOMEM;
41640 - goto fail;
41641 - }
41642 - idev->keycodesize = sizeof(keytable[0]);
41643 - idev->keycodemax = ARRAY_SIZE(keytable);
41644 -
41645 - for (i = 0; i < ARRAY_SIZE(keytable); i++)
41646 - set_bit(keytable[i], idev->keybit);
41647 -
41648 - err = input_register_device(idev);
41649 - if (err)
41650 - goto fail_free_keymap;
41651 -
41652 - return 0;
41653 -
41654 -fail_free_keymap:
41655 - kfree(idev->keycode);
41656 -fail:
41657 - input_free_device(idev);
41658 - return err;
41659 -}
41660 -
41661 -void fdtv_unregister_rc(struct firedtv *fdtv)
41662 -{
41663 - kfree(fdtv->remote_ctrl_dev->keycode);
41664 - input_unregister_device(fdtv->remote_ctrl_dev);
41665 -}
41666 -
41667 -void fdtv_handle_rc(struct firedtv *fdtv, unsigned int code)
41668 -{
41669 - u16 *keycode = fdtv->remote_ctrl_dev->keycode;
41670 -
41671 - if (code >= 0x0300 && code <= 0x031f)
41672 - code = keycode[code - 0x0300];
41673 - else if (code >= 0x0340 && code <= 0x0354)
41674 - code = keycode[code - 0x0320];
41675 - else if (code >= 0x4501 && code <= 0x451f)
41676 - code = oldtable[code - 0x4501];
41677 - else if (code >= 0x4540 && code <= 0x4542)
41678 - code = oldtable[code - 0x4521];
41679 - else {
41680 - printk(KERN_DEBUG "firedtv: invalid key code 0x%04x "
41681 - "from remote control\n", code);
41682 - return;
41683 - }
41684 -
41685 - input_report_key(fdtv->remote_ctrl_dev, code, 1);
41686 - input_report_key(fdtv->remote_ctrl_dev, code, 0);
41687 -}
41688 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/dvb/firewire/Kconfig linux-2.6.29-rc3.owrt/drivers/media/dvb/firewire/Kconfig
41689 --- linux-2.6.29.owrt/drivers/media/dvb/firewire/Kconfig 2009-05-10 22:04:39.000000000 +0200
41690 +++ linux-2.6.29-rc3.owrt/drivers/media/dvb/firewire/Kconfig 1970-01-01 01:00:00.000000000 +0100
41691 @@ -1,22 +0,0 @@
41692 -config DVB_FIREDTV
41693 - tristate "FireDTV and FloppyDTV"
41694 - depends on DVB_CORE && IEEE1394
41695 - help
41696 - Support for DVB receivers from Digital Everywhere
41697 - which are connected via IEEE 1394 (FireWire).
41698 -
41699 - These devices don't have an MPEG decoder built in,
41700 - so you need an external software decoder to watch TV.
41701 -
41702 - To compile this driver as a module, say M here:
41703 - the module will be called firedtv.
41704 -
41705 -if DVB_FIREDTV
41706 -
41707 -config DVB_FIREDTV_IEEE1394
41708 - def_bool IEEE1394
41709 -
41710 -config DVB_FIREDTV_INPUT
41711 - def_bool INPUT = y || (INPUT = m && DVB_FIREDTV = m)
41712 -
41713 -endif # DVB_FIREDTV
41714 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/dvb/firewire/Makefile linux-2.6.29-rc3.owrt/drivers/media/dvb/firewire/Makefile
41715 --- linux-2.6.29.owrt/drivers/media/dvb/firewire/Makefile 2009-05-10 22:04:39.000000000 +0200
41716 +++ linux-2.6.29-rc3.owrt/drivers/media/dvb/firewire/Makefile 1970-01-01 01:00:00.000000000 +0100
41717 @@ -1,8 +0,0 @@
41718 -obj-$(CONFIG_DVB_FIREDTV) += firedtv.o
41719 -
41720 -firedtv-y := firedtv-avc.o firedtv-ci.o firedtv-dvb.o firedtv-fe.o
41721 -firedtv-$(CONFIG_DVB_FIREDTV_IEEE1394) += firedtv-1394.o
41722 -firedtv-$(CONFIG_DVB_FIREDTV_INPUT) += firedtv-rc.o
41723 -
41724 -ccflags-y += -Idrivers/media/dvb/dvb-core
41725 -ccflags-$(CONFIG_DVB_FIREDTV_IEEE1394) += -Idrivers/ieee1394
41726 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/dvb/frontends/drx397xD.c linux-2.6.29-rc3.owrt/drivers/media/dvb/frontends/drx397xD.c
41727 --- linux-2.6.29.owrt/drivers/media/dvb/frontends/drx397xD.c 2009-05-10 22:04:39.000000000 +0200
41728 +++ linux-2.6.29-rc3.owrt/drivers/media/dvb/frontends/drx397xD.c 2009-05-10 23:48:28.000000000 +0200
41729 @@ -646,7 +646,7 @@
41730 u32 edi = 0, ebx = 0, ebp = 0, edx = 0;
41731 u16 v20 = 0, v1E = 0, v16 = 0, v14 = 0, v12 = 0, v10 = 0, v0E = 0;
41732
41733 - int rc, df_tuner = 0;
41734 + int rc, df_tuner;
41735 int a, b, c, d;
41736 pr_debug("%s %d\n", __func__, s->config.d60);
41737
41738 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/dvb/frontends/s5h1409.c linux-2.6.29-rc3.owrt/drivers/media/dvb/frontends/s5h1409.c
41739 --- linux-2.6.29.owrt/drivers/media/dvb/frontends/s5h1409.c 2009-05-10 22:04:39.000000000 +0200
41740 +++ linux-2.6.29-rc3.owrt/drivers/media/dvb/frontends/s5h1409.c 2009-05-10 23:48:28.000000000 +0200
41741 @@ -545,6 +545,9 @@
41742
41743 s5h1409_enable_modulation(fe, p->u.vsb.modulation);
41744
41745 + /* Allow the demod to settle */
41746 + msleep(100);
41747 +
41748 if (fe->ops.tuner_ops.set_params) {
41749 if (fe->ops.i2c_gate_ctrl)
41750 fe->ops.i2c_gate_ctrl(fe, 1);
41751 @@ -559,10 +562,6 @@
41752 s5h1409_set_qam_interleave_mode(fe);
41753 }
41754
41755 - /* Issue a reset to the demod so it knows to resync against the
41756 - newly tuned frequency */
41757 - s5h1409_softreset(fe);
41758 -
41759 return 0;
41760 }
41761
41762 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/dvb/frontends/stb0899_algo.c linux-2.6.29-rc3.owrt/drivers/media/dvb/frontends/stb0899_algo.c
41763 --- linux-2.6.29.owrt/drivers/media/dvb/frontends/stb0899_algo.c 2009-05-10 22:04:39.000000000 +0200
41764 +++ linux-2.6.29-rc3.owrt/drivers/media/dvb/frontends/stb0899_algo.c 2009-05-10 23:48:28.000000000 +0200
41765 @@ -31,8 +31,6 @@
41766 return n;
41767 }
41768
41769 -#if 0
41770 -/* These functions are currently unused */
41771 /*
41772 * stb0899_calc_srate
41773 * Compute symbol rate
41774 @@ -65,7 +63,6 @@
41775
41776 return stb0899_calc_srate(internal->master_clk, sfr);
41777 }
41778 -#endif
41779
41780 /*
41781 * stb0899_set_srate
41782 @@ -156,7 +153,7 @@
41783 }
41784
41785 if (range > 0)
41786 - internal->sub_range = min(internal->srch_range, range);
41787 + internal->sub_range = MIN(internal->srch_range, range);
41788 else
41789 internal->sub_range = 0;
41790
41791 @@ -185,7 +182,7 @@
41792 timing = stb0899_read_reg(state, STB0899_RTF);
41793
41794 if (lock >= 42) {
41795 - if ((lock > 48) && (abs(timing) >= 110)) {
41796 + if ((lock > 48) && (ABS(timing) >= 110)) {
41797 internal->status = ANALOGCARRIER;
41798 dprintk(state->verbose, FE_DEBUG, 1, "-->ANALOG Carrier !");
41799 } else {
41800 @@ -222,7 +219,7 @@
41801 index++;
41802 derot_freq += index * internal->direction * derot_step; /* next derot zig zag position */
41803
41804 - if (abs(derot_freq) > derot_limit)
41805 + if (ABS(derot_freq) > derot_limit)
41806 next_loop--;
41807
41808 if (next_loop) {
41809 @@ -298,7 +295,7 @@
41810 last_derot_freq = derot_freq;
41811 derot_freq += index * internal->direction * internal->derot_step; /* next zig zag derotator position */
41812
41813 - if(abs(derot_freq) > derot_limit)
41814 + if(ABS(derot_freq) > derot_limit)
41815 next_loop--;
41816
41817 if (next_loop) {
41818 @@ -400,7 +397,7 @@
41819 if ((internal->status != CARRIEROK) || (stb0899_check_data(state) != DATAOK)) {
41820
41821 derot_freq += index * internal->direction * derot_step; /* next zig zag derotator position */
41822 - if (abs(derot_freq) > derot_limit)
41823 + if (ABS(derot_freq) > derot_limit)
41824 next_loop--;
41825
41826 if (next_loop) {
41827 @@ -467,7 +464,7 @@
41828
41829 if (internal->sub_dir > 0) {
41830 old_sub_range = internal->sub_range;
41831 - internal->sub_range = min((internal->srch_range / 2) -
41832 + internal->sub_range = MIN((internal->srch_range / 2) -
41833 (internal->tuner_offst + internal->sub_range / 2),
41834 internal->sub_range);
41835
41836 @@ -771,7 +768,7 @@
41837 int i;
41838
41839 i = 0;
41840 - while ((1 << i) <= abs(number))
41841 + while ((1 << i) <= ABS(number))
41842 i++;
41843
41844 if (number == 0)
41845 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/dvb/frontends/stb0899_drv.c linux-2.6.29-rc3.owrt/drivers/media/dvb/frontends/stb0899_drv.c
41846 --- linux-2.6.29.owrt/drivers/media/dvb/frontends/stb0899_drv.c 2009-05-10 22:04:39.000000000 +0200
41847 +++ linux-2.6.29-rc3.owrt/drivers/media/dvb/frontends/stb0899_drv.c 2009-05-10 23:48:28.000000000 +0200
41848 @@ -794,7 +794,7 @@
41849 reg = stb0899_read_reg(state, STB0899_DISCNTRL1);
41850 old_state = reg;
41851 /* set to burst mode */
41852 - STB0899_SETFIELD_VAL(DISEQCMODE, reg, 0x03);
41853 + STB0899_SETFIELD_VAL(DISEQCMODE, reg, 0x02);
41854 STB0899_SETFIELD_VAL(DISPRECHARGE, reg, 0x01);
41855 stb0899_write_reg(state, STB0899_DISCNTRL1, reg);
41856 switch (burst) {
41857 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/dvb/frontends/stb0899_priv.h linux-2.6.29-rc3.owrt/drivers/media/dvb/frontends/stb0899_priv.h
41858 --- linux-2.6.29.owrt/drivers/media/dvb/frontends/stb0899_priv.h 2009-05-10 22:04:39.000000000 +0200
41859 +++ linux-2.6.29-rc3.owrt/drivers/media/dvb/frontends/stb0899_priv.h 2009-05-10 23:48:28.000000000 +0200
41860 @@ -59,6 +59,10 @@
41861 #define MAKEWORD32(a, b, c, d) (((a) << 24) | ((b) << 16) | ((c) << 8) | (d))
41862 #define MAKEWORD16(a, b) (((a) << 8) | (b))
41863
41864 +#define MIN(x, y) ((x) <= (y) ? (x) : (y))
41865 +#define MAX(x, y) ((x) >= (y) ? (x) : (y))
41866 +#define ABS(x) ((x) >= 0 ? (x) : -(x))
41867 +
41868 #define LSB(x) ((x & 0xff))
41869 #define MSB(y) ((y >> 8) & 0xff)
41870
41871 @@ -164,10 +168,10 @@
41872 u32 freq; /* Demod internal Frequency */
41873 u32 srate; /* Demod internal Symbol rate */
41874 enum stb0899_fec fecrate; /* Demod internal FEC rate */
41875 - s32 srch_range; /* Demod internal Search Range */
41876 - s32 sub_range; /* Demod current sub range (Hz) */
41877 - s32 tuner_step; /* Tuner step (Hz) */
41878 - s32 tuner_offst; /* Relative offset to carrier (Hz) */
41879 + u32 srch_range; /* Demod internal Search Range */
41880 + u32 sub_range; /* Demod current sub range (Hz) */
41881 + u32 tuner_step; /* Tuner step (Hz) */
41882 + u32 tuner_offst; /* Relative offset to carrier (Hz) */
41883 u32 tuner_bw; /* Current bandwidth of the tuner (Hz) */
41884
41885 s32 mclk; /* Masterclock Divider factor (binary) */
41886 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/dvb/frontends/stb6100.c linux-2.6.29-rc3.owrt/drivers/media/dvb/frontends/stb6100.c
41887 --- linux-2.6.29.owrt/drivers/media/dvb/frontends/stb6100.c 2009-05-10 22:04:39.000000000 +0200
41888 +++ linux-2.6.29-rc3.owrt/drivers/media/dvb/frontends/stb6100.c 2009-05-10 23:48:28.000000000 +0200
41889 @@ -427,11 +427,11 @@
41890 status->refclock = 27000000; /* Hz */
41891 status->iqsense = 1;
41892 status->bandwidth = 36000; /* kHz */
41893 - state->bandwidth = status->bandwidth * 1000; /* Hz */
41894 + state->bandwidth = status->bandwidth * 1000; /* MHz */
41895 state->reference = status->refclock / 1000; /* kHz */
41896
41897 /* Set default bandwidth. */
41898 - return stb6100_set_bandwidth(fe, state->bandwidth);
41899 + return stb6100_set_bandwidth(fe, status->bandwidth);
41900 }
41901
41902 static int stb6100_get_state(struct dvb_frontend *fe,
41903 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/dvb/frontends/zl10353.c linux-2.6.29-rc3.owrt/drivers/media/dvb/frontends/zl10353.c
41904 --- linux-2.6.29.owrt/drivers/media/dvb/frontends/zl10353.c 2009-05-10 22:04:39.000000000 +0200
41905 +++ linux-2.6.29-rc3.owrt/drivers/media/dvb/frontends/zl10353.c 2009-05-10 23:48:28.000000000 +0200
41906 @@ -590,7 +590,7 @@
41907 struct zl10353_state *state = fe->demodulator_priv;
41908 u8 val = 0x0a;
41909
41910 - if (state->config.disable_i2c_gate_ctrl) {
41911 + if (state->config.no_tuner) {
41912 /* No tuner attached to the internal I2C bus */
41913 /* If set enable I2C bridge, the main I2C bus stopped hardly */
41914 return 0;
41915 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/dvb/frontends/zl10353.h linux-2.6.29-rc3.owrt/drivers/media/dvb/frontends/zl10353.h
41916 --- linux-2.6.29.owrt/drivers/media/dvb/frontends/zl10353.h 2009-05-10 22:04:39.000000000 +0200
41917 +++ linux-2.6.29-rc3.owrt/drivers/media/dvb/frontends/zl10353.h 2009-05-10 23:48:28.000000000 +0200
41918 @@ -38,9 +38,6 @@
41919
41920 /* set if parallel ts output is required */
41921 int parallel_ts;
41922 -
41923 - /* set if i2c_gate_ctrl disable is required */
41924 - u8 disable_i2c_gate_ctrl:1;
41925 };
41926
41927 #if defined(CONFIG_DVB_ZL10353) || (defined(CONFIG_DVB_ZL10353_MODULE) && defined(MODULE))
41928 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/dvb/Kconfig linux-2.6.29-rc3.owrt/drivers/media/dvb/Kconfig
41929 --- linux-2.6.29.owrt/drivers/media/dvb/Kconfig 2009-05-10 22:04:39.000000000 +0200
41930 +++ linux-2.6.29-rc3.owrt/drivers/media/dvb/Kconfig 2009-05-10 23:48:28.000000000 +0200
41931 @@ -51,10 +51,6 @@
41932 depends on DVB_CORE && PCI && I2C
41933 source "drivers/media/dvb/dm1105/Kconfig"
41934
41935 -comment "Supported FireWire (IEEE 1394) Adapters"
41936 - depends on DVB_CORE && IEEE1394
41937 -source "drivers/media/dvb/firewire/Kconfig"
41938 -
41939 comment "Supported DVB Frontends"
41940 depends on DVB_CORE
41941 source "drivers/media/dvb/frontends/Kconfig"
41942 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/dvb/Makefile linux-2.6.29-rc3.owrt/drivers/media/dvb/Makefile
41943 --- linux-2.6.29.owrt/drivers/media/dvb/Makefile 2009-05-10 22:04:39.000000000 +0200
41944 +++ linux-2.6.29-rc3.owrt/drivers/media/dvb/Makefile 2009-05-10 23:48:28.000000000 +0200
41945 @@ -3,5 +3,3 @@
41946 #
41947
41948 obj-y := dvb-core/ frontends/ ttpci/ ttusb-dec/ ttusb-budget/ b2c2/ bt8xx/ dvb-usb/ pluto2/ siano/ dm1105/
41949 -
41950 -obj-$(CONFIG_DVB_FIREDTV) += firewire/
41951 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/dvb/ttpci/budget.c linux-2.6.29-rc3.owrt/drivers/media/dvb/ttpci/budget.c
41952 --- linux-2.6.29.owrt/drivers/media/dvb/ttpci/budget.c 2009-05-10 22:04:39.000000000 +0200
41953 +++ linux-2.6.29-rc3.owrt/drivers/media/dvb/ttpci/budget.c 2009-05-10 23:48:28.000000000 +0200
41954 @@ -470,7 +470,6 @@
41955 budget->dvb_frontend = dvb_attach(l64781_attach, &grundig_29504_401_config, &budget->i2c_adap);
41956 if (budget->dvb_frontend) {
41957 budget->dvb_frontend->ops.tuner_ops.set_params = grundig_29504_401_tuner_set_params;
41958 - budget->dvb_frontend->tuner_priv = NULL;
41959 break;
41960 }
41961 break;
41962 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/dvb/ttusb-dec/ttusb_dec.c linux-2.6.29-rc3.owrt/drivers/media/dvb/ttusb-dec/ttusb_dec.c
41963 --- linux-2.6.29.owrt/drivers/media/dvb/ttusb-dec/ttusb_dec.c 2009-05-10 22:04:39.000000000 +0200
41964 +++ linux-2.6.29-rc3.owrt/drivers/media/dvb/ttusb-dec/ttusb_dec.c 2009-05-10 23:48:28.000000000 +0200
41965 @@ -1384,7 +1384,7 @@
41966 static int ttusb_dec_init_stb(struct ttusb_dec *dec)
41967 {
41968 int result;
41969 - unsigned int mode = 0, model = 0, version = 0;
41970 + unsigned int mode, model, version;
41971
41972 dprintk("%s\n", __func__);
41973
41974 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/radio/radio-mr800.c linux-2.6.29-rc3.owrt/drivers/media/radio/radio-mr800.c
41975 --- linux-2.6.29.owrt/drivers/media/radio/radio-mr800.c 2009-05-10 22:04:39.000000000 +0200
41976 +++ linux-2.6.29-rc3.owrt/drivers/media/radio/radio-mr800.c 2009-05-10 23:48:28.000000000 +0200
41977 @@ -194,10 +194,10 @@
41978 return retval;
41979 }
41980
41981 - radio->muted = 0;
41982 -
41983 mutex_unlock(&radio->lock);
41984
41985 + radio->muted = 0;
41986 +
41987 return retval;
41988 }
41989
41990 @@ -230,10 +230,10 @@
41991 return retval;
41992 }
41993
41994 - radio->muted = 1;
41995 -
41996 mutex_unlock(&radio->lock);
41997
41998 + radio->muted = 1;
41999 +
42000 return retval;
42001 }
42002
42003 @@ -284,10 +284,10 @@
42004 return retval;
42005 }
42006
42007 - radio->stereo = 0;
42008 -
42009 mutex_unlock(&radio->lock);
42010
42011 + radio->stereo = 0;
42012 +
42013 return retval;
42014 }
42015
42016 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/radio/radio-si470x.c linux-2.6.29-rc3.owrt/drivers/media/radio/radio-si470x.c
42017 --- linux-2.6.29.owrt/drivers/media/radio/radio-si470x.c 2009-05-10 22:04:39.000000000 +0200
42018 +++ linux-2.6.29-rc3.owrt/drivers/media/radio/radio-si470x.c 2009-05-10 23:48:28.000000000 +0200
42019 @@ -98,16 +98,11 @@
42020 * - blacklisted KWorld radio in hid-core.c and hid-ids.h
42021 * 2008-12-03 Mark Lord <mlord@pobox.com>
42022 * - add support for DealExtreme USB Radio
42023 - * 2009-01-31 Bob Ross <pigiron@gmx.com>
42024 - * - correction of stereo detection/setting
42025 - * - correction of signal strength indicator scaling
42026 - * 2009-01-31 Rick Bronson <rick@efn.org>
42027 - * Tobias Lorenz <tobias.lorenz@gmx.net>
42028 - * - add LED status output
42029 *
42030 * ToDo:
42031 * - add firmware download/update support
42032 * - RDS support: interrupt mode, instead of polling
42033 + * - add LED status output (check if that's not already done in firmware)
42034 */
42035
42036
42037 @@ -887,30 +882,6 @@
42038
42039
42040 /**************************************************************************
42041 - * General Driver Functions - LED_REPORT
42042 - **************************************************************************/
42043 -
42044 -/*
42045 - * si470x_set_led_state - sets the led state
42046 - */
42047 -static int si470x_set_led_state(struct si470x_device *radio,
42048 - unsigned char led_state)
42049 -{
42050 - unsigned char buf[LED_REPORT_SIZE];
42051 - int retval;
42052 -
42053 - buf[0] = LED_REPORT;
42054 - buf[1] = LED_COMMAND;
42055 - buf[2] = led_state;
42056 -
42057 - retval = si470x_set_report(radio, (void *) &buf, sizeof(buf));
42058 -
42059 - return (retval < 0) ? -EINVAL : 0;
42060 -}
42061 -
42062 -
42063 -
42064 -/**************************************************************************
42065 * RDS Driver Functions
42066 **************************************************************************/
42067
42068 @@ -1414,22 +1385,20 @@
42069 };
42070
42071 /* stereo indicator == stereo (instead of mono) */
42072 - if ((radio->registers[STATUSRSSI] & STATUSRSSI_ST) == 0)
42073 - tuner->rxsubchans = V4L2_TUNER_SUB_MONO;
42074 - else
42075 + if ((radio->registers[STATUSRSSI] & STATUSRSSI_ST) == 1)
42076 tuner->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO;
42077 + else
42078 + tuner->rxsubchans = V4L2_TUNER_SUB_MONO;
42079
42080 /* mono/stereo selector */
42081 - if ((radio->registers[POWERCFG] & POWERCFG_MONO) == 0)
42082 - tuner->audmode = V4L2_TUNER_MODE_STEREO;
42083 - else
42084 + if ((radio->registers[POWERCFG] & POWERCFG_MONO) == 1)
42085 tuner->audmode = V4L2_TUNER_MODE_MONO;
42086 + else
42087 + tuner->audmode = V4L2_TUNER_MODE_STEREO;
42088
42089 /* min is worst, max is best; signal:0..0xffff; rssi: 0..0xff */
42090 - /* measured in units of dbµV in 1 db increments (max at ~75 dbµV) */
42091 - tuner->signal = (radio->registers[STATUSRSSI] & STATUSRSSI_RSSI);
42092 - /* the ideal factor is 0xffff/75 = 873,8 */
42093 - tuner->signal = (tuner->signal * 873) + (8 * tuner->signal / 10);
42094 + tuner->signal = (radio->registers[STATUSRSSI] & STATUSRSSI_RSSI)
42095 + * 0x0101;
42096
42097 /* automatic frequency control: -1: freq to low, 1 freq to high */
42098 /* AFCRL does only indicate that freq. differs, not if too low/high */
42099 @@ -1663,9 +1632,6 @@
42100 /* set initial frequency */
42101 si470x_set_freq(radio, 87.5 * FREQ_MUL); /* available in all regions */
42102
42103 - /* set led to connect state */
42104 - si470x_set_led_state(radio, BLINK_GREEN_LED);
42105 -
42106 /* rds buffer allocation */
42107 radio->buf_size = rds_buf * 3;
42108 radio->buffer = kmalloc(radio->buf_size, GFP_KERNEL);
42109 @@ -1749,9 +1715,6 @@
42110 cancel_delayed_work_sync(&radio->work);
42111 usb_set_intfdata(intf, NULL);
42112 if (radio->users == 0) {
42113 - /* set led to disconnect state */
42114 - si470x_set_led_state(radio, BLINK_ORANGE_LED);
42115 -
42116 video_unregister_device(radio->videodev);
42117 kfree(radio->buffer);
42118 kfree(radio);
42119 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/cs5345.c linux-2.6.29-rc3.owrt/drivers/media/video/cs5345.c
42120 --- linux-2.6.29.owrt/drivers/media/video/cs5345.c 2009-05-10 22:04:38.000000000 +0200
42121 +++ linux-2.6.29-rc3.owrt/drivers/media/video/cs5345.c 2009-05-10 23:48:28.000000000 +0200
42122 @@ -18,6 +18,7 @@
42123 */
42124
42125
42126 +#include <linux/version.h>
42127 #include <linux/module.h>
42128 #include <linux/kernel.h>
42129 #include <linux/i2c.h>
42130 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/cx23885/cx23885-417.c linux-2.6.29-rc3.owrt/drivers/media/video/cx23885/cx23885-417.c
42131 --- linux-2.6.29.owrt/drivers/media/video/cx23885/cx23885-417.c 2009-05-10 22:04:38.000000000 +0200
42132 +++ linux-2.6.29-rc3.owrt/drivers/media/video/cx23885/cx23885-417.c 2009-05-10 23:48:28.000000000 +0200
42133 @@ -1586,8 +1586,7 @@
42134 lock_kernel();
42135 list_for_each(list, &cx23885_devlist) {
42136 h = list_entry(list, struct cx23885_dev, devlist);
42137 - if (h->v4l_device &&
42138 - h->v4l_device->minor == minor) {
42139 + if (h->v4l_device->minor == minor) {
42140 dev = h;
42141 break;
42142 }
42143 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/cx23885/cx23885-video.c linux-2.6.29-rc3.owrt/drivers/media/video/cx23885/cx23885-video.c
42144 --- linux-2.6.29.owrt/drivers/media/video/cx23885/cx23885-video.c 2009-05-10 22:04:38.000000000 +0200
42145 +++ linux-2.6.29-rc3.owrt/drivers/media/video/cx23885/cx23885-video.c 2009-05-10 23:48:28.000000000 +0200
42146 @@ -730,13 +730,12 @@
42147 lock_kernel();
42148 list_for_each(list, &cx23885_devlist) {
42149 h = list_entry(list, struct cx23885_dev, devlist);
42150 - if (h->video_dev &&
42151 - h->video_dev->minor == minor) {
42152 + if (h->video_dev->minor == minor) {
42153 dev = h;
42154 type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
42155 }
42156 if (h->vbi_dev &&
42157 - h->vbi_dev->minor == minor) {
42158 + h->vbi_dev->minor == minor) {
42159 dev = h;
42160 type = V4L2_BUF_TYPE_VBI_CAPTURE;
42161 }
42162 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/cx25840/cx25840-core.c linux-2.6.29-rc3.owrt/drivers/media/video/cx25840/cx25840-core.c
42163 --- linux-2.6.29.owrt/drivers/media/video/cx25840/cx25840-core.c 2009-05-10 22:04:38.000000000 +0200
42164 +++ linux-2.6.29-rc3.owrt/drivers/media/video/cx25840/cx25840-core.c 2009-05-10 23:48:28.000000000 +0200
42165 @@ -1382,14 +1382,6 @@
42166
42167 static int cx25840_command(struct i2c_client *client, unsigned cmd, void *arg)
42168 {
42169 - /* ignore this command */
42170 - if (cmd == TUNER_SET_TYPE_ADDR || cmd == TUNER_SET_CONFIG)
42171 - return 0;
42172 -
42173 - /* Old-style drivers rely on initialization on first use, so
42174 - call the init whenever a command is issued to this driver.
42175 - New-style drivers using v4l2_subdev should call init explicitly. */
42176 - cx25840_init(i2c_get_clientdata(client), 0);
42177 return v4l2_subdev_command(i2c_get_clientdata(client), cmd, arg);
42178 }
42179
42180 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/cx88/cx88-dvb.c linux-2.6.29-rc3.owrt/drivers/media/video/cx88/cx88-dvb.c
42181 --- linux-2.6.29.owrt/drivers/media/video/cx88/cx88-dvb.c 2009-05-10 22:04:38.000000000 +0200
42182 +++ linux-2.6.29-rc3.owrt/drivers/media/video/cx88/cx88-dvb.c 2009-05-10 23:48:28.000000000 +0200
42183 @@ -614,41 +614,34 @@
42184 .set_ts_params = cx24116_set_ts_param,
42185 };
42186
42187 -static int cx8802_alloc_frontends(struct cx8802_dev *dev)
42188 +static int dvb_register(struct cx8802_dev *dev)
42189 {
42190 struct cx88_core *core = dev->core;
42191 - struct videobuf_dvb_frontend *fe = NULL;
42192 + struct videobuf_dvb_frontend *fe0, *fe1 = NULL;
42193 + int mfe_shared = 0; /* bus not shared by default */
42194 int i;
42195
42196 - mutex_init(&dev->frontends.lock);
42197 - INIT_LIST_HEAD(&dev->frontends.felist);
42198 + if (0 != core->i2c_rc) {
42199 + printk(KERN_ERR "%s/2: no i2c-bus available, cannot attach dvb drivers\n", core->name);
42200 + goto frontend_detach;
42201 + }
42202
42203 if (!core->board.num_frontends)
42204 - return -ENODEV;
42205 + return -EINVAL;
42206 +
42207 + mutex_init(&dev->frontends.lock);
42208 + INIT_LIST_HEAD(&dev->frontends.felist);
42209
42210 printk(KERN_INFO "%s() allocating %d frontend(s)\n", __func__,
42211 core->board.num_frontends);
42212 for (i = 1; i <= core->board.num_frontends; i++) {
42213 - fe = videobuf_dvb_alloc_frontend(&dev->frontends, i);
42214 - if (!fe) {
42215 + fe0 = videobuf_dvb_alloc_frontend(&dev->frontends, i);
42216 + if (!fe0) {
42217 printk(KERN_ERR "%s() failed to alloc\n", __func__);
42218 videobuf_dvb_dealloc_frontends(&dev->frontends);
42219 - return -ENOMEM;
42220 + goto frontend_detach;
42221 }
42222 }
42223 - return 0;
42224 -}
42225 -
42226 -static int dvb_register(struct cx8802_dev *dev)
42227 -{
42228 - struct cx88_core *core = dev->core;
42229 - struct videobuf_dvb_frontend *fe0, *fe1 = NULL;
42230 - int mfe_shared = 0; /* bus not shared by default */
42231 -
42232 - if (0 != core->i2c_rc) {
42233 - printk(KERN_ERR "%s/2: no i2c-bus available, cannot attach dvb drivers\n", core->name);
42234 - goto frontend_detach;
42235 - }
42236
42237 /* Get the first frontend */
42238 fe0 = videobuf_dvb_get_frontend(&dev->frontends, 1);
42239 @@ -1250,8 +1243,6 @@
42240 struct cx88_core *core = drv->core;
42241 struct cx8802_dev *dev = drv->core->dvbdev;
42242 int err;
42243 - struct videobuf_dvb_frontend *fe;
42244 - int i;
42245
42246 dprintk( 1, "%s\n", __func__);
42247 dprintk( 1, " ->being probed by Card=%d Name=%s, PCI %02x:%02x\n",
42248 @@ -1267,34 +1258,39 @@
42249 /* If vp3054 isn't enabled, a stub will just return 0 */
42250 err = vp3054_i2c_probe(dev);
42251 if (0 != err)
42252 - goto fail_core;
42253 + goto fail_probe;
42254
42255 /* dvb stuff */
42256 printk(KERN_INFO "%s/2: cx2388x based DVB/ATSC card\n", core->name);
42257 dev->ts_gen_cntrl = 0x0c;
42258
42259 - err = cx8802_alloc_frontends(dev);
42260 - if (err)
42261 - goto fail_core;
42262 -
42263 err = -ENODEV;
42264 - for (i = 1; i <= core->board.num_frontends; i++) {
42265 - fe = videobuf_dvb_get_frontend(&core->dvbdev->frontends, i);
42266 - if (fe == NULL) {
42267 - printk(KERN_ERR "%s() failed to get frontend(%d)\n",
42268 + if (core->board.num_frontends) {
42269 + struct videobuf_dvb_frontend *fe;
42270 + int i;
42271 +
42272 + for (i = 1; i <= core->board.num_frontends; i++) {
42273 + fe = videobuf_dvb_get_frontend(&core->dvbdev->frontends, i);
42274 + if (fe == NULL) {
42275 + printk(KERN_ERR "%s() failed to get frontend(%d)\n",
42276 __func__, i);
42277 - goto fail_probe;
42278 - }
42279 - videobuf_queue_sg_init(&fe->dvb.dvbq, &dvb_qops,
42280 + goto fail_probe;
42281 + }
42282 + videobuf_queue_sg_init(&fe->dvb.dvbq, &dvb_qops,
42283 &dev->pci->dev, &dev->slock,
42284 V4L2_BUF_TYPE_VIDEO_CAPTURE,
42285 V4L2_FIELD_TOP,
42286 sizeof(struct cx88_buffer),
42287 dev);
42288 - /* init struct videobuf_dvb */
42289 - fe->dvb.name = dev->core->name;
42290 + /* init struct videobuf_dvb */
42291 + fe->dvb.name = dev->core->name;
42292 + }
42293 + } else {
42294 + /* no frontends allocated */
42295 + printk(KERN_ERR "%s/2 .num_frontends should be non-zero\n",
42296 + core->name);
42297 + goto fail_core;
42298 }
42299 -
42300 err = dvb_register(dev);
42301 if (err)
42302 /* frontends/adapter de-allocated in dvb_register */
42303 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/cx88/cx88.h linux-2.6.29-rc3.owrt/drivers/media/video/cx88/cx88.h
42304 --- linux-2.6.29.owrt/drivers/media/video/cx88/cx88.h 2009-05-10 22:04:38.000000000 +0200
42305 +++ linux-2.6.29-rc3.owrt/drivers/media/video/cx88/cx88.h 2009-05-10 23:48:28.000000000 +0200
42306 @@ -336,8 +336,8 @@
42307 /* config info -- dvb */
42308 #if defined(CONFIG_VIDEO_CX88_DVB) || defined(CONFIG_VIDEO_CX88_DVB_MODULE)
42309 int (*prev_set_voltage)(struct dvb_frontend *fe, fe_sec_voltage_t voltage);
42310 -#endif
42311 void (*gate_ctrl)(struct cx88_core *core, int open);
42312 +#endif
42313
42314 /* state info */
42315 struct task_struct *kthread;
42316 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/em28xx/em28xx-audio.c linux-2.6.29-rc3.owrt/drivers/media/video/em28xx/em28xx-audio.c
42317 --- linux-2.6.29.owrt/drivers/media/video/em28xx/em28xx-audio.c 2009-05-10 22:04:38.000000000 +0200
42318 +++ linux-2.6.29-rc3.owrt/drivers/media/video/em28xx/em28xx-audio.c 2009-05-10 23:48:28.000000000 +0200
42319 @@ -62,15 +62,9 @@
42320
42321 dprintk("Stopping isoc\n");
42322 for (i = 0; i < EM28XX_AUDIO_BUFS; i++) {
42323 - if (!irqs_disabled())
42324 - usb_kill_urb(dev->adev.urb[i]);
42325 - else
42326 - usb_unlink_urb(dev->adev.urb[i]);
42327 + usb_unlink_urb(dev->adev.urb[i]);
42328 usb_free_urb(dev->adev.urb[i]);
42329 dev->adev.urb[i] = NULL;
42330 -
42331 - kfree(dev->adev.transfer_buffer[i]);
42332 - dev->adev.transfer_buffer[i] = NULL;
42333 }
42334
42335 return 0;
42336 @@ -395,15 +389,11 @@
42337 static snd_pcm_uframes_t snd_em28xx_capture_pointer(struct snd_pcm_substream
42338 *substream)
42339 {
42340 - unsigned long flags;
42341 -
42342 struct em28xx *dev;
42343 - snd_pcm_uframes_t hwptr_done;
42344
42345 + snd_pcm_uframes_t hwptr_done;
42346 dev = snd_pcm_substream_chip(substream);
42347 - spin_lock_irqsave(&dev->adev.slock, flags);
42348 hwptr_done = dev->adev.hwptr_done_capture;
42349 - spin_unlock_irqrestore(&dev->adev.slock, flags);
42350
42351 return hwptr_done;
42352 }
42353 @@ -463,8 +453,6 @@
42354 pcm->info_flags = 0;
42355 pcm->private_data = dev;
42356 strcpy(pcm->name, "Empia 28xx Capture");
42357 -
42358 - snd_card_set_dev(card, &dev->udev->dev);
42359 strcpy(card->driver, "Empia Em28xx Audio");
42360 strcpy(card->shortname, "Em28xx Audio");
42361 strcpy(card->longname, "Empia Em28xx Audio");
42362 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/em28xx/em28xx-cards.c linux-2.6.29-rc3.owrt/drivers/media/video/em28xx/em28xx-cards.c
42363 --- linux-2.6.29.owrt/drivers/media/video/em28xx/em28xx-cards.c 2009-05-10 22:04:38.000000000 +0200
42364 +++ linux-2.6.29-rc3.owrt/drivers/media/video/em28xx/em28xx-cards.c 2009-05-10 23:48:28.000000000 +0200
42365 @@ -102,18 +102,6 @@
42366 /* Board - EM2870 Kworld 355u
42367 Analog - No input analog */
42368
42369 -static struct em28xx_reg_seq kworld_330u_analog[] = {
42370 - {EM28XX_R08_GPIO, 0x6d, ~EM_GPIO_4, 10},
42371 - {EM2880_R04_GPO, 0x00, 0xff, 10},
42372 - { -1, -1, -1, -1},
42373 -};
42374 -
42375 -static struct em28xx_reg_seq kworld_330u_digital[] = {
42376 - {EM28XX_R08_GPIO, 0x6e, ~EM_GPIO_4, 10},
42377 - {EM2880_R04_GPO, 0x08, 0xff, 10},
42378 - { -1, -1, -1, -1},
42379 -};
42380 -
42381 /* Callback for the most boards */
42382 static struct em28xx_reg_seq default_tuner_gpio[] = {
42383 {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10},
42384 @@ -1189,33 +1177,29 @@
42385 .gpio = hauppauge_wintv_hvr_900_analog,
42386 } },
42387 },
42388 - [EM2883_BOARD_KWORLD_HYBRID_330U] = {
42389 + [EM2883_BOARD_KWORLD_HYBRID_A316] = {
42390 .name = "Kworld PlusTV HD Hybrid 330",
42391 .tuner_type = TUNER_XC2028,
42392 .tuner_gpio = default_tuner_gpio,
42393 .decoder = EM28XX_TVP5150,
42394 .mts_firmware = 1,
42395 .has_dvb = 1,
42396 - .dvb_gpio = kworld_330u_digital,
42397 - .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
42398 - .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | EM28XX_I2C_EEPROM_ON_BOARD | EM28XX_I2C_EEPROM_KEY_VALID,
42399 + .dvb_gpio = default_digital,
42400 .input = { {
42401 .type = EM28XX_VMUX_TELEVISION,
42402 .vmux = TVP5150_COMPOSITE0,
42403 .amux = EM28XX_AMUX_VIDEO,
42404 - .gpio = kworld_330u_analog,
42405 - .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
42406 + .gpio = default_analog,
42407 }, {
42408 .type = EM28XX_VMUX_COMPOSITE1,
42409 .vmux = TVP5150_COMPOSITE1,
42410 .amux = EM28XX_AMUX_LINE_IN,
42411 - .gpio = kworld_330u_analog,
42412 - .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
42413 + .gpio = hauppauge_wintv_hvr_900_analog,
42414 }, {
42415 .type = EM28XX_VMUX_SVIDEO,
42416 .vmux = TVP5150_SVIDEO,
42417 .amux = EM28XX_AMUX_LINE_IN,
42418 - .gpio = kworld_330u_analog,
42419 + .gpio = hauppauge_wintv_hvr_900_analog,
42420 } },
42421 },
42422 [EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU] = {
42423 @@ -1265,7 +1249,7 @@
42424 { USB_DEVICE(0xeb1a, 0xe310),
42425 .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD },
42426 { USB_DEVICE(0xeb1a, 0xa316),
42427 - .driver_info = EM2883_BOARD_KWORLD_HYBRID_330U },
42428 + .driver_info = EM2883_BOARD_KWORLD_HYBRID_A316 },
42429 { USB_DEVICE(0xeb1a, 0xe320),
42430 .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD_II },
42431 { USB_DEVICE(0xeb1a, 0xe323),
42432 @@ -1542,10 +1526,6 @@
42433 /* FIXME: Better to specify the needed IF */
42434 ctl->demod = XC3028_FE_DEFAULT;
42435 break;
42436 - case EM2883_BOARD_KWORLD_HYBRID_330U:
42437 - ctl->demod = XC3028_FE_CHINA;
42438 - ctl->fname = XC2028_DEFAULT_FIRMWARE;
42439 - break;
42440 default:
42441 ctl->demod = XC3028_FE_OREN538;
42442 }
42443 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/em28xx/em28xx-core.c linux-2.6.29-rc3.owrt/drivers/media/video/em28xx/em28xx-core.c
42444 --- linux-2.6.29.owrt/drivers/media/video/em28xx/em28xx-core.c 2009-05-10 22:04:38.000000000 +0200
42445 +++ linux-2.6.29-rc3.owrt/drivers/media/video/em28xx/em28xx-core.c 2009-05-10 23:48:28.000000000 +0200
42446 @@ -438,10 +438,6 @@
42447 if (dev->audio_mode.ac97 != EM28XX_NO_AC97) {
42448 int vol;
42449
42450 - em28xx_write_ac97(dev, AC97_POWER_DOWN_CTRL, 0x4200);
42451 - em28xx_write_ac97(dev, AC97_EXT_AUD_CTRL, 0x0031);
42452 - em28xx_write_ac97(dev, AC97_PCM_IN_SRATE, 0xbb80);
42453 -
42454 /* LSB: left channel - both channels with the same level */
42455 vol = (0x1f - dev->volume) | ((0x1f - dev->volume) << 8);
42456
42457 @@ -458,15 +454,6 @@
42458 em28xx_warn("couldn't setup AC97 register %d\n",
42459 outputs[i].reg);
42460 }
42461 -
42462 - if (dev->ctl_aoutput & EM28XX_AOUT_PCM_IN) {
42463 - int sel = ac97_return_record_select(dev->ctl_aoutput);
42464 -
42465 - /* Use the same input for both left and right channels */
42466 - sel |= (sel << 8);
42467 -
42468 - em28xx_write_ac97(dev, AC97_RECORD_SELECT, sel);
42469 - }
42470 }
42471
42472 return ret;
42473 @@ -860,11 +847,8 @@
42474 for (i = 0; i < dev->isoc_ctl.num_bufs; i++) {
42475 urb = dev->isoc_ctl.urb[i];
42476 if (urb) {
42477 - if (!irqs_disabled())
42478 - usb_kill_urb(urb);
42479 - else
42480 - usb_unlink_urb(urb);
42481 -
42482 + usb_kill_urb(urb);
42483 + usb_unlink_urb(urb);
42484 if (dev->isoc_ctl.transfer_buffer[i]) {
42485 usb_buffer_free(dev->udev,
42486 urb->transfer_buffer_length,
42487 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/em28xx/em28xx-dvb.c linux-2.6.29-rc3.owrt/drivers/media/video/em28xx/em28xx-dvb.c
42488 --- linux-2.6.29.owrt/drivers/media/video/em28xx/em28xx-dvb.c 2009-05-10 22:04:38.000000000 +0200
42489 +++ linux-2.6.29-rc3.owrt/drivers/media/video/em28xx/em28xx-dvb.c 2009-05-10 23:48:28.000000000 +0200
42490 @@ -28,7 +28,6 @@
42491
42492 #include "lgdt330x.h"
42493 #include "zl10353.h"
42494 -#include "s5h1409.h"
42495 #ifdef EM28XX_DRX397XD_SUPPORT
42496 #include "drx397xD.h"
42497 #endif
42498 @@ -233,15 +232,6 @@
42499 .if2 = 45600,
42500 };
42501
42502 -static struct s5h1409_config em28xx_s5h1409_with_xc3028 = {
42503 - .demod_address = 0x32 >> 1,
42504 - .output_mode = S5H1409_PARALLEL_OUTPUT,
42505 - .gpio = S5H1409_GPIO_OFF,
42506 - .inversion = S5H1409_INVERSION_OFF,
42507 - .status_mode = S5H1409_DEMODLOCKING,
42508 - .mpeg_timing = S5H1409_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK
42509 -};
42510 -
42511 #ifdef EM28XX_DRX397XD_SUPPORT
42512 /* [TODO] djh - not sure yet what the device config needs to contain */
42513 static struct drx397xD_config em28xx_drx397xD_with_xc3028 = {
42514 @@ -422,6 +412,7 @@
42515 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850:
42516 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950:
42517 case EM2880_BOARD_PINNACLE_PCTV_HD_PRO:
42518 + case EM2883_BOARD_KWORLD_HYBRID_A316:
42519 case EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600:
42520 dvb->frontend = dvb_attach(lgdt330x_attach,
42521 &em2880_lgdt3303_dev,
42522 @@ -442,15 +433,6 @@
42523 goto out_free;
42524 }
42525 break;
42526 - case EM2883_BOARD_KWORLD_HYBRID_330U:
42527 - dvb->frontend = dvb_attach(s5h1409_attach,
42528 - &em28xx_s5h1409_with_xc3028,
42529 - &dev->i2c_adap);
42530 - if (attach_xc3028(0x61, dev) < 0) {
42531 - result = -EINVAL;
42532 - goto out_free;
42533 - }
42534 - break;
42535 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
42536 #ifdef EM28XX_DRX397XD_SUPPORT
42537 /* We don't have the config structure properly populated, so
42538 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/em28xx/em28xx.h linux-2.6.29-rc3.owrt/drivers/media/video/em28xx/em28xx.h
42539 --- linux-2.6.29.owrt/drivers/media/video/em28xx/em28xx.h 2009-05-10 22:04:38.000000000 +0200
42540 +++ linux-2.6.29-rc3.owrt/drivers/media/video/em28xx/em28xx.h 2009-05-10 23:48:28.000000000 +0200
42541 @@ -94,7 +94,7 @@
42542 #define EM2882_BOARD_KWORLD_VS_DVBT 54
42543 #define EM2882_BOARD_TERRATEC_HYBRID_XS 55
42544 #define EM2882_BOARD_PINNACLE_HYBRID_PRO 56
42545 -#define EM2883_BOARD_KWORLD_HYBRID_330U 57
42546 +#define EM2883_BOARD_KWORLD_HYBRID_A316 57
42547 #define EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU 58
42548 #define EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850 60
42549 #define EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2 61
42550 @@ -300,32 +300,13 @@
42551 };
42552
42553 enum em28xx_aout {
42554 - /* AC97 outputs */
42555 EM28XX_AOUT_MASTER = 1 << 0,
42556 EM28XX_AOUT_LINE = 1 << 1,
42557 EM28XX_AOUT_MONO = 1 << 2,
42558 EM28XX_AOUT_LFE = 1 << 3,
42559 EM28XX_AOUT_SURR = 1 << 4,
42560 -
42561 - /* PCM IN Mixer - used by AC97_RECORD_SELECT register */
42562 - EM28XX_AOUT_PCM_IN = 1 << 7,
42563 -
42564 - /* Bits 10-8 are used to indicate the PCM IN record select */
42565 - EM28XX_AOUT_PCM_MIC_PCM = 0 << 8,
42566 - EM28XX_AOUT_PCM_CD = 1 << 8,
42567 - EM28XX_AOUT_PCM_VIDEO = 2 << 8,
42568 - EM28XX_AOUT_PCM_AUX = 3 << 8,
42569 - EM28XX_AOUT_PCM_LINE = 4 << 8,
42570 - EM28XX_AOUT_PCM_STEREO = 5 << 8,
42571 - EM28XX_AOUT_PCM_MONO = 6 << 8,
42572 - EM28XX_AOUT_PCM_PHONE = 7 << 8,
42573 };
42574
42575 -static inline int ac97_return_record_select(int a_out)
42576 -{
42577 - return (a_out & 0x700) >> 8;
42578 -}
42579 -
42580 struct em28xx_reg_seq {
42581 int reg;
42582 unsigned char val, mask;
42583 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/em28xx/em28xx-video.c linux-2.6.29-rc3.owrt/drivers/media/video/em28xx/em28xx-video.c
42584 --- linux-2.6.29.owrt/drivers/media/video/em28xx/em28xx-video.c 2009-05-10 22:04:38.000000000 +0200
42585 +++ linux-2.6.29-rc3.owrt/drivers/media/video/em28xx/em28xx-video.c 2009-05-10 23:48:28.000000000 +0200
42586 @@ -886,10 +886,10 @@
42587 if (0 == INPUT(i)->type)
42588 return -EINVAL;
42589
42590 - dev->ctl_input = i;
42591 -
42592 mutex_lock(&dev->lock);
42593 - video_mux(dev, dev->ctl_input);
42594 +
42595 + video_mux(dev, i);
42596 +
42597 mutex_unlock(&dev->lock);
42598 return 0;
42599 }
42600 @@ -939,12 +939,6 @@
42601 struct em28xx_fh *fh = priv;
42602 struct em28xx *dev = fh->dev;
42603
42604 -
42605 - if (a->index >= MAX_EM28XX_INPUT)
42606 - return -EINVAL;
42607 - if (0 == INPUT(a->index)->type)
42608 - return -EINVAL;
42609 -
42610 mutex_lock(&dev->lock);
42611
42612 dev->ctl_ainput = INPUT(a->index)->amux;
42613 @@ -1956,7 +1950,6 @@
42614
42615 int em28xx_register_analog_devices(struct em28xx *dev)
42616 {
42617 - u8 val;
42618 int ret;
42619
42620 printk(KERN_INFO "%s: v4l2 driver version %d.%d.%d\n",
42621 @@ -1964,34 +1957,34 @@
42622 (EM28XX_VERSION_CODE >> 16) & 0xff,
42623 (EM28XX_VERSION_CODE >> 8) & 0xff, EM28XX_VERSION_CODE & 0xff);
42624
42625 - /* set default norm */
42626 - dev->norm = em28xx_video_template.current_norm;
42627 - dev->width = norm_maxw(dev);
42628 - dev->height = norm_maxh(dev);
42629 - dev->interlaced = EM28XX_INTERLACED_DEFAULT;
42630 - dev->hscale = 0;
42631 - dev->vscale = 0;
42632 - dev->ctl_input = 0;
42633 -
42634 /* Analog specific initialization */
42635 dev->format = &format[0];
42636 - video_mux(dev, dev->ctl_input);
42637 -
42638 - /* Audio defaults */
42639 - dev->mute = 1;
42640 - dev->volume = 0x1f;
42641 + video_mux(dev, 0);
42642
42643 /* enable vbi capturing */
42644
42645 /* em28xx_write_reg(dev, EM28XX_R0E_AUDIOSRC, 0xc0); audio register */
42646 - val = (u8)em28xx_read_reg(dev, EM28XX_R0F_XCLK);
42647 - em28xx_write_reg(dev, EM28XX_R0F_XCLK, (EM28XX_XCLK_AUDIO_UNMUTE | val));
42648 +/* em28xx_write_reg(dev, EM28XX_R0F_XCLK, 0x80); clk register */
42649 em28xx_write_reg(dev, EM28XX_R11_VINCTRL, 0x51);
42650
42651 + dev->mute = 1; /* maybe not the right place... */
42652 + dev->volume = 0x1f;
42653 +
42654 em28xx_set_outfmt(dev);
42655 em28xx_colorlevels_set_default(dev);
42656 em28xx_compression_disable(dev);
42657
42658 + /* set default norm */
42659 + dev->norm = em28xx_video_template.current_norm;
42660 + dev->width = norm_maxw(dev);
42661 + dev->height = norm_maxh(dev);
42662 + dev->interlaced = EM28XX_INTERLACED_DEFAULT;
42663 + dev->hscale = 0;
42664 + dev->vscale = 0;
42665 +
42666 + /* FIXME: This is a very bad hack! Not all devices have TV on input 2 */
42667 + dev->ctl_input = 2;
42668 +
42669 /* allocate and fill video video_device struct */
42670 dev->vdev = em28xx_vdev_init(dev, &em28xx_video_template, "video");
42671 if (!dev->vdev) {
42672 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/gspca/gspca.c linux-2.6.29-rc3.owrt/drivers/media/video/gspca/gspca.c
42673 --- linux-2.6.29.owrt/drivers/media/video/gspca/gspca.c 2009-05-10 22:04:38.000000000 +0200
42674 +++ linux-2.6.29-rc3.owrt/drivers/media/video/gspca/gspca.c 2009-05-10 23:48:28.000000000 +0200
42675 @@ -422,10 +422,8 @@
42676 if (urb == NULL)
42677 break;
42678
42679 - BUG_ON(!gspca_dev->dev);
42680 gspca_dev->urb[i] = NULL;
42681 - if (!gspca_dev->present)
42682 - usb_kill_urb(urb);
42683 + usb_kill_urb(urb);
42684 if (urb->transfer_buffer != NULL)
42685 usb_buffer_free(gspca_dev->dev,
42686 urb->transfer_buffer_length,
42687 @@ -1951,12 +1949,9 @@
42688 {
42689 struct gspca_dev *gspca_dev = usb_get_intfdata(intf);
42690
42691 - mutex_lock(&gspca_dev->usb_lock);
42692 gspca_dev->present = 0;
42693 - mutex_unlock(&gspca_dev->usb_lock);
42694 + gspca_dev->streaming = 0;
42695
42696 - destroy_urbs(gspca_dev);
42697 - gspca_dev->dev = NULL;
42698 usb_set_intfdata(intf, NULL);
42699
42700 /* release the device */
42701 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/gspca/m5602/m5602_s5k4aa.c linux-2.6.29-rc3.owrt/drivers/media/video/gspca/m5602/m5602_s5k4aa.c
42702 --- linux-2.6.29.owrt/drivers/media/video/gspca/m5602/m5602_s5k4aa.c 2009-05-10 22:04:38.000000000 +0200
42703 +++ linux-2.6.29-rc3.owrt/drivers/media/video/gspca/m5602/m5602_s5k4aa.c 2009-05-10 23:48:28.000000000 +0200
42704 @@ -102,11 +102,7 @@
42705 }
42706
42707 /* Test some registers, but we don't know their exact meaning yet */
42708 - if (m5602_read_sensor(sd, 0x00, prod_id, 2))
42709 - return -ENODEV;
42710 - if (m5602_read_sensor(sd, 0x02, prod_id+2, 2))
42711 - return -ENODEV;
42712 - if (m5602_read_sensor(sd, 0x04, prod_id+4, 2))
42713 + if (m5602_read_sensor(sd, 0x00, prod_id, sizeof(prod_id)))
42714 return -ENODEV;
42715
42716 if (memcmp(prod_id, expected_prod_id, sizeof(prod_id)))
42717 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/ivtv/ivtv-driver.c linux-2.6.29-rc3.owrt/drivers/media/video/ivtv/ivtv-driver.c
42718 --- linux-2.6.29.owrt/drivers/media/video/ivtv/ivtv-driver.c 2009-05-10 22:04:38.000000000 +0200
42719 +++ linux-2.6.29-rc3.owrt/drivers/media/video/ivtv/ivtv-driver.c 2009-05-10 23:48:28.000000000 +0200
42720 @@ -949,10 +949,8 @@
42721 itv->instance = atomic_inc_return(&ivtv_instance) - 1;
42722
42723 retval = v4l2_device_register(&dev->dev, &itv->device);
42724 - if (retval) {
42725 - kfree(itv);
42726 + if (retval)
42727 return retval;
42728 - }
42729 /* "ivtv + PCI ID" is a bit of a mouthful, so use
42730 "ivtv + instance" instead. */
42731 snprintf(itv->device.name, sizeof(itv->device.name),
42732 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/ivtv/ivtv-ioctl.c linux-2.6.29-rc3.owrt/drivers/media/video/ivtv/ivtv-ioctl.c
42733 --- linux-2.6.29.owrt/drivers/media/video/ivtv/ivtv-ioctl.c 2009-05-10 22:04:38.000000000 +0200
42734 +++ linux-2.6.29-rc3.owrt/drivers/media/video/ivtv/ivtv-ioctl.c 2009-05-10 23:48:28.000000000 +0200
42735 @@ -393,7 +393,7 @@
42736 return 0;
42737 }
42738
42739 - v4l2_subdev_call(itv->sd_video, video, g_fmt, fmt);
42740 + v4l2_subdev_call(itv->sd_video, video, s_fmt, fmt);
42741 vbifmt->service_set = ivtv_get_service_set(vbifmt);
42742 return 0;
42743 }
42744 @@ -1748,18 +1748,6 @@
42745 break;
42746 }
42747
42748 - case IVTV_IOC_DMA_FRAME:
42749 - case VIDEO_GET_PTS:
42750 - case VIDEO_GET_FRAME_COUNT:
42751 - case VIDEO_GET_EVENT:
42752 - case VIDEO_PLAY:
42753 - case VIDEO_STOP:
42754 - case VIDEO_FREEZE:
42755 - case VIDEO_CONTINUE:
42756 - case VIDEO_COMMAND:
42757 - case VIDEO_TRY_COMMAND:
42758 - return ivtv_decoder_ioctls(file, cmd, (void *)arg);
42759 -
42760 default:
42761 return -EINVAL;
42762 }
42763 @@ -1802,6 +1790,18 @@
42764 ivtv_vapi(itv, CX2341X_DEC_SET_AUDIO_MODE, 2, itv->audio_bilingual_mode, itv->audio_stereo_mode);
42765 return 0;
42766
42767 + case IVTV_IOC_DMA_FRAME:
42768 + case VIDEO_GET_PTS:
42769 + case VIDEO_GET_FRAME_COUNT:
42770 + case VIDEO_GET_EVENT:
42771 + case VIDEO_PLAY:
42772 + case VIDEO_STOP:
42773 + case VIDEO_FREEZE:
42774 + case VIDEO_CONTINUE:
42775 + case VIDEO_COMMAND:
42776 + case VIDEO_TRY_COMMAND:
42777 + return ivtv_decoder_ioctls(filp, cmd, (void *)arg);
42778 +
42779 default:
42780 break;
42781 }
42782 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/pwc/pwc-if.c linux-2.6.29-rc3.owrt/drivers/media/video/pwc/pwc-if.c
42783 --- linux-2.6.29.owrt/drivers/media/video/pwc/pwc-if.c 2009-05-10 22:04:38.000000000 +0200
42784 +++ linux-2.6.29-rc3.owrt/drivers/media/video/pwc/pwc-if.c 2009-05-10 23:48:28.000000000 +0200
42785 @@ -62,6 +62,7 @@
42786 #include <linux/poll.h>
42787 #include <linux/slab.h>
42788 #include <linux/vmalloc.h>
42789 +#include <linux/version.h>
42790 #include <asm/io.h>
42791
42792 #include "pwc.h"
42793 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/pxa_camera.c linux-2.6.29-rc3.owrt/drivers/media/video/pxa_camera.c
42794 --- linux-2.6.29.owrt/drivers/media/video/pxa_camera.c 2009-05-10 22:04:38.000000000 +0200
42795 +++ linux-2.6.29-rc3.owrt/drivers/media/video/pxa_camera.c 2009-05-10 23:48:28.000000000 +0200
42796 @@ -1155,24 +1155,24 @@
42797 {
42798 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
42799 struct pxa_camera_dev *pcdev = ici->priv;
42800 - const struct soc_camera_data_format *cam_fmt = NULL;
42801 - const struct soc_camera_format_xlate *xlate = NULL;
42802 + const struct soc_camera_data_format *host_fmt, *cam_fmt = NULL;
42803 + const struct soc_camera_format_xlate *xlate;
42804 struct soc_camera_sense sense = {
42805 .master_clock = pcdev->mclk,
42806 .pixel_clock_max = pcdev->ciclk / 4,
42807 };
42808 - int ret;
42809 + int ret, buswidth;
42810
42811 - if (pixfmt) {
42812 - xlate = soc_camera_xlate_by_fourcc(icd, pixfmt);
42813 - if (!xlate) {
42814 - dev_warn(&ici->dev, "Format %x not found\n", pixfmt);
42815 - return -EINVAL;
42816 - }
42817 -
42818 - cam_fmt = xlate->cam_fmt;
42819 + xlate = soc_camera_xlate_by_fourcc(icd, pixfmt);
42820 + if (!xlate) {
42821 + dev_warn(&ici->dev, "Format %x not found\n", pixfmt);
42822 + return -EINVAL;
42823 }
42824
42825 + buswidth = xlate->buswidth;
42826 + host_fmt = xlate->host_fmt;
42827 + cam_fmt = xlate->cam_fmt;
42828 +
42829 /* If PCLK is used to latch data from the sensor, check sense */
42830 if (pcdev->platform_flags & PXA_CAMERA_PCLK_EN)
42831 icd->sense = &sense;
42832 @@ -1201,8 +1201,8 @@
42833 }
42834
42835 if (pixfmt && !ret) {
42836 - icd->buswidth = xlate->buswidth;
42837 - icd->current_fmt = xlate->host_fmt;
42838 + icd->buswidth = buswidth;
42839 + icd->current_fmt = host_fmt;
42840 }
42841
42842 return ret;
42843 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/saa7127.c linux-2.6.29-rc3.owrt/drivers/media/video/saa7127.c
42844 --- linux-2.6.29.owrt/drivers/media/video/saa7127.c 2009-05-10 22:04:38.000000000 +0200
42845 +++ linux-2.6.29-rc3.owrt/drivers/media/video/saa7127.c 2009-05-10 23:48:28.000000000 +0200
42846 @@ -149,7 +149,7 @@
42847 { SAA7127_REG_COPYGEN_0, 0x77 },
42848 { SAA7127_REG_COPYGEN_1, 0x41 },
42849 { SAA7127_REG_COPYGEN_2, 0x00 }, /* Macrovision enable/disable */
42850 - { SAA7127_REG_OUTPUT_PORT_CONTROL, 0xbf },
42851 + { SAA7127_REG_OUTPUT_PORT_CONTROL, 0x9e },
42852 { SAA7127_REG_GAIN_LUMINANCE_RGB, 0x00 },
42853 { SAA7127_REG_GAIN_COLORDIFF_RGB, 0x00 },
42854 { SAA7127_REG_INPUT_PORT_CONTROL_1, 0x80 }, /* for color bars */
42855 @@ -488,18 +488,12 @@
42856 break;
42857
42858 case SAA7127_OUTPUT_TYPE_COMPOSITE:
42859 - if (state->ident == V4L2_IDENT_SAA7129)
42860 - state->reg_2d = 0x20; /* CVBS only */
42861 - else
42862 - state->reg_2d = 0x08; /* 00001000 CVBS only, RGB DAC's off (high impedance mode) */
42863 + state->reg_2d = 0x08; /* 00001000 CVBS only, RGB DAC's off (high impedance mode) */
42864 state->reg_3a = 0x13; /* by default switch YUV to RGB-matrix on */
42865 break;
42866
42867 case SAA7127_OUTPUT_TYPE_SVIDEO:
42868 - if (state->ident == V4L2_IDENT_SAA7129)
42869 - state->reg_2d = 0x18; /* Y + C */
42870 - else
42871 - state->reg_2d = 0xff; /*11111111 croma -> R, luma -> CVBS + G + B */
42872 + state->reg_2d = 0xff; /* 11111111 croma -> R, luma -> CVBS + G + B */
42873 state->reg_3a = 0x13; /* by default switch YUV to RGB-matrix on */
42874 break;
42875
42876 @@ -514,10 +508,7 @@
42877 break;
42878
42879 case SAA7127_OUTPUT_TYPE_BOTH:
42880 - if (state->ident == V4L2_IDENT_SAA7129)
42881 - state->reg_2d = 0x38;
42882 - else
42883 - state->reg_2d = 0xbf;
42884 + state->reg_2d = 0xbf;
42885 state->reg_3a = 0x13; /* by default switch YUV to RGB-matrix on */
42886 break;
42887
42888 @@ -740,6 +731,24 @@
42889 return -ENODEV;
42890 }
42891
42892 + /* Configure Encoder */
42893 +
42894 + v4l2_dbg(1, debug, sd, "Configuring encoder\n");
42895 + saa7127_write_inittab(sd, saa7127_init_config_common);
42896 + saa7127_set_std(sd, V4L2_STD_NTSC);
42897 + saa7127_set_output_type(sd, SAA7127_OUTPUT_TYPE_BOTH);
42898 + saa7127_set_vps(sd, &vbi);
42899 + saa7127_set_wss(sd, &vbi);
42900 + saa7127_set_cc(sd, &vbi);
42901 + saa7127_set_xds(sd, &vbi);
42902 + if (test_image == 1)
42903 + /* The Encoder has an internal Colorbar generator */
42904 + /* This can be used for debugging */
42905 + saa7127_set_input_type(sd, SAA7127_INPUT_TYPE_TEST_IMAGE);
42906 + else
42907 + saa7127_set_input_type(sd, SAA7127_INPUT_TYPE_NORMAL);
42908 + saa7127_set_video_enable(sd, 1);
42909 +
42910 if (id->driver_data) { /* Chip type is already known */
42911 state->ident = id->driver_data;
42912 } else { /* Needs detection */
42913 @@ -761,23 +770,6 @@
42914
42915 v4l2_info(sd, "%s found @ 0x%x (%s)\n", client->name,
42916 client->addr << 1, client->adapter->name);
42917 -
42918 - v4l2_dbg(1, debug, sd, "Configuring encoder\n");
42919 - saa7127_write_inittab(sd, saa7127_init_config_common);
42920 - saa7127_set_std(sd, V4L2_STD_NTSC);
42921 - saa7127_set_output_type(sd, SAA7127_OUTPUT_TYPE_BOTH);
42922 - saa7127_set_vps(sd, &vbi);
42923 - saa7127_set_wss(sd, &vbi);
42924 - saa7127_set_cc(sd, &vbi);
42925 - saa7127_set_xds(sd, &vbi);
42926 - if (test_image == 1)
42927 - /* The Encoder has an internal Colorbar generator */
42928 - /* This can be used for debugging */
42929 - saa7127_set_input_type(sd, SAA7127_INPUT_TYPE_TEST_IMAGE);
42930 - else
42931 - saa7127_set_input_type(sd, SAA7127_INPUT_TYPE_NORMAL);
42932 - saa7127_set_video_enable(sd, 1);
42933 -
42934 if (state->ident == V4L2_IDENT_SAA7129)
42935 saa7127_write_inittab(sd, saa7129_init_config_extra);
42936 return 0;
42937 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/saa7134/saa7134-alsa.c linux-2.6.29-rc3.owrt/drivers/media/video/saa7134/saa7134-alsa.c
42938 --- linux-2.6.29.owrt/drivers/media/video/saa7134/saa7134-alsa.c 2009-05-10 22:04:39.000000000 +0200
42939 +++ linux-2.6.29-rc3.owrt/drivers/media/video/saa7134/saa7134-alsa.c 2009-05-10 23:48:28.000000000 +0200
42940 @@ -1089,11 +1089,7 @@
42941
42942 list_for_each(list,&saa7134_devlist) {
42943 dev = list_entry(list, struct saa7134_dev, devlist);
42944 - if (dev->pci->device == PCI_DEVICE_ID_PHILIPS_SAA7130)
42945 - printk(KERN_INFO "%s/alsa: %s doesn't support digital audio\n",
42946 - dev->name, saa7134_boards[dev->board].name);
42947 - else
42948 - alsa_device_init(dev);
42949 + alsa_device_init(dev);
42950 }
42951
42952 if (dev == NULL)
42953 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/saa7134/saa7134-core.c linux-2.6.29-rc3.owrt/drivers/media/video/saa7134/saa7134-core.c
42954 --- linux-2.6.29.owrt/drivers/media/video/saa7134/saa7134-core.c 2009-05-10 22:04:39.000000000 +0200
42955 +++ linux-2.6.29-rc3.owrt/drivers/media/video/saa7134/saa7134-core.c 2009-05-10 23:48:28.000000000 +0200
42956 @@ -660,10 +660,6 @@
42957
42958 saa_writel(SAA7134_IRQ1, 0);
42959 saa_writel(SAA7134_IRQ2, 0);
42960 -
42961 - /* Clear any stale IRQ reports */
42962 - saa_writel(SAA7134_IRQ_REPORT, saa_readl(SAA7134_IRQ_REPORT));
42963 -
42964 mutex_init(&dev->lock);
42965 spin_lock_init(&dev->slock);
42966
42967 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/saa7134/saa7134-dvb.c linux-2.6.29-rc3.owrt/drivers/media/video/saa7134/saa7134-dvb.c
42968 --- linux-2.6.29.owrt/drivers/media/video/saa7134/saa7134-dvb.c 2009-05-10 22:04:38.000000000 +0200
42969 +++ linux-2.6.29-rc3.owrt/drivers/media/video/saa7134/saa7134-dvb.c 2009-05-10 23:48:28.000000000 +0200
42970 @@ -860,7 +860,6 @@
42971 .demod_address = 0x1e>>1,
42972 .no_tuner = 1,
42973 .parallel_ts = 1,
42974 - .disable_i2c_gate_ctrl = 1,
42975 };
42976
42977 /* ==================================================================
42978 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/saa717x.c linux-2.6.29-rc3.owrt/drivers/media/video/saa717x.c
42979 --- linux-2.6.29.owrt/drivers/media/video/saa717x.c 2009-05-10 22:04:38.000000000 +0200
42980 +++ linux-2.6.29-rc3.owrt/drivers/media/video/saa717x.c 2009-05-10 23:48:28.000000000 +0200
42981 @@ -30,6 +30,7 @@
42982 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
42983 */
42984
42985 +#include <linux/version.h>
42986 #include <linux/module.h>
42987 #include <linux/kernel.h>
42988 #include <linux/sched.h>
42989 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/sh_mobile_ceu_camera.c linux-2.6.29-rc3.owrt/drivers/media/video/sh_mobile_ceu_camera.c
42990 --- linux-2.6.29.owrt/drivers/media/video/sh_mobile_ceu_camera.c 2009-05-10 22:04:39.000000000 +0200
42991 +++ linux-2.6.29-rc3.owrt/drivers/media/video/sh_mobile_ceu_camera.c 2009-05-10 23:48:28.000000000 +0200
42992 @@ -603,18 +603,21 @@
42993 const struct soc_camera_format_xlate *xlate;
42994 int ret;
42995
42996 - if (!pixfmt)
42997 - return icd->ops->set_fmt(icd, pixfmt, rect);
42998 -
42999 xlate = soc_camera_xlate_by_fourcc(icd, pixfmt);
43000 if (!xlate) {
43001 dev_warn(&ici->dev, "Format %x not found\n", pixfmt);
43002 return -EINVAL;
43003 }
43004
43005 - ret = icd->ops->set_fmt(icd, xlate->cam_fmt->fourcc, rect);
43006 + switch (pixfmt) {
43007 + case 0: /* Only geometry change */
43008 + ret = icd->ops->set_fmt(icd, pixfmt, rect);
43009 + break;
43010 + default:
43011 + ret = icd->ops->set_fmt(icd, xlate->cam_fmt->fourcc, rect);
43012 + }
43013
43014 - if (!ret) {
43015 + if (pixfmt && !ret) {
43016 icd->buswidth = xlate->buswidth;
43017 icd->current_fmt = xlate->host_fmt;
43018 pcdev->camera_fmt = xlate->cam_fmt;
43019 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/tda9875.c linux-2.6.29-rc3.owrt/drivers/media/video/tda9875.c
43020 --- linux-2.6.29.owrt/drivers/media/video/tda9875.c 2009-05-10 22:04:38.000000000 +0200
43021 +++ linux-2.6.29-rc3.owrt/drivers/media/video/tda9875.c 2009-05-10 23:48:28.000000000 +0200
43022 @@ -242,7 +242,7 @@
43023 static int tda9875_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
43024 {
43025 struct tda9875 *t = to_state(sd);
43026 - int chvol = 0, volume = 0, balance = 0, left, right;
43027 + int chvol=0, volume, balance, left, right;
43028
43029 switch (ctrl->id) {
43030 case V4L2_CID_AUDIO_VOLUME:
43031 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/tvaudio.c linux-2.6.29-rc3.owrt/drivers/media/video/tvaudio.c
43032 --- linux-2.6.29.owrt/drivers/media/video/tvaudio.c 2009-05-10 22:04:38.000000000 +0200
43033 +++ linux-2.6.29-rc3.owrt/drivers/media/video/tvaudio.c 2009-05-10 23:48:28.000000000 +0200
43034 @@ -54,7 +54,7 @@
43035 /* ---------------------------------------------------------------------- */
43036 /* our structs */
43037
43038 -#define MAXREGS 256
43039 +#define MAXREGS 64
43040
43041 struct CHIPSTATE;
43042 typedef int (*getvalue)(int);
43043 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/tveeprom.c linux-2.6.29-rc3.owrt/drivers/media/video/tveeprom.c
43044 --- linux-2.6.29.owrt/drivers/media/video/tveeprom.c 2009-05-10 22:04:39.000000000 +0200
43045 +++ linux-2.6.29-rc3.owrt/drivers/media/video/tveeprom.c 2009-05-10 23:48:28.000000000 +0200
43046 @@ -427,9 +427,6 @@
43047 const char *t_fmt_name2[8] = { " none", "", "", "", "", "", "", "" };
43048
43049 memset(tvee, 0, sizeof(*tvee));
43050 - tvee->tuner_type = TUNER_ABSENT;
43051 - tvee->tuner2_type = TUNER_ABSENT;
43052 -
43053 done = len = beenhere = 0;
43054
43055 /* Different eeprom start offsets for em28xx, cx2388x and cx23418 */
43056 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/tvp514x.c linux-2.6.29-rc3.owrt/drivers/media/video/tvp514x.c
43057 --- linux-2.6.29.owrt/drivers/media/video/tvp514x.c 2009-05-10 22:04:38.000000000 +0200
43058 +++ linux-2.6.29-rc3.owrt/drivers/media/video/tvp514x.c 2009-05-10 23:48:28.000000000 +0200
43059 @@ -1401,7 +1401,7 @@
43060
43061 decoder->pdata = client->dev.platform_data;
43062 if (!decoder->pdata) {
43063 - v4l_err(client, "No platform data!!\n");
43064 + v4l_err(client, "No platform data\n!!");
43065 return -ENODEV;
43066 }
43067 /*
43068 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/upd64031a.c linux-2.6.29-rc3.owrt/drivers/media/video/upd64031a.c
43069 --- linux-2.6.29.owrt/drivers/media/video/upd64031a.c 2009-05-10 22:04:38.000000000 +0200
43070 +++ linux-2.6.29-rc3.owrt/drivers/media/video/upd64031a.c 2009-05-10 23:48:28.000000000 +0200
43071 @@ -21,6 +21,7 @@
43072 */
43073
43074
43075 +#include <linux/version.h>
43076 #include <linux/module.h>
43077 #include <linux/kernel.h>
43078 #include <linux/i2c.h>
43079 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/upd64083.c linux-2.6.29-rc3.owrt/drivers/media/video/upd64083.c
43080 --- linux-2.6.29.owrt/drivers/media/video/upd64083.c 2009-05-10 22:04:38.000000000 +0200
43081 +++ linux-2.6.29-rc3.owrt/drivers/media/video/upd64083.c 2009-05-10 23:48:28.000000000 +0200
43082 @@ -21,6 +21,7 @@
43083 * 02110-1301, USA.
43084 */
43085
43086 +#include <linux/version.h>
43087 #include <linux/module.h>
43088 #include <linux/kernel.h>
43089 #include <linux/i2c.h>
43090 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/usbvision/usbvision-i2c.c linux-2.6.29-rc3.owrt/drivers/media/video/usbvision/usbvision-i2c.c
43091 --- linux-2.6.29.owrt/drivers/media/video/usbvision/usbvision-i2c.c 2009-05-10 22:04:38.000000000 +0200
43092 +++ linux-2.6.29-rc3.owrt/drivers/media/video/usbvision/usbvision-i2c.c 2009-05-10 23:48:28.000000000 +0200
43093 @@ -157,7 +157,7 @@
43094 struct i2c_msg *pmsg;
43095 struct usb_usbvision *usbvision;
43096 int i, ret;
43097 - unsigned char addr = 0;
43098 + unsigned char addr;
43099
43100 usbvision = (struct usb_usbvision *)i2c_get_adapdata(i2c_adap);
43101
43102 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/uvc/uvc_ctrl.c linux-2.6.29-rc3.owrt/drivers/media/video/uvc/uvc_ctrl.c
43103 --- linux-2.6.29.owrt/drivers/media/video/uvc/uvc_ctrl.c 2009-05-10 22:04:38.000000000 +0200
43104 +++ linux-2.6.29-rc3.owrt/drivers/media/video/uvc/uvc_ctrl.c 2009-05-10 23:48:28.000000000 +0200
43105 @@ -1,7 +1,7 @@
43106 /*
43107 * uvc_ctrl.c -- USB Video Class driver - Controls
43108 *
43109 - * Copyright (C) 2005-2009
43110 + * Copyright (C) 2005-2008
43111 * Laurent Pinchart (laurent.pinchart@skynet.be)
43112 *
43113 * This program is free software; you can redistribute it and/or modify
43114 @@ -12,6 +12,7 @@
43115 */
43116
43117 #include <linux/kernel.h>
43118 +#include <linux/version.h>
43119 #include <linux/list.h>
43120 #include <linux/module.h>
43121 #include <linux/uaccess.h>
43122 @@ -28,7 +29,7 @@
43123 #define UVC_CTRL_DATA_BACKUP 1
43124
43125 /* ------------------------------------------------------------------------
43126 - * Controls
43127 + * Control, formats, ...
43128 */
43129
43130 static struct uvc_control_info uvc_ctrls[] = {
43131 @@ -634,7 +635,7 @@
43132 mask = (1 << bits) - 1;
43133 }
43134
43135 - /* Sign-extend the value if needed. */
43136 + /* Sign-extend the value if needed */
43137 if (mapping->data_type == UVC_CTRL_DATA_TYPE_SIGNED)
43138 value |= -(value & (1 << (mapping->size - 1)));
43139
43140 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/uvc/uvc_driver.c linux-2.6.29-rc3.owrt/drivers/media/video/uvc/uvc_driver.c
43141 --- linux-2.6.29.owrt/drivers/media/video/uvc/uvc_driver.c 2009-05-10 22:04:38.000000000 +0200
43142 +++ linux-2.6.29-rc3.owrt/drivers/media/video/uvc/uvc_driver.c 2009-05-10 23:48:28.000000000 +0200
43143 @@ -1,7 +1,7 @@
43144 /*
43145 * uvc_driver.c -- USB Video Class driver
43146 *
43147 - * Copyright (C) 2005-2009
43148 + * Copyright (C) 2005-2008
43149 * Laurent Pinchart (laurent.pinchart@skynet.be)
43150 *
43151 * This program is free software; you can redistribute it and/or modify
43152 @@ -24,6 +24,7 @@
43153 */
43154
43155 #include <linux/kernel.h>
43156 +#include <linux/version.h>
43157 #include <linux/list.h>
43158 #include <linux/module.h>
43159 #include <linux/usb.h>
43160 @@ -48,7 +49,7 @@
43161 unsigned int uvc_trace_param;
43162
43163 /* ------------------------------------------------------------------------
43164 - * Video formats
43165 + * Control, formats, ...
43166 */
43167
43168 static struct uvc_format_desc uvc_fmts[] = {
43169 @@ -473,7 +474,7 @@
43170
43171 /* Several UVC chipsets screw up dwMaxVideoFrameBufferSize
43172 * completely. Observed behaviours range from setting the
43173 - * value to 1.1x the actual frame size to hardwiring the
43174 + * value to 1.1x the actual frame size of hardwiring the
43175 * 16 low bits to 0. This results in a higher than necessary
43176 * memory usage as well as a wrong image size information. For
43177 * uncompressed formats this can be fixed by computing the
43178 @@ -486,7 +487,7 @@
43179 /* Some bogus devices report dwMinFrameInterval equal to
43180 * dwMaxFrameInterval and have dwFrameIntervalStep set to
43181 * zero. Setting all null intervals to 1 fixes the problem and
43182 - * some other divisions by zero that could happen.
43183 + * some other divisions by zero which could happen.
43184 */
43185 for (i = 0; i < n; ++i) {
43186 interval = get_unaligned_le32(&buffer[26+4*i]);
43187 @@ -1199,13 +1200,13 @@
43188 * Scan the UVC descriptors to locate a chain starting at an Output Terminal
43189 * and containing the following units:
43190 *
43191 - * - one Output Terminal (USB Streaming or Display)
43192 + * - a USB Streaming Output Terminal
43193 * - zero or one Processing Unit
43194 * - zero, one or mode single-input Selector Units
43195 * - zero or one multiple-input Selector Units, provided all inputs are
43196 * connected to input terminals
43197 * - zero, one or mode single-input Extension Units
43198 - * - one or more Input Terminals (Camera, External or USB Streaming)
43199 + * - one Camera Input Terminal, or one or more External terminals.
43200 *
43201 * A side forward scan is made on each detected entity to check for additional
43202 * extension units.
43203 @@ -1530,6 +1531,10 @@
43204
43205 /* Set the driver data before calling video_register_device, otherwise
43206 * uvc_v4l2_open might race us.
43207 + *
43208 + * FIXME: usb_set_intfdata hasn't been called so far. Is that a
43209 + * problem ? Does any function which could be called here get
43210 + * a pointer to the usb_interface ?
43211 */
43212 dev->video.vdev = vdev;
43213 video_set_drvdata(vdev, &dev->video);
43214 @@ -1564,7 +1569,7 @@
43215 struct uvc_device *dev = container_of(kref, struct uvc_device, kref);
43216 struct list_head *p, *n;
43217
43218 - /* Unregister the video device. */
43219 + /* Unregister the video device */
43220 uvc_unregister_video(dev);
43221 usb_put_intf(dev->intf);
43222 usb_put_dev(dev->udev);
43223 @@ -1607,7 +1612,7 @@
43224 uvc_trace(UVC_TRACE_PROBE, "Probing generic UVC device %s\n",
43225 udev->devpath);
43226
43227 - /* Allocate memory for the device and initialize it. */
43228 + /* Allocate memory for the device and initialize it */
43229 if ((dev = kzalloc(sizeof *dev, GFP_KERNEL)) == NULL)
43230 return -ENOMEM;
43231
43232 @@ -1628,14 +1633,14 @@
43233 le16_to_cpu(udev->descriptor.idVendor),
43234 le16_to_cpu(udev->descriptor.idProduct));
43235
43236 - /* Parse the Video Class control descriptor. */
43237 + /* Parse the Video Class control descriptor */
43238 if (uvc_parse_control(dev) < 0) {
43239 uvc_trace(UVC_TRACE_PROBE, "Unable to parse UVC "
43240 "descriptors.\n");
43241 goto error;
43242 }
43243
43244 - uvc_printk(KERN_INFO, "Found UVC %u.%02x device %s (%04x:%04x)\n",
43245 + uvc_printk(KERN_INFO, "Found UVC %u.%02u device %s (%04x:%04x)\n",
43246 dev->uvc_version >> 8, dev->uvc_version & 0xff,
43247 udev->product ? udev->product : "<unnamed>",
43248 le16_to_cpu(udev->descriptor.idVendor),
43249 @@ -1648,18 +1653,18 @@
43250 "linux-uvc-devel mailing list.\n");
43251 }
43252
43253 - /* Initialize controls. */
43254 + /* Initialize controls */
43255 if (uvc_ctrl_init_device(dev) < 0)
43256 goto error;
43257
43258 - /* Register the video devices. */
43259 + /* Register the video devices */
43260 if (uvc_register_video(dev) < 0)
43261 goto error;
43262
43263 - /* Save our data pointer in the interface data. */
43264 + /* Save our data pointer in the interface data */
43265 usb_set_intfdata(intf, dev);
43266
43267 - /* Initialize the interrupt URB. */
43268 + /* Initialize the interrupt URB */
43269 if ((ret = uvc_status_init(dev)) < 0) {
43270 uvc_printk(KERN_INFO, "Unable to initialize the status "
43271 "endpoint (%d), status interrupt will not be "
43272 @@ -1834,24 +1839,24 @@
43273 .bInterfaceSubClass = 1,
43274 .bInterfaceProtocol = 0 },
43275 /* Apple Built-In iSight */
43276 - { .match_flags = USB_DEVICE_ID_MATCH_DEVICE
43277 + { .match_flags = USB_DEVICE_ID_MATCH_DEVICE
43278 | USB_DEVICE_ID_MATCH_INT_INFO,
43279 .idVendor = 0x05ac,
43280 .idProduct = 0x8501,
43281 - .bInterfaceClass = USB_CLASS_VIDEO,
43282 - .bInterfaceSubClass = 1,
43283 - .bInterfaceProtocol = 0,
43284 + .bInterfaceClass = USB_CLASS_VIDEO,
43285 + .bInterfaceSubClass = 1,
43286 + .bInterfaceProtocol = 0,
43287 .driver_info = UVC_QUIRK_PROBE_MINMAX
43288 | UVC_QUIRK_BUILTIN_ISIGHT },
43289 /* Genesys Logic USB 2.0 PC Camera */
43290 - { .match_flags = USB_DEVICE_ID_MATCH_DEVICE
43291 + { .match_flags = USB_DEVICE_ID_MATCH_DEVICE
43292 | USB_DEVICE_ID_MATCH_INT_INFO,
43293 - .idVendor = 0x05e3,
43294 - .idProduct = 0x0505,
43295 - .bInterfaceClass = USB_CLASS_VIDEO,
43296 - .bInterfaceSubClass = 1,
43297 - .bInterfaceProtocol = 0,
43298 - .driver_info = UVC_QUIRK_STREAM_NO_FID },
43299 + .idVendor = 0x05e3,
43300 + .idProduct = 0x0505,
43301 + .bInterfaceClass = USB_CLASS_VIDEO,
43302 + .bInterfaceSubClass = 1,
43303 + .bInterfaceProtocol = 0,
43304 + .driver_info = UVC_QUIRK_STREAM_NO_FID },
43305 /* MT6227 */
43306 { .match_flags = USB_DEVICE_ID_MATCH_DEVICE
43307 | USB_DEVICE_ID_MATCH_INT_INFO,
43308 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/uvc/uvc_isight.c linux-2.6.29-rc3.owrt/drivers/media/video/uvc/uvc_isight.c
43309 --- linux-2.6.29.owrt/drivers/media/video/uvc/uvc_isight.c 2009-05-10 22:04:38.000000000 +0200
43310 +++ linux-2.6.29-rc3.owrt/drivers/media/video/uvc/uvc_isight.c 2009-05-10 23:48:28.000000000 +0200
43311 @@ -3,8 +3,6 @@
43312 *
43313 * Copyright (C) 2006-2007
43314 * Ivan N. Zlatev <contact@i-nz.net>
43315 - * Copyright (C) 2008-2009
43316 - * Laurent Pinchart <laurent.pinchart@skynet.be>
43317 *
43318 * This program is free software; you can redistribute it and/or modify
43319 * it under the terms of the GNU General Public License as published by
43320 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/uvc/uvc_queue.c linux-2.6.29-rc3.owrt/drivers/media/video/uvc/uvc_queue.c
43321 --- linux-2.6.29.owrt/drivers/media/video/uvc/uvc_queue.c 2009-05-10 22:04:38.000000000 +0200
43322 +++ linux-2.6.29-rc3.owrt/drivers/media/video/uvc/uvc_queue.c 2009-05-10 23:48:28.000000000 +0200
43323 @@ -1,7 +1,7 @@
43324 /*
43325 * uvc_queue.c -- USB Video Class driver - Buffers management
43326 *
43327 - * Copyright (C) 2005-2009
43328 + * Copyright (C) 2005-2008
43329 * Laurent Pinchart (laurent.pinchart@skynet.be)
43330 *
43331 * This program is free software; you can redistribute it and/or modify
43332 @@ -12,6 +12,7 @@
43333 */
43334
43335 #include <linux/kernel.h>
43336 +#include <linux/version.h>
43337 #include <linux/mm.h>
43338 #include <linux/list.h>
43339 #include <linux/module.h>
43340 @@ -36,22 +37,22 @@
43341 * to user space will return -EBUSY.
43342 *
43343 * Video buffers are managed using two queues. However, unlike most USB video
43344 - * drivers that use an in queue and an out queue, we use a main queue to hold
43345 - * all queued buffers (both 'empty' and 'done' buffers), and an irq queue to
43346 - * hold empty buffers. This design (copied from video-buf) minimizes locking
43347 - * in interrupt, as only one queue is shared between interrupt and user
43348 - * contexts.
43349 + * drivers which use an in queue and an out queue, we use a main queue which
43350 + * holds all queued buffers (both 'empty' and 'done' buffers), and an irq
43351 + * queue which holds empty buffers. This design (copied from video-buf)
43352 + * minimizes locking in interrupt, as only one queue is shared between
43353 + * interrupt and user contexts.
43354 *
43355 * Use cases
43356 * ---------
43357 *
43358 - * Unless stated otherwise, all operations that modify the irq buffers queue
43359 + * Unless stated otherwise, all operations which modify the irq buffers queue
43360 * are protected by the irq spinlock.
43361 *
43362 * 1. The user queues the buffers, starts streaming and dequeues a buffer.
43363 *
43364 * The buffers are added to the main and irq queues. Both operations are
43365 - * protected by the queue lock, and the later is protected by the irq
43366 + * protected by the queue lock, and the latert is protected by the irq
43367 * spinlock as well.
43368 *
43369 * The completion handler fetches a buffer from the irq queue and fills it
43370 @@ -59,7 +60,7 @@
43371 * returns immediately.
43372 *
43373 * When the buffer is full, the completion handler removes it from the irq
43374 - * queue, marks it as ready (UVC_BUF_STATE_DONE) and wakes its wait queue.
43375 + * queue, marks it as ready (UVC_BUF_STATE_DONE) and wake its wait queue.
43376 * At that point, any process waiting on the buffer will be woken up. If a
43377 * process tries to dequeue a buffer after it has been marked ready, the
43378 * dequeing will succeed immediately.
43379 @@ -90,8 +91,8 @@
43380 /*
43381 * Allocate the video buffers.
43382 *
43383 - * Pages are reserved to make sure they will not be swapped, as they will be
43384 - * filled in the URB completion handler.
43385 + * Pages are reserved to make sure they will not be swaped, as they will be
43386 + * filled in URB completion handler.
43387 *
43388 * Buffers will be individually mapped, so they must all be page aligned.
43389 */
43390 @@ -209,8 +210,8 @@
43391 __uvc_query_buffer(&queue->buffer[v4l2_buf->index], v4l2_buf);
43392
43393 done:
43394 - mutex_unlock(&queue->mutex);
43395 - return ret;
43396 + mutex_unlock(&queue->mutex);
43397 + return ret;
43398 }
43399
43400 /*
43401 @@ -235,7 +236,7 @@
43402 }
43403
43404 mutex_lock(&queue->mutex);
43405 - if (v4l2_buf->index >= queue->count) {
43406 + if (v4l2_buf->index >= queue->count) {
43407 uvc_trace(UVC_TRACE_CAPTURE, "[E] Out of range index.\n");
43408 ret = -EINVAL;
43409 goto done;
43410 @@ -428,7 +429,7 @@
43411 * Cancel the video buffers queue.
43412 *
43413 * Cancelling the queue marks all buffers on the irq queue as erroneous,
43414 - * wakes them up and removes them from the queue.
43415 + * wakes them up and remove them from the queue.
43416 *
43417 * If the disconnect parameter is set, further calls to uvc_queue_buffer will
43418 * fail with -ENODEV.
43419 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/uvc/uvc_status.c linux-2.6.29-rc3.owrt/drivers/media/video/uvc/uvc_status.c
43420 --- linux-2.6.29.owrt/drivers/media/video/uvc/uvc_status.c 2009-05-10 22:04:38.000000000 +0200
43421 +++ linux-2.6.29-rc3.owrt/drivers/media/video/uvc/uvc_status.c 2009-05-10 23:48:28.000000000 +0200
43422 @@ -1,7 +1,7 @@
43423 /*
43424 * uvc_status.c -- USB Video Class driver - Status endpoint
43425 *
43426 - * Copyright (C) 2007-2009
43427 + * Copyright (C) 2007-2008
43428 * Laurent Pinchart (laurent.pinchart@skynet.be)
43429 *
43430 * This program is free software; you can redistribute it and/or modify
43431 @@ -12,6 +12,7 @@
43432 */
43433
43434 #include <linux/kernel.h>
43435 +#include <linux/version.h>
43436 #include <linux/input.h>
43437 #include <linux/usb.h>
43438 #include <linux/usb/input.h>
43439 @@ -46,8 +47,8 @@
43440 usb_to_input_id(udev, &input->id);
43441 input->dev.parent = &dev->intf->dev;
43442
43443 - __set_bit(EV_KEY, input->evbit);
43444 - __set_bit(KEY_CAMERA, input->keybit);
43445 + set_bit(EV_KEY, input->evbit);
43446 + set_bit(BTN_0, input->keybit);
43447
43448 if ((ret = input_register_device(input)) < 0)
43449 goto error;
43450 @@ -70,10 +71,8 @@
43451 static void uvc_input_report_key(struct uvc_device *dev, unsigned int code,
43452 int value)
43453 {
43454 - if (dev->input) {
43455 + if (dev->input)
43456 input_report_key(dev->input, code, value);
43457 - input_sync(dev->input);
43458 - }
43459 }
43460
43461 #else
43462 @@ -98,7 +97,7 @@
43463 return;
43464 uvc_trace(UVC_TRACE_STATUS, "Button (intf %u) %s len %d\n",
43465 data[1], data[3] ? "pressed" : "released", len);
43466 - uvc_input_report_key(dev, KEY_CAMERA, data[3]);
43467 + uvc_input_report_key(dev, BTN_0, data[3]);
43468 } else {
43469 uvc_trace(UVC_TRACE_STATUS, "Stream %u error event %02x %02x "
43470 "len %d.\n", data[1], data[2], data[3], len);
43471 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/uvc/uvc_v4l2.c linux-2.6.29-rc3.owrt/drivers/media/video/uvc/uvc_v4l2.c
43472 --- linux-2.6.29.owrt/drivers/media/video/uvc/uvc_v4l2.c 2009-05-10 22:04:38.000000000 +0200
43473 +++ linux-2.6.29-rc3.owrt/drivers/media/video/uvc/uvc_v4l2.c 2009-05-10 23:48:28.000000000 +0200
43474 @@ -1,7 +1,7 @@
43475 /*
43476 * uvc_v4l2.c -- USB Video Class driver - V4L2 API
43477 *
43478 - * Copyright (C) 2005-2009
43479 + * Copyright (C) 2005-2008
43480 * Laurent Pinchart (laurent.pinchart@skynet.be)
43481 *
43482 * This program is free software; you can redistribute it and/or modify
43483 @@ -37,7 +37,7 @@
43484 * must be grouped (for instance the Red Balance, Blue Balance and Do White
43485 * Balance V4L2 controls use the White Balance Component UVC control) or
43486 * otherwise translated. The approach we take here is to use a translation
43487 - * table for the controls that can be mapped directly, and handle the others
43488 + * table for the controls which can be mapped directly, and handle the others
43489 * manually.
43490 */
43491 static int uvc_v4l2_query_menu(struct uvc_video_device *video,
43492 @@ -189,7 +189,7 @@
43493 probe->dwMaxVideoFrameSize =
43494 video->streaming->ctrl.dwMaxVideoFrameSize;
43495
43496 - /* Probe the device. */
43497 + /* Probe the device */
43498 if ((ret = uvc_probe_video(video, probe)) < 0)
43499 goto done;
43500
43501 @@ -354,11 +354,11 @@
43502 *
43503 * Each open instance of a UVC device can either be in a privileged or
43504 * unprivileged state. Only a single instance can be in a privileged state at
43505 - * a given time. Trying to perform an operation that requires privileges will
43506 + * a given time. Trying to perform an operation which requires privileges will
43507 * automatically acquire the required privileges if possible, or return -EBUSY
43508 * otherwise. Privileges are dismissed when closing the instance.
43509 *
43510 - * Operations that require privileges are:
43511 + * Operations which require privileges are:
43512 *
43513 * - VIDIOC_S_INPUT
43514 * - VIDIOC_S_PARM
43515 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/uvc/uvc_video.c linux-2.6.29-rc3.owrt/drivers/media/video/uvc/uvc_video.c
43516 --- linux-2.6.29.owrt/drivers/media/video/uvc/uvc_video.c 2009-05-10 22:04:38.000000000 +0200
43517 +++ linux-2.6.29-rc3.owrt/drivers/media/video/uvc/uvc_video.c 2009-05-10 23:48:28.000000000 +0200
43518 @@ -1,7 +1,7 @@
43519 /*
43520 * uvc_video.c -- USB Video Class driver - Video handling
43521 *
43522 - * Copyright (C) 2005-2009
43523 + * Copyright (C) 2005-2008
43524 * Laurent Pinchart (laurent.pinchart@skynet.be)
43525 *
43526 * This program is free software; you can redistribute it and/or modify
43527 @@ -12,6 +12,7 @@
43528 */
43529
43530 #include <linux/kernel.h>
43531 +#include <linux/version.h>
43532 #include <linux/list.h>
43533 #include <linux/module.h>
43534 #include <linux/usb.h>
43535 @@ -114,7 +115,7 @@
43536 ctrl->wCompQuality = le16_to_cpup((__le16 *)data);
43537 ret = 0;
43538 goto out;
43539 - } else if (query == GET_DEF && probe == 1 && ret != size) {
43540 + } else if (query == GET_DEF && probe == 1) {
43541 /* Many cameras don't support the GET_DEF request on their
43542 * video probe control. Warn once and return, the caller will
43543 * fall back to GET_CUR.
43544 @@ -159,7 +160,7 @@
43545 }
43546
43547 /* Some broken devices return a null or wrong dwMaxVideoFrameSize.
43548 - * Try to get the value from the format and frame descriptors.
43549 + * Try to get the value from the format and frame descriptor.
43550 */
43551 uvc_fixup_buffer_size(video, ctrl);
43552 ret = 0;
43553 @@ -190,6 +191,9 @@
43554 *(__le16 *)&data[12] = cpu_to_le16(ctrl->wCompQuality);
43555 *(__le16 *)&data[14] = cpu_to_le16(ctrl->wCompWindowSize);
43556 *(__le16 *)&data[16] = cpu_to_le16(ctrl->wDelay);
43557 + /* Note: Some of the fields below are not required for IN devices (see
43558 + * UVC spec, 4.3.1.1), but we still copy them in case support for OUT
43559 + * devices is added in the future. */
43560 put_unaligned_le32(ctrl->dwMaxVideoFrameSize, &data[18]);
43561 put_unaligned_le32(ctrl->dwMaxPayloadTransferSize, &data[22]);
43562
43563 @@ -396,7 +400,7 @@
43564 *
43565 * Empty buffers (bytesused == 0) don't trigger end of frame detection
43566 * as it doesn't make sense to return an empty buffer. This also
43567 - * avoids detecting end of frame conditions at FID toggling if the
43568 + * avoids detecting and of frame conditions at FID toggling if the
43569 * previous payload had the EOF bit set.
43570 */
43571 if (fid != video->last_fid && buf->buf.bytesused != 0) {
43572 @@ -449,17 +453,6 @@
43573 }
43574 }
43575
43576 -/* Video payload encoding is handled by uvc_video_encode_header() and
43577 - * uvc_video_encode_data(). Only bulk transfers are currently supported.
43578 - *
43579 - * uvc_video_encode_header is called at the start of a payload. It adds header
43580 - * data to the transfer buffer and returns the header size. As the only known
43581 - * UVC output device transfers a whole frame in a single payload, the EOF bit
43582 - * is always set in the header.
43583 - *
43584 - * uvc_video_encode_data is called for every URB and copies the data from the
43585 - * video buffer to the transfer buffer.
43586 - */
43587 static int uvc_video_encode_header(struct uvc_video_device *video,
43588 struct uvc_buffer *buf, __u8 *data, int len)
43589 {
43590 @@ -960,7 +953,7 @@
43591 }
43592
43593 /*
43594 - * Reconfigure the video interface and restart streaming if it was enabled
43595 + * Reconfigure the video interface and restart streaming if it was enable
43596 * before suspend.
43597 *
43598 * If an error occurs, disable the video queue. This will wake all pending
43599 @@ -992,8 +985,8 @@
43600 */
43601
43602 /*
43603 - * Initialize the UVC video device by switching to alternate setting 0 and
43604 - * retrieve the default format.
43605 + * Initialize the UVC video device by retrieving the default format and
43606 + * committing it.
43607 *
43608 * Some cameras (namely the Fuji Finepix) set the format and frame
43609 * indexes to zero. The UVC standard doesn't clearly make this a spec
43610 @@ -1021,7 +1014,7 @@
43611 */
43612 usb_set_interface(video->dev->udev, video->streaming->intfnum, 0);
43613
43614 - /* Some webcams don't suport GET_DEF requests on the probe control. We
43615 + /* Some webcams don't suport GET_DEF request on the probe control. We
43616 * fall back to GET_CUR if GET_DEF fails.
43617 */
43618 if ((ret = uvc_get_video_ctrl(video, probe, 1, GET_DEF)) < 0 &&
43619 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/uvc/uvcvideo.h linux-2.6.29-rc3.owrt/drivers/media/video/uvc/uvcvideo.h
43620 --- linux-2.6.29.owrt/drivers/media/video/uvc/uvcvideo.h 2009-05-10 22:04:38.000000000 +0200
43621 +++ linux-2.6.29-rc3.owrt/drivers/media/video/uvc/uvcvideo.h 2009-05-10 23:48:28.000000000 +0200
43622 @@ -72,149 +72,149 @@
43623 * UVC constants
43624 */
43625
43626 -#define SC_UNDEFINED 0x00
43627 -#define SC_VIDEOCONTROL 0x01
43628 -#define SC_VIDEOSTREAMING 0x02
43629 -#define SC_VIDEO_INTERFACE_COLLECTION 0x03
43630 -
43631 -#define PC_PROTOCOL_UNDEFINED 0x00
43632 -
43633 -#define CS_UNDEFINED 0x20
43634 -#define CS_DEVICE 0x21
43635 -#define CS_CONFIGURATION 0x22
43636 -#define CS_STRING 0x23
43637 -#define CS_INTERFACE 0x24
43638 -#define CS_ENDPOINT 0x25
43639 +#define SC_UNDEFINED 0x00
43640 +#define SC_VIDEOCONTROL 0x01
43641 +#define SC_VIDEOSTREAMING 0x02
43642 +#define SC_VIDEO_INTERFACE_COLLECTION 0x03
43643 +
43644 +#define PC_PROTOCOL_UNDEFINED 0x00
43645 +
43646 +#define CS_UNDEFINED 0x20
43647 +#define CS_DEVICE 0x21
43648 +#define CS_CONFIGURATION 0x22
43649 +#define CS_STRING 0x23
43650 +#define CS_INTERFACE 0x24
43651 +#define CS_ENDPOINT 0x25
43652
43653 /* VideoControl class specific interface descriptor */
43654 -#define VC_DESCRIPTOR_UNDEFINED 0x00
43655 -#define VC_HEADER 0x01
43656 -#define VC_INPUT_TERMINAL 0x02
43657 -#define VC_OUTPUT_TERMINAL 0x03
43658 -#define VC_SELECTOR_UNIT 0x04
43659 -#define VC_PROCESSING_UNIT 0x05
43660 -#define VC_EXTENSION_UNIT 0x06
43661 +#define VC_DESCRIPTOR_UNDEFINED 0x00
43662 +#define VC_HEADER 0x01
43663 +#define VC_INPUT_TERMINAL 0x02
43664 +#define VC_OUTPUT_TERMINAL 0x03
43665 +#define VC_SELECTOR_UNIT 0x04
43666 +#define VC_PROCESSING_UNIT 0x05
43667 +#define VC_EXTENSION_UNIT 0x06
43668
43669 /* VideoStreaming class specific interface descriptor */
43670 -#define VS_UNDEFINED 0x00
43671 -#define VS_INPUT_HEADER 0x01
43672 -#define VS_OUTPUT_HEADER 0x02
43673 -#define VS_STILL_IMAGE_FRAME 0x03
43674 -#define VS_FORMAT_UNCOMPRESSED 0x04
43675 -#define VS_FRAME_UNCOMPRESSED 0x05
43676 -#define VS_FORMAT_MJPEG 0x06
43677 -#define VS_FRAME_MJPEG 0x07
43678 -#define VS_FORMAT_MPEG2TS 0x0a
43679 -#define VS_FORMAT_DV 0x0c
43680 -#define VS_COLORFORMAT 0x0d
43681 -#define VS_FORMAT_FRAME_BASED 0x10
43682 -#define VS_FRAME_FRAME_BASED 0x11
43683 -#define VS_FORMAT_STREAM_BASED 0x12
43684 +#define VS_UNDEFINED 0x00
43685 +#define VS_INPUT_HEADER 0x01
43686 +#define VS_OUTPUT_HEADER 0x02
43687 +#define VS_STILL_IMAGE_FRAME 0x03
43688 +#define VS_FORMAT_UNCOMPRESSED 0x04
43689 +#define VS_FRAME_UNCOMPRESSED 0x05
43690 +#define VS_FORMAT_MJPEG 0x06
43691 +#define VS_FRAME_MJPEG 0x07
43692 +#define VS_FORMAT_MPEG2TS 0x0a
43693 +#define VS_FORMAT_DV 0x0c
43694 +#define VS_COLORFORMAT 0x0d
43695 +#define VS_FORMAT_FRAME_BASED 0x10
43696 +#define VS_FRAME_FRAME_BASED 0x11
43697 +#define VS_FORMAT_STREAM_BASED 0x12
43698
43699 /* Endpoint type */
43700 -#define EP_UNDEFINED 0x00
43701 -#define EP_GENERAL 0x01
43702 -#define EP_ENDPOINT 0x02
43703 -#define EP_INTERRUPT 0x03
43704 +#define EP_UNDEFINED 0x00
43705 +#define EP_GENERAL 0x01
43706 +#define EP_ENDPOINT 0x02
43707 +#define EP_INTERRUPT 0x03
43708
43709 /* Request codes */
43710 -#define RC_UNDEFINED 0x00
43711 -#define SET_CUR 0x01
43712 -#define GET_CUR 0x81
43713 -#define GET_MIN 0x82
43714 -#define GET_MAX 0x83
43715 -#define GET_RES 0x84
43716 -#define GET_LEN 0x85
43717 -#define GET_INFO 0x86
43718 -#define GET_DEF 0x87
43719 +#define RC_UNDEFINED 0x00
43720 +#define SET_CUR 0x01
43721 +#define GET_CUR 0x81
43722 +#define GET_MIN 0x82
43723 +#define GET_MAX 0x83
43724 +#define GET_RES 0x84
43725 +#define GET_LEN 0x85
43726 +#define GET_INFO 0x86
43727 +#define GET_DEF 0x87
43728
43729 /* VideoControl interface controls */
43730 -#define VC_CONTROL_UNDEFINED 0x00
43731 -#define VC_VIDEO_POWER_MODE_CONTROL 0x01
43732 -#define VC_REQUEST_ERROR_CODE_CONTROL 0x02
43733 +#define VC_CONTROL_UNDEFINED 0x00
43734 +#define VC_VIDEO_POWER_MODE_CONTROL 0x01
43735 +#define VC_REQUEST_ERROR_CODE_CONTROL 0x02
43736
43737 /* Terminal controls */
43738 -#define TE_CONTROL_UNDEFINED 0x00
43739 +#define TE_CONTROL_UNDEFINED 0x00
43740
43741 /* Selector Unit controls */
43742 -#define SU_CONTROL_UNDEFINED 0x00
43743 -#define SU_INPUT_SELECT_CONTROL 0x01
43744 +#define SU_CONTROL_UNDEFINED 0x00
43745 +#define SU_INPUT_SELECT_CONTROL 0x01
43746
43747 /* Camera Terminal controls */
43748 -#define CT_CONTROL_UNDEFINED 0x00
43749 -#define CT_SCANNING_MODE_CONTROL 0x01
43750 -#define CT_AE_MODE_CONTROL 0x02
43751 -#define CT_AE_PRIORITY_CONTROL 0x03
43752 -#define CT_EXPOSURE_TIME_ABSOLUTE_CONTROL 0x04
43753 -#define CT_EXPOSURE_TIME_RELATIVE_CONTROL 0x05
43754 -#define CT_FOCUS_ABSOLUTE_CONTROL 0x06
43755 -#define CT_FOCUS_RELATIVE_CONTROL 0x07
43756 -#define CT_FOCUS_AUTO_CONTROL 0x08
43757 -#define CT_IRIS_ABSOLUTE_CONTROL 0x09
43758 -#define CT_IRIS_RELATIVE_CONTROL 0x0a
43759 -#define CT_ZOOM_ABSOLUTE_CONTROL 0x0b
43760 -#define CT_ZOOM_RELATIVE_CONTROL 0x0c
43761 -#define CT_PANTILT_ABSOLUTE_CONTROL 0x0d
43762 -#define CT_PANTILT_RELATIVE_CONTROL 0x0e
43763 -#define CT_ROLL_ABSOLUTE_CONTROL 0x0f
43764 -#define CT_ROLL_RELATIVE_CONTROL 0x10
43765 -#define CT_PRIVACY_CONTROL 0x11
43766 +#define CT_CONTROL_UNDEFINED 0x00
43767 +#define CT_SCANNING_MODE_CONTROL 0x01
43768 +#define CT_AE_MODE_CONTROL 0x02
43769 +#define CT_AE_PRIORITY_CONTROL 0x03
43770 +#define CT_EXPOSURE_TIME_ABSOLUTE_CONTROL 0x04
43771 +#define CT_EXPOSURE_TIME_RELATIVE_CONTROL 0x05
43772 +#define CT_FOCUS_ABSOLUTE_CONTROL 0x06
43773 +#define CT_FOCUS_RELATIVE_CONTROL 0x07
43774 +#define CT_FOCUS_AUTO_CONTROL 0x08
43775 +#define CT_IRIS_ABSOLUTE_CONTROL 0x09
43776 +#define CT_IRIS_RELATIVE_CONTROL 0x0a
43777 +#define CT_ZOOM_ABSOLUTE_CONTROL 0x0b
43778 +#define CT_ZOOM_RELATIVE_CONTROL 0x0c
43779 +#define CT_PANTILT_ABSOLUTE_CONTROL 0x0d
43780 +#define CT_PANTILT_RELATIVE_CONTROL 0x0e
43781 +#define CT_ROLL_ABSOLUTE_CONTROL 0x0f
43782 +#define CT_ROLL_RELATIVE_CONTROL 0x10
43783 +#define CT_PRIVACY_CONTROL 0x11
43784
43785 /* Processing Unit controls */
43786 -#define PU_CONTROL_UNDEFINED 0x00
43787 -#define PU_BACKLIGHT_COMPENSATION_CONTROL 0x01
43788 -#define PU_BRIGHTNESS_CONTROL 0x02
43789 -#define PU_CONTRAST_CONTROL 0x03
43790 -#define PU_GAIN_CONTROL 0x04
43791 -#define PU_POWER_LINE_FREQUENCY_CONTROL 0x05
43792 -#define PU_HUE_CONTROL 0x06
43793 -#define PU_SATURATION_CONTROL 0x07
43794 -#define PU_SHARPNESS_CONTROL 0x08
43795 -#define PU_GAMMA_CONTROL 0x09
43796 -#define PU_WHITE_BALANCE_TEMPERATURE_CONTROL 0x0a
43797 -#define PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL 0x0b
43798 -#define PU_WHITE_BALANCE_COMPONENT_CONTROL 0x0c
43799 -#define PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL 0x0d
43800 -#define PU_DIGITAL_MULTIPLIER_CONTROL 0x0e
43801 -#define PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL 0x0f
43802 -#define PU_HUE_AUTO_CONTROL 0x10
43803 -#define PU_ANALOG_VIDEO_STANDARD_CONTROL 0x11
43804 -#define PU_ANALOG_LOCK_STATUS_CONTROL 0x12
43805 +#define PU_CONTROL_UNDEFINED 0x00
43806 +#define PU_BACKLIGHT_COMPENSATION_CONTROL 0x01
43807 +#define PU_BRIGHTNESS_CONTROL 0x02
43808 +#define PU_CONTRAST_CONTROL 0x03
43809 +#define PU_GAIN_CONTROL 0x04
43810 +#define PU_POWER_LINE_FREQUENCY_CONTROL 0x05
43811 +#define PU_HUE_CONTROL 0x06
43812 +#define PU_SATURATION_CONTROL 0x07
43813 +#define PU_SHARPNESS_CONTROL 0x08
43814 +#define PU_GAMMA_CONTROL 0x09
43815 +#define PU_WHITE_BALANCE_TEMPERATURE_CONTROL 0x0a
43816 +#define PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL 0x0b
43817 +#define PU_WHITE_BALANCE_COMPONENT_CONTROL 0x0c
43818 +#define PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL 0x0d
43819 +#define PU_DIGITAL_MULTIPLIER_CONTROL 0x0e
43820 +#define PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL 0x0f
43821 +#define PU_HUE_AUTO_CONTROL 0x10
43822 +#define PU_ANALOG_VIDEO_STANDARD_CONTROL 0x11
43823 +#define PU_ANALOG_LOCK_STATUS_CONTROL 0x12
43824
43825 #define LXU_MOTOR_PANTILT_RELATIVE_CONTROL 0x01
43826 #define LXU_MOTOR_PANTILT_RESET_CONTROL 0x02
43827 #define LXU_MOTOR_FOCUS_MOTOR_CONTROL 0x03
43828
43829 /* VideoStreaming interface controls */
43830 -#define VS_CONTROL_UNDEFINED 0x00
43831 -#define VS_PROBE_CONTROL 0x01
43832 -#define VS_COMMIT_CONTROL 0x02
43833 -#define VS_STILL_PROBE_CONTROL 0x03
43834 -#define VS_STILL_COMMIT_CONTROL 0x04
43835 -#define VS_STILL_IMAGE_TRIGGER_CONTROL 0x05
43836 -#define VS_STREAM_ERROR_CODE_CONTROL 0x06
43837 -#define VS_GENERATE_KEY_FRAME_CONTROL 0x07
43838 -#define VS_UPDATE_FRAME_SEGMENT_CONTROL 0x08
43839 -#define VS_SYNC_DELAY_CONTROL 0x09
43840 +#define VS_CONTROL_UNDEFINED 0x00
43841 +#define VS_PROBE_CONTROL 0x01
43842 +#define VS_COMMIT_CONTROL 0x02
43843 +#define VS_STILL_PROBE_CONTROL 0x03
43844 +#define VS_STILL_COMMIT_CONTROL 0x04
43845 +#define VS_STILL_IMAGE_TRIGGER_CONTROL 0x05
43846 +#define VS_STREAM_ERROR_CODE_CONTROL 0x06
43847 +#define VS_GENERATE_KEY_FRAME_CONTROL 0x07
43848 +#define VS_UPDATE_FRAME_SEGMENT_CONTROL 0x08
43849 +#define VS_SYNC_DELAY_CONTROL 0x09
43850
43851 -#define TT_VENDOR_SPECIFIC 0x0100
43852 -#define TT_STREAMING 0x0101
43853 +#define TT_VENDOR_SPECIFIC 0x0100
43854 +#define TT_STREAMING 0x0101
43855
43856 /* Input Terminal types */
43857 -#define ITT_VENDOR_SPECIFIC 0x0200
43858 -#define ITT_CAMERA 0x0201
43859 -#define ITT_MEDIA_TRANSPORT_INPUT 0x0202
43860 +#define ITT_VENDOR_SPECIFIC 0x0200
43861 +#define ITT_CAMERA 0x0201
43862 +#define ITT_MEDIA_TRANSPORT_INPUT 0x0202
43863
43864 /* Output Terminal types */
43865 -#define OTT_VENDOR_SPECIFIC 0x0300
43866 -#define OTT_DISPLAY 0x0301
43867 -#define OTT_MEDIA_TRANSPORT_OUTPUT 0x0302
43868 +#define OTT_VENDOR_SPECIFIC 0x0300
43869 +#define OTT_DISPLAY 0x0301
43870 +#define OTT_MEDIA_TRANSPORT_OUTPUT 0x0302
43871
43872 /* External Terminal types */
43873 -#define EXTERNAL_VENDOR_SPECIFIC 0x0400
43874 -#define COMPOSITE_CONNECTOR 0x0401
43875 -#define SVIDEO_CONNECTOR 0x0402
43876 -#define COMPONENT_CONNECTOR 0x0403
43877 +#define EXTERNAL_VENDOR_SPECIFIC 0x0400
43878 +#define COMPOSITE_CONNECTOR 0x0401
43879 +#define SVIDEO_CONNECTOR 0x0402
43880 +#define COMPONENT_CONNECTOR 0x0403
43881
43882 #define UVC_TERM_INPUT 0x0000
43883 #define UVC_TERM_OUTPUT 0x8000
43884 @@ -541,11 +541,11 @@
43885 };
43886
43887 enum uvc_buffer_state {
43888 - UVC_BUF_STATE_IDLE = 0,
43889 - UVC_BUF_STATE_QUEUED = 1,
43890 - UVC_BUF_STATE_ACTIVE = 2,
43891 - UVC_BUF_STATE_DONE = 3,
43892 - UVC_BUF_STATE_ERROR = 4,
43893 + UVC_BUF_STATE_IDLE = 0,
43894 + UVC_BUF_STATE_QUEUED = 1,
43895 + UVC_BUF_STATE_ACTIVE = 2,
43896 + UVC_BUF_STATE_DONE = 3,
43897 + UVC_BUF_STATE_ERROR = 4,
43898 };
43899
43900 struct uvc_buffer {
43901 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/v4l2-subdev.c linux-2.6.29-rc3.owrt/drivers/media/video/v4l2-subdev.c
43902 --- linux-2.6.29.owrt/drivers/media/video/v4l2-subdev.c 2009-05-10 22:04:38.000000000 +0200
43903 +++ linux-2.6.29-rc3.owrt/drivers/media/video/v4l2-subdev.c 2009-05-10 23:48:28.000000000 +0200
43904 @@ -28,13 +28,13 @@
43905 {
43906 switch (cmd) {
43907 case VIDIOC_QUERYCTRL:
43908 - return v4l2_subdev_call(sd, core, queryctrl, arg);
43909 + return v4l2_subdev_call(sd, core, querymenu, arg);
43910 case VIDIOC_G_CTRL:
43911 return v4l2_subdev_call(sd, core, g_ctrl, arg);
43912 case VIDIOC_S_CTRL:
43913 return v4l2_subdev_call(sd, core, s_ctrl, arg);
43914 case VIDIOC_QUERYMENU:
43915 - return v4l2_subdev_call(sd, core, querymenu, arg);
43916 + return v4l2_subdev_call(sd, core, queryctrl, arg);
43917 case VIDIOC_LOG_STATUS:
43918 return v4l2_subdev_call(sd, core, log_status);
43919 case VIDIOC_DBG_G_CHIP_IDENT:
43920 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/zoran/Kconfig linux-2.6.29-rc3.owrt/drivers/media/video/zoran/Kconfig
43921 --- linux-2.6.29.owrt/drivers/media/video/zoran/Kconfig 2009-05-10 22:04:38.000000000 +0200
43922 +++ linux-2.6.29-rc3.owrt/drivers/media/video/zoran/Kconfig 2009-05-10 23:48:28.000000000 +0200
43923 @@ -68,7 +68,6 @@
43924 tristate "AverMedia 6 Eyes support (EXPERIMENTAL)"
43925 depends on VIDEO_ZORAN_ZR36060 && EXPERIMENTAL && VIDEO_V4L1
43926 select VIDEO_BT856 if VIDEO_HELPER_CHIPS_AUTO
43927 - select VIDEO_BT866 if VIDEO_HELPER_CHIPS_AUTO
43928 select VIDEO_KS0127 if VIDEO_HELPER_CHIPS_AUTO
43929 help
43930 Support for the AverMedia 6 Eyes video surveillance card.
43931 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/zoran/zoran_card.c linux-2.6.29-rc3.owrt/drivers/media/video/zoran/zoran_card.c
43932 --- linux-2.6.29.owrt/drivers/media/video/zoran/zoran_card.c 2009-05-10 22:04:38.000000000 +0200
43933 +++ linux-2.6.29-rc3.owrt/drivers/media/video/zoran/zoran_card.c 2009-05-10 23:48:28.000000000 +0200
43934 @@ -61,17 +61,17 @@
43935
43936 extern const struct zoran_format zoran_formats[];
43937
43938 -static int card[BUZ_MAX] = { [0 ... (BUZ_MAX-1)] = -1 };
43939 +static int card[BUZ_MAX] = { -1, -1, -1, -1 };
43940 module_param_array(card, int, NULL, 0444);
43941 -MODULE_PARM_DESC(card, "Card type");
43942 +MODULE_PARM_DESC(card, "The type of card");
43943
43944 -static int encoder[BUZ_MAX] = { [0 ... (BUZ_MAX-1)] = -1 };
43945 +static int encoder[BUZ_MAX] = { -1, -1, -1, -1 };
43946 module_param_array(encoder, int, NULL, 0444);
43947 -MODULE_PARM_DESC(encoder, "Video encoder chip");
43948 +MODULE_PARM_DESC(encoder, "i2c TV encoder");
43949
43950 -static int decoder[BUZ_MAX] = { [0 ... (BUZ_MAX-1)] = -1 };
43951 +static int decoder[BUZ_MAX] = { -1, -1, -1, -1 };
43952 module_param_array(decoder, int, NULL, 0444);
43953 -MODULE_PARM_DESC(decoder, "Video decoder chip");
43954 +MODULE_PARM_DESC(decoder, "i2c TV decoder");
43955
43956 /*
43957 The video mem address of the video card.
43958 @@ -104,9 +104,9 @@
43959 MODULE_PARM_DESC(default_norm, "Default norm (0=PAL, 1=NTSC, 2=SECAM)");
43960
43961 /* /dev/videoN, -1 for autodetect */
43962 -static int video_nr[BUZ_MAX] = { [0 ... (BUZ_MAX-1)] = -1 };
43963 +static int video_nr[BUZ_MAX] = {-1, -1, -1, -1};
43964 module_param_array(video_nr, int, NULL, 0444);
43965 -MODULE_PARM_DESC(video_nr, "Video device number (-1=Auto)");
43966 +MODULE_PARM_DESC(video_nr, "video device number (-1=Auto)");
43967
43968 /*
43969 Number and size of grab buffers for Video 4 Linux
43970 @@ -153,21 +153,9 @@
43971 MODULE_AUTHOR("Serguei Miridonov");
43972 MODULE_LICENSE("GPL");
43973
43974 -#define ZR_DEVICE(subven, subdev, data) { \
43975 - .vendor = PCI_VENDOR_ID_ZORAN, .device = PCI_DEVICE_ID_ZORAN_36057, \
43976 - .subvendor = (subven), .subdevice = (subdev), .driver_data = (data) }
43977 -
43978 -static struct pci_device_id zr36067_pci_tbl[] = {
43979 - ZR_DEVICE(PCI_VENDOR_ID_MIRO, PCI_DEVICE_ID_MIRO_DC10PLUS, DC10plus),
43980 - ZR_DEVICE(PCI_VENDOR_ID_MIRO, PCI_DEVICE_ID_MIRO_DC30PLUS, DC30plus),
43981 - ZR_DEVICE(PCI_VENDOR_ID_ELECTRONICDESIGNGMBH, PCI_DEVICE_ID_LML_33R10, LML33R10),
43982 - ZR_DEVICE(PCI_VENDOR_ID_IOMEGA, PCI_DEVICE_ID_IOMEGA_BUZ, BUZ),
43983 - ZR_DEVICE(PCI_ANY_ID, PCI_ANY_ID, NUM_CARDS),
43984 - {0}
43985 -};
43986 -MODULE_DEVICE_TABLE(pci, zr36067_pci_tbl);
43987
43988 -static unsigned int zoran_num; /* number of cards found */
43989 +int zoran_num; /* number of Buzs in use */
43990 +struct zoran *zoran[BUZ_MAX];
43991
43992 /* videocodec bus functions ZR36060 */
43993 static u32
43994 @@ -484,6 +472,8 @@
43995 }, {
43996 .type = DC10plus,
43997 .name = "DC10plus",
43998 + .vendor_id = PCI_VENDOR_ID_MIRO,
43999 + .device_id = PCI_DEVICE_ID_MIRO_DC10PLUS,
44000 .i2c_decoder = I2C_DRIVERID_SAA7110,
44001 .i2c_encoder = I2C_DRIVERID_ADV7175,
44002 .video_codec = CODEC_TYPE_ZR36060,
44003 @@ -541,6 +531,8 @@
44004 }, {
44005 .type = DC30plus,
44006 .name = "DC30plus",
44007 + .vendor_id = PCI_VENDOR_ID_MIRO,
44008 + .device_id = PCI_DEVICE_ID_MIRO_DC30PLUS,
44009 .i2c_decoder = I2C_DRIVERID_VPX3220,
44010 .i2c_encoder = I2C_DRIVERID_ADV7175,
44011 .video_codec = CODEC_TYPE_ZR36050,
44012 @@ -597,6 +589,8 @@
44013 }, {
44014 .type = LML33R10,
44015 .name = "LML33R10",
44016 + .vendor_id = PCI_VENDOR_ID_ELECTRONICDESIGNGMBH,
44017 + .device_id = PCI_DEVICE_ID_LML_33R10,
44018 .i2c_decoder = I2C_DRIVERID_SAA7114,
44019 .i2c_encoder = I2C_DRIVERID_ADV7170,
44020 .video_codec = CODEC_TYPE_ZR36060,
44021 @@ -624,6 +618,8 @@
44022 }, {
44023 .type = BUZ,
44024 .name = "Buz",
44025 + .vendor_id = PCI_VENDOR_ID_IOMEGA,
44026 + .device_id = PCI_DEVICE_ID_IOMEGA_BUZ,
44027 .i2c_decoder = I2C_DRIVERID_SAA7111A,
44028 .i2c_encoder = I2C_DRIVERID_SAA7185B,
44029 .video_codec = CODEC_TYPE_ZR36060,
44030 @@ -653,6 +649,8 @@
44031 .name = "6-Eyes",
44032 /* AverMedia chose not to brand the 6-Eyes. Thus it
44033 can't be autodetected, and requires card=x. */
44034 + .vendor_id = -1,
44035 + .device_id = -1,
44036 .i2c_decoder = I2C_DRIVERID_KS0127,
44037 .i2c_encoder = I2C_DRIVERID_BT866,
44038 .video_codec = CODEC_TYPE_ZR36060,
44039 @@ -1140,8 +1138,7 @@
44040 strcpy(zr->video_dev->name, ZR_DEVNAME(zr));
44041 err = video_register_device(zr->video_dev, VFL_TYPE_GRABBER, video_nr[zr->id]);
44042 if (err < 0)
44043 - goto exit_free;
44044 - video_set_drvdata(zr->video_dev, zr);
44045 + goto exit_unregister;
44046
44047 zoran_init_hardware(zr);
44048 if (zr36067_debug > 2)
44049 @@ -1156,19 +1153,19 @@
44050 zr->initialized = 1;
44051 return 0;
44052
44053 +exit_unregister:
44054 + zoran_unregister_i2c(zr);
44055 exit_free:
44056 kfree(zr->stat_com);
44057 kfree(zr->video_dev);
44058 return err;
44059 }
44060
44061 -static void __devexit zoran_remove(struct pci_dev *pdev)
44062 +static void
44063 +zoran_release (struct zoran *zr)
44064 {
44065 - struct zoran *zr = pci_get_drvdata(pdev);
44066 -
44067 if (!zr->initialized)
44068 goto exit_free;
44069 -
44070 /* unregister videocodec bus */
44071 if (zr->codec) {
44072 struct videocodec_master *master = zr->codec->master_data;
44073 @@ -1197,7 +1194,6 @@
44074 pci_disable_device(zr->pci_dev);
44075 video_unregister_device(zr->video_dev);
44076 exit_free:
44077 - pci_set_drvdata(pdev, NULL);
44078 kfree(zr);
44079 }
44080
44081 @@ -1260,329 +1256,338 @@
44082 * Scan for a Buz card (actually for the PCI controller ZR36057),
44083 * request the irq and map the io memory
44084 */
44085 -static int __devinit zoran_probe(struct pci_dev *pdev,
44086 - const struct pci_device_id *ent)
44087 +static int __devinit
44088 +find_zr36057 (void)
44089 {
44090 unsigned char latency, need_latency;
44091 struct zoran *zr;
44092 + struct pci_dev *dev = NULL;
44093 int result;
44094 struct videocodec_master *master_vfe = NULL;
44095 struct videocodec_master *master_codec = NULL;
44096 int card_num;
44097 char *i2c_enc_name, *i2c_dec_name, *codec_name, *vfe_name;
44098 - unsigned int nr;
44099 -
44100 -
44101 - nr = zoran_num++;
44102 - if (nr >= BUZ_MAX) {
44103 - dprintk(1,
44104 - KERN_ERR
44105 - "%s: driver limited to %d card(s) maximum\n",
44106 - ZORAN_NAME, BUZ_MAX);
44107 - return -ENOENT;
44108 - }
44109
44110 - zr = kzalloc(sizeof(struct zoran), GFP_KERNEL);
44111 - if (!zr) {
44112 - dprintk(1,
44113 - KERN_ERR
44114 - "%s: find_zr36057() - kzalloc failed\n",
44115 - ZORAN_NAME);
44116 - return -ENOMEM;
44117 - }
44118 - zr->pci_dev = pdev;
44119 - zr->id = nr;
44120 - snprintf(ZR_DEVNAME(zr), sizeof(ZR_DEVNAME(zr)), "MJPEG[%u]", zr->id);
44121 - spin_lock_init(&zr->spinlock);
44122 - mutex_init(&zr->resource_lock);
44123 - if (pci_enable_device(pdev))
44124 - goto zr_free_mem;
44125 - pci_read_config_byte(zr->pci_dev, PCI_CLASS_REVISION, &zr->revision);
44126 + zoran_num = 0;
44127 + while (zoran_num < BUZ_MAX &&
44128 + (dev = pci_get_device(PCI_VENDOR_ID_ZORAN, PCI_DEVICE_ID_ZORAN_36057, dev)) != NULL) {
44129 + card_num = card[zoran_num];
44130 + zr = kzalloc(sizeof(struct zoran), GFP_KERNEL);
44131 + if (!zr) {
44132 + dprintk(1,
44133 + KERN_ERR
44134 + "%s: find_zr36057() - kzalloc failed\n",
44135 + ZORAN_NAME);
44136 + continue;
44137 + }
44138 + zr->pci_dev = dev;
44139 + //zr->zr36057_mem = NULL;
44140 + zr->id = zoran_num;
44141 + snprintf(ZR_DEVNAME(zr), sizeof(ZR_DEVNAME(zr)), "MJPEG[%u]", zr->id);
44142 + spin_lock_init(&zr->spinlock);
44143 + mutex_init(&zr->resource_lock);
44144 + if (pci_enable_device(dev))
44145 + goto zr_free_mem;
44146 + zr->zr36057_adr = pci_resource_start(zr->pci_dev, 0);
44147 + pci_read_config_byte(zr->pci_dev, PCI_CLASS_REVISION,
44148 + &zr->revision);
44149 + if (zr->revision < 2) {
44150 + dprintk(1,
44151 + KERN_INFO
44152 + "%s: Zoran ZR36057 (rev %d) irq: %d, memory: 0x%08x.\n",
44153 + ZR_DEVNAME(zr), zr->revision, zr->pci_dev->irq,
44154 + zr->zr36057_adr);
44155
44156 - dprintk(1,
44157 - KERN_INFO
44158 - "%s: Zoran ZR360%c7 (rev %d), irq: %d, memory: 0x%08llx\n",
44159 - ZR_DEVNAME(zr), zr->revision < 2 ? '5' : '6', zr->revision,
44160 - zr->pci_dev->irq, (uint64_t)pci_resource_start(zr->pci_dev, 0));
44161 - if (zr->revision >= 2) {
44162 - dprintk(1,
44163 - KERN_INFO
44164 - "%s: Subsystem vendor=0x%04x id=0x%04x\n",
44165 - ZR_DEVNAME(zr), zr->pci_dev->subsystem_vendor,
44166 - zr->pci_dev->subsystem_device);
44167 - }
44168 + if (card_num == -1) {
44169 + dprintk(1,
44170 + KERN_ERR
44171 + "%s: find_zr36057() - no card specified, please use the card=X insmod option\n",
44172 + ZR_DEVNAME(zr));
44173 + goto zr_free_mem;
44174 + }
44175 + } else {
44176 + int i;
44177 + unsigned short ss_vendor, ss_device;
44178
44179 - /* Use auto-detected card type? */
44180 - if (card[nr] == -1) {
44181 - if (zr->revision < 2) {
44182 + ss_vendor = zr->pci_dev->subsystem_vendor;
44183 + ss_device = zr->pci_dev->subsystem_device;
44184 dprintk(1,
44185 - KERN_ERR
44186 - "%s: No card type specified, please use the card=X module parameter\n",
44187 - ZR_DEVNAME(zr));
44188 + KERN_INFO
44189 + "%s: Zoran ZR36067 (rev %d) irq: %d, memory: 0x%08x\n",
44190 + ZR_DEVNAME(zr), zr->revision, zr->pci_dev->irq,
44191 + zr->zr36057_adr);
44192 dprintk(1,
44193 + KERN_INFO
44194 + "%s: subsystem vendor=0x%04x id=0x%04x\n",
44195 + ZR_DEVNAME(zr), ss_vendor, ss_device);
44196 + if (card_num == -1) {
44197 + dprintk(3,
44198 + KERN_DEBUG
44199 + "%s: find_zr36057() - trying to autodetect card type\n",
44200 + ZR_DEVNAME(zr));
44201 + for (i=0;i<NUM_CARDS;i++) {
44202 + if (ss_vendor == zoran_cards[i].vendor_id &&
44203 + ss_device == zoran_cards[i].device_id) {
44204 + dprintk(3,
44205 + KERN_DEBUG
44206 + "%s: find_zr36057() - card %s detected\n",
44207 + ZR_DEVNAME(zr),
44208 + zoran_cards[i].name);
44209 + card_num = i;
44210 + break;
44211 + }
44212 + }
44213 + if (i == NUM_CARDS) {
44214 + dprintk(1,
44215 + KERN_ERR
44216 + "%s: find_zr36057() - unknown card\n",
44217 + ZR_DEVNAME(zr));
44218 + goto zr_free_mem;
44219 + }
44220 + }
44221 + }
44222 +
44223 + if (card_num < 0 || card_num >= NUM_CARDS) {
44224 + dprintk(2,
44225 KERN_ERR
44226 - "%s: It is not possible to auto-detect ZR36057 based cards\n",
44227 - ZR_DEVNAME(zr));
44228 + "%s: find_zr36057() - invalid cardnum %d\n",
44229 + ZR_DEVNAME(zr), card_num);
44230 goto zr_free_mem;
44231 }
44232
44233 - card_num = ent->driver_data;
44234 - if (card_num >= NUM_CARDS) {
44235 + /* even though we make this a non pointer and thus
44236 + * theoretically allow for making changes to this struct
44237 + * on a per-individual card basis at runtime, this is
44238 + * strongly discouraged. This structure is intended to
44239 + * keep general card information, no settings or anything */
44240 + zr->card = zoran_cards[card_num];
44241 + snprintf(ZR_DEVNAME(zr), sizeof(ZR_DEVNAME(zr)),
44242 + "%s[%u]", zr->card.name, zr->id);
44243 +
44244 + zr->zr36057_mem = ioremap_nocache(zr->zr36057_adr, 0x1000);
44245 + if (!zr->zr36057_mem) {
44246 dprintk(1,
44247 KERN_ERR
44248 - "%s: Unknown card, try specifying card=X module parameter\n",
44249 + "%s: find_zr36057() - ioremap failed\n",
44250 ZR_DEVNAME(zr));
44251 goto zr_free_mem;
44252 }
44253 - dprintk(3,
44254 - KERN_DEBUG
44255 - "%s: %s() - card %s detected\n",
44256 - ZR_DEVNAME(zr), __func__, zoran_cards[card_num].name);
44257 - } else {
44258 - card_num = card[nr];
44259 - if (card_num >= NUM_CARDS || card_num < 0) {
44260 - dprintk(1,
44261 - KERN_ERR
44262 - "%s: User specified card type %d out of range (0 .. %d)\n",
44263 - ZR_DEVNAME(zr), card_num, NUM_CARDS - 1);
44264 - goto zr_free_mem;
44265 +
44266 + result = request_irq(zr->pci_dev->irq,
44267 + zoran_irq,
44268 + IRQF_SHARED | IRQF_DISABLED,
44269 + ZR_DEVNAME(zr),
44270 + (void *) zr);
44271 + if (result < 0) {
44272 + if (result == -EINVAL) {
44273 + dprintk(1,
44274 + KERN_ERR
44275 + "%s: find_zr36057() - bad irq number or handler\n",
44276 + ZR_DEVNAME(zr));
44277 + } else if (result == -EBUSY) {
44278 + dprintk(1,
44279 + KERN_ERR
44280 + "%s: find_zr36057() - IRQ %d busy, change your PnP config in BIOS\n",
44281 + ZR_DEVNAME(zr), zr->pci_dev->irq);
44282 + } else {
44283 + dprintk(1,
44284 + KERN_ERR
44285 + "%s: find_zr36057() - can't assign irq, error code %d\n",
44286 + ZR_DEVNAME(zr), result);
44287 + }
44288 + goto zr_unmap;
44289 }
44290 - }
44291
44292 - /* even though we make this a non pointer and thus
44293 - * theoretically allow for making changes to this struct
44294 - * on a per-individual card basis at runtime, this is
44295 - * strongly discouraged. This structure is intended to
44296 - * keep general card information, no settings or anything */
44297 - zr->card = zoran_cards[card_num];
44298 - snprintf(ZR_DEVNAME(zr), sizeof(ZR_DEVNAME(zr)),
44299 - "%s[%u]", zr->card.name, zr->id);
44300 + /* set PCI latency timer */
44301 + pci_read_config_byte(zr->pci_dev, PCI_LATENCY_TIMER,
44302 + &latency);
44303 + need_latency = zr->revision > 1 ? 32 : 48;
44304 + if (latency != need_latency) {
44305 + dprintk(2,
44306 + KERN_INFO
44307 + "%s: Changing PCI latency from %d to %d.\n",
44308 + ZR_DEVNAME(zr), latency, need_latency);
44309 + pci_write_config_byte(zr->pci_dev,
44310 + PCI_LATENCY_TIMER,
44311 + need_latency);
44312 + }
44313
44314 - zr->zr36057_mem = pci_ioremap_bar(zr->pci_dev, 0);
44315 - if (!zr->zr36057_mem) {
44316 - dprintk(1,
44317 - KERN_ERR
44318 - "%s: %s() - ioremap failed\n",
44319 - ZR_DEVNAME(zr), __func__);
44320 - goto zr_free_mem;
44321 - }
44322 + zr36057_restart(zr);
44323 + /* i2c */
44324 + dprintk(2, KERN_INFO "%s: Initializing i2c bus...\n",
44325 + ZR_DEVNAME(zr));
44326
44327 - result = request_irq(zr->pci_dev->irq, zoran_irq,
44328 - IRQF_SHARED | IRQF_DISABLED, ZR_DEVNAME(zr), zr);
44329 - if (result < 0) {
44330 - if (result == -EINVAL) {
44331 - dprintk(1,
44332 - KERN_ERR
44333 - "%s: find_zr36057() - bad irq number or handler\n",
44334 - ZR_DEVNAME(zr));
44335 - } else if (result == -EBUSY) {
44336 - dprintk(1,
44337 - KERN_ERR
44338 - "%s: find_zr36057() - IRQ %d busy, change your PnP config in BIOS\n",
44339 - ZR_DEVNAME(zr), zr->pci_dev->irq);
44340 + /* i2c decoder */
44341 + if (decoder[zr->id] != -1) {
44342 + i2c_dec_name = i2cid_to_modulename(decoder[zr->id]);
44343 + zr->card.i2c_decoder = decoder[zr->id];
44344 + } else if (zr->card.i2c_decoder != 0) {
44345 + i2c_dec_name =
44346 + i2cid_to_modulename(zr->card.i2c_decoder);
44347 } else {
44348 - dprintk(1,
44349 - KERN_ERR
44350 - "%s: find_zr36057() - can't assign irq, error code %d\n",
44351 - ZR_DEVNAME(zr), result);
44352 + i2c_dec_name = NULL;
44353 }
44354 - goto zr_unmap;
44355 - }
44356
44357 - /* set PCI latency timer */
44358 - pci_read_config_byte(zr->pci_dev, PCI_LATENCY_TIMER,
44359 - &latency);
44360 - need_latency = zr->revision > 1 ? 32 : 48;
44361 - if (latency != need_latency) {
44362 - dprintk(2,
44363 - KERN_INFO
44364 - "%s: Changing PCI latency from %d to %d\n",
44365 - ZR_DEVNAME(zr), latency, need_latency);
44366 - pci_write_config_byte(zr->pci_dev, PCI_LATENCY_TIMER,
44367 - need_latency);
44368 - }
44369 -
44370 - zr36057_restart(zr);
44371 - /* i2c */
44372 - dprintk(2, KERN_INFO "%s: Initializing i2c bus...\n",
44373 - ZR_DEVNAME(zr));
44374 -
44375 - /* i2c decoder */
44376 - if (decoder[zr->id] != -1) {
44377 - i2c_dec_name = i2cid_to_modulename(decoder[zr->id]);
44378 - zr->card.i2c_decoder = decoder[zr->id];
44379 - } else if (zr->card.i2c_decoder != 0) {
44380 - i2c_dec_name = i2cid_to_modulename(zr->card.i2c_decoder);
44381 - } else {
44382 - i2c_dec_name = NULL;
44383 - }
44384 + if (i2c_dec_name) {
44385 + if ((result = request_module(i2c_dec_name)) < 0) {
44386 + dprintk(1,
44387 + KERN_ERR
44388 + "%s: failed to load module %s: %d\n",
44389 + ZR_DEVNAME(zr), i2c_dec_name, result);
44390 + }
44391 + }
44392
44393 - if (i2c_dec_name) {
44394 - result = request_module(i2c_dec_name);
44395 - if (result < 0) {
44396 - dprintk(1,
44397 - KERN_ERR
44398 - "%s: failed to load module %s: %d\n",
44399 - ZR_DEVNAME(zr), i2c_dec_name, result);
44400 + /* i2c encoder */
44401 + if (encoder[zr->id] != -1) {
44402 + i2c_enc_name = i2cid_to_modulename(encoder[zr->id]);
44403 + zr->card.i2c_encoder = encoder[zr->id];
44404 + } else if (zr->card.i2c_encoder != 0) {
44405 + i2c_enc_name =
44406 + i2cid_to_modulename(zr->card.i2c_encoder);
44407 + } else {
44408 + i2c_enc_name = NULL;
44409 }
44410 - }
44411
44412 - /* i2c encoder */
44413 - if (encoder[zr->id] != -1) {
44414 - i2c_enc_name = i2cid_to_modulename(encoder[zr->id]);
44415 - zr->card.i2c_encoder = encoder[zr->id];
44416 - } else if (zr->card.i2c_encoder != 0) {
44417 - i2c_enc_name = i2cid_to_modulename(zr->card.i2c_encoder);
44418 - } else {
44419 - i2c_enc_name = NULL;
44420 - }
44421 + if (i2c_enc_name) {
44422 + if ((result = request_module(i2c_enc_name)) < 0) {
44423 + dprintk(1,
44424 + KERN_ERR
44425 + "%s: failed to load module %s: %d\n",
44426 + ZR_DEVNAME(zr), i2c_enc_name, result);
44427 + }
44428 + }
44429
44430 - if (i2c_enc_name) {
44431 - result = request_module(i2c_enc_name);
44432 - if (result < 0) {
44433 + if (zoran_register_i2c(zr) < 0) {
44434 dprintk(1,
44435 KERN_ERR
44436 - "%s: failed to load module %s: %d\n",
44437 - ZR_DEVNAME(zr), i2c_enc_name, result);
44438 + "%s: find_zr36057() - can't initialize i2c bus\n",
44439 + ZR_DEVNAME(zr));
44440 + goto zr_free_irq;
44441 }
44442 - }
44443
44444 - if (zoran_register_i2c(zr) < 0) {
44445 - dprintk(1,
44446 - KERN_ERR
44447 - "%s: find_zr36057() - can't initialize i2c bus\n",
44448 + dprintk(2,
44449 + KERN_INFO "%s: Initializing videocodec bus...\n",
44450 ZR_DEVNAME(zr));
44451 - goto zr_free_irq;
44452 - }
44453 -
44454 - dprintk(2,
44455 - KERN_INFO "%s: Initializing videocodec bus...\n",
44456 - ZR_DEVNAME(zr));
44457
44458 - if (zr->card.video_codec) {
44459 - codec_name = codecid_to_modulename(zr->card.video_codec);
44460 - if (codec_name) {
44461 - result = request_module(codec_name);
44462 - if (result) {
44463 + if (zr->card.video_codec != 0 &&
44464 + (codec_name =
44465 + codecid_to_modulename(zr->card.video_codec)) != NULL) {
44466 + if ((result = request_module(codec_name)) < 0) {
44467 dprintk(1,
44468 KERN_ERR
44469 "%s: failed to load modules %s: %d\n",
44470 ZR_DEVNAME(zr), codec_name, result);
44471 }
44472 }
44473 - }
44474 - if (zr->card.video_vfe) {
44475 - vfe_name = codecid_to_modulename(zr->card.video_vfe);
44476 - if (vfe_name) {
44477 - result = request_module(vfe_name);
44478 - if (result < 0) {
44479 + if (zr->card.video_vfe != 0 &&
44480 + (vfe_name =
44481 + codecid_to_modulename(zr->card.video_vfe)) != NULL) {
44482 + if ((result = request_module(vfe_name)) < 0) {
44483 dprintk(1,
44484 KERN_ERR
44485 "%s: failed to load modules %s: %d\n",
44486 ZR_DEVNAME(zr), vfe_name, result);
44487 }
44488 }
44489 - }
44490
44491 - /* reset JPEG codec */
44492 - jpeg_codec_sleep(zr, 1);
44493 - jpeg_codec_reset(zr);
44494 - /* video bus enabled */
44495 - /* display codec revision */
44496 - if (zr->card.video_codec != 0) {
44497 - master_codec = zoran_setup_videocodec(zr, zr->card.video_codec);
44498 - if (!master_codec)
44499 - goto zr_unreg_i2c;
44500 - zr->codec = videocodec_attach(master_codec);
44501 - if (!zr->codec) {
44502 - dprintk(1,
44503 - KERN_ERR
44504 - "%s: find_zr36057() - no codec found\n",
44505 - ZR_DEVNAME(zr));
44506 - goto zr_free_codec;
44507 - }
44508 - if (zr->codec->type != zr->card.video_codec) {
44509 - dprintk(1,
44510 - KERN_ERR
44511 - "%s: find_zr36057() - wrong codec\n",
44512 - ZR_DEVNAME(zr));
44513 - goto zr_detach_codec;
44514 - }
44515 - }
44516 - if (zr->card.video_vfe != 0) {
44517 - master_vfe = zoran_setup_videocodec(zr, zr->card.video_vfe);
44518 - if (!master_vfe)
44519 - goto zr_detach_codec;
44520 - zr->vfe = videocodec_attach(master_vfe);
44521 - if (!zr->vfe) {
44522 - dprintk(1,
44523 - KERN_ERR
44524 - "%s: find_zr36057() - no VFE found\n",
44525 - ZR_DEVNAME(zr));
44526 - goto zr_free_vfe;
44527 + /* reset JPEG codec */
44528 + jpeg_codec_sleep(zr, 1);
44529 + jpeg_codec_reset(zr);
44530 + /* video bus enabled */
44531 + /* display codec revision */
44532 + if (zr->card.video_codec != 0) {
44533 + master_codec = zoran_setup_videocodec(zr,
44534 + zr->card.video_codec);
44535 + if (!master_codec)
44536 + goto zr_unreg_i2c;
44537 + zr->codec = videocodec_attach(master_codec);
44538 + if (!zr->codec) {
44539 + dprintk(1,
44540 + KERN_ERR
44541 + "%s: find_zr36057() - no codec found\n",
44542 + ZR_DEVNAME(zr));
44543 + goto zr_free_codec;
44544 + }
44545 + if (zr->codec->type != zr->card.video_codec) {
44546 + dprintk(1,
44547 + KERN_ERR
44548 + "%s: find_zr36057() - wrong codec\n",
44549 + ZR_DEVNAME(zr));
44550 + goto zr_detach_codec;
44551 + }
44552 }
44553 - if (zr->vfe->type != zr->card.video_vfe) {
44554 - dprintk(1,
44555 - KERN_ERR
44556 - "%s: find_zr36057() = wrong VFE\n",
44557 - ZR_DEVNAME(zr));
44558 - goto zr_detach_vfe;
44559 + if (zr->card.video_vfe != 0) {
44560 + master_vfe = zoran_setup_videocodec(zr,
44561 + zr->card.video_vfe);
44562 + if (!master_vfe)
44563 + goto zr_detach_codec;
44564 + zr->vfe = videocodec_attach(master_vfe);
44565 + if (!zr->vfe) {
44566 + dprintk(1,
44567 + KERN_ERR
44568 + "%s: find_zr36057() - no VFE found\n",
44569 + ZR_DEVNAME(zr));
44570 + goto zr_free_vfe;
44571 + }
44572 + if (zr->vfe->type != zr->card.video_vfe) {
44573 + dprintk(1,
44574 + KERN_ERR
44575 + "%s: find_zr36057() = wrong VFE\n",
44576 + ZR_DEVNAME(zr));
44577 + goto zr_detach_vfe;
44578 + }
44579 }
44580 - }
44581 -
44582 - /* take care of Natoma chipset and a revision 1 zr36057 */
44583 - if ((pci_pci_problems & PCIPCI_NATOMA) && zr->revision <= 1) {
44584 - zr->jpg_buffers.need_contiguous = 1;
44585 - dprintk(1,
44586 - KERN_INFO
44587 - "%s: ZR36057/Natoma bug, max. buffer size is 128K\n",
44588 - ZR_DEVNAME(zr));
44589 - }
44590 + /* Success so keep the pci_dev referenced */
44591 + pci_dev_get(zr->pci_dev);
44592 + zoran[zoran_num++] = zr;
44593 + continue;
44594
44595 - if (zr36057_init(zr) < 0)
44596 - goto zr_detach_vfe;
44597 -
44598 - zoran_proc_init(zr);
44599 -
44600 - pci_set_drvdata(pdev, zr);
44601 -
44602 - return 0;
44603 -
44604 -zr_detach_vfe:
44605 - videocodec_detach(zr->vfe);
44606 -zr_free_vfe:
44607 - kfree(master_vfe);
44608 -zr_detach_codec:
44609 - videocodec_detach(zr->codec);
44610 -zr_free_codec:
44611 - kfree(master_codec);
44612 -zr_unreg_i2c:
44613 - zoran_unregister_i2c(zr);
44614 -zr_free_irq:
44615 - btwrite(0, ZR36057_SPGPPCR);
44616 - free_irq(zr->pci_dev->irq, zr);
44617 -zr_unmap:
44618 - iounmap(zr->zr36057_mem);
44619 -zr_free_mem:
44620 - kfree(zr);
44621 + // Init errors
44622 + zr_detach_vfe:
44623 + videocodec_detach(zr->vfe);
44624 + zr_free_vfe:
44625 + kfree(master_vfe);
44626 + zr_detach_codec:
44627 + videocodec_detach(zr->codec);
44628 + zr_free_codec:
44629 + kfree(master_codec);
44630 + zr_unreg_i2c:
44631 + zoran_unregister_i2c(zr);
44632 + zr_free_irq:
44633 + btwrite(0, ZR36057_SPGPPCR);
44634 + free_irq(zr->pci_dev->irq, zr);
44635 + zr_unmap:
44636 + iounmap(zr->zr36057_mem);
44637 + zr_free_mem:
44638 + kfree(zr);
44639 + continue;
44640 + }
44641 + if (dev) /* Clean up ref count on early exit */
44642 + pci_dev_put(dev);
44643
44644 - return -ENODEV;
44645 + if (zoran_num == 0) {
44646 + dprintk(1, KERN_INFO "No known MJPEG cards found.\n");
44647 + }
44648 + return zoran_num;
44649 }
44650
44651 -static struct pci_driver zoran_driver = {
44652 - .name = "zr36067",
44653 - .id_table = zr36067_pci_tbl,
44654 - .probe = zoran_probe,
44655 - .remove = zoran_remove,
44656 -};
44657 -
44658 -static int __init zoran_init(void)
44659 +static int __init
44660 +init_dc10_cards (void)
44661 {
44662 - int res;
44663 + int i;
44664
44665 + memset(zoran, 0, sizeof(zoran));
44666 printk(KERN_INFO "Zoran MJPEG board driver version %d.%d.%d\n",
44667 MAJOR_VERSION, MINOR_VERSION, RELEASE_VERSION);
44668
44669 + /* Look for cards */
44670 + if (find_zr36057() < 0) {
44671 + return -EIO;
44672 + }
44673 + if (zoran_num == 0)
44674 + return -ENODEV;
44675 + dprintk(1, KERN_INFO "%s: %d card(s) found\n", ZORAN_NAME,
44676 + zoran_num);
44677 /* check the parameters we have been given, adjust if necessary */
44678 if (v4l_nbufs < 2)
44679 v4l_nbufs = 2;
44680 @@ -1624,22 +1629,37 @@
44681 ZORAN_NAME);
44682 }
44683
44684 - res = pci_register_driver(&zoran_driver);
44685 - if (res) {
44686 - dprintk(1,
44687 - KERN_ERR
44688 - "%s: Unable to register ZR36057 driver\n",
44689 - ZORAN_NAME);
44690 - return res;
44691 + /* take care of Natoma chipset and a revision 1 zr36057 */
44692 + for (i = 0; i < zoran_num; i++) {
44693 + struct zoran *zr = zoran[i];
44694 +
44695 + if ((pci_pci_problems & PCIPCI_NATOMA) && zr->revision <= 1) {
44696 + zr->jpg_buffers.need_contiguous = 1;
44697 + dprintk(1,
44698 + KERN_INFO
44699 + "%s: ZR36057/Natoma bug, max. buffer size is 128K\n",
44700 + ZR_DEVNAME(zr));
44701 + }
44702 +
44703 + if (zr36057_init(zr) < 0) {
44704 + for (i = 0; i < zoran_num; i++)
44705 + zoran_release(zoran[i]);
44706 + return -EIO;
44707 + }
44708 + zoran_proc_init(zr);
44709 }
44710
44711 return 0;
44712 }
44713
44714 -static void __exit zoran_exit(void)
44715 +static void __exit
44716 +unload_dc10_cards (void)
44717 {
44718 - pci_unregister_driver(&zoran_driver);
44719 + int i;
44720 +
44721 + for (i = 0; i < zoran_num; i++)
44722 + zoran_release(zoran[i]);
44723 }
44724
44725 -module_init(zoran_init);
44726 -module_exit(zoran_exit);
44727 +module_init(init_dc10_cards);
44728 +module_exit(unload_dc10_cards);
44729 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/zoran/zoran_card.h linux-2.6.29-rc3.owrt/drivers/media/video/zoran/zoran_card.h
44730 --- linux-2.6.29.owrt/drivers/media/video/zoran/zoran_card.h 2009-05-10 22:04:38.000000000 +0200
44731 +++ linux-2.6.29-rc3.owrt/drivers/media/video/zoran/zoran_card.h 2009-05-10 23:48:28.000000000 +0200
44732 @@ -40,6 +40,8 @@
44733
44734 /* Anybody who uses more than four? */
44735 #define BUZ_MAX 4
44736 +extern int zoran_num;
44737 +extern struct zoran *zoran[BUZ_MAX];
44738
44739 extern struct video_device zoran_template;
44740
44741 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/zoran/zoran_driver.c linux-2.6.29-rc3.owrt/drivers/media/video/zoran/zoran_driver.c
44742 --- linux-2.6.29.owrt/drivers/media/video/zoran/zoran_driver.c 2009-05-10 22:04:38.000000000 +0200
44743 +++ linux-2.6.29-rc3.owrt/drivers/media/video/zoran/zoran_driver.c 2009-05-10 23:48:28.000000000 +0200
44744 @@ -1196,54 +1196,83 @@
44745 * Open a zoran card. Right now the flags stuff is just playing
44746 */
44747
44748 -static int zoran_open(struct file *file)
44749 +static int
44750 +zoran_open(struct file *file)
44751 {
44752 - struct zoran *zr = video_drvdata(file);
44753 + unsigned int minor = video_devdata(file)->minor;
44754 + struct zoran *zr = NULL;
44755 struct zoran_fh *fh;
44756 - int res, first_open = 0;
44757 -
44758 - dprintk(2, KERN_INFO "%s: zoran_open(%s, pid=[%d]), users(-)=%d\n",
44759 - ZR_DEVNAME(zr), current->comm, task_pid_nr(current), zr->user + 1);
44760 + int i, res, first_open = 0, have_module_locks = 0;
44761
44762 lock_kernel();
44763 + /* find the device */
44764 + for (i = 0; i < zoran_num; i++) {
44765 + if (zoran[i]->video_dev->minor == minor) {
44766 + zr = zoran[i];
44767 + break;
44768 + }
44769 + }
44770 +
44771 + if (!zr) {
44772 + dprintk(1, KERN_ERR "%s: device not found!\n", ZORAN_NAME);
44773 + res = -ENODEV;
44774 + goto open_unlock_and_return;
44775 + }
44776
44777 /* see fs/device.c - the kernel already locks during open(),
44778 * so locking ourselves only causes deadlocks */
44779 /*mutex_lock(&zr->resource_lock);*/
44780
44781 - if (zr->user >= 2048) {
44782 - dprintk(1, KERN_ERR "%s: too many users (%d) on device\n",
44783 - ZR_DEVNAME(zr), zr->user);
44784 - res = -EBUSY;
44785 - goto fail_unlock;
44786 - }
44787 -
44788 if (!zr->decoder) {
44789 dprintk(1,
44790 KERN_ERR "%s: no TV decoder loaded for device!\n",
44791 ZR_DEVNAME(zr));
44792 res = -EIO;
44793 - goto fail_unlock;
44794 + goto open_unlock_and_return;
44795 }
44796
44797 + /* try to grab a module lock */
44798 + if (!try_module_get(THIS_MODULE)) {
44799 + dprintk(1,
44800 + KERN_ERR
44801 + "%s: failed to acquire my own lock! PANIC!\n",
44802 + ZR_DEVNAME(zr));
44803 + res = -ENODEV;
44804 + goto open_unlock_and_return;
44805 + }
44806 if (!try_module_get(zr->decoder->driver->driver.owner)) {
44807 dprintk(1,
44808 KERN_ERR
44809 - "%s: failed to grab ownership of video decoder\n",
44810 + "%s: failed to grab ownership of i2c decoder\n",
44811 ZR_DEVNAME(zr));
44812 res = -EIO;
44813 - goto fail_unlock;
44814 + module_put(THIS_MODULE);
44815 + goto open_unlock_and_return;
44816 }
44817 if (zr->encoder &&
44818 !try_module_get(zr->encoder->driver->driver.owner)) {
44819 dprintk(1,
44820 KERN_ERR
44821 - "%s: failed to grab ownership of video encoder\n",
44822 + "%s: failed to grab ownership of i2c encoder\n",
44823 ZR_DEVNAME(zr));
44824 res = -EIO;
44825 - goto fail_decoder;
44826 + module_put(zr->decoder->driver->driver.owner);
44827 + module_put(THIS_MODULE);
44828 + goto open_unlock_and_return;
44829 + }
44830 +
44831 + have_module_locks = 1;
44832 +
44833 + if (zr->user >= 2048) {
44834 + dprintk(1, KERN_ERR "%s: too many users (%d) on device\n",
44835 + ZR_DEVNAME(zr), zr->user);
44836 + res = -EBUSY;
44837 + goto open_unlock_and_return;
44838 }
44839
44840 + dprintk(1, KERN_INFO "%s: zoran_open(%s, pid=[%d]), users(-)=%d\n",
44841 + ZR_DEVNAME(zr), current->comm, task_pid_nr(current), zr->user);
44842 +
44843 /* now, create the open()-specific file_ops struct */
44844 fh = kzalloc(sizeof(struct zoran_fh), GFP_KERNEL);
44845 if (!fh) {
44846 @@ -1252,7 +1281,7 @@
44847 "%s: zoran_open() - allocation of zoran_fh failed\n",
44848 ZR_DEVNAME(zr));
44849 res = -ENOMEM;
44850 - goto fail_encoder;
44851 + goto open_unlock_and_return;
44852 }
44853 /* used to be BUZ_MAX_WIDTH/HEIGHT, but that gives overflows
44854 * on norm-change! */
44855 @@ -1263,8 +1292,9 @@
44856 KERN_ERR
44857 "%s: zoran_open() - allocation of overlay_mask failed\n",
44858 ZR_DEVNAME(zr));
44859 + kfree(fh);
44860 res = -ENOMEM;
44861 - goto fail_fh;
44862 + goto open_unlock_and_return;
44863 }
44864
44865 if (zr->user++ == 0)
44866 @@ -1289,18 +1319,21 @@
44867
44868 return 0;
44869
44870 -fail_fh:
44871 - kfree(fh);
44872 -fail_encoder:
44873 - if (zr->encoder)
44874 - module_put(zr->encoder->driver->driver.owner);
44875 -fail_decoder:
44876 - module_put(zr->decoder->driver->driver.owner);
44877 -fail_unlock:
44878 - unlock_kernel();
44879 +open_unlock_and_return:
44880 + /* if we grabbed locks, release them accordingly */
44881 + if (have_module_locks) {
44882 + module_put(zr->decoder->driver->driver.owner);
44883 + if (zr->encoder) {
44884 + module_put(zr->encoder->driver->driver.owner);
44885 + }
44886 + module_put(THIS_MODULE);
44887 + }
44888
44889 - dprintk(2, KERN_INFO "%s: open failed (%d), users(-)=%d\n",
44890 - ZR_DEVNAME(zr), res, zr->user);
44891 + /* if there's no device found, we didn't obtain the lock either */
44892 + if (zr) {
44893 + /*mutex_unlock(&zr->resource_lock);*/
44894 + }
44895 + unlock_kernel();
44896
44897 return res;
44898 }
44899 @@ -1311,8 +1344,8 @@
44900 struct zoran_fh *fh = file->private_data;
44901 struct zoran *zr = fh->zr;
44902
44903 - dprintk(2, KERN_INFO "%s: zoran_close(%s, pid=[%d]), users(+)=%d\n",
44904 - ZR_DEVNAME(zr), current->comm, task_pid_nr(current), zr->user - 1);
44905 + dprintk(1, KERN_INFO "%s: zoran_close(%s, pid=[%d]), users(+)=%d\n",
44906 + ZR_DEVNAME(zr), current->comm, task_pid_nr(current), zr->user);
44907
44908 /* kernel locks (fs/device.c), so don't do that ourselves
44909 * (prevents deadlocks) */
44910 @@ -1358,8 +1391,10 @@
44911
44912 /* release locks on the i2c modules */
44913 module_put(zr->decoder->driver->driver.owner);
44914 - if (zr->encoder)
44915 - module_put(zr->encoder->driver->driver.owner);
44916 + if (zr->encoder) {
44917 + module_put(zr->encoder->driver->driver.owner);
44918 + }
44919 + module_put(THIS_MODULE);
44920
44921 /*mutex_unlock(&zr->resource_lock);*/
44922
44923 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/media/video/zoran/zoran.h linux-2.6.29-rc3.owrt/drivers/media/video/zoran/zoran.h
44924 --- linux-2.6.29.owrt/drivers/media/video/zoran/zoran.h 2009-05-10 22:04:38.000000000 +0200
44925 +++ linux-2.6.29-rc3.owrt/drivers/media/video/zoran/zoran.h 2009-05-10 23:48:28.000000000 +0200
44926 @@ -349,6 +349,7 @@
44927 u16 i2c_decoder, i2c_encoder; /* I2C types */
44928 u16 video_vfe, video_codec; /* videocodec types */
44929 u16 audio_chip; /* audio type */
44930 + u16 vendor_id, device_id; /* subsystem vendor/device ID */
44931
44932 int inputs; /* number of video inputs */
44933 struct input {
44934 @@ -400,6 +401,7 @@
44935 char name[32]; /* name of this device */
44936 struct pci_dev *pci_dev; /* PCI device */
44937 unsigned char revision; /* revision of zr36057 */
44938 + unsigned int zr36057_adr; /* bus address of IO mem returned by PCI BIOS */
44939 unsigned char __iomem *zr36057_mem;/* pointer to mapped IO memory */
44940
44941 spinlock_t spinlock; /* Spinlock */
44942 @@ -488,10 +490,16 @@
44943 wait_queue_head_t test_q;
44944 };
44945
44946 -/* There was something called _ALPHA_BUZ that used the PCI address instead of
44947 - * the kernel iomapped address for btread/btwrite. */
44948 +/*The following should be done in more portable way. It depends on define
44949 + of _ALPHA_BUZ in the Makefile.*/
44950 +
44951 +#ifdef _ALPHA_BUZ
44952 +#define btwrite(dat,adr) writel((dat), zr->zr36057_adr+(adr))
44953 +#define btread(adr) readl(zr->zr36057_adr+(adr))
44954 +#else
44955 #define btwrite(dat,adr) writel((dat), zr->zr36057_mem+(adr))
44956 #define btread(adr) readl(zr->zr36057_mem+(adr))
44957 +#endif
44958
44959 #define btand(dat,adr) btwrite((dat) & btread(adr), adr)
44960 #define btor(dat,adr) btwrite((dat) | btread(adr), adr)
44961 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/message/fusion/mptbase.c linux-2.6.29-rc3.owrt/drivers/message/fusion/mptbase.c
44962 --- linux-2.6.29.owrt/drivers/message/fusion/mptbase.c 2009-05-10 22:04:39.000000000 +0200
44963 +++ linux-2.6.29-rc3.owrt/drivers/message/fusion/mptbase.c 2009-05-10 23:48:28.000000000 +0200
44964 @@ -91,9 +91,9 @@
44965 controllers (default=0)");
44966
44967 static int mpt_msi_enable_sas;
44968 -module_param(mpt_msi_enable_sas, int, 0);
44969 +module_param(mpt_msi_enable_sas, int, 1);
44970 MODULE_PARM_DESC(mpt_msi_enable_sas, " Enable MSI Support for SAS \
44971 - controllers (default=0)");
44972 + controllers (default=1)");
44973
44974
44975 static int mpt_channel_mapping;
44976 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mfd/htc-egpio.c linux-2.6.29-rc3.owrt/drivers/mfd/htc-egpio.c
44977 --- linux-2.6.29.owrt/drivers/mfd/htc-egpio.c 2009-05-10 22:04:38.000000000 +0200
44978 +++ linux-2.6.29-rc3.owrt/drivers/mfd/htc-egpio.c 2009-05-10 23:48:28.000000000 +0200
44979 @@ -286,7 +286,7 @@
44980 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
44981 if (!res)
44982 goto fail;
44983 - ei->base_addr = ioremap_nocache(res->start, resource_size(res));
44984 + ei->base_addr = ioremap_nocache(res->start, res->end - res->start);
44985 if (!ei->base_addr)
44986 goto fail;
44987 pr_debug("EGPIO phys=%08x virt=%p\n", (u32)res->start, ei->base_addr);
44988 @@ -307,7 +307,7 @@
44989
44990 ei->nchips = pdata->num_chips;
44991 ei->chip = kzalloc(sizeof(struct egpio_chip) * ei->nchips, GFP_KERNEL);
44992 - if (!ei->chip) {
44993 + if (!ei) {
44994 ret = -ENOMEM;
44995 goto fail;
44996 }
44997 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mfd/pcf50633-core.c linux-2.6.29-rc3.owrt/drivers/mfd/pcf50633-core.c
44998 --- linux-2.6.29.owrt/drivers/mfd/pcf50633-core.c 2009-05-10 22:04:38.000000000 +0200
44999 +++ linux-2.6.29-rc3.owrt/drivers/mfd/pcf50633-core.c 2009-05-10 23:48:28.000000000 +0200
45000 @@ -626,6 +626,7 @@
45001 }
45002
45003 if (client->irq) {
45004 + set_irq_handler(client->irq, handle_level_irq);
45005 ret = request_irq(client->irq, pcf50633_irq,
45006 IRQF_TRIGGER_LOW, "pcf50633", pcf);
45007
45008 @@ -678,7 +679,6 @@
45009
45010 static struct i2c_device_id pcf50633_id_table[] = {
45011 {"pcf50633", 0x73},
45012 - {/* end of list */}
45013 };
45014
45015 static struct i2c_driver pcf50633_driver = {
45016 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mfd/sm501.c linux-2.6.29-rc3.owrt/drivers/mfd/sm501.c
45017 --- linux-2.6.29.owrt/drivers/mfd/sm501.c 2009-05-10 22:04:38.000000000 +0200
45018 +++ linux-2.6.29-rc3.owrt/drivers/mfd/sm501.c 2009-05-10 23:48:28.000000000 +0200
45019 @@ -1050,7 +1050,7 @@
45020 return gpiochip_add(gchip);
45021 }
45022
45023 -static int __devinit sm501_register_gpio(struct sm501_devdata *sm)
45024 +static int sm501_register_gpio(struct sm501_devdata *sm)
45025 {
45026 struct sm501_gpio *gpio = &sm->gpio;
45027 resource_size_t iobase = sm->io_res->start + SM501_GPIO;
45028 @@ -1321,7 +1321,7 @@
45029 * Common init code for an SM501
45030 */
45031
45032 -static int __devinit sm501_init_dev(struct sm501_devdata *sm)
45033 +static int sm501_init_dev(struct sm501_devdata *sm)
45034 {
45035 struct sm501_initdata *idata;
45036 struct sm501_platdata *pdata;
45037 @@ -1397,7 +1397,7 @@
45038 return 0;
45039 }
45040
45041 -static int __devinit sm501_plat_probe(struct platform_device *dev)
45042 +static int sm501_plat_probe(struct platform_device *dev)
45043 {
45044 struct sm501_devdata *sm;
45045 int ret;
45046 @@ -1586,8 +1586,8 @@
45047 .gpio_base = -1,
45048 };
45049
45050 -static int __devinit sm501_pci_probe(struct pci_dev *dev,
45051 - const struct pci_device_id *id)
45052 +static int sm501_pci_probe(struct pci_dev *dev,
45053 + const struct pci_device_id *id)
45054 {
45055 struct sm501_devdata *sm;
45056 int err;
45057 @@ -1693,7 +1693,7 @@
45058 sm501_gpio_remove(sm);
45059 }
45060
45061 -static void __devexit sm501_pci_remove(struct pci_dev *dev)
45062 +static void sm501_pci_remove(struct pci_dev *dev)
45063 {
45064 struct sm501_devdata *sm = pci_get_drvdata(dev);
45065
45066 @@ -1727,16 +1727,16 @@
45067
45068 MODULE_DEVICE_TABLE(pci, sm501_pci_tbl);
45069
45070 -static struct pci_driver sm501_pci_driver = {
45071 +static struct pci_driver sm501_pci_drv = {
45072 .name = "sm501",
45073 .id_table = sm501_pci_tbl,
45074 .probe = sm501_pci_probe,
45075 - .remove = __devexit_p(sm501_pci_remove),
45076 + .remove = sm501_pci_remove,
45077 };
45078
45079 MODULE_ALIAS("platform:sm501");
45080
45081 -static struct platform_driver sm501_plat_driver = {
45082 +static struct platform_driver sm501_plat_drv = {
45083 .driver = {
45084 .name = "sm501",
45085 .owner = THIS_MODULE,
45086 @@ -1749,14 +1749,14 @@
45087
45088 static int __init sm501_base_init(void)
45089 {
45090 - platform_driver_register(&sm501_plat_driver);
45091 - return pci_register_driver(&sm501_pci_driver);
45092 + platform_driver_register(&sm501_plat_drv);
45093 + return pci_register_driver(&sm501_pci_drv);
45094 }
45095
45096 static void __exit sm501_base_exit(void)
45097 {
45098 - platform_driver_unregister(&sm501_plat_driver);
45099 - pci_unregister_driver(&sm501_pci_driver);
45100 + platform_driver_unregister(&sm501_plat_drv);
45101 + pci_unregister_driver(&sm501_pci_drv);
45102 }
45103
45104 module_init(sm501_base_init);
45105 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mfd/twl4030-core.c linux-2.6.29-rc3.owrt/drivers/mfd/twl4030-core.c
45106 --- linux-2.6.29.owrt/drivers/mfd/twl4030-core.c 2009-05-10 22:04:38.000000000 +0200
45107 +++ linux-2.6.29-rc3.owrt/drivers/mfd/twl4030-core.c 2009-05-10 23:48:28.000000000 +0200
45108 @@ -38,7 +38,7 @@
45109 #include <linux/i2c.h>
45110 #include <linux/i2c/twl4030.h>
45111
45112 -#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
45113 +#ifdef CONFIG_ARM
45114 #include <mach/cpu.h>
45115 #endif
45116
45117 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mfd/wm8350-core.c linux-2.6.29-rc3.owrt/drivers/mfd/wm8350-core.c
45118 --- linux-2.6.29.owrt/drivers/mfd/wm8350-core.c 2009-05-10 22:04:38.000000000 +0200
45119 +++ linux-2.6.29-rc3.owrt/drivers/mfd/wm8350-core.c 2009-05-10 23:48:28.000000000 +0200
45120 @@ -1111,7 +1111,7 @@
45121 do {
45122 schedule_timeout_interruptible(1);
45123 reg = wm8350_reg_read(wm8350, WM8350_DIGITISER_CONTROL_1);
45124 - } while (--tries && (reg & WM8350_AUXADC_POLL));
45125 + } while (tries-- && (reg & WM8350_AUXADC_POLL));
45126
45127 if (!tries)
45128 dev_err(wm8350->dev, "adc chn %d read timeout\n", channel);
45129 @@ -1297,29 +1297,14 @@
45130 int wm8350_device_init(struct wm8350 *wm8350, int irq,
45131 struct wm8350_platform_data *pdata)
45132 {
45133 - int ret;
45134 + int ret = -EINVAL;
45135 u16 id1, id2, mask_rev;
45136 u16 cust_id, mode, chip_rev;
45137
45138 /* get WM8350 revision and config mode */
45139 - ret = wm8350->read_dev(wm8350, WM8350_RESET_ID, sizeof(id1), &id1);
45140 - if (ret != 0) {
45141 - dev_err(wm8350->dev, "Failed to read ID: %d\n", ret);
45142 - goto err;
45143 - }
45144 -
45145 - ret = wm8350->read_dev(wm8350, WM8350_ID, sizeof(id2), &id2);
45146 - if (ret != 0) {
45147 - dev_err(wm8350->dev, "Failed to read ID: %d\n", ret);
45148 - goto err;
45149 - }
45150 -
45151 - ret = wm8350->read_dev(wm8350, WM8350_REVISION, sizeof(mask_rev),
45152 - &mask_rev);
45153 - if (ret != 0) {
45154 - dev_err(wm8350->dev, "Failed to read revision: %d\n", ret);
45155 - goto err;
45156 - }
45157 + wm8350->read_dev(wm8350, WM8350_RESET_ID, sizeof(id1), &id1);
45158 + wm8350->read_dev(wm8350, WM8350_ID, sizeof(id2), &id2);
45159 + wm8350->read_dev(wm8350, WM8350_REVISION, sizeof(mask_rev), &mask_rev);
45160
45161 id1 = be16_to_cpu(id1);
45162 id2 = be16_to_cpu(id2);
45163 @@ -1383,11 +1368,6 @@
45164 wm8350->power.rev_g_coeff = 1;
45165 break;
45166
45167 - case 1:
45168 - dev_info(wm8350->dev, "WM8351 Rev B\n");
45169 - wm8350->power.rev_g_coeff = 1;
45170 - break;
45171 -
45172 default:
45173 dev_err(wm8350->dev, "Unknown WM8351 CHIP_REV\n");
45174 ret = -ENODEV;
45175 @@ -1424,12 +1404,14 @@
45176 return ret;
45177 }
45178
45179 - wm8350_reg_write(wm8350, WM8350_SYSTEM_INTERRUPTS_MASK, 0xFFFF);
45180 - wm8350_reg_write(wm8350, WM8350_INT_STATUS_1_MASK, 0xFFFF);
45181 - wm8350_reg_write(wm8350, WM8350_INT_STATUS_2_MASK, 0xFFFF);
45182 - wm8350_reg_write(wm8350, WM8350_UNDER_VOLTAGE_INT_STATUS_MASK, 0xFFFF);
45183 - wm8350_reg_write(wm8350, WM8350_GPIO_INT_STATUS_MASK, 0xFFFF);
45184 - wm8350_reg_write(wm8350, WM8350_COMPARATOR_INT_STATUS_MASK, 0xFFFF);
45185 + if (pdata && pdata->init) {
45186 + ret = pdata->init(wm8350);
45187 + if (ret != 0) {
45188 + dev_err(wm8350->dev, "Platform init() failed: %d\n",
45189 + ret);
45190 + goto err;
45191 + }
45192 + }
45193
45194 mutex_init(&wm8350->auxadc_mutex);
45195 mutex_init(&wm8350->irq_mutex);
45196 @@ -1448,15 +1430,6 @@
45197 }
45198 wm8350->chip_irq = irq;
45199
45200 - if (pdata && pdata->init) {
45201 - ret = pdata->init(wm8350);
45202 - if (ret != 0) {
45203 - dev_err(wm8350->dev, "Platform init() failed: %d\n",
45204 - ret);
45205 - goto err;
45206 - }
45207 - }
45208 -
45209 wm8350_reg_write(wm8350, WM8350_SYSTEM_INTERRUPTS_MASK, 0x0);
45210
45211 wm8350_client_dev_register(wm8350, "wm8350-codec",
45212 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mfd/wm8350-regmap.c linux-2.6.29-rc3.owrt/drivers/mfd/wm8350-regmap.c
45213 --- linux-2.6.29.owrt/drivers/mfd/wm8350-regmap.c 2009-05-10 22:04:38.000000000 +0200
45214 +++ linux-2.6.29-rc3.owrt/drivers/mfd/wm8350-regmap.c 2009-05-10 23:48:28.000000000 +0200
45215 @@ -3188,7 +3188,7 @@
45216 { 0x7CFF, 0x0C00, 0x7FFF }, /* R1 - ID */
45217 { 0x0000, 0x0000, 0x0000 }, /* R2 */
45218 { 0xBE3B, 0xBE3B, 0x8000 }, /* R3 - System Control 1 */
45219 - { 0xFEF7, 0xFEF7, 0xF800 }, /* R4 - System Control 2 */
45220 + { 0xFCF7, 0xFCF7, 0xF800 }, /* R4 - System Control 2 */
45221 { 0x80FF, 0x80FF, 0x8000 }, /* R5 - System Hibernate */
45222 { 0xFB0E, 0xFB0E, 0x0000 }, /* R6 - Interface Control */
45223 { 0x0000, 0x0000, 0x0000 }, /* R7 */
45224 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/misc/atmel-ssc.c linux-2.6.29-rc3.owrt/drivers/misc/atmel-ssc.c
45225 --- linux-2.6.29.owrt/drivers/misc/atmel-ssc.c 2009-05-10 22:04:38.000000000 +0200
45226 +++ linux-2.6.29-rc3.owrt/drivers/misc/atmel-ssc.c 2009-05-10 23:48:28.000000000 +0200
45227 @@ -35,7 +35,7 @@
45228
45229 if (!ssc_valid) {
45230 spin_unlock(&user_lock);
45231 - pr_err("ssc: ssc%d platform device is missing\n", ssc_num);
45232 + dev_dbg(&ssc->pdev->dev, "could not find requested device\n");
45233 return ERR_PTR(-ENODEV);
45234 }
45235
45236 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/misc/hpilo.c linux-2.6.29-rc3.owrt/drivers/misc/hpilo.c
45237 --- linux-2.6.29.owrt/drivers/misc/hpilo.c 2009-05-10 22:04:38.000000000 +0200
45238 +++ linux-2.6.29-rc3.owrt/drivers/misc/hpilo.c 2009-05-10 23:48:28.000000000 +0200
45239 @@ -207,7 +207,7 @@
45240 &device_ccb->recv_ctrl);
45241
45242 /* give iLO some time to process stop request */
45243 - for (retries = MAX_WAIT; retries > 0; retries--) {
45244 + for (retries = 1000; retries > 0; retries--) {
45245 doorbell_set(driver_ccb);
45246 udelay(1);
45247 if (!(ioread32(&device_ccb->send_ctrl) & (1 << CTRL_BITPOS_A))
45248 @@ -309,7 +309,7 @@
45249 doorbell_clr(driver_ccb);
45250
45251 /* make sure iLO is really handling requests */
45252 - for (i = MAX_WAIT; i > 0; i--) {
45253 + for (i = 1000; i > 0; i--) {
45254 if (ilo_pkt_dequeue(hw, driver_ccb, SENDQ, &pkt_id, NULL, NULL))
45255 break;
45256 udelay(1);
45257 @@ -326,7 +326,7 @@
45258
45259 return 0;
45260 free:
45261 - ilo_ccb_close(pdev, data);
45262 + pci_free_consistent(pdev, data->dma_size, data->dma_va, data->dma_pa);
45263 out:
45264 return error;
45265 }
45266 @@ -710,7 +710,6 @@
45267
45268 static struct pci_device_id ilo_devices[] = {
45269 { PCI_DEVICE(PCI_VENDOR_ID_COMPAQ, 0xB204) },
45270 - { PCI_DEVICE(PCI_VENDOR_ID_HP, 0x3307) },
45271 { }
45272 };
45273 MODULE_DEVICE_TABLE(pci, ilo_devices);
45274 @@ -759,7 +758,7 @@
45275 class_destroy(ilo_class);
45276 }
45277
45278 -MODULE_VERSION("1.0");
45279 +MODULE_VERSION("0.05");
45280 MODULE_ALIAS(ILO_NAME);
45281 MODULE_DESCRIPTION(ILO_NAME);
45282 MODULE_AUTHOR("David Altobelli <david.altobelli@hp.com>");
45283 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/misc/hpilo.h linux-2.6.29-rc3.owrt/drivers/misc/hpilo.h
45284 --- linux-2.6.29.owrt/drivers/misc/hpilo.h 2009-05-10 22:04:38.000000000 +0200
45285 +++ linux-2.6.29-rc3.owrt/drivers/misc/hpilo.h 2009-05-10 23:48:28.000000000 +0200
45286 @@ -19,8 +19,6 @@
45287 #define MAX_ILO_DEV 1
45288 /* max number of files */
45289 #define MAX_OPEN (MAX_CCB * MAX_ILO_DEV)
45290 -/* spin counter for open/close delay */
45291 -#define MAX_WAIT 10000
45292
45293 /*
45294 * Per device, used to track global memory allocations.
45295 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/misc/Kconfig linux-2.6.29-rc3.owrt/drivers/misc/Kconfig
45296 --- linux-2.6.29.owrt/drivers/misc/Kconfig 2009-05-10 22:04:38.000000000 +0200
45297 +++ linux-2.6.29-rc3.owrt/drivers/misc/Kconfig 2009-05-10 23:48:28.000000000 +0200
45298 @@ -217,7 +217,6 @@
45299 depends on EXPERIMENTAL
45300 depends on BACKLIGHT_CLASS_DEVICE
45301 depends on RFKILL
45302 - depends on POWER_SUPPLY
45303 default n
45304 ---help---
45305 This driver adds support for rfkill and backlight control to Dell
45306 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/misc/sgi-xp/xpc_channel.c linux-2.6.29-rc3.owrt/drivers/misc/sgi-xp/xpc_channel.c
45307 --- linux-2.6.29.owrt/drivers/misc/sgi-xp/xpc_channel.c 2009-05-10 22:04:38.000000000 +0200
45308 +++ linux-2.6.29-rc3.owrt/drivers/misc/sgi-xp/xpc_channel.c 2009-05-10 23:48:28.000000000 +0200
45309 @@ -49,6 +49,9 @@
45310
45311 if (ch->flags & (XPC_C_CONNECTED | XPC_C_DISCONNECTING))
45312 return;
45313 +
45314 + DBUG_ON(ch->local_msgqueue == NULL);
45315 + DBUG_ON(ch->remote_msgqueue == NULL);
45316 }
45317
45318 if (!(ch->flags & XPC_C_OPENREPLY)) {
45319 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/misc/sgi-xp/xpc.h linux-2.6.29-rc3.owrt/drivers/misc/sgi-xp/xpc.h
45320 --- linux-2.6.29.owrt/drivers/misc/sgi-xp/xpc.h 2009-05-10 22:04:38.000000000 +0200
45321 +++ linux-2.6.29-rc3.owrt/drivers/misc/sgi-xp/xpc.h 2009-05-10 23:48:28.000000000 +0200
45322 @@ -3,7 +3,7 @@
45323 * License. See the file "COPYING" in the main directory of this archive
45324 * for more details.
45325 *
45326 - * Copyright (c) 2004-2009 Silicon Graphics, Inc. All Rights Reserved.
45327 + * Copyright (c) 2004-2008 Silicon Graphics, Inc. All Rights Reserved.
45328 */
45329
45330 /*
45331 @@ -514,8 +514,7 @@
45332 /* partition's notify mq */
45333
45334 struct xpc_send_msg_slot_uv *send_msg_slots;
45335 - void *recv_msg_slots; /* each slot will hold a xpc_notify_mq_msg_uv */
45336 - /* structure plus the user's payload */
45337 + struct xpc_notify_mq_msg_uv *recv_msg_slots;
45338
45339 struct xpc_fifo_head_uv msg_slot_free_list;
45340 struct xpc_fifo_head_uv recv_msg_list; /* deliverable payloads */
45341 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/misc/sgi-xp/xpc_sn2.c linux-2.6.29-rc3.owrt/drivers/misc/sgi-xp/xpc_sn2.c
45342 --- linux-2.6.29.owrt/drivers/misc/sgi-xp/xpc_sn2.c 2009-05-10 22:04:38.000000000 +0200
45343 +++ linux-2.6.29-rc3.owrt/drivers/misc/sgi-xp/xpc_sn2.c 2009-05-10 23:48:28.000000000 +0200
45344 @@ -1106,6 +1106,8 @@
45345 int n_IRQs_expected;
45346 int n_IRQs_detected;
45347
45348 + DBUG_ON(xpc_activate_IRQ_rcvd == 0);
45349 +
45350 spin_lock_irqsave(&xpc_activate_IRQ_rcvd_lock, irq_flags);
45351 n_IRQs_expected = xpc_activate_IRQ_rcvd;
45352 xpc_activate_IRQ_rcvd = 0;
45353 @@ -1724,7 +1726,6 @@
45354 msg = (struct xpc_msg_sn2 *)((u64)ch_sn2->local_msgqueue +
45355 (get % ch->local_nentries) *
45356 ch->entry_size);
45357 - DBUG_ON(!(msg->flags & XPC_M_SN2_READY));
45358 msg->flags = 0;
45359 } while (++get < ch_sn2->remote_GP.get);
45360 }
45361 @@ -1739,18 +1740,11 @@
45362 struct xpc_msg_sn2 *msg;
45363 s64 put;
45364
45365 - /* flags are zeroed when the buffer is allocated */
45366 - if (ch_sn2->remote_GP.put < ch->remote_nentries)
45367 - return;
45368 -
45369 - put = max(ch_sn2->w_remote_GP.put, ch->remote_nentries);
45370 + put = ch_sn2->w_remote_GP.put;
45371 do {
45372 msg = (struct xpc_msg_sn2 *)((u64)ch_sn2->remote_msgqueue +
45373 (put % ch->remote_nentries) *
45374 ch->entry_size);
45375 - DBUG_ON(!(msg->flags & XPC_M_SN2_READY));
45376 - DBUG_ON(!(msg->flags & XPC_M_SN2_DONE));
45377 - DBUG_ON(msg->number != put - ch->remote_nentries);
45378 msg->flags = 0;
45379 } while (++put < ch_sn2->remote_GP.put);
45380 }
45381 @@ -1842,7 +1836,6 @@
45382 */
45383 xpc_clear_remote_msgqueue_flags_sn2(ch);
45384
45385 - smp_wmb(); /* ensure flags have been cleared before bte_copy */
45386 ch_sn2->w_remote_GP.put = ch_sn2->remote_GP.put;
45387
45388 dev_dbg(xpc_chan, "w_remote_GP.put changed to %ld, partid=%d, "
45389 @@ -1941,7 +1934,7 @@
45390 break;
45391
45392 get = ch_sn2->w_local_GP.get;
45393 - smp_rmb(); /* guarantee that .get loads before .put */
45394 + rmb(); /* guarantee that .get loads before .put */
45395 if (get == ch_sn2->w_remote_GP.put)
45396 break;
45397
45398 @@ -1963,13 +1956,11 @@
45399
45400 msg = xpc_pull_remote_msg_sn2(ch, get);
45401
45402 - if (msg != NULL) {
45403 - DBUG_ON(msg->number != get);
45404 - DBUG_ON(msg->flags & XPC_M_SN2_DONE);
45405 - DBUG_ON(!(msg->flags & XPC_M_SN2_READY));
45406 + DBUG_ON(msg != NULL && msg->number != get);
45407 + DBUG_ON(msg != NULL && (msg->flags & XPC_M_SN2_DONE));
45408 + DBUG_ON(msg != NULL && !(msg->flags & XPC_M_SN2_READY));
45409
45410 - payload = &msg->payload;
45411 - }
45412 + payload = &msg->payload;
45413 break;
45414 }
45415
45416 @@ -2062,7 +2053,7 @@
45417 while (1) {
45418
45419 put = ch_sn2->w_local_GP.put;
45420 - smp_rmb(); /* guarantee that .put loads before .get */
45421 + rmb(); /* guarantee that .put loads before .get */
45422 if (put - ch_sn2->w_remote_GP.get < ch->local_nentries) {
45423
45424 /* There are available message entries. We need to try
45425 @@ -2195,7 +2186,7 @@
45426 * The preceding store of msg->flags must occur before the following
45427 * load of local_GP->put.
45428 */
45429 - smp_mb();
45430 + mb();
45431
45432 /* see if the message is next in line to be sent, if so send it */
45433
45434 @@ -2286,9 +2277,8 @@
45435 dev_dbg(xpc_chan, "msg=0x%p, msg_number=%ld, partid=%d, channel=%d\n",
45436 (void *)msg, msg_number, ch->partid, ch->number);
45437
45438 - DBUG_ON((((u64)msg - (u64)ch->sn.sn2.remote_msgqueue) / ch->entry_size) !=
45439 + DBUG_ON((((u64)msg - (u64)ch->remote_msgqueue) / ch->entry_size) !=
45440 msg_number % ch->remote_nentries);
45441 - DBUG_ON(!(msg->flags & XPC_M_SN2_READY));
45442 DBUG_ON(msg->flags & XPC_M_SN2_DONE);
45443
45444 msg->flags |= XPC_M_SN2_DONE;
45445 @@ -2297,7 +2287,7 @@
45446 * The preceding store of msg->flags must occur before the following
45447 * load of local_GP->get.
45448 */
45449 - smp_mb();
45450 + mb();
45451
45452 /*
45453 * See if this message is next in line to be acknowledged as having
45454 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/misc/sgi-xp/xpc_uv.c linux-2.6.29-rc3.owrt/drivers/misc/sgi-xp/xpc_uv.c
45455 --- linux-2.6.29.owrt/drivers/misc/sgi-xp/xpc_uv.c 2009-05-10 22:04:38.000000000 +0200
45456 +++ linux-2.6.29-rc3.owrt/drivers/misc/sgi-xp/xpc_uv.c 2009-05-10 23:48:28.000000000 +0200
45457 @@ -3,7 +3,7 @@
45458 * License. See the file "COPYING" in the main directory of this archive
45459 * for more details.
45460 *
45461 - * Copyright (c) 2008-2009 Silicon Graphics, Inc. All Rights Reserved.
45462 + * Copyright (c) 2008 Silicon Graphics, Inc. All Rights Reserved.
45463 */
45464
45465 /*
45466 @@ -1010,8 +1010,8 @@
45467 continue;
45468
45469 for (entry = 0; entry < nentries; entry++) {
45470 - msg_slot = ch_uv->recv_msg_slots +
45471 - entry * ch->entry_size;
45472 + msg_slot = ch_uv->recv_msg_slots + entry *
45473 + ch->entry_size;
45474
45475 msg_slot->hdr.msg_slot_number = entry;
45476 }
45477 @@ -1308,8 +1308,9 @@
45478 /* we're dealing with a normal message sent via the notify_mq */
45479 ch_uv = &ch->sn.uv;
45480
45481 - msg_slot = ch_uv->recv_msg_slots +
45482 - (msg->hdr.msg_slot_number % ch->remote_nentries) * ch->entry_size;
45483 + msg_slot = (struct xpc_notify_mq_msg_uv *)((u64)ch_uv->recv_msg_slots +
45484 + (msg->hdr.msg_slot_number % ch->remote_nentries) *
45485 + ch->entry_size);
45486
45487 BUG_ON(msg->hdr.msg_slot_number != msg_slot->hdr.msg_slot_number);
45488 BUG_ON(msg_slot->hdr.size != 0);
45489 @@ -1422,7 +1423,7 @@
45490 atomic_inc(&ch->n_to_notify);
45491
45492 msg_slot->key = key;
45493 - smp_wmb(); /* a non-NULL func must hit memory after the key */
45494 + wmb(); /* a non-NULL func must hit memory after the key */
45495 msg_slot->func = func;
45496
45497 if (ch->flags & XPC_C_DISCONNECTING) {
45498 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/misc/sgi-xp/xpnet.c linux-2.6.29-rc3.owrt/drivers/misc/sgi-xp/xpnet.c
45499 --- linux-2.6.29.owrt/drivers/misc/sgi-xp/xpnet.c 2009-05-10 22:04:38.000000000 +0200
45500 +++ linux-2.6.29-rc3.owrt/drivers/misc/sgi-xp/xpnet.c 2009-05-10 23:48:28.000000000 +0200
45501 @@ -3,7 +3,7 @@
45502 * License. See the file "COPYING" in the main directory of this archive
45503 * for more details.
45504 *
45505 - * Copyright (C) 1999-2009 Silicon Graphics, Inc. All rights reserved.
45506 + * Copyright (C) 1999-2008 Silicon Graphics, Inc. All rights reserved.
45507 */
45508
45509 /*
45510 @@ -551,7 +551,6 @@
45511
45512 netif_carrier_off(xpnet_device);
45513
45514 - xpnet_device->netdev_ops = &xpnet_netdev_ops;
45515 xpnet_device->mtu = XPNET_DEF_MTU;
45516
45517 /*
45518 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mmc/card/block.c linux-2.6.29-rc3.owrt/drivers/mmc/card/block.c
45519 --- linux-2.6.29.owrt/drivers/mmc/card/block.c 2009-05-10 22:04:38.000000000 +0200
45520 +++ linux-2.6.29-rc3.owrt/drivers/mmc/card/block.c 2009-05-10 23:48:28.000000000 +0200
45521 @@ -584,7 +584,7 @@
45522 if (err)
45523 goto out;
45524
45525 - string_get_size((u64)get_capacity(md->disk) << 9, STRING_UNITS_2,
45526 + string_get_size(get_capacity(md->disk) << 9, STRING_UNITS_2,
45527 cap_str, sizeof(cap_str));
45528 printk(KERN_INFO "%s: %s %s %s %s\n",
45529 md->disk->disk_name, mmc_card_id(card), mmc_card_name(card),
45530 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mmc/card/mmc_test.c linux-2.6.29-rc3.owrt/drivers/mmc/card/mmc_test.c
45531 --- linux-2.6.29.owrt/drivers/mmc/card/mmc_test.c 2009-05-10 22:04:38.000000000 +0200
45532 +++ linux-2.6.29-rc3.owrt/drivers/mmc/card/mmc_test.c 2009-05-10 23:48:28.000000000 +0200
45533 @@ -494,7 +494,7 @@
45534
45535 sg_init_one(&sg, test->buffer, 512);
45536
45537 - ret = mmc_test_simple_transfer(test, &sg, 1, 0, 1, 512, 0);
45538 + ret = mmc_test_simple_transfer(test, &sg, 1, 0, 1, 512, 1);
45539 if (ret)
45540 return ret;
45541
45542 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mmc/core/mmc_ops.c linux-2.6.29-rc3.owrt/drivers/mmc/core/mmc_ops.c
45543 --- linux-2.6.29.owrt/drivers/mmc/core/mmc_ops.c 2009-05-10 22:04:38.000000000 +0200
45544 +++ linux-2.6.29-rc3.owrt/drivers/mmc/core/mmc_ops.c 2009-05-10 23:48:28.000000000 +0200
45545 @@ -248,15 +248,12 @@
45546
45547 sg_init_one(&sg, data_buf, len);
45548
45549 - if (opcode == MMC_SEND_CSD || opcode == MMC_SEND_CID) {
45550 - /*
45551 - * The spec states that CSR and CID accesses have a timeout
45552 - * of 64 clock cycles.
45553 - */
45554 - data.timeout_ns = 0;
45555 - data.timeout_clks = 64;
45556 - } else
45557 - mmc_set_data_timeout(&data, card);
45558 + /*
45559 + * The spec states that CSR and CID accesses have a timeout
45560 + * of 64 clock cycles.
45561 + */
45562 + data.timeout_ns = 0;
45563 + data.timeout_clks = 64;
45564
45565 mmc_wait_for_req(host, &mrq);
45566
45567 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mmc/host/atmel-mci.c linux-2.6.29-rc3.owrt/drivers/mmc/host/atmel-mci.c
45568 --- linux-2.6.29.owrt/drivers/mmc/host/atmel-mci.c 2009-05-10 22:04:38.000000000 +0200
45569 +++ linux-2.6.29-rc3.owrt/drivers/mmc/host/atmel-mci.c 2009-05-10 23:48:28.000000000 +0200
45570 @@ -1548,10 +1548,9 @@
45571 {
45572 struct dw_dma_slave *dws = slave;
45573
45574 - if (dws->dma_dev == chan->device->dev) {
45575 - chan->private = dws;
45576 + if (dws->dma_dev == chan->device->dev)
45577 return true;
45578 - } else
45579 + else
45580 return false;
45581 }
45582 #endif
45583 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mmc/host/Kconfig linux-2.6.29-rc3.owrt/drivers/mmc/host/Kconfig
45584 --- linux-2.6.29.owrt/drivers/mmc/host/Kconfig 2009-05-10 22:04:38.000000000 +0200
45585 +++ linux-2.6.29-rc3.owrt/drivers/mmc/host/Kconfig 2009-05-10 23:48:28.000000000 +0200
45586 @@ -145,16 +145,6 @@
45587
45588 If unsure, say N.
45589
45590 -config MMC_MXC
45591 - tristate "Freescale i.MX2/3 Multimedia Card Interface support"
45592 - depends on ARCH_MXC
45593 - help
45594 - This selects the Freescale i.MX2/3 Multimedia card Interface.
45595 - If you have a i.MX platform with a Multimedia Card slot,
45596 - say Y or M here.
45597 -
45598 - If unsure, say N.
45599 -
45600 config MMC_TIFM_SD
45601 tristate "TI Flash Media MMC/SD Interface support (EXPERIMENTAL)"
45602 depends on EXPERIMENTAL && PCI
45603 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mmc/host/Makefile linux-2.6.29-rc3.owrt/drivers/mmc/host/Makefile
45604 --- linux-2.6.29.owrt/drivers/mmc/host/Makefile 2009-05-10 22:04:38.000000000 +0200
45605 +++ linux-2.6.29-rc3.owrt/drivers/mmc/host/Makefile 2009-05-10 23:48:28.000000000 +0200
45606 @@ -9,7 +9,6 @@
45607 obj-$(CONFIG_MMC_ARMMMCI) += mmci.o
45608 obj-$(CONFIG_MMC_PXA) += pxamci.o
45609 obj-$(CONFIG_MMC_IMX) += imxmmc.o
45610 -obj-$(CONFIG_MMC_MXC) += mxcmmc.o
45611 obj-$(CONFIG_MMC_SDHCI) += sdhci.o
45612 obj-$(CONFIG_MMC_SDHCI_PCI) += sdhci-pci.o
45613 obj-$(CONFIG_MMC_RICOH_MMC) += ricoh_mmc.o
45614 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mmc/host/mmci.c linux-2.6.29-rc3.owrt/drivers/mmc/host/mmci.c
45615 --- linux-2.6.29.owrt/drivers/mmc/host/mmci.c 2009-05-10 22:04:38.000000000 +0200
45616 +++ linux-2.6.29-rc3.owrt/drivers/mmc/host/mmci.c 2009-05-10 23:48:28.000000000 +0200
45617 @@ -430,8 +430,6 @@
45618 clk = 255;
45619 host->cclk = host->mclk / (2 * (clk + 1));
45620 }
45621 - if (host->hw_designer == 0x80)
45622 - clk |= MCI_FCEN; /* Bug fix in ST IP block */
45623 clk |= MCI_CLK_ENABLE;
45624 }
45625
45626 @@ -442,27 +440,15 @@
45627 case MMC_POWER_OFF:
45628 break;
45629 case MMC_POWER_UP:
45630 - /* The ST version does not have this, fall through to POWER_ON */
45631 - if (host->hw_designer != 0x80) {
45632 - pwr |= MCI_PWR_UP;
45633 - break;
45634 - }
45635 + pwr |= MCI_PWR_UP;
45636 + break;
45637 case MMC_POWER_ON:
45638 pwr |= MCI_PWR_ON;
45639 break;
45640 }
45641
45642 - if (ios->bus_mode == MMC_BUSMODE_OPENDRAIN) {
45643 - if (host->hw_designer != 0x80)
45644 - pwr |= MCI_ROD;
45645 - else {
45646 - /*
45647 - * The ST Micro variant use the ROD bit for something
45648 - * else and only has OD (Open Drain).
45649 - */
45650 - pwr |= MCI_OD;
45651 - }
45652 - }
45653 + if (ios->bus_mode == MMC_BUSMODE_OPENDRAIN)
45654 + pwr |= MCI_ROD;
45655
45656 writel(clk, host->base + MMCICLOCK);
45657
45658 @@ -514,12 +500,6 @@
45659 }
45660
45661 host = mmc_priv(mmc);
45662 - /* Bits 12 thru 19 is the designer */
45663 - host->hw_designer = (dev->periphid >> 12) & 0xff;
45664 - /* Bits 20 thru 23 is the revison */
45665 - host->hw_revision = (dev->periphid >> 20) & 0xf;
45666 - DBG(host, "designer ID = 0x%02x\n", host->hw_designer);
45667 - DBG(host, "revision = 0x%01x\n", host->hw_revision);
45668 host->clk = clk_get(&dev->dev, NULL);
45669 if (IS_ERR(host->clk)) {
45670 ret = PTR_ERR(host->clk);
45671 @@ -713,15 +693,6 @@
45672 .id = 0x00041181,
45673 .mask = 0x000fffff,
45674 },
45675 - /* ST Micro variants */
45676 - {
45677 - .id = 0x00180180,
45678 - .mask = 0x00ffffff,
45679 - },
45680 - {
45681 - .id = 0x00280180,
45682 - .mask = 0x00ffffff,
45683 - },
45684 { 0, 0 },
45685 };
45686
45687 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mmc/host/mmci.h linux-2.6.29-rc3.owrt/drivers/mmc/host/mmci.h
45688 --- linux-2.6.29.owrt/drivers/mmc/host/mmci.h 2009-05-10 22:04:38.000000000 +0200
45689 +++ linux-2.6.29-rc3.owrt/drivers/mmc/host/mmci.h 2009-05-10 23:48:28.000000000 +0200
45690 @@ -11,23 +11,13 @@
45691 #define MCI_PWR_OFF 0x00
45692 #define MCI_PWR_UP 0x02
45693 #define MCI_PWR_ON 0x03
45694 -#define MCI_DATA2DIREN (1 << 2)
45695 -#define MCI_CMDDIREN (1 << 3)
45696 -#define MCI_DATA0DIREN (1 << 4)
45697 -#define MCI_DATA31DIREN (1 << 5)
45698 #define MCI_OD (1 << 6)
45699 #define MCI_ROD (1 << 7)
45700 -/* The ST Micro version does not have ROD */
45701 -#define MCI_FBCLKEN (1 << 7)
45702 -#define MCI_DATA74DIREN (1 << 8)
45703
45704 #define MMCICLOCK 0x004
45705 #define MCI_CLK_ENABLE (1 << 8)
45706 #define MCI_CLK_PWRSAVE (1 << 9)
45707 #define MCI_CLK_BYPASS (1 << 10)
45708 -#define MCI_WIDE_BUS (1 << 11)
45709 -/* HW flow control on the ST Micro version */
45710 -#define MCI_FCEN (1 << 13)
45711
45712 #define MMCIARGUMENT 0x008
45713 #define MMCICOMMAND 0x00c
45714 @@ -36,10 +26,6 @@
45715 #define MCI_CPSM_INTERRUPT (1 << 8)
45716 #define MCI_CPSM_PENDING (1 << 9)
45717 #define MCI_CPSM_ENABLE (1 << 10)
45718 -#define MCI_SDIO_SUSP (1 << 11)
45719 -#define MCI_ENCMD_COMPL (1 << 12)
45720 -#define MCI_NIEN (1 << 13)
45721 -#define MCI_CE_ATACMD (1 << 14)
45722
45723 #define MMCIRESPCMD 0x010
45724 #define MMCIRESPONSE0 0x014
45725 @@ -53,11 +39,6 @@
45726 #define MCI_DPSM_DIRECTION (1 << 1)
45727 #define MCI_DPSM_MODE (1 << 2)
45728 #define MCI_DPSM_DMAENABLE (1 << 3)
45729 -#define MCI_DPSM_BLOCKSIZE (1 << 4)
45730 -#define MCI_DPSM_RWSTART (1 << 8)
45731 -#define MCI_DPSM_RWSTOP (1 << 9)
45732 -#define MCI_DPSM_RWMOD (1 << 10)
45733 -#define MCI_DPSM_SDIOEN (1 << 11)
45734
45735 #define MMCIDATACNT 0x030
45736 #define MMCISTATUS 0x034
45737 @@ -82,8 +63,6 @@
45738 #define MCI_RXFIFOEMPTY (1 << 19)
45739 #define MCI_TXDATAAVLBL (1 << 20)
45740 #define MCI_RXDATAAVLBL (1 << 21)
45741 -#define MCI_SDIOIT (1 << 22)
45742 -#define MCI_CEATAEND (1 << 23)
45743
45744 #define MMCICLEAR 0x038
45745 #define MCI_CMDCRCFAILCLR (1 << 0)
45746 @@ -96,8 +75,6 @@
45747 #define MCI_CMDSENTCLR (1 << 7)
45748 #define MCI_DATAENDCLR (1 << 8)
45749 #define MCI_DATABLOCKENDCLR (1 << 10)
45750 -#define MCI_SDIOITC (1 << 22)
45751 -#define MCI_CEATAENDC (1 << 23)
45752
45753 #define MMCIMASK0 0x03c
45754 #define MCI_CMDCRCFAILMASK (1 << 0)
45755 @@ -121,8 +98,6 @@
45756 #define MCI_RXFIFOEMPTYMASK (1 << 19)
45757 #define MCI_TXDATAAVLBLMASK (1 << 20)
45758 #define MCI_RXDATAAVLBLMASK (1 << 21)
45759 -#define MCI_SDIOITMASK (1 << 22)
45760 -#define MCI_CEATAENDMASK (1 << 23)
45761
45762 #define MMCIMASK1 0x040
45763 #define MMCIFIFOCNT 0x048
45764 @@ -161,9 +136,6 @@
45765 u32 pwr;
45766 struct mmc_platform_data *plat;
45767
45768 - u8 hw_designer;
45769 - u8 hw_revision:4;
45770 -
45771 struct timer_list timer;
45772 unsigned int oldstat;
45773
45774 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mmc/host/mxcmmc.c linux-2.6.29-rc3.owrt/drivers/mmc/host/mxcmmc.c
45775 --- linux-2.6.29.owrt/drivers/mmc/host/mxcmmc.c 2009-05-10 22:04:38.000000000 +0200
45776 +++ linux-2.6.29-rc3.owrt/drivers/mmc/host/mxcmmc.c 1970-01-01 01:00:00.000000000 +0100
45777 @@ -1,880 +0,0 @@
45778 -/*
45779 - * linux/drivers/mmc/host/mxcmmc.c - Freescale i.MX MMCI driver
45780 - *
45781 - * This is a driver for the SDHC controller found in Freescale MX2/MX3
45782 - * SoCs. It is basically the same hardware as found on MX1 (imxmmc.c).
45783 - * Unlike the hardware found on MX1, this hardware just works and does
45784 - * not need all the quirks found in imxmmc.c, hence the seperate driver.
45785 - *
45786 - * Copyright (C) 2008 Sascha Hauer, Pengutronix <s.hauer@pengutronix.de>
45787 - * Copyright (C) 2006 Pavel Pisa, PiKRON <ppisa@pikron.com>
45788 - *
45789 - * derived from pxamci.c by Russell King
45790 - *
45791 - * This program is free software; you can redistribute it and/or modify
45792 - * it under the terms of the GNU General Public License version 2 as
45793 - * published by the Free Software Foundation.
45794 - *
45795 - */
45796 -
45797 -#include <linux/module.h>
45798 -#include <linux/init.h>
45799 -#include <linux/ioport.h>
45800 -#include <linux/platform_device.h>
45801 -#include <linux/interrupt.h>
45802 -#include <linux/irq.h>
45803 -#include <linux/blkdev.h>
45804 -#include <linux/dma-mapping.h>
45805 -#include <linux/mmc/host.h>
45806 -#include <linux/mmc/card.h>
45807 -#include <linux/delay.h>
45808 -#include <linux/clk.h>
45809 -#include <linux/io.h>
45810 -#include <linux/gpio.h>
45811 -
45812 -#include <asm/dma.h>
45813 -#include <asm/irq.h>
45814 -#include <asm/sizes.h>
45815 -#include <mach/mmc.h>
45816 -
45817 -#ifdef CONFIG_ARCH_MX2
45818 -#include <mach/dma-mx1-mx2.h>
45819 -#define HAS_DMA
45820 -#endif
45821 -
45822 -#define DRIVER_NAME "imx-mmc"
45823 -
45824 -#define MMC_REG_STR_STP_CLK 0x00
45825 -#define MMC_REG_STATUS 0x04
45826 -#define MMC_REG_CLK_RATE 0x08
45827 -#define MMC_REG_CMD_DAT_CONT 0x0C
45828 -#define MMC_REG_RES_TO 0x10
45829 -#define MMC_REG_READ_TO 0x14
45830 -#define MMC_REG_BLK_LEN 0x18
45831 -#define MMC_REG_NOB 0x1C
45832 -#define MMC_REG_REV_NO 0x20
45833 -#define MMC_REG_INT_CNTR 0x24
45834 -#define MMC_REG_CMD 0x28
45835 -#define MMC_REG_ARG 0x2C
45836 -#define MMC_REG_RES_FIFO 0x34
45837 -#define MMC_REG_BUFFER_ACCESS 0x38
45838 -
45839 -#define STR_STP_CLK_RESET (1 << 3)
45840 -#define STR_STP_CLK_START_CLK (1 << 1)
45841 -#define STR_STP_CLK_STOP_CLK (1 << 0)
45842 -
45843 -#define STATUS_CARD_INSERTION (1 << 31)
45844 -#define STATUS_CARD_REMOVAL (1 << 30)
45845 -#define STATUS_YBUF_EMPTY (1 << 29)
45846 -#define STATUS_XBUF_EMPTY (1 << 28)
45847 -#define STATUS_YBUF_FULL (1 << 27)
45848 -#define STATUS_XBUF_FULL (1 << 26)
45849 -#define STATUS_BUF_UND_RUN (1 << 25)
45850 -#define STATUS_BUF_OVFL (1 << 24)
45851 -#define STATUS_SDIO_INT_ACTIVE (1 << 14)
45852 -#define STATUS_END_CMD_RESP (1 << 13)
45853 -#define STATUS_WRITE_OP_DONE (1 << 12)
45854 -#define STATUS_DATA_TRANS_DONE (1 << 11)
45855 -#define STATUS_READ_OP_DONE (1 << 11)
45856 -#define STATUS_WR_CRC_ERROR_CODE_MASK (3 << 10)
45857 -#define STATUS_CARD_BUS_CLK_RUN (1 << 8)
45858 -#define STATUS_BUF_READ_RDY (1 << 7)
45859 -#define STATUS_BUF_WRITE_RDY (1 << 6)
45860 -#define STATUS_RESP_CRC_ERR (1 << 5)
45861 -#define STATUS_CRC_READ_ERR (1 << 3)
45862 -#define STATUS_CRC_WRITE_ERR (1 << 2)
45863 -#define STATUS_TIME_OUT_RESP (1 << 1)
45864 -#define STATUS_TIME_OUT_READ (1 << 0)
45865 -#define STATUS_ERR_MASK 0x2f
45866 -
45867 -#define CMD_DAT_CONT_CMD_RESP_LONG_OFF (1 << 12)
45868 -#define CMD_DAT_CONT_STOP_READWAIT (1 << 11)
45869 -#define CMD_DAT_CONT_START_READWAIT (1 << 10)
45870 -#define CMD_DAT_CONT_BUS_WIDTH_4 (2 << 8)
45871 -#define CMD_DAT_CONT_INIT (1 << 7)
45872 -#define CMD_DAT_CONT_WRITE (1 << 4)
45873 -#define CMD_DAT_CONT_DATA_ENABLE (1 << 3)
45874 -#define CMD_DAT_CONT_RESPONSE_48BIT_CRC (1 << 0)
45875 -#define CMD_DAT_CONT_RESPONSE_136BIT (2 << 0)
45876 -#define CMD_DAT_CONT_RESPONSE_48BIT (3 << 0)
45877 -
45878 -#define INT_SDIO_INT_WKP_EN (1 << 18)
45879 -#define INT_CARD_INSERTION_WKP_EN (1 << 17)
45880 -#define INT_CARD_REMOVAL_WKP_EN (1 << 16)
45881 -#define INT_CARD_INSERTION_EN (1 << 15)
45882 -#define INT_CARD_REMOVAL_EN (1 << 14)
45883 -#define INT_SDIO_IRQ_EN (1 << 13)
45884 -#define INT_DAT0_EN (1 << 12)
45885 -#define INT_BUF_READ_EN (1 << 4)
45886 -#define INT_BUF_WRITE_EN (1 << 3)
45887 -#define INT_END_CMD_RES_EN (1 << 2)
45888 -#define INT_WRITE_OP_DONE_EN (1 << 1)
45889 -#define INT_READ_OP_EN (1 << 0)
45890 -
45891 -struct mxcmci_host {
45892 - struct mmc_host *mmc;
45893 - struct resource *res;
45894 - void __iomem *base;
45895 - int irq;
45896 - int detect_irq;
45897 - int dma;
45898 - int do_dma;
45899 - unsigned int power_mode;
45900 - struct imxmmc_platform_data *pdata;
45901 -
45902 - struct mmc_request *req;
45903 - struct mmc_command *cmd;
45904 - struct mmc_data *data;
45905 -
45906 - unsigned int dma_nents;
45907 - unsigned int datasize;
45908 - unsigned int dma_dir;
45909 -
45910 - u16 rev_no;
45911 - unsigned int cmdat;
45912 -
45913 - struct clk *clk;
45914 -
45915 - int clock;
45916 -
45917 - struct work_struct datawork;
45918 -};
45919 -
45920 -static inline int mxcmci_use_dma(struct mxcmci_host *host)
45921 -{
45922 - return host->do_dma;
45923 -}
45924 -
45925 -static void mxcmci_softreset(struct mxcmci_host *host)
45926 -{
45927 - int i;
45928 -
45929 - /* reset sequence */
45930 - writew(STR_STP_CLK_RESET, host->base + MMC_REG_STR_STP_CLK);
45931 - writew(STR_STP_CLK_RESET | STR_STP_CLK_START_CLK,
45932 - host->base + MMC_REG_STR_STP_CLK);
45933 -
45934 - for (i = 0; i < 8; i++)
45935 - writew(STR_STP_CLK_START_CLK, host->base + MMC_REG_STR_STP_CLK);
45936 -
45937 - writew(0xff, host->base + MMC_REG_RES_TO);
45938 -}
45939 -
45940 -static void mxcmci_setup_data(struct mxcmci_host *host, struct mmc_data *data)
45941 -{
45942 - unsigned int nob = data->blocks;
45943 - unsigned int blksz = data->blksz;
45944 - unsigned int datasize = nob * blksz;
45945 -#ifdef HAS_DMA
45946 - struct scatterlist *sg;
45947 - int i;
45948 -#endif
45949 - if (data->flags & MMC_DATA_STREAM)
45950 - nob = 0xffff;
45951 -
45952 - host->data = data;
45953 - data->bytes_xfered = 0;
45954 -
45955 - writew(nob, host->base + MMC_REG_NOB);
45956 - writew(blksz, host->base + MMC_REG_BLK_LEN);
45957 - host->datasize = datasize;
45958 -
45959 -#ifdef HAS_DMA
45960 - for_each_sg(data->sg, sg, data->sg_len, i) {
45961 - if (sg->offset & 3 || sg->length & 3) {
45962 - host->do_dma = 0;
45963 - return;
45964 - }
45965 - }
45966 -
45967 - if (data->flags & MMC_DATA_READ) {
45968 - host->dma_dir = DMA_FROM_DEVICE;
45969 - host->dma_nents = dma_map_sg(mmc_dev(host->mmc), data->sg,
45970 - data->sg_len, host->dma_dir);
45971 -
45972 - imx_dma_setup_sg(host->dma, data->sg, host->dma_nents, datasize,
45973 - host->res->start + MMC_REG_BUFFER_ACCESS,
45974 - DMA_MODE_READ);
45975 - } else {
45976 - host->dma_dir = DMA_TO_DEVICE;
45977 - host->dma_nents = dma_map_sg(mmc_dev(host->mmc), data->sg,
45978 - data->sg_len, host->dma_dir);
45979 -
45980 - imx_dma_setup_sg(host->dma, data->sg, host->dma_nents, datasize,
45981 - host->res->start + MMC_REG_BUFFER_ACCESS,
45982 - DMA_MODE_WRITE);
45983 - }
45984 -
45985 - wmb();
45986 -
45987 - imx_dma_enable(host->dma);
45988 -#endif /* HAS_DMA */
45989 -}
45990 -
45991 -static int mxcmci_start_cmd(struct mxcmci_host *host, struct mmc_command *cmd,
45992 - unsigned int cmdat)
45993 -{
45994 - WARN_ON(host->cmd != NULL);
45995 - host->cmd = cmd;
45996 -
45997 - switch (mmc_resp_type(cmd)) {
45998 - case MMC_RSP_R1: /* short CRC, OPCODE */
45999 - case MMC_RSP_R1B:/* short CRC, OPCODE, BUSY */
46000 - cmdat |= CMD_DAT_CONT_RESPONSE_48BIT_CRC;
46001 - break;
46002 - case MMC_RSP_R2: /* long 136 bit + CRC */
46003 - cmdat |= CMD_DAT_CONT_RESPONSE_136BIT;
46004 - break;
46005 - case MMC_RSP_R3: /* short */
46006 - cmdat |= CMD_DAT_CONT_RESPONSE_48BIT;
46007 - break;
46008 - case MMC_RSP_NONE:
46009 - break;
46010 - default:
46011 - dev_err(mmc_dev(host->mmc), "unhandled response type 0x%x\n",
46012 - mmc_resp_type(cmd));
46013 - cmd->error = -EINVAL;
46014 - return -EINVAL;
46015 - }
46016 -
46017 - if (mxcmci_use_dma(host))
46018 - writel(INT_READ_OP_EN | INT_WRITE_OP_DONE_EN |
46019 - INT_END_CMD_RES_EN,
46020 - host->base + MMC_REG_INT_CNTR);
46021 - else
46022 - writel(INT_END_CMD_RES_EN, host->base + MMC_REG_INT_CNTR);
46023 -
46024 - writew(cmd->opcode, host->base + MMC_REG_CMD);
46025 - writel(cmd->arg, host->base + MMC_REG_ARG);
46026 - writew(cmdat, host->base + MMC_REG_CMD_DAT_CONT);
46027 -
46028 - return 0;
46029 -}
46030 -
46031 -static void mxcmci_finish_request(struct mxcmci_host *host,
46032 - struct mmc_request *req)
46033 -{
46034 - writel(0, host->base + MMC_REG_INT_CNTR);
46035 -
46036 - host->req = NULL;
46037 - host->cmd = NULL;
46038 - host->data = NULL;
46039 -
46040 - mmc_request_done(host->mmc, req);
46041 -}
46042 -
46043 -static int mxcmci_finish_data(struct mxcmci_host *host, unsigned int stat)
46044 -{
46045 - struct mmc_data *data = host->data;
46046 - int data_error;
46047 -
46048 -#ifdef HAS_DMA
46049 - if (mxcmci_use_dma(host)) {
46050 - imx_dma_disable(host->dma);
46051 - dma_unmap_sg(mmc_dev(host->mmc), data->sg, host->dma_nents,
46052 - host->dma_dir);
46053 - }
46054 -#endif
46055 -
46056 - if (stat & STATUS_ERR_MASK) {
46057 - dev_dbg(mmc_dev(host->mmc), "request failed. status: 0x%08x\n",
46058 - stat);
46059 - if (stat & STATUS_CRC_READ_ERR) {
46060 - data->error = -EILSEQ;
46061 - } else if (stat & STATUS_CRC_WRITE_ERR) {
46062 - u32 err_code = (stat >> 9) & 0x3;
46063 - if (err_code == 2) /* No CRC response */
46064 - data->error = -ETIMEDOUT;
46065 - else
46066 - data->error = -EILSEQ;
46067 - } else if (stat & STATUS_TIME_OUT_READ) {
46068 - data->error = -ETIMEDOUT;
46069 - } else {
46070 - data->error = -EIO;
46071 - }
46072 - } else {
46073 - data->bytes_xfered = host->datasize;
46074 - }
46075 -
46076 - data_error = data->error;
46077 -
46078 - host->data = NULL;
46079 -
46080 - return data_error;
46081 -}
46082 -
46083 -static void mxcmci_read_response(struct mxcmci_host *host, unsigned int stat)
46084 -{
46085 - struct mmc_command *cmd = host->cmd;
46086 - int i;
46087 - u32 a, b, c;
46088 -
46089 - if (!cmd)
46090 - return;
46091 -
46092 - if (stat & STATUS_TIME_OUT_RESP) {
46093 - dev_dbg(mmc_dev(host->mmc), "CMD TIMEOUT\n");
46094 - cmd->error = -ETIMEDOUT;
46095 - } else if (stat & STATUS_RESP_CRC_ERR && cmd->flags & MMC_RSP_CRC) {
46096 - dev_dbg(mmc_dev(host->mmc), "cmd crc error\n");
46097 - cmd->error = -EILSEQ;
46098 - }
46099 -
46100 - if (cmd->flags & MMC_RSP_PRESENT) {
46101 - if (cmd->flags & MMC_RSP_136) {
46102 - for (i = 0; i < 4; i++) {
46103 - a = readw(host->base + MMC_REG_RES_FIFO);
46104 - b = readw(host->base + MMC_REG_RES_FIFO);
46105 - cmd->resp[i] = a << 16 | b;
46106 - }
46107 - } else {
46108 - a = readw(host->base + MMC_REG_RES_FIFO);
46109 - b = readw(host->base + MMC_REG_RES_FIFO);
46110 - c = readw(host->base + MMC_REG_RES_FIFO);
46111 - cmd->resp[0] = a << 24 | b << 8 | c >> 8;
46112 - }
46113 - }
46114 -}
46115 -
46116 -static int mxcmci_poll_status(struct mxcmci_host *host, u32 mask)
46117 -{
46118 - u32 stat;
46119 - unsigned long timeout = jiffies + HZ;
46120 -
46121 - do {
46122 - stat = readl(host->base + MMC_REG_STATUS);
46123 - if (stat & STATUS_ERR_MASK)
46124 - return stat;
46125 - if (time_after(jiffies, timeout))
46126 - return STATUS_TIME_OUT_READ;
46127 - if (stat & mask)
46128 - return 0;
46129 - cpu_relax();
46130 - } while (1);
46131 -}
46132 -
46133 -static int mxcmci_pull(struct mxcmci_host *host, void *_buf, int bytes)
46134 -{
46135 - unsigned int stat;
46136 - u32 *buf = _buf;
46137 -
46138 - while (bytes > 3) {
46139 - stat = mxcmci_poll_status(host,
46140 - STATUS_BUF_READ_RDY | STATUS_READ_OP_DONE);
46141 - if (stat)
46142 - return stat;
46143 - *buf++ = readl(host->base + MMC_REG_BUFFER_ACCESS);
46144 - bytes -= 4;
46145 - }
46146 -
46147 - if (bytes) {
46148 - u8 *b = (u8 *)buf;
46149 - u32 tmp;
46150 -
46151 - stat = mxcmci_poll_status(host,
46152 - STATUS_BUF_READ_RDY | STATUS_READ_OP_DONE);
46153 - if (stat)
46154 - return stat;
46155 - tmp = readl(host->base + MMC_REG_BUFFER_ACCESS);
46156 - memcpy(b, &tmp, bytes);
46157 - }
46158 -
46159 - return 0;
46160 -}
46161 -
46162 -static int mxcmci_push(struct mxcmci_host *host, void *_buf, int bytes)
46163 -{
46164 - unsigned int stat;
46165 - u32 *buf = _buf;
46166 -
46167 - while (bytes > 3) {
46168 - stat = mxcmci_poll_status(host, STATUS_BUF_WRITE_RDY);
46169 - if (stat)
46170 - return stat;
46171 - writel(*buf++, host->base + MMC_REG_BUFFER_ACCESS);
46172 - bytes -= 4;
46173 - }
46174 -
46175 - if (bytes) {
46176 - u8 *b = (u8 *)buf;
46177 - u32 tmp;
46178 -
46179 - stat = mxcmci_poll_status(host, STATUS_BUF_WRITE_RDY);
46180 - if (stat)
46181 - return stat;
46182 -
46183 - memcpy(&tmp, b, bytes);
46184 - writel(tmp, host->base + MMC_REG_BUFFER_ACCESS);
46185 - }
46186 -
46187 - stat = mxcmci_poll_status(host, STATUS_BUF_WRITE_RDY);
46188 - if (stat)
46189 - return stat;
46190 -
46191 - return 0;
46192 -}
46193 -
46194 -static int mxcmci_transfer_data(struct mxcmci_host *host)
46195 -{
46196 - struct mmc_data *data = host->req->data;
46197 - struct scatterlist *sg;
46198 - int stat, i;
46199 -
46200 - host->datasize = 0;
46201 -
46202 - host->data = data;
46203 - host->datasize = 0;
46204 -
46205 - if (data->flags & MMC_DATA_READ) {
46206 - for_each_sg(data->sg, sg, data->sg_len, i) {
46207 - stat = mxcmci_pull(host, sg_virt(sg), sg->length);
46208 - if (stat)
46209 - return stat;
46210 - host->datasize += sg->length;
46211 - }
46212 - } else {
46213 - for_each_sg(data->sg, sg, data->sg_len, i) {
46214 - stat = mxcmci_push(host, sg_virt(sg), sg->length);
46215 - if (stat)
46216 - return stat;
46217 - host->datasize += sg->length;
46218 - }
46219 - stat = mxcmci_poll_status(host, STATUS_WRITE_OP_DONE);
46220 - if (stat)
46221 - return stat;
46222 - }
46223 - return 0;
46224 -}
46225 -
46226 -static void mxcmci_datawork(struct work_struct *work)
46227 -{
46228 - struct mxcmci_host *host = container_of(work, struct mxcmci_host,
46229 - datawork);
46230 - int datastat = mxcmci_transfer_data(host);
46231 - mxcmci_finish_data(host, datastat);
46232 -
46233 - if (host->req->stop) {
46234 - if (mxcmci_start_cmd(host, host->req->stop, 0)) {
46235 - mxcmci_finish_request(host, host->req);
46236 - return;
46237 - }
46238 - } else {
46239 - mxcmci_finish_request(host, host->req);
46240 - }
46241 -}
46242 -
46243 -#ifdef HAS_DMA
46244 -static void mxcmci_data_done(struct mxcmci_host *host, unsigned int stat)
46245 -{
46246 - struct mmc_data *data = host->data;
46247 - int data_error;
46248 -
46249 - if (!data)
46250 - return;
46251 -
46252 - data_error = mxcmci_finish_data(host, stat);
46253 -
46254 - mxcmci_read_response(host, stat);
46255 - host->cmd = NULL;
46256 -
46257 - if (host->req->stop) {
46258 - if (mxcmci_start_cmd(host, host->req->stop, 0)) {
46259 - mxcmci_finish_request(host, host->req);
46260 - return;
46261 - }
46262 - } else {
46263 - mxcmci_finish_request(host, host->req);
46264 - }
46265 -}
46266 -#endif /* HAS_DMA */
46267 -
46268 -static void mxcmci_cmd_done(struct mxcmci_host *host, unsigned int stat)
46269 -{
46270 - mxcmci_read_response(host, stat);
46271 - host->cmd = NULL;
46272 -
46273 - if (!host->data && host->req) {
46274 - mxcmci_finish_request(host, host->req);
46275 - return;
46276 - }
46277 -
46278 - /* For the DMA case the DMA engine handles the data transfer
46279 - * automatically. For non DMA we have to to it ourselves.
46280 - * Don't do it in interrupt context though.
46281 - */
46282 - if (!mxcmci_use_dma(host) && host->data)
46283 - schedule_work(&host->datawork);
46284 -
46285 -}
46286 -
46287 -static irqreturn_t mxcmci_irq(int irq, void *devid)
46288 -{
46289 - struct mxcmci_host *host = devid;
46290 - u32 stat;
46291 -
46292 - stat = readl(host->base + MMC_REG_STATUS);
46293 - writel(stat, host->base + MMC_REG_STATUS);
46294 -
46295 - dev_dbg(mmc_dev(host->mmc), "%s: 0x%08x\n", __func__, stat);
46296 -
46297 - if (stat & STATUS_END_CMD_RESP)
46298 - mxcmci_cmd_done(host, stat);
46299 -#ifdef HAS_DMA
46300 - if (mxcmci_use_dma(host) &&
46301 - (stat & (STATUS_DATA_TRANS_DONE | STATUS_WRITE_OP_DONE)))
46302 - mxcmci_data_done(host, stat);
46303 -#endif
46304 - return IRQ_HANDLED;
46305 -}
46306 -
46307 -static void mxcmci_request(struct mmc_host *mmc, struct mmc_request *req)
46308 -{
46309 - struct mxcmci_host *host = mmc_priv(mmc);
46310 - unsigned int cmdat = host->cmdat;
46311 -
46312 - WARN_ON(host->req != NULL);
46313 -
46314 - host->req = req;
46315 - host->cmdat &= ~CMD_DAT_CONT_INIT;
46316 -#ifdef HAS_DMA
46317 - host->do_dma = 1;
46318 -#endif
46319 - if (req->data) {
46320 - mxcmci_setup_data(host, req->data);
46321 -
46322 - cmdat |= CMD_DAT_CONT_DATA_ENABLE;
46323 -
46324 - if (req->data->flags & MMC_DATA_WRITE)
46325 - cmdat |= CMD_DAT_CONT_WRITE;
46326 - }
46327 -
46328 - if (mxcmci_start_cmd(host, req->cmd, cmdat))
46329 - mxcmci_finish_request(host, req);
46330 -}
46331 -
46332 -static void mxcmci_set_clk_rate(struct mxcmci_host *host, unsigned int clk_ios)
46333 -{
46334 - unsigned int divider;
46335 - int prescaler = 0;
46336 - unsigned int clk_in = clk_get_rate(host->clk);
46337 -
46338 - while (prescaler <= 0x800) {
46339 - for (divider = 1; divider <= 0xF; divider++) {
46340 - int x;
46341 -
46342 - x = (clk_in / (divider + 1));
46343 -
46344 - if (prescaler)
46345 - x /= (prescaler * 2);
46346 -
46347 - if (x <= clk_ios)
46348 - break;
46349 - }
46350 - if (divider < 0x10)
46351 - break;
46352 -
46353 - if (prescaler == 0)
46354 - prescaler = 1;
46355 - else
46356 - prescaler <<= 1;
46357 - }
46358 -
46359 - writew((prescaler << 4) | divider, host->base + MMC_REG_CLK_RATE);
46360 -
46361 - dev_dbg(mmc_dev(host->mmc), "scaler: %d divider: %d in: %d out: %d\n",
46362 - prescaler, divider, clk_in, clk_ios);
46363 -}
46364 -
46365 -static void mxcmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
46366 -{
46367 - struct mxcmci_host *host = mmc_priv(mmc);
46368 -#ifdef HAS_DMA
46369 - unsigned int blen;
46370 - /*
46371 - * use burstlen of 64 in 4 bit mode (--> reg value 0)
46372 - * use burstlen of 16 in 1 bit mode (--> reg value 16)
46373 - */
46374 - if (ios->bus_width == MMC_BUS_WIDTH_4)
46375 - blen = 0;
46376 - else
46377 - blen = 16;
46378 -
46379 - imx_dma_config_burstlen(host->dma, blen);
46380 -#endif
46381 - if (ios->bus_width == MMC_BUS_WIDTH_4)
46382 - host->cmdat |= CMD_DAT_CONT_BUS_WIDTH_4;
46383 - else
46384 - host->cmdat &= ~CMD_DAT_CONT_BUS_WIDTH_4;
46385 -
46386 - if (host->power_mode != ios->power_mode) {
46387 - if (host->pdata && host->pdata->setpower)
46388 - host->pdata->setpower(mmc_dev(mmc), ios->vdd);
46389 - host->power_mode = ios->power_mode;
46390 - if (ios->power_mode == MMC_POWER_ON)
46391 - host->cmdat |= CMD_DAT_CONT_INIT;
46392 - }
46393 -
46394 - if (ios->clock) {
46395 - mxcmci_set_clk_rate(host, ios->clock);
46396 - writew(STR_STP_CLK_START_CLK, host->base + MMC_REG_STR_STP_CLK);
46397 - } else {
46398 - writew(STR_STP_CLK_STOP_CLK, host->base + MMC_REG_STR_STP_CLK);
46399 - }
46400 -
46401 - host->clock = ios->clock;
46402 -}
46403 -
46404 -static irqreturn_t mxcmci_detect_irq(int irq, void *data)
46405 -{
46406 - struct mmc_host *mmc = data;
46407 -
46408 - dev_dbg(mmc_dev(mmc), "%s\n", __func__);
46409 -
46410 - mmc_detect_change(mmc, msecs_to_jiffies(250));
46411 - return IRQ_HANDLED;
46412 -}
46413 -
46414 -static int mxcmci_get_ro(struct mmc_host *mmc)
46415 -{
46416 - struct mxcmci_host *host = mmc_priv(mmc);
46417 -
46418 - if (host->pdata && host->pdata->get_ro)
46419 - return !!host->pdata->get_ro(mmc_dev(mmc));
46420 - /*
46421 - * Board doesn't support read only detection; let the mmc core
46422 - * decide what to do.
46423 - */
46424 - return -ENOSYS;
46425 -}
46426 -
46427 -
46428 -static const struct mmc_host_ops mxcmci_ops = {
46429 - .request = mxcmci_request,
46430 - .set_ios = mxcmci_set_ios,
46431 - .get_ro = mxcmci_get_ro,
46432 -};
46433 -
46434 -static int mxcmci_probe(struct platform_device *pdev)
46435 -{
46436 - struct mmc_host *mmc;
46437 - struct mxcmci_host *host = NULL;
46438 - struct resource *r;
46439 - int ret = 0, irq;
46440 -
46441 - printk(KERN_INFO "i.MX SDHC driver\n");
46442 -
46443 - r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
46444 - irq = platform_get_irq(pdev, 0);
46445 - if (!r || irq < 0)
46446 - return -EINVAL;
46447 -
46448 - r = request_mem_region(r->start, resource_size(r), pdev->name);
46449 - if (!r)
46450 - return -EBUSY;
46451 -
46452 - mmc = mmc_alloc_host(sizeof(struct mxcmci_host), &pdev->dev);
46453 - if (!mmc) {
46454 - ret = -ENOMEM;
46455 - goto out_release_mem;
46456 - }
46457 -
46458 - mmc->ops = &mxcmci_ops;
46459 - mmc->caps = MMC_CAP_4_BIT_DATA;
46460 -
46461 - /* MMC core transfer sizes tunable parameters */
46462 - mmc->max_hw_segs = 64;
46463 - mmc->max_phys_segs = 64;
46464 - mmc->max_blk_size = 2048;
46465 - mmc->max_blk_count = 65535;
46466 - mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count;
46467 - mmc->max_seg_size = mmc->max_seg_size;
46468 -
46469 - host = mmc_priv(mmc);
46470 - host->base = ioremap(r->start, resource_size(r));
46471 - if (!host->base) {
46472 - ret = -ENOMEM;
46473 - goto out_free;
46474 - }
46475 -
46476 - host->mmc = mmc;
46477 - host->pdata = pdev->dev.platform_data;
46478 -
46479 - if (host->pdata && host->pdata->ocr_avail)
46480 - mmc->ocr_avail = host->pdata->ocr_avail;
46481 - else
46482 - mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
46483 -
46484 - host->res = r;
46485 - host->irq = irq;
46486 -
46487 - host->clk = clk_get(&pdev->dev, "sdhc_clk");
46488 - if (IS_ERR(host->clk)) {
46489 - ret = PTR_ERR(host->clk);
46490 - goto out_iounmap;
46491 - }
46492 - clk_enable(host->clk);
46493 -
46494 - mxcmci_softreset(host);
46495 -
46496 - host->rev_no = readw(host->base + MMC_REG_REV_NO);
46497 - if (host->rev_no != 0x400) {
46498 - ret = -ENODEV;
46499 - dev_err(mmc_dev(host->mmc), "wrong rev.no. 0x%08x. aborting.\n",
46500 - host->rev_no);
46501 - goto out_clk_put;
46502 - }
46503 -
46504 - mmc->f_min = clk_get_rate(host->clk) >> 7;
46505 - mmc->f_max = clk_get_rate(host->clk) >> 1;
46506 -
46507 - /* recommended in data sheet */
46508 - writew(0x2db4, host->base + MMC_REG_READ_TO);
46509 -
46510 - writel(0, host->base + MMC_REG_INT_CNTR);
46511 -
46512 -#ifdef HAS_DMA
46513 - host->dma = imx_dma_request_by_prio(DRIVER_NAME, DMA_PRIO_LOW);
46514 - if (host->dma < 0) {
46515 - dev_err(mmc_dev(host->mmc), "imx_dma_request_by_prio failed\n");
46516 - ret = -EBUSY;
46517 - goto out_clk_put;
46518 - }
46519 -
46520 - r = platform_get_resource(pdev, IORESOURCE_DMA, 0);
46521 - if (!r) {
46522 - ret = -EINVAL;
46523 - goto out_free_dma;
46524 - }
46525 -
46526 - ret = imx_dma_config_channel(host->dma,
46527 - IMX_DMA_MEMSIZE_32 | IMX_DMA_TYPE_FIFO,
46528 - IMX_DMA_MEMSIZE_32 | IMX_DMA_TYPE_LINEAR,
46529 - r->start, 0);
46530 - if (ret) {
46531 - dev_err(mmc_dev(host->mmc), "failed to config DMA channel\n");
46532 - goto out_free_dma;
46533 - }
46534 -#endif
46535 - INIT_WORK(&host->datawork, mxcmci_datawork);
46536 -
46537 - ret = request_irq(host->irq, mxcmci_irq, 0, DRIVER_NAME, host);
46538 - if (ret)
46539 - goto out_free_dma;
46540 -
46541 - platform_set_drvdata(pdev, mmc);
46542 -
46543 - if (host->pdata && host->pdata->init) {
46544 - ret = host->pdata->init(&pdev->dev, mxcmci_detect_irq,
46545 - host->mmc);
46546 - if (ret)
46547 - goto out_free_irq;
46548 - }
46549 -
46550 - mmc_add_host(mmc);
46551 -
46552 - return 0;
46553 -
46554 -out_free_irq:
46555 - free_irq(host->irq, host);
46556 -out_free_dma:
46557 -#ifdef HAS_DMA
46558 - imx_dma_free(host->dma);
46559 -#endif
46560 -out_clk_put:
46561 - clk_disable(host->clk);
46562 - clk_put(host->clk);
46563 -out_iounmap:
46564 - iounmap(host->base);
46565 -out_free:
46566 - mmc_free_host(mmc);
46567 -out_release_mem:
46568 - release_mem_region(host->res->start, resource_size(host->res));
46569 - return ret;
46570 -}
46571 -
46572 -static int mxcmci_remove(struct platform_device *pdev)
46573 -{
46574 - struct mmc_host *mmc = platform_get_drvdata(pdev);
46575 - struct mxcmci_host *host = mmc_priv(mmc);
46576 -
46577 - platform_set_drvdata(pdev, NULL);
46578 -
46579 - mmc_remove_host(mmc);
46580 -
46581 - if (host->pdata && host->pdata->exit)
46582 - host->pdata->exit(&pdev->dev, mmc);
46583 -
46584 - free_irq(host->irq, host);
46585 - iounmap(host->base);
46586 -#ifdef HAS_DMA
46587 - imx_dma_free(host->dma);
46588 -#endif
46589 - clk_disable(host->clk);
46590 - clk_put(host->clk);
46591 -
46592 - release_mem_region(host->res->start, resource_size(host->res));
46593 - release_resource(host->res);
46594 -
46595 - mmc_free_host(mmc);
46596 -
46597 - return 0;
46598 -}
46599 -
46600 -#ifdef CONFIG_PM
46601 -static int mxcmci_suspend(struct platform_device *dev, pm_message_t state)
46602 -{
46603 - struct mmc_host *mmc = platform_get_drvdata(dev);
46604 - int ret = 0;
46605 -
46606 - if (mmc)
46607 - ret = mmc_suspend_host(mmc, state);
46608 -
46609 - return ret;
46610 -}
46611 -
46612 -static int mxcmci_resume(struct platform_device *dev)
46613 -{
46614 - struct mmc_host *mmc = platform_get_drvdata(dev);
46615 - struct mxcmci_host *host;
46616 - int ret = 0;
46617 -
46618 - if (mmc) {
46619 - host = mmc_priv(mmc);
46620 - ret = mmc_resume_host(mmc);
46621 - }
46622 -
46623 - return ret;
46624 -}
46625 -#else
46626 -#define mxcmci_suspend NULL
46627 -#define mxcmci_resume NULL
46628 -#endif /* CONFIG_PM */
46629 -
46630 -static struct platform_driver mxcmci_driver = {
46631 - .probe = mxcmci_probe,
46632 - .remove = mxcmci_remove,
46633 - .suspend = mxcmci_suspend,
46634 - .resume = mxcmci_resume,
46635 - .driver = {
46636 - .name = DRIVER_NAME,
46637 - .owner = THIS_MODULE,
46638 - }
46639 -};
46640 -
46641 -static int __init mxcmci_init(void)
46642 -{
46643 - return platform_driver_register(&mxcmci_driver);
46644 -}
46645 -
46646 -static void __exit mxcmci_exit(void)
46647 -{
46648 - platform_driver_unregister(&mxcmci_driver);
46649 -}
46650 -
46651 -module_init(mxcmci_init);
46652 -module_exit(mxcmci_exit);
46653 -
46654 -MODULE_DESCRIPTION("i.MX Multimedia Card Interface Driver");
46655 -MODULE_AUTHOR("Sascha Hauer, Pengutronix");
46656 -MODULE_LICENSE("GPL");
46657 -MODULE_ALIAS("platform:imx-mmc");
46658 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mmc/host/omap_hsmmc.c linux-2.6.29-rc3.owrt/drivers/mmc/host/omap_hsmmc.c
46659 --- linux-2.6.29.owrt/drivers/mmc/host/omap_hsmmc.c 2009-05-10 22:04:38.000000000 +0200
46660 +++ linux-2.6.29-rc3.owrt/drivers/mmc/host/omap_hsmmc.c 2009-05-10 23:48:28.000000000 +0200
46661 @@ -55,7 +55,6 @@
46662 #define VS30 (1 << 25)
46663 #define SDVS18 (0x5 << 9)
46664 #define SDVS30 (0x6 << 9)
46665 -#define SDVS33 (0x7 << 9)
46666 #define SDVSCLR 0xFFFFF1FF
46667 #define SDVSDET 0x00000400
46668 #define AUTOIDLE 0x1
46669 @@ -376,32 +375,6 @@
46670 }
46671 #endif /* CONFIG_MMC_DEBUG */
46672
46673 -/*
46674 - * MMC controller internal state machines reset
46675 - *
46676 - * Used to reset command or data internal state machines, using respectively
46677 - * SRC or SRD bit of SYSCTL register
46678 - * Can be called from interrupt context
46679 - */
46680 -static inline void mmc_omap_reset_controller_fsm(struct mmc_omap_host *host,
46681 - unsigned long bit)
46682 -{
46683 - unsigned long i = 0;
46684 - unsigned long limit = (loops_per_jiffy *
46685 - msecs_to_jiffies(MMC_TIMEOUT_MS));
46686 -
46687 - OMAP_HSMMC_WRITE(host->base, SYSCTL,
46688 - OMAP_HSMMC_READ(host->base, SYSCTL) | bit);
46689 -
46690 - while ((OMAP_HSMMC_READ(host->base, SYSCTL) & bit) &&
46691 - (i++ < limit))
46692 - cpu_relax();
46693 -
46694 - if (OMAP_HSMMC_READ(host->base, SYSCTL) & bit)
46695 - dev_err(mmc_dev(host->mmc),
46696 - "Timeout waiting on controller reset in %s\n",
46697 - __func__);
46698 -}
46699
46700 /*
46701 * MMC controller IRQ handler
46702 @@ -430,17 +403,21 @@
46703 (status & CMD_CRC)) {
46704 if (host->cmd) {
46705 if (status & CMD_TIMEOUT) {
46706 - mmc_omap_reset_controller_fsm(host, SRC);
46707 + OMAP_HSMMC_WRITE(host->base, SYSCTL,
46708 + OMAP_HSMMC_READ(host->base,
46709 + SYSCTL) | SRC);
46710 + while (OMAP_HSMMC_READ(host->base,
46711 + SYSCTL) & SRC)
46712 + ;
46713 +
46714 host->cmd->error = -ETIMEDOUT;
46715 } else {
46716 host->cmd->error = -EILSEQ;
46717 }
46718 end_cmd = 1;
46719 }
46720 - if (host->data) {
46721 + if (host->data)
46722 mmc_dma_cleanup(host);
46723 - mmc_omap_reset_controller_fsm(host, SRD);
46724 - }
46725 }
46726 if ((status & DATA_TIMEOUT) ||
46727 (status & DATA_CRC)) {
46728 @@ -449,7 +426,12 @@
46729 mmc_dma_cleanup(host);
46730 else
46731 host->data->error = -EILSEQ;
46732 - mmc_omap_reset_controller_fsm(host, SRD);
46733 + OMAP_HSMMC_WRITE(host->base, SYSCTL,
46734 + OMAP_HSMMC_READ(host->base,
46735 + SYSCTL) | SRD);
46736 + while (OMAP_HSMMC_READ(host->base,
46737 + SYSCTL) & SRD)
46738 + ;
46739 end_trans = 1;
46740 }
46741 }
46742 @@ -474,20 +456,13 @@
46743 }
46744
46745 /*
46746 - * Switch MMC interface voltage ... only relevant for MMC1.
46747 - *
46748 - * MMC2 and MMC3 use fixed 1.8V levels, and maybe a transceiver.
46749 - * The MMC2 transceiver controls are used instead of DAT4..DAT7.
46750 - * Some chips, like eMMC ones, use internal transceivers.
46751 + * Switch MMC operating voltage
46752 */
46753 static int omap_mmc_switch_opcond(struct mmc_omap_host *host, int vdd)
46754 {
46755 u32 reg_val = 0;
46756 int ret;
46757
46758 - if (host->id != OMAP_MMC1_DEVID)
46759 - return 0;
46760 -
46761 /* Disable the clocks */
46762 clk_disable(host->fclk);
46763 clk_disable(host->iclk);
46764 @@ -510,26 +485,19 @@
46765 OMAP_HSMMC_WRITE(host->base, HCTL,
46766 OMAP_HSMMC_READ(host->base, HCTL) & SDVSCLR);
46767 reg_val = OMAP_HSMMC_READ(host->base, HCTL);
46768 -
46769 /*
46770 * If a MMC dual voltage card is detected, the set_ios fn calls
46771 * this fn with VDD bit set for 1.8V. Upon card removal from the
46772 * slot, omap_mmc_set_ios sets the VDD back to 3V on MMC_POWER_OFF.
46773 *
46774 - * Cope with a bit of slop in the range ... per data sheets:
46775 - * - "1.8V" for vdds_mmc1/vdds_mmc1a can be up to 2.45V max,
46776 - * but recommended values are 1.71V to 1.89V
46777 - * - "3.0V" for vdds_mmc1/vdds_mmc1a can be up to 3.5V max,
46778 - * but recommended values are 2.7V to 3.3V
46779 - *
46780 - * Board setup code shouldn't permit anything very out-of-range.
46781 - * TWL4030-family VMMC1 and VSIM regulators are fine (avoiding the
46782 - * middle range) but VSIM can't power DAT4..DAT7 at more than 3V.
46783 + * Only MMC1 supports 3.0V. MMC2 will not function if SDVS30 is
46784 + * set in HCTL.
46785 */
46786 - if ((1 << vdd) <= MMC_VDD_23_24)
46787 - reg_val |= SDVS18;
46788 - else
46789 + if (host->id == OMAP_MMC1_DEVID && (((1 << vdd) == MMC_VDD_32_33) ||
46790 + ((1 << vdd) == MMC_VDD_33_34)))
46791 reg_val |= SDVS30;
46792 + if ((1 << vdd) == MMC_VDD_165_195)
46793 + reg_val |= SDVS18;
46794
46795 OMAP_HSMMC_WRITE(host->base, HCTL, reg_val);
46796
46797 @@ -549,15 +517,16 @@
46798 {
46799 struct mmc_omap_host *host = container_of(work, struct mmc_omap_host,
46800 mmc_carddetect_work);
46801 - struct omap_mmc_slot_data *slot = &mmc_slot(host);
46802 -
46803 - host->carddetect = slot->card_detect(slot->card_detect_irq);
46804
46805 sysfs_notify(&host->mmc->class_dev.kobj, NULL, "cover_switch");
46806 if (host->carddetect) {
46807 mmc_detect_change(host->mmc, (HZ * 200) / 1000);
46808 } else {
46809 - mmc_omap_reset_controller_fsm(host, SRD);
46810 + OMAP_HSMMC_WRITE(host->base, SYSCTL,
46811 + OMAP_HSMMC_READ(host->base, SYSCTL) | SRD);
46812 + while (OMAP_HSMMC_READ(host->base, SYSCTL) & SRD)
46813 + ;
46814 +
46815 mmc_detect_change(host->mmc, (HZ * 50) / 1000);
46816 }
46817 }
46818 @@ -569,6 +538,7 @@
46819 {
46820 struct mmc_omap_host *host = (struct mmc_omap_host *)dev_id;
46821
46822 + host->carddetect = mmc_slot(host).card_detect(irq);
46823 schedule_work(&host->mmc_carddetect_work);
46824
46825 return IRQ_HANDLED;
46826 @@ -787,14 +757,10 @@
46827 case MMC_POWER_OFF:
46828 mmc_slot(host).set_power(host->dev, host->slot_id, 0, 0);
46829 /*
46830 - * Reset interface voltage to 3V if it's 1.8V now;
46831 - * only relevant on MMC-1, the others always use 1.8V.
46832 - *
46833 + * Reset bus voltage to 3V if it got set to 1.8V earlier.
46834 * REVISIT: If we are able to detect cards after unplugging
46835 * a 1.8V card, this code should not be needed.
46836 */
46837 - if (host->id != OMAP_MMC1_DEVID)
46838 - break;
46839 if (!(OMAP_HSMMC_READ(host->base, HCTL) & SDVSDET)) {
46840 int vdd = fls(host->mmc->ocr_avail) - 1;
46841 if (omap_mmc_switch_opcond(host, vdd) != 0)
46842 @@ -818,9 +784,7 @@
46843 }
46844
46845 if (host->id == OMAP_MMC1_DEVID) {
46846 - /* Only MMC1 can interface at 3V without some flavor
46847 - * of external transceiver; but they all handle 1.8V.
46848 - */
46849 + /* Only MMC1 can operate at 3V/1.8V */
46850 if ((OMAP_HSMMC_READ(host->base, HCTL) & SDVSDET) &&
46851 (ios->vdd == DUAL_VOLT_OCR_BIT)) {
46852 /*
46853 @@ -1173,9 +1137,7 @@
46854 " level suspend\n");
46855 }
46856
46857 - if (host->id == OMAP_MMC1_DEVID
46858 - && !(OMAP_HSMMC_READ(host->base, HCTL)
46859 - & SDVSDET)) {
46860 + if (!(OMAP_HSMMC_READ(host->base, HCTL) & SDVSDET)) {
46861 OMAP_HSMMC_WRITE(host->base, HCTL,
46862 OMAP_HSMMC_READ(host->base, HCTL)
46863 & SDVSCLR);
46864 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mmc/host/pxamci.c linux-2.6.29-rc3.owrt/drivers/mmc/host/pxamci.c
46865 --- linux-2.6.29.owrt/drivers/mmc/host/pxamci.c 2009-05-10 22:04:38.000000000 +0200
46866 +++ linux-2.6.29-rc3.owrt/drivers/mmc/host/pxamci.c 2009-05-10 23:48:28.000000000 +0200
46867 @@ -180,15 +180,7 @@
46868 else
46869 DALGN &= ~(1 << host->dma);
46870 DDADR(host->dma) = host->sg_dma;
46871 -
46872 - /*
46873 - * workaround for erratum #91:
46874 - * only start DMA now if we are doing a read,
46875 - * otherwise we wait until CMD/RESP has finished
46876 - * before starting DMA.
46877 - */
46878 - if (!cpu_is_pxa27x() || data->flags & MMC_DATA_READ)
46879 - DCSR(host->dma) = DCSR_RUN;
46880 + DCSR(host->dma) = DCSR_RUN;
46881 }
46882
46883 static void pxamci_start_cmd(struct pxamci_host *host, struct mmc_command *cmd, unsigned int cmdat)
46884 @@ -259,28 +251,23 @@
46885 if (stat & STAT_TIME_OUT_RESPONSE) {
46886 cmd->error = -ETIMEDOUT;
46887 } else if (stat & STAT_RES_CRC_ERR && cmd->flags & MMC_RSP_CRC) {
46888 +#ifdef CONFIG_PXA27x
46889 /*
46890 * workaround for erratum #42:
46891 * Intel PXA27x Family Processor Specification Update Rev 001
46892 * A bogus CRC error can appear if the msb of a 136 bit
46893 * response is a one.
46894 */
46895 - if (cpu_is_pxa27x() &&
46896 - (cmd->flags & MMC_RSP_136 && cmd->resp[0] & 0x80000000))
46897 + if (cmd->flags & MMC_RSP_136 && cmd->resp[0] & 0x80000000) {
46898 pr_debug("ignoring CRC from command %d - *risky*\n", cmd->opcode);
46899 - else
46900 - cmd->error = -EILSEQ;
46901 + } else
46902 +#endif
46903 + cmd->error = -EILSEQ;
46904 }
46905
46906 pxamci_disable_irq(host, END_CMD_RES);
46907 if (host->data && !cmd->error) {
46908 pxamci_enable_irq(host, DATA_TRAN_DONE);
46909 - /*
46910 - * workaround for erratum #91, if doing write
46911 - * enable DMA late
46912 - */
46913 - if (cpu_is_pxa27x() && host->data->flags & MMC_DATA_WRITE)
46914 - DCSR(host->dma) = DCSR_RUN;
46915 } else {
46916 pxamci_finish_request(host, host->mrq);
46917 }
46918 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mmc/host/ricoh_mmc.c linux-2.6.29-rc3.owrt/drivers/mmc/host/ricoh_mmc.c
46919 --- linux-2.6.29.owrt/drivers/mmc/host/ricoh_mmc.c 2009-05-10 22:04:38.000000000 +0200
46920 +++ linux-2.6.29-rc3.owrt/drivers/mmc/host/ricoh_mmc.c 2009-05-10 23:48:28.000000000 +0200
46921 @@ -196,7 +196,7 @@
46922 pci_set_drvdata(pdev, NULL);
46923 }
46924
46925 -static int ricoh_mmc_suspend_late(struct pci_dev *pdev, pm_message_t state)
46926 +static int ricoh_mmc_suspend(struct pci_dev *pdev, pm_message_t state)
46927 {
46928 struct pci_dev *fw_dev = NULL;
46929
46930 @@ -210,7 +210,7 @@
46931 return 0;
46932 }
46933
46934 -static int ricoh_mmc_resume_early(struct pci_dev *pdev)
46935 +static int ricoh_mmc_resume(struct pci_dev *pdev)
46936 {
46937 struct pci_dev *fw_dev = NULL;
46938
46939 @@ -229,8 +229,8 @@
46940 .id_table = pci_ids,
46941 .probe = ricoh_mmc_probe,
46942 .remove = __devexit_p(ricoh_mmc_remove),
46943 - .suspend_late = ricoh_mmc_suspend_late,
46944 - .resume_early = ricoh_mmc_resume_early,
46945 + .suspend = ricoh_mmc_suspend,
46946 + .resume = ricoh_mmc_resume,
46947 };
46948
46949 /*****************************************************************************\
46950 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mmc/host/s3cmci.c linux-2.6.29-rc3.owrt/drivers/mmc/host/s3cmci.c
46951 --- linux-2.6.29.owrt/drivers/mmc/host/s3cmci.c 2009-05-10 22:04:38.000000000 +0200
46952 +++ linux-2.6.29-rc3.owrt/drivers/mmc/host/s3cmci.c 2009-05-10 23:48:28.000000000 +0200
46953 @@ -329,7 +329,7 @@
46954
46955 to_ptr = host->base + host->sdidata;
46956
46957 - while ((fifo = fifo_free(host)) > 3) {
46958 + while ((fifo = fifo_free(host))) {
46959 if (!host->pio_bytes) {
46960 res = get_data_buffer(host, &host->pio_bytes,
46961 &host->pio_ptr);
46962 @@ -793,7 +793,8 @@
46963 host->mem->start + host->sdidata);
46964
46965 if (!setup_ok) {
46966 - s3c2410_dma_config(host->dma, 4, 0);
46967 + s3c2410_dma_config(host->dma, 4,
46968 + (S3C2410_DCON_HWTRIG | S3C2410_DCON_CH0_SDI));
46969 s3c2410_dma_set_buffdone_fn(host->dma,
46970 s3cmci_dma_done_callback);
46971 s3c2410_dma_setflags(host->dma, S3C2410_DMAF_AUTOSTART);
46972 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mmc/host/sdhci.c linux-2.6.29-rc3.owrt/drivers/mmc/host/sdhci.c
46973 --- linux-2.6.29.owrt/drivers/mmc/host/sdhci.c 2009-05-10 22:04:38.000000000 +0200
46974 +++ linux-2.6.29-rc3.owrt/drivers/mmc/host/sdhci.c 2009-05-10 23:48:28.000000000 +0200
46975 @@ -1291,11 +1291,8 @@
46976 if (host->cmd->data)
46977 DBG("Cannot wait for busy signal when also "
46978 "doing a data transfer");
46979 - else if (!(host->quirks & SDHCI_QUIRK_NO_BUSY_IRQ))
46980 + else
46981 return;
46982 -
46983 - /* The controller does not support the end-of-busy IRQ,
46984 - * fall through and take the SDHCI_INT_RESPONSE */
46985 }
46986
46987 if (intmask & SDHCI_INT_RESPONSE)
46988 @@ -1639,7 +1636,8 @@
46989 mmc->f_max = host->max_clk;
46990 mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ;
46991
46992 - if (caps & SDHCI_CAN_DO_HISPD)
46993 + if ((caps & SDHCI_CAN_DO_HISPD) ||
46994 + (host->quirks & SDHCI_QUIRK_FORCE_HIGHSPEED))
46995 mmc->caps |= MMC_CAP_SD_HIGHSPEED;
46996
46997 mmc->ocr_avail = 0;
46998 @@ -1725,9 +1723,7 @@
46999 #endif
47000
47001 #ifdef SDHCI_USE_LEDS_CLASS
47002 - snprintf(host->led_name, sizeof(host->led_name),
47003 - "%s::", mmc_hostname(mmc));
47004 - host->led.name = host->led_name;
47005 + host->led.name = mmc_hostname(mmc);
47006 host->led.brightness = LED_OFF;
47007 host->led.default_trigger = mmc_hostname(mmc);
47008 host->led.brightness_set = sdhci_led_control;
47009 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mmc/host/sdhci.h linux-2.6.29-rc3.owrt/drivers/mmc/host/sdhci.h
47010 --- linux-2.6.29.owrt/drivers/mmc/host/sdhci.h 2009-05-10 22:04:38.000000000 +0200
47011 +++ linux-2.6.29-rc3.owrt/drivers/mmc/host/sdhci.h 2009-05-10 23:48:28.000000000 +0200
47012 @@ -208,8 +208,8 @@
47013 #define SDHCI_QUIRK_BROKEN_TIMEOUT_VAL (1<<12)
47014 /* Controller has an issue with buffer bits for small transfers */
47015 #define SDHCI_QUIRK_BROKEN_SMALL_PIO (1<<13)
47016 -/* Controller does not provide transfer-complete interrupt when not busy */
47017 -#define SDHCI_QUIRK_NO_BUSY_IRQ (1<<14)
47018 +/* Controller supports high speed but doesn't have the caps bit set */
47019 +#define SDHCI_QUIRK_FORCE_HIGHSPEED (1<<14)
47020
47021 int irq; /* Device IRQ */
47022 void __iomem * ioaddr; /* Mapped address */
47023 @@ -222,7 +222,6 @@
47024
47025 #if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
47026 struct led_classdev led; /* LED control */
47027 - char led_name[32];
47028 #endif
47029
47030 spinlock_t lock; /* Mutex */
47031 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mmc/host/sdhci-pci.c linux-2.6.29-rc3.owrt/drivers/mmc/host/sdhci-pci.c
47032 --- linux-2.6.29.owrt/drivers/mmc/host/sdhci-pci.c 2009-05-10 22:04:38.000000000 +0200
47033 +++ linux-2.6.29-rc3.owrt/drivers/mmc/host/sdhci-pci.c 2009-05-10 23:48:28.000000000 +0200
47034 @@ -107,7 +107,6 @@
47035
47036 static const struct sdhci_pci_fixes sdhci_cafe = {
47037 .quirks = SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER |
47038 - SDHCI_QUIRK_NO_BUSY_IRQ |
47039 SDHCI_QUIRK_BROKEN_TIMEOUT_VAL,
47040 };
47041
47042 @@ -145,7 +144,8 @@
47043 SDHCI_QUIRK_32BIT_DMA_SIZE |
47044 SDHCI_QUIRK_32BIT_ADMA_SIZE |
47045 SDHCI_QUIRK_RESET_AFTER_REQUEST |
47046 - SDHCI_QUIRK_BROKEN_SMALL_PIO;
47047 + SDHCI_QUIRK_BROKEN_SMALL_PIO |
47048 + SDHCI_QUIRK_FORCE_HIGHSPEED;
47049 }
47050
47051 /*
47052 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mtd/chips/map_rom.c linux-2.6.29-rc3.owrt/drivers/mtd/chips/map_rom.c
47053 --- linux-2.6.29.owrt/drivers/mtd/chips/map_rom.c 2009-05-10 22:04:39.000000000 +0200
47054 +++ linux-2.6.29-rc3.owrt/drivers/mtd/chips/map_rom.c 2009-05-10 23:48:28.000000000 +0200
47055 @@ -19,7 +19,6 @@
47056 static int maprom_write (struct mtd_info *, loff_t, size_t, size_t *, const u_char *);
47057 static void maprom_nop (struct mtd_info *);
47058 static struct mtd_info *map_rom_probe(struct map_info *map);
47059 -static int maprom_erase (struct mtd_info *mtd, struct erase_info *info);
47060
47061 static struct mtd_chip_driver maprom_chipdrv = {
47062 .probe = map_rom_probe,
47063 @@ -43,7 +42,6 @@
47064 mtd->read = maprom_read;
47065 mtd->write = maprom_write;
47066 mtd->sync = maprom_nop;
47067 - mtd->erase = maprom_erase;
47068 mtd->flags = MTD_CAP_ROM;
47069 mtd->erasesize = map->size;
47070 mtd->writesize = 1;
47071 @@ -73,12 +71,6 @@
47072 return -EIO;
47073 }
47074
47075 -static int maprom_erase (struct mtd_info *mtd, struct erase_info *info)
47076 -{
47077 - /* We do our best 8) */
47078 - return -EROFS;
47079 -}
47080 -
47081 static int __init map_rom_init(void)
47082 {
47083 register_mtd_chip_driver(&maprom_chipdrv);
47084 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mtd/devices/Kconfig linux-2.6.29-rc3.owrt/drivers/mtd/devices/Kconfig
47085 --- linux-2.6.29.owrt/drivers/mtd/devices/Kconfig 2009-05-10 22:04:39.000000000 +0200
47086 +++ linux-2.6.29-rc3.owrt/drivers/mtd/devices/Kconfig 2009-05-10 23:48:28.000000000 +0200
47087 @@ -120,6 +120,13 @@
47088 doesn't have access to, memory beyond the mem=xxx limit, nvram,
47089 memory on the video card, etc...
47090
47091 +config MTD_PS3VRAM
47092 + tristate "PS3 video RAM"
47093 + depends on FB_PS3
47094 + help
47095 + This driver allows you to use excess PS3 video RAM as volatile
47096 + storage or system swap.
47097 +
47098 config MTD_LART
47099 tristate "28F160xx flash driver for LART"
47100 depends on SA1100_LART
47101 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mtd/devices/Makefile linux-2.6.29-rc3.owrt/drivers/mtd/devices/Makefile
47102 --- linux-2.6.29.owrt/drivers/mtd/devices/Makefile 2009-05-10 22:04:39.000000000 +0200
47103 +++ linux-2.6.29-rc3.owrt/drivers/mtd/devices/Makefile 2009-05-10 23:48:28.000000000 +0200
47104 @@ -16,3 +16,4 @@
47105 obj-$(CONFIG_MTD_BLOCK2MTD) += block2mtd.o
47106 obj-$(CONFIG_MTD_DATAFLASH) += mtd_dataflash.o
47107 obj-$(CONFIG_MTD_M25P80) += m25p80.o
47108 +obj-$(CONFIG_MTD_PS3VRAM) += ps3vram.o
47109 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mtd/devices/mtd_dataflash.c linux-2.6.29-rc3.owrt/drivers/mtd/devices/mtd_dataflash.c
47110 --- linux-2.6.29.owrt/drivers/mtd/devices/mtd_dataflash.c 2009-05-10 22:04:39.000000000 +0200
47111 +++ linux-2.6.29-rc3.owrt/drivers/mtd/devices/mtd_dataflash.c 2009-05-10 23:48:28.000000000 +0200
47112 @@ -821,8 +821,7 @@
47113 if (!(info->flags & IS_POW2PS))
47114 return info;
47115 }
47116 - } else
47117 - return info;
47118 + }
47119 }
47120 }
47121
47122 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mtd/devices/ps3vram.c linux-2.6.29-rc3.owrt/drivers/mtd/devices/ps3vram.c
47123 --- linux-2.6.29.owrt/drivers/mtd/devices/ps3vram.c 1970-01-01 01:00:00.000000000 +0100
47124 +++ linux-2.6.29-rc3.owrt/drivers/mtd/devices/ps3vram.c 2009-05-10 23:48:28.000000000 +0200
47125 @@ -0,0 +1,768 @@
47126 +/**
47127 + * ps3vram - Use extra PS3 video ram as MTD block device.
47128 + *
47129 + * Copyright (c) 2007-2008 Jim Paris <jim@jtan.com>
47130 + * Added support RSX DMA Vivien Chappelier <vivien.chappelier@free.fr>
47131 + */
47132 +
47133 +#include <linux/io.h>
47134 +#include <linux/mm.h>
47135 +#include <linux/init.h>
47136 +#include <linux/kernel.h>
47137 +#include <linux/list.h>
47138 +#include <linux/module.h>
47139 +#include <linux/moduleparam.h>
47140 +#include <linux/slab.h>
47141 +#include <linux/version.h>
47142 +#include <linux/gfp.h>
47143 +#include <linux/delay.h>
47144 +#include <linux/mtd/mtd.h>
47145 +
47146 +#include <asm/lv1call.h>
47147 +#include <asm/ps3.h>
47148 +
47149 +#define DEVICE_NAME "ps3vram"
47150 +
47151 +#define XDR_BUF_SIZE (2 * 1024 * 1024) /* XDR buffer (must be 1MiB aligned) */
47152 +#define XDR_IOIF 0x0c000000
47153 +
47154 +#define FIFO_BASE XDR_IOIF
47155 +#define FIFO_SIZE (64 * 1024)
47156 +
47157 +#define DMA_PAGE_SIZE (4 * 1024)
47158 +
47159 +#define CACHE_PAGE_SIZE (256 * 1024)
47160 +#define CACHE_PAGE_COUNT ((XDR_BUF_SIZE - FIFO_SIZE) / CACHE_PAGE_SIZE)
47161 +
47162 +#define CACHE_OFFSET CACHE_PAGE_SIZE
47163 +#define FIFO_OFFSET 0
47164 +
47165 +#define CTRL_PUT 0x10
47166 +#define CTRL_GET 0x11
47167 +#define CTRL_TOP 0x15
47168 +
47169 +#define UPLOAD_SUBCH 1
47170 +#define DOWNLOAD_SUBCH 2
47171 +
47172 +#define NV_MEMORY_TO_MEMORY_FORMAT_OFFSET_IN 0x0000030c
47173 +#define NV_MEMORY_TO_MEMORY_FORMAT_NOTIFY 0x00000104
47174 +
47175 +#define L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT 0x601
47176 +
47177 +struct mtd_info ps3vram_mtd;
47178 +
47179 +#define CACHE_PAGE_PRESENT 1
47180 +#define CACHE_PAGE_DIRTY 2
47181 +
47182 +struct ps3vram_tag {
47183 + unsigned int address;
47184 + unsigned int flags;
47185 +};
47186 +
47187 +struct ps3vram_cache {
47188 + unsigned int page_count;
47189 + unsigned int page_size;
47190 + struct ps3vram_tag *tags;
47191 +};
47192 +
47193 +struct ps3vram_priv {
47194 + u64 memory_handle;
47195 + u64 context_handle;
47196 + u32 *ctrl;
47197 + u32 *reports;
47198 + u8 __iomem *ddr_base;
47199 + u8 *xdr_buf;
47200 +
47201 + u32 *fifo_base;
47202 + u32 *fifo_ptr;
47203 +
47204 + struct device *dev;
47205 + struct ps3vram_cache cache;
47206 +
47207 + /* Used to serialize cache/DMA operations */
47208 + struct mutex lock;
47209 +};
47210 +
47211 +#define DMA_NOTIFIER_HANDLE_BASE 0x66604200 /* first DMA notifier handle */
47212 +#define DMA_NOTIFIER_OFFSET_BASE 0x1000 /* first DMA notifier offset */
47213 +#define DMA_NOTIFIER_SIZE 0x40
47214 +#define NOTIFIER 7 /* notifier used for completion report */
47215 +
47216 +/* A trailing '-' means to subtract off ps3fb_videomemory.size */
47217 +char *size = "256M-";
47218 +module_param(size, charp, 0);
47219 +MODULE_PARM_DESC(size, "memory size");
47220 +
47221 +static u32 *ps3vram_get_notifier(u32 *reports, int notifier)
47222 +{
47223 + return (void *) reports +
47224 + DMA_NOTIFIER_OFFSET_BASE +
47225 + DMA_NOTIFIER_SIZE * notifier;
47226 +}
47227 +
47228 +static void ps3vram_notifier_reset(struct mtd_info *mtd)
47229 +{
47230 + int i;
47231 +
47232 + struct ps3vram_priv *priv = mtd->priv;
47233 + u32 *notify = ps3vram_get_notifier(priv->reports, NOTIFIER);
47234 + for (i = 0; i < 4; i++)
47235 + notify[i] = 0xffffffff;
47236 +}
47237 +
47238 +static int ps3vram_notifier_wait(struct mtd_info *mtd, unsigned int timeout_ms)
47239 +{
47240 + struct ps3vram_priv *priv = mtd->priv;
47241 + u32 *notify = ps3vram_get_notifier(priv->reports, NOTIFIER);
47242 + unsigned long timeout = jiffies + msecs_to_jiffies(timeout_ms);
47243 +
47244 + do {
47245 + if (!notify[3])
47246 + return 0;
47247 + msleep(1);
47248 + } while (time_before(jiffies, timeout));
47249 +
47250 + return -ETIMEDOUT;
47251 +}
47252 +
47253 +static void ps3vram_init_ring(struct mtd_info *mtd)
47254 +{
47255 + struct ps3vram_priv *priv = mtd->priv;
47256 +
47257 + priv->ctrl[CTRL_PUT] = FIFO_BASE + FIFO_OFFSET;
47258 + priv->ctrl[CTRL_GET] = FIFO_BASE + FIFO_OFFSET;
47259 +}
47260 +
47261 +static int ps3vram_wait_ring(struct mtd_info *mtd, unsigned int timeout_ms)
47262 +{
47263 + struct ps3vram_priv *priv = mtd->priv;
47264 + unsigned long timeout = jiffies + msecs_to_jiffies(timeout_ms);
47265 +
47266 + do {
47267 + if (priv->ctrl[CTRL_PUT] == priv->ctrl[CTRL_GET])
47268 + return 0;
47269 + msleep(1);
47270 + } while (time_before(jiffies, timeout));
47271 +
47272 + dev_dbg(priv->dev, "%s:%d: FIFO timeout (%08x/%08x/%08x)\n", __func__,
47273 + __LINE__, priv->ctrl[CTRL_PUT], priv->ctrl[CTRL_GET],
47274 + priv->ctrl[CTRL_TOP]);
47275 +
47276 + return -ETIMEDOUT;
47277 +}
47278 +
47279 +static void ps3vram_out_ring(struct ps3vram_priv *priv, u32 data)
47280 +{
47281 + *(priv->fifo_ptr)++ = data;
47282 +}
47283 +
47284 +static void ps3vram_begin_ring(struct ps3vram_priv *priv, u32 chan,
47285 + u32 tag, u32 size)
47286 +{
47287 + ps3vram_out_ring(priv, (size << 18) | (chan << 13) | tag);
47288 +}
47289 +
47290 +static void ps3vram_rewind_ring(struct mtd_info *mtd)
47291 +{
47292 + struct ps3vram_priv *priv = mtd->priv;
47293 + u64 status;
47294 +
47295 + ps3vram_out_ring(priv, 0x20000000 | (FIFO_BASE + FIFO_OFFSET));
47296 +
47297 + priv->ctrl[CTRL_PUT] = FIFO_BASE + FIFO_OFFSET;
47298 +
47299 + /* asking the HV for a blit will kick the fifo */
47300 + status = lv1_gpu_context_attribute(priv->context_handle,
47301 + L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT,
47302 + 0, 0, 0, 0);
47303 + if (status)
47304 + dev_err(priv->dev, "%s:%d: lv1_gpu_context_attribute failed\n",
47305 + __func__, __LINE__);
47306 +
47307 + priv->fifo_ptr = priv->fifo_base;
47308 +}
47309 +
47310 +static void ps3vram_fire_ring(struct mtd_info *mtd)
47311 +{
47312 + struct ps3vram_priv *priv = mtd->priv;
47313 + u64 status;
47314 +
47315 + mutex_lock(&ps3_gpu_mutex);
47316 +
47317 + priv->ctrl[CTRL_PUT] = FIFO_BASE + FIFO_OFFSET +
47318 + (priv->fifo_ptr - priv->fifo_base) * sizeof(u32);
47319 +
47320 + /* asking the HV for a blit will kick the fifo */
47321 + status = lv1_gpu_context_attribute(priv->context_handle,
47322 + L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT,
47323 + 0, 0, 0, 0);
47324 + if (status)
47325 + dev_err(priv->dev, "%s:%d: lv1_gpu_context_attribute failed\n",
47326 + __func__, __LINE__);
47327 +
47328 + if ((priv->fifo_ptr - priv->fifo_base) * sizeof(u32) >
47329 + FIFO_SIZE - 1024) {
47330 + dev_dbg(priv->dev, "%s:%d: fifo full, rewinding\n", __func__,
47331 + __LINE__);
47332 + ps3vram_wait_ring(mtd, 200);
47333 + ps3vram_rewind_ring(mtd);
47334 + }
47335 +
47336 + mutex_unlock(&ps3_gpu_mutex);
47337 +}
47338 +
47339 +static void ps3vram_bind(struct mtd_info *mtd)
47340 +{
47341 + struct ps3vram_priv *priv = mtd->priv;
47342 +
47343 + ps3vram_begin_ring(priv, UPLOAD_SUBCH, 0, 1);
47344 + ps3vram_out_ring(priv, 0x31337303);
47345 + ps3vram_begin_ring(priv, UPLOAD_SUBCH, 0x180, 3);
47346 + ps3vram_out_ring(priv, DMA_NOTIFIER_HANDLE_BASE + NOTIFIER);
47347 + ps3vram_out_ring(priv, 0xfeed0001); /* DMA system RAM instance */
47348 + ps3vram_out_ring(priv, 0xfeed0000); /* DMA video RAM instance */
47349 +
47350 + ps3vram_begin_ring(priv, DOWNLOAD_SUBCH, 0, 1);
47351 + ps3vram_out_ring(priv, 0x3137c0de);
47352 + ps3vram_begin_ring(priv, DOWNLOAD_SUBCH, 0x180, 3);
47353 + ps3vram_out_ring(priv, DMA_NOTIFIER_HANDLE_BASE + NOTIFIER);
47354 + ps3vram_out_ring(priv, 0xfeed0000); /* DMA video RAM instance */
47355 + ps3vram_out_ring(priv, 0xfeed0001); /* DMA system RAM instance */
47356 +
47357 + ps3vram_fire_ring(mtd);
47358 +}
47359 +
47360 +static int ps3vram_upload(struct mtd_info *mtd, unsigned int src_offset,
47361 + unsigned int dst_offset, int len, int count)
47362 +{
47363 + struct ps3vram_priv *priv = mtd->priv;
47364 +
47365 + ps3vram_begin_ring(priv, UPLOAD_SUBCH,
47366 + NV_MEMORY_TO_MEMORY_FORMAT_OFFSET_IN, 8);
47367 + ps3vram_out_ring(priv, XDR_IOIF + src_offset);
47368 + ps3vram_out_ring(priv, dst_offset);
47369 + ps3vram_out_ring(priv, len);
47370 + ps3vram_out_ring(priv, len);
47371 + ps3vram_out_ring(priv, len);
47372 + ps3vram_out_ring(priv, count);
47373 + ps3vram_out_ring(priv, (1 << 8) | 1);
47374 + ps3vram_out_ring(priv, 0);
47375 +
47376 + ps3vram_notifier_reset(mtd);
47377 + ps3vram_begin_ring(priv, UPLOAD_SUBCH,
47378 + NV_MEMORY_TO_MEMORY_FORMAT_NOTIFY, 1);
47379 + ps3vram_out_ring(priv, 0);
47380 + ps3vram_begin_ring(priv, UPLOAD_SUBCH, 0x100, 1);
47381 + ps3vram_out_ring(priv, 0);
47382 + ps3vram_fire_ring(mtd);
47383 + if (ps3vram_notifier_wait(mtd, 200) < 0) {
47384 + dev_dbg(priv->dev, "%s:%d: notifier timeout\n", __func__,
47385 + __LINE__);
47386 + return -1;
47387 + }
47388 +
47389 + return 0;
47390 +}
47391 +
47392 +static int ps3vram_download(struct mtd_info *mtd, unsigned int src_offset,
47393 + unsigned int dst_offset, int len, int count)
47394 +{
47395 + struct ps3vram_priv *priv = mtd->priv;
47396 +
47397 + ps3vram_begin_ring(priv, DOWNLOAD_SUBCH,
47398 + NV_MEMORY_TO_MEMORY_FORMAT_OFFSET_IN, 8);
47399 + ps3vram_out_ring(priv, src_offset);
47400 + ps3vram_out_ring(priv, XDR_IOIF + dst_offset);
47401 + ps3vram_out_ring(priv, len);
47402 + ps3vram_out_ring(priv, len);
47403 + ps3vram_out_ring(priv, len);
47404 + ps3vram_out_ring(priv, count);
47405 + ps3vram_out_ring(priv, (1 << 8) | 1);
47406 + ps3vram_out_ring(priv, 0);
47407 +
47408 + ps3vram_notifier_reset(mtd);
47409 + ps3vram_begin_ring(priv, DOWNLOAD_SUBCH,
47410 + NV_MEMORY_TO_MEMORY_FORMAT_NOTIFY, 1);
47411 + ps3vram_out_ring(priv, 0);
47412 + ps3vram_begin_ring(priv, DOWNLOAD_SUBCH, 0x100, 1);
47413 + ps3vram_out_ring(priv, 0);
47414 + ps3vram_fire_ring(mtd);
47415 + if (ps3vram_notifier_wait(mtd, 200) < 0) {
47416 + dev_dbg(priv->dev, "%s:%d: notifier timeout\n", __func__,
47417 + __LINE__);
47418 + return -1;
47419 + }
47420 +
47421 + return 0;
47422 +}
47423 +
47424 +static void ps3vram_cache_evict(struct mtd_info *mtd, int entry)
47425 +{
47426 + struct ps3vram_priv *priv = mtd->priv;
47427 + struct ps3vram_cache *cache = &priv->cache;
47428 +
47429 + if (cache->tags[entry].flags & CACHE_PAGE_DIRTY) {
47430 + dev_dbg(priv->dev, "%s:%d: flushing %d : 0x%08x\n", __func__,
47431 + __LINE__, entry, cache->tags[entry].address);
47432 + if (ps3vram_upload(mtd,
47433 + CACHE_OFFSET + entry * cache->page_size,
47434 + cache->tags[entry].address,
47435 + DMA_PAGE_SIZE,
47436 + cache->page_size / DMA_PAGE_SIZE) < 0) {
47437 + dev_dbg(priv->dev, "%s:%d: failed to upload from "
47438 + "0x%x to 0x%x size 0x%x\n", __func__, __LINE__,
47439 + entry * cache->page_size,
47440 + cache->tags[entry].address, cache->page_size);
47441 + }
47442 + cache->tags[entry].flags &= ~CACHE_PAGE_DIRTY;
47443 + }
47444 +}
47445 +
47446 +static void ps3vram_cache_load(struct mtd_info *mtd, int entry,
47447 + unsigned int address)
47448 +{
47449 + struct ps3vram_priv *priv = mtd->priv;
47450 + struct ps3vram_cache *cache = &priv->cache;
47451 +
47452 + dev_dbg(priv->dev, "%s:%d: fetching %d : 0x%08x\n", __func__, __LINE__,
47453 + entry, address);
47454 + if (ps3vram_download(mtd,
47455 + address,
47456 + CACHE_OFFSET + entry * cache->page_size,
47457 + DMA_PAGE_SIZE,
47458 + cache->page_size / DMA_PAGE_SIZE) < 0) {
47459 + dev_err(priv->dev, "%s:%d: failed to download from "
47460 + "0x%x to 0x%x size 0x%x\n", __func__, __LINE__, address,
47461 + entry * cache->page_size, cache->page_size);
47462 + }
47463 +
47464 + cache->tags[entry].address = address;
47465 + cache->tags[entry].flags |= CACHE_PAGE_PRESENT;
47466 +}
47467 +
47468 +
47469 +static void ps3vram_cache_flush(struct mtd_info *mtd)
47470 +{
47471 + struct ps3vram_priv *priv = mtd->priv;
47472 + struct ps3vram_cache *cache = &priv->cache;
47473 + int i;
47474 +
47475 + dev_dbg(priv->dev, "%s:%d: FLUSH\n", __func__, __LINE__);
47476 + for (i = 0; i < cache->page_count; i++) {
47477 + ps3vram_cache_evict(mtd, i);
47478 + cache->tags[i].flags = 0;
47479 + }
47480 +}
47481 +
47482 +static unsigned int ps3vram_cache_match(struct mtd_info *mtd, loff_t address)
47483 +{
47484 + struct ps3vram_priv *priv = mtd->priv;
47485 + struct ps3vram_cache *cache = &priv->cache;
47486 + unsigned int base;
47487 + unsigned int offset;
47488 + int i;
47489 + static int counter;
47490 +
47491 + offset = (unsigned int) (address & (cache->page_size - 1));
47492 + base = (unsigned int) (address - offset);
47493 +
47494 + /* fully associative check */
47495 + for (i = 0; i < cache->page_count; i++) {
47496 + if ((cache->tags[i].flags & CACHE_PAGE_PRESENT) &&
47497 + cache->tags[i].address == base) {
47498 + dev_dbg(priv->dev, "%s:%d: found entry %d : 0x%08x\n",
47499 + __func__, __LINE__, i, cache->tags[i].address);
47500 + return i;
47501 + }
47502 + }
47503 +
47504 + /* choose a random entry */
47505 + i = (jiffies + (counter++)) % cache->page_count;
47506 + dev_dbg(priv->dev, "%s:%d: using entry %d\n", __func__, __LINE__, i);
47507 +
47508 + ps3vram_cache_evict(mtd, i);
47509 + ps3vram_cache_load(mtd, i, base);
47510 +
47511 + return i;
47512 +}
47513 +
47514 +static int ps3vram_cache_init(struct mtd_info *mtd)
47515 +{
47516 + struct ps3vram_priv *priv = mtd->priv;
47517 +
47518 + priv->cache.page_count = CACHE_PAGE_COUNT;
47519 + priv->cache.page_size = CACHE_PAGE_SIZE;
47520 + priv->cache.tags = kzalloc(sizeof(struct ps3vram_tag) *
47521 + CACHE_PAGE_COUNT, GFP_KERNEL);
47522 + if (priv->cache.tags == NULL) {
47523 + dev_err(priv->dev, "%s:%d: could not allocate cache tags\n",
47524 + __func__, __LINE__);
47525 + return -ENOMEM;
47526 + }
47527 +
47528 + dev_info(priv->dev, "created ram cache: %d entries, %d KiB each\n",
47529 + CACHE_PAGE_COUNT, CACHE_PAGE_SIZE / 1024);
47530 +
47531 + return 0;
47532 +}
47533 +
47534 +static void ps3vram_cache_cleanup(struct mtd_info *mtd)
47535 +{
47536 + struct ps3vram_priv *priv = mtd->priv;
47537 +
47538 + ps3vram_cache_flush(mtd);
47539 + kfree(priv->cache.tags);
47540 +}
47541 +
47542 +static int ps3vram_erase(struct mtd_info *mtd, struct erase_info *instr)
47543 +{
47544 + struct ps3vram_priv *priv = mtd->priv;
47545 +
47546 + if (instr->addr + instr->len > mtd->size)
47547 + return -EINVAL;
47548 +
47549 + mutex_lock(&priv->lock);
47550 +
47551 + ps3vram_cache_flush(mtd);
47552 +
47553 + /* Set bytes to 0xFF */
47554 + memset_io(priv->ddr_base + instr->addr, 0xFF, instr->len);
47555 +
47556 + mutex_unlock(&priv->lock);
47557 +
47558 + instr->state = MTD_ERASE_DONE;
47559 + mtd_erase_callback(instr);
47560 +
47561 + return 0;
47562 +}
47563 +
47564 +static int ps3vram_read(struct mtd_info *mtd, loff_t from, size_t len,
47565 + size_t *retlen, u_char *buf)
47566 +{
47567 + struct ps3vram_priv *priv = mtd->priv;
47568 + unsigned int cached, count;
47569 +
47570 + dev_dbg(priv->dev, "%s:%d: from=0x%08x len=0x%zx\n", __func__, __LINE__,
47571 + (unsigned int)from, len);
47572 +
47573 + if (from >= mtd->size)
47574 + return -EINVAL;
47575 +
47576 + if (len > mtd->size - from)
47577 + len = mtd->size - from;
47578 +
47579 + /* Copy from vram to buf */
47580 + count = len;
47581 + while (count) {
47582 + unsigned int offset, avail;
47583 + unsigned int entry;
47584 +
47585 + offset = (unsigned int) (from & (priv->cache.page_size - 1));
47586 + avail = priv->cache.page_size - offset;
47587 +
47588 + mutex_lock(&priv->lock);
47589 +
47590 + entry = ps3vram_cache_match(mtd, from);
47591 + cached = CACHE_OFFSET + entry * priv->cache.page_size + offset;
47592 +
47593 + dev_dbg(priv->dev, "%s:%d: from=%08x cached=%08x offset=%08x "
47594 + "avail=%08x count=%08x\n", __func__, __LINE__,
47595 + (unsigned int)from, cached, offset, avail, count);
47596 +
47597 + if (avail > count)
47598 + avail = count;
47599 + memcpy(buf, priv->xdr_buf + cached, avail);
47600 +
47601 + mutex_unlock(&priv->lock);
47602 +
47603 + buf += avail;
47604 + count -= avail;
47605 + from += avail;
47606 + }
47607 +
47608 + *retlen = len;
47609 + return 0;
47610 +}
47611 +
47612 +static int ps3vram_write(struct mtd_info *mtd, loff_t to, size_t len,
47613 + size_t *retlen, const u_char *buf)
47614 +{
47615 + struct ps3vram_priv *priv = mtd->priv;
47616 + unsigned int cached, count;
47617 +
47618 + if (to >= mtd->size)
47619 + return -EINVAL;
47620 +
47621 + if (len > mtd->size - to)
47622 + len = mtd->size - to;
47623 +
47624 + /* Copy from buf to vram */
47625 + count = len;
47626 + while (count) {
47627 + unsigned int offset, avail;
47628 + unsigned int entry;
47629 +
47630 + offset = (unsigned int) (to & (priv->cache.page_size - 1));
47631 + avail = priv->cache.page_size - offset;
47632 +
47633 + mutex_lock(&priv->lock);
47634 +
47635 + entry = ps3vram_cache_match(mtd, to);
47636 + cached = CACHE_OFFSET + entry * priv->cache.page_size + offset;
47637 +
47638 + dev_dbg(priv->dev, "%s:%d: to=%08x cached=%08x offset=%08x "
47639 + "avail=%08x count=%08x\n", __func__, __LINE__,
47640 + (unsigned int)to, cached, offset, avail, count);
47641 +
47642 + if (avail > count)
47643 + avail = count;
47644 + memcpy(priv->xdr_buf + cached, buf, avail);
47645 +
47646 + priv->cache.tags[entry].flags |= CACHE_PAGE_DIRTY;
47647 +
47648 + mutex_unlock(&priv->lock);
47649 +
47650 + buf += avail;
47651 + count -= avail;
47652 + to += avail;
47653 + }
47654 +
47655 + *retlen = len;
47656 + return 0;
47657 +}
47658 +
47659 +static int __devinit ps3vram_probe(struct ps3_system_bus_device *dev)
47660 +{
47661 + struct ps3vram_priv *priv;
47662 + int status;
47663 + u64 ddr_lpar;
47664 + u64 ctrl_lpar;
47665 + u64 info_lpar;
47666 + u64 reports_lpar;
47667 + u64 ddr_size;
47668 + u64 reports_size;
47669 + int ret = -ENOMEM;
47670 + char *rest;
47671 +
47672 + ret = -EIO;
47673 + ps3vram_mtd.priv = kzalloc(sizeof(struct ps3vram_priv), GFP_KERNEL);
47674 + if (!ps3vram_mtd.priv)
47675 + goto out;
47676 + priv = ps3vram_mtd.priv;
47677 +
47678 + mutex_init(&priv->lock);
47679 + priv->dev = &dev->core;
47680 +
47681 + /* Allocate XDR buffer (1MiB aligned) */
47682 + priv->xdr_buf = (void *)__get_free_pages(GFP_KERNEL,
47683 + get_order(XDR_BUF_SIZE));
47684 + if (priv->xdr_buf == NULL) {
47685 + dev_dbg(&dev->core, "%s:%d: could not allocate XDR buffer\n",
47686 + __func__, __LINE__);
47687 + ret = -ENOMEM;
47688 + goto out_free_priv;
47689 + }
47690 +
47691 + /* Put FIFO at begginning of XDR buffer */
47692 + priv->fifo_base = (u32 *) (priv->xdr_buf + FIFO_OFFSET);
47693 + priv->fifo_ptr = priv->fifo_base;
47694 +
47695 + /* XXX: Need to open GPU, in case ps3fb or snd_ps3 aren't loaded */
47696 + if (ps3_open_hv_device(dev)) {
47697 + dev_err(&dev->core, "%s:%d: ps3_open_hv_device failed\n",
47698 + __func__, __LINE__);
47699 + ret = -EAGAIN;
47700 + goto out_close_gpu;
47701 + }
47702 +
47703 + /* Request memory */
47704 + status = -1;
47705 + ddr_size = memparse(size, &rest);
47706 + if (*rest == '-')
47707 + ddr_size -= ps3fb_videomemory.size;
47708 + ddr_size = ALIGN(ddr_size, 1024*1024);
47709 + if (ddr_size <= 0) {
47710 + dev_err(&dev->core, "%s:%d: specified size is too small\n",
47711 + __func__, __LINE__);
47712 + ret = -EINVAL;
47713 + goto out_close_gpu;
47714 + }
47715 +
47716 + while (ddr_size > 0) {
47717 + status = lv1_gpu_memory_allocate(ddr_size, 0, 0, 0, 0,
47718 + &priv->memory_handle,
47719 + &ddr_lpar);
47720 + if (!status)
47721 + break;
47722 + ddr_size -= 1024*1024;
47723 + }
47724 + if (status || ddr_size <= 0) {
47725 + dev_err(&dev->core, "%s:%d: lv1_gpu_memory_allocate failed\n",
47726 + __func__, __LINE__);
47727 + ret = -ENOMEM;
47728 + goto out_free_xdr_buf;
47729 + }
47730 +
47731 + /* Request context */
47732 + status = lv1_gpu_context_allocate(priv->memory_handle,
47733 + 0,
47734 + &priv->context_handle,
47735 + &ctrl_lpar,
47736 + &info_lpar,
47737 + &reports_lpar,
47738 + &reports_size);
47739 + if (status) {
47740 + dev_err(&dev->core, "%s:%d: lv1_gpu_context_allocate failed\n",
47741 + __func__, __LINE__);
47742 + ret = -ENOMEM;
47743 + goto out_free_memory;
47744 + }
47745 +
47746 + /* Map XDR buffer to RSX */
47747 + status = lv1_gpu_context_iomap(priv->context_handle, XDR_IOIF,
47748 + ps3_mm_phys_to_lpar(__pa(priv->xdr_buf)),
47749 + XDR_BUF_SIZE, 0);
47750 + if (status) {
47751 + dev_err(&dev->core, "%s:%d: lv1_gpu_context_iomap failed\n",
47752 + __func__, __LINE__);
47753 + ret = -ENOMEM;
47754 + goto out_free_context;
47755 + }
47756 +
47757 + priv->ddr_base = ioremap_flags(ddr_lpar, ddr_size, _PAGE_NO_CACHE);
47758 +
47759 + if (!priv->ddr_base) {
47760 + dev_err(&dev->core, "%s:%d: ioremap failed\n", __func__,
47761 + __LINE__);
47762 + ret = -ENOMEM;
47763 + goto out_free_context;
47764 + }
47765 +
47766 + priv->ctrl = ioremap(ctrl_lpar, 64 * 1024);
47767 + if (!priv->ctrl) {
47768 + dev_err(&dev->core, "%s:%d: ioremap failed\n", __func__,
47769 + __LINE__);
47770 + ret = -ENOMEM;
47771 + goto out_unmap_vram;
47772 + }
47773 +
47774 + priv->reports = ioremap(reports_lpar, reports_size);
47775 + if (!priv->reports) {
47776 + dev_err(&dev->core, "%s:%d: ioremap failed\n", __func__,
47777 + __LINE__);
47778 + ret = -ENOMEM;
47779 + goto out_unmap_ctrl;
47780 + }
47781 +
47782 + mutex_lock(&ps3_gpu_mutex);
47783 + ps3vram_init_ring(&ps3vram_mtd);
47784 + mutex_unlock(&ps3_gpu_mutex);
47785 +
47786 + ps3vram_mtd.name = "ps3vram";
47787 + ps3vram_mtd.size = ddr_size;
47788 + ps3vram_mtd.flags = MTD_CAP_RAM;
47789 + ps3vram_mtd.erase = ps3vram_erase;
47790 + ps3vram_mtd.point = NULL;
47791 + ps3vram_mtd.unpoint = NULL;
47792 + ps3vram_mtd.read = ps3vram_read;
47793 + ps3vram_mtd.write = ps3vram_write;
47794 + ps3vram_mtd.owner = THIS_MODULE;
47795 + ps3vram_mtd.type = MTD_RAM;
47796 + ps3vram_mtd.erasesize = CACHE_PAGE_SIZE;
47797 + ps3vram_mtd.writesize = 1;
47798 +
47799 + ps3vram_bind(&ps3vram_mtd);
47800 +
47801 + mutex_lock(&ps3_gpu_mutex);
47802 + ret = ps3vram_wait_ring(&ps3vram_mtd, 100);
47803 + mutex_unlock(&ps3_gpu_mutex);
47804 + if (ret < 0) {
47805 + dev_err(&dev->core, "%s:%d: failed to initialize channels\n",
47806 + __func__, __LINE__);
47807 + ret = -ETIMEDOUT;
47808 + goto out_unmap_reports;
47809 + }
47810 +
47811 + ps3vram_cache_init(&ps3vram_mtd);
47812 +
47813 + if (add_mtd_device(&ps3vram_mtd)) {
47814 + dev_err(&dev->core, "%s:%d: add_mtd_device failed\n",
47815 + __func__, __LINE__);
47816 + ret = -EAGAIN;
47817 + goto out_cache_cleanup;
47818 + }
47819 +
47820 + dev_info(&dev->core, "reserved %u MiB of gpu memory\n",
47821 + (unsigned int)(ddr_size / 1024 / 1024));
47822 +
47823 + return 0;
47824 +
47825 +out_cache_cleanup:
47826 + ps3vram_cache_cleanup(&ps3vram_mtd);
47827 +out_unmap_reports:
47828 + iounmap(priv->reports);
47829 +out_unmap_ctrl:
47830 + iounmap(priv->ctrl);
47831 +out_unmap_vram:
47832 + iounmap(priv->ddr_base);
47833 +out_free_context:
47834 + lv1_gpu_context_free(priv->context_handle);
47835 +out_free_memory:
47836 + lv1_gpu_memory_free(priv->memory_handle);
47837 +out_close_gpu:
47838 + ps3_close_hv_device(dev);
47839 +out_free_xdr_buf:
47840 + free_pages((unsigned long) priv->xdr_buf, get_order(XDR_BUF_SIZE));
47841 +out_free_priv:
47842 + kfree(ps3vram_mtd.priv);
47843 + ps3vram_mtd.priv = NULL;
47844 +out:
47845 + return ret;
47846 +}
47847 +
47848 +static int ps3vram_shutdown(struct ps3_system_bus_device *dev)
47849 +{
47850 + struct ps3vram_priv *priv;
47851 +
47852 + priv = ps3vram_mtd.priv;
47853 +
47854 + del_mtd_device(&ps3vram_mtd);
47855 + ps3vram_cache_cleanup(&ps3vram_mtd);
47856 + iounmap(priv->reports);
47857 + iounmap(priv->ctrl);
47858 + iounmap(priv->ddr_base);
47859 + lv1_gpu_context_free(priv->context_handle);
47860 + lv1_gpu_memory_free(priv->memory_handle);
47861 + ps3_close_hv_device(dev);
47862 + free_pages((unsigned long) priv->xdr_buf, get_order(XDR_BUF_SIZE));
47863 + kfree(priv);
47864 + return 0;
47865 +}
47866 +
47867 +static struct ps3_system_bus_driver ps3vram_driver = {
47868 + .match_id = PS3_MATCH_ID_GPU,
47869 + .match_sub_id = PS3_MATCH_SUB_ID_GPU_RAMDISK,
47870 + .core.name = DEVICE_NAME,
47871 + .core.owner = THIS_MODULE,
47872 + .probe = ps3vram_probe,
47873 + .remove = ps3vram_shutdown,
47874 + .shutdown = ps3vram_shutdown,
47875 +};
47876 +
47877 +static int __init ps3vram_init(void)
47878 +{
47879 + return ps3_system_bus_driver_register(&ps3vram_driver);
47880 +}
47881 +
47882 +static void __exit ps3vram_exit(void)
47883 +{
47884 + ps3_system_bus_driver_unregister(&ps3vram_driver);
47885 +}
47886 +
47887 +module_init(ps3vram_init);
47888 +module_exit(ps3vram_exit);
47889 +
47890 +MODULE_LICENSE("GPL");
47891 +MODULE_AUTHOR("Jim Paris <jim@jtan.com>");
47892 +MODULE_DESCRIPTION("MTD driver for PS3 video RAM");
47893 +MODULE_ALIAS(PS3_MODULE_ALIAS_GPU_RAMDISK);
47894 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mtd/devices/slram.c linux-2.6.29-rc3.owrt/drivers/mtd/devices/slram.c
47895 --- linux-2.6.29.owrt/drivers/mtd/devices/slram.c 2009-05-10 22:04:39.000000000 +0200
47896 +++ linux-2.6.29-rc3.owrt/drivers/mtd/devices/slram.c 2009-05-10 23:48:28.000000000 +0200
47897 @@ -267,28 +267,22 @@
47898 if (*(szlength) != '+') {
47899 devlength = simple_strtoul(szlength, &buffer, 0);
47900 devlength = handle_unit(devlength, buffer) - devstart;
47901 - if (devlength < devstart)
47902 - goto err_out;
47903 -
47904 - devlength -= devstart;
47905 } else {
47906 devlength = simple_strtoul(szlength + 1, &buffer, 0);
47907 devlength = handle_unit(devlength, buffer);
47908 }
47909 T("slram: devname=%s, devstart=0x%lx, devlength=0x%lx\n",
47910 devname, devstart, devlength);
47911 - if (devlength % SLRAM_BLK_SZ != 0)
47912 - goto err_out;
47913 + if ((devstart < 0) || (devlength < 0) || (devlength % SLRAM_BLK_SZ != 0)) {
47914 + E("slram: Illegal start / length parameter.\n");
47915 + return(-EINVAL);
47916 + }
47917
47918 if ((devstart = register_device(devname, devstart, devlength))){
47919 unregister_devices();
47920 return((int)devstart);
47921 }
47922 return(0);
47923 -
47924 -err_out:
47925 - E("slram: Illegal length parameter.\n");
47926 - return(-EINVAL);
47927 }
47928
47929 #ifndef MODULE
47930 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mtd/lpddr/Kconfig linux-2.6.29-rc3.owrt/drivers/mtd/lpddr/Kconfig
47931 --- linux-2.6.29.owrt/drivers/mtd/lpddr/Kconfig 2009-05-10 22:04:39.000000000 +0200
47932 +++ linux-2.6.29-rc3.owrt/drivers/mtd/lpddr/Kconfig 2009-05-10 23:48:28.000000000 +0200
47933 @@ -12,7 +12,6 @@
47934 DDR memories, intended for battery-operated systems.
47935
47936 config MTD_QINFO_PROBE
47937 - depends on MTD_LPDDR
47938 tristate "Detect flash chips by QINFO probe"
47939 help
47940 Device Information for LPDDR chips is offered through the Overlay
47941 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mtd/maps/bfin-async-flash.c linux-2.6.29-rc3.owrt/drivers/mtd/maps/bfin-async-flash.c
47942 --- linux-2.6.29.owrt/drivers/mtd/maps/bfin-async-flash.c 2009-05-10 22:04:39.000000000 +0200
47943 +++ linux-2.6.29-rc3.owrt/drivers/mtd/maps/bfin-async-flash.c 2009-05-10 23:48:28.000000000 +0200
47944 @@ -152,18 +152,14 @@
47945
47946 if (gpio_request(state->enet_flash_pin, DRIVER_NAME)) {
47947 pr_devinit(KERN_ERR DRIVER_NAME ": Failed to request gpio %d\n", state->enet_flash_pin);
47948 - kfree(state);
47949 return -EBUSY;
47950 }
47951 gpio_direction_output(state->enet_flash_pin, 1);
47952
47953 pr_devinit(KERN_NOTICE DRIVER_NAME ": probing %d-bit flash bus\n", state->map.bankwidth * 8);
47954 state->mtd = do_map_probe(memory->name, &state->map);
47955 - if (!state->mtd) {
47956 - gpio_free(state->enet_flash_pin);
47957 - kfree(state);
47958 + if (!state->mtd)
47959 return -ENXIO;
47960 - }
47961
47962 #ifdef CONFIG_MTD_PARTITIONS
47963 ret = parse_mtd_partitions(state->mtd, part_probe_types, &pdata->parts, 0);
47964 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mtd/maps/ck804xrom.c linux-2.6.29-rc3.owrt/drivers/mtd/maps/ck804xrom.c
47965 --- linux-2.6.29.owrt/drivers/mtd/maps/ck804xrom.c 2009-05-10 22:04:39.000000000 +0200
47966 +++ linux-2.6.29-rc3.owrt/drivers/mtd/maps/ck804xrom.c 2009-05-10 23:48:28.000000000 +0200
47967 @@ -342,9 +342,9 @@
47968 { 0, }
47969 };
47970
47971 -#if 0
47972 MODULE_DEVICE_TABLE(pci, ck804xrom_pci_tbl);
47973
47974 +#if 0
47975 static struct pci_driver ck804xrom_driver = {
47976 .name = MOD_NAME,
47977 .id_table = ck804xrom_pci_tbl,
47978 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mtd/maps/Kconfig linux-2.6.29-rc3.owrt/drivers/mtd/maps/Kconfig
47979 --- linux-2.6.29.owrt/drivers/mtd/maps/Kconfig 2009-05-10 22:04:39.000000000 +0200
47980 +++ linux-2.6.29-rc3.owrt/drivers/mtd/maps/Kconfig 2009-05-10 23:48:28.000000000 +0200
47981 @@ -491,7 +491,7 @@
47982
47983 config MTD_BFIN_ASYNC
47984 tristate "Blackfin BF533-STAMP Flash Chip Support"
47985 - depends on BFIN533_STAMP && MTD_CFI && MTD_COMPLEX_MAPPINGS
47986 + depends on BFIN533_STAMP && MTD_CFI
47987 select MTD_PARTITIONS
47988 default y
47989 help
47990 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mtd/maps/physmap.c linux-2.6.29-rc3.owrt/drivers/mtd/maps/physmap.c
47991 --- linux-2.6.29.owrt/drivers/mtd/maps/physmap.c 2009-05-10 22:04:39.000000000 +0200
47992 +++ linux-2.6.29-rc3.owrt/drivers/mtd/maps/physmap.c 2009-05-10 23:48:28.000000000 +0200
47993 @@ -29,7 +29,6 @@
47994 struct map_info map[MAX_RESOURCES];
47995 #ifdef CONFIG_MTD_PARTITIONS
47996 int nr_parts;
47997 - struct mtd_partition *parts;
47998 #endif
47999 };
48000
48001 @@ -46,29 +45,25 @@
48002
48003 physmap_data = dev->dev.platform_data;
48004
48005 - if (info->cmtd) {
48006 -#ifdef CONFIG_MTD_PARTITIONS
48007 - if (info->nr_parts || physmap_data->nr_parts)
48008 - del_mtd_partitions(info->cmtd);
48009 - else
48010 - del_mtd_device(info->cmtd);
48011 -#else
48012 - del_mtd_device(info->cmtd);
48013 -#endif
48014 - }
48015 -#ifdef CONFIG_MTD_PARTITIONS
48016 - if (info->nr_parts)
48017 - kfree(info->parts);
48018 -#endif
48019 -
48020 #ifdef CONFIG_MTD_CONCAT
48021 - if (info->cmtd != info->mtd[0])
48022 + if (info->cmtd != info->mtd[0]) {
48023 + del_mtd_device(info->cmtd);
48024 mtd_concat_destroy(info->cmtd);
48025 + }
48026 #endif
48027
48028 for (i = 0; i < MAX_RESOURCES; i++) {
48029 - if (info->mtd[i] != NULL)
48030 + if (info->mtd[i] != NULL) {
48031 +#ifdef CONFIG_MTD_PARTITIONS
48032 + if (info->nr_parts || physmap_data->nr_parts)
48033 + del_mtd_partitions(info->mtd[i]);
48034 + else
48035 + del_mtd_device(info->mtd[i]);
48036 +#else
48037 + del_mtd_device(info->mtd[i]);
48038 +#endif
48039 map_destroy(info->mtd[i]);
48040 + }
48041 }
48042 return 0;
48043 }
48044 @@ -91,6 +86,9 @@
48045 int err = 0;
48046 int i;
48047 int devices_found = 0;
48048 +#ifdef CONFIG_MTD_PARTITIONS
48049 + struct mtd_partition *parts;
48050 +#endif
48051
48052 physmap_data = dev->dev.platform_data;
48053 if (physmap_data == NULL)
48054 @@ -169,11 +167,10 @@
48055 goto err_out;
48056
48057 #ifdef CONFIG_MTD_PARTITIONS
48058 - err = parse_mtd_partitions(info->cmtd, part_probe_types,
48059 - &info->parts, 0);
48060 + err = parse_mtd_partitions(info->cmtd, part_probe_types, &parts, 0);
48061 if (err > 0) {
48062 - add_mtd_partitions(info->cmtd, info->parts, err);
48063 - info->nr_parts = err;
48064 + add_mtd_partitions(info->cmtd, parts, err);
48065 + kfree(parts);
48066 return 0;
48067 }
48068
48069 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mtd/maps/sa1100-flash.c linux-2.6.29-rc3.owrt/drivers/mtd/maps/sa1100-flash.c
48070 --- linux-2.6.29.owrt/drivers/mtd/maps/sa1100-flash.c 2009-05-10 22:04:39.000000000 +0200
48071 +++ linux-2.6.29-rc3.owrt/drivers/mtd/maps/sa1100-flash.c 2009-05-10 23:48:28.000000000 +0200
48072 @@ -453,7 +453,7 @@
48073 .resume = sa1100_mtd_resume,
48074 .shutdown = sa1100_mtd_shutdown,
48075 .driver = {
48076 - .name = "sa1100-mtd",
48077 + .name = "flash",
48078 .owner = THIS_MODULE,
48079 },
48080 };
48081 @@ -474,4 +474,4 @@
48082 MODULE_AUTHOR("Nicolas Pitre");
48083 MODULE_DESCRIPTION("SA1100 CFI map driver");
48084 MODULE_LICENSE("GPL");
48085 -MODULE_ALIAS("platform:sa1100-mtd");
48086 +MODULE_ALIAS("platform:flash");
48087 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mtd/nand/atmel_nand.c linux-2.6.29-rc3.owrt/drivers/mtd/nand/atmel_nand.c
48088 --- linux-2.6.29.owrt/drivers/mtd/nand/atmel_nand.c 2009-05-10 22:04:39.000000000 +0200
48089 +++ linux-2.6.29-rc3.owrt/drivers/mtd/nand/atmel_nand.c 2009-05-10 23:48:28.000000000 +0200
48090 @@ -139,8 +139,7 @@
48091 struct nand_chip *nand_chip = mtd->priv;
48092 struct atmel_nand_host *host = nand_chip->priv;
48093
48094 - return gpio_get_value(host->board->rdy_pin) ^
48095 - !!host->board->rdy_pin_active_low;
48096 + return gpio_get_value(host->board->rdy_pin);
48097 }
48098
48099 /*
48100 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mtd/nand/orion_nand.c linux-2.6.29-rc3.owrt/drivers/mtd/nand/orion_nand.c
48101 --- linux-2.6.29.owrt/drivers/mtd/nand/orion_nand.c 2009-05-10 22:04:39.000000000 +0200
48102 +++ linux-2.6.29-rc3.owrt/drivers/mtd/nand/orion_nand.c 2009-05-10 23:48:28.000000000 +0200
48103 @@ -149,7 +149,7 @@
48104
48105 static struct platform_driver orion_nand_driver = {
48106 .probe = orion_nand_probe,
48107 - .remove = __devexit_p(orion_nand_remove),
48108 + .remove = orion_nand_remove,
48109 .driver = {
48110 .name = "orion_nand",
48111 .owner = THIS_MODULE,
48112 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mtd/ubi/build.c linux-2.6.29-rc3.owrt/drivers/mtd/ubi/build.c
48113 --- linux-2.6.29.owrt/drivers/mtd/ubi/build.c 2009-05-10 22:04:39.000000000 +0200
48114 +++ linux-2.6.29-rc3.owrt/drivers/mtd/ubi/build.c 2009-05-10 23:48:28.000000000 +0200
48115 @@ -263,12 +263,8 @@
48116 return ret;
48117 }
48118
48119 -static void dev_release(struct device *dev)
48120 -{
48121 - struct ubi_device *ubi = container_of(dev, struct ubi_device, dev);
48122 -
48123 - kfree(ubi);
48124 -}
48125 +/* Fake "release" method for UBI devices */
48126 +static void dev_release(struct device *dev) { }
48127
48128 /**
48129 * ubi_sysfs_init - initialize sysfs for an UBI device.
48130 @@ -384,7 +380,7 @@
48131 */
48132 static int uif_init(struct ubi_device *ubi)
48133 {
48134 - int i, err;
48135 + int i, err, do_free = 0;
48136 dev_t dev;
48137
48138 sprintf(ubi->ubi_name, UBI_NAME_STR "%d", ubi->ubi_num);
48139 @@ -431,10 +427,13 @@
48140
48141 out_volumes:
48142 kill_volumes(ubi);
48143 + do_free = 0;
48144 out_sysfs:
48145 ubi_sysfs_close(ubi);
48146 cdev_del(&ubi->cdev);
48147 out_unreg:
48148 + if (do_free)
48149 + free_user_volumes(ubi);
48150 unregister_chrdev_region(ubi->cdev.dev, ubi->vtbl_slots + 1);
48151 ubi_err("cannot initialize UBI %s, error %d", ubi->ubi_name, err);
48152 return err;
48153 @@ -948,12 +947,6 @@
48154 if (ubi->bgt_thread)
48155 kthread_stop(ubi->bgt_thread);
48156
48157 - /*
48158 - * Get a reference to the device in order to prevent 'dev_release()'
48159 - * from freeing @ubi object.
48160 - */
48161 - get_device(&ubi->dev);
48162 -
48163 uif_close(ubi);
48164 ubi_wl_close(ubi);
48165 free_internal_volumes(ubi);
48166 @@ -965,7 +958,7 @@
48167 vfree(ubi->dbg_peb_buf);
48168 #endif
48169 ubi_msg("mtd%d is detached from ubi%d", ubi->mtd->index, ubi->ubi_num);
48170 - put_device(&ubi->dev);
48171 + kfree(ubi);
48172 return 0;
48173 }
48174
48175 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mtd/ubi/cdev.c linux-2.6.29-rc3.owrt/drivers/mtd/ubi/cdev.c
48176 --- linux-2.6.29.owrt/drivers/mtd/ubi/cdev.c 2009-05-10 22:04:39.000000000 +0200
48177 +++ linux-2.6.29-rc3.owrt/drivers/mtd/ubi/cdev.c 2009-05-10 23:48:28.000000000 +0200
48178 @@ -40,9 +40,9 @@
48179 #include <linux/ioctl.h>
48180 #include <linux/capability.h>
48181 #include <linux/uaccess.h>
48182 -#include <linux/compat.h>
48183 -#include <linux/math64.h>
48184 +#include <linux/smp_lock.h>
48185 #include <mtd/ubi-user.h>
48186 +#include <asm/div64.h>
48187 #include "ubi.h"
48188
48189 /**
48190 @@ -195,6 +195,7 @@
48191 int err, lnum, off, len, tbuf_size;
48192 size_t count_save = count;
48193 void *tbuf;
48194 + uint64_t tmp;
48195
48196 dbg_gen("read %zd bytes from offset %lld of volume %d",
48197 count, *offp, vol->vol_id);
48198 @@ -224,7 +225,10 @@
48199 return -ENOMEM;
48200
48201 len = count > tbuf_size ? tbuf_size : count;
48202 - lnum = div_u64_rem(*offp, vol->usable_leb_size, &off);
48203 +
48204 + tmp = *offp;
48205 + off = do_div(tmp, vol->usable_leb_size);
48206 + lnum = tmp;
48207
48208 do {
48209 cond_resched();
48210 @@ -259,9 +263,12 @@
48211 return err ? err : count_save - count;
48212 }
48213
48214 +#ifdef CONFIG_MTD_UBI_DEBUG_USERSPACE_IO
48215 +
48216 /*
48217 * This function allows to directly write to dynamic UBI volumes, without
48218 - * issuing the volume update operation.
48219 + * issuing the volume update operation. Available only as a debugging feature.
48220 + * Very useful for testing UBI.
48221 */
48222 static ssize_t vol_cdev_direct_write(struct file *file, const char __user *buf,
48223 size_t count, loff_t *offp)
48224 @@ -272,9 +279,7 @@
48225 int lnum, off, len, tbuf_size, err = 0;
48226 size_t count_save = count;
48227 char *tbuf;
48228 -
48229 - if (!vol->direct_writes)
48230 - return -EPERM;
48231 + uint64_t tmp;
48232
48233 dbg_gen("requested: write %zd bytes to offset %lld of volume %u",
48234 count, *offp, vol->vol_id);
48235 @@ -282,7 +287,10 @@
48236 if (vol->vol_type == UBI_STATIC_VOLUME)
48237 return -EROFS;
48238
48239 - lnum = div_u64_rem(*offp, vol->usable_leb_size, &off);
48240 + tmp = *offp;
48241 + off = do_div(tmp, vol->usable_leb_size);
48242 + lnum = tmp;
48243 +
48244 if (off & (ubi->min_io_size - 1)) {
48245 dbg_err("unaligned position");
48246 return -EINVAL;
48247 @@ -339,6 +347,10 @@
48248 return err ? err : count_save - count;
48249 }
48250
48251 +#else
48252 +#define vol_cdev_direct_write(file, buf, count, offp) (-EPERM)
48253 +#endif /* CONFIG_MTD_UBI_DEBUG_USERSPACE_IO */
48254 +
48255 static ssize_t vol_cdev_write(struct file *file, const char __user *buf,
48256 size_t count, loff_t *offp)
48257 {
48258 @@ -390,8 +402,8 @@
48259 return count;
48260 }
48261
48262 -static long vol_cdev_ioctl(struct file *file, unsigned int cmd,
48263 - unsigned long arg)
48264 +static int vol_cdev_ioctl(struct inode *inode, struct file *file,
48265 + unsigned int cmd, unsigned long arg)
48266 {
48267 int err = 0;
48268 struct ubi_volume_desc *desc = file->private_data;
48269 @@ -475,6 +487,7 @@
48270 break;
48271 }
48272
48273 +#ifdef CONFIG_MTD_UBI_DEBUG_USERSPACE_IO
48274 /* Logical eraseblock erasure command */
48275 case UBI_IOCEBER:
48276 {
48277 @@ -505,77 +518,13 @@
48278 err = ubi_wl_flush(ubi);
48279 break;
48280 }
48281 -
48282 - /* Logical eraseblock map command */
48283 - case UBI_IOCEBMAP:
48284 - {
48285 - struct ubi_map_req req;
48286 -
48287 - err = copy_from_user(&req, argp, sizeof(struct ubi_map_req));
48288 - if (err) {
48289 - err = -EFAULT;
48290 - break;
48291 - }
48292 - err = ubi_leb_map(desc, req.lnum, req.dtype);
48293 - break;
48294 - }
48295 -
48296 - /* Logical eraseblock un-map command */
48297 - case UBI_IOCEBUNMAP:
48298 - {
48299 - int32_t lnum;
48300 -
48301 - err = get_user(lnum, (__user int32_t *)argp);
48302 - if (err) {
48303 - err = -EFAULT;
48304 - break;
48305 - }
48306 - err = ubi_leb_unmap(desc, lnum);
48307 - break;
48308 - }
48309 -
48310 - /* Check if logical eraseblock is mapped command */
48311 - case UBI_IOCEBISMAP:
48312 - {
48313 - int32_t lnum;
48314 -
48315 - err = get_user(lnum, (__user int32_t *)argp);
48316 - if (err) {
48317 - err = -EFAULT;
48318 - break;
48319 - }
48320 - err = ubi_is_mapped(desc, lnum);
48321 - break;
48322 - }
48323 -
48324 - /* Set volume property command*/
48325 - case UBI_IOCSETPROP:
48326 - {
48327 - struct ubi_set_prop_req req;
48328 -
48329 - err = copy_from_user(&req, argp,
48330 - sizeof(struct ubi_set_prop_req));
48331 - if (err) {
48332 - err = -EFAULT;
48333 - break;
48334 - }
48335 - switch (req.property) {
48336 - case UBI_PROP_DIRECT_WRITE:
48337 - mutex_lock(&ubi->volumes_mutex);
48338 - desc->vol->direct_writes = !!req.value;
48339 - mutex_unlock(&ubi->volumes_mutex);
48340 - break;
48341 - default:
48342 - err = -EINVAL;
48343 - break;
48344 - }
48345 - break;
48346 - }
48347 +#endif
48348
48349 default:
48350 err = -ENOTTY;
48351 break;
48352 }
48353 +
48354 return err;
48355 }
48356
48357 @@ -813,8 +762,8 @@
48358 return err;
48359 }
48360
48361 -static long ubi_cdev_ioctl(struct file *file, unsigned int cmd,
48362 - unsigned long arg)
48363 +static int ubi_cdev_ioctl(struct inode *inode, struct file *file,
48364 + unsigned int cmd, unsigned long arg)
48365 {
48366 int err = 0;
48367 struct ubi_device *ubi;
48368 @@ -824,7 +773,7 @@
48369 if (!capable(CAP_SYS_RESOURCE))
48370 return -EPERM;
48371
48372 - ubi = ubi_get_by_major(imajor(file->f_mapping->host));
48373 + ubi = ubi_get_by_major(imajor(inode));
48374 if (!ubi)
48375 return -ENODEV;
48376
48377 @@ -894,6 +843,7 @@
48378 case UBI_IOCRSVOL:
48379 {
48380 int pebs;
48381 + uint64_t tmp;
48382 struct ubi_rsvol_req req;
48383
48384 dbg_gen("re-size volume");
48385 @@ -913,8 +863,9 @@
48386 break;
48387 }
48388
48389 - pebs = div_u64(req.bytes + desc->vol->usable_leb_size - 1,
48390 - desc->vol->usable_leb_size);
48391 + tmp = req.bytes;
48392 + pebs = !!do_div(tmp, desc->vol->usable_leb_size);
48393 + pebs += tmp;
48394
48395 mutex_lock(&ubi->volumes_mutex);
48396 err = ubi_resize_volume(desc, pebs);
48397 @@ -958,8 +909,8 @@
48398 return err;
48399 }
48400
48401 -static long ctrl_cdev_ioctl(struct file *file, unsigned int cmd,
48402 - unsigned long arg)
48403 +static int ctrl_cdev_ioctl(struct inode *inode, struct file *file,
48404 + unsigned int cmd, unsigned long arg)
48405 {
48406 int err = 0;
48407 void __user *argp = (void __user *)arg;
48408 @@ -1035,59 +986,26 @@
48409 return err;
48410 }
48411
48412 -#ifdef CONFIG_COMPAT
48413 -static long vol_cdev_compat_ioctl(struct file *file, unsigned int cmd,
48414 - unsigned long arg)
48415 -{
48416 - unsigned long translated_arg = (unsigned long)compat_ptr(arg);
48417 -
48418 - return vol_cdev_ioctl(file, cmd, translated_arg);
48419 -}
48420 -
48421 -static long ubi_cdev_compat_ioctl(struct file *file, unsigned int cmd,
48422 - unsigned long arg)
48423 -{
48424 - unsigned long translated_arg = (unsigned long)compat_ptr(arg);
48425 -
48426 - return ubi_cdev_ioctl(file, cmd, translated_arg);
48427 -}
48428 -
48429 -static long ctrl_cdev_compat_ioctl(struct file *file, unsigned int cmd,
48430 - unsigned long arg)
48431 -{
48432 - unsigned long translated_arg = (unsigned long)compat_ptr(arg);
48433 -
48434 - return ctrl_cdev_ioctl(file, cmd, translated_arg);
48435 -}
48436 -#else
48437 -#define vol_cdev_compat_ioctl NULL
48438 -#define ubi_cdev_compat_ioctl NULL
48439 -#define ctrl_cdev_compat_ioctl NULL
48440 -#endif
48441 -
48442 -/* UBI volume character device operations */
48443 -const struct file_operations ubi_vol_cdev_operations = {
48444 - .owner = THIS_MODULE,
48445 - .open = vol_cdev_open,
48446 - .release = vol_cdev_release,
48447 - .llseek = vol_cdev_llseek,
48448 - .read = vol_cdev_read,
48449 - .write = vol_cdev_write,
48450 - .unlocked_ioctl = vol_cdev_ioctl,
48451 - .compat_ioctl = vol_cdev_compat_ioctl,
48452 +/* UBI control character device operations */
48453 +struct file_operations ubi_ctrl_cdev_operations = {
48454 + .ioctl = ctrl_cdev_ioctl,
48455 + .owner = THIS_MODULE,
48456 };
48457
48458 /* UBI character device operations */
48459 -const struct file_operations ubi_cdev_operations = {
48460 - .owner = THIS_MODULE,
48461 - .llseek = no_llseek,
48462 - .unlocked_ioctl = ubi_cdev_ioctl,
48463 - .compat_ioctl = ubi_cdev_compat_ioctl,
48464 +struct file_operations ubi_cdev_operations = {
48465 + .owner = THIS_MODULE,
48466 + .ioctl = ubi_cdev_ioctl,
48467 + .llseek = no_llseek,
48468 };
48469
48470 -/* UBI control character device operations */
48471 -const struct file_operations ubi_ctrl_cdev_operations = {
48472 - .owner = THIS_MODULE,
48473 - .unlocked_ioctl = ctrl_cdev_ioctl,
48474 - .compat_ioctl = ctrl_cdev_compat_ioctl,
48475 +/* UBI volume character device operations */
48476 +struct file_operations ubi_vol_cdev_operations = {
48477 + .owner = THIS_MODULE,
48478 + .open = vol_cdev_open,
48479 + .release = vol_cdev_release,
48480 + .llseek = vol_cdev_llseek,
48481 + .read = vol_cdev_read,
48482 + .write = vol_cdev_write,
48483 + .ioctl = vol_cdev_ioctl,
48484 };
48485 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mtd/ubi/gluebi.c linux-2.6.29-rc3.owrt/drivers/mtd/ubi/gluebi.c
48486 --- linux-2.6.29.owrt/drivers/mtd/ubi/gluebi.c 2009-05-10 22:04:39.000000000 +0200
48487 +++ linux-2.6.29-rc3.owrt/drivers/mtd/ubi/gluebi.c 2009-05-10 23:48:28.000000000 +0200
48488 @@ -28,7 +28,7 @@
48489 * eraseblock size is equivalent to the logical eraseblock size of the volume.
48490 */
48491
48492 -#include <linux/math64.h>
48493 +#include <asm/div64.h>
48494 #include "ubi.h"
48495
48496 /**
48497 @@ -109,6 +109,7 @@
48498 int err = 0, lnum, offs, total_read;
48499 struct ubi_volume *vol;
48500 struct ubi_device *ubi;
48501 + uint64_t tmp = from;
48502
48503 dbg_gen("read %zd bytes from offset %lld", len, from);
48504
48505 @@ -118,7 +119,9 @@
48506 vol = container_of(mtd, struct ubi_volume, gluebi_mtd);
48507 ubi = vol->ubi;
48508
48509 - lnum = div_u64_rem(from, mtd->erasesize, &offs);
48510 + offs = do_div(tmp, mtd->erasesize);
48511 + lnum = tmp;
48512 +
48513 total_read = len;
48514 while (total_read) {
48515 size_t to_read = mtd->erasesize - offs;
48516 @@ -157,6 +160,7 @@
48517 int err = 0, lnum, offs, total_written;
48518 struct ubi_volume *vol;
48519 struct ubi_device *ubi;
48520 + uint64_t tmp = to;
48521
48522 dbg_gen("write %zd bytes to offset %lld", len, to);
48523
48524 @@ -169,7 +173,8 @@
48525 if (ubi->ro_mode)
48526 return -EROFS;
48527
48528 - lnum = div_u64_rem(to, mtd->erasesize, &offs);
48529 + offs = do_div(tmp, mtd->erasesize);
48530 + lnum = tmp;
48531
48532 if (len % mtd->writesize || offs % mtd->writesize)
48533 return -EINVAL;
48534 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mtd/ubi/Kconfig.debug linux-2.6.29-rc3.owrt/drivers/mtd/ubi/Kconfig.debug
48535 --- linux-2.6.29.owrt/drivers/mtd/ubi/Kconfig.debug 2009-05-10 22:04:39.000000000 +0200
48536 +++ linux-2.6.29-rc3.owrt/drivers/mtd/ubi/Kconfig.debug 2009-05-10 23:48:28.000000000 +0200
48537 @@ -33,6 +33,16 @@
48538 This option switches the background thread off by default. The thread
48539 may be also be enabled/disabled via UBI sysfs.
48540
48541 +config MTD_UBI_DEBUG_USERSPACE_IO
48542 + bool "Direct user-space write/erase support"
48543 + default n
48544 + depends on MTD_UBI_DEBUG
48545 + help
48546 + By default, users cannot directly write and erase individual
48547 + eraseblocks of dynamic volumes, and have to use update operation
48548 + instead. This option enables this capability - it is very useful for
48549 + debugging and testing.
48550 +
48551 config MTD_UBI_DEBUG_EMULATE_BITFLIPS
48552 bool "Emulate flash bit-flips"
48553 depends on MTD_UBI_DEBUG
48554 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mtd/ubi/scan.c linux-2.6.29-rc3.owrt/drivers/mtd/ubi/scan.c
48555 --- linux-2.6.29.owrt/drivers/mtd/ubi/scan.c 2009-05-10 22:04:39.000000000 +0200
48556 +++ linux-2.6.29-rc3.owrt/drivers/mtd/ubi/scan.c 2009-05-10 23:48:28.000000000 +0200
48557 @@ -42,7 +42,7 @@
48558
48559 #include <linux/err.h>
48560 #include <linux/crc32.h>
48561 -#include <linux/math64.h>
48562 +#include <asm/div64.h>
48563 #include "ubi.h"
48564
48565 #ifdef CONFIG_MTD_UBI_DEBUG_PARANOID
48566 @@ -904,8 +904,10 @@
48567 dbg_msg("scanning is finished");
48568
48569 /* Calculate mean erase counter */
48570 - if (si->ec_count)
48571 - si->mean_ec = div_u64(si->ec_sum, si->ec_count);
48572 + if (si->ec_count) {
48573 + do_div(si->ec_sum, si->ec_count);
48574 + si->mean_ec = si->ec_sum;
48575 + }
48576
48577 if (si->is_empty)
48578 ubi_msg("empty MTD device detected");
48579 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mtd/ubi/ubi.h linux-2.6.29-rc3.owrt/drivers/mtd/ubi/ubi.h
48580 --- linux-2.6.29.owrt/drivers/mtd/ubi/ubi.h 2009-05-10 22:04:39.000000000 +0200
48581 +++ linux-2.6.29-rc3.owrt/drivers/mtd/ubi/ubi.h 2009-05-10 23:48:28.000000000 +0200
48582 @@ -206,7 +206,6 @@
48583 * @upd_marker: %1 if the update marker is set for this volume
48584 * @updating: %1 if the volume is being updated
48585 * @changing_leb: %1 if the atomic LEB change ioctl command is in progress
48586 - * @direct_writes: %1 if direct writes are enabled for this volume
48587 *
48588 * @gluebi_desc: gluebi UBI volume descriptor
48589 * @gluebi_refcount: reference count of the gluebi MTD device
48590 @@ -254,7 +253,6 @@
48591 unsigned int upd_marker:1;
48592 unsigned int updating:1;
48593 unsigned int changing_leb:1;
48594 - unsigned int direct_writes:1;
48595
48596 #ifdef CONFIG_MTD_UBI_GLUEBI
48597 /*
48598 @@ -306,8 +304,7 @@
48599 * @vtbl_size: size of the volume table in bytes
48600 * @vtbl: in-RAM volume table copy
48601 * @volumes_mutex: protects on-flash volume table and serializes volume
48602 - * changes, like creation, deletion, update, re-size,
48603 - * re-name and set property
48604 + * changes, like creation, deletion, update, re-size and re-name
48605 *
48606 * @max_ec: current highest erase counter value
48607 * @mean_ec: current mean erase counter value
48608 @@ -452,9 +449,9 @@
48609 };
48610
48611 extern struct kmem_cache *ubi_wl_entry_slab;
48612 -extern const struct file_operations ubi_ctrl_cdev_operations;
48613 -extern const struct file_operations ubi_cdev_operations;
48614 -extern const struct file_operations ubi_vol_cdev_operations;
48615 +extern struct file_operations ubi_ctrl_cdev_operations;
48616 +extern struct file_operations ubi_cdev_operations;
48617 +extern struct file_operations ubi_vol_cdev_operations;
48618 extern struct class *ubi_class;
48619 extern struct mutex ubi_devices_mutex;
48620
48621 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mtd/ubi/upd.c linux-2.6.29-rc3.owrt/drivers/mtd/ubi/upd.c
48622 --- linux-2.6.29.owrt/drivers/mtd/ubi/upd.c 2009-05-10 22:04:39.000000000 +0200
48623 +++ linux-2.6.29-rc3.owrt/drivers/mtd/ubi/upd.c 2009-05-10 23:48:28.000000000 +0200
48624 @@ -40,7 +40,7 @@
48625
48626 #include <linux/err.h>
48627 #include <linux/uaccess.h>
48628 -#include <linux/math64.h>
48629 +#include <asm/div64.h>
48630 #include "ubi.h"
48631
48632 /**
48633 @@ -89,6 +89,7 @@
48634 long long bytes)
48635 {
48636 int err;
48637 + uint64_t tmp;
48638 struct ubi_vtbl_record vtbl_rec;
48639
48640 dbg_gen("clear update marker for volume %d", vol->vol_id);
48641 @@ -100,9 +101,9 @@
48642
48643 if (vol->vol_type == UBI_STATIC_VOLUME) {
48644 vol->corrupted = 0;
48645 - vol->used_bytes = bytes;
48646 - vol->used_ebs = div_u64_rem(bytes, vol->usable_leb_size,
48647 - &vol->last_eb_bytes);
48648 + vol->used_bytes = tmp = bytes;
48649 + vol->last_eb_bytes = do_div(tmp, vol->usable_leb_size);
48650 + vol->used_ebs = tmp;
48651 if (vol->last_eb_bytes)
48652 vol->used_ebs += 1;
48653 else
48654 @@ -130,6 +131,7 @@
48655 long long bytes)
48656 {
48657 int i, err;
48658 + uint64_t tmp;
48659
48660 dbg_gen("start update of volume %d, %llu bytes", vol->vol_id, bytes);
48661 ubi_assert(!vol->updating && !vol->changing_leb);
48662 @@ -159,8 +161,9 @@
48663 if (!vol->upd_buf)
48664 return -ENOMEM;
48665
48666 - vol->upd_ebs = div_u64(bytes + vol->usable_leb_size - 1,
48667 - vol->usable_leb_size);
48668 + tmp = bytes;
48669 + vol->upd_ebs = !!do_div(tmp, vol->usable_leb_size);
48670 + vol->upd_ebs += tmp;
48671 vol->upd_bytes = bytes;
48672 vol->upd_received = 0;
48673 return 0;
48674 @@ -279,6 +282,7 @@
48675 int ubi_more_update_data(struct ubi_device *ubi, struct ubi_volume *vol,
48676 const void __user *buf, int count)
48677 {
48678 + uint64_t tmp;
48679 int lnum, offs, err = 0, len, to_write = count;
48680
48681 dbg_gen("write %d of %lld bytes, %lld already passed",
48682 @@ -287,7 +291,10 @@
48683 if (ubi->ro_mode)
48684 return -EROFS;
48685
48686 - lnum = div_u64_rem(vol->upd_received, vol->usable_leb_size, &offs);
48687 + tmp = vol->upd_received;
48688 + offs = do_div(tmp, vol->usable_leb_size);
48689 + lnum = tmp;
48690 +
48691 if (vol->upd_received + count > vol->upd_bytes)
48692 to_write = count = vol->upd_bytes - vol->upd_received;
48693
48694 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/mtd/ubi/vmt.c linux-2.6.29-rc3.owrt/drivers/mtd/ubi/vmt.c
48695 --- linux-2.6.29.owrt/drivers/mtd/ubi/vmt.c 2009-05-10 22:04:39.000000000 +0200
48696 +++ linux-2.6.29-rc3.owrt/drivers/mtd/ubi/vmt.c 2009-05-10 23:48:28.000000000 +0200
48697 @@ -24,7 +24,7 @@
48698 */
48699
48700 #include <linux/err.h>
48701 -#include <linux/math64.h>
48702 +#include <asm/div64.h>
48703 #include "ubi.h"
48704
48705 #ifdef CONFIG_MTD_UBI_DEBUG_PARANOID
48706 @@ -205,6 +205,7 @@
48707 int i, err, vol_id = req->vol_id, do_free = 1;
48708 struct ubi_volume *vol;
48709 struct ubi_vtbl_record vtbl_rec;
48710 + uint64_t bytes;
48711 dev_t dev;
48712
48713 if (ubi->ro_mode)
48714 @@ -254,8 +255,10 @@
48715
48716 /* Calculate how many eraseblocks are requested */
48717 vol->usable_leb_size = ubi->leb_size - ubi->leb_size % req->alignment;
48718 - vol->reserved_pebs += div_u64(req->bytes + vol->usable_leb_size - 1,
48719 - vol->usable_leb_size);
48720 + bytes = req->bytes;
48721 + if (do_div(bytes, vol->usable_leb_size))
48722 + vol->reserved_pebs = 1;
48723 + vol->reserved_pebs += bytes;
48724
48725 /* Reserve physical eraseblocks */
48726 if (vol->reserved_pebs > ubi->avail_pebs) {
48727 @@ -298,10 +301,10 @@
48728 vol->used_bytes =
48729 (long long)vol->used_ebs * vol->usable_leb_size;
48730 } else {
48731 - vol->used_ebs = div_u64_rem(vol->used_bytes,
48732 - vol->usable_leb_size,
48733 - &vol->last_eb_bytes);
48734 - if (vol->last_eb_bytes != 0)
48735 + bytes = vol->used_bytes;
48736 + vol->last_eb_bytes = do_div(bytes, vol->usable_leb_size);
48737 + vol->used_ebs = bytes;
48738 + if (vol->last_eb_bytes)
48739 vol->used_ebs += 1;
48740 else
48741 vol->last_eb_bytes = vol->usable_leb_size;
48742 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/3c505.c linux-2.6.29-rc3.owrt/drivers/net/3c505.c
48743 --- linux-2.6.29.owrt/drivers/net/3c505.c 2009-05-10 22:04:38.000000000 +0200
48744 +++ linux-2.6.29-rc3.owrt/drivers/net/3c505.c 2009-05-10 23:48:28.000000000 +0200
48745 @@ -493,27 +493,21 @@
48746 }
48747 /* read the data */
48748 spin_lock_irqsave(&adapter->lock, flags);
48749 - for (i = 0; i < MAX_PCB_DATA; i++) {
48750 - for (j = 0; j < 20000; j++) {
48751 - stat = get_status(dev->base_addr);
48752 - if (stat & ACRF)
48753 - break;
48754 - }
48755 - pcb->data.raw[i] = inb_command(dev->base_addr);
48756 - if ((stat & ASF_PCB_MASK) == ASF_PCB_END || j >= 20000)
48757 - break;
48758 - }
48759 + i = 0;
48760 + do {
48761 + j = 0;
48762 + while (((stat = get_status(dev->base_addr)) & ACRF) == 0 && j++ < 20000);
48763 + pcb->data.raw[i++] = inb_command(dev->base_addr);
48764 + if (i > MAX_PCB_DATA)
48765 + INVALID_PCB_MSG(i);
48766 + } while ((stat & ASF_PCB_MASK) != ASF_PCB_END && j < 20000);
48767 spin_unlock_irqrestore(&adapter->lock, flags);
48768 - if (i >= MAX_PCB_DATA) {
48769 - INVALID_PCB_MSG(i);
48770 - return false;
48771 - }
48772 if (j >= 20000) {
48773 TIMEOUT_MSG(__LINE__);
48774 return false;
48775 }
48776 - /* the last "data" byte was really the length! */
48777 - total_length = pcb->data.raw[i];
48778 + /* woops, the last "data" byte was really the length! */
48779 + total_length = pcb->data.raw[--i];
48780
48781 /* safety check total length vs data length */
48782 if (total_length != (pcb->length + 2)) {
48783 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/3c509.c linux-2.6.29-rc3.owrt/drivers/net/3c509.c
48784 --- linux-2.6.29.owrt/drivers/net/3c509.c 2009-05-10 22:04:38.000000000 +0200
48785 +++ linux-2.6.29-rc3.owrt/drivers/net/3c509.c 2009-05-10 23:48:28.000000000 +0200
48786 @@ -1475,7 +1475,6 @@
48787 spin_lock_irqsave(&lp->lock, flags);
48788
48789 outw(PowerUp, ioaddr + EL3_CMD);
48790 - EL3WINDOW(0);
48791 el3_up(dev);
48792
48793 if (netif_running(dev))
48794 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/arm/etherh.c linux-2.6.29-rc3.owrt/drivers/net/arm/etherh.c
48795 --- linux-2.6.29.owrt/drivers/net/arm/etherh.c 2009-05-10 22:04:38.000000000 +0200
48796 +++ linux-2.6.29-rc3.owrt/drivers/net/arm/etherh.c 2009-05-10 23:48:28.000000000 +0200
48797 @@ -641,15 +641,15 @@
48798 .ndo_open = etherh_open,
48799 .ndo_stop = etherh_close,
48800 .ndo_set_config = etherh_set_config,
48801 - .ndo_start_xmit = __ei_start_xmit,
48802 - .ndo_tx_timeout = __ei_tx_timeout,
48803 - .ndo_get_stats = __ei_get_stats,
48804 - .ndo_set_multicast_list = __ei_set_multicast_list,
48805 + .ndo_start_xmit = ei_start_xmit,
48806 + .ndo_tx_timeout = ei_tx_timeout,
48807 + .ndo_get_stats = ei_get_stats,
48808 + .ndo_set_multicast_list = ei_set_multicast_list,
48809 .ndo_validate_addr = eth_validate_addr,
48810 - .ndo_set_mac_address = eth_mac_addr,
48811 + .ndo_set_mac_address = eth_set_mac_addr,
48812 .ndo_change_mtu = eth_change_mtu,
48813 #ifdef CONFIG_NET_POLL_CONTROLLER
48814 - .ndo_poll_controller = __ei_poll,
48815 + .ndo_poll_controller = ei_poll,
48816 #endif
48817 };
48818
48819 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/arm/ks8695net.c linux-2.6.29-rc3.owrt/drivers/net/arm/ks8695net.c
48820 --- linux-2.6.29.owrt/drivers/net/arm/ks8695net.c 2009-05-10 22:04:38.000000000 +0200
48821 +++ linux-2.6.29-rc3.owrt/drivers/net/arm/ks8695net.c 2009-05-10 23:48:28.000000000 +0200
48822 @@ -560,7 +560,7 @@
48823 msleep(1);
48824 }
48825
48826 - if (reset_timeout < 0) {
48827 + if (reset_timeout == 0) {
48828 dev_crit(ksp->dev,
48829 "Timeout waiting for DMA engines to reset\n");
48830 /* And blithely carry on */
48831 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/arm/Makefile linux-2.6.29-rc3.owrt/drivers/net/arm/Makefile
48832 --- linux-2.6.29.owrt/drivers/net/arm/Makefile 2009-05-10 22:04:38.000000000 +0200
48833 +++ linux-2.6.29-rc3.owrt/drivers/net/arm/Makefile 2009-05-10 23:48:28.000000000 +0200
48834 @@ -4,7 +4,7 @@
48835 #
48836
48837 obj-$(CONFIG_ARM_AM79C961A) += am79c961a.o
48838 -obj-$(CONFIG_ARM_ETHERH) += etherh.o
48839 +obj-$(CONFIG_ARM_ETHERH) += etherh.o ../8390.o
48840 obj-$(CONFIG_ARM_ETHER3) += ether3.o
48841 obj-$(CONFIG_ARM_ETHER1) += ether1.o
48842 obj-$(CONFIG_ARM_AT91_ETHER) += at91_ether.o
48843 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/atl1c/atl1c_ethtool.c linux-2.6.29-rc3.owrt/drivers/net/atl1c/atl1c_ethtool.c
48844 --- linux-2.6.29.owrt/drivers/net/atl1c/atl1c_ethtool.c 2009-05-10 22:04:38.000000000 +0200
48845 +++ linux-2.6.29-rc3.owrt/drivers/net/atl1c/atl1c_ethtool.c 1970-01-01 01:00:00.000000000 +0100
48846 @@ -1,317 +0,0 @@
48847 -/*
48848 - * Copyright(c) 2009 - 2009 Atheros Corporation. All rights reserved.
48849 - *
48850 - * Derived from Intel e1000 driver
48851 - * Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved.
48852 - *
48853 - * This program is free software; you can redistribute it and/or modify it
48854 - * under the terms of the GNU General Public License as published by the Free
48855 - * Software Foundation; either version 2 of the License, or (at your option)
48856 - * any later version.
48857 - *
48858 - * This program is distributed in the hope that it will be useful, but WITHOUT
48859 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
48860 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
48861 - * more details.
48862 - *
48863 - * You should have received a copy of the GNU General Public License along with
48864 - * this program; if not, write to the Free Software Foundation, Inc., 59
48865 - * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
48866 - *
48867 - */
48868 -
48869 -#include <linux/netdevice.h>
48870 -#include <linux/ethtool.h>
48871 -
48872 -#include "atl1c.h"
48873 -
48874 -static int atl1c_get_settings(struct net_device *netdev,
48875 - struct ethtool_cmd *ecmd)
48876 -{
48877 - struct atl1c_adapter *adapter = netdev_priv(netdev);
48878 - struct atl1c_hw *hw = &adapter->hw;
48879 -
48880 - ecmd->supported = (SUPPORTED_10baseT_Half |
48881 - SUPPORTED_10baseT_Full |
48882 - SUPPORTED_100baseT_Half |
48883 - SUPPORTED_100baseT_Full |
48884 - SUPPORTED_Autoneg |
48885 - SUPPORTED_TP);
48886 - if (hw->ctrl_flags & ATL1C_LINK_CAP_1000M)
48887 - ecmd->supported |= SUPPORTED_1000baseT_Full;
48888 -
48889 - ecmd->advertising = ADVERTISED_TP;
48890 -
48891 - ecmd->advertising |= hw->autoneg_advertised;
48892 -
48893 - ecmd->port = PORT_TP;
48894 - ecmd->phy_address = 0;
48895 - ecmd->transceiver = XCVR_INTERNAL;
48896 -
48897 - if (adapter->link_speed != SPEED_0) {
48898 - ecmd->speed = adapter->link_speed;
48899 - if (adapter->link_duplex == FULL_DUPLEX)
48900 - ecmd->duplex = DUPLEX_FULL;
48901 - else
48902 - ecmd->duplex = DUPLEX_HALF;
48903 - } else {
48904 - ecmd->speed = -1;
48905 - ecmd->duplex = -1;
48906 - }
48907 -
48908 - ecmd->autoneg = AUTONEG_ENABLE;
48909 - return 0;
48910 -}
48911 -
48912 -static int atl1c_set_settings(struct net_device *netdev,
48913 - struct ethtool_cmd *ecmd)
48914 -{
48915 - struct atl1c_adapter *adapter = netdev_priv(netdev);
48916 - struct atl1c_hw *hw = &adapter->hw;
48917 - u16 autoneg_advertised;
48918 -
48919 - while (test_and_set_bit(__AT_RESETTING, &adapter->flags))
48920 - msleep(1);
48921 -
48922 - if (ecmd->autoneg == AUTONEG_ENABLE) {
48923 - autoneg_advertised = ADVERTISED_Autoneg;
48924 - } else {
48925 - if (ecmd->speed == SPEED_1000) {
48926 - if (ecmd->duplex != DUPLEX_FULL) {
48927 - if (netif_msg_link(adapter))
48928 - dev_warn(&adapter->pdev->dev,
48929 - "1000M half is invalid\n");
48930 - clear_bit(__AT_RESETTING, &adapter->flags);
48931 - return -EINVAL;
48932 - }
48933 - autoneg_advertised = ADVERTISED_1000baseT_Full;
48934 - } else if (ecmd->speed == SPEED_100) {
48935 - if (ecmd->duplex == DUPLEX_FULL)
48936 - autoneg_advertised = ADVERTISED_100baseT_Full;
48937 - else
48938 - autoneg_advertised = ADVERTISED_100baseT_Half;
48939 - } else {
48940 - if (ecmd->duplex == DUPLEX_FULL)
48941 - autoneg_advertised = ADVERTISED_10baseT_Full;
48942 - else
48943 - autoneg_advertised = ADVERTISED_10baseT_Half;
48944 - }
48945 - }
48946 -
48947 - if (hw->autoneg_advertised != autoneg_advertised) {
48948 - hw->autoneg_advertised = autoneg_advertised;
48949 - if (atl1c_restart_autoneg(hw) != 0) {
48950 - if (netif_msg_link(adapter))
48951 - dev_warn(&adapter->pdev->dev,
48952 - "ethtool speed/duplex setting failed\n");
48953 - clear_bit(__AT_RESETTING, &adapter->flags);
48954 - return -EINVAL;
48955 - }
48956 - }
48957 - clear_bit(__AT_RESETTING, &adapter->flags);
48958 - return 0;
48959 -}
48960 -
48961 -static u32 atl1c_get_tx_csum(struct net_device *netdev)
48962 -{
48963 - return (netdev->features & NETIF_F_HW_CSUM) != 0;
48964 -}
48965 -
48966 -static u32 atl1c_get_msglevel(struct net_device *netdev)
48967 -{
48968 - struct atl1c_adapter *adapter = netdev_priv(netdev);
48969 - return adapter->msg_enable;
48970 -}
48971 -
48972 -static void atl1c_set_msglevel(struct net_device *netdev, u32 data)
48973 -{
48974 - struct atl1c_adapter *adapter = netdev_priv(netdev);
48975 - adapter->msg_enable = data;
48976 -}
48977 -
48978 -static int atl1c_get_regs_len(struct net_device *netdev)
48979 -{
48980 - return AT_REGS_LEN;
48981 -}
48982 -
48983 -static void atl1c_get_regs(struct net_device *netdev,
48984 - struct ethtool_regs *regs, void *p)
48985 -{
48986 - struct atl1c_adapter *adapter = netdev_priv(netdev);
48987 - struct atl1c_hw *hw = &adapter->hw;
48988 - u32 *regs_buff = p;
48989 - u16 phy_data;
48990 -
48991 - memset(p, 0, AT_REGS_LEN);
48992 -
48993 - regs->version = 0;
48994 - AT_READ_REG(hw, REG_VPD_CAP, p++);
48995 - AT_READ_REG(hw, REG_PM_CTRL, p++);
48996 - AT_READ_REG(hw, REG_MAC_HALF_DUPLX_CTRL, p++);
48997 - AT_READ_REG(hw, REG_TWSI_CTRL, p++);
48998 - AT_READ_REG(hw, REG_PCIE_DEV_MISC_CTRL, p++);
48999 - AT_READ_REG(hw, REG_MASTER_CTRL, p++);
49000 - AT_READ_REG(hw, REG_MANUAL_TIMER_INIT, p++);
49001 - AT_READ_REG(hw, REG_IRQ_MODRT_TIMER_INIT, p++);
49002 - AT_READ_REG(hw, REG_GPHY_CTRL, p++);
49003 - AT_READ_REG(hw, REG_LINK_CTRL, p++);
49004 - AT_READ_REG(hw, REG_IDLE_STATUS, p++);
49005 - AT_READ_REG(hw, REG_MDIO_CTRL, p++);
49006 - AT_READ_REG(hw, REG_SERDES_LOCK, p++);
49007 - AT_READ_REG(hw, REG_MAC_CTRL, p++);
49008 - AT_READ_REG(hw, REG_MAC_IPG_IFG, p++);
49009 - AT_READ_REG(hw, REG_MAC_STA_ADDR, p++);
49010 - AT_READ_REG(hw, REG_MAC_STA_ADDR+4, p++);
49011 - AT_READ_REG(hw, REG_RX_HASH_TABLE, p++);
49012 - AT_READ_REG(hw, REG_RX_HASH_TABLE+4, p++);
49013 - AT_READ_REG(hw, REG_RXQ_CTRL, p++);
49014 - AT_READ_REG(hw, REG_TXQ_CTRL, p++);
49015 - AT_READ_REG(hw, REG_MTU, p++);
49016 - AT_READ_REG(hw, REG_WOL_CTRL, p++);
49017 -
49018 - atl1c_read_phy_reg(hw, MII_BMCR, &phy_data);
49019 - regs_buff[73] = (u32) phy_data;
49020 - atl1c_read_phy_reg(hw, MII_BMSR, &phy_data);
49021 - regs_buff[74] = (u32) phy_data;
49022 -}
49023 -
49024 -static int atl1c_get_eeprom_len(struct net_device *netdev)
49025 -{
49026 - struct atl1c_adapter *adapter = netdev_priv(netdev);
49027 -
49028 - if (atl1c_check_eeprom_exist(&adapter->hw))
49029 - return AT_EEPROM_LEN;
49030 - else
49031 - return 0;
49032 -}
49033 -
49034 -static int atl1c_get_eeprom(struct net_device *netdev,
49035 - struct ethtool_eeprom *eeprom, u8 *bytes)
49036 -{
49037 - struct atl1c_adapter *adapter = netdev_priv(netdev);
49038 - struct atl1c_hw *hw = &adapter->hw;
49039 - u32 *eeprom_buff;
49040 - int first_dword, last_dword;
49041 - int ret_val = 0;
49042 - int i;
49043 -
49044 - if (eeprom->len == 0)
49045 - return -EINVAL;
49046 -
49047 - if (!atl1c_check_eeprom_exist(hw)) /* not exist */
49048 - return -EINVAL;
49049 -
49050 - eeprom->magic = adapter->pdev->vendor |
49051 - (adapter->pdev->device << 16);
49052 -
49053 - first_dword = eeprom->offset >> 2;
49054 - last_dword = (eeprom->offset + eeprom->len - 1) >> 2;
49055 -
49056 - eeprom_buff = kmalloc(sizeof(u32) *
49057 - (last_dword - first_dword + 1), GFP_KERNEL);
49058 - if (eeprom_buff == NULL)
49059 - return -ENOMEM;
49060 -
49061 - for (i = first_dword; i < last_dword; i++) {
49062 - if (!atl1c_read_eeprom(hw, i * 4, &(eeprom_buff[i-first_dword]))) {
49063 - kfree(eeprom_buff);
49064 - return -EIO;
49065 - }
49066 - }
49067 -
49068 - memcpy(bytes, (u8 *)eeprom_buff + (eeprom->offset & 3),
49069 - eeprom->len);
49070 - kfree(eeprom_buff);
49071 -
49072 - return ret_val;
49073 - return 0;
49074 -}
49075 -
49076 -static void atl1c_get_drvinfo(struct net_device *netdev,
49077 - struct ethtool_drvinfo *drvinfo)
49078 -{
49079 - struct atl1c_adapter *adapter = netdev_priv(netdev);
49080 -
49081 - strncpy(drvinfo->driver, atl1c_driver_name, sizeof(drvinfo->driver));
49082 - strncpy(drvinfo->version, atl1c_driver_version,
49083 - sizeof(drvinfo->version));
49084 - strncpy(drvinfo->fw_version, "N/A", sizeof(drvinfo->fw_version));
49085 - strncpy(drvinfo->bus_info, pci_name(adapter->pdev),
49086 - sizeof(drvinfo->bus_info));
49087 - drvinfo->n_stats = 0;
49088 - drvinfo->testinfo_len = 0;
49089 - drvinfo->regdump_len = atl1c_get_regs_len(netdev);
49090 - drvinfo->eedump_len = atl1c_get_eeprom_len(netdev);
49091 -}
49092 -
49093 -static void atl1c_get_wol(struct net_device *netdev,
49094 - struct ethtool_wolinfo *wol)
49095 -{
49096 - struct atl1c_adapter *adapter = netdev_priv(netdev);
49097 -
49098 - wol->supported = WAKE_MAGIC | WAKE_PHY;
49099 - wol->wolopts = 0;
49100 -
49101 - if (adapter->wol & AT_WUFC_EX)
49102 - wol->wolopts |= WAKE_UCAST;
49103 - if (adapter->wol & AT_WUFC_MC)
49104 - wol->wolopts |= WAKE_MCAST;
49105 - if (adapter->wol & AT_WUFC_BC)
49106 - wol->wolopts |= WAKE_BCAST;
49107 - if (adapter->wol & AT_WUFC_MAG)
49108 - wol->wolopts |= WAKE_MAGIC;
49109 - if (adapter->wol & AT_WUFC_LNKC)
49110 - wol->wolopts |= WAKE_PHY;
49111 -
49112 - return;
49113 -}
49114 -
49115 -static int atl1c_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
49116 -{
49117 - struct atl1c_adapter *adapter = netdev_priv(netdev);
49118 -
49119 - if (wol->wolopts & (WAKE_ARP | WAKE_MAGICSECURE |
49120 - WAKE_MCAST | WAKE_BCAST | WAKE_MCAST))
49121 - return -EOPNOTSUPP;
49122 - /* these settings will always override what we currently have */
49123 - adapter->wol = 0;
49124 -
49125 - if (wol->wolopts & WAKE_MAGIC)
49126 - adapter->wol |= AT_WUFC_MAG;
49127 - if (wol->wolopts & WAKE_PHY)
49128 - adapter->wol |= AT_WUFC_LNKC;
49129 -
49130 - return 0;
49131 -}
49132 -
49133 -static int atl1c_nway_reset(struct net_device *netdev)
49134 -{
49135 - struct atl1c_adapter *adapter = netdev_priv(netdev);
49136 - if (netif_running(netdev))
49137 - atl1c_reinit_locked(adapter);
49138 - return 0;
49139 -}
49140 -
49141 -static struct ethtool_ops atl1c_ethtool_ops = {
49142 - .get_settings = atl1c_get_settings,
49143 - .set_settings = atl1c_set_settings,
49144 - .get_drvinfo = atl1c_get_drvinfo,
49145 - .get_regs_len = atl1c_get_regs_len,
49146 - .get_regs = atl1c_get_regs,
49147 - .get_wol = atl1c_get_wol,
49148 - .set_wol = atl1c_set_wol,
49149 - .get_msglevel = atl1c_get_msglevel,
49150 - .set_msglevel = atl1c_set_msglevel,
49151 - .nway_reset = atl1c_nway_reset,
49152 - .get_link = ethtool_op_get_link,
49153 - .get_eeprom_len = atl1c_get_eeprom_len,
49154 - .get_eeprom = atl1c_get_eeprom,
49155 - .get_tx_csum = atl1c_get_tx_csum,
49156 - .get_sg = ethtool_op_get_sg,
49157 - .set_sg = ethtool_op_set_sg,
49158 -};
49159 -
49160 -void atl1c_set_ethtool_ops(struct net_device *netdev)
49161 -{
49162 - SET_ETHTOOL_OPS(netdev, &atl1c_ethtool_ops);
49163 -}
49164 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/atl1c/atl1c.h linux-2.6.29-rc3.owrt/drivers/net/atl1c/atl1c.h
49165 --- linux-2.6.29.owrt/drivers/net/atl1c/atl1c.h 2009-05-10 22:04:38.000000000 +0200
49166 +++ linux-2.6.29-rc3.owrt/drivers/net/atl1c/atl1c.h 1970-01-01 01:00:00.000000000 +0100
49167 @@ -1,606 +0,0 @@
49168 -/*
49169 - * Copyright(c) 2008 - 2009 Atheros Corporation. All rights reserved.
49170 - *
49171 - * Derived from Intel e1000 driver
49172 - * Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved.
49173 - *
49174 - * This program is free software; you can redistribute it and/or modify it
49175 - * under the terms of the GNU General Public License as published by the Free
49176 - * Software Foundation; either version 2 of the License, or (at your option)
49177 - * any later version.
49178 - *
49179 - * This program is distributed in the hope that it will be useful, but WITHOUT
49180 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
49181 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
49182 - * more details.
49183 - *
49184 - * You should have received a copy of the GNU General Public License along with
49185 - * this program; if not, write to the Free Software Foundation, Inc., 59
49186 - * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
49187 - */
49188 -
49189 -#ifndef _ATL1C_H_
49190 -#define _ATL1C_H_
49191 -
49192 -#include <linux/version.h>
49193 -#include <linux/init.h>
49194 -#include <linux/types.h>
49195 -#include <linux/errno.h>
49196 -#include <linux/module.h>
49197 -#include <linux/pci.h>
49198 -#include <linux/netdevice.h>
49199 -#include <linux/etherdevice.h>
49200 -#include <linux/skbuff.h>
49201 -#include <linux/ioport.h>
49202 -#include <linux/slab.h>
49203 -#include <linux/list.h>
49204 -#include <linux/delay.h>
49205 -#include <linux/sched.h>
49206 -#include <linux/in.h>
49207 -#include <linux/ip.h>
49208 -#include <linux/ipv6.h>
49209 -#include <linux/udp.h>
49210 -#include <linux/mii.h>
49211 -#include <linux/io.h>
49212 -#include <linux/vmalloc.h>
49213 -#include <linux/pagemap.h>
49214 -#include <linux/tcp.h>
49215 -#include <linux/mii.h>
49216 -#include <linux/ethtool.h>
49217 -#include <linux/if_vlan.h>
49218 -#include <linux/workqueue.h>
49219 -#include <net/checksum.h>
49220 -#include <net/ip6_checksum.h>
49221 -
49222 -#include "atl1c_hw.h"
49223 -
49224 -/* Wake Up Filter Control */
49225 -#define AT_WUFC_LNKC 0x00000001 /* Link Status Change Wakeup Enable */
49226 -#define AT_WUFC_MAG 0x00000002 /* Magic Packet Wakeup Enable */
49227 -#define AT_WUFC_EX 0x00000004 /* Directed Exact Wakeup Enable */
49228 -#define AT_WUFC_MC 0x00000008 /* Multicast Wakeup Enable */
49229 -#define AT_WUFC_BC 0x00000010 /* Broadcast Wakeup Enable */
49230 -
49231 -#define AT_VLAN_TO_TAG(_vlan, _tag) \
49232 - _tag = ((((_vlan) >> 8) & 0xFF) |\
49233 - (((_vlan) & 0xFF) << 8))
49234 -
49235 -#define AT_TAG_TO_VLAN(_tag, _vlan) \
49236 - _vlan = ((((_tag) >> 8) & 0xFF) |\
49237 - (((_tag) & 0xFF) << 8))
49238 -
49239 -#define SPEED_0 0xffff
49240 -#define HALF_DUPLEX 1
49241 -#define FULL_DUPLEX 2
49242 -
49243 -#define AT_RX_BUF_SIZE (ETH_FRAME_LEN + VLAN_HLEN + ETH_FCS_LEN)
49244 -#define MAX_JUMBO_FRAME_SIZE (9*1024)
49245 -#define MAX_TX_OFFLOAD_THRESH (9*1024)
49246 -
49247 -#define AT_MAX_RECEIVE_QUEUE 4
49248 -#define AT_DEF_RECEIVE_QUEUE 1
49249 -#define AT_MAX_TRANSMIT_QUEUE 2
49250 -
49251 -#define AT_DMA_HI_ADDR_MASK 0xffffffff00000000ULL
49252 -#define AT_DMA_LO_ADDR_MASK 0x00000000ffffffffULL
49253 -
49254 -#define AT_TX_WATCHDOG (5 * HZ)
49255 -#define AT_MAX_INT_WORK 5
49256 -#define AT_TWSI_EEPROM_TIMEOUT 100
49257 -#define AT_HW_MAX_IDLE_DELAY 10
49258 -#define AT_SUSPEND_LINK_TIMEOUT 28
49259 -
49260 -#define AT_ASPM_L0S_TIMER 6
49261 -#define AT_ASPM_L1_TIMER 12
49262 -
49263 -#define ATL1C_PCIE_L0S_L1_DISABLE 0x01
49264 -#define ATL1C_PCIE_PHY_RESET 0x02
49265 -
49266 -#define ATL1C_ASPM_L0s_ENABLE 0x0001
49267 -#define ATL1C_ASPM_L1_ENABLE 0x0002
49268 -
49269 -#define AT_REGS_LEN (75 * sizeof(u32))
49270 -#define AT_EEPROM_LEN 512
49271 -
49272 -#define ATL1C_GET_DESC(R, i, type) (&(((type *)((R)->desc))[i]))
49273 -#define ATL1C_RFD_DESC(R, i) ATL1C_GET_DESC(R, i, struct atl1c_rx_free_desc)
49274 -#define ATL1C_TPD_DESC(R, i) ATL1C_GET_DESC(R, i, struct atl1c_tpd_desc)
49275 -#define ATL1C_RRD_DESC(R, i) ATL1C_GET_DESC(R, i, struct atl1c_recv_ret_status)
49276 -
49277 -/* tpd word 1 bit 0:7 General Checksum task offload */
49278 -#define TPD_L4HDR_OFFSET_MASK 0x00FF
49279 -#define TPD_L4HDR_OFFSET_SHIFT 0
49280 -
49281 -/* tpd word 1 bit 0:7 Large Send task offload (IPv4/IPV6) */
49282 -#define TPD_TCPHDR_OFFSET_MASK 0x00FF
49283 -#define TPD_TCPHDR_OFFSET_SHIFT 0
49284 -
49285 -/* tpd word 1 bit 0:7 Custom Checksum task offload */
49286 -#define TPD_PLOADOFFSET_MASK 0x00FF
49287 -#define TPD_PLOADOFFSET_SHIFT 0
49288 -
49289 -/* tpd word 1 bit 8:17 */
49290 -#define TPD_CCSUM_EN_MASK 0x0001
49291 -#define TPD_CCSUM_EN_SHIFT 8
49292 -#define TPD_IP_CSUM_MASK 0x0001
49293 -#define TPD_IP_CSUM_SHIFT 9
49294 -#define TPD_TCP_CSUM_MASK 0x0001
49295 -#define TPD_TCP_CSUM_SHIFT 10
49296 -#define TPD_UDP_CSUM_MASK 0x0001
49297 -#define TPD_UDP_CSUM_SHIFT 11
49298 -#define TPD_LSO_EN_MASK 0x0001 /* TCP Large Send Offload */
49299 -#define TPD_LSO_EN_SHIFT 12
49300 -#define TPD_LSO_VER_MASK 0x0001
49301 -#define TPD_LSO_VER_SHIFT 13 /* 0 : ipv4; 1 : ipv4/ipv6 */
49302 -#define TPD_CON_VTAG_MASK 0x0001
49303 -#define TPD_CON_VTAG_SHIFT 14
49304 -#define TPD_INS_VTAG_MASK 0x0001
49305 -#define TPD_INS_VTAG_SHIFT 15
49306 -#define TPD_IPV4_PACKET_MASK 0x0001 /* valid when LSO VER is 1 */
49307 -#define TPD_IPV4_PACKET_SHIFT 16
49308 -#define TPD_ETH_TYPE_MASK 0x0001
49309 -#define TPD_ETH_TYPE_SHIFT 17 /* 0 : 802.3 frame; 1 : Ethernet */
49310 -
49311 -/* tpd word 18:25 Custom Checksum task offload */
49312 -#define TPD_CCSUM_OFFSET_MASK 0x00FF
49313 -#define TPD_CCSUM_OFFSET_SHIFT 18
49314 -#define TPD_CCSUM_EPAD_MASK 0x0001
49315 -#define TPD_CCSUM_EPAD_SHIFT 30
49316 -
49317 -/* tpd word 18:30 Large Send task offload (IPv4/IPV6) */
49318 -#define TPD_MSS_MASK 0x1FFF
49319 -#define TPD_MSS_SHIFT 18
49320 -
49321 -#define TPD_EOP_MASK 0x0001
49322 -#define TPD_EOP_SHIFT 31
49323 -
49324 -struct atl1c_tpd_desc {
49325 - __le16 buffer_len; /* include 4-byte CRC */
49326 - __le16 vlan_tag;
49327 - __le32 word1;
49328 - __le64 buffer_addr;
49329 -};
49330 -
49331 -struct atl1c_tpd_ext_desc {
49332 - u32 reservd_0;
49333 - __le32 word1;
49334 - __le32 pkt_len;
49335 - u32 reservd_1;
49336 -};
49337 -/* rrs word 0 bit 0:31 */
49338 -#define RRS_RX_CSUM_MASK 0xFFFF
49339 -#define RRS_RX_CSUM_SHIFT 0
49340 -#define RRS_RX_RFD_CNT_MASK 0x000F
49341 -#define RRS_RX_RFD_CNT_SHIFT 16
49342 -#define RRS_RX_RFD_INDEX_MASK 0x0FFF
49343 -#define RRS_RX_RFD_INDEX_SHIFT 20
49344 -
49345 -/* rrs flag bit 0:16 */
49346 -#define RRS_HEAD_LEN_MASK 0x00FF
49347 -#define RRS_HEAD_LEN_SHIFT 0
49348 -#define RRS_HDS_TYPE_MASK 0x0003
49349 -#define RRS_HDS_TYPE_SHIFT 8
49350 -#define RRS_CPU_NUM_MASK 0x0003
49351 -#define RRS_CPU_NUM_SHIFT 10
49352 -#define RRS_HASH_FLG_MASK 0x000F
49353 -#define RRS_HASH_FLG_SHIFT 12
49354 -
49355 -#define RRS_HDS_TYPE_HEAD 1
49356 -#define RRS_HDS_TYPE_DATA 2
49357 -
49358 -#define RRS_IS_NO_HDS_TYPE(flag) \
49359 - (((flag) >> (RRS_HDS_TYPE_SHIFT)) & RRS_HDS_TYPE_MASK == 0)
49360 -
49361 -#define RRS_IS_HDS_HEAD(flag) \
49362 - (((flag) >> (RRS_HDS_TYPE_SHIFT)) & RRS_HDS_TYPE_MASK == \
49363 - RRS_HDS_TYPE_HEAD)
49364 -
49365 -#define RRS_IS_HDS_DATA(flag) \
49366 - (((flag) >> (RRS_HDS_TYPE_SHIFT)) & RRS_HDS_TYPE_MASK == \
49367 - RRS_HDS_TYPE_DATA)
49368 -
49369 -/* rrs word 3 bit 0:31 */
49370 -#define RRS_PKT_SIZE_MASK 0x3FFF
49371 -#define RRS_PKT_SIZE_SHIFT 0
49372 -#define RRS_ERR_L4_CSUM_MASK 0x0001
49373 -#define RRS_ERR_L4_CSUM_SHIFT 14
49374 -#define RRS_ERR_IP_CSUM_MASK 0x0001
49375 -#define RRS_ERR_IP_CSUM_SHIFT 15
49376 -#define RRS_VLAN_INS_MASK 0x0001
49377 -#define RRS_VLAN_INS_SHIFT 16
49378 -#define RRS_PROT_ID_MASK 0x0007
49379 -#define RRS_PROT_ID_SHIFT 17
49380 -#define RRS_RX_ERR_SUM_MASK 0x0001
49381 -#define RRS_RX_ERR_SUM_SHIFT 20
49382 -#define RRS_RX_ERR_CRC_MASK 0x0001
49383 -#define RRS_RX_ERR_CRC_SHIFT 21
49384 -#define RRS_RX_ERR_FAE_MASK 0x0001
49385 -#define RRS_RX_ERR_FAE_SHIFT 22
49386 -#define RRS_RX_ERR_TRUNC_MASK 0x0001
49387 -#define RRS_RX_ERR_TRUNC_SHIFT 23
49388 -#define RRS_RX_ERR_RUNC_MASK 0x0001
49389 -#define RRS_RX_ERR_RUNC_SHIFT 24
49390 -#define RRS_RX_ERR_ICMP_MASK 0x0001
49391 -#define RRS_RX_ERR_ICMP_SHIFT 25
49392 -#define RRS_PACKET_BCAST_MASK 0x0001
49393 -#define RRS_PACKET_BCAST_SHIFT 26
49394 -#define RRS_PACKET_MCAST_MASK 0x0001
49395 -#define RRS_PACKET_MCAST_SHIFT 27
49396 -#define RRS_PACKET_TYPE_MASK 0x0001
49397 -#define RRS_PACKET_TYPE_SHIFT 28
49398 -#define RRS_FIFO_FULL_MASK 0x0001
49399 -#define RRS_FIFO_FULL_SHIFT 29
49400 -#define RRS_802_3_LEN_ERR_MASK 0x0001
49401 -#define RRS_802_3_LEN_ERR_SHIFT 30
49402 -#define RRS_RXD_UPDATED_MASK 0x0001
49403 -#define RRS_RXD_UPDATED_SHIFT 31
49404 -
49405 -#define RRS_ERR_L4_CSUM 0x00004000
49406 -#define RRS_ERR_IP_CSUM 0x00008000
49407 -#define RRS_VLAN_INS 0x00010000
49408 -#define RRS_RX_ERR_SUM 0x00100000
49409 -#define RRS_RX_ERR_CRC 0x00200000
49410 -#define RRS_802_3_LEN_ERR 0x40000000
49411 -#define RRS_RXD_UPDATED 0x80000000
49412 -
49413 -#define RRS_PACKET_TYPE_802_3 1
49414 -#define RRS_PACKET_TYPE_ETH 0
49415 -#define RRS_PACKET_IS_ETH(word) \
49416 - (((word) >> RRS_PACKET_TYPE_SHIFT) & RRS_PACKET_TYPE_MASK == \
49417 - RRS_PACKET_TYPE_ETH)
49418 -#define RRS_RXD_IS_VALID(word) \
49419 - ((((word) >> RRS_RXD_UPDATED_SHIFT) & RRS_RXD_UPDATED_MASK) == 1)
49420 -
49421 -#define RRS_PACKET_PROT_IS_IPV4_ONLY(word) \
49422 - ((((word) >> RRS_PROT_ID_SHIFT) & RRS_PROT_ID_MASK) == 1)
49423 -#define RRS_PACKET_PROT_IS_IPV6_ONLY(word) \
49424 - ((((word) >> RRS_PROT_ID_SHIFT) & RRS_PROT_ID_MASK) == 6)
49425 -
49426 -struct atl1c_recv_ret_status {
49427 - __le32 word0;
49428 - __le32 rss_hash;
49429 - __le16 vlan_tag;
49430 - __le16 flag;
49431 - __le32 word3;
49432 -};
49433 -
49434 -/* RFD desciptor */
49435 -struct atl1c_rx_free_desc {
49436 - __le64 buffer_addr;
49437 -};
49438 -
49439 -/* DMA Order Settings */
49440 -enum atl1c_dma_order {
49441 - atl1c_dma_ord_in = 1,
49442 - atl1c_dma_ord_enh = 2,
49443 - atl1c_dma_ord_out = 4
49444 -};
49445 -
49446 -enum atl1c_dma_rcb {
49447 - atl1c_rcb_64 = 0,
49448 - atl1c_rcb_128 = 1
49449 -};
49450 -
49451 -enum atl1c_mac_speed {
49452 - atl1c_mac_speed_0 = 0,
49453 - atl1c_mac_speed_10_100 = 1,
49454 - atl1c_mac_speed_1000 = 2
49455 -};
49456 -
49457 -enum atl1c_dma_req_block {
49458 - atl1c_dma_req_128 = 0,
49459 - atl1c_dma_req_256 = 1,
49460 - atl1c_dma_req_512 = 2,
49461 - atl1c_dma_req_1024 = 3,
49462 - atl1c_dma_req_2048 = 4,
49463 - atl1c_dma_req_4096 = 5
49464 -};
49465 -
49466 -enum atl1c_rss_mode {
49467 - atl1c_rss_mode_disable = 0,
49468 - atl1c_rss_sig_que = 1,
49469 - atl1c_rss_mul_que_sig_int = 2,
49470 - atl1c_rss_mul_que_mul_int = 4,
49471 -};
49472 -
49473 -enum atl1c_rss_type {
49474 - atl1c_rss_disable = 0,
49475 - atl1c_rss_ipv4 = 1,
49476 - atl1c_rss_ipv4_tcp = 2,
49477 - atl1c_rss_ipv6 = 4,
49478 - atl1c_rss_ipv6_tcp = 8
49479 -};
49480 -
49481 -enum atl1c_nic_type {
49482 - athr_l1c = 0,
49483 - athr_l2c = 1,
49484 -};
49485 -
49486 -enum atl1c_trans_queue {
49487 - atl1c_trans_normal = 0,
49488 - atl1c_trans_high = 1
49489 -};
49490 -
49491 -struct atl1c_hw_stats {
49492 - /* rx */
49493 - unsigned long rx_ok; /* The number of good packet received. */
49494 - unsigned long rx_bcast; /* The number of good broadcast packet received. */
49495 - unsigned long rx_mcast; /* The number of good multicast packet received. */
49496 - unsigned long rx_pause; /* The number of Pause packet received. */
49497 - unsigned long rx_ctrl; /* The number of Control packet received other than Pause frame. */
49498 - unsigned long rx_fcs_err; /* The number of packets with bad FCS. */
49499 - unsigned long rx_len_err; /* The number of packets with mismatch of length field and actual size. */
49500 - unsigned long rx_byte_cnt; /* The number of bytes of good packet received. FCS is NOT included. */
49501 - unsigned long rx_runt; /* The number of packets received that are less than 64 byte long and with good FCS. */
49502 - unsigned long rx_frag; /* The number of packets received that are less than 64 byte long and with bad FCS. */
49503 - unsigned long rx_sz_64; /* The number of good and bad packets received that are 64 byte long. */
49504 - unsigned long rx_sz_65_127; /* The number of good and bad packets received that are between 65 and 127-byte long. */
49505 - unsigned long rx_sz_128_255; /* The number of good and bad packets received that are between 128 and 255-byte long. */
49506 - unsigned long rx_sz_256_511; /* The number of good and bad packets received that are between 256 and 511-byte long. */
49507 - unsigned long rx_sz_512_1023; /* The number of good and bad packets received that are between 512 and 1023-byte long. */
49508 - unsigned long rx_sz_1024_1518; /* The number of good and bad packets received that are between 1024 and 1518-byte long. */
49509 - unsigned long rx_sz_1519_max; /* The number of good and bad packets received that are between 1519-byte and MTU. */
49510 - unsigned long rx_sz_ov; /* The number of good and bad packets received that are more than MTU size truncated by Selene. */
49511 - unsigned long rx_rxf_ov; /* The number of frame dropped due to occurrence of RX FIFO overflow. */
49512 - unsigned long rx_rrd_ov; /* The number of frame dropped due to occurrence of RRD overflow. */
49513 - unsigned long rx_align_err; /* Alignment Error */
49514 - unsigned long rx_bcast_byte_cnt; /* The byte count of broadcast packet received, excluding FCS. */
49515 - unsigned long rx_mcast_byte_cnt; /* The byte count of multicast packet received, excluding FCS. */
49516 - unsigned long rx_err_addr; /* The number of packets dropped due to address filtering. */
49517 -
49518 - /* tx */
49519 - unsigned long tx_ok; /* The number of good packet transmitted. */
49520 - unsigned long tx_bcast; /* The number of good broadcast packet transmitted. */
49521 - unsigned long tx_mcast; /* The number of good multicast packet transmitted. */
49522 - unsigned long tx_pause; /* The number of Pause packet transmitted. */
49523 - unsigned long tx_exc_defer; /* The number of packets transmitted with excessive deferral. */
49524 - unsigned long tx_ctrl; /* The number of packets transmitted is a control frame, excluding Pause frame. */
49525 - unsigned long tx_defer; /* The number of packets transmitted that is deferred. */
49526 - unsigned long tx_byte_cnt; /* The number of bytes of data transmitted. FCS is NOT included. */
49527 - unsigned long tx_sz_64; /* The number of good and bad packets transmitted that are 64 byte long. */
49528 - unsigned long tx_sz_65_127; /* The number of good and bad packets transmitted that are between 65 and 127-byte long. */
49529 - unsigned long tx_sz_128_255; /* The number of good and bad packets transmitted that are between 128 and 255-byte long. */
49530 - unsigned long tx_sz_256_511; /* The number of good and bad packets transmitted that are between 256 and 511-byte long. */
49531 - unsigned long tx_sz_512_1023; /* The number of good and bad packets transmitted that are between 512 and 1023-byte long. */
49532 - unsigned long tx_sz_1024_1518; /* The number of good and bad packets transmitted that are between 1024 and 1518-byte long. */
49533 - unsigned long tx_sz_1519_max; /* The number of good and bad packets transmitted that are between 1519-byte and MTU. */
49534 - unsigned long tx_1_col; /* The number of packets subsequently transmitted successfully with a single prior collision. */
49535 - unsigned long tx_2_col; /* The number of packets subsequently transmitted successfully with multiple prior collisions. */
49536 - unsigned long tx_late_col; /* The number of packets transmitted with late collisions. */
49537 - unsigned long tx_abort_col; /* The number of transmit packets aborted due to excessive collisions. */
49538 - unsigned long tx_underrun; /* The number of transmit packets aborted due to transmit FIFO underrun, or TRD FIFO underrun */
49539 - unsigned long tx_rd_eop; /* The number of times that read beyond the EOP into the next frame area when TRD was not written timely */
49540 - unsigned long tx_len_err; /* The number of transmit packets with length field does NOT match the actual frame size. */
49541 - unsigned long tx_trunc; /* The number of transmit packets truncated due to size exceeding MTU. */
49542 - unsigned long tx_bcast_byte; /* The byte count of broadcast packet transmitted, excluding FCS. */
49543 - unsigned long tx_mcast_byte; /* The byte count of multicast packet transmitted, excluding FCS. */
49544 -};
49545 -
49546 -struct atl1c_hw {
49547 - u8 __iomem *hw_addr; /* inner register address */
49548 - struct atl1c_adapter *adapter;
49549 - enum atl1c_nic_type nic_type;
49550 - enum atl1c_dma_order dma_order;
49551 - enum atl1c_dma_rcb rcb_value;
49552 - enum atl1c_dma_req_block dmar_block;
49553 - enum atl1c_dma_req_block dmaw_block;
49554 -
49555 - u16 device_id;
49556 - u16 vendor_id;
49557 - u16 subsystem_id;
49558 - u16 subsystem_vendor_id;
49559 - u8 revision_id;
49560 -
49561 - u32 intr_mask;
49562 - u8 dmaw_dly_cnt;
49563 - u8 dmar_dly_cnt;
49564 -
49565 - u8 preamble_len;
49566 - u16 max_frame_size;
49567 - u16 min_frame_size;
49568 -
49569 - enum atl1c_mac_speed mac_speed;
49570 - bool mac_duplex;
49571 - bool hibernate;
49572 - u16 media_type;
49573 -#define MEDIA_TYPE_AUTO_SENSOR 0
49574 -#define MEDIA_TYPE_100M_FULL 1
49575 -#define MEDIA_TYPE_100M_HALF 2
49576 -#define MEDIA_TYPE_10M_FULL 3
49577 -#define MEDIA_TYPE_10M_HALF 4
49578 -
49579 - u16 autoneg_advertised;
49580 - u16 mii_autoneg_adv_reg;
49581 - u16 mii_1000t_ctrl_reg;
49582 -
49583 - u16 tx_imt; /* TX Interrupt Moderator timer ( 2us resolution) */
49584 - u16 rx_imt; /* RX Interrupt Moderator timer ( 2us resolution) */
49585 - u16 ict; /* Interrupt Clear timer (2us resolution) */
49586 - u16 ctrl_flags;
49587 -#define ATL1C_INTR_CLEAR_ON_READ 0x0001
49588 -#define ATL1C_INTR_MODRT_ENABLE 0x0002
49589 -#define ATL1C_CMB_ENABLE 0x0004
49590 -#define ATL1C_SMB_ENABLE 0x0010
49591 -#define ATL1C_TXQ_MODE_ENHANCE 0x0020
49592 -#define ATL1C_RX_IPV6_CHKSUM 0x0040
49593 -#define ATL1C_ASPM_L0S_SUPPORT 0x0080
49594 -#define ATL1C_ASPM_L1_SUPPORT 0x0100
49595 -#define ATL1C_ASPM_CTRL_MON 0x0200
49596 -#define ATL1C_HIB_DISABLE 0x0400
49597 -#define ATL1C_LINK_CAP_1000M 0x0800
49598 -#define ATL1C_FPGA_VERSION 0x8000
49599 - u16 cmb_tpd;
49600 - u16 cmb_rrd;
49601 - u16 cmb_rx_timer; /* 2us resolution */
49602 - u16 cmb_tx_timer;
49603 - u32 smb_timer;
49604 -
49605 - u16 rrd_thresh; /* Threshold of number of RRD produced to trigger
49606 - interrupt request */
49607 - u16 tpd_thresh;
49608 - u8 tpd_burst; /* Number of TPD to prefetch in cache-aligned burst. */
49609 - u8 rfd_burst;
49610 - enum atl1c_rss_type rss_type;
49611 - enum atl1c_rss_mode rss_mode;
49612 - u8 rss_hash_bits;
49613 - u32 base_cpu;
49614 - u32 indirect_tab;
49615 - u8 mac_addr[ETH_ALEN];
49616 - u8 perm_mac_addr[ETH_ALEN];
49617 -
49618 - bool phy_configured;
49619 - bool re_autoneg;
49620 - bool emi_ca;
49621 -};
49622 -
49623 -/*
49624 - * atl1c_ring_header represents a single, contiguous block of DMA space
49625 - * mapped for the three descriptor rings (tpd, rfd, rrd) and the two
49626 - * message blocks (cmb, smb) described below
49627 - */
49628 -struct atl1c_ring_header {
49629 - void *desc; /* virtual address */
49630 - dma_addr_t dma; /* physical address*/
49631 - unsigned int size; /* length in bytes */
49632 -};
49633 -
49634 -/*
49635 - * atl1c_buffer is wrapper around a pointer to a socket buffer
49636 - * so a DMA handle can be stored along with the skb
49637 - */
49638 -struct atl1c_buffer {
49639 - struct sk_buff *skb; /* socket buffer */
49640 - u16 length; /* rx buffer length */
49641 - u16 state; /* state of buffer */
49642 -#define ATL1_BUFFER_FREE 0
49643 -#define ATL1_BUFFER_BUSY 1
49644 - dma_addr_t dma;
49645 -};
49646 -
49647 -/* transimit packet descriptor (tpd) ring */
49648 -struct atl1c_tpd_ring {
49649 - void *desc; /* descriptor ring virtual address */
49650 - dma_addr_t dma; /* descriptor ring physical address */
49651 - u16 size; /* descriptor ring length in bytes */
49652 - u16 count; /* number of descriptors in the ring */
49653 - u16 next_to_use; /* this is protectd by adapter->tx_lock */
49654 - atomic_t next_to_clean;
49655 - struct atl1c_buffer *buffer_info;
49656 -};
49657 -
49658 -/* receive free descriptor (rfd) ring */
49659 -struct atl1c_rfd_ring {
49660 - void *desc; /* descriptor ring virtual address */
49661 - dma_addr_t dma; /* descriptor ring physical address */
49662 - u16 size; /* descriptor ring length in bytes */
49663 - u16 count; /* number of descriptors in the ring */
49664 - u16 next_to_use;
49665 - u16 next_to_clean;
49666 - struct atl1c_buffer *buffer_info;
49667 -};
49668 -
49669 -/* receive return desciptor (rrd) ring */
49670 -struct atl1c_rrd_ring {
49671 - void *desc; /* descriptor ring virtual address */
49672 - dma_addr_t dma; /* descriptor ring physical address */
49673 - u16 size; /* descriptor ring length in bytes */
49674 - u16 count; /* number of descriptors in the ring */
49675 - u16 next_to_use;
49676 - u16 next_to_clean;
49677 -};
49678 -
49679 -struct atl1c_cmb {
49680 - void *cmb;
49681 - dma_addr_t dma;
49682 -};
49683 -
49684 -struct atl1c_smb {
49685 - void *smb;
49686 - dma_addr_t dma;
49687 -};
49688 -
49689 -/* board specific private data structure */
49690 -struct atl1c_adapter {
49691 - struct net_device *netdev;
49692 - struct pci_dev *pdev;
49693 - struct vlan_group *vlgrp;
49694 - struct napi_struct napi;
49695 - struct atl1c_hw hw;
49696 - struct atl1c_hw_stats hw_stats;
49697 - struct net_device_stats net_stats;
49698 - struct mii_if_info mii; /* MII interface info */
49699 - u16 rx_buffer_len;
49700 -
49701 - unsigned long flags;
49702 -#define __AT_TESTING 0x0001
49703 -#define __AT_RESETTING 0x0002
49704 -#define __AT_DOWN 0x0003
49705 - u32 msg_enable;
49706 -
49707 - bool have_msi;
49708 - u32 wol;
49709 - u16 link_speed;
49710 - u16 link_duplex;
49711 -
49712 - spinlock_t mdio_lock;
49713 - spinlock_t tx_lock;
49714 - atomic_t irq_sem;
49715 -
49716 - struct work_struct reset_task;
49717 - struct work_struct link_chg_task;
49718 - struct timer_list watchdog_timer;
49719 - struct timer_list phy_config_timer;
49720 -
49721 - /* All Descriptor memory */
49722 - struct atl1c_ring_header ring_header;
49723 - struct atl1c_tpd_ring tpd_ring[AT_MAX_TRANSMIT_QUEUE];
49724 - struct atl1c_rfd_ring rfd_ring[AT_MAX_RECEIVE_QUEUE];
49725 - struct atl1c_rrd_ring rrd_ring[AT_MAX_RECEIVE_QUEUE];
49726 - struct atl1c_cmb cmb;
49727 - struct atl1c_smb smb;
49728 - int num_rx_queues;
49729 - u32 bd_number; /* board number;*/
49730 -};
49731 -
49732 -#define AT_WRITE_REG(a, reg, value) ( \
49733 - writel((value), ((a)->hw_addr + reg)))
49734 -
49735 -#define AT_WRITE_FLUSH(a) (\
49736 - readl((a)->hw_addr))
49737 -
49738 -#define AT_READ_REG(a, reg, pdata) do { \
49739 - if (unlikely((a)->hibernate)) { \
49740 - readl((a)->hw_addr + reg); \
49741 - *(u32 *)pdata = readl((a)->hw_addr + reg); \
49742 - } else { \
49743 - *(u32 *)pdata = readl((a)->hw_addr + reg); \
49744 - } \
49745 - } while (0)
49746 -
49747 -#define AT_WRITE_REGB(a, reg, value) (\
49748 - writeb((value), ((a)->hw_addr + reg)))
49749 -
49750 -#define AT_READ_REGB(a, reg) (\
49751 - readb((a)->hw_addr + reg))
49752 -
49753 -#define AT_WRITE_REGW(a, reg, value) (\
49754 - writew((value), ((a)->hw_addr + reg)))
49755 -
49756 -#define AT_READ_REGW(a, reg) (\
49757 - readw((a)->hw_addr + reg))
49758 -
49759 -#define AT_WRITE_REG_ARRAY(a, reg, offset, value) ( \
49760 - writel((value), (((a)->hw_addr + reg) + ((offset) << 2))))
49761 -
49762 -#define AT_READ_REG_ARRAY(a, reg, offset) ( \
49763 - readl(((a)->hw_addr + reg) + ((offset) << 2)))
49764 -
49765 -extern char atl1c_driver_name[];
49766 -extern char atl1c_driver_version[];
49767 -
49768 -extern int atl1c_up(struct atl1c_adapter *adapter);
49769 -extern void atl1c_down(struct atl1c_adapter *adapter);
49770 -extern void atl1c_reinit_locked(struct atl1c_adapter *adapter);
49771 -extern s32 atl1c_reset_hw(struct atl1c_hw *hw);
49772 -extern void atl1c_set_ethtool_ops(struct net_device *netdev);
49773 -#endif /* _ATL1C_H_ */
49774 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/atl1c/atl1c_hw.c linux-2.6.29-rc3.owrt/drivers/net/atl1c/atl1c_hw.c
49775 --- linux-2.6.29.owrt/drivers/net/atl1c/atl1c_hw.c 2009-05-10 22:04:38.000000000 +0200
49776 +++ linux-2.6.29-rc3.owrt/drivers/net/atl1c/atl1c_hw.c 1970-01-01 01:00:00.000000000 +0100
49777 @@ -1,527 +0,0 @@
49778 -/*
49779 - * Copyright(c) 2007 Atheros Corporation. All rights reserved.
49780 - *
49781 - * Derived from Intel e1000 driver
49782 - * Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved.
49783 - *
49784 - * This program is free software; you can redistribute it and/or modify it
49785 - * under the terms of the GNU General Public License as published by the Free
49786 - * Software Foundation; either version 2 of the License, or (at your option)
49787 - * any later version.
49788 - *
49789 - * This program is distributed in the hope that it will be useful, but WITHOUT
49790 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
49791 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
49792 - * more details.
49793 - *
49794 - * You should have received a copy of the GNU General Public License along with
49795 - * this program; if not, write to the Free Software Foundation, Inc., 59
49796 - * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
49797 - */
49798 -#include <linux/pci.h>
49799 -#include <linux/delay.h>
49800 -#include <linux/mii.h>
49801 -#include <linux/crc32.h>
49802 -
49803 -#include "atl1c.h"
49804 -
49805 -/*
49806 - * check_eeprom_exist
49807 - * return 1 if eeprom exist
49808 - */
49809 -int atl1c_check_eeprom_exist(struct atl1c_hw *hw)
49810 -{
49811 - u32 data;
49812 -
49813 - AT_READ_REG(hw, REG_TWSI_DEBUG, &data);
49814 - if (data & TWSI_DEBUG_DEV_EXIST)
49815 - return 1;
49816 -
49817 - return 0;
49818 -}
49819 -
49820 -void atl1c_hw_set_mac_addr(struct atl1c_hw *hw)
49821 -{
49822 - u32 value;
49823 - /*
49824 - * 00-0B-6A-F6-00-DC
49825 - * 0: 6AF600DC 1: 000B
49826 - * low dword
49827 - */
49828 - value = (((u32)hw->mac_addr[2]) << 24) |
49829 - (((u32)hw->mac_addr[3]) << 16) |
49830 - (((u32)hw->mac_addr[4]) << 8) |
49831 - (((u32)hw->mac_addr[5])) ;
49832 - AT_WRITE_REG_ARRAY(hw, REG_MAC_STA_ADDR, 0, value);
49833 - /* hight dword */
49834 - value = (((u32)hw->mac_addr[0]) << 8) |
49835 - (((u32)hw->mac_addr[1])) ;
49836 - AT_WRITE_REG_ARRAY(hw, REG_MAC_STA_ADDR, 1, value);
49837 -}
49838 -
49839 -/*
49840 - * atl1c_get_permanent_address
49841 - * return 0 if get valid mac address,
49842 - */
49843 -static int atl1c_get_permanent_address(struct atl1c_hw *hw)
49844 -{
49845 - u32 addr[2];
49846 - u32 i;
49847 - u32 otp_ctrl_data;
49848 - u32 twsi_ctrl_data;
49849 - u8 eth_addr[ETH_ALEN];
49850 -
49851 - /* init */
49852 - addr[0] = addr[1] = 0;
49853 - AT_READ_REG(hw, REG_OTP_CTRL, &otp_ctrl_data);
49854 - if (atl1c_check_eeprom_exist(hw)) {
49855 - /* Enable OTP CLK */
49856 - if (!(otp_ctrl_data & OTP_CTRL_CLK_EN)) {
49857 - otp_ctrl_data |= OTP_CTRL_CLK_EN;
49858 - AT_WRITE_REG(hw, REG_OTP_CTRL, otp_ctrl_data);
49859 - AT_WRITE_FLUSH(hw);
49860 - msleep(1);
49861 - }
49862 -
49863 - AT_READ_REG(hw, REG_TWSI_CTRL, &twsi_ctrl_data);
49864 - twsi_ctrl_data |= TWSI_CTRL_SW_LDSTART;
49865 - AT_WRITE_REG(hw, REG_TWSI_CTRL, twsi_ctrl_data);
49866 - for (i = 0; i < AT_TWSI_EEPROM_TIMEOUT; i++) {
49867 - msleep(10);
49868 - AT_READ_REG(hw, REG_TWSI_CTRL, &twsi_ctrl_data);
49869 - if ((twsi_ctrl_data & TWSI_CTRL_SW_LDSTART) == 0)
49870 - break;
49871 - }
49872 - if (i >= AT_TWSI_EEPROM_TIMEOUT)
49873 - return -1;
49874 - }
49875 - /* Disable OTP_CLK */
49876 - if (otp_ctrl_data & OTP_CTRL_CLK_EN) {
49877 - otp_ctrl_data &= ~OTP_CTRL_CLK_EN;
49878 - AT_WRITE_REG(hw, REG_OTP_CTRL, otp_ctrl_data);
49879 - AT_WRITE_FLUSH(hw);
49880 - msleep(1);
49881 - }
49882 -
49883 - /* maybe MAC-address is from BIOS */
49884 - AT_READ_REG(hw, REG_MAC_STA_ADDR, &addr[0]);
49885 - AT_READ_REG(hw, REG_MAC_STA_ADDR + 4, &addr[1]);
49886 - *(u32 *) &eth_addr[2] = swab32(addr[0]);
49887 - *(u16 *) &eth_addr[0] = swab16(*(u16 *)&addr[1]);
49888 -
49889 - if (is_valid_ether_addr(eth_addr)) {
49890 - memcpy(hw->perm_mac_addr, eth_addr, ETH_ALEN);
49891 - return 0;
49892 - }
49893 -
49894 - return -1;
49895 -}
49896 -
49897 -bool atl1c_read_eeprom(struct atl1c_hw *hw, u32 offset, u32 *p_value)
49898 -{
49899 - int i;
49900 - int ret = false;
49901 - u32 otp_ctrl_data;
49902 - u32 control;
49903 - u32 data;
49904 -
49905 - if (offset & 3)
49906 - return ret; /* address do not align */
49907 -
49908 - AT_READ_REG(hw, REG_OTP_CTRL, &otp_ctrl_data);
49909 - if (!(otp_ctrl_data & OTP_CTRL_CLK_EN))
49910 - AT_WRITE_REG(hw, REG_OTP_CTRL,
49911 - (otp_ctrl_data | OTP_CTRL_CLK_EN));
49912 -
49913 - AT_WRITE_REG(hw, REG_EEPROM_DATA_LO, 0);
49914 - control = (offset & EEPROM_CTRL_ADDR_MASK) << EEPROM_CTRL_ADDR_SHIFT;
49915 - AT_WRITE_REG(hw, REG_EEPROM_CTRL, control);
49916 -
49917 - for (i = 0; i < 10; i++) {
49918 - udelay(100);
49919 - AT_READ_REG(hw, REG_EEPROM_CTRL, &control);
49920 - if (control & EEPROM_CTRL_RW)
49921 - break;
49922 - }
49923 - if (control & EEPROM_CTRL_RW) {
49924 - AT_READ_REG(hw, REG_EEPROM_CTRL, &data);
49925 - AT_READ_REG(hw, REG_EEPROM_DATA_LO, p_value);
49926 - data = data & 0xFFFF;
49927 - *p_value = swab32((data << 16) | (*p_value >> 16));
49928 - ret = true;
49929 - }
49930 - if (!(otp_ctrl_data & OTP_CTRL_CLK_EN))
49931 - AT_WRITE_REG(hw, REG_OTP_CTRL, otp_ctrl_data);
49932 -
49933 - return ret;
49934 -}
49935 -/*
49936 - * Reads the adapter's MAC address from the EEPROM
49937 - *
49938 - * hw - Struct containing variables accessed by shared code
49939 - */
49940 -int atl1c_read_mac_addr(struct atl1c_hw *hw)
49941 -{
49942 - int err = 0;
49943 -
49944 - err = atl1c_get_permanent_address(hw);
49945 - if (err)
49946 - random_ether_addr(hw->perm_mac_addr);
49947 -
49948 - memcpy(hw->mac_addr, hw->perm_mac_addr, sizeof(hw->perm_mac_addr));
49949 - return 0;
49950 -}
49951 -
49952 -/*
49953 - * atl1c_hash_mc_addr
49954 - * purpose
49955 - * set hash value for a multicast address
49956 - * hash calcu processing :
49957 - * 1. calcu 32bit CRC for multicast address
49958 - * 2. reverse crc with MSB to LSB
49959 - */
49960 -u32 atl1c_hash_mc_addr(struct atl1c_hw *hw, u8 *mc_addr)
49961 -{
49962 - u32 crc32;
49963 - u32 value = 0;
49964 - int i;
49965 -
49966 - crc32 = ether_crc_le(6, mc_addr);
49967 - for (i = 0; i < 32; i++)
49968 - value |= (((crc32 >> i) & 1) << (31 - i));
49969 -
49970 - return value;
49971 -}
49972 -
49973 -/*
49974 - * Sets the bit in the multicast table corresponding to the hash value.
49975 - * hw - Struct containing variables accessed by shared code
49976 - * hash_value - Multicast address hash value
49977 - */
49978 -void atl1c_hash_set(struct atl1c_hw *hw, u32 hash_value)
49979 -{
49980 - u32 hash_bit, hash_reg;
49981 - u32 mta;
49982 -
49983 - /*
49984 - * The HASH Table is a register array of 2 32-bit registers.
49985 - * It is treated like an array of 64 bits. We want to set
49986 - * bit BitArray[hash_value]. So we figure out what register
49987 - * the bit is in, read it, OR in the new bit, then write
49988 - * back the new value. The register is determined by the
49989 - * upper bit of the hash value and the bit within that
49990 - * register are determined by the lower 5 bits of the value.
49991 - */
49992 - hash_reg = (hash_value >> 31) & 0x1;
49993 - hash_bit = (hash_value >> 26) & 0x1F;
49994 -
49995 - mta = AT_READ_REG_ARRAY(hw, REG_RX_HASH_TABLE, hash_reg);
49996 -
49997 - mta |= (1 << hash_bit);
49998 -
49999 - AT_WRITE_REG_ARRAY(hw, REG_RX_HASH_TABLE, hash_reg, mta);
50000 -}
50001 -
50002 -/*
50003 - * Reads the value from a PHY register
50004 - * hw - Struct containing variables accessed by shared code
50005 - * reg_addr - address of the PHY register to read
50006 - */
50007 -int atl1c_read_phy_reg(struct atl1c_hw *hw, u16 reg_addr, u16 *phy_data)
50008 -{
50009 - u32 val;
50010 - int i;
50011 -
50012 - val = ((u32)(reg_addr & MDIO_REG_ADDR_MASK)) << MDIO_REG_ADDR_SHIFT |
50013 - MDIO_START | MDIO_SUP_PREAMBLE | MDIO_RW |
50014 - MDIO_CLK_25_4 << MDIO_CLK_SEL_SHIFT;
50015 -
50016 - AT_WRITE_REG(hw, REG_MDIO_CTRL, val);
50017 -
50018 - for (i = 0; i < MDIO_WAIT_TIMES; i++) {
50019 - udelay(2);
50020 - AT_READ_REG(hw, REG_MDIO_CTRL, &val);
50021 - if (!(val & (MDIO_START | MDIO_BUSY)))
50022 - break;
50023 - }
50024 - if (!(val & (MDIO_START | MDIO_BUSY))) {
50025 - *phy_data = (u16)val;
50026 - return 0;
50027 - }
50028 -
50029 - return -1;
50030 -}
50031 -
50032 -/*
50033 - * Writes a value to a PHY register
50034 - * hw - Struct containing variables accessed by shared code
50035 - * reg_addr - address of the PHY register to write
50036 - * data - data to write to the PHY
50037 - */
50038 -int atl1c_write_phy_reg(struct atl1c_hw *hw, u32 reg_addr, u16 phy_data)
50039 -{
50040 - int i;
50041 - u32 val;
50042 -
50043 - val = ((u32)(phy_data & MDIO_DATA_MASK)) << MDIO_DATA_SHIFT |
50044 - (reg_addr & MDIO_REG_ADDR_MASK) << MDIO_REG_ADDR_SHIFT |
50045 - MDIO_SUP_PREAMBLE | MDIO_START |
50046 - MDIO_CLK_25_4 << MDIO_CLK_SEL_SHIFT;
50047 -
50048 - AT_WRITE_REG(hw, REG_MDIO_CTRL, val);
50049 -
50050 - for (i = 0; i < MDIO_WAIT_TIMES; i++) {
50051 - udelay(2);
50052 - AT_READ_REG(hw, REG_MDIO_CTRL, &val);
50053 - if (!(val & (MDIO_START | MDIO_BUSY)))
50054 - break;
50055 - }
50056 -
50057 - if (!(val & (MDIO_START | MDIO_BUSY)))
50058 - return 0;
50059 -
50060 - return -1;
50061 -}
50062 -
50063 -/*
50064 - * Configures PHY autoneg and flow control advertisement settings
50065 - *
50066 - * hw - Struct containing variables accessed by shared code
50067 - */
50068 -static int atl1c_phy_setup_adv(struct atl1c_hw *hw)
50069 -{
50070 - u16 mii_adv_data = ADVERTISE_DEFAULT_CAP & ~ADVERTISE_SPEED_MASK;
50071 - u16 mii_giga_ctrl_data = GIGA_CR_1000T_DEFAULT_CAP &
50072 - ~GIGA_CR_1000T_SPEED_MASK;
50073 -
50074 - if (hw->autoneg_advertised & ADVERTISED_10baseT_Half)
50075 - mii_adv_data |= ADVERTISE_10HALF;
50076 - if (hw->autoneg_advertised & ADVERTISED_10baseT_Full)
50077 - mii_adv_data |= ADVERTISE_10FULL;
50078 - if (hw->autoneg_advertised & ADVERTISED_100baseT_Half)
50079 - mii_adv_data |= ADVERTISE_100HALF;
50080 - if (hw->autoneg_advertised & ADVERTISED_100baseT_Full)
50081 - mii_adv_data |= ADVERTISE_100FULL;
50082 -
50083 - if (hw->autoneg_advertised & ADVERTISED_Autoneg)
50084 - mii_adv_data |= ADVERTISE_10HALF | ADVERTISE_10FULL |
50085 - ADVERTISE_100HALF | ADVERTISE_100FULL;
50086 -
50087 - if (hw->ctrl_flags & ATL1C_LINK_CAP_1000M) {
50088 - if (hw->autoneg_advertised & ADVERTISED_1000baseT_Half)
50089 - mii_giga_ctrl_data |= ADVERTISE_1000HALF;
50090 - if (hw->autoneg_advertised & ADVERTISED_1000baseT_Full)
50091 - mii_giga_ctrl_data |= ADVERTISE_1000FULL;
50092 - if (hw->autoneg_advertised & ADVERTISED_Autoneg)
50093 - mii_giga_ctrl_data |= ADVERTISE_1000HALF |
50094 - ADVERTISE_1000FULL;
50095 - }
50096 -
50097 - if (atl1c_write_phy_reg(hw, MII_ADVERTISE, mii_adv_data) != 0 ||
50098 - atl1c_write_phy_reg(hw, MII_GIGA_CR, mii_giga_ctrl_data) != 0)
50099 - return -1;
50100 - return 0;
50101 -}
50102 -
50103 -void atl1c_phy_disable(struct atl1c_hw *hw)
50104 -{
50105 - AT_WRITE_REGW(hw, REG_GPHY_CTRL,
50106 - GPHY_CTRL_PW_WOL_DIS | GPHY_CTRL_EXT_RESET);
50107 -}
50108 -
50109 -static void atl1c_phy_magic_data(struct atl1c_hw *hw)
50110 -{
50111 - u16 data;
50112 -
50113 - data = ANA_LOOP_SEL_10BT | ANA_EN_MASK_TB | ANA_EN_10BT_IDLE |
50114 - ((1 & ANA_INTERVAL_SEL_TIMER_MASK) <<
50115 - ANA_INTERVAL_SEL_TIMER_SHIFT);
50116 -
50117 - atl1c_write_phy_reg(hw, MII_DBG_ADDR, MII_ANA_CTRL_18);
50118 - atl1c_write_phy_reg(hw, MII_DBG_DATA, data);
50119 -
50120 - data = (2 & ANA_SERDES_CDR_BW_MASK) | ANA_MS_PAD_DBG |
50121 - ANA_SERDES_EN_DEEM | ANA_SERDES_SEL_HSP | ANA_SERDES_EN_PLL |
50122 - ANA_SERDES_EN_LCKDT;
50123 -
50124 - atl1c_write_phy_reg(hw, MII_DBG_ADDR, MII_ANA_CTRL_5);
50125 - atl1c_write_phy_reg(hw, MII_DBG_DATA, data);
50126 -
50127 - data = (44 & ANA_LONG_CABLE_TH_100_MASK) |
50128 - ((33 & ANA_SHORT_CABLE_TH_100_MASK) <<
50129 - ANA_SHORT_CABLE_TH_100_SHIFT) | ANA_BP_BAD_LINK_ACCUM |
50130 - ANA_BP_SMALL_BW;
50131 -
50132 - atl1c_write_phy_reg(hw, MII_DBG_ADDR, MII_ANA_CTRL_54);
50133 - atl1c_write_phy_reg(hw, MII_DBG_DATA, data);
50134 -
50135 - data = (11 & ANA_IECHO_ADJ_MASK) | ((11 & ANA_IECHO_ADJ_MASK) <<
50136 - ANA_IECHO_ADJ_2_SHIFT) | ((8 & ANA_IECHO_ADJ_MASK) <<
50137 - ANA_IECHO_ADJ_1_SHIFT) | ((8 & ANA_IECHO_ADJ_MASK) <<
50138 - ANA_IECHO_ADJ_0_SHIFT);
50139 -
50140 - atl1c_write_phy_reg(hw, MII_DBG_ADDR, MII_ANA_CTRL_4);
50141 - atl1c_write_phy_reg(hw, MII_DBG_DATA, data);
50142 -
50143 - data = ANA_RESTART_CAL | ((7 & ANA_MANUL_SWICH_ON_MASK) <<
50144 - ANA_MANUL_SWICH_ON_SHIFT) | ANA_MAN_ENABLE |
50145 - ANA_SEL_HSP | ANA_EN_HB | ANA_OEN_125M;
50146 -
50147 - atl1c_write_phy_reg(hw, MII_DBG_ADDR, MII_ANA_CTRL_0);
50148 - atl1c_write_phy_reg(hw, MII_DBG_DATA, data);
50149 -
50150 - if (hw->ctrl_flags & ATL1C_HIB_DISABLE) {
50151 - atl1c_write_phy_reg(hw, MII_DBG_ADDR, MII_ANA_CTRL_41);
50152 - if (atl1c_read_phy_reg(hw, MII_DBG_DATA, &data) != 0)
50153 - return;
50154 - data &= ~ANA_TOP_PS_EN;
50155 - atl1c_write_phy_reg(hw, MII_DBG_DATA, data);
50156 -
50157 - atl1c_write_phy_reg(hw, MII_DBG_ADDR, MII_ANA_CTRL_11);
50158 - if (atl1c_read_phy_reg(hw, MII_DBG_DATA, &data) != 0)
50159 - return;
50160 - data &= ~ANA_PS_HIB_EN;
50161 - atl1c_write_phy_reg(hw, MII_DBG_DATA, data);
50162 - }
50163 -}
50164 -
50165 -int atl1c_phy_reset(struct atl1c_hw *hw)
50166 -{
50167 - struct atl1c_adapter *adapter = hw->adapter;
50168 - struct pci_dev *pdev = adapter->pdev;
50169 - u32 phy_ctrl_data = GPHY_CTRL_DEFAULT;
50170 - u32 mii_ier_data = IER_LINK_UP | IER_LINK_DOWN;
50171 - int err;
50172 -
50173 - if (hw->ctrl_flags & ATL1C_HIB_DISABLE)
50174 - phy_ctrl_data &= ~GPHY_CTRL_HIB_EN;
50175 -
50176 - AT_WRITE_REG(hw, REG_GPHY_CTRL, phy_ctrl_data);
50177 - AT_WRITE_FLUSH(hw);
50178 - msleep(40);
50179 - phy_ctrl_data |= GPHY_CTRL_EXT_RESET;
50180 - AT_WRITE_REG(hw, REG_GPHY_CTRL, phy_ctrl_data);
50181 - AT_WRITE_FLUSH(hw);
50182 - msleep(10);
50183 -
50184 - /*Enable PHY LinkChange Interrupt */
50185 - err = atl1c_write_phy_reg(hw, MII_IER, mii_ier_data);
50186 - if (err) {
50187 - if (netif_msg_hw(adapter))
50188 - dev_err(&pdev->dev,
50189 - "Error enable PHY linkChange Interrupt\n");
50190 - return err;
50191 - }
50192 - if (!(hw->ctrl_flags & ATL1C_FPGA_VERSION))
50193 - atl1c_phy_magic_data(hw);
50194 - return 0;
50195 -}
50196 -
50197 -int atl1c_phy_init(struct atl1c_hw *hw)
50198 -{
50199 - struct atl1c_adapter *adapter = (struct atl1c_adapter *)hw->adapter;
50200 - struct pci_dev *pdev = adapter->pdev;
50201 - int ret_val;
50202 - u16 mii_bmcr_data = BMCR_RESET;
50203 - u16 phy_id1, phy_id2;
50204 -
50205 - if ((atl1c_read_phy_reg(hw, MII_PHYSID1, &phy_id1) != 0) ||
50206 - (atl1c_read_phy_reg(hw, MII_PHYSID2, &phy_id2) != 0)) {
50207 - if (netif_msg_link(adapter))
50208 - dev_err(&pdev->dev, "Error get phy ID\n");
50209 - return -1;
50210 - }
50211 - switch (hw->media_type) {
50212 - case MEDIA_TYPE_AUTO_SENSOR:
50213 - ret_val = atl1c_phy_setup_adv(hw);
50214 - if (ret_val) {
50215 - if (netif_msg_link(adapter))
50216 - dev_err(&pdev->dev,
50217 - "Error Setting up Auto-Negotiation\n");
50218 - return ret_val;
50219 - }
50220 - mii_bmcr_data |= BMCR_AUTO_NEG_EN | BMCR_RESTART_AUTO_NEG;
50221 - break;
50222 - case MEDIA_TYPE_100M_FULL:
50223 - mii_bmcr_data |= BMCR_SPEED_100 | BMCR_FULL_DUPLEX;
50224 - break;
50225 - case MEDIA_TYPE_100M_HALF:
50226 - mii_bmcr_data |= BMCR_SPEED_100;
50227 - break;
50228 - case MEDIA_TYPE_10M_FULL:
50229 - mii_bmcr_data |= BMCR_SPEED_10 | BMCR_FULL_DUPLEX;
50230 - break;
50231 - case MEDIA_TYPE_10M_HALF:
50232 - mii_bmcr_data |= BMCR_SPEED_10;
50233 - break;
50234 - default:
50235 - if (netif_msg_link(adapter))
50236 - dev_err(&pdev->dev, "Wrong Media type %d\n",
50237 - hw->media_type);
50238 - return -1;
50239 - break;
50240 - }
50241 -
50242 - ret_val = atl1c_write_phy_reg(hw, MII_BMCR, mii_bmcr_data);
50243 - if (ret_val)
50244 - return ret_val;
50245 - hw->phy_configured = true;
50246 -
50247 - return 0;
50248 -}
50249 -
50250 -/*
50251 - * Detects the current speed and duplex settings of the hardware.
50252 - *
50253 - * hw - Struct containing variables accessed by shared code
50254 - * speed - Speed of the connection
50255 - * duplex - Duplex setting of the connection
50256 - */
50257 -int atl1c_get_speed_and_duplex(struct atl1c_hw *hw, u16 *speed, u16 *duplex)
50258 -{
50259 - int err;
50260 - u16 phy_data;
50261 -
50262 - /* Read PHY Specific Status Register (17) */
50263 - err = atl1c_read_phy_reg(hw, MII_GIGA_PSSR, &phy_data);
50264 - if (err)
50265 - return err;
50266 -
50267 - if (!(phy_data & GIGA_PSSR_SPD_DPLX_RESOLVED))
50268 - return -1;
50269 -
50270 - switch (phy_data & GIGA_PSSR_SPEED) {
50271 - case GIGA_PSSR_1000MBS:
50272 - *speed = SPEED_1000;
50273 - break;
50274 - case GIGA_PSSR_100MBS:
50275 - *speed = SPEED_100;
50276 - break;
50277 - case GIGA_PSSR_10MBS:
50278 - *speed = SPEED_10;
50279 - break;
50280 - default:
50281 - return -1;
50282 - break;
50283 - }
50284 -
50285 - if (phy_data & GIGA_PSSR_DPLX)
50286 - *duplex = FULL_DUPLEX;
50287 - else
50288 - *duplex = HALF_DUPLEX;
50289 -
50290 - return 0;
50291 -}
50292 -
50293 -int atl1c_restart_autoneg(struct atl1c_hw *hw)
50294 -{
50295 - int err = 0;
50296 - u16 mii_bmcr_data = BMCR_RESET;
50297 -
50298 - err = atl1c_phy_setup_adv(hw);
50299 - if (err)
50300 - return err;
50301 - mii_bmcr_data |= BMCR_AUTO_NEG_EN | BMCR_RESTART_AUTO_NEG;
50302 -
50303 - return atl1c_write_phy_reg(hw, MII_BMCR, mii_bmcr_data);
50304 -}
50305 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/atl1c/atl1c_hw.h linux-2.6.29-rc3.owrt/drivers/net/atl1c/atl1c_hw.h
50306 --- linux-2.6.29.owrt/drivers/net/atl1c/atl1c_hw.h 2009-05-10 22:04:38.000000000 +0200
50307 +++ linux-2.6.29-rc3.owrt/drivers/net/atl1c/atl1c_hw.h 1970-01-01 01:00:00.000000000 +0100
50308 @@ -1,859 +0,0 @@
50309 -/*
50310 - * Copyright(c) 2008 - 2009 Atheros Corporation. All rights reserved.
50311 - *
50312 - * Derived from Intel e1000 driver
50313 - * Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved.
50314 - *
50315 - * This program is free software; you can redistribute it and/or modify it
50316 - * under the terms of the GNU General Public License as published by the Free
50317 - * Software Foundation; either version 2 of the License, or (at your option)
50318 - * any later version.
50319 - *
50320 - * This program is distributed in the hope that it will be useful, but WITHOUT
50321 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
50322 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
50323 - * more details.
50324 - *
50325 - * You should have received a copy of the GNU General Public License along with
50326 - * this program; if not, write to the Free Software Foundation, Inc., 59
50327 - * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
50328 - */
50329 -
50330 -#ifndef _ATL1C_HW_H_
50331 -#define _ATL1C_HW_H_
50332 -
50333 -#include <linux/types.h>
50334 -#include <linux/mii.h>
50335 -
50336 -struct atl1c_adapter;
50337 -struct atl1c_hw;
50338 -
50339 -/* function prototype */
50340 -void atl1c_phy_disable(struct atl1c_hw *hw);
50341 -void atl1c_hw_set_mac_addr(struct atl1c_hw *hw);
50342 -int atl1c_phy_reset(struct atl1c_hw *hw);
50343 -int atl1c_read_mac_addr(struct atl1c_hw *hw);
50344 -int atl1c_get_speed_and_duplex(struct atl1c_hw *hw, u16 *speed, u16 *duplex);
50345 -u32 atl1c_hash_mc_addr(struct atl1c_hw *hw, u8 *mc_addr);
50346 -void atl1c_hash_set(struct atl1c_hw *hw, u32 hash_value);
50347 -int atl1c_read_phy_reg(struct atl1c_hw *hw, u16 reg_addr, u16 *phy_data);
50348 -int atl1c_write_phy_reg(struct atl1c_hw *hw, u32 reg_addr, u16 phy_data);
50349 -bool atl1c_read_eeprom(struct atl1c_hw *hw, u32 offset, u32 *p_value);
50350 -int atl1c_phy_init(struct atl1c_hw *hw);
50351 -int atl1c_check_eeprom_exist(struct atl1c_hw *hw);
50352 -int atl1c_restart_autoneg(struct atl1c_hw *hw);
50353 -
50354 -/* register definition */
50355 -#define REG_DEVICE_CAP 0x5C
50356 -#define DEVICE_CAP_MAX_PAYLOAD_MASK 0x7
50357 -#define DEVICE_CAP_MAX_PAYLOAD_SHIFT 0
50358 -
50359 -#define REG_DEVICE_CTRL 0x60
50360 -#define DEVICE_CTRL_MAX_PAYLOAD_MASK 0x7
50361 -#define DEVICE_CTRL_MAX_PAYLOAD_SHIFT 5
50362 -#define DEVICE_CTRL_MAX_RREQ_SZ_MASK 0x7
50363 -#define DEVICE_CTRL_MAX_RREQ_SZ_SHIFT 12
50364 -
50365 -#define REG_LINK_CTRL 0x68
50366 -#define LINK_CTRL_L0S_EN 0x01
50367 -#define LINK_CTRL_L1_EN 0x02
50368 -
50369 -#define REG_VPD_CAP 0x6C
50370 -#define VPD_CAP_ID_MASK 0xff
50371 -#define VPD_CAP_ID_SHIFT 0
50372 -#define VPD_CAP_NEXT_PTR_MASK 0xFF
50373 -#define VPD_CAP_NEXT_PTR_SHIFT 8
50374 -#define VPD_CAP_VPD_ADDR_MASK 0x7FFF
50375 -#define VPD_CAP_VPD_ADDR_SHIFT 16
50376 -#define VPD_CAP_VPD_FLAG 0x80000000
50377 -
50378 -#define REG_VPD_DATA 0x70
50379 -
50380 -#define REG_PCIE_UC_SEVERITY 0x10C
50381 -#define PCIE_UC_SERVRITY_TRN 0x00000001
50382 -#define PCIE_UC_SERVRITY_DLP 0x00000010
50383 -#define PCIE_UC_SERVRITY_PSN_TLP 0x00001000
50384 -#define PCIE_UC_SERVRITY_FCP 0x00002000
50385 -#define PCIE_UC_SERVRITY_CPL_TO 0x00004000
50386 -#define PCIE_UC_SERVRITY_CA 0x00008000
50387 -#define PCIE_UC_SERVRITY_UC 0x00010000
50388 -#define PCIE_UC_SERVRITY_ROV 0x00020000
50389 -#define PCIE_UC_SERVRITY_MLFP 0x00040000
50390 -#define PCIE_UC_SERVRITY_ECRC 0x00080000
50391 -#define PCIE_UC_SERVRITY_UR 0x00100000
50392 -
50393 -#define REG_DEV_SERIALNUM_CTRL 0x200
50394 -#define REG_DEV_MAC_SEL_MASK 0x0 /* 0:EUI; 1:MAC */
50395 -#define REG_DEV_MAC_SEL_SHIFT 0
50396 -#define REG_DEV_SERIAL_NUM_EN_MASK 0x1
50397 -#define REG_DEV_SERIAL_NUM_EN_SHIFT 1
50398 -
50399 -#define REG_TWSI_CTRL 0x218
50400 -#define TWSI_CTRL_LD_OFFSET_MASK 0xFF
50401 -#define TWSI_CTRL_LD_OFFSET_SHIFT 0
50402 -#define TWSI_CTRL_LD_SLV_ADDR_MASK 0x7
50403 -#define TWSI_CTRL_LD_SLV_ADDR_SHIFT 8
50404 -#define TWSI_CTRL_SW_LDSTART 0x800
50405 -#define TWSI_CTRL_HW_LDSTART 0x1000
50406 -#define TWSI_CTRL_SMB_SLV_ADDR_MASK 0x7F
50407 -#define TWSI_CTRL_SMB_SLV_ADDR_SHIFT 15
50408 -#define TWSI_CTRL_LD_EXIST 0x400000
50409 -#define TWSI_CTRL_READ_FREQ_SEL_MASK 0x3
50410 -#define TWSI_CTRL_READ_FREQ_SEL_SHIFT 23
50411 -#define TWSI_CTRL_FREQ_SEL_100K 0
50412 -#define TWSI_CTRL_FREQ_SEL_200K 1
50413 -#define TWSI_CTRL_FREQ_SEL_300K 2
50414 -#define TWSI_CTRL_FREQ_SEL_400K 3
50415 -#define TWSI_CTRL_SMB_SLV_ADDR
50416 -#define TWSI_CTRL_WRITE_FREQ_SEL_MASK 0x3
50417 -#define TWSI_CTRL_WRITE_FREQ_SEL_SHIFT 24
50418 -
50419 -
50420 -#define REG_PCIE_DEV_MISC_CTRL 0x21C
50421 -#define PCIE_DEV_MISC_EXT_PIPE 0x2
50422 -#define PCIE_DEV_MISC_RETRY_BUFDIS 0x1
50423 -#define PCIE_DEV_MISC_SPIROM_EXIST 0x4
50424 -#define PCIE_DEV_MISC_SERDES_ENDIAN 0x8
50425 -#define PCIE_DEV_MISC_SERDES_SEL_DIN 0x10
50426 -
50427 -#define REG_PCIE_PHYMISC 0x1000
50428 -#define PCIE_PHYMISC_FORCE_RCV_DET 0x4
50429 -
50430 -#define REG_TWSI_DEBUG 0x1108
50431 -#define TWSI_DEBUG_DEV_EXIST 0x20000000
50432 -
50433 -#define REG_EEPROM_CTRL 0x12C0
50434 -#define EEPROM_CTRL_DATA_HI_MASK 0xFFFF
50435 -#define EEPROM_CTRL_DATA_HI_SHIFT 0
50436 -#define EEPROM_CTRL_ADDR_MASK 0x3FF
50437 -#define EEPROM_CTRL_ADDR_SHIFT 16
50438 -#define EEPROM_CTRL_ACK 0x40000000
50439 -#define EEPROM_CTRL_RW 0x80000000
50440 -
50441 -#define REG_EEPROM_DATA_LO 0x12C4
50442 -
50443 -#define REG_OTP_CTRL 0x12F0
50444 -#define OTP_CTRL_CLK_EN 0x0002
50445 -
50446 -#define REG_PM_CTRL 0x12F8
50447 -#define PM_CTRL_SDES_EN 0x00000001
50448 -#define PM_CTRL_RBER_EN 0x00000002
50449 -#define PM_CTRL_CLK_REQ_EN 0x00000004
50450 -#define PM_CTRL_ASPM_L1_EN 0x00000008
50451 -#define PM_CTRL_SERDES_L1_EN 0x00000010
50452 -#define PM_CTRL_SERDES_PLL_L1_EN 0x00000020
50453 -#define PM_CTRL_SERDES_PD_EX_L1 0x00000040
50454 -#define PM_CTRL_SERDES_BUDS_RX_L1_EN 0x00000080
50455 -#define PM_CTRL_L0S_ENTRY_TIMER_MASK 0xF
50456 -#define PM_CTRL_L0S_ENTRY_TIMER_SHIFT 8
50457 -#define PM_CTRL_ASPM_L0S_EN 0x00001000
50458 -#define PM_CTRL_CLK_SWH_L1 0x00002000
50459 -#define PM_CTRL_CLK_PWM_VER1_1 0x00004000
50460 -#define PM_CTRL_PCIE_RECV 0x00008000
50461 -#define PM_CTRL_L1_ENTRY_TIMER_MASK 0xF
50462 -#define PM_CTRL_L1_ENTRY_TIMER_SHIFT 16
50463 -#define PM_CTRL_PM_REQ_TIMER_MASK 0xF
50464 -#define PM_CTRL_PM_REQ_TIMER_SHIFT 20
50465 -#define PM_CTRL_LCKDET_TIMER_MASK 0x3F
50466 -#define PM_CTRL_LCKDET_TIMER_SHIFT 24
50467 -#define PM_CTRL_MAC_ASPM_CHK 0x40000000
50468 -#define PM_CTRL_HOTRST 0x80000000
50469 -
50470 -/* Selene Master Control Register */
50471 -#define REG_MASTER_CTRL 0x1400
50472 -#define MASTER_CTRL_SOFT_RST 0x1
50473 -#define MASTER_CTRL_TEST_MODE_MASK 0x3
50474 -#define MASTER_CTRL_TEST_MODE_SHIFT 2
50475 -#define MASTER_CTRL_BERT_START 0x10
50476 -#define MASTER_CTRL_MTIMER_EN 0x100
50477 -#define MASTER_CTRL_MANUAL_INT 0x200
50478 -#define MASTER_CTRL_TX_ITIMER_EN 0x400
50479 -#define MASTER_CTRL_RX_ITIMER_EN 0x800
50480 -#define MASTER_CTRL_CLK_SEL_DIS 0x1000
50481 -#define MASTER_CTRL_CLK_SWH_MODE 0x2000
50482 -#define MASTER_CTRL_INT_RDCLR 0x4000
50483 -#define MASTER_CTRL_REV_NUM_SHIFT 16
50484 -#define MASTER_CTRL_REV_NUM_MASK 0xff
50485 -#define MASTER_CTRL_DEV_ID_SHIFT 24
50486 -#define MASTER_CTRL_DEV_ID_MASK 0x7f
50487 -#define MASTER_CTRL_OTP_SEL 0x80000000
50488 -
50489 -/* Timer Initial Value Register */
50490 -#define REG_MANUAL_TIMER_INIT 0x1404
50491 -
50492 -/* IRQ ModeratorTimer Initial Value Register */
50493 -#define REG_IRQ_MODRT_TIMER_INIT 0x1408
50494 -#define IRQ_MODRT_TIMER_MASK 0xffff
50495 -#define IRQ_MODRT_TX_TIMER_SHIFT 0
50496 -#define IRQ_MODRT_RX_TIMER_SHIFT 16
50497 -
50498 -#define REG_GPHY_CTRL 0x140C
50499 -#define GPHY_CTRL_EXT_RESET 0x1
50500 -#define GPHY_CTRL_RTL_MODE 0x2
50501 -#define GPHY_CTRL_LED_MODE 0x4
50502 -#define GPHY_CTRL_ANEG_NOW 0x8
50503 -#define GPHY_CTRL_REV_ANEG 0x10
50504 -#define GPHY_CTRL_GATE_25M_EN 0x20
50505 -#define GPHY_CTRL_LPW_EXIT 0x40
50506 -#define GPHY_CTRL_PHY_IDDQ 0x80
50507 -#define GPHY_CTRL_PHY_IDDQ_DIS 0x100
50508 -#define GPHY_CTRL_GIGA_DIS 0x200
50509 -#define GPHY_CTRL_HIB_EN 0x400
50510 -#define GPHY_CTRL_HIB_PULSE 0x800
50511 -#define GPHY_CTRL_SEL_ANA_RST 0x1000
50512 -#define GPHY_CTRL_PHY_PLL_ON 0x2000
50513 -#define GPHY_CTRL_PWDOWN_HW 0x4000
50514 -#define GPHY_CTRL_PHY_PLL_BYPASS 0x8000
50515 -
50516 -#define GPHY_CTRL_DEFAULT ( \
50517 - GPHY_CTRL_SEL_ANA_RST |\
50518 - GPHY_CTRL_HIB_PULSE |\
50519 - GPHY_CTRL_HIB_EN)
50520 -
50521 -#define GPHY_CTRL_PW_WOL_DIS ( \
50522 - GPHY_CTRL_SEL_ANA_RST |\
50523 - GPHY_CTRL_HIB_PULSE |\
50524 - GPHY_CTRL_HIB_EN |\
50525 - GPHY_CTRL_PWDOWN_HW |\
50526 - GPHY_CTRL_PHY_IDDQ)
50527 -
50528 -/* Block IDLE Status Register */
50529 -#define REG_IDLE_STATUS 0x1410
50530 -#define IDLE_STATUS_MASK 0x00FF
50531 -#define IDLE_STATUS_RXMAC_NO_IDLE 0x1
50532 -#define IDLE_STATUS_TXMAC_NO_IDLE 0x2
50533 -#define IDLE_STATUS_RXQ_NO_IDLE 0x4
50534 -#define IDLE_STATUS_TXQ_NO_IDLE 0x8
50535 -#define IDLE_STATUS_DMAR_NO_IDLE 0x10
50536 -#define IDLE_STATUS_DMAW_NO_IDLE 0x20
50537 -#define IDLE_STATUS_SMB_NO_IDLE 0x40
50538 -#define IDLE_STATUS_CMB_NO_IDLE 0x80
50539 -
50540 -/* MDIO Control Register */
50541 -#define REG_MDIO_CTRL 0x1414
50542 -#define MDIO_DATA_MASK 0xffff /* On MDIO write, the 16-bit
50543 - * control data to write to PHY
50544 - * MII management register */
50545 -#define MDIO_DATA_SHIFT 0 /* On MDIO read, the 16-bit
50546 - * status data that was read
50547 - * from the PHY MII management register */
50548 -#define MDIO_REG_ADDR_MASK 0x1f /* MDIO register address */
50549 -#define MDIO_REG_ADDR_SHIFT 16
50550 -#define MDIO_RW 0x200000 /* 1: read, 0: write */
50551 -#define MDIO_SUP_PREAMBLE 0x400000 /* Suppress preamble */
50552 -#define MDIO_START 0x800000 /* Write 1 to initiate the MDIO
50553 - * master. And this bit is self
50554 - * cleared after one cycle */
50555 -#define MDIO_CLK_SEL_SHIFT 24
50556 -#define MDIO_CLK_25_4 0
50557 -#define MDIO_CLK_25_6 2
50558 -#define MDIO_CLK_25_8 3
50559 -#define MDIO_CLK_25_10 4
50560 -#define MDIO_CLK_25_14 5
50561 -#define MDIO_CLK_25_20 6
50562 -#define MDIO_CLK_25_28 7
50563 -#define MDIO_BUSY 0x8000000
50564 -#define MDIO_AP_EN 0x10000000
50565 -#define MDIO_WAIT_TIMES 10
50566 -
50567 -/* MII PHY Status Register */
50568 -#define REG_PHY_STATUS 0x1418
50569 -#define PHY_GENERAL_STATUS_MASK 0xFFFF
50570 -#define PHY_STATUS_RECV_ENABLE 0x0001
50571 -#define PHY_OE_PWSP_STATUS_MASK 0x07FF
50572 -#define PHY_OE_PWSP_STATUS_SHIFT 16
50573 -#define PHY_STATUS_LPW_STATE 0x80000000
50574 -/* BIST Control and Status Register0 (for the Packet Memory) */
50575 -#define REG_BIST0_CTRL 0x141c
50576 -#define BIST0_NOW 0x1
50577 -#define BIST0_SRAM_FAIL 0x2 /* 1: The SRAM failure is
50578 - * un-repairable because
50579 - * it has address decoder
50580 - * failure or more than 1 cell
50581 - * stuck-to-x failure */
50582 -#define BIST0_FUSE_FLAG 0x4
50583 -
50584 -/* BIST Control and Status Register1(for the retry buffer of PCI Express) */
50585 -#define REG_BIST1_CTRL 0x1420
50586 -#define BIST1_NOW 0x1
50587 -#define BIST1_SRAM_FAIL 0x2
50588 -#define BIST1_FUSE_FLAG 0x4
50589 -
50590 -/* SerDes Lock Detect Control and Status Register */
50591 -#define REG_SERDES_LOCK 0x1424
50592 -#define SERDES_LOCK_DETECT 0x1 /* SerDes lock detected. This signal
50593 - * comes from Analog SerDes */
50594 -#define SERDES_LOCK_DETECT_EN 0x2 /* 1: Enable SerDes Lock detect function */
50595 -
50596 -/* MAC Control Register */
50597 -#define REG_MAC_CTRL 0x1480
50598 -#define MAC_CTRL_TX_EN 0x1
50599 -#define MAC_CTRL_RX_EN 0x2
50600 -#define MAC_CTRL_TX_FLOW 0x4
50601 -#define MAC_CTRL_RX_FLOW 0x8
50602 -#define MAC_CTRL_LOOPBACK 0x10
50603 -#define MAC_CTRL_DUPLX 0x20
50604 -#define MAC_CTRL_ADD_CRC 0x40
50605 -#define MAC_CTRL_PAD 0x80
50606 -#define MAC_CTRL_LENCHK 0x100
50607 -#define MAC_CTRL_HUGE_EN 0x200
50608 -#define MAC_CTRL_PRMLEN_SHIFT 10
50609 -#define MAC_CTRL_PRMLEN_MASK 0xf
50610 -#define MAC_CTRL_RMV_VLAN 0x4000
50611 -#define MAC_CTRL_PROMIS_EN 0x8000
50612 -#define MAC_CTRL_TX_PAUSE 0x10000
50613 -#define MAC_CTRL_SCNT 0x20000
50614 -#define MAC_CTRL_SRST_TX 0x40000
50615 -#define MAC_CTRL_TX_SIMURST 0x80000
50616 -#define MAC_CTRL_SPEED_SHIFT 20
50617 -#define MAC_CTRL_SPEED_MASK 0x3
50618 -#define MAC_CTRL_DBG_TX_BKPRESURE 0x400000
50619 -#define MAC_CTRL_TX_HUGE 0x800000
50620 -#define MAC_CTRL_RX_CHKSUM_EN 0x1000000
50621 -#define MAC_CTRL_MC_ALL_EN 0x2000000
50622 -#define MAC_CTRL_BC_EN 0x4000000
50623 -#define MAC_CTRL_DBG 0x8000000
50624 -#define MAC_CTRL_SINGLE_PAUSE_EN 0x10000000
50625 -
50626 -/* MAC IPG/IFG Control Register */
50627 -#define REG_MAC_IPG_IFG 0x1484
50628 -#define MAC_IPG_IFG_IPGT_SHIFT 0 /* Desired back to back
50629 - * inter-packet gap. The
50630 - * default is 96-bit time */
50631 -#define MAC_IPG_IFG_IPGT_MASK 0x7f
50632 -#define MAC_IPG_IFG_MIFG_SHIFT 8 /* Minimum number of IFG to
50633 - * enforce in between RX frames */
50634 -#define MAC_IPG_IFG_MIFG_MASK 0xff /* Frame gap below such IFP is dropped */
50635 -#define MAC_IPG_IFG_IPGR1_SHIFT 16 /* 64bit Carrier-Sense window */
50636 -#define MAC_IPG_IFG_IPGR1_MASK 0x7f
50637 -#define MAC_IPG_IFG_IPGR2_SHIFT 24 /* 96-bit IPG window */
50638 -#define MAC_IPG_IFG_IPGR2_MASK 0x7f
50639 -
50640 -/* MAC STATION ADDRESS */
50641 -#define REG_MAC_STA_ADDR 0x1488
50642 -
50643 -/* Hash table for multicast address */
50644 -#define REG_RX_HASH_TABLE 0x1490
50645 -
50646 -/* MAC Half-Duplex Control Register */
50647 -#define REG_MAC_HALF_DUPLX_CTRL 0x1498
50648 -#define MAC_HALF_DUPLX_CTRL_LCOL_SHIFT 0 /* Collision Window */
50649 -#define MAC_HALF_DUPLX_CTRL_LCOL_MASK 0x3ff
50650 -#define MAC_HALF_DUPLX_CTRL_RETRY_SHIFT 12
50651 -#define MAC_HALF_DUPLX_CTRL_RETRY_MASK 0xf
50652 -#define MAC_HALF_DUPLX_CTRL_EXC_DEF_EN 0x10000
50653 -#define MAC_HALF_DUPLX_CTRL_NO_BACK_C 0x20000
50654 -#define MAC_HALF_DUPLX_CTRL_NO_BACK_P 0x40000 /* No back-off on backpressure,
50655 - * immediately start the
50656 - * transmission after back pressure */
50657 -#define MAC_HALF_DUPLX_CTRL_ABEBE 0x80000 /* 1: Alternative Binary Exponential Back-off Enabled */
50658 -#define MAC_HALF_DUPLX_CTRL_ABEBT_SHIFT 20 /* Maximum binary exponential number */
50659 -#define MAC_HALF_DUPLX_CTRL_ABEBT_MASK 0xf
50660 -#define MAC_HALF_DUPLX_CTRL_JAMIPG_SHIFT 24 /* IPG to start JAM for collision based flow control in half-duplex */
50661 -#define MAC_HALF_DUPLX_CTRL_JAMIPG_MASK 0xf /* mode. In unit of 8-bit time */
50662 -
50663 -/* Maximum Frame Length Control Register */
50664 -#define REG_MTU 0x149c
50665 -
50666 -/* Wake-On-Lan control register */
50667 -#define REG_WOL_CTRL 0x14a0
50668 -#define WOL_PATTERN_EN 0x00000001
50669 -#define WOL_PATTERN_PME_EN 0x00000002
50670 -#define WOL_MAGIC_EN 0x00000004
50671 -#define WOL_MAGIC_PME_EN 0x00000008
50672 -#define WOL_LINK_CHG_EN 0x00000010
50673 -#define WOL_LINK_CHG_PME_EN 0x00000020
50674 -#define WOL_PATTERN_ST 0x00000100
50675 -#define WOL_MAGIC_ST 0x00000200
50676 -#define WOL_LINKCHG_ST 0x00000400
50677 -#define WOL_CLK_SWITCH_EN 0x00008000
50678 -#define WOL_PT0_EN 0x00010000
50679 -#define WOL_PT1_EN 0x00020000
50680 -#define WOL_PT2_EN 0x00040000
50681 -#define WOL_PT3_EN 0x00080000
50682 -#define WOL_PT4_EN 0x00100000
50683 -#define WOL_PT5_EN 0x00200000
50684 -#define WOL_PT6_EN 0x00400000
50685 -
50686 -/* WOL Length ( 2 DWORD ) */
50687 -#define REG_WOL_PATTERN_LEN 0x14a4
50688 -#define WOL_PT_LEN_MASK 0x7f
50689 -#define WOL_PT0_LEN_SHIFT 0
50690 -#define WOL_PT1_LEN_SHIFT 8
50691 -#define WOL_PT2_LEN_SHIFT 16
50692 -#define WOL_PT3_LEN_SHIFT 24
50693 -#define WOL_PT4_LEN_SHIFT 0
50694 -#define WOL_PT5_LEN_SHIFT 8
50695 -#define WOL_PT6_LEN_SHIFT 16
50696 -
50697 -/* Internal SRAM Partition Register */
50698 -#define RFDX_HEAD_ADDR_MASK 0x03FF
50699 -#define RFDX_HARD_ADDR_SHIFT 0
50700 -#define RFDX_TAIL_ADDR_MASK 0x03FF
50701 -#define RFDX_TAIL_ADDR_SHIFT 16
50702 -
50703 -#define REG_SRAM_RFD0_INFO 0x1500
50704 -#define REG_SRAM_RFD1_INFO 0x1504
50705 -#define REG_SRAM_RFD2_INFO 0x1508
50706 -#define REG_SRAM_RFD3_INFO 0x150C
50707 -
50708 -#define REG_RFD_NIC_LEN 0x1510 /* In 8-bytes */
50709 -#define RFD_NIC_LEN_MASK 0x03FF
50710 -
50711 -#define REG_SRAM_TRD_ADDR 0x1518
50712 -#define TPD_HEAD_ADDR_MASK 0x03FF
50713 -#define TPD_HEAD_ADDR_SHIFT 0
50714 -#define TPD_TAIL_ADDR_MASK 0x03FF
50715 -#define TPD_TAIL_ADDR_SHIFT 16
50716 -
50717 -#define REG_SRAM_TRD_LEN 0x151C /* In 8-bytes */
50718 -#define TPD_NIC_LEN_MASK 0x03FF
50719 -
50720 -#define REG_SRAM_RXF_ADDR 0x1520
50721 -#define REG_SRAM_RXF_LEN 0x1524
50722 -#define REG_SRAM_TXF_ADDR 0x1528
50723 -#define REG_SRAM_TXF_LEN 0x152C
50724 -#define REG_SRAM_TCPH_ADDR 0x1530
50725 -#define REG_SRAM_PKTH_ADDR 0x1532
50726 -
50727 -/*
50728 - * Load Ptr Register
50729 - * Software sets this bit after the initialization of the head and tail */
50730 -#define REG_LOAD_PTR 0x1534
50731 -
50732 -/*
50733 - * addresses of all descriptors, as well as the following descriptor
50734 - * control register, which triggers each function block to load the head
50735 - * pointer to prepare for the operation. This bit is then self-cleared
50736 - * after one cycle.
50737 - */
50738 -#define REG_RX_BASE_ADDR_HI 0x1540
50739 -#define REG_TX_BASE_ADDR_HI 0x1544
50740 -#define REG_SMB_BASE_ADDR_HI 0x1548
50741 -#define REG_SMB_BASE_ADDR_LO 0x154C
50742 -#define REG_RFD0_HEAD_ADDR_LO 0x1550
50743 -#define REG_RFD1_HEAD_ADDR_LO 0x1554
50744 -#define REG_RFD2_HEAD_ADDR_LO 0x1558
50745 -#define REG_RFD3_HEAD_ADDR_LO 0x155C
50746 -#define REG_RFD_RING_SIZE 0x1560
50747 -#define RFD_RING_SIZE_MASK 0x0FFF
50748 -#define REG_RX_BUF_SIZE 0x1564
50749 -#define RX_BUF_SIZE_MASK 0xFFFF
50750 -#define REG_RRD0_HEAD_ADDR_LO 0x1568
50751 -#define REG_RRD1_HEAD_ADDR_LO 0x156C
50752 -#define REG_RRD2_HEAD_ADDR_LO 0x1570
50753 -#define REG_RRD3_HEAD_ADDR_LO 0x1574
50754 -#define REG_RRD_RING_SIZE 0x1578
50755 -#define RRD_RING_SIZE_MASK 0x0FFF
50756 -#define REG_HTPD_HEAD_ADDR_LO 0x157C
50757 -#define REG_NTPD_HEAD_ADDR_LO 0x1580
50758 -#define REG_TPD_RING_SIZE 0x1584
50759 -#define TPD_RING_SIZE_MASK 0xFFFF
50760 -#define REG_CMB_BASE_ADDR_LO 0x1588
50761 -
50762 -/* RSS about */
50763 -#define REG_RSS_KEY0 0x14B0
50764 -#define REG_RSS_KEY1 0x14B4
50765 -#define REG_RSS_KEY2 0x14B8
50766 -#define REG_RSS_KEY3 0x14BC
50767 -#define REG_RSS_KEY4 0x14C0
50768 -#define REG_RSS_KEY5 0x14C4
50769 -#define REG_RSS_KEY6 0x14C8
50770 -#define REG_RSS_KEY7 0x14CC
50771 -#define REG_RSS_KEY8 0x14D0
50772 -#define REG_RSS_KEY9 0x14D4
50773 -#define REG_IDT_TABLE0 0x14E0
50774 -#define REG_IDT_TABLE1 0x14E4
50775 -#define REG_IDT_TABLE2 0x14E8
50776 -#define REG_IDT_TABLE3 0x14EC
50777 -#define REG_IDT_TABLE4 0x14F0
50778 -#define REG_IDT_TABLE5 0x14F4
50779 -#define REG_IDT_TABLE6 0x14F8
50780 -#define REG_IDT_TABLE7 0x14FC
50781 -#define REG_IDT_TABLE REG_IDT_TABLE0
50782 -#define REG_RSS_HASH_VALUE 0x15B0
50783 -#define REG_RSS_HASH_FLAG 0x15B4
50784 -#define REG_BASE_CPU_NUMBER 0x15B8
50785 -
50786 -/* TXQ Control Register */
50787 -#define REG_TXQ_CTRL 0x1590
50788 -#define TXQ_NUM_TPD_BURST_MASK 0xF
50789 -#define TXQ_NUM_TPD_BURST_SHIFT 0
50790 -#define TXQ_CTRL_IP_OPTION_EN 0x10
50791 -#define TXQ_CTRL_EN 0x20
50792 -#define TXQ_CTRL_ENH_MODE 0x40
50793 -#define TXQ_CTRL_LS_8023_EN 0x80
50794 -#define TXQ_TXF_BURST_NUM_SHIFT 16
50795 -#define TXQ_TXF_BURST_NUM_MASK 0xFFFF
50796 -
50797 -/* Jumbo packet Threshold for task offload */
50798 -#define REG_TX_TSO_OFFLOAD_THRESH 0x1594 /* In 8-bytes */
50799 -#define TX_TSO_OFFLOAD_THRESH_MASK 0x07FF
50800 -
50801 -#define REG_TXF_WATER_MARK 0x1598 /* In 8-bytes */
50802 -#define TXF_WATER_MARK_MASK 0x0FFF
50803 -#define TXF_LOW_WATER_MARK_SHIFT 0
50804 -#define TXF_HIGH_WATER_MARK_SHIFT 16
50805 -#define TXQ_CTRL_BURST_MODE_EN 0x80000000
50806 -
50807 -#define REG_THRUPUT_MON_CTRL 0x159C
50808 -#define THRUPUT_MON_RATE_MASK 0x3
50809 -#define THRUPUT_MON_RATE_SHIFT 0
50810 -#define THRUPUT_MON_EN 0x80
50811 -
50812 -/* RXQ Control Register */
50813 -#define REG_RXQ_CTRL 0x15A0
50814 -#define ASPM_THRUPUT_LIMIT_MASK 0x3
50815 -#define ASPM_THRUPUT_LIMIT_SHIFT 0
50816 -#define ASPM_THRUPUT_LIMIT_NO 0x00
50817 -#define ASPM_THRUPUT_LIMIT_1M 0x01
50818 -#define ASPM_THRUPUT_LIMIT_10M 0x02
50819 -#define ASPM_THRUPUT_LIMIT_100M 0x04
50820 -#define RXQ1_CTRL_EN 0x10
50821 -#define RXQ2_CTRL_EN 0x20
50822 -#define RXQ3_CTRL_EN 0x40
50823 -#define IPV6_CHKSUM_CTRL_EN 0x80
50824 -#define RSS_HASH_BITS_MASK 0x00FF
50825 -#define RSS_HASH_BITS_SHIFT 8
50826 -#define RSS_HASH_IPV4 0x10000
50827 -#define RSS_HASH_IPV4_TCP 0x20000
50828 -#define RSS_HASH_IPV6 0x40000
50829 -#define RSS_HASH_IPV6_TCP 0x80000
50830 -#define RXQ_RFD_BURST_NUM_MASK 0x003F
50831 -#define RXQ_RFD_BURST_NUM_SHIFT 20
50832 -#define RSS_MODE_MASK 0x0003
50833 -#define RSS_MODE_SHIFT 26
50834 -#define RSS_NIP_QUEUE_SEL_MASK 0x1
50835 -#define RSS_NIP_QUEUE_SEL_SHIFT 28
50836 -#define RRS_HASH_CTRL_EN 0x20000000
50837 -#define RX_CUT_THRU_EN 0x40000000
50838 -#define RXQ_CTRL_EN 0x80000000
50839 -
50840 -#define REG_RFD_FREE_THRESH 0x15A4
50841 -#define RFD_FREE_THRESH_MASK 0x003F
50842 -#define RFD_FREE_HI_THRESH_SHIFT 0
50843 -#define RFD_FREE_LO_THRESH_SHIFT 6
50844 -
50845 -/* RXF flow control register */
50846 -#define REG_RXQ_RXF_PAUSE_THRESH 0x15A8
50847 -#define RXQ_RXF_PAUSE_TH_HI_SHIFT 0
50848 -#define RXQ_RXF_PAUSE_TH_HI_MASK 0x0FFF
50849 -#define RXQ_RXF_PAUSE_TH_LO_SHIFT 16
50850 -#define RXQ_RXF_PAUSE_TH_LO_MASK 0x0FFF
50851 -
50852 -#define REG_RXD_DMA_CTRL 0x15AC
50853 -#define RXD_DMA_THRESH_MASK 0x0FFF /* In 8-bytes */
50854 -#define RXD_DMA_THRESH_SHIFT 0
50855 -#define RXD_DMA_DOWN_TIMER_MASK 0xFFFF
50856 -#define RXD_DMA_DOWN_TIMER_SHIFT 16
50857 -
50858 -/* DMA Engine Control Register */
50859 -#define REG_DMA_CTRL 0x15C0
50860 -#define DMA_CTRL_DMAR_IN_ORDER 0x1
50861 -#define DMA_CTRL_DMAR_ENH_ORDER 0x2
50862 -#define DMA_CTRL_DMAR_OUT_ORDER 0x4
50863 -#define DMA_CTRL_RCB_VALUE 0x8
50864 -#define DMA_CTRL_DMAR_BURST_LEN_MASK 0x0007
50865 -#define DMA_CTRL_DMAR_BURST_LEN_SHIFT 4
50866 -#define DMA_CTRL_DMAW_BURST_LEN_MASK 0x0007
50867 -#define DMA_CTRL_DMAW_BURST_LEN_SHIFT 7
50868 -#define DMA_CTRL_DMAR_REQ_PRI 0x400
50869 -#define DMA_CTRL_DMAR_DLY_CNT_MASK 0x001F
50870 -#define DMA_CTRL_DMAR_DLY_CNT_SHIFT 11
50871 -#define DMA_CTRL_DMAW_DLY_CNT_MASK 0x000F
50872 -#define DMA_CTRL_DMAW_DLY_CNT_SHIFT 16
50873 -#define DMA_CTRL_CMB_EN 0x100000
50874 -#define DMA_CTRL_SMB_EN 0x200000
50875 -#define DMA_CTRL_CMB_NOW 0x400000
50876 -#define MAC_CTRL_SMB_DIS 0x1000000
50877 -#define DMA_CTRL_SMB_NOW 0x80000000
50878 -
50879 -/* CMB/SMB Control Register */
50880 -#define REG_SMB_STAT_TIMER 0x15C4 /* 2us resolution */
50881 -#define SMB_STAT_TIMER_MASK 0xFFFFFF
50882 -#define REG_CMB_TPD_THRESH 0x15C8
50883 -#define CMB_TPD_THRESH_MASK 0xFFFF
50884 -#define REG_CMB_TX_TIMER 0x15CC /* 2us resolution */
50885 -#define CMB_TX_TIMER_MASK 0xFFFF
50886 -
50887 -/* Mail box */
50888 -#define MB_RFDX_PROD_IDX_MASK 0xFFFF
50889 -#define REG_MB_RFD0_PROD_IDX 0x15E0
50890 -#define REG_MB_RFD1_PROD_IDX 0x15E4
50891 -#define REG_MB_RFD2_PROD_IDX 0x15E8
50892 -#define REG_MB_RFD3_PROD_IDX 0x15EC
50893 -
50894 -#define MB_PRIO_PROD_IDX_MASK 0xFFFF
50895 -#define REG_MB_PRIO_PROD_IDX 0x15F0
50896 -#define MB_HTPD_PROD_IDX_SHIFT 0
50897 -#define MB_NTPD_PROD_IDX_SHIFT 16
50898 -
50899 -#define MB_PRIO_CONS_IDX_MASK 0xFFFF
50900 -#define REG_MB_PRIO_CONS_IDX 0x15F4
50901 -#define MB_HTPD_CONS_IDX_SHIFT 0
50902 -#define MB_NTPD_CONS_IDX_SHIFT 16
50903 -
50904 -#define REG_MB_RFD01_CONS_IDX 0x15F8
50905 -#define MB_RFD0_CONS_IDX_MASK 0x0000FFFF
50906 -#define MB_RFD1_CONS_IDX_MASK 0xFFFF0000
50907 -#define REG_MB_RFD23_CONS_IDX 0x15FC
50908 -#define MB_RFD2_CONS_IDX_MASK 0x0000FFFF
50909 -#define MB_RFD3_CONS_IDX_MASK 0xFFFF0000
50910 -
50911 -/* Interrupt Status Register */
50912 -#define REG_ISR 0x1600
50913 -#define ISR_SMB 0x00000001
50914 -#define ISR_TIMER 0x00000002
50915 -/*
50916 - * Software manual interrupt, for debug. Set when SW_MAN_INT_EN is set
50917 - * in Table 51 Selene Master Control Register (Offset 0x1400).
50918 - */
50919 -#define ISR_MANUAL 0x00000004
50920 -#define ISR_HW_RXF_OV 0x00000008 /* RXF overflow interrupt */
50921 -#define ISR_RFD0_UR 0x00000010 /* RFD0 under run */
50922 -#define ISR_RFD1_UR 0x00000020
50923 -#define ISR_RFD2_UR 0x00000040
50924 -#define ISR_RFD3_UR 0x00000080
50925 -#define ISR_TXF_UR 0x00000100
50926 -#define ISR_DMAR_TO_RST 0x00000200
50927 -#define ISR_DMAW_TO_RST 0x00000400
50928 -#define ISR_TX_CREDIT 0x00000800
50929 -#define ISR_GPHY 0x00001000
50930 -/* GPHY low power state interrupt */
50931 -#define ISR_GPHY_LPW 0x00002000
50932 -#define ISR_TXQ_TO_RST 0x00004000
50933 -#define ISR_TX_PKT 0x00008000
50934 -#define ISR_RX_PKT_0 0x00010000
50935 -#define ISR_RX_PKT_1 0x00020000
50936 -#define ISR_RX_PKT_2 0x00040000
50937 -#define ISR_RX_PKT_3 0x00080000
50938 -#define ISR_MAC_RX 0x00100000
50939 -#define ISR_MAC_TX 0x00200000
50940 -#define ISR_UR_DETECTED 0x00400000
50941 -#define ISR_FERR_DETECTED 0x00800000
50942 -#define ISR_NFERR_DETECTED 0x01000000
50943 -#define ISR_CERR_DETECTED 0x02000000
50944 -#define ISR_PHY_LINKDOWN 0x04000000
50945 -#define ISR_DIS_INT 0x80000000
50946 -
50947 -/* Interrupt Mask Register */
50948 -#define REG_IMR 0x1604
50949 -
50950 -#define IMR_NORMAL_MASK (\
50951 - ISR_MANUAL |\
50952 - ISR_HW_RXF_OV |\
50953 - ISR_RFD0_UR |\
50954 - ISR_TXF_UR |\
50955 - ISR_DMAR_TO_RST |\
50956 - ISR_TXQ_TO_RST |\
50957 - ISR_DMAW_TO_RST |\
50958 - ISR_GPHY |\
50959 - ISR_TX_PKT |\
50960 - ISR_RX_PKT_0 |\
50961 - ISR_GPHY_LPW |\
50962 - ISR_PHY_LINKDOWN)
50963 -
50964 -#define ISR_RX_PKT (\
50965 - ISR_RX_PKT_0 |\
50966 - ISR_RX_PKT_1 |\
50967 - ISR_RX_PKT_2 |\
50968 - ISR_RX_PKT_3)
50969 -
50970 -#define ISR_OVER (\
50971 - ISR_RFD0_UR |\
50972 - ISR_RFD1_UR |\
50973 - ISR_RFD2_UR |\
50974 - ISR_RFD3_UR |\
50975 - ISR_HW_RXF_OV |\
50976 - ISR_TXF_UR)
50977 -
50978 -#define ISR_ERROR (\
50979 - ISR_DMAR_TO_RST |\
50980 - ISR_TXQ_TO_RST |\
50981 - ISR_DMAW_TO_RST |\
50982 - ISR_PHY_LINKDOWN)
50983 -
50984 -#define REG_INT_RETRIG_TIMER 0x1608
50985 -#define INT_RETRIG_TIMER_MASK 0xFFFF
50986 -
50987 -#define REG_HDS_CTRL 0x160C
50988 -#define HDS_CTRL_EN 0x0001
50989 -#define HDS_CTRL_BACKFILLSIZE_SHIFT 8
50990 -#define HDS_CTRL_BACKFILLSIZE_MASK 0x0FFF
50991 -#define HDS_CTRL_MAX_HDRSIZE_SHIFT 20
50992 -#define HDS_CTRL_MAC_HDRSIZE_MASK 0x0FFF
50993 -
50994 -#define REG_MAC_RX_STATUS_BIN 0x1700
50995 -#define REG_MAC_RX_STATUS_END 0x175c
50996 -#define REG_MAC_TX_STATUS_BIN 0x1760
50997 -#define REG_MAC_TX_STATUS_END 0x17c0
50998 -
50999 -/* DEBUG ADDR */
51000 -#define REG_DEBUG_DATA0 0x1900
51001 -#define REG_DEBUG_DATA1 0x1904
51002 -
51003 -/* PHY Control Register */
51004 -#define MII_BMCR 0x00
51005 -#define BMCR_SPEED_SELECT_MSB 0x0040 /* bits 6,13: 10=1000, 01=100, 00=10 */
51006 -#define BMCR_COLL_TEST_ENABLE 0x0080 /* Collision test enable */
51007 -#define BMCR_FULL_DUPLEX 0x0100 /* FDX =1, half duplex =0 */
51008 -#define BMCR_RESTART_AUTO_NEG 0x0200 /* Restart auto negotiation */
51009 -#define BMCR_ISOLATE 0x0400 /* Isolate PHY from MII */
51010 -#define BMCR_POWER_DOWN 0x0800 /* Power down */
51011 -#define BMCR_AUTO_NEG_EN 0x1000 /* Auto Neg Enable */
51012 -#define BMCR_SPEED_SELECT_LSB 0x2000 /* bits 6,13: 10=1000, 01=100, 00=10 */
51013 -#define BMCR_LOOPBACK 0x4000 /* 0 = normal, 1 = loopback */
51014 -#define BMCR_RESET 0x8000 /* 0 = normal, 1 = PHY reset */
51015 -#define BMCR_SPEED_MASK 0x2040
51016 -#define BMCR_SPEED_1000 0x0040
51017 -#define BMCR_SPEED_100 0x2000
51018 -#define BMCR_SPEED_10 0x0000
51019 -
51020 -/* PHY Status Register */
51021 -#define MII_BMSR 0x01
51022 -#define BMMSR_EXTENDED_CAPS 0x0001 /* Extended register capabilities */
51023 -#define BMSR_JABBER_DETECT 0x0002 /* Jabber Detected */
51024 -#define BMSR_LINK_STATUS 0x0004 /* Link Status 1 = link */
51025 -#define BMSR_AUTONEG_CAPS 0x0008 /* Auto Neg Capable */
51026 -#define BMSR_REMOTE_FAULT 0x0010 /* Remote Fault Detect */
51027 -#define BMSR_AUTONEG_COMPLETE 0x0020 /* Auto Neg Complete */
51028 -#define BMSR_PREAMBLE_SUPPRESS 0x0040 /* Preamble may be suppressed */
51029 -#define BMSR_EXTENDED_STATUS 0x0100 /* Ext. status info in Reg 0x0F */
51030 -#define BMSR_100T2_HD_CAPS 0x0200 /* 100T2 Half Duplex Capable */
51031 -#define BMSR_100T2_FD_CAPS 0x0400 /* 100T2 Full Duplex Capable */
51032 -#define BMSR_10T_HD_CAPS 0x0800 /* 10T Half Duplex Capable */
51033 -#define BMSR_10T_FD_CAPS 0x1000 /* 10T Full Duplex Capable */
51034 -#define BMSR_100X_HD_CAPS 0x2000 /* 100X Half Duplex Capable */
51035 -#define BMMII_SR_100X_FD_CAPS 0x4000 /* 100X Full Duplex Capable */
51036 -#define BMMII_SR_100T4_CAPS 0x8000 /* 100T4 Capable */
51037 -
51038 -#define MII_PHYSID1 0x02
51039 -#define MII_PHYSID2 0x03
51040 -
51041 -/* Autoneg Advertisement Register */
51042 -#define MII_ADVERTISE 0x04
51043 -#define ADVERTISE_SPEED_MASK 0x01E0
51044 -#define ADVERTISE_DEFAULT_CAP 0x0DE0
51045 -
51046 -/* 1000BASE-T Control Register */
51047 -#define MII_GIGA_CR 0x09
51048 -#define GIGA_CR_1000T_REPEATER_DTE 0x0400 /* 1=Repeater/switch device port 0=DTE device */
51049 -
51050 -#define GIGA_CR_1000T_MS_VALUE 0x0800 /* 1=Configure PHY as Master 0=Configure PHY as Slave */
51051 -#define GIGA_CR_1000T_MS_ENABLE 0x1000 /* 1=Master/Slave manual config value 0=Automatic Master/Slave config */
51052 -#define GIGA_CR_1000T_TEST_MODE_NORMAL 0x0000 /* Normal Operation */
51053 -#define GIGA_CR_1000T_TEST_MODE_1 0x2000 /* Transmit Waveform test */
51054 -#define GIGA_CR_1000T_TEST_MODE_2 0x4000 /* Master Transmit Jitter test */
51055 -#define GIGA_CR_1000T_TEST_MODE_3 0x6000 /* Slave Transmit Jitter test */
51056 -#define GIGA_CR_1000T_TEST_MODE_4 0x8000 /* Transmitter Distortion test */
51057 -#define GIGA_CR_1000T_SPEED_MASK 0x0300
51058 -#define GIGA_CR_1000T_DEFAULT_CAP 0x0300
51059 -
51060 -/* PHY Specific Status Register */
51061 -#define MII_GIGA_PSSR 0x11
51062 -#define GIGA_PSSR_SPD_DPLX_RESOLVED 0x0800 /* 1=Speed & Duplex resolved */
51063 -#define GIGA_PSSR_DPLX 0x2000 /* 1=Duplex 0=Half Duplex */
51064 -#define GIGA_PSSR_SPEED 0xC000 /* Speed, bits 14:15 */
51065 -#define GIGA_PSSR_10MBS 0x0000 /* 00=10Mbs */
51066 -#define GIGA_PSSR_100MBS 0x4000 /* 01=100Mbs */
51067 -#define GIGA_PSSR_1000MBS 0x8000 /* 10=1000Mbs */
51068 -
51069 -/* PHY Interrupt Enable Register */
51070 -#define MII_IER 0x12
51071 -#define IER_LINK_UP 0x0400
51072 -#define IER_LINK_DOWN 0x0800
51073 -
51074 -/* PHY Interrupt Status Register */
51075 -#define MII_ISR 0x13
51076 -#define ISR_LINK_UP 0x0400
51077 -#define ISR_LINK_DOWN 0x0800
51078 -
51079 -/* Cable-Detect-Test Control Register */
51080 -#define MII_CDTC 0x16
51081 -#define CDTC_EN_OFF 0 /* sc */
51082 -#define CDTC_EN_BITS 1
51083 -#define CDTC_PAIR_OFF 8
51084 -#define CDTC_PAIR_BIT 2
51085 -
51086 -/* Cable-Detect-Test Status Register */
51087 -#define MII_CDTS 0x1C
51088 -#define CDTS_STATUS_OFF 8
51089 -#define CDTS_STATUS_BITS 2
51090 -#define CDTS_STATUS_NORMAL 0
51091 -#define CDTS_STATUS_SHORT 1
51092 -#define CDTS_STATUS_OPEN 2
51093 -#define CDTS_STATUS_INVALID 3
51094 -
51095 -#define MII_DBG_ADDR 0x1D
51096 -#define MII_DBG_DATA 0x1E
51097 -
51098 -#define MII_ANA_CTRL_0 0x0
51099 -#define ANA_RESTART_CAL 0x0001
51100 -#define ANA_MANUL_SWICH_ON_SHIFT 0x1
51101 -#define ANA_MANUL_SWICH_ON_MASK 0xF
51102 -#define ANA_MAN_ENABLE 0x0020
51103 -#define ANA_SEL_HSP 0x0040
51104 -#define ANA_EN_HB 0x0080
51105 -#define ANA_EN_HBIAS 0x0100
51106 -#define ANA_OEN_125M 0x0200
51107 -#define ANA_EN_LCKDT 0x0400
51108 -#define ANA_LCKDT_PHY 0x0800
51109 -#define ANA_AFE_MODE 0x1000
51110 -#define ANA_VCO_SLOW 0x2000
51111 -#define ANA_VCO_FAST 0x4000
51112 -#define ANA_SEL_CLK125M_DSP 0x8000
51113 -
51114 -#define MII_ANA_CTRL_4 0x4
51115 -#define ANA_IECHO_ADJ_MASK 0xF
51116 -#define ANA_IECHO_ADJ_3_SHIFT 0
51117 -#define ANA_IECHO_ADJ_2_SHIFT 4
51118 -#define ANA_IECHO_ADJ_1_SHIFT 8
51119 -#define ANA_IECHO_ADJ_0_SHIFT 12
51120 -
51121 -#define MII_ANA_CTRL_5 0x5
51122 -#define ANA_SERDES_CDR_BW_SHIFT 0
51123 -#define ANA_SERDES_CDR_BW_MASK 0x3
51124 -#define ANA_MS_PAD_DBG 0x0004
51125 -#define ANA_SPEEDUP_DBG 0x0008
51126 -#define ANA_SERDES_TH_LOS_SHIFT 4
51127 -#define ANA_SERDES_TH_LOS_MASK 0x3
51128 -#define ANA_SERDES_EN_DEEM 0x0040
51129 -#define ANA_SERDES_TXELECIDLE 0x0080
51130 -#define ANA_SERDES_BEACON 0x0100
51131 -#define ANA_SERDES_HALFTXDR 0x0200
51132 -#define ANA_SERDES_SEL_HSP 0x0400
51133 -#define ANA_SERDES_EN_PLL 0x0800
51134 -#define ANA_SERDES_EN 0x1000
51135 -#define ANA_SERDES_EN_LCKDT 0x2000
51136 -
51137 -#define MII_ANA_CTRL_11 0xB
51138 -#define ANA_PS_HIB_EN 0x8000
51139 -
51140 -#define MII_ANA_CTRL_18 0x12
51141 -#define ANA_TEST_MODE_10BT_01SHIFT 0
51142 -#define ANA_TEST_MODE_10BT_01MASK 0x3
51143 -#define ANA_LOOP_SEL_10BT 0x0004
51144 -#define ANA_RGMII_MODE_SW 0x0008
51145 -#define ANA_EN_LONGECABLE 0x0010
51146 -#define ANA_TEST_MODE_10BT_2 0x0020
51147 -#define ANA_EN_10BT_IDLE 0x0400
51148 -#define ANA_EN_MASK_TB 0x0800
51149 -#define ANA_TRIGGER_SEL_TIMER_SHIFT 12
51150 -#define ANA_TRIGGER_SEL_TIMER_MASK 0x3
51151 -#define ANA_INTERVAL_SEL_TIMER_SHIFT 14
51152 -#define ANA_INTERVAL_SEL_TIMER_MASK 0x3
51153 -
51154 -#define MII_ANA_CTRL_41 0x29
51155 -#define ANA_TOP_PS_EN 0x8000
51156 -
51157 -#define MII_ANA_CTRL_54 0x36
51158 -#define ANA_LONG_CABLE_TH_100_SHIFT 0
51159 -#define ANA_LONG_CABLE_TH_100_MASK 0x3F
51160 -#define ANA_DESERVED 0x0040
51161 -#define ANA_EN_LIT_CH 0x0080
51162 -#define ANA_SHORT_CABLE_TH_100_SHIFT 8
51163 -#define ANA_SHORT_CABLE_TH_100_MASK 0x3F
51164 -#define ANA_BP_BAD_LINK_ACCUM 0x4000
51165 -#define ANA_BP_SMALL_BW 0x8000
51166 -
51167 -#endif /*_ATL1C_HW_H_*/
51168 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/atl1c/atl1c_main.c linux-2.6.29-rc3.owrt/drivers/net/atl1c/atl1c_main.c
51169 --- linux-2.6.29.owrt/drivers/net/atl1c/atl1c_main.c 2009-05-10 22:04:38.000000000 +0200
51170 +++ linux-2.6.29-rc3.owrt/drivers/net/atl1c/atl1c_main.c 1970-01-01 01:00:00.000000000 +0100
51171 @@ -1,2797 +0,0 @@
51172 -/*
51173 - * Copyright(c) 2008 - 2009 Atheros Corporation. All rights reserved.
51174 - *
51175 - * Derived from Intel e1000 driver
51176 - * Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved.
51177 - *
51178 - * This program is free software; you can redistribute it and/or modify it
51179 - * under the terms of the GNU General Public License as published by the Free
51180 - * Software Foundation; either version 2 of the License, or (at your option)
51181 - * any later version.
51182 - *
51183 - * This program is distributed in the hope that it will be useful, but WITHOUT
51184 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
51185 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
51186 - * more details.
51187 - *
51188 - * You should have received a copy of the GNU General Public License along with
51189 - * this program; if not, write to the Free Software Foundation, Inc., 59
51190 - * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
51191 - */
51192 -
51193 -#include "atl1c.h"
51194 -
51195 -#define ATL1C_DRV_VERSION "1.0.0.1-NAPI"
51196 -char atl1c_driver_name[] = "atl1c";
51197 -char atl1c_driver_version[] = ATL1C_DRV_VERSION;
51198 -#define PCI_DEVICE_ID_ATTANSIC_L2C 0x1062
51199 -#define PCI_DEVICE_ID_ATTANSIC_L1C 0x1063
51200 -/*
51201 - * atl1c_pci_tbl - PCI Device ID Table
51202 - *
51203 - * Wildcard entries (PCI_ANY_ID) should come last
51204 - * Last entry must be all 0s
51205 - *
51206 - * { Vendor ID, Device ID, SubVendor ID, SubDevice ID,
51207 - * Class, Class Mask, private data (not used) }
51208 - */
51209 -static struct pci_device_id atl1c_pci_tbl[] = {
51210 - {PCI_DEVICE(PCI_VENDOR_ID_ATTANSIC, PCI_DEVICE_ID_ATTANSIC_L1C)},
51211 - {PCI_DEVICE(PCI_VENDOR_ID_ATTANSIC, PCI_DEVICE_ID_ATTANSIC_L2C)},
51212 - /* required last entry */
51213 - { 0 }
51214 -};
51215 -MODULE_DEVICE_TABLE(pci, atl1c_pci_tbl);
51216 -
51217 -MODULE_AUTHOR("Jie Yang <jie.yang@atheros.com>");
51218 -MODULE_DESCRIPTION("Atheros 1000M Ethernet Network Driver");
51219 -MODULE_LICENSE("GPL");
51220 -MODULE_VERSION(ATL1C_DRV_VERSION);
51221 -
51222 -static int atl1c_stop_mac(struct atl1c_hw *hw);
51223 -static void atl1c_enable_rx_ctrl(struct atl1c_hw *hw);
51224 -static void atl1c_enable_tx_ctrl(struct atl1c_hw *hw);
51225 -static void atl1c_disable_l0s_l1(struct atl1c_hw *hw);
51226 -static void atl1c_set_aspm(struct atl1c_hw *hw, bool linkup);
51227 -static void atl1c_setup_mac_ctrl(struct atl1c_adapter *adapter);
51228 -static void atl1c_clean_rx_irq(struct atl1c_adapter *adapter, u8 que,
51229 - int *work_done, int work_to_do);
51230 -
51231 -static const u16 atl1c_pay_load_size[] = {
51232 - 128, 256, 512, 1024, 2048, 4096,
51233 -};
51234 -
51235 -static const u16 atl1c_rfd_prod_idx_regs[AT_MAX_RECEIVE_QUEUE] =
51236 -{
51237 - REG_MB_RFD0_PROD_IDX,
51238 - REG_MB_RFD1_PROD_IDX,
51239 - REG_MB_RFD2_PROD_IDX,
51240 - REG_MB_RFD3_PROD_IDX
51241 -};
51242 -
51243 -static const u16 atl1c_rfd_addr_lo_regs[AT_MAX_RECEIVE_QUEUE] =
51244 -{
51245 - REG_RFD0_HEAD_ADDR_LO,
51246 - REG_RFD1_HEAD_ADDR_LO,
51247 - REG_RFD2_HEAD_ADDR_LO,
51248 - REG_RFD3_HEAD_ADDR_LO
51249 -};
51250 -
51251 -static const u16 atl1c_rrd_addr_lo_regs[AT_MAX_RECEIVE_QUEUE] =
51252 -{
51253 - REG_RRD0_HEAD_ADDR_LO,
51254 - REG_RRD1_HEAD_ADDR_LO,
51255 - REG_RRD2_HEAD_ADDR_LO,
51256 - REG_RRD3_HEAD_ADDR_LO
51257 -};
51258 -
51259 -static const u32 atl1c_default_msg = NETIF_MSG_DRV | NETIF_MSG_PROBE |
51260 - NETIF_MSG_LINK | NETIF_MSG_TIMER | NETIF_MSG_IFDOWN | NETIF_MSG_IFUP;
51261 -
51262 -/*
51263 - * atl1c_init_pcie - init PCIE module
51264 - */
51265 -static void atl1c_reset_pcie(struct atl1c_hw *hw, u32 flag)
51266 -{
51267 - u32 data;
51268 - u32 pci_cmd;
51269 - struct pci_dev *pdev = hw->adapter->pdev;
51270 -
51271 - AT_READ_REG(hw, PCI_COMMAND, &pci_cmd);
51272 - pci_cmd &= ~PCI_COMMAND_INTX_DISABLE;
51273 - pci_cmd |= (PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER |
51274 - PCI_COMMAND_IO);
51275 - AT_WRITE_REG(hw, PCI_COMMAND, pci_cmd);
51276 -
51277 - /*
51278 - * Clear any PowerSaveing Settings
51279 - */
51280 - pci_enable_wake(pdev, PCI_D3hot, 0);
51281 - pci_enable_wake(pdev, PCI_D3cold, 0);
51282 -
51283 - /*
51284 - * Mask some pcie error bits
51285 - */
51286 - AT_READ_REG(hw, REG_PCIE_UC_SEVERITY, &data);
51287 - data &= ~PCIE_UC_SERVRITY_DLP;
51288 - data &= ~PCIE_UC_SERVRITY_FCP;
51289 - AT_WRITE_REG(hw, REG_PCIE_UC_SEVERITY, data);
51290 -
51291 - if (flag & ATL1C_PCIE_L0S_L1_DISABLE)
51292 - atl1c_disable_l0s_l1(hw);
51293 - if (flag & ATL1C_PCIE_PHY_RESET)
51294 - AT_WRITE_REG(hw, REG_GPHY_CTRL, GPHY_CTRL_DEFAULT);
51295 - else
51296 - AT_WRITE_REG(hw, REG_GPHY_CTRL,
51297 - GPHY_CTRL_DEFAULT | GPHY_CTRL_EXT_RESET);
51298 -
51299 - msleep(1);
51300 -}
51301 -
51302 -/*
51303 - * atl1c_irq_enable - Enable default interrupt generation settings
51304 - * @adapter: board private structure
51305 - */
51306 -static inline void atl1c_irq_enable(struct atl1c_adapter *adapter)
51307 -{
51308 - if (likely(atomic_dec_and_test(&adapter->irq_sem))) {
51309 - AT_WRITE_REG(&adapter->hw, REG_ISR, 0x7FFFFFFF);
51310 - AT_WRITE_REG(&adapter->hw, REG_IMR, adapter->hw.intr_mask);
51311 - AT_WRITE_FLUSH(&adapter->hw);
51312 - }
51313 -}
51314 -
51315 -/*
51316 - * atl1c_irq_disable - Mask off interrupt generation on the NIC
51317 - * @adapter: board private structure
51318 - */
51319 -static inline void atl1c_irq_disable(struct atl1c_adapter *adapter)
51320 -{
51321 - atomic_inc(&adapter->irq_sem);
51322 - AT_WRITE_REG(&adapter->hw, REG_IMR, 0);
51323 - AT_WRITE_FLUSH(&adapter->hw);
51324 - synchronize_irq(adapter->pdev->irq);
51325 -}
51326 -
51327 -/*
51328 - * atl1c_irq_reset - reset interrupt confiure on the NIC
51329 - * @adapter: board private structure
51330 - */
51331 -static inline void atl1c_irq_reset(struct atl1c_adapter *adapter)
51332 -{
51333 - atomic_set(&adapter->irq_sem, 1);
51334 - atl1c_irq_enable(adapter);
51335 -}
51336 -
51337 -/*
51338 - * atl1c_phy_config - Timer Call-back
51339 - * @data: pointer to netdev cast into an unsigned long
51340 - */
51341 -static void atl1c_phy_config(unsigned long data)
51342 -{
51343 - struct atl1c_adapter *adapter = (struct atl1c_adapter *) data;
51344 - struct atl1c_hw *hw = &adapter->hw;
51345 - unsigned long flags;
51346 -
51347 - spin_lock_irqsave(&adapter->mdio_lock, flags);
51348 - atl1c_restart_autoneg(hw);
51349 - spin_unlock_irqrestore(&adapter->mdio_lock, flags);
51350 -}
51351 -
51352 -void atl1c_reinit_locked(struct atl1c_adapter *adapter)
51353 -{
51354 -
51355 - WARN_ON(in_interrupt());
51356 - atl1c_down(adapter);
51357 - atl1c_up(adapter);
51358 - clear_bit(__AT_RESETTING, &adapter->flags);
51359 -}
51360 -
51361 -static void atl1c_reset_task(struct work_struct *work)
51362 -{
51363 - struct atl1c_adapter *adapter;
51364 - struct net_device *netdev;
51365 -
51366 - adapter = container_of(work, struct atl1c_adapter, reset_task);
51367 - netdev = adapter->netdev;
51368 -
51369 - netif_device_detach(netdev);
51370 - atl1c_down(adapter);
51371 - atl1c_up(adapter);
51372 - netif_device_attach(netdev);
51373 -}
51374 -
51375 -static void atl1c_check_link_status(struct atl1c_adapter *adapter)
51376 -{
51377 - struct atl1c_hw *hw = &adapter->hw;
51378 - struct net_device *netdev = adapter->netdev;
51379 - struct pci_dev *pdev = adapter->pdev;
51380 - int err;
51381 - unsigned long flags;
51382 - u16 speed, duplex, phy_data;
51383 -
51384 - spin_lock_irqsave(&adapter->mdio_lock, flags);
51385 - /* MII_BMSR must read twise */
51386 - atl1c_read_phy_reg(hw, MII_BMSR, &phy_data);
51387 - atl1c_read_phy_reg(hw, MII_BMSR, &phy_data);
51388 - spin_unlock_irqrestore(&adapter->mdio_lock, flags);
51389 -
51390 - if ((phy_data & BMSR_LSTATUS) == 0) {
51391 - /* link down */
51392 - if (netif_carrier_ok(netdev)) {
51393 - hw->hibernate = true;
51394 - atl1c_set_aspm(hw, false);
51395 - if (atl1c_stop_mac(hw) != 0)
51396 - if (netif_msg_hw(adapter))
51397 - dev_warn(&pdev->dev,
51398 - "stop mac failed\n");
51399 - }
51400 - netif_carrier_off(netdev);
51401 - } else {
51402 - /* Link Up */
51403 - hw->hibernate = false;
51404 - spin_lock_irqsave(&adapter->mdio_lock, flags);
51405 - err = atl1c_get_speed_and_duplex(hw, &speed, &duplex);
51406 - spin_unlock_irqrestore(&adapter->mdio_lock, flags);
51407 - if (unlikely(err))
51408 - return;
51409 - /* link result is our setting */
51410 - if (adapter->link_speed != speed ||
51411 - adapter->link_duplex != duplex) {
51412 - adapter->link_speed = speed;
51413 - adapter->link_duplex = duplex;
51414 - atl1c_enable_tx_ctrl(hw);
51415 - atl1c_enable_rx_ctrl(hw);
51416 - atl1c_setup_mac_ctrl(adapter);
51417 - atl1c_set_aspm(hw, true);
51418 - if (netif_msg_link(adapter))
51419 - dev_info(&pdev->dev,
51420 - "%s: %s NIC Link is Up<%d Mbps %s>\n",
51421 - atl1c_driver_name, netdev->name,
51422 - adapter->link_speed,
51423 - adapter->link_duplex == FULL_DUPLEX ?
51424 - "Full Duplex" : "Half Duplex");
51425 - }
51426 - if (!netif_carrier_ok(netdev))
51427 - netif_carrier_on(netdev);
51428 - }
51429 -}
51430 -
51431 -/*
51432 - * atl1c_link_chg_task - deal with link change event Out of interrupt context
51433 - * @netdev: network interface device structure
51434 - */
51435 -static void atl1c_link_chg_task(struct work_struct *work)
51436 -{
51437 - struct atl1c_adapter *adapter;
51438 -
51439 - adapter = container_of(work, struct atl1c_adapter, link_chg_task);
51440 - atl1c_check_link_status(adapter);
51441 -}
51442 -
51443 -static void atl1c_link_chg_event(struct atl1c_adapter *adapter)
51444 -{
51445 - struct net_device *netdev = adapter->netdev;
51446 - struct pci_dev *pdev = adapter->pdev;
51447 - u16 phy_data;
51448 - u16 link_up;
51449 -
51450 - spin_lock(&adapter->mdio_lock);
51451 - atl1c_read_phy_reg(&adapter->hw, MII_BMSR, &phy_data);
51452 - atl1c_read_phy_reg(&adapter->hw, MII_BMSR, &phy_data);
51453 - spin_unlock(&adapter->mdio_lock);
51454 - link_up = phy_data & BMSR_LSTATUS;
51455 - /* notify upper layer link down ASAP */
51456 - if (!link_up) {
51457 - if (netif_carrier_ok(netdev)) {
51458 - /* old link state: Up */
51459 - netif_carrier_off(netdev);
51460 - if (netif_msg_link(adapter))
51461 - dev_info(&pdev->dev,
51462 - "%s: %s NIC Link is Down\n",
51463 - atl1c_driver_name, netdev->name);
51464 - adapter->link_speed = SPEED_0;
51465 - }
51466 - }
51467 - schedule_work(&adapter->link_chg_task);
51468 -}
51469 -
51470 -static void atl1c_del_timer(struct atl1c_adapter *adapter)
51471 -{
51472 - del_timer_sync(&adapter->phy_config_timer);
51473 -}
51474 -
51475 -static void atl1c_cancel_work(struct atl1c_adapter *adapter)
51476 -{
51477 - cancel_work_sync(&adapter->reset_task);
51478 - cancel_work_sync(&adapter->link_chg_task);
51479 -}
51480 -
51481 -/*
51482 - * atl1c_tx_timeout - Respond to a Tx Hang
51483 - * @netdev: network interface device structure
51484 - */
51485 -static void atl1c_tx_timeout(struct net_device *netdev)
51486 -{
51487 - struct atl1c_adapter *adapter = netdev_priv(netdev);
51488 -
51489 - /* Do the reset outside of interrupt context */
51490 - schedule_work(&adapter->reset_task);
51491 -}
51492 -
51493 -/*
51494 - * atl1c_set_multi - Multicast and Promiscuous mode set
51495 - * @netdev: network interface device structure
51496 - *
51497 - * The set_multi entry point is called whenever the multicast address
51498 - * list or the network interface flags are updated. This routine is
51499 - * responsible for configuring the hardware for proper multicast,
51500 - * promiscuous mode, and all-multi behavior.
51501 - */
51502 -static void atl1c_set_multi(struct net_device *netdev)
51503 -{
51504 - struct atl1c_adapter *adapter = netdev_priv(netdev);
51505 - struct atl1c_hw *hw = &adapter->hw;
51506 - struct dev_mc_list *mc_ptr;
51507 - u32 mac_ctrl_data;
51508 - u32 hash_value;
51509 -
51510 - /* Check for Promiscuous and All Multicast modes */
51511 - AT_READ_REG(hw, REG_MAC_CTRL, &mac_ctrl_data);
51512 -
51513 - if (netdev->flags & IFF_PROMISC) {
51514 - mac_ctrl_data |= MAC_CTRL_PROMIS_EN;
51515 - } else if (netdev->flags & IFF_ALLMULTI) {
51516 - mac_ctrl_data |= MAC_CTRL_MC_ALL_EN;
51517 - mac_ctrl_data &= ~MAC_CTRL_PROMIS_EN;
51518 - } else {
51519 - mac_ctrl_data &= ~(MAC_CTRL_PROMIS_EN | MAC_CTRL_MC_ALL_EN);
51520 - }
51521 -
51522 - AT_WRITE_REG(hw, REG_MAC_CTRL, mac_ctrl_data);
51523 -
51524 - /* clear the old settings from the multicast hash table */
51525 - AT_WRITE_REG(hw, REG_RX_HASH_TABLE, 0);
51526 - AT_WRITE_REG_ARRAY(hw, REG_RX_HASH_TABLE, 1, 0);
51527 -
51528 - /* comoute mc addresses' hash value ,and put it into hash table */
51529 - for (mc_ptr = netdev->mc_list; mc_ptr; mc_ptr = mc_ptr->next) {
51530 - hash_value = atl1c_hash_mc_addr(hw, mc_ptr->dmi_addr);
51531 - atl1c_hash_set(hw, hash_value);
51532 - }
51533 -}
51534 -
51535 -static void atl1c_vlan_rx_register(struct net_device *netdev,
51536 - struct vlan_group *grp)
51537 -{
51538 - struct atl1c_adapter *adapter = netdev_priv(netdev);
51539 - struct pci_dev *pdev = adapter->pdev;
51540 - u32 mac_ctrl_data = 0;
51541 -
51542 - if (netif_msg_pktdata(adapter))
51543 - dev_dbg(&pdev->dev, "atl1c_vlan_rx_register\n");
51544 -
51545 - atl1c_irq_disable(adapter);
51546 -
51547 - adapter->vlgrp = grp;
51548 - AT_READ_REG(&adapter->hw, REG_MAC_CTRL, &mac_ctrl_data);
51549 -
51550 - if (grp) {
51551 - /* enable VLAN tag insert/strip */
51552 - mac_ctrl_data |= MAC_CTRL_RMV_VLAN;
51553 - } else {
51554 - /* disable VLAN tag insert/strip */
51555 - mac_ctrl_data &= ~MAC_CTRL_RMV_VLAN;
51556 - }
51557 -
51558 - AT_WRITE_REG(&adapter->hw, REG_MAC_CTRL, mac_ctrl_data);
51559 - atl1c_irq_enable(adapter);
51560 -}
51561 -
51562 -static void atl1c_restore_vlan(struct atl1c_adapter *adapter)
51563 -{
51564 - struct pci_dev *pdev = adapter->pdev;
51565 -
51566 - if (netif_msg_pktdata(adapter))
51567 - dev_dbg(&pdev->dev, "atl1c_restore_vlan !");
51568 - atl1c_vlan_rx_register(adapter->netdev, adapter->vlgrp);
51569 -}
51570 -/*
51571 - * atl1c_set_mac - Change the Ethernet Address of the NIC
51572 - * @netdev: network interface device structure
51573 - * @p: pointer to an address structure
51574 - *
51575 - * Returns 0 on success, negative on failure
51576 - */
51577 -static int atl1c_set_mac_addr(struct net_device *netdev, void *p)
51578 -{
51579 - struct atl1c_adapter *adapter = netdev_priv(netdev);
51580 - struct sockaddr *addr = p;
51581 -
51582 - if (!is_valid_ether_addr(addr->sa_data))
51583 - return -EADDRNOTAVAIL;
51584 -
51585 - if (netif_running(netdev))
51586 - return -EBUSY;
51587 -
51588 - memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
51589 - memcpy(adapter->hw.mac_addr, addr->sa_data, netdev->addr_len);
51590 -
51591 - atl1c_hw_set_mac_addr(&adapter->hw);
51592 -
51593 - return 0;
51594 -}
51595 -
51596 -static void atl1c_set_rxbufsize(struct atl1c_adapter *adapter,
51597 - struct net_device *dev)
51598 -{
51599 - int mtu = dev->mtu;
51600 -
51601 - adapter->rx_buffer_len = mtu > AT_RX_BUF_SIZE ?
51602 - roundup(mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN, 8) : AT_RX_BUF_SIZE;
51603 -}
51604 -/*
51605 - * atl1c_change_mtu - Change the Maximum Transfer Unit
51606 - * @netdev: network interface device structure
51607 - * @new_mtu: new value for maximum frame size
51608 - *
51609 - * Returns 0 on success, negative on failure
51610 - */
51611 -static int atl1c_change_mtu(struct net_device *netdev, int new_mtu)
51612 -{
51613 - struct atl1c_adapter *adapter = netdev_priv(netdev);
51614 - int old_mtu = netdev->mtu;
51615 - int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN;
51616 -
51617 - if ((max_frame < ETH_ZLEN + ETH_FCS_LEN) ||
51618 - (max_frame > MAX_JUMBO_FRAME_SIZE)) {
51619 - if (netif_msg_link(adapter))
51620 - dev_warn(&adapter->pdev->dev, "invalid MTU setting\n");
51621 - return -EINVAL;
51622 - }
51623 - /* set MTU */
51624 - if (old_mtu != new_mtu && netif_running(netdev)) {
51625 - while (test_and_set_bit(__AT_RESETTING, &adapter->flags))
51626 - msleep(1);
51627 - netdev->mtu = new_mtu;
51628 - adapter->hw.max_frame_size = new_mtu;
51629 - atl1c_set_rxbufsize(adapter, netdev);
51630 - atl1c_down(adapter);
51631 - atl1c_up(adapter);
51632 - clear_bit(__AT_RESETTING, &adapter->flags);
51633 - if (adapter->hw.ctrl_flags & ATL1C_FPGA_VERSION) {
51634 - u32 phy_data;
51635 -
51636 - AT_READ_REG(&adapter->hw, 0x1414, &phy_data);
51637 - phy_data |= 0x10000000;
51638 - AT_WRITE_REG(&adapter->hw, 0x1414, phy_data);
51639 - }
51640 -
51641 - }
51642 - return 0;
51643 -}
51644 -
51645 -/*
51646 - * caller should hold mdio_lock
51647 - */
51648 -static int atl1c_mdio_read(struct net_device *netdev, int phy_id, int reg_num)
51649 -{
51650 - struct atl1c_adapter *adapter = netdev_priv(netdev);
51651 - u16 result;
51652 -
51653 - atl1c_read_phy_reg(&adapter->hw, reg_num & MDIO_REG_ADDR_MASK, &result);
51654 - return result;
51655 -}
51656 -
51657 -static void atl1c_mdio_write(struct net_device *netdev, int phy_id,
51658 - int reg_num, int val)
51659 -{
51660 - struct atl1c_adapter *adapter = netdev_priv(netdev);
51661 -
51662 - atl1c_write_phy_reg(&adapter->hw, reg_num & MDIO_REG_ADDR_MASK, val);
51663 -}
51664 -
51665 -/*
51666 - * atl1c_mii_ioctl -
51667 - * @netdev:
51668 - * @ifreq:
51669 - * @cmd:
51670 - */
51671 -static int atl1c_mii_ioctl(struct net_device *netdev,
51672 - struct ifreq *ifr, int cmd)
51673 -{
51674 - struct atl1c_adapter *adapter = netdev_priv(netdev);
51675 - struct pci_dev *pdev = adapter->pdev;
51676 - struct mii_ioctl_data *data = if_mii(ifr);
51677 - unsigned long flags;
51678 - int retval = 0;
51679 -
51680 - if (!netif_running(netdev))
51681 - return -EINVAL;
51682 -
51683 - spin_lock_irqsave(&adapter->mdio_lock, flags);
51684 - switch (cmd) {
51685 - case SIOCGMIIPHY:
51686 - data->phy_id = 0;
51687 - break;
51688 -
51689 - case SIOCGMIIREG:
51690 - if (!capable(CAP_NET_ADMIN)) {
51691 - retval = -EPERM;
51692 - goto out;
51693 - }
51694 - if (atl1c_read_phy_reg(&adapter->hw, data->reg_num & 0x1F,
51695 - &data->val_out)) {
51696 - retval = -EIO;
51697 - goto out;
51698 - }
51699 - break;
51700 -
51701 - case SIOCSMIIREG:
51702 - if (!capable(CAP_NET_ADMIN)) {
51703 - retval = -EPERM;
51704 - goto out;
51705 - }
51706 - if (data->reg_num & ~(0x1F)) {
51707 - retval = -EFAULT;
51708 - goto out;
51709 - }
51710 -
51711 - dev_dbg(&pdev->dev, "<atl1c_mii_ioctl> write %x %x",
51712 - data->reg_num, data->val_in);
51713 - if (atl1c_write_phy_reg(&adapter->hw,
51714 - data->reg_num, data->val_in)) {
51715 - retval = -EIO;
51716 - goto out;
51717 - }
51718 - break;
51719 -
51720 - default:
51721 - retval = -EOPNOTSUPP;
51722 - break;
51723 - }
51724 -out:
51725 - spin_unlock_irqrestore(&adapter->mdio_lock, flags);
51726 - return retval;
51727 -}
51728 -
51729 -/*
51730 - * atl1c_ioctl -
51731 - * @netdev:
51732 - * @ifreq:
51733 - * @cmd:
51734 - */
51735 -static int atl1c_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
51736 -{
51737 - switch (cmd) {
51738 - case SIOCGMIIPHY:
51739 - case SIOCGMIIREG:
51740 - case SIOCSMIIREG:
51741 - return atl1c_mii_ioctl(netdev, ifr, cmd);
51742 - default:
51743 - return -EOPNOTSUPP;
51744 - }
51745 -}
51746 -
51747 -/*
51748 - * atl1c_alloc_queues - Allocate memory for all rings
51749 - * @adapter: board private structure to initialize
51750 - *
51751 - */
51752 -static int __devinit atl1c_alloc_queues(struct atl1c_adapter *adapter)
51753 -{
51754 - return 0;
51755 -}
51756 -
51757 -static void atl1c_set_mac_type(struct atl1c_hw *hw)
51758 -{
51759 - switch (hw->device_id) {
51760 - case PCI_DEVICE_ID_ATTANSIC_L2C:
51761 - hw->nic_type = athr_l2c;
51762 - break;
51763 -
51764 - case PCI_DEVICE_ID_ATTANSIC_L1C:
51765 - hw->nic_type = athr_l1c;
51766 - break;
51767 -
51768 - default:
51769 - break;
51770 - }
51771 -}
51772 -
51773 -static int atl1c_setup_mac_funcs(struct atl1c_hw *hw)
51774 -{
51775 - u32 phy_status_data;
51776 - u32 link_ctrl_data;
51777 -
51778 - atl1c_set_mac_type(hw);
51779 - AT_READ_REG(hw, REG_PHY_STATUS, &phy_status_data);
51780 - AT_READ_REG(hw, REG_LINK_CTRL, &link_ctrl_data);
51781 -
51782 - hw->ctrl_flags = ATL1C_INTR_CLEAR_ON_READ |
51783 - ATL1C_INTR_MODRT_ENABLE |
51784 - ATL1C_RX_IPV6_CHKSUM |
51785 - ATL1C_TXQ_MODE_ENHANCE;
51786 - if (link_ctrl_data & LINK_CTRL_L0S_EN)
51787 - hw->ctrl_flags |= ATL1C_ASPM_L0S_SUPPORT;
51788 - if (link_ctrl_data & LINK_CTRL_L1_EN)
51789 - hw->ctrl_flags |= ATL1C_ASPM_L1_SUPPORT;
51790 -
51791 - if (hw->nic_type == athr_l1c) {
51792 - hw->ctrl_flags |= ATL1C_ASPM_CTRL_MON;
51793 - hw->ctrl_flags |= ATL1C_LINK_CAP_1000M;
51794 - }
51795 - return 0;
51796 -}
51797 -/*
51798 - * atl1c_sw_init - Initialize general software structures (struct atl1c_adapter)
51799 - * @adapter: board private structure to initialize
51800 - *
51801 - * atl1c_sw_init initializes the Adapter private data structure.
51802 - * Fields are initialized based on PCI device information and
51803 - * OS network device settings (MTU size).
51804 - */
51805 -static int __devinit atl1c_sw_init(struct atl1c_adapter *adapter)
51806 -{
51807 - struct atl1c_hw *hw = &adapter->hw;
51808 - struct pci_dev *pdev = adapter->pdev;
51809 -
51810 - adapter->wol = 0;
51811 - adapter->link_speed = SPEED_0;
51812 - adapter->link_duplex = FULL_DUPLEX;
51813 - adapter->num_rx_queues = AT_DEF_RECEIVE_QUEUE;
51814 - adapter->tpd_ring[0].count = 1024;
51815 - adapter->rfd_ring[0].count = 512;
51816 -
51817 - hw->vendor_id = pdev->vendor;
51818 - hw->device_id = pdev->device;
51819 - hw->subsystem_vendor_id = pdev->subsystem_vendor;
51820 - hw->subsystem_id = pdev->subsystem_device;
51821 -
51822 - /* before link up, we assume hibernate is true */
51823 - hw->hibernate = true;
51824 - hw->media_type = MEDIA_TYPE_AUTO_SENSOR;
51825 - if (atl1c_setup_mac_funcs(hw) != 0) {
51826 - dev_err(&pdev->dev, "set mac function pointers failed\n");
51827 - return -1;
51828 - }
51829 - hw->intr_mask = IMR_NORMAL_MASK;
51830 - hw->phy_configured = false;
51831 - hw->preamble_len = 7;
51832 - hw->max_frame_size = adapter->netdev->mtu;
51833 - if (adapter->num_rx_queues < 2) {
51834 - hw->rss_type = atl1c_rss_disable;
51835 - hw->rss_mode = atl1c_rss_mode_disable;
51836 - } else {
51837 - hw->rss_type = atl1c_rss_ipv4;
51838 - hw->rss_mode = atl1c_rss_mul_que_mul_int;
51839 - hw->rss_hash_bits = 16;
51840 - }
51841 - hw->autoneg_advertised = ADVERTISED_Autoneg;
51842 - hw->indirect_tab = 0xE4E4E4E4;
51843 - hw->base_cpu = 0;
51844 -
51845 - hw->ict = 50000; /* 100ms */
51846 - hw->smb_timer = 200000; /* 400ms */
51847 - hw->cmb_tpd = 4;
51848 - hw->cmb_tx_timer = 1; /* 2 us */
51849 - hw->rx_imt = 200;
51850 - hw->tx_imt = 1000;
51851 -
51852 - hw->tpd_burst = 5;
51853 - hw->rfd_burst = 8;
51854 - hw->dma_order = atl1c_dma_ord_out;
51855 - hw->dmar_block = atl1c_dma_req_1024;
51856 - hw->dmaw_block = atl1c_dma_req_1024;
51857 - hw->dmar_dly_cnt = 15;
51858 - hw->dmaw_dly_cnt = 4;
51859 -
51860 - if (atl1c_alloc_queues(adapter)) {
51861 - dev_err(&pdev->dev, "Unable to allocate memory for queues\n");
51862 - return -ENOMEM;
51863 - }
51864 - /* TODO */
51865 - atl1c_set_rxbufsize(adapter, adapter->netdev);
51866 - atomic_set(&adapter->irq_sem, 1);
51867 - spin_lock_init(&adapter->mdio_lock);
51868 - spin_lock_init(&adapter->tx_lock);
51869 - set_bit(__AT_DOWN, &adapter->flags);
51870 -
51871 - return 0;
51872 -}
51873 -
51874 -/*
51875 - * atl1c_clean_tx_ring - Free Tx-skb
51876 - * @adapter: board private structure
51877 - */
51878 -static void atl1c_clean_tx_ring(struct atl1c_adapter *adapter,
51879 - enum atl1c_trans_queue type)
51880 -{
51881 - struct atl1c_tpd_ring *tpd_ring = &adapter->tpd_ring[type];
51882 - struct atl1c_buffer *buffer_info;
51883 - struct pci_dev *pdev = adapter->pdev;
51884 - u16 index, ring_count;
51885 -
51886 - ring_count = tpd_ring->count;
51887 - for (index = 0; index < ring_count; index++) {
51888 - buffer_info = &tpd_ring->buffer_info[index];
51889 - if (buffer_info->state == ATL1_BUFFER_FREE)
51890 - continue;
51891 - if (buffer_info->dma)
51892 - pci_unmap_single(pdev, buffer_info->dma,
51893 - buffer_info->length,
51894 - PCI_DMA_TODEVICE);
51895 - if (buffer_info->skb)
51896 - dev_kfree_skb(buffer_info->skb);
51897 - buffer_info->dma = 0;
51898 - buffer_info->skb = NULL;
51899 - buffer_info->state = ATL1_BUFFER_FREE;
51900 - }
51901 -
51902 - /* Zero out Tx-buffers */
51903 - memset(tpd_ring->desc, 0, sizeof(struct atl1c_tpd_desc) *
51904 - ring_count);
51905 - atomic_set(&tpd_ring->next_to_clean, 0);
51906 - tpd_ring->next_to_use = 0;
51907 -}
51908 -
51909 -/*
51910 - * atl1c_clean_rx_ring - Free rx-reservation skbs
51911 - * @adapter: board private structure
51912 - */
51913 -static void atl1c_clean_rx_ring(struct atl1c_adapter *adapter)
51914 -{
51915 - struct atl1c_rfd_ring *rfd_ring = adapter->rfd_ring;
51916 - struct atl1c_rrd_ring *rrd_ring = adapter->rrd_ring;
51917 - struct atl1c_buffer *buffer_info;
51918 - struct pci_dev *pdev = adapter->pdev;
51919 - int i, j;
51920 -
51921 - for (i = 0; i < adapter->num_rx_queues; i++) {
51922 - for (j = 0; j < rfd_ring[i].count; j++) {
51923 - buffer_info = &rfd_ring[i].buffer_info[j];
51924 - if (buffer_info->state == ATL1_BUFFER_FREE)
51925 - continue;
51926 - if (buffer_info->dma)
51927 - pci_unmap_single(pdev, buffer_info->dma,
51928 - buffer_info->length,
51929 - PCI_DMA_FROMDEVICE);
51930 - if (buffer_info->skb)
51931 - dev_kfree_skb(buffer_info->skb);
51932 - buffer_info->state = ATL1_BUFFER_FREE;
51933 - buffer_info->skb = NULL;
51934 - }
51935 - /* zero out the descriptor ring */
51936 - memset(rfd_ring[i].desc, 0, rfd_ring[i].size);
51937 - rfd_ring[i].next_to_clean = 0;
51938 - rfd_ring[i].next_to_use = 0;
51939 - rrd_ring[i].next_to_use = 0;
51940 - rrd_ring[i].next_to_clean = 0;
51941 - }
51942 -}
51943 -
51944 -/*
51945 - * Read / Write Ptr Initialize:
51946 - */
51947 -static void atl1c_init_ring_ptrs(struct atl1c_adapter *adapter)
51948 -{
51949 - struct atl1c_tpd_ring *tpd_ring = adapter->tpd_ring;
51950 - struct atl1c_rfd_ring *rfd_ring = adapter->rfd_ring;
51951 - struct atl1c_rrd_ring *rrd_ring = adapter->rrd_ring;
51952 - struct atl1c_buffer *buffer_info;
51953 - int i, j;
51954 -
51955 - for (i = 0; i < AT_MAX_TRANSMIT_QUEUE; i++) {
51956 - tpd_ring[i].next_to_use = 0;
51957 - atomic_set(&tpd_ring[i].next_to_clean, 0);
51958 - buffer_info = tpd_ring[i].buffer_info;
51959 - for (j = 0; j < tpd_ring->count; j++)
51960 - buffer_info[i].state = ATL1_BUFFER_FREE;
51961 - }
51962 - for (i = 0; i < adapter->num_rx_queues; i++) {
51963 - rfd_ring[i].next_to_use = 0;
51964 - rfd_ring[i].next_to_clean = 0;
51965 - rrd_ring[i].next_to_use = 0;
51966 - rrd_ring[i].next_to_clean = 0;
51967 - for (j = 0; j < rfd_ring[i].count; j++) {
51968 - buffer_info = &rfd_ring[i].buffer_info[j];
51969 - buffer_info->state = ATL1_BUFFER_FREE;
51970 - }
51971 - }
51972 -}
51973 -
51974 -/*
51975 - * atl1c_free_ring_resources - Free Tx / RX descriptor Resources
51976 - * @adapter: board private structure
51977 - *
51978 - * Free all transmit software resources
51979 - */
51980 -static void atl1c_free_ring_resources(struct atl1c_adapter *adapter)
51981 -{
51982 - struct pci_dev *pdev = adapter->pdev;
51983 -
51984 - pci_free_consistent(pdev, adapter->ring_header.size,
51985 - adapter->ring_header.desc,
51986 - adapter->ring_header.dma);
51987 - adapter->ring_header.desc = NULL;
51988 -
51989 - /* Note: just free tdp_ring.buffer_info,
51990 - * it contain rfd_ring.buffer_info, do not double free */
51991 - if (adapter->tpd_ring[0].buffer_info) {
51992 - kfree(adapter->tpd_ring[0].buffer_info);
51993 - adapter->tpd_ring[0].buffer_info = NULL;
51994 - }
51995 -}
51996 -
51997 -/*
51998 - * atl1c_setup_mem_resources - allocate Tx / RX descriptor resources
51999 - * @adapter: board private structure
52000 - *
52001 - * Return 0 on success, negative on failure
52002 - */
52003 -static int atl1c_setup_ring_resources(struct atl1c_adapter *adapter)
52004 -{
52005 - struct pci_dev *pdev = adapter->pdev;
52006 - struct atl1c_tpd_ring *tpd_ring = adapter->tpd_ring;
52007 - struct atl1c_rfd_ring *rfd_ring = adapter->rfd_ring;
52008 - struct atl1c_rrd_ring *rrd_ring = adapter->rrd_ring;
52009 - struct atl1c_ring_header *ring_header = &adapter->ring_header;
52010 - int num_rx_queues = adapter->num_rx_queues;
52011 - int size;
52012 - int i;
52013 - int count = 0;
52014 - int rx_desc_count = 0;
52015 - u32 offset = 0;
52016 -
52017 - rrd_ring[0].count = rfd_ring[0].count;
52018 - for (i = 1; i < AT_MAX_TRANSMIT_QUEUE; i++)
52019 - tpd_ring[i].count = tpd_ring[0].count;
52020 -
52021 - for (i = 1; i < adapter->num_rx_queues; i++)
52022 - rfd_ring[i].count = rrd_ring[i].count = rfd_ring[0].count;
52023 -
52024 - /* 2 tpd queue, one high priority queue,
52025 - * another normal priority queue */
52026 - size = sizeof(struct atl1c_buffer) * (tpd_ring->count * 2 +
52027 - rfd_ring->count * num_rx_queues);
52028 - tpd_ring->buffer_info = kzalloc(size, GFP_KERNEL);
52029 - if (unlikely(!tpd_ring->buffer_info)) {
52030 - dev_err(&pdev->dev, "kzalloc failed, size = %d\n",
52031 - size);
52032 - goto err_nomem;
52033 - }
52034 - for (i = 0; i < AT_MAX_TRANSMIT_QUEUE; i++) {
52035 - tpd_ring[i].buffer_info =
52036 - (struct atl1c_buffer *) (tpd_ring->buffer_info + count);
52037 - count += tpd_ring[i].count;
52038 - }
52039 -
52040 - for (i = 0; i < num_rx_queues; i++) {
52041 - rfd_ring[i].buffer_info =
52042 - (struct atl1c_buffer *) (tpd_ring->buffer_info + count);
52043 - count += rfd_ring[i].count;
52044 - rx_desc_count += rfd_ring[i].count;
52045 - }
52046 - /*
52047 - * real ring DMA buffer
52048 - * each ring/block may need up to 8 bytes for alignment, hence the
52049 - * additional bytes tacked onto the end.
52050 - */
52051 - ring_header->size = size =
52052 - sizeof(struct atl1c_tpd_desc) * tpd_ring->count * 2 +
52053 - sizeof(struct atl1c_rx_free_desc) * rx_desc_count +
52054 - sizeof(struct atl1c_recv_ret_status) * rx_desc_count +
52055 - sizeof(struct atl1c_hw_stats) +
52056 - 8 * 4 + 8 * 2 * num_rx_queues;
52057 -
52058 - ring_header->desc = pci_alloc_consistent(pdev, ring_header->size,
52059 - &ring_header->dma);
52060 - if (unlikely(!ring_header->desc)) {
52061 - dev_err(&pdev->dev, "pci_alloc_consistend failed\n");
52062 - goto err_nomem;
52063 - }
52064 - memset(ring_header->desc, 0, ring_header->size);
52065 - /* init TPD ring */
52066 -
52067 - tpd_ring[0].dma = roundup(ring_header->dma, 8);
52068 - offset = tpd_ring[0].dma - ring_header->dma;
52069 - for (i = 0; i < AT_MAX_TRANSMIT_QUEUE; i++) {
52070 - tpd_ring[i].dma = ring_header->dma + offset;
52071 - tpd_ring[i].desc = (u8 *) ring_header->desc + offset;
52072 - tpd_ring[i].size =
52073 - sizeof(struct atl1c_tpd_desc) * tpd_ring[i].count;
52074 - offset += roundup(tpd_ring[i].size, 8);
52075 - }
52076 - /* init RFD ring */
52077 - for (i = 0; i < num_rx_queues; i++) {
52078 - rfd_ring[i].dma = ring_header->dma + offset;
52079 - rfd_ring[i].desc = (u8 *) ring_header->desc + offset;
52080 - rfd_ring[i].size = sizeof(struct atl1c_rx_free_desc) *
52081 - rfd_ring[i].count;
52082 - offset += roundup(rfd_ring[i].size, 8);
52083 - }
52084 -
52085 - /* init RRD ring */
52086 - for (i = 0; i < num_rx_queues; i++) {
52087 - rrd_ring[i].dma = ring_header->dma + offset;
52088 - rrd_ring[i].desc = (u8 *) ring_header->desc + offset;
52089 - rrd_ring[i].size = sizeof(struct atl1c_recv_ret_status) *
52090 - rrd_ring[i].count;
52091 - offset += roundup(rrd_ring[i].size, 8);
52092 - }
52093 -
52094 - adapter->smb.dma = ring_header->dma + offset;
52095 - adapter->smb.smb = (u8 *)ring_header->desc + offset;
52096 - return 0;
52097 -
52098 -err_nomem:
52099 - kfree(tpd_ring->buffer_info);
52100 - return -ENOMEM;
52101 -}
52102 -
52103 -static void atl1c_configure_des_ring(struct atl1c_adapter *adapter)
52104 -{
52105 - struct atl1c_hw *hw = &adapter->hw;
52106 - struct atl1c_rfd_ring *rfd_ring = (struct atl1c_rfd_ring *)
52107 - adapter->rfd_ring;
52108 - struct atl1c_rrd_ring *rrd_ring = (struct atl1c_rrd_ring *)
52109 - adapter->rrd_ring;
52110 - struct atl1c_tpd_ring *tpd_ring = (struct atl1c_tpd_ring *)
52111 - adapter->tpd_ring;
52112 - struct atl1c_cmb *cmb = (struct atl1c_cmb *) &adapter->cmb;
52113 - struct atl1c_smb *smb = (struct atl1c_smb *) &adapter->smb;
52114 - int i;
52115 -
52116 - /* TPD */
52117 - AT_WRITE_REG(hw, REG_TX_BASE_ADDR_HI,
52118 - (u32)((tpd_ring[atl1c_trans_normal].dma &
52119 - AT_DMA_HI_ADDR_MASK) >> 32));
52120 - /* just enable normal priority TX queue */
52121 - AT_WRITE_REG(hw, REG_NTPD_HEAD_ADDR_LO,
52122 - (u32)(tpd_ring[atl1c_trans_normal].dma &
52123 - AT_DMA_LO_ADDR_MASK));
52124 - AT_WRITE_REG(hw, REG_HTPD_HEAD_ADDR_LO,
52125 - (u32)(tpd_ring[atl1c_trans_high].dma &
52126 - AT_DMA_LO_ADDR_MASK));
52127 - AT_WRITE_REG(hw, REG_TPD_RING_SIZE,
52128 - (u32)(tpd_ring[0].count & TPD_RING_SIZE_MASK));
52129 -
52130 -
52131 - /* RFD */
52132 - AT_WRITE_REG(hw, REG_RX_BASE_ADDR_HI,
52133 - (u32)((rfd_ring[0].dma & AT_DMA_HI_ADDR_MASK) >> 32));
52134 - for (i = 0; i < adapter->num_rx_queues; i++)
52135 - AT_WRITE_REG(hw, atl1c_rfd_addr_lo_regs[i],
52136 - (u32)(rfd_ring[i].dma & AT_DMA_LO_ADDR_MASK));
52137 -
52138 - AT_WRITE_REG(hw, REG_RFD_RING_SIZE,
52139 - rfd_ring[0].count & RFD_RING_SIZE_MASK);
52140 - AT_WRITE_REG(hw, REG_RX_BUF_SIZE,
52141 - adapter->rx_buffer_len & RX_BUF_SIZE_MASK);
52142 -
52143 - /* RRD */
52144 - for (i = 0; i < adapter->num_rx_queues; i++)
52145 - AT_WRITE_REG(hw, atl1c_rrd_addr_lo_regs[i],
52146 - (u32)(rrd_ring[i].dma & AT_DMA_LO_ADDR_MASK));
52147 - AT_WRITE_REG(hw, REG_RRD_RING_SIZE,
52148 - (rrd_ring[0].count & RRD_RING_SIZE_MASK));
52149 -
52150 - /* CMB */
52151 - AT_WRITE_REG(hw, REG_CMB_BASE_ADDR_LO, cmb->dma & AT_DMA_LO_ADDR_MASK);
52152 -
52153 - /* SMB */
52154 - AT_WRITE_REG(hw, REG_SMB_BASE_ADDR_HI,
52155 - (u32)((smb->dma & AT_DMA_HI_ADDR_MASK) >> 32));
52156 - AT_WRITE_REG(hw, REG_SMB_BASE_ADDR_LO,
52157 - (u32)(smb->dma & AT_DMA_LO_ADDR_MASK));
52158 - /* Load all of base address above */
52159 - AT_WRITE_REG(hw, REG_LOAD_PTR, 1);
52160 -}
52161 -
52162 -static void atl1c_configure_tx(struct atl1c_adapter *adapter)
52163 -{
52164 - struct atl1c_hw *hw = &adapter->hw;
52165 - u32 dev_ctrl_data;
52166 - u32 max_pay_load;
52167 - u16 tx_offload_thresh;
52168 - u32 txq_ctrl_data;
52169 - u32 extra_size = 0; /* Jumbo frame threshold in QWORD unit */
52170 -
52171 - extra_size = ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN;
52172 - tx_offload_thresh = MAX_TX_OFFLOAD_THRESH;
52173 - AT_WRITE_REG(hw, REG_TX_TSO_OFFLOAD_THRESH,
52174 - (tx_offload_thresh >> 3) & TX_TSO_OFFLOAD_THRESH_MASK);
52175 - AT_READ_REG(hw, REG_DEVICE_CTRL, &dev_ctrl_data);
52176 - max_pay_load = (dev_ctrl_data >> DEVICE_CTRL_MAX_PAYLOAD_SHIFT) &
52177 - DEVICE_CTRL_MAX_PAYLOAD_MASK;
52178 - hw->dmaw_block = min(max_pay_load, hw->dmaw_block);
52179 - max_pay_load = (dev_ctrl_data >> DEVICE_CTRL_MAX_RREQ_SZ_SHIFT) &
52180 - DEVICE_CTRL_MAX_RREQ_SZ_MASK;
52181 - hw->dmar_block = min(max_pay_load, hw->dmar_block);
52182 -
52183 - txq_ctrl_data = (hw->tpd_burst & TXQ_NUM_TPD_BURST_MASK) <<
52184 - TXQ_NUM_TPD_BURST_SHIFT;
52185 - if (hw->ctrl_flags & ATL1C_TXQ_MODE_ENHANCE)
52186 - txq_ctrl_data |= TXQ_CTRL_ENH_MODE;
52187 - txq_ctrl_data |= (atl1c_pay_load_size[hw->dmar_block] &
52188 - TXQ_TXF_BURST_NUM_MASK) << TXQ_TXF_BURST_NUM_SHIFT;
52189 -
52190 - AT_WRITE_REG(hw, REG_TXQ_CTRL, txq_ctrl_data);
52191 -}
52192 -
52193 -static void atl1c_configure_rx(struct atl1c_adapter *adapter)
52194 -{
52195 - struct atl1c_hw *hw = &adapter->hw;
52196 - u32 rxq_ctrl_data;
52197 -
52198 - rxq_ctrl_data = (hw->rfd_burst & RXQ_RFD_BURST_NUM_MASK) <<
52199 - RXQ_RFD_BURST_NUM_SHIFT;
52200 -
52201 - if (hw->ctrl_flags & ATL1C_RX_IPV6_CHKSUM)
52202 - rxq_ctrl_data |= IPV6_CHKSUM_CTRL_EN;
52203 - if (hw->rss_type == atl1c_rss_ipv4)
52204 - rxq_ctrl_data |= RSS_HASH_IPV4;
52205 - if (hw->rss_type == atl1c_rss_ipv4_tcp)
52206 - rxq_ctrl_data |= RSS_HASH_IPV4_TCP;
52207 - if (hw->rss_type == atl1c_rss_ipv6)
52208 - rxq_ctrl_data |= RSS_HASH_IPV6;
52209 - if (hw->rss_type == atl1c_rss_ipv6_tcp)
52210 - rxq_ctrl_data |= RSS_HASH_IPV6_TCP;
52211 - if (hw->rss_type != atl1c_rss_disable)
52212 - rxq_ctrl_data |= RRS_HASH_CTRL_EN;
52213 -
52214 - rxq_ctrl_data |= (hw->rss_mode & RSS_MODE_MASK) <<
52215 - RSS_MODE_SHIFT;
52216 - rxq_ctrl_data |= (hw->rss_hash_bits & RSS_HASH_BITS_MASK) <<
52217 - RSS_HASH_BITS_SHIFT;
52218 - if (hw->ctrl_flags & ATL1C_ASPM_CTRL_MON)
52219 - rxq_ctrl_data |= (ASPM_THRUPUT_LIMIT_100M &
52220 - ASPM_THRUPUT_LIMIT_MASK) << ASPM_THRUPUT_LIMIT_SHIFT;
52221 -
52222 - AT_WRITE_REG(hw, REG_RXQ_CTRL, rxq_ctrl_data);
52223 -}
52224 -
52225 -static void atl1c_configure_rss(struct atl1c_adapter *adapter)
52226 -{
52227 - struct atl1c_hw *hw = &adapter->hw;
52228 -
52229 - AT_WRITE_REG(hw, REG_IDT_TABLE, hw->indirect_tab);
52230 - AT_WRITE_REG(hw, REG_BASE_CPU_NUMBER, hw->base_cpu);
52231 -}
52232 -
52233 -static void atl1c_configure_dma(struct atl1c_adapter *adapter)
52234 -{
52235 - struct atl1c_hw *hw = &adapter->hw;
52236 - u32 dma_ctrl_data;
52237 -
52238 - dma_ctrl_data = DMA_CTRL_DMAR_REQ_PRI;
52239 - if (hw->ctrl_flags & ATL1C_CMB_ENABLE)
52240 - dma_ctrl_data |= DMA_CTRL_CMB_EN;
52241 - if (hw->ctrl_flags & ATL1C_SMB_ENABLE)
52242 - dma_ctrl_data |= DMA_CTRL_SMB_EN;
52243 - else
52244 - dma_ctrl_data |= MAC_CTRL_SMB_DIS;
52245 -
52246 - switch (hw->dma_order) {
52247 - case atl1c_dma_ord_in:
52248 - dma_ctrl_data |= DMA_CTRL_DMAR_IN_ORDER;
52249 - break;
52250 - case atl1c_dma_ord_enh:
52251 - dma_ctrl_data |= DMA_CTRL_DMAR_ENH_ORDER;
52252 - break;
52253 - case atl1c_dma_ord_out:
52254 - dma_ctrl_data |= DMA_CTRL_DMAR_OUT_ORDER;
52255 - break;
52256 - default:
52257 - break;
52258 - }
52259 -
52260 - dma_ctrl_data |= (((u32)hw->dmar_block) & DMA_CTRL_DMAR_BURST_LEN_MASK)
52261 - << DMA_CTRL_DMAR_BURST_LEN_SHIFT;
52262 - dma_ctrl_data |= (((u32)hw->dmaw_block) & DMA_CTRL_DMAW_BURST_LEN_MASK)
52263 - << DMA_CTRL_DMAW_BURST_LEN_SHIFT;
52264 - dma_ctrl_data |= (((u32)hw->dmar_dly_cnt) & DMA_CTRL_DMAR_DLY_CNT_MASK)
52265 - << DMA_CTRL_DMAR_DLY_CNT_SHIFT;
52266 - dma_ctrl_data |= (((u32)hw->dmaw_dly_cnt) & DMA_CTRL_DMAW_DLY_CNT_MASK)
52267 - << DMA_CTRL_DMAW_DLY_CNT_SHIFT;
52268 -
52269 - AT_WRITE_REG(hw, REG_DMA_CTRL, dma_ctrl_data);
52270 -}
52271 -
52272 -/*
52273 - * Stop the mac, transmit and receive units
52274 - * hw - Struct containing variables accessed by shared code
52275 - * return : 0 or idle status (if error)
52276 - */
52277 -static int atl1c_stop_mac(struct atl1c_hw *hw)
52278 -{
52279 - u32 data;
52280 - int timeout;
52281 -
52282 - AT_READ_REG(hw, REG_RXQ_CTRL, &data);
52283 - data &= ~(RXQ1_CTRL_EN | RXQ2_CTRL_EN |
52284 - RXQ3_CTRL_EN | RXQ_CTRL_EN);
52285 - AT_WRITE_REG(hw, REG_RXQ_CTRL, data);
52286 -
52287 - AT_READ_REG(hw, REG_TXQ_CTRL, &data);
52288 - data &= ~TXQ_CTRL_EN;
52289 - AT_WRITE_REG(hw, REG_TWSI_CTRL, data);
52290 -
52291 - for (timeout = 0; timeout < AT_HW_MAX_IDLE_DELAY; timeout++) {
52292 - AT_READ_REG(hw, REG_IDLE_STATUS, &data);
52293 - if ((data & (IDLE_STATUS_RXQ_NO_IDLE |
52294 - IDLE_STATUS_TXQ_NO_IDLE)) == 0)
52295 - break;
52296 - msleep(1);
52297 - }
52298 -
52299 - AT_READ_REG(hw, REG_MAC_CTRL, &data);
52300 - data &= ~(MAC_CTRL_TX_EN | MAC_CTRL_RX_EN);
52301 - AT_WRITE_REG(hw, REG_MAC_CTRL, data);
52302 -
52303 - for (timeout = 0; timeout < AT_HW_MAX_IDLE_DELAY; timeout++) {
52304 - AT_READ_REG(hw, REG_IDLE_STATUS, &data);
52305 - if ((data & IDLE_STATUS_MASK) == 0)
52306 - return 0;
52307 - msleep(1);
52308 - }
52309 - return data;
52310 -}
52311 -
52312 -static void atl1c_enable_rx_ctrl(struct atl1c_hw *hw)
52313 -{
52314 - u32 data;
52315 -
52316 - AT_READ_REG(hw, REG_RXQ_CTRL, &data);
52317 - switch (hw->adapter->num_rx_queues) {
52318 - case 4:
52319 - data |= (RXQ3_CTRL_EN | RXQ2_CTRL_EN | RXQ1_CTRL_EN);
52320 - break;
52321 - case 3:
52322 - data |= (RXQ2_CTRL_EN | RXQ1_CTRL_EN);
52323 - break;
52324 - case 2:
52325 - data |= RXQ1_CTRL_EN;
52326 - break;
52327 - default:
52328 - break;
52329 - }
52330 - data |= RXQ_CTRL_EN;
52331 - AT_WRITE_REG(hw, REG_RXQ_CTRL, data);
52332 -}
52333 -
52334 -static void atl1c_enable_tx_ctrl(struct atl1c_hw *hw)
52335 -{
52336 - u32 data;
52337 -
52338 - AT_READ_REG(hw, REG_TXQ_CTRL, &data);
52339 - data |= TXQ_CTRL_EN;
52340 - AT_WRITE_REG(hw, REG_TXQ_CTRL, data);
52341 -}
52342 -
52343 -/*
52344 - * Reset the transmit and receive units; mask and clear all interrupts.
52345 - * hw - Struct containing variables accessed by shared code
52346 - * return : 0 or idle status (if error)
52347 - */
52348 -static int atl1c_reset_mac(struct atl1c_hw *hw)
52349 -{
52350 - struct atl1c_adapter *adapter = (struct atl1c_adapter *)hw->adapter;
52351 - struct pci_dev *pdev = adapter->pdev;
52352 - u32 idle_status_data = 0;
52353 - int timeout = 0;
52354 - int ret;
52355 -
52356 - AT_WRITE_REG(hw, REG_IMR, 0);
52357 - AT_WRITE_REG(hw, REG_ISR, ISR_DIS_INT);
52358 -
52359 - ret = atl1c_stop_mac(hw);
52360 - if (ret)
52361 - return ret;
52362 - /*
52363 - * Issue Soft Reset to the MAC. This will reset the chip's
52364 - * transmit, receive, DMA. It will not effect
52365 - * the current PCI configuration. The global reset bit is self-
52366 - * clearing, and should clear within a microsecond.
52367 - */
52368 - AT_WRITE_REGW(hw, REG_MASTER_CTRL, MASTER_CTRL_SOFT_RST);
52369 - AT_WRITE_FLUSH(hw);
52370 - msleep(10);
52371 - /* Wait at least 10ms for All module to be Idle */
52372 - for (timeout = 0; timeout < AT_HW_MAX_IDLE_DELAY; timeout++) {
52373 - AT_READ_REG(hw, REG_IDLE_STATUS, &idle_status_data);
52374 - if ((idle_status_data & IDLE_STATUS_MASK) == 0)
52375 - break;
52376 - msleep(1);
52377 - }
52378 - if (timeout >= AT_HW_MAX_IDLE_DELAY) {
52379 - dev_err(&pdev->dev,
52380 - "MAC state machine cann't be idle since"
52381 - " disabled for 10ms second\n");
52382 - return -1;
52383 - }
52384 - return 0;
52385 -}
52386 -
52387 -static void atl1c_disable_l0s_l1(struct atl1c_hw *hw)
52388 -{
52389 - u32 pm_ctrl_data;
52390 -
52391 - AT_READ_REG(hw, REG_PM_CTRL, &pm_ctrl_data);
52392 - pm_ctrl_data &= ~(PM_CTRL_L1_ENTRY_TIMER_MASK <<
52393 - PM_CTRL_L1_ENTRY_TIMER_SHIFT);
52394 - pm_ctrl_data &= ~PM_CTRL_CLK_SWH_L1;
52395 - pm_ctrl_data &= ~PM_CTRL_ASPM_L0S_EN;
52396 - pm_ctrl_data &= ~PM_CTRL_ASPM_L1_EN;
52397 - pm_ctrl_data &= ~PM_CTRL_MAC_ASPM_CHK;
52398 - pm_ctrl_data &= ~PM_CTRL_SERDES_PD_EX_L1;
52399 -
52400 - pm_ctrl_data |= PM_CTRL_SERDES_BUDS_RX_L1_EN;
52401 - pm_ctrl_data |= PM_CTRL_SERDES_PLL_L1_EN;
52402 - pm_ctrl_data |= PM_CTRL_SERDES_L1_EN;
52403 - AT_WRITE_REG(hw, REG_PM_CTRL, pm_ctrl_data);
52404 -}
52405 -
52406 -/*
52407 - * Set ASPM state.
52408 - * Enable/disable L0s/L1 depend on link state.
52409 - */
52410 -static void atl1c_set_aspm(struct atl1c_hw *hw, bool linkup)
52411 -{
52412 - u32 pm_ctrl_data;
52413 -
52414 - AT_READ_REG(hw, REG_PM_CTRL, &pm_ctrl_data);
52415 -
52416 - pm_ctrl_data &= PM_CTRL_SERDES_PD_EX_L1;
52417 - pm_ctrl_data |= ~PM_CTRL_SERDES_BUDS_RX_L1_EN;
52418 - pm_ctrl_data |= ~PM_CTRL_SERDES_L1_EN;
52419 - pm_ctrl_data &= ~(PM_CTRL_L1_ENTRY_TIMER_MASK <<
52420 - PM_CTRL_L1_ENTRY_TIMER_SHIFT);
52421 -
52422 - pm_ctrl_data |= PM_CTRL_MAC_ASPM_CHK;
52423 -
52424 - if (linkup) {
52425 - pm_ctrl_data |= PM_CTRL_SERDES_PLL_L1_EN;
52426 - pm_ctrl_data &= ~PM_CTRL_CLK_SWH_L1;
52427 -
52428 - if (hw->ctrl_flags & ATL1C_ASPM_L1_SUPPORT) {
52429 - pm_ctrl_data |= AT_ASPM_L1_TIMER <<
52430 - PM_CTRL_L1_ENTRY_TIMER_SHIFT;
52431 - pm_ctrl_data |= PM_CTRL_ASPM_L1_EN;
52432 - } else
52433 - pm_ctrl_data &= ~PM_CTRL_ASPM_L1_EN;
52434 -
52435 - if (hw->ctrl_flags & ATL1C_ASPM_L0S_SUPPORT)
52436 - pm_ctrl_data |= PM_CTRL_ASPM_L0S_EN;
52437 - else
52438 - pm_ctrl_data &= ~PM_CTRL_ASPM_L0S_EN;
52439 -
52440 - } else {
52441 - pm_ctrl_data &= ~PM_CTRL_ASPM_L0S_EN;
52442 - pm_ctrl_data &= ~PM_CTRL_SERDES_PLL_L1_EN;
52443 -
52444 - pm_ctrl_data |= PM_CTRL_CLK_SWH_L1;
52445 -
52446 - if (hw->ctrl_flags & ATL1C_ASPM_L1_SUPPORT)
52447 - pm_ctrl_data |= PM_CTRL_ASPM_L1_EN;
52448 - else
52449 - pm_ctrl_data &= ~PM_CTRL_ASPM_L1_EN;
52450 - }
52451 -
52452 - AT_WRITE_REG(hw, REG_PM_CTRL, pm_ctrl_data);
52453 -}
52454 -
52455 -static void atl1c_setup_mac_ctrl(struct atl1c_adapter *adapter)
52456 -{
52457 - struct atl1c_hw *hw = &adapter->hw;
52458 - struct net_device *netdev = adapter->netdev;
52459 - u32 mac_ctrl_data;
52460 -
52461 - mac_ctrl_data = MAC_CTRL_TX_EN | MAC_CTRL_RX_EN;
52462 - mac_ctrl_data |= (MAC_CTRL_TX_FLOW | MAC_CTRL_RX_FLOW);
52463 -
52464 - if (adapter->link_duplex == FULL_DUPLEX) {
52465 - hw->mac_duplex = true;
52466 - mac_ctrl_data |= MAC_CTRL_DUPLX;
52467 - }
52468 -
52469 - if (adapter->link_speed == SPEED_1000)
52470 - hw->mac_speed = atl1c_mac_speed_1000;
52471 - else
52472 - hw->mac_speed = atl1c_mac_speed_10_100;
52473 -
52474 - mac_ctrl_data |= (hw->mac_speed & MAC_CTRL_SPEED_MASK) <<
52475 - MAC_CTRL_SPEED_SHIFT;
52476 -
52477 - mac_ctrl_data |= (MAC_CTRL_ADD_CRC | MAC_CTRL_PAD);
52478 - mac_ctrl_data |= ((hw->preamble_len & MAC_CTRL_PRMLEN_MASK) <<
52479 - MAC_CTRL_PRMLEN_SHIFT);
52480 -
52481 - if (adapter->vlgrp)
52482 - mac_ctrl_data |= MAC_CTRL_RMV_VLAN;
52483 -
52484 - mac_ctrl_data |= MAC_CTRL_BC_EN;
52485 - if (netdev->flags & IFF_PROMISC)
52486 - mac_ctrl_data |= MAC_CTRL_PROMIS_EN;
52487 - if (netdev->flags & IFF_ALLMULTI)
52488 - mac_ctrl_data |= MAC_CTRL_MC_ALL_EN;
52489 -
52490 - mac_ctrl_data |= MAC_CTRL_SINGLE_PAUSE_EN;
52491 - AT_WRITE_REG(hw, REG_MAC_CTRL, mac_ctrl_data);
52492 -}
52493 -
52494 -/*
52495 - * atl1c_configure - Configure Transmit&Receive Unit after Reset
52496 - * @adapter: board private structure
52497 - *
52498 - * Configure the Tx /Rx unit of the MAC after a reset.
52499 - */
52500 -static int atl1c_configure(struct atl1c_adapter *adapter)
52501 -{
52502 - struct atl1c_hw *hw = &adapter->hw;
52503 - u32 master_ctrl_data = 0;
52504 - u32 intr_modrt_data;
52505 -
52506 - /* clear interrupt status */
52507 - AT_WRITE_REG(hw, REG_ISR, 0xFFFFFFFF);
52508 - /* Clear any WOL status */
52509 - AT_WRITE_REG(hw, REG_WOL_CTRL, 0);
52510 - /* set Interrupt Clear Timer
52511 - * HW will enable self to assert interrupt event to system after
52512 - * waiting x-time for software to notify it accept interrupt.
52513 - */
52514 - AT_WRITE_REG(hw, REG_INT_RETRIG_TIMER,
52515 - hw->ict & INT_RETRIG_TIMER_MASK);
52516 -
52517 - atl1c_configure_des_ring(adapter);
52518 -
52519 - if (hw->ctrl_flags & ATL1C_INTR_MODRT_ENABLE) {
52520 - intr_modrt_data = (hw->tx_imt & IRQ_MODRT_TIMER_MASK) <<
52521 - IRQ_MODRT_TX_TIMER_SHIFT;
52522 - intr_modrt_data |= (hw->rx_imt & IRQ_MODRT_TIMER_MASK) <<
52523 - IRQ_MODRT_RX_TIMER_SHIFT;
52524 - AT_WRITE_REG(hw, REG_IRQ_MODRT_TIMER_INIT, intr_modrt_data);
52525 - master_ctrl_data |=
52526 - MASTER_CTRL_TX_ITIMER_EN | MASTER_CTRL_RX_ITIMER_EN;
52527 - }
52528 -
52529 - if (hw->ctrl_flags & ATL1C_INTR_CLEAR_ON_READ)
52530 - master_ctrl_data |= MASTER_CTRL_INT_RDCLR;
52531 -
52532 - AT_WRITE_REG(hw, REG_MASTER_CTRL, master_ctrl_data);
52533 -
52534 - if (hw->ctrl_flags & ATL1C_CMB_ENABLE) {
52535 - AT_WRITE_REG(hw, REG_CMB_TPD_THRESH,
52536 - hw->cmb_tpd & CMB_TPD_THRESH_MASK);
52537 - AT_WRITE_REG(hw, REG_CMB_TX_TIMER,
52538 - hw->cmb_tx_timer & CMB_TX_TIMER_MASK);
52539 - }
52540 -
52541 - if (hw->ctrl_flags & ATL1C_SMB_ENABLE)
52542 - AT_WRITE_REG(hw, REG_SMB_STAT_TIMER,
52543 - hw->smb_timer & SMB_STAT_TIMER_MASK);
52544 - /* set MTU */
52545 - AT_WRITE_REG(hw, REG_MTU, hw->max_frame_size + ETH_HLEN +
52546 - VLAN_HLEN + ETH_FCS_LEN);
52547 - /* HDS, disable */
52548 - AT_WRITE_REG(hw, REG_HDS_CTRL, 0);
52549 -
52550 - atl1c_configure_tx(adapter);
52551 - atl1c_configure_rx(adapter);
52552 - atl1c_configure_rss(adapter);
52553 - atl1c_configure_dma(adapter);
52554 -
52555 - return 0;
52556 -}
52557 -
52558 -static void atl1c_update_hw_stats(struct atl1c_adapter *adapter)
52559 -{
52560 - u16 hw_reg_addr = 0;
52561 - unsigned long *stats_item = NULL;
52562 - u32 data;
52563 -
52564 - /* update rx status */
52565 - hw_reg_addr = REG_MAC_RX_STATUS_BIN;
52566 - stats_item = &adapter->hw_stats.rx_ok;
52567 - while (hw_reg_addr <= REG_MAC_RX_STATUS_END) {
52568 - AT_READ_REG(&adapter->hw, hw_reg_addr, &data);
52569 - *stats_item += data;
52570 - stats_item++;
52571 - hw_reg_addr += 4;
52572 - }
52573 -/* update tx status */
52574 - hw_reg_addr = REG_MAC_TX_STATUS_BIN;
52575 - stats_item = &adapter->hw_stats.tx_ok;
52576 - while (hw_reg_addr <= REG_MAC_TX_STATUS_END) {
52577 - AT_READ_REG(&adapter->hw, hw_reg_addr, &data);
52578 - *stats_item += data;
52579 - stats_item++;
52580 - hw_reg_addr += 4;
52581 - }
52582 -}
52583 -
52584 -/*
52585 - * atl1c_get_stats - Get System Network Statistics
52586 - * @netdev: network interface device structure
52587 - *
52588 - * Returns the address of the device statistics structure.
52589 - * The statistics are actually updated from the timer callback.
52590 - */
52591 -static struct net_device_stats *atl1c_get_stats(struct net_device *netdev)
52592 -{
52593 - struct atl1c_adapter *adapter = netdev_priv(netdev);
52594 - struct atl1c_hw_stats *hw_stats = &adapter->hw_stats;
52595 - struct net_device_stats *net_stats = &adapter->net_stats;
52596 -
52597 - atl1c_update_hw_stats(adapter);
52598 - net_stats->rx_packets = hw_stats->rx_ok;
52599 - net_stats->tx_packets = hw_stats->tx_ok;
52600 - net_stats->rx_bytes = hw_stats->rx_byte_cnt;
52601 - net_stats->tx_bytes = hw_stats->tx_byte_cnt;
52602 - net_stats->multicast = hw_stats->rx_mcast;
52603 - net_stats->collisions = hw_stats->tx_1_col +
52604 - hw_stats->tx_2_col * 2 +
52605 - hw_stats->tx_late_col + hw_stats->tx_abort_col;
52606 - net_stats->rx_errors = hw_stats->rx_frag + hw_stats->rx_fcs_err +
52607 - hw_stats->rx_len_err + hw_stats->rx_sz_ov +
52608 - hw_stats->rx_rrd_ov + hw_stats->rx_align_err;
52609 - net_stats->rx_fifo_errors = hw_stats->rx_rxf_ov;
52610 - net_stats->rx_length_errors = hw_stats->rx_len_err;
52611 - net_stats->rx_crc_errors = hw_stats->rx_fcs_err;
52612 - net_stats->rx_frame_errors = hw_stats->rx_align_err;
52613 - net_stats->rx_over_errors = hw_stats->rx_rrd_ov + hw_stats->rx_rxf_ov;
52614 -
52615 - net_stats->rx_missed_errors = hw_stats->rx_rrd_ov + hw_stats->rx_rxf_ov;
52616 -
52617 - net_stats->tx_errors = hw_stats->tx_late_col + hw_stats->tx_abort_col +
52618 - hw_stats->tx_underrun + hw_stats->tx_trunc;
52619 - net_stats->tx_fifo_errors = hw_stats->tx_underrun;
52620 - net_stats->tx_aborted_errors = hw_stats->tx_abort_col;
52621 - net_stats->tx_window_errors = hw_stats->tx_late_col;
52622 -
52623 - return &adapter->net_stats;
52624 -}
52625 -
52626 -static inline void atl1c_clear_phy_int(struct atl1c_adapter *adapter)
52627 -{
52628 - u16 phy_data;
52629 -
52630 - spin_lock(&adapter->mdio_lock);
52631 - atl1c_read_phy_reg(&adapter->hw, MII_ISR, &phy_data);
52632 - spin_unlock(&adapter->mdio_lock);
52633 -}
52634 -
52635 -static bool atl1c_clean_tx_irq(struct atl1c_adapter *adapter,
52636 - enum atl1c_trans_queue type)
52637 -{
52638 - struct atl1c_tpd_ring *tpd_ring = (struct atl1c_tpd_ring *)
52639 - &adapter->tpd_ring[type];
52640 - struct atl1c_buffer *buffer_info;
52641 - u16 next_to_clean = atomic_read(&tpd_ring->next_to_clean);
52642 - u16 hw_next_to_clean;
52643 - u16 shift;
52644 - u32 data;
52645 -
52646 - if (type == atl1c_trans_high)
52647 - shift = MB_HTPD_CONS_IDX_SHIFT;
52648 - else
52649 - shift = MB_NTPD_CONS_IDX_SHIFT;
52650 -
52651 - AT_READ_REG(&adapter->hw, REG_MB_PRIO_CONS_IDX, &data);
52652 - hw_next_to_clean = (data >> shift) & MB_PRIO_PROD_IDX_MASK;
52653 -
52654 - while (next_to_clean != hw_next_to_clean) {
52655 - buffer_info = &tpd_ring->buffer_info[next_to_clean];
52656 - if (buffer_info->state == ATL1_BUFFER_BUSY) {
52657 - pci_unmap_page(adapter->pdev, buffer_info->dma,
52658 - buffer_info->length, PCI_DMA_TODEVICE);
52659 - buffer_info->dma = 0;
52660 - if (buffer_info->skb) {
52661 - dev_kfree_skb_irq(buffer_info->skb);
52662 - buffer_info->skb = NULL;
52663 - }
52664 - buffer_info->state = ATL1_BUFFER_FREE;
52665 - }
52666 - if (++next_to_clean == tpd_ring->count)
52667 - next_to_clean = 0;
52668 - atomic_set(&tpd_ring->next_to_clean, next_to_clean);
52669 - }
52670 -
52671 - if (netif_queue_stopped(adapter->netdev) &&
52672 - netif_carrier_ok(adapter->netdev)) {
52673 - netif_wake_queue(adapter->netdev);
52674 - }
52675 -
52676 - return true;
52677 -}
52678 -
52679 -/*
52680 - * atl1c_intr - Interrupt Handler
52681 - * @irq: interrupt number
52682 - * @data: pointer to a network interface device structure
52683 - * @pt_regs: CPU registers structure
52684 - */
52685 -static irqreturn_t atl1c_intr(int irq, void *data)
52686 -{
52687 - struct net_device *netdev = data;
52688 - struct atl1c_adapter *adapter = netdev_priv(netdev);
52689 - struct pci_dev *pdev = adapter->pdev;
52690 - struct atl1c_hw *hw = &adapter->hw;
52691 - int max_ints = AT_MAX_INT_WORK;
52692 - int handled = IRQ_NONE;
52693 - u32 status;
52694 - u32 reg_data;
52695 -
52696 - do {
52697 - AT_READ_REG(hw, REG_ISR, &reg_data);
52698 - status = reg_data & hw->intr_mask;
52699 -
52700 - if (status == 0 || (status & ISR_DIS_INT) != 0) {
52701 - if (max_ints != AT_MAX_INT_WORK)
52702 - handled = IRQ_HANDLED;
52703 - break;
52704 - }
52705 - /* link event */
52706 - if (status & ISR_GPHY)
52707 - atl1c_clear_phy_int(adapter);
52708 - /* Ack ISR */
52709 - AT_WRITE_REG(hw, REG_ISR, status | ISR_DIS_INT);
52710 - if (status & ISR_RX_PKT) {
52711 - if (likely(napi_schedule_prep(&adapter->napi))) {
52712 - hw->intr_mask &= ~ISR_RX_PKT;
52713 - AT_WRITE_REG(hw, REG_IMR, hw->intr_mask);
52714 - __napi_schedule(&adapter->napi);
52715 - }
52716 - }
52717 - if (status & ISR_TX_PKT)
52718 - atl1c_clean_tx_irq(adapter, atl1c_trans_normal);
52719 -
52720 - handled = IRQ_HANDLED;
52721 - /* check if PCIE PHY Link down */
52722 - if (status & ISR_ERROR) {
52723 - if (netif_msg_hw(adapter))
52724 - dev_err(&pdev->dev,
52725 - "atl1c hardware error (status = 0x%x)\n",
52726 - status & ISR_ERROR);
52727 - /* reset MAC */
52728 - hw->intr_mask &= ~ISR_ERROR;
52729 - AT_WRITE_REG(hw, REG_IMR, hw->intr_mask);
52730 - schedule_work(&adapter->reset_task);
52731 - break;
52732 - }
52733 -
52734 - if (status & ISR_OVER)
52735 - if (netif_msg_intr(adapter))
52736 - dev_warn(&pdev->dev,
52737 - "TX/RX over flow (status = 0x%x)\n",
52738 - status & ISR_OVER);
52739 -
52740 - /* link event */
52741 - if (status & (ISR_GPHY | ISR_MANUAL)) {
52742 - adapter->net_stats.tx_carrier_errors++;
52743 - atl1c_link_chg_event(adapter);
52744 - break;
52745 - }
52746 -
52747 - } while (--max_ints > 0);
52748 - /* re-enable Interrupt*/
52749 - AT_WRITE_REG(&adapter->hw, REG_ISR, 0);
52750 - return handled;
52751 -}
52752 -
52753 -static inline void atl1c_rx_checksum(struct atl1c_adapter *adapter,
52754 - struct sk_buff *skb, struct atl1c_recv_ret_status *prrs)
52755 -{
52756 - /*
52757 - * The pid field in RRS in not correct sometimes, so we
52758 - * cannot figure out if the packet is fragmented or not,
52759 - * so we tell the KERNEL CHECKSUM_NONE
52760 - */
52761 - skb->ip_summed = CHECKSUM_NONE;
52762 -}
52763 -
52764 -static int atl1c_alloc_rx_buffer(struct atl1c_adapter *adapter, const int ringid)
52765 -{
52766 - struct atl1c_rfd_ring *rfd_ring = &adapter->rfd_ring[ringid];
52767 - struct pci_dev *pdev = adapter->pdev;
52768 - struct atl1c_buffer *buffer_info, *next_info;
52769 - struct sk_buff *skb;
52770 - void *vir_addr = NULL;
52771 - u16 num_alloc = 0;
52772 - u16 rfd_next_to_use, next_next;
52773 - struct atl1c_rx_free_desc *rfd_desc;
52774 -
52775 - next_next = rfd_next_to_use = rfd_ring->next_to_use;
52776 - if (++next_next == rfd_ring->count)
52777 - next_next = 0;
52778 - buffer_info = &rfd_ring->buffer_info[rfd_next_to_use];
52779 - next_info = &rfd_ring->buffer_info[next_next];
52780 -
52781 - while (next_info->state == ATL1_BUFFER_FREE) {
52782 - rfd_desc = ATL1C_RFD_DESC(rfd_ring, rfd_next_to_use);
52783 -
52784 - skb = dev_alloc_skb(adapter->rx_buffer_len);
52785 - if (unlikely(!skb)) {
52786 - if (netif_msg_rx_err(adapter))
52787 - dev_warn(&pdev->dev, "alloc rx buffer failed\n");
52788 - break;
52789 - }
52790 -
52791 - /*
52792 - * Make buffer alignment 2 beyond a 16 byte boundary
52793 - * this will result in a 16 byte aligned IP header after
52794 - * the 14 byte MAC header is removed
52795 - */
52796 - vir_addr = skb->data;
52797 - buffer_info->state = ATL1_BUFFER_BUSY;
52798 - buffer_info->skb = skb;
52799 - buffer_info->length = adapter->rx_buffer_len;
52800 - buffer_info->dma = pci_map_single(pdev, vir_addr,
52801 - buffer_info->length,
52802 - PCI_DMA_FROMDEVICE);
52803 - rfd_desc->buffer_addr = cpu_to_le64(buffer_info->dma);
52804 - rfd_next_to_use = next_next;
52805 - if (++next_next == rfd_ring->count)
52806 - next_next = 0;
52807 - buffer_info = &rfd_ring->buffer_info[rfd_next_to_use];
52808 - next_info = &rfd_ring->buffer_info[next_next];
52809 - num_alloc++;
52810 - }
52811 -
52812 - if (num_alloc) {
52813 - /* TODO: update mailbox here */
52814 - wmb();
52815 - rfd_ring->next_to_use = rfd_next_to_use;
52816 - AT_WRITE_REG(&adapter->hw, atl1c_rfd_prod_idx_regs[ringid],
52817 - rfd_ring->next_to_use & MB_RFDX_PROD_IDX_MASK);
52818 - }
52819 -
52820 - return num_alloc;
52821 -}
52822 -
52823 -static void atl1c_clean_rrd(struct atl1c_rrd_ring *rrd_ring,
52824 - struct atl1c_recv_ret_status *rrs, u16 num)
52825 -{
52826 - u16 i;
52827 - /* the relationship between rrd and rfd is one map one */
52828 - for (i = 0; i < num; i++, rrs = ATL1C_RRD_DESC(rrd_ring,
52829 - rrd_ring->next_to_clean)) {
52830 - rrs->word3 &= ~RRS_RXD_UPDATED;
52831 - if (++rrd_ring->next_to_clean == rrd_ring->count)
52832 - rrd_ring->next_to_clean = 0;
52833 - }
52834 -}
52835 -
52836 -static void atl1c_clean_rfd(struct atl1c_rfd_ring *rfd_ring,
52837 - struct atl1c_recv_ret_status *rrs, u16 num)
52838 -{
52839 - u16 i;
52840 - u16 rfd_index;
52841 - struct atl1c_buffer *buffer_info = rfd_ring->buffer_info;
52842 -
52843 - rfd_index = (rrs->word0 >> RRS_RX_RFD_INDEX_SHIFT) &
52844 - RRS_RX_RFD_INDEX_MASK;
52845 - for (i = 0; i < num; i++) {
52846 - buffer_info[rfd_index].skb = NULL;
52847 - buffer_info[rfd_index].state = ATL1_BUFFER_FREE;
52848 - if (++rfd_index == rfd_ring->count)
52849 - rfd_index = 0;
52850 - }
52851 - rfd_ring->next_to_clean = rfd_index;
52852 -}
52853 -
52854 -static void atl1c_clean_rx_irq(struct atl1c_adapter *adapter, u8 que,
52855 - int *work_done, int work_to_do)
52856 -{
52857 - u16 rfd_num, rfd_index;
52858 - u16 count = 0;
52859 - u16 length;
52860 - struct pci_dev *pdev = adapter->pdev;
52861 - struct net_device *netdev = adapter->netdev;
52862 - struct atl1c_rfd_ring *rfd_ring = &adapter->rfd_ring[que];
52863 - struct atl1c_rrd_ring *rrd_ring = &adapter->rrd_ring[que];
52864 - struct sk_buff *skb;
52865 - struct atl1c_recv_ret_status *rrs;
52866 - struct atl1c_buffer *buffer_info;
52867 -
52868 - while (1) {
52869 - if (*work_done >= work_to_do)
52870 - break;
52871 - rrs = ATL1C_RRD_DESC(rrd_ring, rrd_ring->next_to_clean);
52872 - if (likely(RRS_RXD_IS_VALID(rrs->word3))) {
52873 - rfd_num = (rrs->word0 >> RRS_RX_RFD_CNT_SHIFT) &
52874 - RRS_RX_RFD_CNT_MASK;
52875 - if (unlikely(rfd_num) != 1)
52876 - /* TODO support mul rfd*/
52877 - if (netif_msg_rx_err(adapter))
52878 - dev_warn(&pdev->dev,
52879 - "Multi rfd not support yet!\n");
52880 - goto rrs_checked;
52881 - } else {
52882 - break;
52883 - }
52884 -rrs_checked:
52885 - atl1c_clean_rrd(rrd_ring, rrs, rfd_num);
52886 - if (rrs->word3 & (RRS_RX_ERR_SUM | RRS_802_3_LEN_ERR)) {
52887 - atl1c_clean_rfd(rfd_ring, rrs, rfd_num);
52888 - if (netif_msg_rx_err(adapter))
52889 - dev_warn(&pdev->dev,
52890 - "wrong packet! rrs word3 is %x\n",
52891 - rrs->word3);
52892 - continue;
52893 - }
52894 -
52895 - length = le16_to_cpu((rrs->word3 >> RRS_PKT_SIZE_SHIFT) &
52896 - RRS_PKT_SIZE_MASK);
52897 - /* Good Receive */
52898 - if (likely(rfd_num == 1)) {
52899 - rfd_index = (rrs->word0 >> RRS_RX_RFD_INDEX_SHIFT) &
52900 - RRS_RX_RFD_INDEX_MASK;
52901 - buffer_info = &rfd_ring->buffer_info[rfd_index];
52902 - pci_unmap_single(pdev, buffer_info->dma,
52903 - buffer_info->length, PCI_DMA_FROMDEVICE);
52904 - skb = buffer_info->skb;
52905 - } else {
52906 - /* TODO */
52907 - if (netif_msg_rx_err(adapter))
52908 - dev_warn(&pdev->dev,
52909 - "Multi rfd not support yet!\n");
52910 - break;
52911 - }
52912 - atl1c_clean_rfd(rfd_ring, rrs, rfd_num);
52913 - skb_put(skb, length - ETH_FCS_LEN);
52914 - skb->protocol = eth_type_trans(skb, netdev);
52915 - skb->dev = netdev;
52916 - atl1c_rx_checksum(adapter, skb, rrs);
52917 - if (unlikely(adapter->vlgrp) && rrs->word3 & RRS_VLAN_INS) {
52918 - u16 vlan;
52919 -
52920 - AT_TAG_TO_VLAN(rrs->vlan_tag, vlan);
52921 - vlan = le16_to_cpu(vlan);
52922 - vlan_hwaccel_receive_skb(skb, adapter->vlgrp, vlan);
52923 - } else
52924 - netif_receive_skb(skb);
52925 -
52926 - netdev->last_rx = jiffies;
52927 - (*work_done)++;
52928 - count++;
52929 - }
52930 - if (count)
52931 - atl1c_alloc_rx_buffer(adapter, que);
52932 -}
52933 -
52934 -/*
52935 - * atl1c_clean - NAPI Rx polling callback
52936 - * @adapter: board private structure
52937 - */
52938 -static int atl1c_clean(struct napi_struct *napi, int budget)
52939 -{
52940 - struct atl1c_adapter *adapter =
52941 - container_of(napi, struct atl1c_adapter, napi);
52942 - int work_done = 0;
52943 -
52944 - /* Keep link state information with original netdev */
52945 - if (!netif_carrier_ok(adapter->netdev))
52946 - goto quit_polling;
52947 - /* just enable one RXQ */
52948 - atl1c_clean_rx_irq(adapter, 0, &work_done, budget);
52949 -
52950 - if (work_done < budget) {
52951 -quit_polling:
52952 - napi_complete(napi);
52953 - adapter->hw.intr_mask |= ISR_RX_PKT;
52954 - AT_WRITE_REG(&adapter->hw, REG_IMR, adapter->hw.intr_mask);
52955 - }
52956 - return work_done;
52957 -}
52958 -
52959 -#ifdef CONFIG_NET_POLL_CONTROLLER
52960 -
52961 -/*
52962 - * Polling 'interrupt' - used by things like netconsole to send skbs
52963 - * without having to re-enable interrupts. It's not called while
52964 - * the interrupt routine is executing.
52965 - */
52966 -static void atl1c_netpoll(struct net_device *netdev)
52967 -{
52968 - struct atl1c_adapter *adapter = netdev_priv(netdev);
52969 -
52970 - disable_irq(adapter->pdev->irq);
52971 - atl1c_intr(adapter->pdev->irq, netdev);
52972 - enable_irq(adapter->pdev->irq);
52973 -}
52974 -#endif
52975 -
52976 -static inline u16 atl1c_tpd_avail(struct atl1c_adapter *adapter, enum atl1c_trans_queue type)
52977 -{
52978 - struct atl1c_tpd_ring *tpd_ring = &adapter->tpd_ring[type];
52979 - u16 next_to_use = 0;
52980 - u16 next_to_clean = 0;
52981 -
52982 - next_to_clean = atomic_read(&tpd_ring->next_to_clean);
52983 - next_to_use = tpd_ring->next_to_use;
52984 -
52985 - return (u16)(next_to_clean > next_to_use) ?
52986 - (next_to_clean - next_to_use - 1) :
52987 - (tpd_ring->count + next_to_clean - next_to_use - 1);
52988 -}
52989 -
52990 -/*
52991 - * get next usable tpd
52992 - * Note: should call atl1c_tdp_avail to make sure
52993 - * there is enough tpd to use
52994 - */
52995 -static struct atl1c_tpd_desc *atl1c_get_tpd(struct atl1c_adapter *adapter,
52996 - enum atl1c_trans_queue type)
52997 -{
52998 - struct atl1c_tpd_ring *tpd_ring = &adapter->tpd_ring[type];
52999 - struct atl1c_tpd_desc *tpd_desc;
53000 - u16 next_to_use = 0;
53001 -
53002 - next_to_use = tpd_ring->next_to_use;
53003 - if (++tpd_ring->next_to_use == tpd_ring->count)
53004 - tpd_ring->next_to_use = 0;
53005 - tpd_desc = ATL1C_TPD_DESC(tpd_ring, next_to_use);
53006 - memset(tpd_desc, 0, sizeof(struct atl1c_tpd_desc));
53007 - return tpd_desc;
53008 -}
53009 -
53010 -static struct atl1c_buffer *
53011 -atl1c_get_tx_buffer(struct atl1c_adapter *adapter, struct atl1c_tpd_desc *tpd)
53012 -{
53013 - struct atl1c_tpd_ring *tpd_ring = adapter->tpd_ring;
53014 -
53015 - return &tpd_ring->buffer_info[tpd -
53016 - (struct atl1c_tpd_desc *)tpd_ring->desc];
53017 -}
53018 -
53019 -/* Calculate the transmit packet descript needed*/
53020 -static u16 atl1c_cal_tpd_req(const struct sk_buff *skb)
53021 -{
53022 - u16 tpd_req;
53023 - u16 proto_hdr_len = 0;
53024 -
53025 - tpd_req = skb_shinfo(skb)->nr_frags + 1;
53026 -
53027 - if (skb_is_gso(skb)) {
53028 - proto_hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb);
53029 - if (proto_hdr_len < skb_headlen(skb))
53030 - tpd_req++;
53031 - if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6)
53032 - tpd_req++;
53033 - }
53034 - return tpd_req;
53035 -}
53036 -
53037 -static int atl1c_tso_csum(struct atl1c_adapter *adapter,
53038 - struct sk_buff *skb,
53039 - struct atl1c_tpd_desc **tpd,
53040 - enum atl1c_trans_queue type)
53041 -{
53042 - struct pci_dev *pdev = adapter->pdev;
53043 - u8 hdr_len;
53044 - u32 real_len;
53045 - unsigned short offload_type;
53046 - int err;
53047 -
53048 - if (skb_is_gso(skb)) {
53049 - if (skb_header_cloned(skb)) {
53050 - err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC);
53051 - if (unlikely(err))
53052 - return -1;
53053 - }
53054 - offload_type = skb_shinfo(skb)->gso_type;
53055 -
53056 - if (offload_type & SKB_GSO_TCPV4) {
53057 - real_len = (((unsigned char *)ip_hdr(skb) - skb->data)
53058 - + ntohs(ip_hdr(skb)->tot_len));
53059 -
53060 - if (real_len < skb->len)
53061 - pskb_trim(skb, real_len);
53062 -
53063 - hdr_len = (skb_transport_offset(skb) + tcp_hdrlen(skb));
53064 - if (unlikely(skb->len == hdr_len)) {
53065 - /* only xsum need */
53066 - if (netif_msg_tx_queued(adapter))
53067 - dev_warn(&pdev->dev,
53068 - "IPV4 tso with zero data??\n");
53069 - goto check_sum;
53070 - } else {
53071 - ip_hdr(skb)->check = 0;
53072 - tcp_hdr(skb)->check = ~csum_tcpudp_magic(
53073 - ip_hdr(skb)->saddr,
53074 - ip_hdr(skb)->daddr,
53075 - 0, IPPROTO_TCP, 0);
53076 - (*tpd)->word1 |= 1 << TPD_IPV4_PACKET_SHIFT;
53077 - }
53078 - }
53079 -
53080 - if (offload_type & SKB_GSO_TCPV6) {
53081 - struct atl1c_tpd_ext_desc *etpd =
53082 - *(struct atl1c_tpd_ext_desc **)(tpd);
53083 -
53084 - memset(etpd, 0, sizeof(struct atl1c_tpd_ext_desc));
53085 - *tpd = atl1c_get_tpd(adapter, type);
53086 - ipv6_hdr(skb)->payload_len = 0;
53087 - /* check payload == 0 byte ? */
53088 - hdr_len = (skb_transport_offset(skb) + tcp_hdrlen(skb));
53089 - if (unlikely(skb->len == hdr_len)) {
53090 - /* only xsum need */
53091 - if (netif_msg_tx_queued(adapter))
53092 - dev_warn(&pdev->dev,
53093 - "IPV6 tso with zero data??\n");
53094 - goto check_sum;
53095 - } else
53096 - tcp_hdr(skb)->check = ~csum_ipv6_magic(
53097 - &ipv6_hdr(skb)->saddr,
53098 - &ipv6_hdr(skb)->daddr,
53099 - 0, IPPROTO_TCP, 0);
53100 - etpd->word1 |= 1 << TPD_LSO_EN_SHIFT;
53101 - etpd->word1 |= 1 << TPD_LSO_VER_SHIFT;
53102 - etpd->pkt_len = cpu_to_le32(skb->len);
53103 - (*tpd)->word1 |= 1 << TPD_LSO_VER_SHIFT;
53104 - }
53105 -
53106 - (*tpd)->word1 |= 1 << TPD_LSO_EN_SHIFT;
53107 - (*tpd)->word1 |= (skb_transport_offset(skb) & TPD_TCPHDR_OFFSET_MASK) <<
53108 - TPD_TCPHDR_OFFSET_SHIFT;
53109 - (*tpd)->word1 |= (skb_shinfo(skb)->gso_size & TPD_MSS_MASK) <<
53110 - TPD_MSS_SHIFT;
53111 - return 0;
53112 - }
53113 -
53114 -check_sum:
53115 - if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) {
53116 - u8 css, cso;
53117 - cso = skb_transport_offset(skb);
53118 -
53119 - if (unlikely(cso & 0x1)) {
53120 - if (netif_msg_tx_err(adapter))
53121 - dev_err(&adapter->pdev->dev,
53122 - "payload offset should not an event number\n");
53123 - return -1;
53124 - } else {
53125 - css = cso + skb->csum_offset;
53126 -
53127 - (*tpd)->word1 |= ((cso >> 1) & TPD_PLOADOFFSET_MASK) <<
53128 - TPD_PLOADOFFSET_SHIFT;
53129 - (*tpd)->word1 |= ((css >> 1) & TPD_CCSUM_OFFSET_MASK) <<
53130 - TPD_CCSUM_OFFSET_SHIFT;
53131 - (*tpd)->word1 |= 1 << TPD_CCSUM_EN_SHIFT;
53132 - }
53133 - }
53134 - return 0;
53135 -}
53136 -
53137 -static void atl1c_tx_map(struct atl1c_adapter *adapter,
53138 - struct sk_buff *skb, struct atl1c_tpd_desc *tpd,
53139 - enum atl1c_trans_queue type)
53140 -{
53141 - struct atl1c_tpd_desc *use_tpd = NULL;
53142 - struct atl1c_buffer *buffer_info = NULL;
53143 - u16 buf_len = skb_headlen(skb);
53144 - u16 map_len = 0;
53145 - u16 mapped_len = 0;
53146 - u16 hdr_len = 0;
53147 - u16 nr_frags;
53148 - u16 f;
53149 - int tso;
53150 -
53151 - nr_frags = skb_shinfo(skb)->nr_frags;
53152 - tso = (tpd->word1 >> TPD_LSO_EN_SHIFT) & TPD_LSO_EN_MASK;
53153 - if (tso) {
53154 - /* TSO */
53155 - map_len = hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb);
53156 - use_tpd = tpd;
53157 -
53158 - buffer_info = atl1c_get_tx_buffer(adapter, use_tpd);
53159 - buffer_info->length = map_len;
53160 - buffer_info->dma = pci_map_single(adapter->pdev,
53161 - skb->data, hdr_len, PCI_DMA_TODEVICE);
53162 - buffer_info->state = ATL1_BUFFER_BUSY;
53163 - mapped_len += map_len;
53164 - use_tpd->buffer_addr = cpu_to_le64(buffer_info->dma);
53165 - use_tpd->buffer_len = cpu_to_le16(buffer_info->length);
53166 - }
53167 -
53168 - if (mapped_len < buf_len) {
53169 - /* mapped_len == 0, means we should use the first tpd,
53170 - which is given by caller */
53171 - if (mapped_len == 0)
53172 - use_tpd = tpd;
53173 - else {
53174 - use_tpd = atl1c_get_tpd(adapter, type);
53175 - memcpy(use_tpd, tpd, sizeof(struct atl1c_tpd_desc));
53176 - use_tpd = atl1c_get_tpd(adapter, type);
53177 - memcpy(use_tpd, tpd, sizeof(struct atl1c_tpd_desc));
53178 - }
53179 - buffer_info = atl1c_get_tx_buffer(adapter, use_tpd);
53180 - buffer_info->length = buf_len - mapped_len;
53181 - buffer_info->dma =
53182 - pci_map_single(adapter->pdev, skb->data + mapped_len,
53183 - buffer_info->length, PCI_DMA_TODEVICE);
53184 - buffer_info->state = ATL1_BUFFER_BUSY;
53185 -
53186 - use_tpd->buffer_addr = cpu_to_le64(buffer_info->dma);
53187 - use_tpd->buffer_len = cpu_to_le16(buffer_info->length);
53188 - }
53189 -
53190 - for (f = 0; f < nr_frags; f++) {
53191 - struct skb_frag_struct *frag;
53192 -
53193 - frag = &skb_shinfo(skb)->frags[f];
53194 -
53195 - use_tpd = atl1c_get_tpd(adapter, type);
53196 - memcpy(use_tpd, tpd, sizeof(struct atl1c_tpd_desc));
53197 -
53198 - buffer_info = atl1c_get_tx_buffer(adapter, use_tpd);
53199 - buffer_info->length = frag->size;
53200 - buffer_info->dma =
53201 - pci_map_page(adapter->pdev, frag->page,
53202 - frag->page_offset,
53203 - buffer_info->length,
53204 - PCI_DMA_TODEVICE);
53205 - buffer_info->state = ATL1_BUFFER_BUSY;
53206 -
53207 - use_tpd->buffer_addr = cpu_to_le64(buffer_info->dma);
53208 - use_tpd->buffer_len = cpu_to_le16(buffer_info->length);
53209 - }
53210 -
53211 - /* The last tpd */
53212 - use_tpd->word1 |= 1 << TPD_EOP_SHIFT;
53213 - /* The last buffer info contain the skb address,
53214 - so it will be free after unmap */
53215 - buffer_info->skb = skb;
53216 -}
53217 -
53218 -static void atl1c_tx_queue(struct atl1c_adapter *adapter, struct sk_buff *skb,
53219 - struct atl1c_tpd_desc *tpd, enum atl1c_trans_queue type)
53220 -{
53221 - struct atl1c_tpd_ring *tpd_ring = &adapter->tpd_ring[type];
53222 - u32 prod_data;
53223 -
53224 - AT_READ_REG(&adapter->hw, REG_MB_PRIO_PROD_IDX, &prod_data);
53225 - switch (type) {
53226 - case atl1c_trans_high:
53227 - prod_data &= 0xFFFF0000;
53228 - prod_data |= tpd_ring->next_to_use & 0xFFFF;
53229 - break;
53230 - case atl1c_trans_normal:
53231 - prod_data &= 0x0000FFFF;
53232 - prod_data |= (tpd_ring->next_to_use & 0xFFFF) << 16;
53233 - break;
53234 - default:
53235 - break;
53236 - }
53237 - wmb();
53238 - AT_WRITE_REG(&adapter->hw, REG_MB_PRIO_PROD_IDX, prod_data);
53239 -}
53240 -
53241 -static int atl1c_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
53242 -{
53243 - struct atl1c_adapter *adapter = netdev_priv(netdev);
53244 - unsigned long flags;
53245 - u16 tpd_req = 1;
53246 - struct atl1c_tpd_desc *tpd;
53247 - enum atl1c_trans_queue type = atl1c_trans_normal;
53248 -
53249 - if (test_bit(__AT_DOWN, &adapter->flags)) {
53250 - dev_kfree_skb_any(skb);
53251 - return NETDEV_TX_OK;
53252 - }
53253 -
53254 - tpd_req = atl1c_cal_tpd_req(skb);
53255 - if (!spin_trylock_irqsave(&adapter->tx_lock, flags)) {
53256 - if (netif_msg_pktdata(adapter))
53257 - dev_info(&adapter->pdev->dev, "tx locked\n");
53258 - return NETDEV_TX_LOCKED;
53259 - }
53260 - if (skb->mark == 0x01)
53261 - type = atl1c_trans_high;
53262 - else
53263 - type = atl1c_trans_normal;
53264 -
53265 - if (atl1c_tpd_avail(adapter, type) < tpd_req) {
53266 - /* no enough descriptor, just stop queue */
53267 - netif_stop_queue(netdev);
53268 - spin_unlock_irqrestore(&adapter->tx_lock, flags);
53269 - return NETDEV_TX_BUSY;
53270 - }
53271 -
53272 - tpd = atl1c_get_tpd(adapter, type);
53273 -
53274 - /* do TSO and check sum */
53275 - if (atl1c_tso_csum(adapter, skb, &tpd, type) != 0) {
53276 - spin_unlock_irqrestore(&adapter->tx_lock, flags);
53277 - dev_kfree_skb_any(skb);
53278 - return NETDEV_TX_OK;
53279 - }
53280 -
53281 - if (unlikely(adapter->vlgrp && vlan_tx_tag_present(skb))) {
53282 - u16 vlan = vlan_tx_tag_get(skb);
53283 - __le16 tag;
53284 -
53285 - vlan = cpu_to_le16(vlan);
53286 - AT_VLAN_TO_TAG(vlan, tag);
53287 - tpd->word1 |= 1 << TPD_INS_VTAG_SHIFT;
53288 - tpd->vlan_tag = tag;
53289 - }
53290 -
53291 - if (skb_network_offset(skb) != ETH_HLEN)
53292 - tpd->word1 |= 1 << TPD_ETH_TYPE_SHIFT; /* Ethernet frame */
53293 -
53294 - atl1c_tx_map(adapter, skb, tpd, type);
53295 - atl1c_tx_queue(adapter, skb, tpd, type);
53296 -
53297 - netdev->trans_start = jiffies;
53298 - spin_unlock_irqrestore(&adapter->tx_lock, flags);
53299 - return NETDEV_TX_OK;
53300 -}
53301 -
53302 -static void atl1c_free_irq(struct atl1c_adapter *adapter)
53303 -{
53304 - struct net_device *netdev = adapter->netdev;
53305 -
53306 - free_irq(adapter->pdev->irq, netdev);
53307 -
53308 - if (adapter->have_msi)
53309 - pci_disable_msi(adapter->pdev);
53310 -}
53311 -
53312 -static int atl1c_request_irq(struct atl1c_adapter *adapter)
53313 -{
53314 - struct pci_dev *pdev = adapter->pdev;
53315 - struct net_device *netdev = adapter->netdev;
53316 - int flags = 0;
53317 - int err = 0;
53318 -
53319 - adapter->have_msi = true;
53320 - err = pci_enable_msi(adapter->pdev);
53321 - if (err) {
53322 - if (netif_msg_ifup(adapter))
53323 - dev_err(&pdev->dev,
53324 - "Unable to allocate MSI interrupt Error: %d\n",
53325 - err);
53326 - adapter->have_msi = false;
53327 - } else
53328 - netdev->irq = pdev->irq;
53329 -
53330 - if (!adapter->have_msi)
53331 - flags |= IRQF_SHARED;
53332 - err = request_irq(adapter->pdev->irq, &atl1c_intr, flags,
53333 - netdev->name, netdev);
53334 - if (err) {
53335 - if (netif_msg_ifup(adapter))
53336 - dev_err(&pdev->dev,
53337 - "Unable to allocate interrupt Error: %d\n",
53338 - err);
53339 - if (adapter->have_msi)
53340 - pci_disable_msi(adapter->pdev);
53341 - return err;
53342 - }
53343 - if (netif_msg_ifup(adapter))
53344 - dev_dbg(&pdev->dev, "atl1c_request_irq OK\n");
53345 - return err;
53346 -}
53347 -
53348 -int atl1c_up(struct atl1c_adapter *adapter)
53349 -{
53350 - struct net_device *netdev = adapter->netdev;
53351 - int num;
53352 - int err;
53353 - int i;
53354 -
53355 - netif_carrier_off(netdev);
53356 - atl1c_init_ring_ptrs(adapter);
53357 - atl1c_set_multi(netdev);
53358 - atl1c_restore_vlan(adapter);
53359 -
53360 - for (i = 0; i < adapter->num_rx_queues; i++) {
53361 - num = atl1c_alloc_rx_buffer(adapter, i);
53362 - if (unlikely(num == 0)) {
53363 - err = -ENOMEM;
53364 - goto err_alloc_rx;
53365 - }
53366 - }
53367 -
53368 - if (atl1c_configure(adapter)) {
53369 - err = -EIO;
53370 - goto err_up;
53371 - }
53372 -
53373 - err = atl1c_request_irq(adapter);
53374 - if (unlikely(err))
53375 - goto err_up;
53376 -
53377 - clear_bit(__AT_DOWN, &adapter->flags);
53378 - napi_enable(&adapter->napi);
53379 - atl1c_irq_enable(adapter);
53380 - atl1c_check_link_status(adapter);
53381 - netif_start_queue(netdev);
53382 - return err;
53383 -
53384 -err_up:
53385 -err_alloc_rx:
53386 - atl1c_clean_rx_ring(adapter);
53387 - return err;
53388 -}
53389 -
53390 -void atl1c_down(struct atl1c_adapter *adapter)
53391 -{
53392 - struct net_device *netdev = adapter->netdev;
53393 -
53394 - atl1c_del_timer(adapter);
53395 - atl1c_cancel_work(adapter);
53396 -
53397 - /* signal that we're down so the interrupt handler does not
53398 - * reschedule our watchdog timer */
53399 - set_bit(__AT_DOWN, &adapter->flags);
53400 - netif_carrier_off(netdev);
53401 - napi_disable(&adapter->napi);
53402 - atl1c_irq_disable(adapter);
53403 - atl1c_free_irq(adapter);
53404 - AT_WRITE_REG(&adapter->hw, REG_ISR, ISR_DIS_INT);
53405 - /* reset MAC to disable all RX/TX */
53406 - atl1c_reset_mac(&adapter->hw);
53407 - msleep(1);
53408 -
53409 - adapter->link_speed = SPEED_0;
53410 - adapter->link_duplex = -1;
53411 - atl1c_clean_tx_ring(adapter, atl1c_trans_normal);
53412 - atl1c_clean_tx_ring(adapter, atl1c_trans_high);
53413 - atl1c_clean_rx_ring(adapter);
53414 -}
53415 -
53416 -/*
53417 - * atl1c_open - Called when a network interface is made active
53418 - * @netdev: network interface device structure
53419 - *
53420 - * Returns 0 on success, negative value on failure
53421 - *
53422 - * The open entry point is called when a network interface is made
53423 - * active by the system (IFF_UP). At this point all resources needed
53424 - * for transmit and receive operations are allocated, the interrupt
53425 - * handler is registered with the OS, the watchdog timer is started,
53426 - * and the stack is notified that the interface is ready.
53427 - */
53428 -static int atl1c_open(struct net_device *netdev)
53429 -{
53430 - struct atl1c_adapter *adapter = netdev_priv(netdev);
53431 - int err;
53432 -
53433 - /* disallow open during test */
53434 - if (test_bit(__AT_TESTING, &adapter->flags))
53435 - return -EBUSY;
53436 -
53437 - /* allocate rx/tx dma buffer & descriptors */
53438 - err = atl1c_setup_ring_resources(adapter);
53439 - if (unlikely(err))
53440 - return err;
53441 -
53442 - err = atl1c_up(adapter);
53443 - if (unlikely(err))
53444 - goto err_up;
53445 -
53446 - if (adapter->hw.ctrl_flags & ATL1C_FPGA_VERSION) {
53447 - u32 phy_data;
53448 -
53449 - AT_READ_REG(&adapter->hw, REG_MDIO_CTRL, &phy_data);
53450 - phy_data |= MDIO_AP_EN;
53451 - AT_WRITE_REG(&adapter->hw, REG_MDIO_CTRL, phy_data);
53452 - }
53453 - return 0;
53454 -
53455 -err_up:
53456 - atl1c_free_irq(adapter);
53457 - atl1c_free_ring_resources(adapter);
53458 - atl1c_reset_mac(&adapter->hw);
53459 - return err;
53460 -}
53461 -
53462 -/*
53463 - * atl1c_close - Disables a network interface
53464 - * @netdev: network interface device structure
53465 - *
53466 - * Returns 0, this is not allowed to fail
53467 - *
53468 - * The close entry point is called when an interface is de-activated
53469 - * by the OS. The hardware is still under the drivers control, but
53470 - * needs to be disabled. A global MAC reset is issued to stop the
53471 - * hardware, and all transmit and receive resources are freed.
53472 - */
53473 -static int atl1c_close(struct net_device *netdev)
53474 -{
53475 - struct atl1c_adapter *adapter = netdev_priv(netdev);
53476 -
53477 - WARN_ON(test_bit(__AT_RESETTING, &adapter->flags));
53478 - atl1c_down(adapter);
53479 - atl1c_free_ring_resources(adapter);
53480 - return 0;
53481 -}
53482 -
53483 -static int atl1c_suspend(struct pci_dev *pdev, pm_message_t state)
53484 -{
53485 - struct net_device *netdev = pci_get_drvdata(pdev);
53486 - struct atl1c_adapter *adapter = netdev_priv(netdev);
53487 - struct atl1c_hw *hw = &adapter->hw;
53488 - u32 ctrl;
53489 - u32 mac_ctrl_data;
53490 - u32 master_ctrl_data;
53491 - u32 wol_ctrl_data;
53492 - u16 mii_bmsr_data;
53493 - u16 save_autoneg_advertised;
53494 - u16 mii_intr_status_data;
53495 - u32 wufc = adapter->wol;
53496 - u32 i;
53497 - int retval = 0;
53498 -
53499 - if (netif_running(netdev)) {
53500 - WARN_ON(test_bit(__AT_RESETTING, &adapter->flags));
53501 - atl1c_down(adapter);
53502 - }
53503 - netif_device_detach(netdev);
53504 - atl1c_disable_l0s_l1(hw);
53505 - retval = pci_save_state(pdev);
53506 - if (retval)
53507 - return retval;
53508 - if (wufc) {
53509 - AT_READ_REG(hw, REG_MASTER_CTRL, &master_ctrl_data);
53510 - master_ctrl_data &= ~MASTER_CTRL_CLK_SEL_DIS;
53511 -
53512 - /* get link status */
53513 - atl1c_read_phy_reg(hw, MII_BMSR, (u16 *)&mii_bmsr_data);
53514 - atl1c_read_phy_reg(hw, MII_BMSR, (u16 *)&mii_bmsr_data);
53515 - save_autoneg_advertised = hw->autoneg_advertised;
53516 - hw->autoneg_advertised = ADVERTISED_10baseT_Half;
53517 - if (atl1c_restart_autoneg(hw) != 0)
53518 - if (netif_msg_link(adapter))
53519 - dev_warn(&pdev->dev, "phy autoneg failed\n");
53520 - hw->phy_configured = false; /* re-init PHY when resume */
53521 - hw->autoneg_advertised = save_autoneg_advertised;
53522 - /* turn on magic packet wol */
53523 - if (wufc & AT_WUFC_MAG)
53524 - wol_ctrl_data = WOL_MAGIC_EN | WOL_MAGIC_PME_EN;
53525 -
53526 - if (wufc & AT_WUFC_LNKC) {
53527 - for (i = 0; i < AT_SUSPEND_LINK_TIMEOUT; i++) {
53528 - msleep(100);
53529 - atl1c_read_phy_reg(hw, MII_BMSR,
53530 - (u16 *)&mii_bmsr_data);
53531 - if (mii_bmsr_data & BMSR_LSTATUS)
53532 - break;
53533 - }
53534 - if ((mii_bmsr_data & BMSR_LSTATUS) == 0)
53535 - if (netif_msg_link(adapter))
53536 - dev_warn(&pdev->dev,
53537 - "%s: Link may change"
53538 - "when suspend\n",
53539 - atl1c_driver_name);
53540 - wol_ctrl_data |= WOL_LINK_CHG_EN | WOL_LINK_CHG_PME_EN;
53541 - /* only link up can wake up */
53542 - if (atl1c_write_phy_reg(hw, MII_IER, IER_LINK_UP) != 0) {
53543 - if (netif_msg_link(adapter))
53544 - dev_err(&pdev->dev,
53545 - "%s: read write phy "
53546 - "register failed.\n",
53547 - atl1c_driver_name);
53548 - goto wol_dis;
53549 - }
53550 - }
53551 - /* clear phy interrupt */
53552 - atl1c_read_phy_reg(hw, MII_ISR, &mii_intr_status_data);
53553 - /* Config MAC Ctrl register */
53554 - mac_ctrl_data = MAC_CTRL_RX_EN;
53555 - /* set to 10/100M halt duplex */
53556 - mac_ctrl_data |= atl1c_mac_speed_10_100 << MAC_CTRL_SPEED_SHIFT;
53557 - mac_ctrl_data |= (((u32)adapter->hw.preamble_len &
53558 - MAC_CTRL_PRMLEN_MASK) <<
53559 - MAC_CTRL_PRMLEN_SHIFT);
53560 -
53561 - if (adapter->vlgrp)
53562 - mac_ctrl_data |= MAC_CTRL_RMV_VLAN;
53563 -
53564 - /* magic packet maybe Broadcast&multicast&Unicast frame */
53565 - if (wufc & AT_WUFC_MAG)
53566 - mac_ctrl_data |= MAC_CTRL_BC_EN;
53567 -
53568 - if (netif_msg_hw(adapter))
53569 - dev_dbg(&pdev->dev,
53570 - "%s: suspend MAC=0x%x\n",
53571 - atl1c_driver_name, mac_ctrl_data);
53572 - AT_WRITE_REG(hw, REG_MASTER_CTRL, master_ctrl_data);
53573 - AT_WRITE_REG(hw, REG_WOL_CTRL, wol_ctrl_data);
53574 - AT_WRITE_REG(hw, REG_MAC_CTRL, mac_ctrl_data);
53575 -
53576 - /* pcie patch */
53577 - AT_READ_REG(hw, REG_PCIE_PHYMISC, &ctrl);
53578 - ctrl |= PCIE_PHYMISC_FORCE_RCV_DET;
53579 - AT_WRITE_REG(hw, REG_PCIE_PHYMISC, ctrl);
53580 -
53581 - pci_enable_wake(pdev, pci_choose_state(pdev, state), 1);
53582 - goto suspend_exit;
53583 - }
53584 -wol_dis:
53585 -
53586 - /* WOL disabled */
53587 - AT_WRITE_REG(hw, REG_WOL_CTRL, 0);
53588 -
53589 - /* pcie patch */
53590 - AT_READ_REG(hw, REG_PCIE_PHYMISC, &ctrl);
53591 - ctrl |= PCIE_PHYMISC_FORCE_RCV_DET;
53592 - AT_WRITE_REG(hw, REG_PCIE_PHYMISC, ctrl);
53593 -
53594 - atl1c_phy_disable(hw);
53595 - hw->phy_configured = false; /* re-init PHY when resume */
53596 -
53597 - pci_enable_wake(pdev, pci_choose_state(pdev, state), 0);
53598 -suspend_exit:
53599 -
53600 - pci_disable_device(pdev);
53601 - pci_set_power_state(pdev, pci_choose_state(pdev, state));
53602 -
53603 - return 0;
53604 -}
53605 -
53606 -static int atl1c_resume(struct pci_dev *pdev)
53607 -{
53608 - struct net_device *netdev = pci_get_drvdata(pdev);
53609 - struct atl1c_adapter *adapter = netdev_priv(netdev);
53610 -
53611 - pci_set_power_state(pdev, PCI_D0);
53612 - pci_restore_state(pdev);
53613 - pci_enable_wake(pdev, PCI_D3hot, 0);
53614 - pci_enable_wake(pdev, PCI_D3cold, 0);
53615 -
53616 - AT_WRITE_REG(&adapter->hw, REG_WOL_CTRL, 0);
53617 -
53618 - atl1c_phy_reset(&adapter->hw);
53619 - atl1c_reset_mac(&adapter->hw);
53620 - netif_device_attach(netdev);
53621 - if (netif_running(netdev))
53622 - atl1c_up(adapter);
53623 -
53624 - return 0;
53625 -}
53626 -
53627 -static void atl1c_shutdown(struct pci_dev *pdev)
53628 -{
53629 - atl1c_suspend(pdev, PMSG_SUSPEND);
53630 -}
53631 -
53632 -static const struct net_device_ops atl1c_netdev_ops = {
53633 - .ndo_open = atl1c_open,
53634 - .ndo_stop = atl1c_close,
53635 - .ndo_validate_addr = eth_validate_addr,
53636 - .ndo_start_xmit = atl1c_xmit_frame,
53637 - .ndo_set_mac_address = atl1c_set_mac_addr,
53638 - .ndo_set_multicast_list = atl1c_set_multi,
53639 - .ndo_change_mtu = atl1c_change_mtu,
53640 - .ndo_do_ioctl = atl1c_ioctl,
53641 - .ndo_tx_timeout = atl1c_tx_timeout,
53642 - .ndo_get_stats = atl1c_get_stats,
53643 - .ndo_vlan_rx_register = atl1c_vlan_rx_register,
53644 -#ifdef CONFIG_NET_POLL_CONTROLLER
53645 - .ndo_poll_controller = atl1c_netpoll,
53646 -#endif
53647 -};
53648 -
53649 -static int atl1c_init_netdev(struct net_device *netdev, struct pci_dev *pdev)
53650 -{
53651 - SET_NETDEV_DEV(netdev, &pdev->dev);
53652 - pci_set_drvdata(pdev, netdev);
53653 -
53654 - netdev->irq = pdev->irq;
53655 - netdev->netdev_ops = &atl1c_netdev_ops;
53656 - netdev->watchdog_timeo = AT_TX_WATCHDOG;
53657 - atl1c_set_ethtool_ops(netdev);
53658 -
53659 - /* TODO: add when ready */
53660 - netdev->features = NETIF_F_SG |
53661 - NETIF_F_HW_CSUM |
53662 - NETIF_F_HW_VLAN_TX |
53663 - NETIF_F_HW_VLAN_RX |
53664 - NETIF_F_TSO |
53665 - NETIF_F_TSO6;
53666 - return 0;
53667 -}
53668 -
53669 -/*
53670 - * atl1c_probe - Device Initialization Routine
53671 - * @pdev: PCI device information struct
53672 - * @ent: entry in atl1c_pci_tbl
53673 - *
53674 - * Returns 0 on success, negative on failure
53675 - *
53676 - * atl1c_probe initializes an adapter identified by a pci_dev structure.
53677 - * The OS initialization, configuring of the adapter private structure,
53678 - * and a hardware reset occur.
53679 - */
53680 -static int __devinit atl1c_probe(struct pci_dev *pdev,
53681 - const struct pci_device_id *ent)
53682 -{
53683 - struct net_device *netdev;
53684 - struct atl1c_adapter *adapter;
53685 - static int cards_found;
53686 -
53687 - int err = 0;
53688 -
53689 - /* enable device (incl. PCI PM wakeup and hotplug setup) */
53690 - err = pci_enable_device_mem(pdev);
53691 - if (err) {
53692 - dev_err(&pdev->dev, "cannot enable PCI device\n");
53693 - return err;
53694 - }
53695 -
53696 - /*
53697 - * The atl1c chip can DMA to 64-bit addresses, but it uses a single
53698 - * shared register for the high 32 bits, so only a single, aligned,
53699 - * 4 GB physical address range can be used at a time.
53700 - *
53701 - * Supporting 64-bit DMA on this hardware is more trouble than it's
53702 - * worth. It is far easier to limit to 32-bit DMA than update
53703 - * various kernel subsystems to support the mechanics required by a
53704 - * fixed-high-32-bit system.
53705 - */
53706 - if ((pci_set_dma_mask(pdev, DMA_32BIT_MASK) != 0) ||
53707 - (pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK) != 0)) {
53708 - dev_err(&pdev->dev, "No usable DMA configuration,aborting\n");
53709 - goto err_dma;
53710 - }
53711 -
53712 - err = pci_request_regions(pdev, atl1c_driver_name);
53713 - if (err) {
53714 - dev_err(&pdev->dev, "cannot obtain PCI resources\n");
53715 - goto err_pci_reg;
53716 - }
53717 -
53718 - pci_set_master(pdev);
53719 -
53720 - netdev = alloc_etherdev(sizeof(struct atl1c_adapter));
53721 - if (netdev == NULL) {
53722 - err = -ENOMEM;
53723 - dev_err(&pdev->dev, "etherdev alloc failed\n");
53724 - goto err_alloc_etherdev;
53725 - }
53726 -
53727 - err = atl1c_init_netdev(netdev, pdev);
53728 - if (err) {
53729 - dev_err(&pdev->dev, "init netdevice failed\n");
53730 - goto err_init_netdev;
53731 - }
53732 - adapter = netdev_priv(netdev);
53733 - adapter->bd_number = cards_found;
53734 - adapter->netdev = netdev;
53735 - adapter->pdev = pdev;
53736 - adapter->hw.adapter = adapter;
53737 - adapter->msg_enable = netif_msg_init(-1, atl1c_default_msg);
53738 - adapter->hw.hw_addr = ioremap(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0));
53739 - if (!adapter->hw.hw_addr) {
53740 - err = -EIO;
53741 - dev_err(&pdev->dev, "cannot map device registers\n");
53742 - goto err_ioremap;
53743 - }
53744 - netdev->base_addr = (unsigned long)adapter->hw.hw_addr;
53745 -
53746 - /* init mii data */
53747 - adapter->mii.dev = netdev;
53748 - adapter->mii.mdio_read = atl1c_mdio_read;
53749 - adapter->mii.mdio_write = atl1c_mdio_write;
53750 - adapter->mii.phy_id_mask = 0x1f;
53751 - adapter->mii.reg_num_mask = MDIO_REG_ADDR_MASK;
53752 - netif_napi_add(netdev, &adapter->napi, atl1c_clean, 64);
53753 - setup_timer(&adapter->phy_config_timer, atl1c_phy_config,
53754 - (unsigned long)adapter);
53755 - /* setup the private structure */
53756 - err = atl1c_sw_init(adapter);
53757 - if (err) {
53758 - dev_err(&pdev->dev, "net device private data init failed\n");
53759 - goto err_sw_init;
53760 - }
53761 - atl1c_reset_pcie(&adapter->hw, ATL1C_PCIE_L0S_L1_DISABLE |
53762 - ATL1C_PCIE_PHY_RESET);
53763 -
53764 - /* Init GPHY as early as possible due to power saving issue */
53765 - atl1c_phy_reset(&adapter->hw);
53766 -
53767 - err = atl1c_reset_mac(&adapter->hw);
53768 - if (err) {
53769 - err = -EIO;
53770 - goto err_reset;
53771 - }
53772 -
53773 - device_init_wakeup(&pdev->dev, 1);
53774 - /* reset the controller to
53775 - * put the device in a known good starting state */
53776 - err = atl1c_phy_init(&adapter->hw);
53777 - if (err) {
53778 - err = -EIO;
53779 - goto err_reset;
53780 - }
53781 - if (atl1c_read_mac_addr(&adapter->hw) != 0) {
53782 - err = -EIO;
53783 - dev_err(&pdev->dev, "get mac address failed\n");
53784 - goto err_eeprom;
53785 - }
53786 - memcpy(netdev->dev_addr, adapter->hw.mac_addr, netdev->addr_len);
53787 - memcpy(netdev->perm_addr, adapter->hw.mac_addr, netdev->addr_len);
53788 - if (netif_msg_probe(adapter))
53789 - dev_dbg(&pdev->dev,
53790 - "mac address : %02x-%02x-%02x-%02x-%02x-%02x\n",
53791 - adapter->hw.mac_addr[0], adapter->hw.mac_addr[1],
53792 - adapter->hw.mac_addr[2], adapter->hw.mac_addr[3],
53793 - adapter->hw.mac_addr[4], adapter->hw.mac_addr[5]);
53794 -
53795 - atl1c_hw_set_mac_addr(&adapter->hw);
53796 - INIT_WORK(&adapter->reset_task, atl1c_reset_task);
53797 - INIT_WORK(&adapter->link_chg_task, atl1c_link_chg_task);
53798 - err = register_netdev(netdev);
53799 - if (err) {
53800 - dev_err(&pdev->dev, "register netdevice failed\n");
53801 - goto err_register;
53802 - }
53803 -
53804 - if (netif_msg_probe(adapter))
53805 - dev_info(&pdev->dev, "version %s\n", ATL1C_DRV_VERSION);
53806 - cards_found++;
53807 - return 0;
53808 -
53809 -err_reset:
53810 -err_register:
53811 -err_sw_init:
53812 -err_eeprom:
53813 - iounmap(adapter->hw.hw_addr);
53814 -err_init_netdev:
53815 -err_ioremap:
53816 - free_netdev(netdev);
53817 -err_alloc_etherdev:
53818 - pci_release_regions(pdev);
53819 -err_pci_reg:
53820 -err_dma:
53821 - pci_disable_device(pdev);
53822 - return err;
53823 -}
53824 -
53825 -/*
53826 - * atl1c_remove - Device Removal Routine
53827 - * @pdev: PCI device information struct
53828 - *
53829 - * atl1c_remove is called by the PCI subsystem to alert the driver
53830 - * that it should release a PCI device. The could be caused by a
53831 - * Hot-Plug event, or because the driver is going to be removed from
53832 - * memory.
53833 - */
53834 -static void __devexit atl1c_remove(struct pci_dev *pdev)
53835 -{
53836 - struct net_device *netdev = pci_get_drvdata(pdev);
53837 - struct atl1c_adapter *adapter = netdev_priv(netdev);
53838 -
53839 - unregister_netdev(netdev);
53840 - atl1c_phy_disable(&adapter->hw);
53841 -
53842 - iounmap(adapter->hw.hw_addr);
53843 -
53844 - pci_release_regions(pdev);
53845 - pci_disable_device(pdev);
53846 - free_netdev(netdev);
53847 -}
53848 -
53849 -/*
53850 - * atl1c_io_error_detected - called when PCI error is detected
53851 - * @pdev: Pointer to PCI device
53852 - * @state: The current pci connection state
53853 - *
53854 - * This function is called after a PCI bus error affecting
53855 - * this device has been detected.
53856 - */
53857 -static pci_ers_result_t atl1c_io_error_detected(struct pci_dev *pdev,
53858 - pci_channel_state_t state)
53859 -{
53860 - struct net_device *netdev = pci_get_drvdata(pdev);
53861 - struct atl1c_adapter *adapter = netdev_priv(netdev);
53862 -
53863 - netif_device_detach(netdev);
53864 -
53865 - if (netif_running(netdev))
53866 - atl1c_down(adapter);
53867 -
53868 - pci_disable_device(pdev);
53869 -
53870 - /* Request a slot slot reset. */
53871 - return PCI_ERS_RESULT_NEED_RESET;
53872 -}
53873 -
53874 -/*
53875 - * atl1c_io_slot_reset - called after the pci bus has been reset.
53876 - * @pdev: Pointer to PCI device
53877 - *
53878 - * Restart the card from scratch, as if from a cold-boot. Implementation
53879 - * resembles the first-half of the e1000_resume routine.
53880 - */
53881 -static pci_ers_result_t atl1c_io_slot_reset(struct pci_dev *pdev)
53882 -{
53883 - struct net_device *netdev = pci_get_drvdata(pdev);
53884 - struct atl1c_adapter *adapter = netdev_priv(netdev);
53885 -
53886 - if (pci_enable_device(pdev)) {
53887 - if (netif_msg_hw(adapter))
53888 - dev_err(&pdev->dev,
53889 - "Cannot re-enable PCI device after reset\n");
53890 - return PCI_ERS_RESULT_DISCONNECT;
53891 - }
53892 - pci_set_master(pdev);
53893 -
53894 - pci_enable_wake(pdev, PCI_D3hot, 0);
53895 - pci_enable_wake(pdev, PCI_D3cold, 0);
53896 -
53897 - atl1c_reset_mac(&adapter->hw);
53898 -
53899 - return PCI_ERS_RESULT_RECOVERED;
53900 -}
53901 -
53902 -/*
53903 - * atl1c_io_resume - called when traffic can start flowing again.
53904 - * @pdev: Pointer to PCI device
53905 - *
53906 - * This callback is called when the error recovery driver tells us that
53907 - * its OK to resume normal operation. Implementation resembles the
53908 - * second-half of the atl1c_resume routine.
53909 - */
53910 -static void atl1c_io_resume(struct pci_dev *pdev)
53911 -{
53912 - struct net_device *netdev = pci_get_drvdata(pdev);
53913 - struct atl1c_adapter *adapter = netdev_priv(netdev);
53914 -
53915 - if (netif_running(netdev)) {
53916 - if (atl1c_up(adapter)) {
53917 - if (netif_msg_hw(adapter))
53918 - dev_err(&pdev->dev,
53919 - "Cannot bring device back up after reset\n");
53920 - return;
53921 - }
53922 - }
53923 -
53924 - netif_device_attach(netdev);
53925 -}
53926 -
53927 -static struct pci_error_handlers atl1c_err_handler = {
53928 - .error_detected = atl1c_io_error_detected,
53929 - .slot_reset = atl1c_io_slot_reset,
53930 - .resume = atl1c_io_resume,
53931 -};
53932 -
53933 -static struct pci_driver atl1c_driver = {
53934 - .name = atl1c_driver_name,
53935 - .id_table = atl1c_pci_tbl,
53936 - .probe = atl1c_probe,
53937 - .remove = __devexit_p(atl1c_remove),
53938 - /* Power Managment Hooks */
53939 - .suspend = atl1c_suspend,
53940 - .resume = atl1c_resume,
53941 - .shutdown = atl1c_shutdown,
53942 - .err_handler = &atl1c_err_handler
53943 -};
53944 -
53945 -/*
53946 - * atl1c_init_module - Driver Registration Routine
53947 - *
53948 - * atl1c_init_module is the first routine called when the driver is
53949 - * loaded. All it does is register with the PCI subsystem.
53950 - */
53951 -static int __init atl1c_init_module(void)
53952 -{
53953 - return pci_register_driver(&atl1c_driver);
53954 -}
53955 -
53956 -/*
53957 - * atl1c_exit_module - Driver Exit Cleanup Routine
53958 - *
53959 - * atl1c_exit_module is called just before the driver is removed
53960 - * from memory.
53961 - */
53962 -static void __exit atl1c_exit_module(void)
53963 -{
53964 - pci_unregister_driver(&atl1c_driver);
53965 -}
53966 -
53967 -module_init(atl1c_init_module);
53968 -module_exit(atl1c_exit_module);
53969 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/atl1c/Makefile linux-2.6.29-rc3.owrt/drivers/net/atl1c/Makefile
53970 --- linux-2.6.29.owrt/drivers/net/atl1c/Makefile 2009-05-10 22:04:38.000000000 +0200
53971 +++ linux-2.6.29-rc3.owrt/drivers/net/atl1c/Makefile 1970-01-01 01:00:00.000000000 +0100
53972 @@ -1,2 +0,0 @@
53973 -obj-$(CONFIG_ATL1C) += atl1c.o
53974 -atl1c-objs := atl1c_main.o atl1c_hw.o atl1c_ethtool.o
53975 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/b44.c linux-2.6.29-rc3.owrt/drivers/net/b44.c
53976 --- linux-2.6.29.owrt/drivers/net/b44.c 2009-05-10 22:04:38.000000000 +0200
53977 +++ linux-2.6.29-rc3.owrt/drivers/net/b44.c 2009-05-10 23:48:28.000000000 +0200
53978 @@ -1264,14 +1264,8 @@
53979 static void b44_chip_reset(struct b44 *bp, int reset_kind)
53980 {
53981 struct ssb_device *sdev = bp->sdev;
53982 - bool was_enabled;
53983
53984 - was_enabled = ssb_device_is_enabled(bp->sdev);
53985 -
53986 - ssb_device_enable(bp->sdev, 0);
53987 - ssb_pcicore_dev_irqvecs_enable(&sdev->bus->pcicore, sdev);
53988 -
53989 - if (was_enabled) {
53990 + if (ssb_device_is_enabled(bp->sdev)) {
53991 bw32(bp, B44_RCV_LAZY, 0);
53992 bw32(bp, B44_ENET_CTRL, ENET_CTRL_DISABLE);
53993 b44_wait_bit(bp, B44_ENET_CTRL, ENET_CTRL_DISABLE, 200, 1);
53994 @@ -1283,8 +1277,10 @@
53995 }
53996 bw32(bp, B44_DMARX_CTRL, 0);
53997 bp->rx_prod = bp->rx_cons = 0;
53998 - }
53999 + } else
54000 + ssb_pcicore_dev_irqvecs_enable(&sdev->bus->pcicore, sdev);
54001
54002 + ssb_device_enable(bp->sdev, 0);
54003 b44_clear_stats(bp);
54004
54005 /*
54006 @@ -2240,7 +2236,6 @@
54007 struct net_device *dev = ssb_get_drvdata(sdev);
54008
54009 unregister_netdev(dev);
54010 - ssb_device_disable(sdev, 0);
54011 ssb_bus_may_powerdown(sdev->bus);
54012 free_netdev(dev);
54013 ssb_pcihost_set_power_state(sdev, PCI_D3hot);
54014 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/benet/be_cmds.c linux-2.6.29-rc3.owrt/drivers/net/benet/be_cmds.c
54015 --- linux-2.6.29.owrt/drivers/net/benet/be_cmds.c 2009-05-10 22:04:38.000000000 +0200
54016 +++ linux-2.6.29-rc3.owrt/drivers/net/benet/be_cmds.c 1970-01-01 01:00:00.000000000 +0100
54017 @@ -1,861 +0,0 @@
54018 -/*
54019 - * Copyright (C) 2005 - 2009 ServerEngines
54020 - * All rights reserved.
54021 - *
54022 - * This program is free software; you can redistribute it and/or
54023 - * modify it under the terms of the GNU General Public License version 2
54024 - * as published by the Free Software Foundation. The full GNU General
54025 - * Public License is included in this distribution in the file called COPYING.
54026 - *
54027 - * Contact Information:
54028 - * linux-drivers@serverengines.com
54029 - *
54030 - * ServerEngines
54031 - * 209 N. Fair Oaks Ave
54032 - * Sunnyvale, CA 94085
54033 - */
54034 -
54035 -#include "be.h"
54036 -
54037 -static int be_mbox_db_ready_wait(void __iomem *db)
54038 -{
54039 - int cnt = 0, wait = 5;
54040 - u32 ready;
54041 -
54042 - do {
54043 - ready = ioread32(db) & MPU_MAILBOX_DB_RDY_MASK;
54044 - if (ready)
54045 - break;
54046 -
54047 - if (cnt > 200000) {
54048 - printk(KERN_WARNING DRV_NAME
54049 - ": mbox_db poll timed out\n");
54050 - return -1;
54051 - }
54052 -
54053 - if (cnt > 50)
54054 - wait = 200;
54055 - cnt += wait;
54056 - udelay(wait);
54057 - } while (true);
54058 -
54059 - return 0;
54060 -}
54061 -
54062 -/*
54063 - * Insert the mailbox address into the doorbell in two steps
54064 - */
54065 -static int be_mbox_db_ring(struct be_ctrl_info *ctrl)
54066 -{
54067 - int status;
54068 - u16 compl_status, extd_status;
54069 - u32 val = 0;
54070 - void __iomem *db = ctrl->db + MPU_MAILBOX_DB_OFFSET;
54071 - struct be_dma_mem *mbox_mem = &ctrl->mbox_mem;
54072 - struct be_mcc_mailbox *mbox = mbox_mem->va;
54073 - struct be_mcc_cq_entry *cqe = &mbox->cqe;
54074 -
54075 - memset(cqe, 0, sizeof(*cqe));
54076 -
54077 - val &= ~MPU_MAILBOX_DB_RDY_MASK;
54078 - val |= MPU_MAILBOX_DB_HI_MASK;
54079 - /* at bits 2 - 31 place mbox dma addr msb bits 34 - 63 */
54080 - val |= (upper_32_bits(mbox_mem->dma) >> 2) << 2;
54081 - iowrite32(val, db);
54082 -
54083 - /* wait for ready to be set */
54084 - status = be_mbox_db_ready_wait(db);
54085 - if (status != 0)
54086 - return status;
54087 -
54088 - val = 0;
54089 - val &= ~MPU_MAILBOX_DB_RDY_MASK;
54090 - val &= ~MPU_MAILBOX_DB_HI_MASK;
54091 - /* at bits 2 - 31 place mbox dma addr lsb bits 4 - 33 */
54092 - val |= (u32)(mbox_mem->dma >> 4) << 2;
54093 - iowrite32(val, db);
54094 -
54095 - status = be_mbox_db_ready_wait(db);
54096 - if (status != 0)
54097 - return status;
54098 -
54099 - /* compl entry has been made now */
54100 - be_dws_le_to_cpu(cqe, sizeof(*cqe));
54101 - if (!(cqe->flags & CQE_FLAGS_VALID_MASK)) {
54102 - printk(KERN_WARNING DRV_NAME ": ERROR invalid mbox compl\n");
54103 - return -1;
54104 - }
54105 -
54106 - compl_status = (cqe->status >> CQE_STATUS_COMPL_SHIFT) &
54107 - CQE_STATUS_COMPL_MASK;
54108 - if (compl_status != MCC_STATUS_SUCCESS) {
54109 - extd_status = (cqe->status >> CQE_STATUS_EXTD_SHIFT) &
54110 - CQE_STATUS_EXTD_MASK;
54111 - printk(KERN_WARNING DRV_NAME
54112 - ": ERROR in cmd compl. status(compl/extd)=%d/%d\n",
54113 - compl_status, extd_status);
54114 - }
54115 -
54116 - return compl_status;
54117 -}
54118 -
54119 -static int be_POST_stage_get(struct be_ctrl_info *ctrl, u16 *stage)
54120 -{
54121 - u32 sem = ioread32(ctrl->csr + MPU_EP_SEMAPHORE_OFFSET);
54122 -
54123 - *stage = sem & EP_SEMAPHORE_POST_STAGE_MASK;
54124 - if ((sem >> EP_SEMAPHORE_POST_ERR_SHIFT) & EP_SEMAPHORE_POST_ERR_MASK)
54125 - return -1;
54126 - else
54127 - return 0;
54128 -}
54129 -
54130 -static int be_POST_stage_poll(struct be_ctrl_info *ctrl, u16 poll_stage)
54131 -{
54132 - u16 stage, cnt, error;
54133 - for (cnt = 0; cnt < 5000; cnt++) {
54134 - error = be_POST_stage_get(ctrl, &stage);
54135 - if (error)
54136 - return -1;
54137 -
54138 - if (stage == poll_stage)
54139 - break;
54140 - udelay(1000);
54141 - }
54142 - if (stage != poll_stage)
54143 - return -1;
54144 - return 0;
54145 -}
54146 -
54147 -
54148 -int be_cmd_POST(struct be_ctrl_info *ctrl)
54149 -{
54150 - u16 stage, error;
54151 -
54152 - error = be_POST_stage_get(ctrl, &stage);
54153 - if (error)
54154 - goto err;
54155 -
54156 - if (stage == POST_STAGE_ARMFW_RDY)
54157 - return 0;
54158 -
54159 - if (stage != POST_STAGE_AWAITING_HOST_RDY)
54160 - goto err;
54161 -
54162 - /* On awaiting host rdy, reset and again poll on awaiting host rdy */
54163 - iowrite32(POST_STAGE_BE_RESET, ctrl->csr + MPU_EP_SEMAPHORE_OFFSET);
54164 - error = be_POST_stage_poll(ctrl, POST_STAGE_AWAITING_HOST_RDY);
54165 - if (error)
54166 - goto err;
54167 -
54168 - /* Now kickoff POST and poll on armfw ready */
54169 - iowrite32(POST_STAGE_HOST_RDY, ctrl->csr + MPU_EP_SEMAPHORE_OFFSET);
54170 - error = be_POST_stage_poll(ctrl, POST_STAGE_ARMFW_RDY);
54171 - if (error)
54172 - goto err;
54173 -
54174 - return 0;
54175 -err:
54176 - printk(KERN_WARNING DRV_NAME ": ERROR, stage=%d\n", stage);
54177 - return -1;
54178 -}
54179 -
54180 -static inline void *embedded_payload(struct be_mcc_wrb *wrb)
54181 -{
54182 - return wrb->payload.embedded_payload;
54183 -}
54184 -
54185 -static inline struct be_sge *nonembedded_sgl(struct be_mcc_wrb *wrb)
54186 -{
54187 - return &wrb->payload.sgl[0];
54188 -}
54189 -
54190 -/* Don't touch the hdr after it's prepared */
54191 -static void be_wrb_hdr_prepare(struct be_mcc_wrb *wrb, int payload_len,
54192 - bool embedded, u8 sge_cnt)
54193 -{
54194 - if (embedded)
54195 - wrb->embedded |= MCC_WRB_EMBEDDED_MASK;
54196 - else
54197 - wrb->embedded |= (sge_cnt & MCC_WRB_SGE_CNT_MASK) <<
54198 - MCC_WRB_SGE_CNT_SHIFT;
54199 - wrb->payload_length = payload_len;
54200 - be_dws_cpu_to_le(wrb, 20);
54201 -}
54202 -
54203 -/* Don't touch the hdr after it's prepared */
54204 -static void be_cmd_hdr_prepare(struct be_cmd_req_hdr *req_hdr,
54205 - u8 subsystem, u8 opcode, int cmd_len)
54206 -{
54207 - req_hdr->opcode = opcode;
54208 - req_hdr->subsystem = subsystem;
54209 - req_hdr->request_length = cpu_to_le32(cmd_len - sizeof(*req_hdr));
54210 -}
54211 -
54212 -static void be_cmd_page_addrs_prepare(struct phys_addr *pages, u32 max_pages,
54213 - struct be_dma_mem *mem)
54214 -{
54215 - int i, buf_pages = min(PAGES_4K_SPANNED(mem->va, mem->size), max_pages);
54216 - u64 dma = (u64)mem->dma;
54217 -
54218 - for (i = 0; i < buf_pages; i++) {
54219 - pages[i].lo = cpu_to_le32(dma & 0xFFFFFFFF);
54220 - pages[i].hi = cpu_to_le32(upper_32_bits(dma));
54221 - dma += PAGE_SIZE_4K;
54222 - }
54223 -}
54224 -
54225 -/* Converts interrupt delay in microseconds to multiplier value */
54226 -static u32 eq_delay_to_mult(u32 usec_delay)
54227 -{
54228 -#define MAX_INTR_RATE 651042
54229 - const u32 round = 10;
54230 - u32 multiplier;
54231 -
54232 - if (usec_delay == 0)
54233 - multiplier = 0;
54234 - else {
54235 - u32 interrupt_rate = 1000000 / usec_delay;
54236 - /* Max delay, corresponding to the lowest interrupt rate */
54237 - if (interrupt_rate == 0)
54238 - multiplier = 1023;
54239 - else {
54240 - multiplier = (MAX_INTR_RATE - interrupt_rate) * round;
54241 - multiplier /= interrupt_rate;
54242 - /* Round the multiplier to the closest value.*/
54243 - multiplier = (multiplier + round/2) / round;
54244 - multiplier = min(multiplier, (u32)1023);
54245 - }
54246 - }
54247 - return multiplier;
54248 -}
54249 -
54250 -static inline struct be_mcc_wrb *wrb_from_mbox(struct be_dma_mem *mbox_mem)
54251 -{
54252 - return &((struct be_mcc_mailbox *)(mbox_mem->va))->wrb;
54253 -}
54254 -
54255 -int be_cmd_eq_create(struct be_ctrl_info *ctrl,
54256 - struct be_queue_info *eq, int eq_delay)
54257 -{
54258 - struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem);
54259 - struct be_cmd_req_eq_create *req = embedded_payload(wrb);
54260 - struct be_cmd_resp_eq_create *resp = embedded_payload(wrb);
54261 - struct be_dma_mem *q_mem = &eq->dma_mem;
54262 - int status;
54263 -
54264 - spin_lock(&ctrl->cmd_lock);
54265 - memset(wrb, 0, sizeof(*wrb));
54266 -
54267 - be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0);
54268 -
54269 - be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
54270 - OPCODE_COMMON_EQ_CREATE, sizeof(*req));
54271 -
54272 - req->num_pages = cpu_to_le16(PAGES_4K_SPANNED(q_mem->va, q_mem->size));
54273 -
54274 - AMAP_SET_BITS(struct amap_eq_context, func, req->context,
54275 - ctrl->pci_func);
54276 - AMAP_SET_BITS(struct amap_eq_context, valid, req->context, 1);
54277 - /* 4byte eqe*/
54278 - AMAP_SET_BITS(struct amap_eq_context, size, req->context, 0);
54279 - AMAP_SET_BITS(struct amap_eq_context, count, req->context,
54280 - __ilog2_u32(eq->len/256));
54281 - AMAP_SET_BITS(struct amap_eq_context, delaymult, req->context,
54282 - eq_delay_to_mult(eq_delay));
54283 - be_dws_cpu_to_le(req->context, sizeof(req->context));
54284 -
54285 - be_cmd_page_addrs_prepare(req->pages, ARRAY_SIZE(req->pages), q_mem);
54286 -
54287 - status = be_mbox_db_ring(ctrl);
54288 - if (!status) {
54289 - eq->id = le16_to_cpu(resp->eq_id);
54290 - eq->created = true;
54291 - }
54292 - spin_unlock(&ctrl->cmd_lock);
54293 - return status;
54294 -}
54295 -
54296 -int be_cmd_mac_addr_query(struct be_ctrl_info *ctrl, u8 *mac_addr,
54297 - u8 type, bool permanent, u32 if_handle)
54298 -{
54299 - struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem);
54300 - struct be_cmd_req_mac_query *req = embedded_payload(wrb);
54301 - struct be_cmd_resp_mac_query *resp = embedded_payload(wrb);
54302 - int status;
54303 -
54304 - spin_lock(&ctrl->cmd_lock);
54305 - memset(wrb, 0, sizeof(*wrb));
54306 -
54307 - be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0);
54308 -
54309 - be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
54310 - OPCODE_COMMON_NTWK_MAC_QUERY, sizeof(*req));
54311 -
54312 - req->type = type;
54313 - if (permanent) {
54314 - req->permanent = 1;
54315 - } else {
54316 - req->if_id = cpu_to_le16((u16)if_handle);
54317 - req->permanent = 0;
54318 - }
54319 -
54320 - status = be_mbox_db_ring(ctrl);
54321 - if (!status)
54322 - memcpy(mac_addr, resp->mac.addr, ETH_ALEN);
54323 -
54324 - spin_unlock(&ctrl->cmd_lock);
54325 - return status;
54326 -}
54327 -
54328 -int be_cmd_pmac_add(struct be_ctrl_info *ctrl, u8 *mac_addr,
54329 - u32 if_id, u32 *pmac_id)
54330 -{
54331 - struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem);
54332 - struct be_cmd_req_pmac_add *req = embedded_payload(wrb);
54333 - int status;
54334 -
54335 - spin_lock(&ctrl->cmd_lock);
54336 - memset(wrb, 0, sizeof(*wrb));
54337 -
54338 - be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0);
54339 -
54340 - be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
54341 - OPCODE_COMMON_NTWK_PMAC_ADD, sizeof(*req));
54342 -
54343 - req->if_id = cpu_to_le32(if_id);
54344 - memcpy(req->mac_address, mac_addr, ETH_ALEN);
54345 -
54346 - status = be_mbox_db_ring(ctrl);
54347 - if (!status) {
54348 - struct be_cmd_resp_pmac_add *resp = embedded_payload(wrb);
54349 - *pmac_id = le32_to_cpu(resp->pmac_id);
54350 - }
54351 -
54352 - spin_unlock(&ctrl->cmd_lock);
54353 - return status;
54354 -}
54355 -
54356 -int be_cmd_pmac_del(struct be_ctrl_info *ctrl, u32 if_id, u32 pmac_id)
54357 -{
54358 - struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem);
54359 - struct be_cmd_req_pmac_del *req = embedded_payload(wrb);
54360 - int status;
54361 -
54362 - spin_lock(&ctrl->cmd_lock);
54363 - memset(wrb, 0, sizeof(*wrb));
54364 -
54365 - be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0);
54366 -
54367 - be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
54368 - OPCODE_COMMON_NTWK_PMAC_DEL, sizeof(*req));
54369 -
54370 - req->if_id = cpu_to_le32(if_id);
54371 - req->pmac_id = cpu_to_le32(pmac_id);
54372 -
54373 - status = be_mbox_db_ring(ctrl);
54374 - spin_unlock(&ctrl->cmd_lock);
54375 -
54376 - return status;
54377 -}
54378 -
54379 -int be_cmd_cq_create(struct be_ctrl_info *ctrl,
54380 - struct be_queue_info *cq, struct be_queue_info *eq,
54381 - bool sol_evts, bool no_delay, int coalesce_wm)
54382 -{
54383 - struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem);
54384 - struct be_cmd_req_cq_create *req = embedded_payload(wrb);
54385 - struct be_cmd_resp_cq_create *resp = embedded_payload(wrb);
54386 - struct be_dma_mem *q_mem = &cq->dma_mem;
54387 - void *ctxt = &req->context;
54388 - int status;
54389 -
54390 - spin_lock(&ctrl->cmd_lock);
54391 - memset(wrb, 0, sizeof(*wrb));
54392 -
54393 - be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0);
54394 -
54395 - be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
54396 - OPCODE_COMMON_CQ_CREATE, sizeof(*req));
54397 -
54398 - req->num_pages = cpu_to_le16(PAGES_4K_SPANNED(q_mem->va, q_mem->size));
54399 -
54400 - AMAP_SET_BITS(struct amap_cq_context, coalescwm, ctxt, coalesce_wm);
54401 - AMAP_SET_BITS(struct amap_cq_context, nodelay, ctxt, no_delay);
54402 - AMAP_SET_BITS(struct amap_cq_context, count, ctxt,
54403 - __ilog2_u32(cq->len/256));
54404 - AMAP_SET_BITS(struct amap_cq_context, valid, ctxt, 1);
54405 - AMAP_SET_BITS(struct amap_cq_context, solevent, ctxt, sol_evts);
54406 - AMAP_SET_BITS(struct amap_cq_context, eventable, ctxt, 1);
54407 - AMAP_SET_BITS(struct amap_cq_context, eqid, ctxt, eq->id);
54408 - AMAP_SET_BITS(struct amap_cq_context, armed, ctxt, 0);
54409 - AMAP_SET_BITS(struct amap_cq_context, func, ctxt, ctrl->pci_func);
54410 - be_dws_cpu_to_le(ctxt, sizeof(req->context));
54411 -
54412 - be_cmd_page_addrs_prepare(req->pages, ARRAY_SIZE(req->pages), q_mem);
54413 -
54414 - status = be_mbox_db_ring(ctrl);
54415 - if (!status) {
54416 - cq->id = le16_to_cpu(resp->cq_id);
54417 - cq->created = true;
54418 - }
54419 - spin_unlock(&ctrl->cmd_lock);
54420 -
54421 - return status;
54422 -}
54423 -
54424 -int be_cmd_txq_create(struct be_ctrl_info *ctrl,
54425 - struct be_queue_info *txq,
54426 - struct be_queue_info *cq)
54427 -{
54428 - struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem);
54429 - struct be_cmd_req_eth_tx_create *req = embedded_payload(wrb);
54430 - struct be_dma_mem *q_mem = &txq->dma_mem;
54431 - void *ctxt = &req->context;
54432 - int status;
54433 - u32 len_encoded;
54434 -
54435 - spin_lock(&ctrl->cmd_lock);
54436 - memset(wrb, 0, sizeof(*wrb));
54437 -
54438 - be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0);
54439 -
54440 - be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ETH, OPCODE_ETH_TX_CREATE,
54441 - sizeof(*req));
54442 -
54443 - req->num_pages = PAGES_4K_SPANNED(q_mem->va, q_mem->size);
54444 - req->ulp_num = BE_ULP1_NUM;
54445 - req->type = BE_ETH_TX_RING_TYPE_STANDARD;
54446 -
54447 - len_encoded = fls(txq->len); /* log2(len) + 1 */
54448 - if (len_encoded == 16)
54449 - len_encoded = 0;
54450 - AMAP_SET_BITS(struct amap_tx_context, tx_ring_size, ctxt, len_encoded);
54451 - AMAP_SET_BITS(struct amap_tx_context, pci_func_id, ctxt,
54452 - ctrl->pci_func);
54453 - AMAP_SET_BITS(struct amap_tx_context, ctx_valid, ctxt, 1);
54454 - AMAP_SET_BITS(struct amap_tx_context, cq_id_send, ctxt, cq->id);
54455 -
54456 - be_dws_cpu_to_le(ctxt, sizeof(req->context));
54457 -
54458 - be_cmd_page_addrs_prepare(req->pages, ARRAY_SIZE(req->pages), q_mem);
54459 -
54460 - status = be_mbox_db_ring(ctrl);
54461 - if (!status) {
54462 - struct be_cmd_resp_eth_tx_create *resp = embedded_payload(wrb);
54463 - txq->id = le16_to_cpu(resp->cid);
54464 - txq->created = true;
54465 - }
54466 - spin_unlock(&ctrl->cmd_lock);
54467 -
54468 - return status;
54469 -}
54470 -
54471 -int be_cmd_rxq_create(struct be_ctrl_info *ctrl,
54472 - struct be_queue_info *rxq, u16 cq_id, u16 frag_size,
54473 - u16 max_frame_size, u32 if_id, u32 rss)
54474 -{
54475 - struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem);
54476 - struct be_cmd_req_eth_rx_create *req = embedded_payload(wrb);
54477 - struct be_dma_mem *q_mem = &rxq->dma_mem;
54478 - int status;
54479 -
54480 - spin_lock(&ctrl->cmd_lock);
54481 - memset(wrb, 0, sizeof(*wrb));
54482 -
54483 - be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0);
54484 -
54485 - be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ETH, OPCODE_ETH_RX_CREATE,
54486 - sizeof(*req));
54487 -
54488 - req->cq_id = cpu_to_le16(cq_id);
54489 - req->frag_size = fls(frag_size) - 1;
54490 - req->num_pages = 2;
54491 - be_cmd_page_addrs_prepare(req->pages, ARRAY_SIZE(req->pages), q_mem);
54492 - req->interface_id = cpu_to_le32(if_id);
54493 - req->max_frame_size = cpu_to_le16(max_frame_size);
54494 - req->rss_queue = cpu_to_le32(rss);
54495 -
54496 - status = be_mbox_db_ring(ctrl);
54497 - if (!status) {
54498 - struct be_cmd_resp_eth_rx_create *resp = embedded_payload(wrb);
54499 - rxq->id = le16_to_cpu(resp->id);
54500 - rxq->created = true;
54501 - }
54502 - spin_unlock(&ctrl->cmd_lock);
54503 -
54504 - return status;
54505 -}
54506 -
54507 -/* Generic destroyer function for all types of queues */
54508 -int be_cmd_q_destroy(struct be_ctrl_info *ctrl, struct be_queue_info *q,
54509 - int queue_type)
54510 -{
54511 - struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem);
54512 - struct be_cmd_req_q_destroy *req = embedded_payload(wrb);
54513 - u8 subsys = 0, opcode = 0;
54514 - int status;
54515 -
54516 - spin_lock(&ctrl->cmd_lock);
54517 -
54518 - memset(wrb, 0, sizeof(*wrb));
54519 - be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0);
54520 -
54521 - switch (queue_type) {
54522 - case QTYPE_EQ:
54523 - subsys = CMD_SUBSYSTEM_COMMON;
54524 - opcode = OPCODE_COMMON_EQ_DESTROY;
54525 - break;
54526 - case QTYPE_CQ:
54527 - subsys = CMD_SUBSYSTEM_COMMON;
54528 - opcode = OPCODE_COMMON_CQ_DESTROY;
54529 - break;
54530 - case QTYPE_TXQ:
54531 - subsys = CMD_SUBSYSTEM_ETH;
54532 - opcode = OPCODE_ETH_TX_DESTROY;
54533 - break;
54534 - case QTYPE_RXQ:
54535 - subsys = CMD_SUBSYSTEM_ETH;
54536 - opcode = OPCODE_ETH_RX_DESTROY;
54537 - break;
54538 - default:
54539 - printk(KERN_WARNING DRV_NAME ":bad Q type in Q destroy cmd\n");
54540 - status = -1;
54541 - goto err;
54542 - }
54543 - be_cmd_hdr_prepare(&req->hdr, subsys, opcode, sizeof(*req));
54544 - req->id = cpu_to_le16(q->id);
54545 -
54546 - status = be_mbox_db_ring(ctrl);
54547 -err:
54548 - spin_unlock(&ctrl->cmd_lock);
54549 -
54550 - return status;
54551 -}
54552 -
54553 -/* Create an rx filtering policy configuration on an i/f */
54554 -int be_cmd_if_create(struct be_ctrl_info *ctrl, u32 flags, u8 *mac,
54555 - bool pmac_invalid, u32 *if_handle, u32 *pmac_id)
54556 -{
54557 - struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem);
54558 - struct be_cmd_req_if_create *req = embedded_payload(wrb);
54559 - int status;
54560 -
54561 - spin_lock(&ctrl->cmd_lock);
54562 - memset(wrb, 0, sizeof(*wrb));
54563 -
54564 - be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0);
54565 -
54566 - be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
54567 - OPCODE_COMMON_NTWK_INTERFACE_CREATE, sizeof(*req));
54568 -
54569 - req->capability_flags = cpu_to_le32(flags);
54570 - req->enable_flags = cpu_to_le32(flags);
54571 - if (!pmac_invalid)
54572 - memcpy(req->mac_addr, mac, ETH_ALEN);
54573 -
54574 - status = be_mbox_db_ring(ctrl);
54575 - if (!status) {
54576 - struct be_cmd_resp_if_create *resp = embedded_payload(wrb);
54577 - *if_handle = le32_to_cpu(resp->interface_id);
54578 - if (!pmac_invalid)
54579 - *pmac_id = le32_to_cpu(resp->pmac_id);
54580 - }
54581 -
54582 - spin_unlock(&ctrl->cmd_lock);
54583 - return status;
54584 -}
54585 -
54586 -int be_cmd_if_destroy(struct be_ctrl_info *ctrl, u32 interface_id)
54587 -{
54588 - struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem);
54589 - struct be_cmd_req_if_destroy *req = embedded_payload(wrb);
54590 - int status;
54591 -
54592 - spin_lock(&ctrl->cmd_lock);
54593 - memset(wrb, 0, sizeof(*wrb));
54594 -
54595 - be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0);
54596 -
54597 - be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
54598 - OPCODE_COMMON_NTWK_INTERFACE_DESTROY, sizeof(*req));
54599 -
54600 - req->interface_id = cpu_to_le32(interface_id);
54601 - status = be_mbox_db_ring(ctrl);
54602 -
54603 - spin_unlock(&ctrl->cmd_lock);
54604 -
54605 - return status;
54606 -}
54607 -
54608 -/* Get stats is a non embedded command: the request is not embedded inside
54609 - * WRB but is a separate dma memory block
54610 - */
54611 -int be_cmd_get_stats(struct be_ctrl_info *ctrl, struct be_dma_mem *nonemb_cmd)
54612 -{
54613 - struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem);
54614 - struct be_cmd_req_get_stats *req = nonemb_cmd->va;
54615 - struct be_sge *sge = nonembedded_sgl(wrb);
54616 - int status;
54617 -
54618 - spin_lock(&ctrl->cmd_lock);
54619 - memset(wrb, 0, sizeof(*wrb));
54620 -
54621 - memset(req, 0, sizeof(*req));
54622 -
54623 - be_wrb_hdr_prepare(wrb, sizeof(*req), false, 1);
54624 -
54625 - be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ETH,
54626 - OPCODE_ETH_GET_STATISTICS, sizeof(*req));
54627 - sge->pa_hi = cpu_to_le32(upper_32_bits(nonemb_cmd->dma));
54628 - sge->pa_lo = cpu_to_le32(nonemb_cmd->dma & 0xFFFFFFFF);
54629 - sge->len = cpu_to_le32(nonemb_cmd->size);
54630 -
54631 - status = be_mbox_db_ring(ctrl);
54632 - if (!status) {
54633 - struct be_cmd_resp_get_stats *resp = nonemb_cmd->va;
54634 - be_dws_le_to_cpu(&resp->hw_stats, sizeof(resp->hw_stats));
54635 - }
54636 -
54637 - spin_unlock(&ctrl->cmd_lock);
54638 - return status;
54639 -}
54640 -
54641 -int be_cmd_link_status_query(struct be_ctrl_info *ctrl,
54642 - struct be_link_info *link)
54643 -{
54644 - struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem);
54645 - struct be_cmd_req_link_status *req = embedded_payload(wrb);
54646 - int status;
54647 -
54648 - spin_lock(&ctrl->cmd_lock);
54649 - memset(wrb, 0, sizeof(*wrb));
54650 -
54651 - be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0);
54652 -
54653 - be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
54654 - OPCODE_COMMON_NTWK_LINK_STATUS_QUERY, sizeof(*req));
54655 -
54656 - status = be_mbox_db_ring(ctrl);
54657 - if (!status) {
54658 - struct be_cmd_resp_link_status *resp = embedded_payload(wrb);
54659 - link->speed = resp->mac_speed;
54660 - link->duplex = resp->mac_duplex;
54661 - link->fault = resp->mac_fault;
54662 - } else {
54663 - link->speed = PHY_LINK_SPEED_ZERO;
54664 - }
54665 -
54666 - spin_unlock(&ctrl->cmd_lock);
54667 - return status;
54668 -}
54669 -
54670 -int be_cmd_get_fw_ver(struct be_ctrl_info *ctrl, char *fw_ver)
54671 -{
54672 - struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem);
54673 - struct be_cmd_req_get_fw_version *req = embedded_payload(wrb);
54674 - int status;
54675 -
54676 - spin_lock(&ctrl->cmd_lock);
54677 - memset(wrb, 0, sizeof(*wrb));
54678 -
54679 - be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0);
54680 -
54681 - be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
54682 - OPCODE_COMMON_GET_FW_VERSION, sizeof(*req));
54683 -
54684 - status = be_mbox_db_ring(ctrl);
54685 - if (!status) {
54686 - struct be_cmd_resp_get_fw_version *resp = embedded_payload(wrb);
54687 - strncpy(fw_ver, resp->firmware_version_string, FW_VER_LEN);
54688 - }
54689 -
54690 - spin_unlock(&ctrl->cmd_lock);
54691 - return status;
54692 -}
54693 -
54694 -/* set the EQ delay interval of an EQ to specified value */
54695 -int be_cmd_modify_eqd(struct be_ctrl_info *ctrl, u32 eq_id, u32 eqd)
54696 -{
54697 - struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem);
54698 - struct be_cmd_req_modify_eq_delay *req = embedded_payload(wrb);
54699 - int status;
54700 -
54701 - spin_lock(&ctrl->cmd_lock);
54702 - memset(wrb, 0, sizeof(*wrb));
54703 -
54704 - be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0);
54705 -
54706 - be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
54707 - OPCODE_COMMON_MODIFY_EQ_DELAY, sizeof(*req));
54708 -
54709 - req->num_eq = cpu_to_le32(1);
54710 - req->delay[0].eq_id = cpu_to_le32(eq_id);
54711 - req->delay[0].phase = 0;
54712 - req->delay[0].delay_multiplier = cpu_to_le32(eqd);
54713 -
54714 - status = be_mbox_db_ring(ctrl);
54715 -
54716 - spin_unlock(&ctrl->cmd_lock);
54717 - return status;
54718 -}
54719 -
54720 -int be_cmd_vlan_config(struct be_ctrl_info *ctrl, u32 if_id, u16 *vtag_array,
54721 - u32 num, bool untagged, bool promiscuous)
54722 -{
54723 - struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem);
54724 - struct be_cmd_req_vlan_config *req = embedded_payload(wrb);
54725 - int status;
54726 -
54727 - spin_lock(&ctrl->cmd_lock);
54728 - memset(wrb, 0, sizeof(*wrb));
54729 -
54730 - be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0);
54731 -
54732 - be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
54733 - OPCODE_COMMON_NTWK_VLAN_CONFIG, sizeof(*req));
54734 -
54735 - req->interface_id = if_id;
54736 - req->promiscuous = promiscuous;
54737 - req->untagged = untagged;
54738 - req->num_vlan = num;
54739 - if (!promiscuous) {
54740 - memcpy(req->normal_vlan, vtag_array,
54741 - req->num_vlan * sizeof(vtag_array[0]));
54742 - }
54743 -
54744 - status = be_mbox_db_ring(ctrl);
54745 -
54746 - spin_unlock(&ctrl->cmd_lock);
54747 - return status;
54748 -}
54749 -
54750 -int be_cmd_promiscuous_config(struct be_ctrl_info *ctrl, u8 port_num, bool en)
54751 -{
54752 - struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem);
54753 - struct be_cmd_req_promiscuous_config *req = embedded_payload(wrb);
54754 - int status;
54755 -
54756 - spin_lock(&ctrl->cmd_lock);
54757 - memset(wrb, 0, sizeof(*wrb));
54758 -
54759 - be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0);
54760 -
54761 - be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ETH,
54762 - OPCODE_ETH_PROMISCUOUS, sizeof(*req));
54763 -
54764 - if (port_num)
54765 - req->port1_promiscuous = en;
54766 - else
54767 - req->port0_promiscuous = en;
54768 -
54769 - status = be_mbox_db_ring(ctrl);
54770 -
54771 - spin_unlock(&ctrl->cmd_lock);
54772 - return status;
54773 -}
54774 -
54775 -int be_cmd_mcast_mac_set(struct be_ctrl_info *ctrl, u32 if_id, u8 *mac_table,
54776 - u32 num, bool promiscuous)
54777 -{
54778 - struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem);
54779 - struct be_cmd_req_mcast_mac_config *req = embedded_payload(wrb);
54780 - int status;
54781 -
54782 - spin_lock(&ctrl->cmd_lock);
54783 - memset(wrb, 0, sizeof(*wrb));
54784 -
54785 - be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0);
54786 -
54787 - be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
54788 - OPCODE_COMMON_NTWK_MULTICAST_SET, sizeof(*req));
54789 -
54790 - req->interface_id = if_id;
54791 - req->promiscuous = promiscuous;
54792 - if (!promiscuous) {
54793 - req->num_mac = cpu_to_le16(num);
54794 - if (num)
54795 - memcpy(req->mac, mac_table, ETH_ALEN * num);
54796 - }
54797 -
54798 - status = be_mbox_db_ring(ctrl);
54799 -
54800 - spin_unlock(&ctrl->cmd_lock);
54801 - return status;
54802 -}
54803 -
54804 -int be_cmd_set_flow_control(struct be_ctrl_info *ctrl, u32 tx_fc, u32 rx_fc)
54805 -{
54806 - struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem);
54807 - struct be_cmd_req_set_flow_control *req = embedded_payload(wrb);
54808 - int status;
54809 -
54810 - spin_lock(&ctrl->cmd_lock);
54811 -
54812 - memset(wrb, 0, sizeof(*wrb));
54813 -
54814 - be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0);
54815 -
54816 - be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
54817 - OPCODE_COMMON_SET_FLOW_CONTROL, sizeof(*req));
54818 -
54819 - req->tx_flow_control = cpu_to_le16((u16)tx_fc);
54820 - req->rx_flow_control = cpu_to_le16((u16)rx_fc);
54821 -
54822 - status = be_mbox_db_ring(ctrl);
54823 -
54824 - spin_unlock(&ctrl->cmd_lock);
54825 - return status;
54826 -}
54827 -
54828 -int be_cmd_get_flow_control(struct be_ctrl_info *ctrl, u32 *tx_fc, u32 *rx_fc)
54829 -{
54830 - struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem);
54831 - struct be_cmd_req_get_flow_control *req = embedded_payload(wrb);
54832 - int status;
54833 -
54834 - spin_lock(&ctrl->cmd_lock);
54835 -
54836 - memset(wrb, 0, sizeof(*wrb));
54837 -
54838 - be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0);
54839 -
54840 - be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
54841 - OPCODE_COMMON_GET_FLOW_CONTROL, sizeof(*req));
54842 -
54843 - status = be_mbox_db_ring(ctrl);
54844 - if (!status) {
54845 - struct be_cmd_resp_get_flow_control *resp =
54846 - embedded_payload(wrb);
54847 - *tx_fc = le16_to_cpu(resp->tx_flow_control);
54848 - *rx_fc = le16_to_cpu(resp->rx_flow_control);
54849 - }
54850 -
54851 - spin_unlock(&ctrl->cmd_lock);
54852 - return status;
54853 -}
54854 -
54855 -int be_cmd_query_fw_cfg(struct be_ctrl_info *ctrl, u32 *port_num)
54856 -{
54857 - struct be_mcc_wrb *wrb = wrb_from_mbox(&ctrl->mbox_mem);
54858 - struct be_cmd_req_query_fw_cfg *req = embedded_payload(wrb);
54859 - int status;
54860 -
54861 - spin_lock(&ctrl->cmd_lock);
54862 -
54863 - memset(wrb, 0, sizeof(*wrb));
54864 -
54865 - be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0);
54866 -
54867 - be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
54868 - OPCODE_COMMON_QUERY_FIRMWARE_CONFIG, sizeof(*req));
54869 -
54870 - status = be_mbox_db_ring(ctrl);
54871 - if (!status) {
54872 - struct be_cmd_resp_query_fw_cfg *resp = embedded_payload(wrb);
54873 - *port_num = le32_to_cpu(resp->phys_port);
54874 - }
54875 -
54876 - spin_unlock(&ctrl->cmd_lock);
54877 - return status;
54878 -}
54879 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/benet/be_cmds.h linux-2.6.29-rc3.owrt/drivers/net/benet/be_cmds.h
54880 --- linux-2.6.29.owrt/drivers/net/benet/be_cmds.h 2009-05-10 22:04:38.000000000 +0200
54881 +++ linux-2.6.29-rc3.owrt/drivers/net/benet/be_cmds.h 1970-01-01 01:00:00.000000000 +0100
54882 @@ -1,688 +0,0 @@
54883 -/*
54884 - * Copyright (C) 2005 - 2009 ServerEngines
54885 - * All rights reserved.
54886 - *
54887 - * This program is free software; you can redistribute it and/or
54888 - * modify it under the terms of the GNU General Public License version 2
54889 - * as published by the Free Software Foundation. The full GNU General
54890 - * Public License is included in this distribution in the file called COPYING.
54891 - *
54892 - * Contact Information:
54893 - * linux-drivers@serverengines.com
54894 - *
54895 - * ServerEngines
54896 - * 209 N. Fair Oaks Ave
54897 - * Sunnyvale, CA 94085
54898 - */
54899 -
54900 -/*
54901 - * The driver sends configuration and managements command requests to the
54902 - * firmware in the BE. These requests are communicated to the processor
54903 - * using Work Request Blocks (WRBs) submitted to the MCC-WRB ring or via one
54904 - * WRB inside a MAILBOX.
54905 - * The commands are serviced by the ARM processor in the BladeEngine's MPU.
54906 - */
54907 -
54908 -struct be_sge {
54909 - u32 pa_lo;
54910 - u32 pa_hi;
54911 - u32 len;
54912 -};
54913 -
54914 -#define MCC_WRB_EMBEDDED_MASK 1 /* bit 0 of dword 0*/
54915 -#define MCC_WRB_SGE_CNT_SHIFT 3 /* bits 3 - 7 of dword 0 */
54916 -#define MCC_WRB_SGE_CNT_MASK 0x1F /* bits 3 - 7 of dword 0 */
54917 -struct be_mcc_wrb {
54918 - u32 embedded; /* dword 0 */
54919 - u32 payload_length; /* dword 1 */
54920 - u32 tag0; /* dword 2 */
54921 - u32 tag1; /* dword 3 */
54922 - u32 rsvd; /* dword 4 */
54923 - union {
54924 - u8 embedded_payload[236]; /* used by embedded cmds */
54925 - struct be_sge sgl[19]; /* used by non-embedded cmds */
54926 - } payload;
54927 -};
54928 -
54929 -#define CQE_FLAGS_VALID_MASK (1 << 31)
54930 -#define CQE_FLAGS_ASYNC_MASK (1 << 30)
54931 -#define CQE_FLAGS_COMPLETED_MASK (1 << 28)
54932 -#define CQE_FLAGS_CONSUMED_MASK (1 << 27)
54933 -
54934 -/* Completion Status */
54935 -enum {
54936 - MCC_STATUS_SUCCESS = 0x0,
54937 -/* The client does not have sufficient privileges to execute the command */
54938 - MCC_STATUS_INSUFFICIENT_PRIVILEGES = 0x1,
54939 -/* A parameter in the command was invalid. */
54940 - MCC_STATUS_INVALID_PARAMETER = 0x2,
54941 -/* There are insufficient chip resources to execute the command */
54942 - MCC_STATUS_INSUFFICIENT_RESOURCES = 0x3,
54943 -/* The command is completing because the queue was getting flushed */
54944 - MCC_STATUS_QUEUE_FLUSHING = 0x4,
54945 -/* The command is completing with a DMA error */
54946 - MCC_STATUS_DMA_FAILED = 0x5
54947 -};
54948 -
54949 -#define CQE_STATUS_COMPL_MASK 0xFFFF
54950 -#define CQE_STATUS_COMPL_SHIFT 0 /* bits 0 - 15 */
54951 -#define CQE_STATUS_EXTD_MASK 0xFFFF
54952 -#define CQE_STATUS_EXTD_SHIFT 0 /* bits 0 - 15 */
54953 -
54954 -struct be_mcc_cq_entry {
54955 - u32 status; /* dword 0 */
54956 - u32 tag0; /* dword 1 */
54957 - u32 tag1; /* dword 2 */
54958 - u32 flags; /* dword 3 */
54959 -};
54960 -
54961 -struct be_mcc_mailbox {
54962 - struct be_mcc_wrb wrb;
54963 - struct be_mcc_cq_entry cqe;
54964 -};
54965 -
54966 -#define CMD_SUBSYSTEM_COMMON 0x1
54967 -#define CMD_SUBSYSTEM_ETH 0x3
54968 -
54969 -#define OPCODE_COMMON_NTWK_MAC_QUERY 1
54970 -#define OPCODE_COMMON_NTWK_MAC_SET 2
54971 -#define OPCODE_COMMON_NTWK_MULTICAST_SET 3
54972 -#define OPCODE_COMMON_NTWK_VLAN_CONFIG 4
54973 -#define OPCODE_COMMON_NTWK_LINK_STATUS_QUERY 5
54974 -#define OPCODE_COMMON_CQ_CREATE 12
54975 -#define OPCODE_COMMON_EQ_CREATE 13
54976 -#define OPCODE_COMMON_MCC_CREATE 21
54977 -#define OPCODE_COMMON_NTWK_RX_FILTER 34
54978 -#define OPCODE_COMMON_GET_FW_VERSION 35
54979 -#define OPCODE_COMMON_SET_FLOW_CONTROL 36
54980 -#define OPCODE_COMMON_GET_FLOW_CONTROL 37
54981 -#define OPCODE_COMMON_SET_FRAME_SIZE 39
54982 -#define OPCODE_COMMON_MODIFY_EQ_DELAY 41
54983 -#define OPCODE_COMMON_FIRMWARE_CONFIG 42
54984 -#define OPCODE_COMMON_NTWK_INTERFACE_CREATE 50
54985 -#define OPCODE_COMMON_NTWK_INTERFACE_DESTROY 51
54986 -#define OPCODE_COMMON_CQ_DESTROY 54
54987 -#define OPCODE_COMMON_EQ_DESTROY 55
54988 -#define OPCODE_COMMON_QUERY_FIRMWARE_CONFIG 58
54989 -#define OPCODE_COMMON_NTWK_PMAC_ADD 59
54990 -#define OPCODE_COMMON_NTWK_PMAC_DEL 60
54991 -
54992 -#define OPCODE_ETH_ACPI_CONFIG 2
54993 -#define OPCODE_ETH_PROMISCUOUS 3
54994 -#define OPCODE_ETH_GET_STATISTICS 4
54995 -#define OPCODE_ETH_TX_CREATE 7
54996 -#define OPCODE_ETH_RX_CREATE 8
54997 -#define OPCODE_ETH_TX_DESTROY 9
54998 -#define OPCODE_ETH_RX_DESTROY 10
54999 -
55000 -struct be_cmd_req_hdr {
55001 - u8 opcode; /* dword 0 */
55002 - u8 subsystem; /* dword 0 */
55003 - u8 port_number; /* dword 0 */
55004 - u8 domain; /* dword 0 */
55005 - u32 timeout; /* dword 1 */
55006 - u32 request_length; /* dword 2 */
55007 - u32 rsvd; /* dword 3 */
55008 -};
55009 -
55010 -#define RESP_HDR_INFO_OPCODE_SHIFT 0 /* bits 0 - 7 */
55011 -#define RESP_HDR_INFO_SUBSYS_SHIFT 8 /* bits 8 - 15 */
55012 -struct be_cmd_resp_hdr {
55013 - u32 info; /* dword 0 */
55014 - u32 status; /* dword 1 */
55015 - u32 response_length; /* dword 2 */
55016 - u32 actual_resp_len; /* dword 3 */
55017 -};
55018 -
55019 -struct phys_addr {
55020 - u32 lo;
55021 - u32 hi;
55022 -};
55023 -
55024 -/**************************
55025 - * BE Command definitions *
55026 - **************************/
55027 -
55028 -/* Pseudo amap definition in which each bit of the actual structure is defined
55029 - * as a byte: used to calculate offset/shift/mask of each field */
55030 -struct amap_eq_context {
55031 - u8 cidx[13]; /* dword 0*/
55032 - u8 rsvd0[3]; /* dword 0*/
55033 - u8 epidx[13]; /* dword 0*/
55034 - u8 valid; /* dword 0*/
55035 - u8 rsvd1; /* dword 0*/
55036 - u8 size; /* dword 0*/
55037 - u8 pidx[13]; /* dword 1*/
55038 - u8 rsvd2[3]; /* dword 1*/
55039 - u8 pd[10]; /* dword 1*/
55040 - u8 count[3]; /* dword 1*/
55041 - u8 solevent; /* dword 1*/
55042 - u8 stalled; /* dword 1*/
55043 - u8 armed; /* dword 1*/
55044 - u8 rsvd3[4]; /* dword 2*/
55045 - u8 func[8]; /* dword 2*/
55046 - u8 rsvd4; /* dword 2*/
55047 - u8 delaymult[10]; /* dword 2*/
55048 - u8 rsvd5[2]; /* dword 2*/
55049 - u8 phase[2]; /* dword 2*/
55050 - u8 nodelay; /* dword 2*/
55051 - u8 rsvd6[4]; /* dword 2*/
55052 - u8 rsvd7[32]; /* dword 3*/
55053 -} __packed;
55054 -
55055 -struct be_cmd_req_eq_create {
55056 - struct be_cmd_req_hdr hdr;
55057 - u16 num_pages; /* sword */
55058 - u16 rsvd0; /* sword */
55059 - u8 context[sizeof(struct amap_eq_context) / 8];
55060 - struct phys_addr pages[8];
55061 -} __packed;
55062 -
55063 -struct be_cmd_resp_eq_create {
55064 - struct be_cmd_resp_hdr resp_hdr;
55065 - u16 eq_id; /* sword */
55066 - u16 rsvd0; /* sword */
55067 -} __packed;
55068 -
55069 -/******************** Mac query ***************************/
55070 -enum {
55071 - MAC_ADDRESS_TYPE_STORAGE = 0x0,
55072 - MAC_ADDRESS_TYPE_NETWORK = 0x1,
55073 - MAC_ADDRESS_TYPE_PD = 0x2,
55074 - MAC_ADDRESS_TYPE_MANAGEMENT = 0x3
55075 -};
55076 -
55077 -struct mac_addr {
55078 - u16 size_of_struct;
55079 - u8 addr[ETH_ALEN];
55080 -} __packed;
55081 -
55082 -struct be_cmd_req_mac_query {
55083 - struct be_cmd_req_hdr hdr;
55084 - u8 type;
55085 - u8 permanent;
55086 - u16 if_id;
55087 -} __packed;
55088 -
55089 -struct be_cmd_resp_mac_query {
55090 - struct be_cmd_resp_hdr hdr;
55091 - struct mac_addr mac;
55092 -};
55093 -
55094 -/******************** PMac Add ***************************/
55095 -struct be_cmd_req_pmac_add {
55096 - struct be_cmd_req_hdr hdr;
55097 - u32 if_id;
55098 - u8 mac_address[ETH_ALEN];
55099 - u8 rsvd0[2];
55100 -} __packed;
55101 -
55102 -struct be_cmd_resp_pmac_add {
55103 - struct be_cmd_resp_hdr hdr;
55104 - u32 pmac_id;
55105 -};
55106 -
55107 -/******************** PMac Del ***************************/
55108 -struct be_cmd_req_pmac_del {
55109 - struct be_cmd_req_hdr hdr;
55110 - u32 if_id;
55111 - u32 pmac_id;
55112 -};
55113 -
55114 -/******************** Create CQ ***************************/
55115 -/* Pseudo amap definition in which each bit of the actual structure is defined
55116 - * as a byte: used to calculate offset/shift/mask of each field */
55117 -struct amap_cq_context {
55118 - u8 cidx[11]; /* dword 0*/
55119 - u8 rsvd0; /* dword 0*/
55120 - u8 coalescwm[2]; /* dword 0*/
55121 - u8 nodelay; /* dword 0*/
55122 - u8 epidx[11]; /* dword 0*/
55123 - u8 rsvd1; /* dword 0*/
55124 - u8 count[2]; /* dword 0*/
55125 - u8 valid; /* dword 0*/
55126 - u8 solevent; /* dword 0*/
55127 - u8 eventable; /* dword 0*/
55128 - u8 pidx[11]; /* dword 1*/
55129 - u8 rsvd2; /* dword 1*/
55130 - u8 pd[10]; /* dword 1*/
55131 - u8 eqid[8]; /* dword 1*/
55132 - u8 stalled; /* dword 1*/
55133 - u8 armed; /* dword 1*/
55134 - u8 rsvd3[4]; /* dword 2*/
55135 - u8 func[8]; /* dword 2*/
55136 - u8 rsvd4[20]; /* dword 2*/
55137 - u8 rsvd5[32]; /* dword 3*/
55138 -} __packed;
55139 -
55140 -struct be_cmd_req_cq_create {
55141 - struct be_cmd_req_hdr hdr;
55142 - u16 num_pages;
55143 - u16 rsvd0;
55144 - u8 context[sizeof(struct amap_cq_context) / 8];
55145 - struct phys_addr pages[8];
55146 -} __packed;
55147 -
55148 -struct be_cmd_resp_cq_create {
55149 - struct be_cmd_resp_hdr hdr;
55150 - u16 cq_id;
55151 - u16 rsvd0;
55152 -} __packed;
55153 -
55154 -/******************** Create TxQ ***************************/
55155 -#define BE_ETH_TX_RING_TYPE_STANDARD 2
55156 -#define BE_ULP1_NUM 1
55157 -
55158 -/* Pseudo amap definition in which each bit of the actual structure is defined
55159 - * as a byte: used to calculate offset/shift/mask of each field */
55160 -struct amap_tx_context {
55161 - u8 rsvd0[16]; /* dword 0 */
55162 - u8 tx_ring_size[4]; /* dword 0 */
55163 - u8 rsvd1[26]; /* dword 0 */
55164 - u8 pci_func_id[8]; /* dword 1 */
55165 - u8 rsvd2[9]; /* dword 1 */
55166 - u8 ctx_valid; /* dword 1 */
55167 - u8 cq_id_send[16]; /* dword 2 */
55168 - u8 rsvd3[16]; /* dword 2 */
55169 - u8 rsvd4[32]; /* dword 3 */
55170 - u8 rsvd5[32]; /* dword 4 */
55171 - u8 rsvd6[32]; /* dword 5 */
55172 - u8 rsvd7[32]; /* dword 6 */
55173 - u8 rsvd8[32]; /* dword 7 */
55174 - u8 rsvd9[32]; /* dword 8 */
55175 - u8 rsvd10[32]; /* dword 9 */
55176 - u8 rsvd11[32]; /* dword 10 */
55177 - u8 rsvd12[32]; /* dword 11 */
55178 - u8 rsvd13[32]; /* dword 12 */
55179 - u8 rsvd14[32]; /* dword 13 */
55180 - u8 rsvd15[32]; /* dword 14 */
55181 - u8 rsvd16[32]; /* dword 15 */
55182 -} __packed;
55183 -
55184 -struct be_cmd_req_eth_tx_create {
55185 - struct be_cmd_req_hdr hdr;
55186 - u8 num_pages;
55187 - u8 ulp_num;
55188 - u8 type;
55189 - u8 bound_port;
55190 - u8 context[sizeof(struct amap_tx_context) / 8];
55191 - struct phys_addr pages[8];
55192 -} __packed;
55193 -
55194 -struct be_cmd_resp_eth_tx_create {
55195 - struct be_cmd_resp_hdr hdr;
55196 - u16 cid;
55197 - u16 rsvd0;
55198 -} __packed;
55199 -
55200 -/******************** Create RxQ ***************************/
55201 -struct be_cmd_req_eth_rx_create {
55202 - struct be_cmd_req_hdr hdr;
55203 - u16 cq_id;
55204 - u8 frag_size;
55205 - u8 num_pages;
55206 - struct phys_addr pages[2];
55207 - u32 interface_id;
55208 - u16 max_frame_size;
55209 - u16 rsvd0;
55210 - u32 rss_queue;
55211 -} __packed;
55212 -
55213 -struct be_cmd_resp_eth_rx_create {
55214 - struct be_cmd_resp_hdr hdr;
55215 - u16 id;
55216 - u8 cpu_id;
55217 - u8 rsvd0;
55218 -} __packed;
55219 -
55220 -/******************** Q Destroy ***************************/
55221 -/* Type of Queue to be destroyed */
55222 -enum {
55223 - QTYPE_EQ = 1,
55224 - QTYPE_CQ,
55225 - QTYPE_TXQ,
55226 - QTYPE_RXQ
55227 -};
55228 -
55229 -struct be_cmd_req_q_destroy {
55230 - struct be_cmd_req_hdr hdr;
55231 - u16 id;
55232 - u16 bypass_flush; /* valid only for rx q destroy */
55233 -} __packed;
55234 -
55235 -/************ I/f Create (it's actually I/f Config Create)**********/
55236 -
55237 -/* Capability flags for the i/f */
55238 -enum be_if_flags {
55239 - BE_IF_FLAGS_RSS = 0x4,
55240 - BE_IF_FLAGS_PROMISCUOUS = 0x8,
55241 - BE_IF_FLAGS_BROADCAST = 0x10,
55242 - BE_IF_FLAGS_UNTAGGED = 0x20,
55243 - BE_IF_FLAGS_ULP = 0x40,
55244 - BE_IF_FLAGS_VLAN_PROMISCUOUS = 0x80,
55245 - BE_IF_FLAGS_VLAN = 0x100,
55246 - BE_IF_FLAGS_MCAST_PROMISCUOUS = 0x200,
55247 - BE_IF_FLAGS_PASS_L2_ERRORS = 0x400,
55248 - BE_IF_FLAGS_PASS_L3L4_ERRORS = 0x800
55249 -};
55250 -
55251 -/* An RX interface is an object with one or more MAC addresses and
55252 - * filtering capabilities. */
55253 -struct be_cmd_req_if_create {
55254 - struct be_cmd_req_hdr hdr;
55255 - u32 version; /* ignore currntly */
55256 - u32 capability_flags;
55257 - u32 enable_flags;
55258 - u8 mac_addr[ETH_ALEN];
55259 - u8 rsvd0;
55260 - u8 pmac_invalid; /* if set, don't attach the mac addr to the i/f */
55261 - u32 vlan_tag; /* not used currently */
55262 -} __packed;
55263 -
55264 -struct be_cmd_resp_if_create {
55265 - struct be_cmd_resp_hdr hdr;
55266 - u32 interface_id;
55267 - u32 pmac_id;
55268 -};
55269 -
55270 -/****** I/f Destroy(it's actually I/f Config Destroy )**********/
55271 -struct be_cmd_req_if_destroy {
55272 - struct be_cmd_req_hdr hdr;
55273 - u32 interface_id;
55274 -};
55275 -
55276 -/*************** HW Stats Get **********************************/
55277 -struct be_port_rxf_stats {
55278 - u32 rx_bytes_lsd; /* dword 0*/
55279 - u32 rx_bytes_msd; /* dword 1*/
55280 - u32 rx_total_frames; /* dword 2*/
55281 - u32 rx_unicast_frames; /* dword 3*/
55282 - u32 rx_multicast_frames; /* dword 4*/
55283 - u32 rx_broadcast_frames; /* dword 5*/
55284 - u32 rx_crc_errors; /* dword 6*/
55285 - u32 rx_alignment_symbol_errors; /* dword 7*/
55286 - u32 rx_pause_frames; /* dword 8*/
55287 - u32 rx_control_frames; /* dword 9*/
55288 - u32 rx_in_range_errors; /* dword 10*/
55289 - u32 rx_out_range_errors; /* dword 11*/
55290 - u32 rx_frame_too_long; /* dword 12*/
55291 - u32 rx_address_match_errors; /* dword 13*/
55292 - u32 rx_vlan_mismatch; /* dword 14*/
55293 - u32 rx_dropped_too_small; /* dword 15*/
55294 - u32 rx_dropped_too_short; /* dword 16*/
55295 - u32 rx_dropped_header_too_small; /* dword 17*/
55296 - u32 rx_dropped_tcp_length; /* dword 18*/
55297 - u32 rx_dropped_runt; /* dword 19*/
55298 - u32 rx_64_byte_packets; /* dword 20*/
55299 - u32 rx_65_127_byte_packets; /* dword 21*/
55300 - u32 rx_128_256_byte_packets; /* dword 22*/
55301 - u32 rx_256_511_byte_packets; /* dword 23*/
55302 - u32 rx_512_1023_byte_packets; /* dword 24*/
55303 - u32 rx_1024_1518_byte_packets; /* dword 25*/
55304 - u32 rx_1519_2047_byte_packets; /* dword 26*/
55305 - u32 rx_2048_4095_byte_packets; /* dword 27*/
55306 - u32 rx_4096_8191_byte_packets; /* dword 28*/
55307 - u32 rx_8192_9216_byte_packets; /* dword 29*/
55308 - u32 rx_ip_checksum_errs; /* dword 30*/
55309 - u32 rx_tcp_checksum_errs; /* dword 31*/
55310 - u32 rx_udp_checksum_errs; /* dword 32*/
55311 - u32 rx_non_rss_packets; /* dword 33*/
55312 - u32 rx_ipv4_packets; /* dword 34*/
55313 - u32 rx_ipv6_packets; /* dword 35*/
55314 - u32 rx_ipv4_bytes_lsd; /* dword 36*/
55315 - u32 rx_ipv4_bytes_msd; /* dword 37*/
55316 - u32 rx_ipv6_bytes_lsd; /* dword 38*/
55317 - u32 rx_ipv6_bytes_msd; /* dword 39*/
55318 - u32 rx_chute1_packets; /* dword 40*/
55319 - u32 rx_chute2_packets; /* dword 41*/
55320 - u32 rx_chute3_packets; /* dword 42*/
55321 - u32 rx_management_packets; /* dword 43*/
55322 - u32 rx_switched_unicast_packets; /* dword 44*/
55323 - u32 rx_switched_multicast_packets; /* dword 45*/
55324 - u32 rx_switched_broadcast_packets; /* dword 46*/
55325 - u32 tx_bytes_lsd; /* dword 47*/
55326 - u32 tx_bytes_msd; /* dword 48*/
55327 - u32 tx_unicastframes; /* dword 49*/
55328 - u32 tx_multicastframes; /* dword 50*/
55329 - u32 tx_broadcastframes; /* dword 51*/
55330 - u32 tx_pauseframes; /* dword 52*/
55331 - u32 tx_controlframes; /* dword 53*/
55332 - u32 tx_64_byte_packets; /* dword 54*/
55333 - u32 tx_65_127_byte_packets; /* dword 55*/
55334 - u32 tx_128_256_byte_packets; /* dword 56*/
55335 - u32 tx_256_511_byte_packets; /* dword 57*/
55336 - u32 tx_512_1023_byte_packets; /* dword 58*/
55337 - u32 tx_1024_1518_byte_packets; /* dword 59*/
55338 - u32 tx_1519_2047_byte_packets; /* dword 60*/
55339 - u32 tx_2048_4095_byte_packets; /* dword 61*/
55340 - u32 tx_4096_8191_byte_packets; /* dword 62*/
55341 - u32 tx_8192_9216_byte_packets; /* dword 63*/
55342 - u32 rx_fifo_overflow; /* dword 64*/
55343 - u32 rx_input_fifo_overflow; /* dword 65*/
55344 -};
55345 -
55346 -struct be_rxf_stats {
55347 - struct be_port_rxf_stats port[2];
55348 - u32 rx_drops_no_pbuf; /* dword 132*/
55349 - u32 rx_drops_no_txpb; /* dword 133*/
55350 - u32 rx_drops_no_erx_descr; /* dword 134*/
55351 - u32 rx_drops_no_tpre_descr; /* dword 135*/
55352 - u32 management_rx_port_packets; /* dword 136*/
55353 - u32 management_rx_port_bytes; /* dword 137*/
55354 - u32 management_rx_port_pause_frames; /* dword 138*/
55355 - u32 management_rx_port_errors; /* dword 139*/
55356 - u32 management_tx_port_packets; /* dword 140*/
55357 - u32 management_tx_port_bytes; /* dword 141*/
55358 - u32 management_tx_port_pause; /* dword 142*/
55359 - u32 management_rx_port_rxfifo_overflow; /* dword 143*/
55360 - u32 rx_drops_too_many_frags; /* dword 144*/
55361 - u32 rx_drops_invalid_ring; /* dword 145*/
55362 - u32 forwarded_packets; /* dword 146*/
55363 - u32 rx_drops_mtu; /* dword 147*/
55364 - u32 rsvd0[15];
55365 -};
55366 -
55367 -struct be_erx_stats {
55368 - u32 rx_drops_no_fragments[44]; /* dwordS 0 to 43*/
55369 - u32 debug_wdma_sent_hold; /* dword 44*/
55370 - u32 debug_wdma_pbfree_sent_hold; /* dword 45*/
55371 - u32 debug_wdma_zerobyte_pbfree_sent_hold; /* dword 46*/
55372 - u32 debug_pmem_pbuf_dealloc; /* dword 47*/
55373 -};
55374 -
55375 -struct be_hw_stats {
55376 - struct be_rxf_stats rxf;
55377 - u32 rsvd[48];
55378 - struct be_erx_stats erx;
55379 -};
55380 -
55381 -struct be_cmd_req_get_stats {
55382 - struct be_cmd_req_hdr hdr;
55383 - u8 rsvd[sizeof(struct be_hw_stats)];
55384 -};
55385 -
55386 -struct be_cmd_resp_get_stats {
55387 - struct be_cmd_resp_hdr hdr;
55388 - struct be_hw_stats hw_stats;
55389 -};
55390 -
55391 -struct be_cmd_req_vlan_config {
55392 - struct be_cmd_req_hdr hdr;
55393 - u8 interface_id;
55394 - u8 promiscuous;
55395 - u8 untagged;
55396 - u8 num_vlan;
55397 - u16 normal_vlan[64];
55398 -} __packed;
55399 -
55400 -struct be_cmd_req_promiscuous_config {
55401 - struct be_cmd_req_hdr hdr;
55402 - u8 port0_promiscuous;
55403 - u8 port1_promiscuous;
55404 - u16 rsvd0;
55405 -} __packed;
55406 -
55407 -struct macaddr {
55408 - u8 byte[ETH_ALEN];
55409 -};
55410 -
55411 -struct be_cmd_req_mcast_mac_config {
55412 - struct be_cmd_req_hdr hdr;
55413 - u16 num_mac;
55414 - u8 promiscuous;
55415 - u8 interface_id;
55416 - struct macaddr mac[32];
55417 -} __packed;
55418 -
55419 -static inline struct be_hw_stats *
55420 -hw_stats_from_cmd(struct be_cmd_resp_get_stats *cmd)
55421 -{
55422 - return &cmd->hw_stats;
55423 -}
55424 -
55425 -/******************** Link Status Query *******************/
55426 -struct be_cmd_req_link_status {
55427 - struct be_cmd_req_hdr hdr;
55428 - u32 rsvd;
55429 -};
55430 -
55431 -struct be_link_info {
55432 - u8 duplex;
55433 - u8 speed;
55434 - u8 fault;
55435 -};
55436 -
55437 -enum {
55438 - PHY_LINK_DUPLEX_NONE = 0x0,
55439 - PHY_LINK_DUPLEX_HALF = 0x1,
55440 - PHY_LINK_DUPLEX_FULL = 0x2
55441 -};
55442 -
55443 -enum {
55444 - PHY_LINK_SPEED_ZERO = 0x0, /* => No link */
55445 - PHY_LINK_SPEED_10MBPS = 0x1,
55446 - PHY_LINK_SPEED_100MBPS = 0x2,
55447 - PHY_LINK_SPEED_1GBPS = 0x3,
55448 - PHY_LINK_SPEED_10GBPS = 0x4
55449 -};
55450 -
55451 -struct be_cmd_resp_link_status {
55452 - struct be_cmd_resp_hdr hdr;
55453 - u8 physical_port;
55454 - u8 mac_duplex;
55455 - u8 mac_speed;
55456 - u8 mac_fault;
55457 - u8 mgmt_mac_duplex;
55458 - u8 mgmt_mac_speed;
55459 - u16 rsvd0;
55460 -} __packed;
55461 -
55462 -/******************** Get FW Version *******************/
55463 -#define FW_VER_LEN 32
55464 -struct be_cmd_req_get_fw_version {
55465 - struct be_cmd_req_hdr hdr;
55466 - u8 rsvd0[FW_VER_LEN];
55467 - u8 rsvd1[FW_VER_LEN];
55468 -} __packed;
55469 -
55470 -struct be_cmd_resp_get_fw_version {
55471 - struct be_cmd_resp_hdr hdr;
55472 - u8 firmware_version_string[FW_VER_LEN];
55473 - u8 fw_on_flash_version_string[FW_VER_LEN];
55474 -} __packed;
55475 -
55476 -/******************** Set Flow Contrl *******************/
55477 -struct be_cmd_req_set_flow_control {
55478 - struct be_cmd_req_hdr hdr;
55479 - u16 tx_flow_control;
55480 - u16 rx_flow_control;
55481 -} __packed;
55482 -
55483 -/******************** Get Flow Contrl *******************/
55484 -struct be_cmd_req_get_flow_control {
55485 - struct be_cmd_req_hdr hdr;
55486 - u32 rsvd;
55487 -};
55488 -
55489 -struct be_cmd_resp_get_flow_control {
55490 - struct be_cmd_resp_hdr hdr;
55491 - u16 tx_flow_control;
55492 - u16 rx_flow_control;
55493 -} __packed;
55494 -
55495 -/******************** Modify EQ Delay *******************/
55496 -struct be_cmd_req_modify_eq_delay {
55497 - struct be_cmd_req_hdr hdr;
55498 - u32 num_eq;
55499 - struct {
55500 - u32 eq_id;
55501 - u32 phase;
55502 - u32 delay_multiplier;
55503 - } delay[8];
55504 -} __packed;
55505 -
55506 -struct be_cmd_resp_modify_eq_delay {
55507 - struct be_cmd_resp_hdr hdr;
55508 - u32 rsvd0;
55509 -} __packed;
55510 -
55511 -/******************** Get FW Config *******************/
55512 -struct be_cmd_req_query_fw_cfg {
55513 - struct be_cmd_req_hdr hdr;
55514 - u32 rsvd[30];
55515 -};
55516 -
55517 -struct be_cmd_resp_query_fw_cfg {
55518 - struct be_cmd_resp_hdr hdr;
55519 - u32 be_config_number;
55520 - u32 asic_revision;
55521 - u32 phys_port;
55522 - u32 function_mode;
55523 - u32 rsvd[26];
55524 -};
55525 -
55526 -extern int be_pci_fnum_get(struct be_ctrl_info *ctrl);
55527 -extern int be_cmd_POST(struct be_ctrl_info *ctrl);
55528 -extern int be_cmd_mac_addr_query(struct be_ctrl_info *ctrl, u8 *mac_addr,
55529 - u8 type, bool permanent, u32 if_handle);
55530 -extern int be_cmd_pmac_add(struct be_ctrl_info *ctrl, u8 *mac_addr,
55531 - u32 if_id, u32 *pmac_id);
55532 -extern int be_cmd_pmac_del(struct be_ctrl_info *ctrl, u32 if_id, u32 pmac_id);
55533 -extern int be_cmd_if_create(struct be_ctrl_info *ctrl, u32 if_flags, u8 *mac,
55534 - bool pmac_invalid, u32 *if_handle, u32 *pmac_id);
55535 -extern int be_cmd_if_destroy(struct be_ctrl_info *ctrl, u32 if_handle);
55536 -extern int be_cmd_eq_create(struct be_ctrl_info *ctrl,
55537 - struct be_queue_info *eq, int eq_delay);
55538 -extern int be_cmd_cq_create(struct be_ctrl_info *ctrl,
55539 - struct be_queue_info *cq, struct be_queue_info *eq,
55540 - bool sol_evts, bool no_delay,
55541 - int num_cqe_dma_coalesce);
55542 -extern int be_cmd_txq_create(struct be_ctrl_info *ctrl,
55543 - struct be_queue_info *txq,
55544 - struct be_queue_info *cq);
55545 -extern int be_cmd_rxq_create(struct be_ctrl_info *ctrl,
55546 - struct be_queue_info *rxq, u16 cq_id,
55547 - u16 frag_size, u16 max_frame_size, u32 if_id,
55548 - u32 rss);
55549 -extern int be_cmd_q_destroy(struct be_ctrl_info *ctrl, struct be_queue_info *q,
55550 - int type);
55551 -extern int be_cmd_link_status_query(struct be_ctrl_info *ctrl,
55552 - struct be_link_info *link);
55553 -extern int be_cmd_reset(struct be_ctrl_info *ctrl);
55554 -extern int be_cmd_get_stats(struct be_ctrl_info *ctrl,
55555 - struct be_dma_mem *nonemb_cmd);
55556 -extern int be_cmd_get_fw_ver(struct be_ctrl_info *ctrl, char *fw_ver);
55557 -
55558 -extern int be_cmd_modify_eqd(struct be_ctrl_info *ctrl, u32 eq_id, u32 eqd);
55559 -extern int be_cmd_vlan_config(struct be_ctrl_info *ctrl, u32 if_id,
55560 - u16 *vtag_array, u32 num, bool untagged,
55561 - bool promiscuous);
55562 -extern int be_cmd_promiscuous_config(struct be_ctrl_info *ctrl,
55563 - u8 port_num, bool en);
55564 -extern int be_cmd_mcast_mac_set(struct be_ctrl_info *ctrl, u32 if_id,
55565 - u8 *mac_table, u32 num, bool promiscuous);
55566 -extern int be_cmd_set_flow_control(struct be_ctrl_info *ctrl,
55567 - u32 tx_fc, u32 rx_fc);
55568 -extern int be_cmd_get_flow_control(struct be_ctrl_info *ctrl,
55569 - u32 *tx_fc, u32 *rx_fc);
55570 -extern int be_cmd_query_fw_cfg(struct be_ctrl_info *ctrl, u32 *port_num);
55571 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/benet/be_ethtool.c linux-2.6.29-rc3.owrt/drivers/net/benet/be_ethtool.c
55572 --- linux-2.6.29.owrt/drivers/net/benet/be_ethtool.c 2009-05-10 22:04:38.000000000 +0200
55573 +++ linux-2.6.29-rc3.owrt/drivers/net/benet/be_ethtool.c 1970-01-01 01:00:00.000000000 +0100
55574 @@ -1,362 +0,0 @@
55575 -/*
55576 - * Copyright (C) 2005 - 2009 ServerEngines
55577 - * All rights reserved.
55578 - *
55579 - * This program is free software; you can redistribute it and/or
55580 - * modify it under the terms of the GNU General Public License version 2
55581 - * as published by the Free Software Foundation. The full GNU General
55582 - * Public License is included in this distribution in the file called COPYING.
55583 - *
55584 - * Contact Information:
55585 - * linux-drivers@serverengines.com
55586 - *
55587 - * ServerEngines
55588 - * 209 N. Fair Oaks Ave
55589 - * Sunnyvale, CA 94085
55590 - */
55591 -
55592 -#include "be.h"
55593 -#include <linux/ethtool.h>
55594 -
55595 -struct be_ethtool_stat {
55596 - char desc[ETH_GSTRING_LEN];
55597 - int type;
55598 - int size;
55599 - int offset;
55600 -};
55601 -
55602 -enum {NETSTAT, PORTSTAT, MISCSTAT, DRVSTAT, ERXSTAT};
55603 -#define FIELDINFO(_struct, field) FIELD_SIZEOF(_struct, field), \
55604 - offsetof(_struct, field)
55605 -#define NETSTAT_INFO(field) #field, NETSTAT,\
55606 - FIELDINFO(struct net_device_stats,\
55607 - field)
55608 -#define DRVSTAT_INFO(field) #field, DRVSTAT,\
55609 - FIELDINFO(struct be_drvr_stats, field)
55610 -#define MISCSTAT_INFO(field) #field, MISCSTAT,\
55611 - FIELDINFO(struct be_rxf_stats, field)
55612 -#define PORTSTAT_INFO(field) #field, PORTSTAT,\
55613 - FIELDINFO(struct be_port_rxf_stats, \
55614 - field)
55615 -#define ERXSTAT_INFO(field) #field, ERXSTAT,\
55616 - FIELDINFO(struct be_erx_stats, field)
55617 -
55618 -static const struct be_ethtool_stat et_stats[] = {
55619 - {NETSTAT_INFO(rx_packets)},
55620 - {NETSTAT_INFO(tx_packets)},
55621 - {NETSTAT_INFO(rx_bytes)},
55622 - {NETSTAT_INFO(tx_bytes)},
55623 - {NETSTAT_INFO(rx_errors)},
55624 - {NETSTAT_INFO(tx_errors)},
55625 - {NETSTAT_INFO(rx_dropped)},
55626 - {NETSTAT_INFO(tx_dropped)},
55627 - {DRVSTAT_INFO(be_tx_reqs)},
55628 - {DRVSTAT_INFO(be_tx_stops)},
55629 - {DRVSTAT_INFO(be_fwd_reqs)},
55630 - {DRVSTAT_INFO(be_tx_wrbs)},
55631 - {DRVSTAT_INFO(be_polls)},
55632 - {DRVSTAT_INFO(be_tx_events)},
55633 - {DRVSTAT_INFO(be_rx_events)},
55634 - {DRVSTAT_INFO(be_tx_compl)},
55635 - {DRVSTAT_INFO(be_rx_compl)},
55636 - {DRVSTAT_INFO(be_ethrx_post_fail)},
55637 - {DRVSTAT_INFO(be_802_3_dropped_frames)},
55638 - {DRVSTAT_INFO(be_802_3_malformed_frames)},
55639 - {DRVSTAT_INFO(be_tx_rate)},
55640 - {DRVSTAT_INFO(be_rx_rate)},
55641 - {PORTSTAT_INFO(rx_unicast_frames)},
55642 - {PORTSTAT_INFO(rx_multicast_frames)},
55643 - {PORTSTAT_INFO(rx_broadcast_frames)},
55644 - {PORTSTAT_INFO(rx_crc_errors)},
55645 - {PORTSTAT_INFO(rx_alignment_symbol_errors)},
55646 - {PORTSTAT_INFO(rx_pause_frames)},
55647 - {PORTSTAT_INFO(rx_control_frames)},
55648 - {PORTSTAT_INFO(rx_in_range_errors)},
55649 - {PORTSTAT_INFO(rx_out_range_errors)},
55650 - {PORTSTAT_INFO(rx_frame_too_long)},
55651 - {PORTSTAT_INFO(rx_address_match_errors)},
55652 - {PORTSTAT_INFO(rx_vlan_mismatch)},
55653 - {PORTSTAT_INFO(rx_dropped_too_small)},
55654 - {PORTSTAT_INFO(rx_dropped_too_short)},
55655 - {PORTSTAT_INFO(rx_dropped_header_too_small)},
55656 - {PORTSTAT_INFO(rx_dropped_tcp_length)},
55657 - {PORTSTAT_INFO(rx_dropped_runt)},
55658 - {PORTSTAT_INFO(rx_fifo_overflow)},
55659 - {PORTSTAT_INFO(rx_input_fifo_overflow)},
55660 - {PORTSTAT_INFO(rx_ip_checksum_errs)},
55661 - {PORTSTAT_INFO(rx_tcp_checksum_errs)},
55662 - {PORTSTAT_INFO(rx_udp_checksum_errs)},
55663 - {PORTSTAT_INFO(rx_non_rss_packets)},
55664 - {PORTSTAT_INFO(rx_ipv4_packets)},
55665 - {PORTSTAT_INFO(rx_ipv6_packets)},
55666 - {PORTSTAT_INFO(tx_unicastframes)},
55667 - {PORTSTAT_INFO(tx_multicastframes)},
55668 - {PORTSTAT_INFO(tx_broadcastframes)},
55669 - {PORTSTAT_INFO(tx_pauseframes)},
55670 - {PORTSTAT_INFO(tx_controlframes)},
55671 - {MISCSTAT_INFO(rx_drops_no_pbuf)},
55672 - {MISCSTAT_INFO(rx_drops_no_txpb)},
55673 - {MISCSTAT_INFO(rx_drops_no_erx_descr)},
55674 - {MISCSTAT_INFO(rx_drops_no_tpre_descr)},
55675 - {MISCSTAT_INFO(rx_drops_too_many_frags)},
55676 - {MISCSTAT_INFO(rx_drops_invalid_ring)},
55677 - {MISCSTAT_INFO(forwarded_packets)},
55678 - {MISCSTAT_INFO(rx_drops_mtu)},
55679 - {ERXSTAT_INFO(rx_drops_no_fragments)},
55680 -};
55681 -#define ETHTOOL_STATS_NUM ARRAY_SIZE(et_stats)
55682 -
55683 -static void
55684 -be_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo)
55685 -{
55686 - struct be_adapter *adapter = netdev_priv(netdev);
55687 -
55688 - strcpy(drvinfo->driver, DRV_NAME);
55689 - strcpy(drvinfo->version, DRV_VER);
55690 - strncpy(drvinfo->fw_version, adapter->fw_ver, FW_VER_LEN);
55691 - strcpy(drvinfo->bus_info, pci_name(adapter->pdev));
55692 - drvinfo->testinfo_len = 0;
55693 - drvinfo->regdump_len = 0;
55694 - drvinfo->eedump_len = 0;
55695 -}
55696 -
55697 -static int
55698 -be_get_coalesce(struct net_device *netdev, struct ethtool_coalesce *coalesce)
55699 -{
55700 - struct be_adapter *adapter = netdev_priv(netdev);
55701 - struct be_eq_obj *rx_eq = &adapter->rx_eq;
55702 - struct be_eq_obj *tx_eq = &adapter->tx_eq;
55703 -
55704 - coalesce->rx_max_coalesced_frames = adapter->max_rx_coal;
55705 -
55706 - coalesce->rx_coalesce_usecs = rx_eq->cur_eqd;
55707 - coalesce->rx_coalesce_usecs_high = rx_eq->max_eqd;
55708 - coalesce->rx_coalesce_usecs_low = rx_eq->min_eqd;
55709 -
55710 - coalesce->tx_coalesce_usecs = tx_eq->cur_eqd;
55711 - coalesce->tx_coalesce_usecs_high = tx_eq->max_eqd;
55712 - coalesce->tx_coalesce_usecs_low = tx_eq->min_eqd;
55713 -
55714 - coalesce->use_adaptive_rx_coalesce = rx_eq->enable_aic;
55715 - coalesce->use_adaptive_tx_coalesce = tx_eq->enable_aic;
55716 -
55717 - return 0;
55718 -}
55719 -
55720 -/*
55721 - * This routine is used to set interrup coalescing delay *as well as*
55722 - * the number of pkts to coalesce for LRO.
55723 - */
55724 -static int
55725 -be_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *coalesce)
55726 -{
55727 - struct be_adapter *adapter = netdev_priv(netdev);
55728 - struct be_ctrl_info *ctrl = &adapter->ctrl;
55729 - struct be_eq_obj *rx_eq = &adapter->rx_eq;
55730 - struct be_eq_obj *tx_eq = &adapter->tx_eq;
55731 - u32 tx_max, tx_min, tx_cur;
55732 - u32 rx_max, rx_min, rx_cur;
55733 - int status = 0;
55734 -
55735 - if (coalesce->use_adaptive_tx_coalesce == 1)
55736 - return -EINVAL;
55737 -
55738 - adapter->max_rx_coal = coalesce->rx_max_coalesced_frames;
55739 - if (adapter->max_rx_coal > MAX_SKB_FRAGS)
55740 - adapter->max_rx_coal = MAX_SKB_FRAGS - 1;
55741 -
55742 - /* if AIC is being turned on now, start with an EQD of 0 */
55743 - if (rx_eq->enable_aic == 0 &&
55744 - coalesce->use_adaptive_rx_coalesce == 1) {
55745 - rx_eq->cur_eqd = 0;
55746 - }
55747 - rx_eq->enable_aic = coalesce->use_adaptive_rx_coalesce;
55748 -
55749 - rx_max = coalesce->rx_coalesce_usecs_high;
55750 - rx_min = coalesce->rx_coalesce_usecs_low;
55751 - rx_cur = coalesce->rx_coalesce_usecs;
55752 -
55753 - tx_max = coalesce->tx_coalesce_usecs_high;
55754 - tx_min = coalesce->tx_coalesce_usecs_low;
55755 - tx_cur = coalesce->tx_coalesce_usecs;
55756 -
55757 - if (tx_cur > BE_MAX_EQD)
55758 - tx_cur = BE_MAX_EQD;
55759 - if (tx_eq->cur_eqd != tx_cur) {
55760 - status = be_cmd_modify_eqd(ctrl, tx_eq->q.id, tx_cur);
55761 - if (!status)
55762 - tx_eq->cur_eqd = tx_cur;
55763 - }
55764 -
55765 - if (rx_eq->enable_aic) {
55766 - if (rx_max > BE_MAX_EQD)
55767 - rx_max = BE_MAX_EQD;
55768 - if (rx_min > rx_max)
55769 - rx_min = rx_max;
55770 - rx_eq->max_eqd = rx_max;
55771 - rx_eq->min_eqd = rx_min;
55772 - if (rx_eq->cur_eqd > rx_max)
55773 - rx_eq->cur_eqd = rx_max;
55774 - if (rx_eq->cur_eqd < rx_min)
55775 - rx_eq->cur_eqd = rx_min;
55776 - } else {
55777 - if (rx_cur > BE_MAX_EQD)
55778 - rx_cur = BE_MAX_EQD;
55779 - if (rx_eq->cur_eqd != rx_cur) {
55780 - status = be_cmd_modify_eqd(ctrl, rx_eq->q.id, rx_cur);
55781 - if (!status)
55782 - rx_eq->cur_eqd = rx_cur;
55783 - }
55784 - }
55785 - return 0;
55786 -}
55787 -
55788 -static u32 be_get_rx_csum(struct net_device *netdev)
55789 -{
55790 - struct be_adapter *adapter = netdev_priv(netdev);
55791 -
55792 - return adapter->rx_csum;
55793 -}
55794 -
55795 -static int be_set_rx_csum(struct net_device *netdev, uint32_t data)
55796 -{
55797 - struct be_adapter *adapter = netdev_priv(netdev);
55798 -
55799 - if (data)
55800 - adapter->rx_csum = true;
55801 - else
55802 - adapter->rx_csum = false;
55803 -
55804 - return 0;
55805 -}
55806 -
55807 -static void
55808 -be_get_ethtool_stats(struct net_device *netdev,
55809 - struct ethtool_stats *stats, uint64_t *data)
55810 -{
55811 - struct be_adapter *adapter = netdev_priv(netdev);
55812 - struct be_drvr_stats *drvr_stats = &adapter->stats.drvr_stats;
55813 - struct be_hw_stats *hw_stats = hw_stats_from_cmd(adapter->stats.cmd.va);
55814 - struct be_rxf_stats *rxf_stats = &hw_stats->rxf;
55815 - struct be_port_rxf_stats *port_stats =
55816 - &rxf_stats->port[adapter->port_num];
55817 - struct net_device_stats *net_stats = &adapter->stats.net_stats;
55818 - struct be_erx_stats *erx_stats = &hw_stats->erx;
55819 - void *p = NULL;
55820 - int i;
55821 -
55822 - for (i = 0; i < ETHTOOL_STATS_NUM; i++) {
55823 - switch (et_stats[i].type) {
55824 - case NETSTAT:
55825 - p = net_stats;
55826 - break;
55827 - case DRVSTAT:
55828 - p = drvr_stats;
55829 - break;
55830 - case PORTSTAT:
55831 - p = port_stats;
55832 - break;
55833 - case MISCSTAT:
55834 - p = rxf_stats;
55835 - break;
55836 - case ERXSTAT: /* Currently only one ERX stat is provided */
55837 - p = (u32 *)erx_stats + adapter->rx_obj.q.id;
55838 - break;
55839 - }
55840 -
55841 - p = (u8 *)p + et_stats[i].offset;
55842 - data[i] = (et_stats[i].size == sizeof(u64)) ?
55843 - *(u64 *)p: *(u32 *)p;
55844 - }
55845 -
55846 - return;
55847 -}
55848 -
55849 -static void
55850 -be_get_stat_strings(struct net_device *netdev, uint32_t stringset,
55851 - uint8_t *data)
55852 -{
55853 - int i;
55854 - switch (stringset) {
55855 - case ETH_SS_STATS:
55856 - for (i = 0; i < ETHTOOL_STATS_NUM; i++) {
55857 - memcpy(data, et_stats[i].desc, ETH_GSTRING_LEN);
55858 - data += ETH_GSTRING_LEN;
55859 - }
55860 - break;
55861 - }
55862 -}
55863 -
55864 -static int be_get_stats_count(struct net_device *netdev)
55865 -{
55866 - return ETHTOOL_STATS_NUM;
55867 -}
55868 -
55869 -static int be_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
55870 -{
55871 - ecmd->speed = SPEED_10000;
55872 - ecmd->duplex = DUPLEX_FULL;
55873 - ecmd->autoneg = AUTONEG_DISABLE;
55874 - return 0;
55875 -}
55876 -
55877 -static void
55878 -be_get_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring)
55879 -{
55880 - struct be_adapter *adapter = netdev_priv(netdev);
55881 -
55882 - ring->rx_max_pending = adapter->rx_obj.q.len;
55883 - ring->tx_max_pending = adapter->tx_obj.q.len;
55884 -
55885 - ring->rx_pending = atomic_read(&adapter->rx_obj.q.used);
55886 - ring->tx_pending = atomic_read(&adapter->tx_obj.q.used);
55887 -}
55888 -
55889 -static void
55890 -be_get_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *ecmd)
55891 -{
55892 - struct be_adapter *adapter = netdev_priv(netdev);
55893 -
55894 - be_cmd_get_flow_control(&adapter->ctrl, &ecmd->tx_pause,
55895 - &ecmd->rx_pause);
55896 - ecmd->autoneg = AUTONEG_ENABLE;
55897 -}
55898 -
55899 -static int
55900 -be_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *ecmd)
55901 -{
55902 - struct be_adapter *adapter = netdev_priv(netdev);
55903 - int status;
55904 -
55905 - if (ecmd->autoneg != AUTONEG_ENABLE)
55906 - return -EINVAL;
55907 -
55908 - status = be_cmd_set_flow_control(&adapter->ctrl, ecmd->tx_pause,
55909 - ecmd->rx_pause);
55910 - if (!status)
55911 - dev_warn(&adapter->pdev->dev, "Pause param set failed.\n");
55912 -
55913 - return status;
55914 -}
55915 -
55916 -struct ethtool_ops be_ethtool_ops = {
55917 - .get_settings = be_get_settings,
55918 - .get_drvinfo = be_get_drvinfo,
55919 - .get_link = ethtool_op_get_link,
55920 - .get_coalesce = be_get_coalesce,
55921 - .set_coalesce = be_set_coalesce,
55922 - .get_ringparam = be_get_ringparam,
55923 - .get_pauseparam = be_get_pauseparam,
55924 - .set_pauseparam = be_set_pauseparam,
55925 - .get_rx_csum = be_get_rx_csum,
55926 - .set_rx_csum = be_set_rx_csum,
55927 - .get_tx_csum = ethtool_op_get_tx_csum,
55928 - .set_tx_csum = ethtool_op_set_tx_csum,
55929 - .get_sg = ethtool_op_get_sg,
55930 - .set_sg = ethtool_op_set_sg,
55931 - .get_tso = ethtool_op_get_tso,
55932 - .set_tso = ethtool_op_set_tso,
55933 - .get_strings = be_get_stat_strings,
55934 - .get_stats_count = be_get_stats_count,
55935 - .get_ethtool_stats = be_get_ethtool_stats,
55936 -};
55937 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/benet/be.h linux-2.6.29-rc3.owrt/drivers/net/benet/be.h
55938 --- linux-2.6.29.owrt/drivers/net/benet/be.h 2009-05-10 22:04:38.000000000 +0200
55939 +++ linux-2.6.29-rc3.owrt/drivers/net/benet/be.h 1970-01-01 01:00:00.000000000 +0100
55940 @@ -1,328 +0,0 @@
55941 -/*
55942 - * Copyright (C) 2005 - 2009 ServerEngines
55943 - * All rights reserved.
55944 - *
55945 - * This program is free software; you can redistribute it and/or
55946 - * modify it under the terms of the GNU General Public License version 2
55947 - * as published by the Free Software Foundation. The full GNU General
55948 - * Public License is included in this distribution in the file called COPYING.
55949 - *
55950 - * Contact Information:
55951 - * linux-drivers@serverengines.com
55952 - *
55953 - * ServerEngines
55954 - * 209 N. Fair Oaks Ave
55955 - * Sunnyvale, CA 94085
55956 - */
55957 -
55958 -#ifndef BE_H
55959 -#define BE_H
55960 -
55961 -#include <linux/pci.h>
55962 -#include <linux/etherdevice.h>
55963 -#include <linux/version.h>
55964 -#include <linux/delay.h>
55965 -#include <net/tcp.h>
55966 -#include <net/ip.h>
55967 -#include <net/ipv6.h>
55968 -#include <linux/if_vlan.h>
55969 -#include <linux/workqueue.h>
55970 -#include <linux/interrupt.h>
55971 -#include <linux/inet_lro.h>
55972 -
55973 -#include "be_hw.h"
55974 -
55975 -#define DRV_VER "2.0.348"
55976 -#define DRV_NAME "be2net"
55977 -#define BE_NAME "ServerEngines BladeEngine2 10Gbps NIC"
55978 -#define DRV_DESC BE_NAME "Driver"
55979 -
55980 -/* Number of bytes of an RX frame that are copied to skb->data */
55981 -#define BE_HDR_LEN 64
55982 -#define BE_MAX_JUMBO_FRAME_SIZE 9018
55983 -#define BE_MIN_MTU 256
55984 -
55985 -#define BE_NUM_VLANS_SUPPORTED 64
55986 -#define BE_MAX_EQD 96
55987 -#define BE_MAX_TX_FRAG_COUNT 30
55988 -
55989 -#define EVNT_Q_LEN 1024
55990 -#define TX_Q_LEN 2048
55991 -#define TX_CQ_LEN 1024
55992 -#define RX_Q_LEN 1024 /* Does not support any other value */
55993 -#define RX_CQ_LEN 1024
55994 -#define MCC_Q_LEN 64 /* total size not to exceed 8 pages */
55995 -#define MCC_CQ_LEN 256
55996 -
55997 -#define BE_NAPI_WEIGHT 64
55998 -#define MAX_RX_POST BE_NAPI_WEIGHT /* Frags posted at a time */
55999 -#define RX_FRAGS_REFILL_WM (RX_Q_LEN - MAX_RX_POST)
56000 -
56001 -#define BE_MAX_LRO_DESCRIPTORS 16
56002 -#define BE_MAX_FRAGS_PER_FRAME 16
56003 -
56004 -struct be_dma_mem {
56005 - void *va;
56006 - dma_addr_t dma;
56007 - u32 size;
56008 -};
56009 -
56010 -struct be_queue_info {
56011 - struct be_dma_mem dma_mem;
56012 - u16 len;
56013 - u16 entry_size; /* Size of an element in the queue */
56014 - u16 id;
56015 - u16 tail, head;
56016 - bool created;
56017 - atomic_t used; /* Number of valid elements in the queue */
56018 -};
56019 -
56020 -struct be_ctrl_info {
56021 - u8 __iomem *csr;
56022 - u8 __iomem *db; /* Door Bell */
56023 - u8 __iomem *pcicfg; /* PCI config space */
56024 - int pci_func;
56025 -
56026 - /* Mbox used for cmd request/response */
56027 - spinlock_t cmd_lock; /* For serializing cmds to BE card */
56028 - struct be_dma_mem mbox_mem;
56029 - /* Mbox mem is adjusted to align to 16 bytes. The allocated addr
56030 - * is stored for freeing purpose */
56031 - struct be_dma_mem mbox_mem_alloced;
56032 -};
56033 -
56034 -#include "be_cmds.h"
56035 -
56036 -struct be_drvr_stats {
56037 - u32 be_tx_reqs; /* number of TX requests initiated */
56038 - u32 be_tx_stops; /* number of times TX Q was stopped */
56039 - u32 be_fwd_reqs; /* number of send reqs through forwarding i/f */
56040 - u32 be_tx_wrbs; /* number of tx WRBs used */
56041 - u32 be_tx_events; /* number of tx completion events */
56042 - u32 be_tx_compl; /* number of tx completion entries processed */
56043 - u64 be_tx_jiffies;
56044 - ulong be_tx_bytes;
56045 - ulong be_tx_bytes_prev;
56046 - u32 be_tx_rate;
56047 -
56048 - u32 cache_barrier[16];
56049 -
56050 - u32 be_ethrx_post_fail;/* number of ethrx buffer alloc failures */
56051 - u32 be_polls; /* number of times NAPI called poll function */
56052 - u32 be_rx_events; /* number of ucast rx completion events */
56053 - u32 be_rx_compl; /* number of rx completion entries processed */
56054 - u32 be_lro_hgram_data[8]; /* histogram of LRO data packets */
56055 - u32 be_lro_hgram_ack[8]; /* histogram of LRO ACKs */
56056 - u64 be_rx_jiffies;
56057 - ulong be_rx_bytes;
56058 - ulong be_rx_bytes_prev;
56059 - u32 be_rx_rate;
56060 - /* number of non ether type II frames dropped where
56061 - * frame len > length field of Mac Hdr */
56062 - u32 be_802_3_dropped_frames;
56063 - /* number of non ether type II frames malformed where
56064 - * in frame len < length field of Mac Hdr */
56065 - u32 be_802_3_malformed_frames;
56066 - u32 be_rxcp_err; /* Num rx completion entries w/ err set. */
56067 - ulong rx_fps_jiffies; /* jiffies at last FPS calc */
56068 - u32 be_rx_frags;
56069 - u32 be_prev_rx_frags;
56070 - u32 be_rx_fps; /* Rx frags per second */
56071 -};
56072 -
56073 -struct be_stats_obj {
56074 - struct be_drvr_stats drvr_stats;
56075 - struct net_device_stats net_stats;
56076 - struct be_dma_mem cmd;
56077 -};
56078 -
56079 -struct be_eq_obj {
56080 - struct be_queue_info q;
56081 - char desc[32];
56082 -
56083 - /* Adaptive interrupt coalescing (AIC) info */
56084 - bool enable_aic;
56085 - u16 min_eqd; /* in usecs */
56086 - u16 max_eqd; /* in usecs */
56087 - u16 cur_eqd; /* in usecs */
56088 -
56089 - struct napi_struct napi;
56090 -};
56091 -
56092 -struct be_tx_obj {
56093 - struct be_queue_info q;
56094 - struct be_queue_info cq;
56095 - /* Remember the skbs that were transmitted */
56096 - struct sk_buff *sent_skb_list[TX_Q_LEN];
56097 -};
56098 -
56099 -/* Struct to remember the pages posted for rx frags */
56100 -struct be_rx_page_info {
56101 - struct page *page;
56102 - dma_addr_t bus;
56103 - u16 page_offset;
56104 - bool last_page_user;
56105 -};
56106 -
56107 -struct be_rx_obj {
56108 - struct be_queue_info q;
56109 - struct be_queue_info cq;
56110 - struct be_rx_page_info page_info_tbl[RX_Q_LEN];
56111 - struct net_lro_mgr lro_mgr;
56112 - struct net_lro_desc lro_desc[BE_MAX_LRO_DESCRIPTORS];
56113 -};
56114 -
56115 -#define BE_NUM_MSIX_VECTORS 2 /* 1 each for Tx and Rx */
56116 -struct be_adapter {
56117 - struct pci_dev *pdev;
56118 - struct net_device *netdev;
56119 -
56120 - /* Mbox, pci config, csr address information */
56121 - struct be_ctrl_info ctrl;
56122 -
56123 - struct msix_entry msix_entries[BE_NUM_MSIX_VECTORS];
56124 - bool msix_enabled;
56125 - bool isr_registered;
56126 -
56127 - /* TX Rings */
56128 - struct be_eq_obj tx_eq;
56129 - struct be_tx_obj tx_obj;
56130 -
56131 - u32 cache_line_break[8];
56132 -
56133 - /* Rx rings */
56134 - struct be_eq_obj rx_eq;
56135 - struct be_rx_obj rx_obj;
56136 - u32 big_page_size; /* Compounded page size shared by rx wrbs */
56137 - bool rx_post_starved; /* Zero rx frags have been posted to BE */
56138 -
56139 - struct vlan_group *vlan_grp;
56140 - u16 num_vlans;
56141 - u8 vlan_tag[VLAN_GROUP_ARRAY_LEN];
56142 -
56143 - struct be_stats_obj stats;
56144 - /* Work queue used to perform periodic tasks like getting statistics */
56145 - struct delayed_work work;
56146 -
56147 - /* Ethtool knobs and info */
56148 - bool rx_csum; /* BE card must perform rx-checksumming */
56149 - u32 max_rx_coal;
56150 - char fw_ver[FW_VER_LEN];
56151 - u32 if_handle; /* Used to configure filtering */
56152 - u32 pmac_id; /* MAC addr handle used by BE card */
56153 -
56154 - struct be_link_info link;
56155 - u32 port_num;
56156 -};
56157 -
56158 -extern struct ethtool_ops be_ethtool_ops;
56159 -
56160 -#define drvr_stats(adapter) (&adapter->stats.drvr_stats)
56161 -
56162 -#define BE_SET_NETDEV_OPS(netdev, ops) (netdev->netdev_ops = ops)
56163 -
56164 -static inline u32 MODULO(u16 val, u16 limit)
56165 -{
56166 - BUG_ON(limit & (limit - 1));
56167 - return val & (limit - 1);
56168 -}
56169 -
56170 -static inline void index_adv(u16 *index, u16 val, u16 limit)
56171 -{
56172 - *index = MODULO((*index + val), limit);
56173 -}
56174 -
56175 -static inline void index_inc(u16 *index, u16 limit)
56176 -{
56177 - *index = MODULO((*index + 1), limit);
56178 -}
56179 -
56180 -#define PAGE_SHIFT_4K 12
56181 -#define PAGE_SIZE_4K (1 << PAGE_SHIFT_4K)
56182 -
56183 -/* Returns number of pages spanned by the data starting at the given addr */
56184 -#define PAGES_4K_SPANNED(_address, size) \
56185 - ((u32)((((size_t)(_address) & (PAGE_SIZE_4K - 1)) + \
56186 - (size) + (PAGE_SIZE_4K - 1)) >> PAGE_SHIFT_4K))
56187 -
56188 -/* Byte offset into the page corresponding to given address */
56189 -#define OFFSET_IN_PAGE(addr) \
56190 - ((size_t)(addr) & (PAGE_SIZE_4K-1))
56191 -
56192 -/* Returns bit offset within a DWORD of a bitfield */
56193 -#define AMAP_BIT_OFFSET(_struct, field) \
56194 - (((size_t)&(((_struct *)0)->field))%32)
56195 -
56196 -/* Returns the bit mask of the field that is NOT shifted into location. */
56197 -static inline u32 amap_mask(u32 bitsize)
56198 -{
56199 - return (bitsize == 32 ? 0xFFFFFFFF : (1 << bitsize) - 1);
56200 -}
56201 -
56202 -static inline void
56203 -amap_set(void *ptr, u32 dw_offset, u32 mask, u32 offset, u32 value)
56204 -{
56205 - u32 *dw = (u32 *) ptr + dw_offset;
56206 - *dw &= ~(mask << offset);
56207 - *dw |= (mask & value) << offset;
56208 -}
56209 -
56210 -#define AMAP_SET_BITS(_struct, field, ptr, val) \
56211 - amap_set(ptr, \
56212 - offsetof(_struct, field)/32, \
56213 - amap_mask(sizeof(((_struct *)0)->field)), \
56214 - AMAP_BIT_OFFSET(_struct, field), \
56215 - val)
56216 -
56217 -static inline u32 amap_get(void *ptr, u32 dw_offset, u32 mask, u32 offset)
56218 -{
56219 - u32 *dw = (u32 *) ptr;
56220 - return mask & (*(dw + dw_offset) >> offset);
56221 -}
56222 -
56223 -#define AMAP_GET_BITS(_struct, field, ptr) \
56224 - amap_get(ptr, \
56225 - offsetof(_struct, field)/32, \
56226 - amap_mask(sizeof(((_struct *)0)->field)), \
56227 - AMAP_BIT_OFFSET(_struct, field))
56228 -
56229 -#define be_dws_cpu_to_le(wrb, len) swap_dws(wrb, len)
56230 -#define be_dws_le_to_cpu(wrb, len) swap_dws(wrb, len)
56231 -static inline void swap_dws(void *wrb, int len)
56232 -{
56233 -#ifdef __BIG_ENDIAN
56234 - u32 *dw = wrb;
56235 - BUG_ON(len % 4);
56236 - do {
56237 - *dw = cpu_to_le32(*dw);
56238 - dw++;
56239 - len -= 4;
56240 - } while (len);
56241 -#endif /* __BIG_ENDIAN */
56242 -}
56243 -
56244 -static inline u8 is_tcp_pkt(struct sk_buff *skb)
56245 -{
56246 - u8 val = 0;
56247 -
56248 - if (ip_hdr(skb)->version == 4)
56249 - val = (ip_hdr(skb)->protocol == IPPROTO_TCP);
56250 - else if (ip_hdr(skb)->version == 6)
56251 - val = (ipv6_hdr(skb)->nexthdr == NEXTHDR_TCP);
56252 -
56253 - return val;
56254 -}
56255 -
56256 -static inline u8 is_udp_pkt(struct sk_buff *skb)
56257 -{
56258 - u8 val = 0;
56259 -
56260 - if (ip_hdr(skb)->version == 4)
56261 - val = (ip_hdr(skb)->protocol == IPPROTO_UDP);
56262 - else if (ip_hdr(skb)->version == 6)
56263 - val = (ipv6_hdr(skb)->nexthdr == NEXTHDR_UDP);
56264 -
56265 - return val;
56266 -}
56267 -
56268 -#endif /* BE_H */
56269 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/benet/be_hw.h linux-2.6.29-rc3.owrt/drivers/net/benet/be_hw.h
56270 --- linux-2.6.29.owrt/drivers/net/benet/be_hw.h 2009-05-10 22:04:38.000000000 +0200
56271 +++ linux-2.6.29-rc3.owrt/drivers/net/benet/be_hw.h 1970-01-01 01:00:00.000000000 +0100
56272 @@ -1,211 +0,0 @@
56273 -/*
56274 - * Copyright (C) 2005 - 2009 ServerEngines
56275 - * All rights reserved.
56276 - *
56277 - * This program is free software; you can redistribute it and/or
56278 - * modify it under the terms of the GNU General Public License version 2
56279 - * as published by the Free Software Foundation. The full GNU General
56280 - * Public License is included in this distribution in the file called COPYING.
56281 - *
56282 - * Contact Information:
56283 - * linux-drivers@serverengines.com
56284 - *
56285 - * ServerEngines
56286 - * 209 N. Fair Oaks Ave
56287 - * Sunnyvale, CA 94085
56288 - */
56289 -
56290 -/********* Mailbox door bell *************/
56291 -/* Used for driver communication with the FW.
56292 - * The software must write this register twice to post any command. First,
56293 - * it writes the register with hi=1 and the upper bits of the physical address
56294 - * for the MAILBOX structure. Software must poll the ready bit until this
56295 - * is acknowledged. Then, sotware writes the register with hi=0 with the lower
56296 - * bits in the address. It must poll the ready bit until the command is
56297 - * complete. Upon completion, the MAILBOX will contain a valid completion
56298 - * queue entry.
56299 - */
56300 -#define MPU_MAILBOX_DB_OFFSET 0x160
56301 -#define MPU_MAILBOX_DB_RDY_MASK 0x1 /* bit 0 */
56302 -#define MPU_MAILBOX_DB_HI_MASK 0x2 /* bit 1 */
56303 -
56304 -#define MPU_EP_CONTROL 0
56305 -
56306 -/********** MPU semphore ******************/
56307 -#define MPU_EP_SEMAPHORE_OFFSET 0xac
56308 -#define EP_SEMAPHORE_POST_STAGE_MASK 0x0000FFFF
56309 -#define EP_SEMAPHORE_POST_ERR_MASK 0x1
56310 -#define EP_SEMAPHORE_POST_ERR_SHIFT 31
56311 -/* MPU semphore POST stage values */
56312 -#define POST_STAGE_AWAITING_HOST_RDY 0x1 /* FW awaiting goahead from host */
56313 -#define POST_STAGE_HOST_RDY 0x2 /* Host has given go-ahed to FW */
56314 -#define POST_STAGE_BE_RESET 0x3 /* Host wants to reset chip */
56315 -#define POST_STAGE_ARMFW_RDY 0xc000 /* FW is done with POST */
56316 -
56317 -/********* Memory BAR register ************/
56318 -#define PCICFG_MEMBAR_CTRL_INT_CTRL_OFFSET 0xfc
56319 -/* Host Interrupt Enable, if set interrupts are enabled although "PCI Interrupt
56320 - * Disable" may still globally block interrupts in addition to individual
56321 - * interrupt masks; a mechanism for the device driver to block all interrupts
56322 - * atomically without having to arbitrate for the PCI Interrupt Disable bit
56323 - * with the OS.
56324 - */
56325 -#define MEMBAR_CTRL_INT_CTRL_HOSTINTR_MASK (1 << 29) /* bit 29 */
56326 -/* PCI physical function number */
56327 -#define MEMBAR_CTRL_INT_CTRL_PFUNC_MASK 0x7 /* bits 26 - 28 */
56328 -#define MEMBAR_CTRL_INT_CTRL_PFUNC_SHIFT 26
56329 -
56330 -/********* Event Q door bell *************/
56331 -#define DB_EQ_OFFSET DB_CQ_OFFSET
56332 -#define DB_EQ_RING_ID_MASK 0x1FF /* bits 0 - 8 */
56333 -/* Clear the interrupt for this eq */
56334 -#define DB_EQ_CLR_SHIFT (9) /* bit 9 */
56335 -/* Must be 1 */
56336 -#define DB_EQ_EVNT_SHIFT (10) /* bit 10 */
56337 -/* Number of event entries processed */
56338 -#define DB_EQ_NUM_POPPED_SHIFT (16) /* bits 16 - 28 */
56339 -/* Rearm bit */
56340 -#define DB_EQ_REARM_SHIFT (29) /* bit 29 */
56341 -
56342 -/********* Compl Q door bell *************/
56343 -#define DB_CQ_OFFSET 0x120
56344 -#define DB_CQ_RING_ID_MASK 0x3FF /* bits 0 - 9 */
56345 -/* Number of event entries processed */
56346 -#define DB_CQ_NUM_POPPED_SHIFT (16) /* bits 16 - 28 */
56347 -/* Rearm bit */
56348 -#define DB_CQ_REARM_SHIFT (29) /* bit 29 */
56349 -
56350 -/********** TX ULP door bell *************/
56351 -#define DB_TXULP1_OFFSET 0x60
56352 -#define DB_TXULP_RING_ID_MASK 0x7FF /* bits 0 - 10 */
56353 -/* Number of tx entries posted */
56354 -#define DB_TXULP_NUM_POSTED_SHIFT (16) /* bits 16 - 29 */
56355 -#define DB_TXULP_NUM_POSTED_MASK 0x3FFF /* bits 16 - 29 */
56356 -
56357 -/********** RQ(erx) door bell ************/
56358 -#define DB_RQ_OFFSET 0x100
56359 -#define DB_RQ_RING_ID_MASK 0x3FF /* bits 0 - 9 */
56360 -/* Number of rx frags posted */
56361 -#define DB_RQ_NUM_POSTED_SHIFT (24) /* bits 24 - 31 */
56362 -
56363 -/*
56364 - * BE descriptors: host memory data structures whose formats
56365 - * are hardwired in BE silicon.
56366 - */
56367 -/* Event Queue Descriptor */
56368 -#define EQ_ENTRY_VALID_MASK 0x1 /* bit 0 */
56369 -#define EQ_ENTRY_RES_ID_MASK 0xFFFF /* bits 16 - 31 */
56370 -#define EQ_ENTRY_RES_ID_SHIFT 16
56371 -struct be_eq_entry {
56372 - u32 evt;
56373 -};
56374 -
56375 -/* TX Queue Descriptor */
56376 -#define ETH_WRB_FRAG_LEN_MASK 0xFFFF
56377 -struct be_eth_wrb {
56378 - u32 frag_pa_hi; /* dword 0 */
56379 - u32 frag_pa_lo; /* dword 1 */
56380 - u32 rsvd0; /* dword 2 */
56381 - u32 frag_len; /* dword 3: bits 0 - 15 */
56382 -} __packed;
56383 -
56384 -/* Pseudo amap definition for eth_hdr_wrb in which each bit of the
56385 - * actual structure is defined as a byte : used to calculate
56386 - * offset/shift/mask of each field */
56387 -struct amap_eth_hdr_wrb {
56388 - u8 rsvd0[32]; /* dword 0 */
56389 - u8 rsvd1[32]; /* dword 1 */
56390 - u8 complete; /* dword 2 */
56391 - u8 event;
56392 - u8 crc;
56393 - u8 forward;
56394 - u8 ipsec;
56395 - u8 mgmt;
56396 - u8 ipcs;
56397 - u8 udpcs;
56398 - u8 tcpcs;
56399 - u8 lso;
56400 - u8 vlan;
56401 - u8 gso[2];
56402 - u8 num_wrb[5];
56403 - u8 lso_mss[14];
56404 - u8 len[16]; /* dword 3 */
56405 - u8 vlan_tag[16];
56406 -} __packed;
56407 -
56408 -struct be_eth_hdr_wrb {
56409 - u32 dw[4];
56410 -};
56411 -
56412 -/* TX Compl Queue Descriptor */
56413 -
56414 -/* Pseudo amap definition for eth_tx_compl in which each bit of the
56415 - * actual structure is defined as a byte: used to calculate
56416 - * offset/shift/mask of each field */
56417 -struct amap_eth_tx_compl {
56418 - u8 wrb_index[16]; /* dword 0 */
56419 - u8 ct[2]; /* dword 0 */
56420 - u8 port[2]; /* dword 0 */
56421 - u8 rsvd0[8]; /* dword 0 */
56422 - u8 status[4]; /* dword 0 */
56423 - u8 user_bytes[16]; /* dword 1 */
56424 - u8 nwh_bytes[8]; /* dword 1 */
56425 - u8 lso; /* dword 1 */
56426 - u8 cast_enc[2]; /* dword 1 */
56427 - u8 rsvd1[5]; /* dword 1 */
56428 - u8 rsvd2[32]; /* dword 2 */
56429 - u8 pkts[16]; /* dword 3 */
56430 - u8 ringid[11]; /* dword 3 */
56431 - u8 hash_val[4]; /* dword 3 */
56432 - u8 valid; /* dword 3 */
56433 -} __packed;
56434 -
56435 -struct be_eth_tx_compl {
56436 - u32 dw[4];
56437 -};
56438 -
56439 -/* RX Queue Descriptor */
56440 -struct be_eth_rx_d {
56441 - u32 fragpa_hi;
56442 - u32 fragpa_lo;
56443 -};
56444 -
56445 -/* RX Compl Queue Descriptor */
56446 -
56447 -/* Pseudo amap definition for eth_rx_compl in which each bit of the
56448 - * actual structure is defined as a byte: used to calculate
56449 - * offset/shift/mask of each field */
56450 -struct amap_eth_rx_compl {
56451 - u8 vlan_tag[16]; /* dword 0 */
56452 - u8 pktsize[14]; /* dword 0 */
56453 - u8 port; /* dword 0 */
56454 - u8 ip_opt; /* dword 0 */
56455 - u8 err; /* dword 1 */
56456 - u8 rsshp; /* dword 1 */
56457 - u8 ipf; /* dword 1 */
56458 - u8 tcpf; /* dword 1 */
56459 - u8 udpf; /* dword 1 */
56460 - u8 ipcksm; /* dword 1 */
56461 - u8 l4_cksm; /* dword 1 */
56462 - u8 ip_version; /* dword 1 */
56463 - u8 macdst[6]; /* dword 1 */
56464 - u8 vtp; /* dword 1 */
56465 - u8 rsvd0; /* dword 1 */
56466 - u8 fragndx[10]; /* dword 1 */
56467 - u8 ct[2]; /* dword 1 */
56468 - u8 sw; /* dword 1 */
56469 - u8 numfrags[3]; /* dword 1 */
56470 - u8 rss_flush; /* dword 2 */
56471 - u8 cast_enc[2]; /* dword 2 */
56472 - u8 qnq; /* dword 2 */
56473 - u8 rss_bank; /* dword 2 */
56474 - u8 rsvd1[23]; /* dword 2 */
56475 - u8 lro_pkt; /* dword 2 */
56476 - u8 rsvd2[2]; /* dword 2 */
56477 - u8 valid; /* dword 2 */
56478 - u8 rsshash[32]; /* dword 3 */
56479 -} __packed;
56480 -
56481 -struct be_eth_rx_compl {
56482 - u32 dw[4];
56483 -};
56484 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/benet/be_main.c linux-2.6.29-rc3.owrt/drivers/net/benet/be_main.c
56485 --- linux-2.6.29.owrt/drivers/net/benet/be_main.c 2009-05-10 22:04:38.000000000 +0200
56486 +++ linux-2.6.29-rc3.owrt/drivers/net/benet/be_main.c 1970-01-01 01:00:00.000000000 +0100
56487 @@ -1,1911 +0,0 @@
56488 -/*
56489 - * Copyright (C) 2005 - 2009 ServerEngines
56490 - * All rights reserved.
56491 - *
56492 - * This program is free software; you can redistribute it and/or
56493 - * modify it under the terms of the GNU General Public License version 2
56494 - * as published by the Free Software Foundation. The full GNU General
56495 - * Public License is included in this distribution in the file called COPYING.
56496 - *
56497 - * Contact Information:
56498 - * linux-drivers@serverengines.com
56499 - *
56500 - * ServerEngines
56501 - * 209 N. Fair Oaks Ave
56502 - * Sunnyvale, CA 94085
56503 - */
56504 -
56505 -#include "be.h"
56506 -
56507 -MODULE_VERSION(DRV_VER);
56508 -MODULE_DEVICE_TABLE(pci, be_dev_ids);
56509 -MODULE_DESCRIPTION(DRV_DESC " " DRV_VER);
56510 -MODULE_AUTHOR("ServerEngines Corporation");
56511 -MODULE_LICENSE("GPL");
56512 -
56513 -static unsigned int rx_frag_size = 2048;
56514 -module_param(rx_frag_size, uint, S_IRUGO);
56515 -MODULE_PARM_DESC(rx_frag_size, "Size of a fragment that holds rcvd data.");
56516 -
56517 -#define BE_VENDOR_ID 0x19a2
56518 -#define BE2_DEVICE_ID_1 0x0211
56519 -static DEFINE_PCI_DEVICE_TABLE(be_dev_ids) = {
56520 - { PCI_DEVICE(BE_VENDOR_ID, BE2_DEVICE_ID_1) },
56521 - { 0 }
56522 -};
56523 -MODULE_DEVICE_TABLE(pci, be_dev_ids);
56524 -
56525 -static void be_queue_free(struct be_adapter *adapter, struct be_queue_info *q)
56526 -{
56527 - struct be_dma_mem *mem = &q->dma_mem;
56528 - if (mem->va)
56529 - pci_free_consistent(adapter->pdev, mem->size,
56530 - mem->va, mem->dma);
56531 -}
56532 -
56533 -static int be_queue_alloc(struct be_adapter *adapter, struct be_queue_info *q,
56534 - u16 len, u16 entry_size)
56535 -{
56536 - struct be_dma_mem *mem = &q->dma_mem;
56537 -
56538 - memset(q, 0, sizeof(*q));
56539 - q->len = len;
56540 - q->entry_size = entry_size;
56541 - mem->size = len * entry_size;
56542 - mem->va = pci_alloc_consistent(adapter->pdev, mem->size, &mem->dma);
56543 - if (!mem->va)
56544 - return -1;
56545 - memset(mem->va, 0, mem->size);
56546 - return 0;
56547 -}
56548 -
56549 -static inline void *queue_head_node(struct be_queue_info *q)
56550 -{
56551 - return q->dma_mem.va + q->head * q->entry_size;
56552 -}
56553 -
56554 -static inline void *queue_tail_node(struct be_queue_info *q)
56555 -{
56556 - return q->dma_mem.va + q->tail * q->entry_size;
56557 -}
56558 -
56559 -static inline void queue_head_inc(struct be_queue_info *q)
56560 -{
56561 - index_inc(&q->head, q->len);
56562 -}
56563 -
56564 -static inline void queue_tail_inc(struct be_queue_info *q)
56565 -{
56566 - index_inc(&q->tail, q->len);
56567 -}
56568 -
56569 -static void be_intr_set(struct be_ctrl_info *ctrl, bool enable)
56570 -{
56571 - u8 __iomem *addr = ctrl->pcicfg + PCICFG_MEMBAR_CTRL_INT_CTRL_OFFSET;
56572 - u32 reg = ioread32(addr);
56573 - u32 enabled = reg & MEMBAR_CTRL_INT_CTRL_HOSTINTR_MASK;
56574 - if (!enabled && enable) {
56575 - reg |= MEMBAR_CTRL_INT_CTRL_HOSTINTR_MASK;
56576 - } else if (enabled && !enable) {
56577 - reg &= ~MEMBAR_CTRL_INT_CTRL_HOSTINTR_MASK;
56578 - } else {
56579 - printk(KERN_WARNING DRV_NAME
56580 - ": bad value in membar_int_ctrl reg=0x%x\n", reg);
56581 - return;
56582 - }
56583 - iowrite32(reg, addr);
56584 -}
56585 -
56586 -static void be_rxq_notify(struct be_ctrl_info *ctrl, u16 qid, u16 posted)
56587 -{
56588 - u32 val = 0;
56589 - val |= qid & DB_RQ_RING_ID_MASK;
56590 - val |= posted << DB_RQ_NUM_POSTED_SHIFT;
56591 - iowrite32(val, ctrl->db + DB_RQ_OFFSET);
56592 -}
56593 -
56594 -static void be_txq_notify(struct be_ctrl_info *ctrl, u16 qid, u16 posted)
56595 -{
56596 - u32 val = 0;
56597 - val |= qid & DB_TXULP_RING_ID_MASK;
56598 - val |= (posted & DB_TXULP_NUM_POSTED_MASK) << DB_TXULP_NUM_POSTED_SHIFT;
56599 - iowrite32(val, ctrl->db + DB_TXULP1_OFFSET);
56600 -}
56601 -
56602 -static void be_eq_notify(struct be_ctrl_info *ctrl, u16 qid,
56603 - bool arm, bool clear_int, u16 num_popped)
56604 -{
56605 - u32 val = 0;
56606 - val |= qid & DB_EQ_RING_ID_MASK;
56607 - if (arm)
56608 - val |= 1 << DB_EQ_REARM_SHIFT;
56609 - if (clear_int)
56610 - val |= 1 << DB_EQ_CLR_SHIFT;
56611 - val |= 1 << DB_EQ_EVNT_SHIFT;
56612 - val |= num_popped << DB_EQ_NUM_POPPED_SHIFT;
56613 - iowrite32(val, ctrl->db + DB_EQ_OFFSET);
56614 -}
56615 -
56616 -static void be_cq_notify(struct be_ctrl_info *ctrl, u16 qid,
56617 - bool arm, u16 num_popped)
56618 -{
56619 - u32 val = 0;
56620 - val |= qid & DB_CQ_RING_ID_MASK;
56621 - if (arm)
56622 - val |= 1 << DB_CQ_REARM_SHIFT;
56623 - val |= num_popped << DB_CQ_NUM_POPPED_SHIFT;
56624 - iowrite32(val, ctrl->db + DB_CQ_OFFSET);
56625 -}
56626 -
56627 -
56628 -static int be_mac_addr_set(struct net_device *netdev, void *p)
56629 -{
56630 - struct be_adapter *adapter = netdev_priv(netdev);
56631 - struct sockaddr *addr = p;
56632 - int status = 0;
56633 -
56634 - if (netif_running(netdev)) {
56635 - status = be_cmd_pmac_del(&adapter->ctrl, adapter->if_handle,
56636 - adapter->pmac_id);
56637 - if (status)
56638 - return status;
56639 -
56640 - status = be_cmd_pmac_add(&adapter->ctrl, (u8 *)addr->sa_data,
56641 - adapter->if_handle, &adapter->pmac_id);
56642 - }
56643 -
56644 - if (!status)
56645 - memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
56646 -
56647 - return status;
56648 -}
56649 -
56650 -static void netdev_stats_update(struct be_adapter *adapter)
56651 -{
56652 - struct be_hw_stats *hw_stats = hw_stats_from_cmd(adapter->stats.cmd.va);
56653 - struct be_rxf_stats *rxf_stats = &hw_stats->rxf;
56654 - struct be_port_rxf_stats *port_stats =
56655 - &rxf_stats->port[adapter->port_num];
56656 - struct net_device_stats *dev_stats = &adapter->stats.net_stats;
56657 -
56658 - dev_stats->rx_packets = port_stats->rx_total_frames;
56659 - dev_stats->tx_packets = port_stats->tx_unicastframes +
56660 - port_stats->tx_multicastframes + port_stats->tx_broadcastframes;
56661 - dev_stats->rx_bytes = (u64) port_stats->rx_bytes_msd << 32 |
56662 - (u64) port_stats->rx_bytes_lsd;
56663 - dev_stats->tx_bytes = (u64) port_stats->tx_bytes_msd << 32 |
56664 - (u64) port_stats->tx_bytes_lsd;
56665 -
56666 - /* bad pkts received */
56667 - dev_stats->rx_errors = port_stats->rx_crc_errors +
56668 - port_stats->rx_alignment_symbol_errors +
56669 - port_stats->rx_in_range_errors +
56670 - port_stats->rx_out_range_errors + port_stats->rx_frame_too_long;
56671 -
56672 - /* packet transmit problems */
56673 - dev_stats->tx_errors = 0;
56674 -
56675 - /* no space in linux buffers */
56676 - dev_stats->rx_dropped = 0;
56677 -
56678 - /* no space available in linux */
56679 - dev_stats->tx_dropped = 0;
56680 -
56681 - dev_stats->multicast = port_stats->tx_multicastframes;
56682 - dev_stats->collisions = 0;
56683 -
56684 - /* detailed rx errors */
56685 - dev_stats->rx_length_errors = port_stats->rx_in_range_errors +
56686 - port_stats->rx_out_range_errors + port_stats->rx_frame_too_long;
56687 - /* receive ring buffer overflow */
56688 - dev_stats->rx_over_errors = 0;
56689 - dev_stats->rx_crc_errors = port_stats->rx_crc_errors;
56690 -
56691 - /* frame alignment errors */
56692 - dev_stats->rx_frame_errors = port_stats->rx_alignment_symbol_errors;
56693 - /* receiver fifo overrun */
56694 - /* drops_no_pbuf is no per i/f, it's per BE card */
56695 - dev_stats->rx_fifo_errors = port_stats->rx_fifo_overflow +
56696 - port_stats->rx_input_fifo_overflow +
56697 - rxf_stats->rx_drops_no_pbuf;
56698 - /* receiver missed packetd */
56699 - dev_stats->rx_missed_errors = 0;
56700 - /* detailed tx_errors */
56701 - dev_stats->tx_aborted_errors = 0;
56702 - dev_stats->tx_carrier_errors = 0;
56703 - dev_stats->tx_fifo_errors = 0;
56704 - dev_stats->tx_heartbeat_errors = 0;
56705 - dev_stats->tx_window_errors = 0;
56706 -}
56707 -
56708 -static void be_link_status_update(struct be_adapter *adapter)
56709 -{
56710 - struct be_link_info *prev = &adapter->link;
56711 - struct be_link_info now = { 0 };
56712 - struct net_device *netdev = adapter->netdev;
56713 -
56714 - be_cmd_link_status_query(&adapter->ctrl, &now);
56715 -
56716 - /* If link came up or went down */
56717 - if (now.speed != prev->speed && (now.speed == PHY_LINK_SPEED_ZERO ||
56718 - prev->speed == PHY_LINK_SPEED_ZERO)) {
56719 - if (now.speed == PHY_LINK_SPEED_ZERO) {
56720 - netif_stop_queue(netdev);
56721 - netif_carrier_off(netdev);
56722 - printk(KERN_INFO "%s: Link down\n", netdev->name);
56723 - } else {
56724 - netif_start_queue(netdev);
56725 - netif_carrier_on(netdev);
56726 - printk(KERN_INFO "%s: Link up\n", netdev->name);
56727 - }
56728 - }
56729 - *prev = now;
56730 -}
56731 -
56732 -/* Update the EQ delay n BE based on the RX frags consumed / sec */
56733 -static void be_rx_eqd_update(struct be_adapter *adapter)
56734 -{
56735 - u32 eqd;
56736 - struct be_ctrl_info *ctrl = &adapter->ctrl;
56737 - struct be_eq_obj *rx_eq = &adapter->rx_eq;
56738 - struct be_drvr_stats *stats = &adapter->stats.drvr_stats;
56739 -
56740 - /* Update once a second */
56741 - if (((jiffies - stats->rx_fps_jiffies) < HZ) || rx_eq->enable_aic == 0)
56742 - return;
56743 -
56744 - stats->be_rx_fps = (stats->be_rx_frags - stats->be_prev_rx_frags) /
56745 - ((jiffies - stats->rx_fps_jiffies) / HZ);
56746 -
56747 - stats->rx_fps_jiffies = jiffies;
56748 - stats->be_prev_rx_frags = stats->be_rx_frags;
56749 - eqd = stats->be_rx_fps / 110000;
56750 - eqd = eqd << 3;
56751 - if (eqd > rx_eq->max_eqd)
56752 - eqd = rx_eq->max_eqd;
56753 - if (eqd < rx_eq->min_eqd)
56754 - eqd = rx_eq->min_eqd;
56755 - if (eqd < 10)
56756 - eqd = 0;
56757 - if (eqd != rx_eq->cur_eqd)
56758 - be_cmd_modify_eqd(ctrl, rx_eq->q.id, eqd);
56759 -
56760 - rx_eq->cur_eqd = eqd;
56761 -}
56762 -
56763 -static struct net_device_stats *be_get_stats(struct net_device *dev)
56764 -{
56765 - struct be_adapter *adapter = netdev_priv(dev);
56766 -
56767 - return &adapter->stats.net_stats;
56768 -}
56769 -
56770 -static void be_tx_stats_update(struct be_adapter *adapter,
56771 - u32 wrb_cnt, u32 copied, bool stopped)
56772 -{
56773 - struct be_drvr_stats *stats = &adapter->stats.drvr_stats;
56774 - stats->be_tx_reqs++;
56775 - stats->be_tx_wrbs += wrb_cnt;
56776 - stats->be_tx_bytes += copied;
56777 - if (stopped)
56778 - stats->be_tx_stops++;
56779 -
56780 - /* Update tx rate once in two seconds */
56781 - if ((jiffies - stats->be_tx_jiffies) > 2 * HZ) {
56782 - u32 r;
56783 - r = (stats->be_tx_bytes - stats->be_tx_bytes_prev) /
56784 - ((u32) (jiffies - stats->be_tx_jiffies) / HZ);
56785 - r = (r / 1000000); /* M bytes/s */
56786 - stats->be_tx_rate = (r * 8); /* M bits/s */
56787 - stats->be_tx_jiffies = jiffies;
56788 - stats->be_tx_bytes_prev = stats->be_tx_bytes;
56789 - }
56790 -}
56791 -
56792 -/* Determine number of WRB entries needed to xmit data in an skb */
56793 -static u32 wrb_cnt_for_skb(struct sk_buff *skb, bool *dummy)
56794 -{
56795 - int cnt = 0;
56796 - while (skb) {
56797 - if (skb->len > skb->data_len)
56798 - cnt++;
56799 - cnt += skb_shinfo(skb)->nr_frags;
56800 - skb = skb_shinfo(skb)->frag_list;
56801 - }
56802 - /* to account for hdr wrb */
56803 - cnt++;
56804 - if (cnt & 1) {
56805 - /* add a dummy to make it an even num */
56806 - cnt++;
56807 - *dummy = true;
56808 - } else
56809 - *dummy = false;
56810 - BUG_ON(cnt > BE_MAX_TX_FRAG_COUNT);
56811 - return cnt;
56812 -}
56813 -
56814 -static inline void wrb_fill(struct be_eth_wrb *wrb, u64 addr, int len)
56815 -{
56816 - wrb->frag_pa_hi = upper_32_bits(addr);
56817 - wrb->frag_pa_lo = addr & 0xFFFFFFFF;
56818 - wrb->frag_len = len & ETH_WRB_FRAG_LEN_MASK;
56819 -}
56820 -
56821 -static void wrb_fill_hdr(struct be_eth_hdr_wrb *hdr, struct sk_buff *skb,
56822 - bool vlan, u32 wrb_cnt, u32 len)
56823 -{
56824 - memset(hdr, 0, sizeof(*hdr));
56825 -
56826 - AMAP_SET_BITS(struct amap_eth_hdr_wrb, crc, hdr, 1);
56827 -
56828 - if (skb_shinfo(skb)->gso_segs > 1 && skb_shinfo(skb)->gso_size) {
56829 - AMAP_SET_BITS(struct amap_eth_hdr_wrb, lso, hdr, 1);
56830 - AMAP_SET_BITS(struct amap_eth_hdr_wrb, lso_mss,
56831 - hdr, skb_shinfo(skb)->gso_size);
56832 - } else if (skb->ip_summed == CHECKSUM_PARTIAL) {
56833 - if (is_tcp_pkt(skb))
56834 - AMAP_SET_BITS(struct amap_eth_hdr_wrb, tcpcs, hdr, 1);
56835 - else if (is_udp_pkt(skb))
56836 - AMAP_SET_BITS(struct amap_eth_hdr_wrb, udpcs, hdr, 1);
56837 - }
56838 -
56839 - if (vlan && vlan_tx_tag_present(skb)) {
56840 - AMAP_SET_BITS(struct amap_eth_hdr_wrb, vlan, hdr, 1);
56841 - AMAP_SET_BITS(struct amap_eth_hdr_wrb, vlan_tag,
56842 - hdr, vlan_tx_tag_get(skb));
56843 - }
56844 -
56845 - AMAP_SET_BITS(struct amap_eth_hdr_wrb, event, hdr, 1);
56846 - AMAP_SET_BITS(struct amap_eth_hdr_wrb, complete, hdr, 1);
56847 - AMAP_SET_BITS(struct amap_eth_hdr_wrb, num_wrb, hdr, wrb_cnt);
56848 - AMAP_SET_BITS(struct amap_eth_hdr_wrb, len, hdr, len);
56849 -}
56850 -
56851 -
56852 -static int make_tx_wrbs(struct be_adapter *adapter,
56853 - struct sk_buff *skb, u32 wrb_cnt, bool dummy_wrb)
56854 -{
56855 - u64 busaddr;
56856 - u32 i, copied = 0;
56857 - struct pci_dev *pdev = adapter->pdev;
56858 - struct sk_buff *first_skb = skb;
56859 - struct be_queue_info *txq = &adapter->tx_obj.q;
56860 - struct be_eth_wrb *wrb;
56861 - struct be_eth_hdr_wrb *hdr;
56862 -
56863 - atomic_add(wrb_cnt, &txq->used);
56864 - hdr = queue_head_node(txq);
56865 - queue_head_inc(txq);
56866 -
56867 - while (skb) {
56868 - if (skb->len > skb->data_len) {
56869 - int len = skb->len - skb->data_len;
56870 - busaddr = pci_map_single(pdev, skb->data, len,
56871 - PCI_DMA_TODEVICE);
56872 - wrb = queue_head_node(txq);
56873 - wrb_fill(wrb, busaddr, len);
56874 - be_dws_cpu_to_le(wrb, sizeof(*wrb));
56875 - queue_head_inc(txq);
56876 - copied += len;
56877 - }
56878 -
56879 - for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
56880 - struct skb_frag_struct *frag =
56881 - &skb_shinfo(skb)->frags[i];
56882 - busaddr = pci_map_page(pdev, frag->page,
56883 - frag->page_offset,
56884 - frag->size, PCI_DMA_TODEVICE);
56885 - wrb = queue_head_node(txq);
56886 - wrb_fill(wrb, busaddr, frag->size);
56887 - be_dws_cpu_to_le(wrb, sizeof(*wrb));
56888 - queue_head_inc(txq);
56889 - copied += frag->size;
56890 - }
56891 - skb = skb_shinfo(skb)->frag_list;
56892 - }
56893 -
56894 - if (dummy_wrb) {
56895 - wrb = queue_head_node(txq);
56896 - wrb_fill(wrb, 0, 0);
56897 - be_dws_cpu_to_le(wrb, sizeof(*wrb));
56898 - queue_head_inc(txq);
56899 - }
56900 -
56901 - wrb_fill_hdr(hdr, first_skb, adapter->vlan_grp ? true : false,
56902 - wrb_cnt, copied);
56903 - be_dws_cpu_to_le(hdr, sizeof(*hdr));
56904 -
56905 - return copied;
56906 -}
56907 -
56908 -static int be_xmit(struct sk_buff *skb, struct net_device *netdev)
56909 -{
56910 - struct be_adapter *adapter = netdev_priv(netdev);
56911 - struct be_tx_obj *tx_obj = &adapter->tx_obj;
56912 - struct be_queue_info *txq = &tx_obj->q;
56913 - u32 wrb_cnt = 0, copied = 0;
56914 - u32 start = txq->head;
56915 - bool dummy_wrb, stopped = false;
56916 -
56917 - wrb_cnt = wrb_cnt_for_skb(skb, &dummy_wrb);
56918 -
56919 - copied = make_tx_wrbs(adapter, skb, wrb_cnt, dummy_wrb);
56920 -
56921 - /* record the sent skb in the sent_skb table */
56922 - BUG_ON(tx_obj->sent_skb_list[start]);
56923 - tx_obj->sent_skb_list[start] = skb;
56924 -
56925 - /* Ensure that txq has space for the next skb; Else stop the queue
56926 - * *BEFORE* ringing the tx doorbell, so that we serialze the
56927 - * tx compls of the current transmit which'll wake up the queue
56928 - */
56929 - if ((BE_MAX_TX_FRAG_COUNT + atomic_read(&txq->used)) >= txq->len) {
56930 - netif_stop_queue(netdev);
56931 - stopped = true;
56932 - }
56933 -
56934 - be_txq_notify(&adapter->ctrl, txq->id, wrb_cnt);
56935 -
56936 - netdev->trans_start = jiffies;
56937 -
56938 - be_tx_stats_update(adapter, wrb_cnt, copied, stopped);
56939 - return NETDEV_TX_OK;
56940 -}
56941 -
56942 -static int be_change_mtu(struct net_device *netdev, int new_mtu)
56943 -{
56944 - struct be_adapter *adapter = netdev_priv(netdev);
56945 - if (new_mtu < BE_MIN_MTU ||
56946 - new_mtu > BE_MAX_JUMBO_FRAME_SIZE) {
56947 - dev_info(&adapter->pdev->dev,
56948 - "MTU must be between %d and %d bytes\n",
56949 - BE_MIN_MTU, BE_MAX_JUMBO_FRAME_SIZE);
56950 - return -EINVAL;
56951 - }
56952 - dev_info(&adapter->pdev->dev, "MTU changed from %d to %d bytes\n",
56953 - netdev->mtu, new_mtu);
56954 - netdev->mtu = new_mtu;
56955 - return 0;
56956 -}
56957 -
56958 -/*
56959 - * if there are BE_NUM_VLANS_SUPPORTED or lesser number of VLANS configured,
56960 - * program them in BE. If more than BE_NUM_VLANS_SUPPORTED are configured,
56961 - * set the BE in promiscuous VLAN mode.
56962 - */
56963 -static void be_vid_config(struct net_device *netdev)
56964 -{
56965 - struct be_adapter *adapter = netdev_priv(netdev);
56966 - u16 vtag[BE_NUM_VLANS_SUPPORTED];
56967 - u16 ntags = 0, i;
56968 -
56969 - if (adapter->num_vlans <= BE_NUM_VLANS_SUPPORTED) {
56970 - /* Construct VLAN Table to give to HW */
56971 - for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) {
56972 - if (adapter->vlan_tag[i]) {
56973 - vtag[ntags] = cpu_to_le16(i);
56974 - ntags++;
56975 - }
56976 - }
56977 - be_cmd_vlan_config(&adapter->ctrl, adapter->if_handle,
56978 - vtag, ntags, 1, 0);
56979 - } else {
56980 - be_cmd_vlan_config(&adapter->ctrl, adapter->if_handle,
56981 - NULL, 0, 1, 1);
56982 - }
56983 -}
56984 -
56985 -static void be_vlan_register(struct net_device *netdev, struct vlan_group *grp)
56986 -{
56987 - struct be_adapter *adapter = netdev_priv(netdev);
56988 - struct be_eq_obj *rx_eq = &adapter->rx_eq;
56989 - struct be_eq_obj *tx_eq = &adapter->tx_eq;
56990 - struct be_ctrl_info *ctrl = &adapter->ctrl;
56991 -
56992 - be_eq_notify(ctrl, rx_eq->q.id, false, false, 0);
56993 - be_eq_notify(ctrl, tx_eq->q.id, false, false, 0);
56994 - adapter->vlan_grp = grp;
56995 - be_eq_notify(ctrl, rx_eq->q.id, true, false, 0);
56996 - be_eq_notify(ctrl, tx_eq->q.id, true, false, 0);
56997 -}
56998 -
56999 -static void be_vlan_add_vid(struct net_device *netdev, u16 vid)
57000 -{
57001 - struct be_adapter *adapter = netdev_priv(netdev);
57002 -
57003 - adapter->num_vlans++;
57004 - adapter->vlan_tag[vid] = 1;
57005 -
57006 - be_vid_config(netdev);
57007 -}
57008 -
57009 -static void be_vlan_rem_vid(struct net_device *netdev, u16 vid)
57010 -{
57011 - struct be_adapter *adapter = netdev_priv(netdev);
57012 -
57013 - adapter->num_vlans--;
57014 - adapter->vlan_tag[vid] = 0;
57015 -
57016 - vlan_group_set_device(adapter->vlan_grp, vid, NULL);
57017 - be_vid_config(netdev);
57018 -}
57019 -
57020 -static void be_set_multicast_filter(struct net_device *netdev)
57021 -{
57022 - struct be_adapter *adapter = netdev_priv(netdev);
57023 - struct dev_mc_list *mc_ptr;
57024 - u8 mac_addr[32][ETH_ALEN];
57025 - int i = 0;
57026 -
57027 - if (netdev->flags & IFF_ALLMULTI) {
57028 - /* set BE in Multicast promiscuous */
57029 - be_cmd_mcast_mac_set(&adapter->ctrl,
57030 - adapter->if_handle, NULL, 0, true);
57031 - return;
57032 - }
57033 -
57034 - for (mc_ptr = netdev->mc_list; mc_ptr; mc_ptr = mc_ptr->next) {
57035 - memcpy(&mac_addr[i][0], mc_ptr->dmi_addr, ETH_ALEN);
57036 - if (++i >= 32) {
57037 - be_cmd_mcast_mac_set(&adapter->ctrl,
57038 - adapter->if_handle, &mac_addr[0][0], i, false);
57039 - i = 0;
57040 - }
57041 -
57042 - }
57043 -
57044 - if (i) {
57045 - /* reset the promiscuous mode also. */
57046 - be_cmd_mcast_mac_set(&adapter->ctrl,
57047 - adapter->if_handle, &mac_addr[0][0], i, false);
57048 - }
57049 -}
57050 -
57051 -static void be_set_multicast_list(struct net_device *netdev)
57052 -{
57053 - struct be_adapter *adapter = netdev_priv(netdev);
57054 -
57055 - if (netdev->flags & IFF_PROMISC) {
57056 - be_cmd_promiscuous_config(&adapter->ctrl, adapter->port_num, 1);
57057 - } else {
57058 - be_cmd_promiscuous_config(&adapter->ctrl, adapter->port_num, 0);
57059 - be_set_multicast_filter(netdev);
57060 - }
57061 -}
57062 -
57063 -static void be_rx_rate_update(struct be_adapter *adapter, u32 pktsize,
57064 - u16 numfrags)
57065 -{
57066 - struct be_drvr_stats *stats = &adapter->stats.drvr_stats;
57067 - u32 rate;
57068 -
57069 - stats->be_rx_compl++;
57070 - stats->be_rx_frags += numfrags;
57071 - stats->be_rx_bytes += pktsize;
57072 -
57073 - /* Update the rate once in two seconds */
57074 - if ((jiffies - stats->be_rx_jiffies) < 2 * HZ)
57075 - return;
57076 -
57077 - rate = (stats->be_rx_bytes - stats->be_rx_bytes_prev) /
57078 - ((u32) (jiffies - stats->be_rx_jiffies) / HZ);
57079 - rate = (rate / 1000000); /* MB/Sec */
57080 - stats->be_rx_rate = (rate * 8); /* Mega Bits/Sec */
57081 - stats->be_rx_jiffies = jiffies;
57082 - stats->be_rx_bytes_prev = stats->be_rx_bytes;
57083 -}
57084 -
57085 -static struct be_rx_page_info *
57086 -get_rx_page_info(struct be_adapter *adapter, u16 frag_idx)
57087 -{
57088 - struct be_rx_page_info *rx_page_info;
57089 - struct be_queue_info *rxq = &adapter->rx_obj.q;
57090 -
57091 - rx_page_info = &adapter->rx_obj.page_info_tbl[frag_idx];
57092 - BUG_ON(!rx_page_info->page);
57093 -
57094 - if (rx_page_info->last_page_user)
57095 - pci_unmap_page(adapter->pdev, pci_unmap_addr(rx_page_info, bus),
57096 - adapter->big_page_size, PCI_DMA_FROMDEVICE);
57097 -
57098 - atomic_dec(&rxq->used);
57099 - return rx_page_info;
57100 -}
57101 -
57102 -/* Throwaway the data in the Rx completion */
57103 -static void be_rx_compl_discard(struct be_adapter *adapter,
57104 - struct be_eth_rx_compl *rxcp)
57105 -{
57106 - struct be_queue_info *rxq = &adapter->rx_obj.q;
57107 - struct be_rx_page_info *page_info;
57108 - u16 rxq_idx, i, num_rcvd;
57109 -
57110 - rxq_idx = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx, rxcp);
57111 - num_rcvd = AMAP_GET_BITS(struct amap_eth_rx_compl, numfrags, rxcp);
57112 -
57113 - for (i = 0; i < num_rcvd; i++) {
57114 - page_info = get_rx_page_info(adapter, rxq_idx);
57115 - put_page(page_info->page);
57116 - memset(page_info, 0, sizeof(*page_info));
57117 - index_inc(&rxq_idx, rxq->len);
57118 - }
57119 -}
57120 -
57121 -/*
57122 - * skb_fill_rx_data forms a complete skb for an ether frame
57123 - * indicated by rxcp.
57124 - */
57125 -static void skb_fill_rx_data(struct be_adapter *adapter,
57126 - struct sk_buff *skb, struct be_eth_rx_compl *rxcp)
57127 -{
57128 - struct be_queue_info *rxq = &adapter->rx_obj.q;
57129 - struct be_rx_page_info *page_info;
57130 - u16 rxq_idx, i, num_rcvd;
57131 - u32 pktsize, hdr_len, curr_frag_len;
57132 - u8 *start;
57133 -
57134 - rxq_idx = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx, rxcp);
57135 - pktsize = AMAP_GET_BITS(struct amap_eth_rx_compl, pktsize, rxcp);
57136 - num_rcvd = AMAP_GET_BITS(struct amap_eth_rx_compl, numfrags, rxcp);
57137 -
57138 - page_info = get_rx_page_info(adapter, rxq_idx);
57139 -
57140 - start = page_address(page_info->page) + page_info->page_offset;
57141 - prefetch(start);
57142 -
57143 - /* Copy data in the first descriptor of this completion */
57144 - curr_frag_len = min(pktsize, rx_frag_size);
57145 -
57146 - /* Copy the header portion into skb_data */
57147 - hdr_len = min((u32)BE_HDR_LEN, curr_frag_len);
57148 - memcpy(skb->data, start, hdr_len);
57149 - skb->len = curr_frag_len;
57150 - if (curr_frag_len <= BE_HDR_LEN) { /* tiny packet */
57151 - /* Complete packet has now been moved to data */
57152 - put_page(page_info->page);
57153 - skb->data_len = 0;
57154 - skb->tail += curr_frag_len;
57155 - } else {
57156 - skb_shinfo(skb)->nr_frags = 1;
57157 - skb_shinfo(skb)->frags[0].page = page_info->page;
57158 - skb_shinfo(skb)->frags[0].page_offset =
57159 - page_info->page_offset + hdr_len;
57160 - skb_shinfo(skb)->frags[0].size = curr_frag_len - hdr_len;
57161 - skb->data_len = curr_frag_len - hdr_len;
57162 - skb->tail += hdr_len;
57163 - }
57164 - memset(page_info, 0, sizeof(*page_info));
57165 -
57166 - if (pktsize <= rx_frag_size) {
57167 - BUG_ON(num_rcvd != 1);
57168 - return;
57169 - }
57170 -
57171 - /* More frags present for this completion */
57172 - pktsize -= curr_frag_len; /* account for above copied frag */
57173 - for (i = 1; i < num_rcvd; i++) {
57174 - index_inc(&rxq_idx, rxq->len);
57175 - page_info = get_rx_page_info(adapter, rxq_idx);
57176 -
57177 - curr_frag_len = min(pktsize, rx_frag_size);
57178 -
57179 - skb_shinfo(skb)->frags[i].page = page_info->page;
57180 - skb_shinfo(skb)->frags[i].page_offset = page_info->page_offset;
57181 - skb_shinfo(skb)->frags[i].size = curr_frag_len;
57182 - skb->len += curr_frag_len;
57183 - skb->data_len += curr_frag_len;
57184 - skb_shinfo(skb)->nr_frags++;
57185 - pktsize -= curr_frag_len;
57186 -
57187 - memset(page_info, 0, sizeof(*page_info));
57188 - }
57189 -
57190 - be_rx_rate_update(adapter, pktsize, num_rcvd);
57191 - return;
57192 -}
57193 -
57194 -/* Process the RX completion indicated by rxcp when LRO is disabled */
57195 -static void be_rx_compl_process(struct be_adapter *adapter,
57196 - struct be_eth_rx_compl *rxcp)
57197 -{
57198 - struct sk_buff *skb;
57199 - u32 vtp, vid;
57200 - int l4_cksm;
57201 -
57202 - l4_cksm = AMAP_GET_BITS(struct amap_eth_rx_compl, l4_cksm, rxcp);
57203 - vtp = AMAP_GET_BITS(struct amap_eth_rx_compl, vtp, rxcp);
57204 -
57205 - skb = netdev_alloc_skb(adapter->netdev, BE_HDR_LEN + NET_IP_ALIGN);
57206 - if (!skb) {
57207 - if (net_ratelimit())
57208 - dev_warn(&adapter->pdev->dev, "skb alloc failed\n");
57209 - be_rx_compl_discard(adapter, rxcp);
57210 - return;
57211 - }
57212 -
57213 - skb_reserve(skb, NET_IP_ALIGN);
57214 -
57215 - skb_fill_rx_data(adapter, skb, rxcp);
57216 -
57217 - if (l4_cksm && adapter->rx_csum)
57218 - skb->ip_summed = CHECKSUM_UNNECESSARY;
57219 - else
57220 - skb->ip_summed = CHECKSUM_NONE;
57221 -
57222 - skb->truesize = skb->len + sizeof(struct sk_buff);
57223 - skb->protocol = eth_type_trans(skb, adapter->netdev);
57224 - skb->dev = adapter->netdev;
57225 -
57226 - if (vtp) {
57227 - if (!adapter->vlan_grp || adapter->num_vlans == 0) {
57228 - kfree_skb(skb);
57229 - return;
57230 - }
57231 - vid = AMAP_GET_BITS(struct amap_eth_rx_compl, vlan_tag, rxcp);
57232 - vid = be16_to_cpu(vid);
57233 - vlan_hwaccel_receive_skb(skb, adapter->vlan_grp, vid);
57234 - } else {
57235 - netif_receive_skb(skb);
57236 - }
57237 -
57238 - adapter->netdev->last_rx = jiffies;
57239 -
57240 - return;
57241 -}
57242 -
57243 -/* Process the RX completion indicated by rxcp when LRO is enabled */
57244 -static void be_rx_compl_process_lro(struct be_adapter *adapter,
57245 - struct be_eth_rx_compl *rxcp)
57246 -{
57247 - struct be_rx_page_info *page_info;
57248 - struct skb_frag_struct rx_frags[BE_MAX_FRAGS_PER_FRAME];
57249 - struct be_queue_info *rxq = &adapter->rx_obj.q;
57250 - u32 num_rcvd, pkt_size, remaining, vlanf, curr_frag_len;
57251 - u16 i, rxq_idx = 0, vid;
57252 -
57253 - num_rcvd = AMAP_GET_BITS(struct amap_eth_rx_compl, numfrags, rxcp);
57254 - pkt_size = AMAP_GET_BITS(struct amap_eth_rx_compl, pktsize, rxcp);
57255 - vlanf = AMAP_GET_BITS(struct amap_eth_rx_compl, vtp, rxcp);
57256 - rxq_idx = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx, rxcp);
57257 -
57258 - remaining = pkt_size;
57259 - for (i = 0; i < num_rcvd; i++) {
57260 - page_info = get_rx_page_info(adapter, rxq_idx);
57261 -
57262 - curr_frag_len = min(remaining, rx_frag_size);
57263 -
57264 - rx_frags[i].page = page_info->page;
57265 - rx_frags[i].page_offset = page_info->page_offset;
57266 - rx_frags[i].size = curr_frag_len;
57267 - remaining -= curr_frag_len;
57268 -
57269 - index_inc(&rxq_idx, rxq->len);
57270 -
57271 - memset(page_info, 0, sizeof(*page_info));
57272 - }
57273 -
57274 - if (likely(!vlanf)) {
57275 - lro_receive_frags(&adapter->rx_obj.lro_mgr, rx_frags, pkt_size,
57276 - pkt_size, NULL, 0);
57277 - } else {
57278 - vid = AMAP_GET_BITS(struct amap_eth_rx_compl, vlan_tag, rxcp);
57279 - vid = be16_to_cpu(vid);
57280 -
57281 - if (!adapter->vlan_grp || adapter->num_vlans == 0)
57282 - return;
57283 -
57284 - lro_vlan_hwaccel_receive_frags(&adapter->rx_obj.lro_mgr,
57285 - rx_frags, pkt_size, pkt_size, adapter->vlan_grp,
57286 - vid, NULL, 0);
57287 - }
57288 -
57289 - be_rx_rate_update(adapter, pkt_size, num_rcvd);
57290 - return;
57291 -}
57292 -
57293 -static struct be_eth_rx_compl *be_rx_compl_get(struct be_adapter *adapter)
57294 -{
57295 - struct be_eth_rx_compl *rxcp = queue_tail_node(&adapter->rx_obj.cq);
57296 -
57297 - if (rxcp->dw[offsetof(struct amap_eth_rx_compl, valid) / 32] == 0)
57298 - return NULL;
57299 -
57300 - be_dws_le_to_cpu(rxcp, sizeof(*rxcp));
57301 -
57302 - rxcp->dw[offsetof(struct amap_eth_rx_compl, valid) / 32] = 0;
57303 -
57304 - queue_tail_inc(&adapter->rx_obj.cq);
57305 - return rxcp;
57306 -}
57307 -
57308 -static inline struct page *be_alloc_pages(u32 size)
57309 -{
57310 - gfp_t alloc_flags = GFP_ATOMIC;
57311 - u32 order = get_order(size);
57312 - if (order > 0)
57313 - alloc_flags |= __GFP_COMP;
57314 - return alloc_pages(alloc_flags, order);
57315 -}
57316 -
57317 -/*
57318 - * Allocate a page, split it to fragments of size rx_frag_size and post as
57319 - * receive buffers to BE
57320 - */
57321 -static void be_post_rx_frags(struct be_adapter *adapter)
57322 -{
57323 - struct be_rx_page_info *page_info_tbl = adapter->rx_obj.page_info_tbl;
57324 - struct be_rx_page_info *page_info = NULL;
57325 - struct be_queue_info *rxq = &adapter->rx_obj.q;
57326 - struct page *pagep = NULL;
57327 - struct be_eth_rx_d *rxd;
57328 - u64 page_dmaaddr = 0, frag_dmaaddr;
57329 - u32 posted, page_offset = 0;
57330 -
57331 -
57332 - page_info = &page_info_tbl[rxq->head];
57333 - for (posted = 0; posted < MAX_RX_POST && !page_info->page; posted++) {
57334 - if (!pagep) {
57335 - pagep = be_alloc_pages(adapter->big_page_size);
57336 - if (unlikely(!pagep)) {
57337 - drvr_stats(adapter)->be_ethrx_post_fail++;
57338 - break;
57339 - }
57340 - page_dmaaddr = pci_map_page(adapter->pdev, pagep, 0,
57341 - adapter->big_page_size,
57342 - PCI_DMA_FROMDEVICE);
57343 - page_info->page_offset = 0;
57344 - } else {
57345 - get_page(pagep);
57346 - page_info->page_offset = page_offset + rx_frag_size;
57347 - }
57348 - page_offset = page_info->page_offset;
57349 - page_info->page = pagep;
57350 - pci_unmap_addr_set(page_info, bus, page_dmaaddr);
57351 - frag_dmaaddr = page_dmaaddr + page_info->page_offset;
57352 -
57353 - rxd = queue_head_node(rxq);
57354 - rxd->fragpa_lo = cpu_to_le32(frag_dmaaddr & 0xFFFFFFFF);
57355 - rxd->fragpa_hi = cpu_to_le32(upper_32_bits(frag_dmaaddr));
57356 - queue_head_inc(rxq);
57357 -
57358 - /* Any space left in the current big page for another frag? */
57359 - if ((page_offset + rx_frag_size + rx_frag_size) >
57360 - adapter->big_page_size) {
57361 - pagep = NULL;
57362 - page_info->last_page_user = true;
57363 - }
57364 - page_info = &page_info_tbl[rxq->head];
57365 - }
57366 - if (pagep)
57367 - page_info->last_page_user = true;
57368 -
57369 - if (posted) {
57370 - atomic_add(posted, &rxq->used);
57371 - be_rxq_notify(&adapter->ctrl, rxq->id, posted);
57372 - } else if (atomic_read(&rxq->used) == 0) {
57373 - /* Let be_worker replenish when memory is available */
57374 - adapter->rx_post_starved = true;
57375 - }
57376 -
57377 - return;
57378 -}
57379 -
57380 -static struct be_eth_tx_compl *
57381 -be_tx_compl_get(struct be_adapter *adapter)
57382 -{
57383 - struct be_queue_info *tx_cq = &adapter->tx_obj.cq;
57384 - struct be_eth_tx_compl *txcp = queue_tail_node(tx_cq);
57385 -
57386 - if (txcp->dw[offsetof(struct amap_eth_tx_compl, valid) / 32] == 0)
57387 - return NULL;
57388 -
57389 - be_dws_le_to_cpu(txcp, sizeof(*txcp));
57390 -
57391 - txcp->dw[offsetof(struct amap_eth_tx_compl, valid) / 32] = 0;
57392 -
57393 - queue_tail_inc(tx_cq);
57394 - return txcp;
57395 -}
57396 -
57397 -static void be_tx_compl_process(struct be_adapter *adapter, u16 last_index)
57398 -{
57399 - struct be_queue_info *txq = &adapter->tx_obj.q;
57400 - struct be_eth_wrb *wrb;
57401 - struct sk_buff **sent_skbs = adapter->tx_obj.sent_skb_list;
57402 - struct sk_buff *sent_skb;
57403 - u64 busaddr;
57404 - u16 cur_index, num_wrbs = 0;
57405 -
57406 - cur_index = txq->tail;
57407 - sent_skb = sent_skbs[cur_index];
57408 - BUG_ON(!sent_skb);
57409 - sent_skbs[cur_index] = NULL;
57410 -
57411 - do {
57412 - cur_index = txq->tail;
57413 - wrb = queue_tail_node(txq);
57414 - be_dws_le_to_cpu(wrb, sizeof(*wrb));
57415 - busaddr = ((u64)wrb->frag_pa_hi << 32) | (u64)wrb->frag_pa_lo;
57416 - if (busaddr != 0) {
57417 - pci_unmap_single(adapter->pdev, busaddr,
57418 - wrb->frag_len, PCI_DMA_TODEVICE);
57419 - }
57420 - num_wrbs++;
57421 - queue_tail_inc(txq);
57422 - } while (cur_index != last_index);
57423 -
57424 - atomic_sub(num_wrbs, &txq->used);
57425 -
57426 - kfree_skb(sent_skb);
57427 -}
57428 -
57429 -static void be_rx_q_clean(struct be_adapter *adapter)
57430 -{
57431 - struct be_rx_page_info *page_info;
57432 - struct be_queue_info *rxq = &adapter->rx_obj.q;
57433 - struct be_queue_info *rx_cq = &adapter->rx_obj.cq;
57434 - struct be_eth_rx_compl *rxcp;
57435 - u16 tail;
57436 -
57437 - /* First cleanup pending rx completions */
57438 - while ((rxcp = be_rx_compl_get(adapter)) != NULL) {
57439 - be_rx_compl_discard(adapter, rxcp);
57440 - be_cq_notify(&adapter->ctrl, rx_cq->id, true, 1);
57441 - }
57442 -
57443 - /* Then free posted rx buffer that were not used */
57444 - tail = (rxq->head + rxq->len - atomic_read(&rxq->used)) % rxq->len;
57445 - for (; tail != rxq->head; index_inc(&tail, rxq->len)) {
57446 - page_info = get_rx_page_info(adapter, tail);
57447 - put_page(page_info->page);
57448 - memset(page_info, 0, sizeof(*page_info));
57449 - }
57450 - BUG_ON(atomic_read(&rxq->used));
57451 -}
57452 -
57453 -static void be_tx_q_clean(struct be_adapter *adapter)
57454 -{
57455 - struct sk_buff **sent_skbs = adapter->tx_obj.sent_skb_list;
57456 - struct sk_buff *sent_skb;
57457 - struct be_queue_info *txq = &adapter->tx_obj.q;
57458 - u16 last_index;
57459 - bool dummy_wrb;
57460 -
57461 - while (atomic_read(&txq->used)) {
57462 - sent_skb = sent_skbs[txq->tail];
57463 - last_index = txq->tail;
57464 - index_adv(&last_index,
57465 - wrb_cnt_for_skb(sent_skb, &dummy_wrb) - 1, txq->len);
57466 - be_tx_compl_process(adapter, last_index);
57467 - }
57468 -}
57469 -
57470 -static void be_tx_queues_destroy(struct be_adapter *adapter)
57471 -{
57472 - struct be_queue_info *q;
57473 -
57474 - q = &adapter->tx_obj.q;
57475 - if (q->created)
57476 - be_cmd_q_destroy(&adapter->ctrl, q, QTYPE_TXQ);
57477 - be_queue_free(adapter, q);
57478 -
57479 - q = &adapter->tx_obj.cq;
57480 - if (q->created)
57481 - be_cmd_q_destroy(&adapter->ctrl, q, QTYPE_CQ);
57482 - be_queue_free(adapter, q);
57483 -
57484 - /* No more tx completions can be rcvd now; clean up if there are
57485 - * any pending completions or pending tx requests */
57486 - be_tx_q_clean(adapter);
57487 -
57488 - q = &adapter->tx_eq.q;
57489 - if (q->created)
57490 - be_cmd_q_destroy(&adapter->ctrl, q, QTYPE_EQ);
57491 - be_queue_free(adapter, q);
57492 -}
57493 -
57494 -static int be_tx_queues_create(struct be_adapter *adapter)
57495 -{
57496 - struct be_queue_info *eq, *q, *cq;
57497 -
57498 - adapter->tx_eq.max_eqd = 0;
57499 - adapter->tx_eq.min_eqd = 0;
57500 - adapter->tx_eq.cur_eqd = 96;
57501 - adapter->tx_eq.enable_aic = false;
57502 - /* Alloc Tx Event queue */
57503 - eq = &adapter->tx_eq.q;
57504 - if (be_queue_alloc(adapter, eq, EVNT_Q_LEN, sizeof(struct be_eq_entry)))
57505 - return -1;
57506 -
57507 - /* Ask BE to create Tx Event queue */
57508 - if (be_cmd_eq_create(&adapter->ctrl, eq, adapter->tx_eq.cur_eqd))
57509 - goto tx_eq_free;
57510 - /* Alloc TX eth compl queue */
57511 - cq = &adapter->tx_obj.cq;
57512 - if (be_queue_alloc(adapter, cq, TX_CQ_LEN,
57513 - sizeof(struct be_eth_tx_compl)))
57514 - goto tx_eq_destroy;
57515 -
57516 - /* Ask BE to create Tx eth compl queue */
57517 - if (be_cmd_cq_create(&adapter->ctrl, cq, eq, false, false, 3))
57518 - goto tx_cq_free;
57519 -
57520 - /* Alloc TX eth queue */
57521 - q = &adapter->tx_obj.q;
57522 - if (be_queue_alloc(adapter, q, TX_Q_LEN, sizeof(struct be_eth_wrb)))
57523 - goto tx_cq_destroy;
57524 -
57525 - /* Ask BE to create Tx eth queue */
57526 - if (be_cmd_txq_create(&adapter->ctrl, q, cq))
57527 - goto tx_q_free;
57528 - return 0;
57529 -
57530 -tx_q_free:
57531 - be_queue_free(adapter, q);
57532 -tx_cq_destroy:
57533 - be_cmd_q_destroy(&adapter->ctrl, cq, QTYPE_CQ);
57534 -tx_cq_free:
57535 - be_queue_free(adapter, cq);
57536 -tx_eq_destroy:
57537 - be_cmd_q_destroy(&adapter->ctrl, eq, QTYPE_EQ);
57538 -tx_eq_free:
57539 - be_queue_free(adapter, eq);
57540 - return -1;
57541 -}
57542 -
57543 -static void be_rx_queues_destroy(struct be_adapter *adapter)
57544 -{
57545 - struct be_queue_info *q;
57546 -
57547 - q = &adapter->rx_obj.q;
57548 - if (q->created) {
57549 - be_cmd_q_destroy(&adapter->ctrl, q, QTYPE_RXQ);
57550 - be_rx_q_clean(adapter);
57551 - }
57552 - be_queue_free(adapter, q);
57553 -
57554 - q = &adapter->rx_obj.cq;
57555 - if (q->created)
57556 - be_cmd_q_destroy(&adapter->ctrl, q, QTYPE_CQ);
57557 - be_queue_free(adapter, q);
57558 -
57559 - q = &adapter->rx_eq.q;
57560 - if (q->created)
57561 - be_cmd_q_destroy(&adapter->ctrl, q, QTYPE_EQ);
57562 - be_queue_free(adapter, q);
57563 -}
57564 -
57565 -static int be_rx_queues_create(struct be_adapter *adapter)
57566 -{
57567 - struct be_queue_info *eq, *q, *cq;
57568 - int rc;
57569 -
57570 - adapter->max_rx_coal = BE_MAX_FRAGS_PER_FRAME;
57571 - adapter->big_page_size = (1 << get_order(rx_frag_size)) * PAGE_SIZE;
57572 - adapter->rx_eq.max_eqd = BE_MAX_EQD;
57573 - adapter->rx_eq.min_eqd = 0;
57574 - adapter->rx_eq.cur_eqd = 0;
57575 - adapter->rx_eq.enable_aic = true;
57576 -
57577 - /* Alloc Rx Event queue */
57578 - eq = &adapter->rx_eq.q;
57579 - rc = be_queue_alloc(adapter, eq, EVNT_Q_LEN,
57580 - sizeof(struct be_eq_entry));
57581 - if (rc)
57582 - return rc;
57583 -
57584 - /* Ask BE to create Rx Event queue */
57585 - rc = be_cmd_eq_create(&adapter->ctrl, eq, adapter->rx_eq.cur_eqd);
57586 - if (rc)
57587 - goto rx_eq_free;
57588 -
57589 - /* Alloc RX eth compl queue */
57590 - cq = &adapter->rx_obj.cq;
57591 - rc = be_queue_alloc(adapter, cq, RX_CQ_LEN,
57592 - sizeof(struct be_eth_rx_compl));
57593 - if (rc)
57594 - goto rx_eq_destroy;
57595 -
57596 - /* Ask BE to create Rx eth compl queue */
57597 - rc = be_cmd_cq_create(&adapter->ctrl, cq, eq, false, false, 3);
57598 - if (rc)
57599 - goto rx_cq_free;
57600 -
57601 - /* Alloc RX eth queue */
57602 - q = &adapter->rx_obj.q;
57603 - rc = be_queue_alloc(adapter, q, RX_Q_LEN, sizeof(struct be_eth_rx_d));
57604 - if (rc)
57605 - goto rx_cq_destroy;
57606 -
57607 - /* Ask BE to create Rx eth queue */
57608 - rc = be_cmd_rxq_create(&adapter->ctrl, q, cq->id, rx_frag_size,
57609 - BE_MAX_JUMBO_FRAME_SIZE, adapter->if_handle, false);
57610 - if (rc)
57611 - goto rx_q_free;
57612 -
57613 - return 0;
57614 -rx_q_free:
57615 - be_queue_free(adapter, q);
57616 -rx_cq_destroy:
57617 - be_cmd_q_destroy(&adapter->ctrl, cq, QTYPE_CQ);
57618 -rx_cq_free:
57619 - be_queue_free(adapter, cq);
57620 -rx_eq_destroy:
57621 - be_cmd_q_destroy(&adapter->ctrl, eq, QTYPE_EQ);
57622 -rx_eq_free:
57623 - be_queue_free(adapter, eq);
57624 - return rc;
57625 -}
57626 -static bool event_get(struct be_eq_obj *eq_obj, u16 *rid)
57627 -{
57628 - struct be_eq_entry *entry = queue_tail_node(&eq_obj->q);
57629 - u32 evt = entry->evt;
57630 -
57631 - if (!evt)
57632 - return false;
57633 -
57634 - evt = le32_to_cpu(evt);
57635 - *rid = (evt >> EQ_ENTRY_RES_ID_SHIFT) & EQ_ENTRY_RES_ID_MASK;
57636 - entry->evt = 0;
57637 - queue_tail_inc(&eq_obj->q);
57638 - return true;
57639 -}
57640 -
57641 -static int event_handle(struct be_ctrl_info *ctrl,
57642 - struct be_eq_obj *eq_obj)
57643 -{
57644 - u16 rid = 0, num = 0;
57645 -
57646 - while (event_get(eq_obj, &rid))
57647 - num++;
57648 -
57649 - /* We can see an interrupt and no event */
57650 - be_eq_notify(ctrl, eq_obj->q.id, true, true, num);
57651 - if (num)
57652 - napi_schedule(&eq_obj->napi);
57653 -
57654 - return num;
57655 -}
57656 -
57657 -static irqreturn_t be_intx(int irq, void *dev)
57658 -{
57659 - struct be_adapter *adapter = dev;
57660 - struct be_ctrl_info *ctrl = &adapter->ctrl;
57661 - int rx, tx;
57662 -
57663 - tx = event_handle(ctrl, &adapter->tx_eq);
57664 - rx = event_handle(ctrl, &adapter->rx_eq);
57665 -
57666 - if (rx || tx)
57667 - return IRQ_HANDLED;
57668 - else
57669 - return IRQ_NONE;
57670 -}
57671 -
57672 -static irqreturn_t be_msix_rx(int irq, void *dev)
57673 -{
57674 - struct be_adapter *adapter = dev;
57675 -
57676 - event_handle(&adapter->ctrl, &adapter->rx_eq);
57677 -
57678 - return IRQ_HANDLED;
57679 -}
57680 -
57681 -static irqreturn_t be_msix_tx(int irq, void *dev)
57682 -{
57683 - struct be_adapter *adapter = dev;
57684 -
57685 - event_handle(&adapter->ctrl, &adapter->tx_eq);
57686 -
57687 - return IRQ_HANDLED;
57688 -}
57689 -
57690 -static inline bool do_lro(struct be_adapter *adapter,
57691 - struct be_eth_rx_compl *rxcp)
57692 -{
57693 - int err = AMAP_GET_BITS(struct amap_eth_rx_compl, err, rxcp);
57694 - int tcp_frame = AMAP_GET_BITS(struct amap_eth_rx_compl, tcpf, rxcp);
57695 -
57696 - if (err)
57697 - drvr_stats(adapter)->be_rxcp_err++;
57698 -
57699 - return (!tcp_frame || err || (adapter->max_rx_coal <= 1)) ?
57700 - false : true;
57701 -}
57702 -
57703 -int be_poll_rx(struct napi_struct *napi, int budget)
57704 -{
57705 - struct be_eq_obj *rx_eq = container_of(napi, struct be_eq_obj, napi);
57706 - struct be_adapter *adapter =
57707 - container_of(rx_eq, struct be_adapter, rx_eq);
57708 - struct be_queue_info *rx_cq = &adapter->rx_obj.cq;
57709 - struct be_eth_rx_compl *rxcp;
57710 - u32 work_done;
57711 -
57712 - for (work_done = 0; work_done < budget; work_done++) {
57713 - rxcp = be_rx_compl_get(adapter);
57714 - if (!rxcp)
57715 - break;
57716 -
57717 - if (do_lro(adapter, rxcp))
57718 - be_rx_compl_process_lro(adapter, rxcp);
57719 - else
57720 - be_rx_compl_process(adapter, rxcp);
57721 - }
57722 -
57723 - lro_flush_all(&adapter->rx_obj.lro_mgr);
57724 -
57725 - /* Refill the queue */
57726 - if (atomic_read(&adapter->rx_obj.q.used) < RX_FRAGS_REFILL_WM)
57727 - be_post_rx_frags(adapter);
57728 -
57729 - /* All consumed */
57730 - if (work_done < budget) {
57731 - napi_complete(napi);
57732 - be_cq_notify(&adapter->ctrl, rx_cq->id, true, work_done);
57733 - } else {
57734 - /* More to be consumed; continue with interrupts disabled */
57735 - be_cq_notify(&adapter->ctrl, rx_cq->id, false, work_done);
57736 - }
57737 - return work_done;
57738 -}
57739 -
57740 -/* For TX we don't honour budget; consume everything */
57741 -int be_poll_tx(struct napi_struct *napi, int budget)
57742 -{
57743 - struct be_eq_obj *tx_eq = container_of(napi, struct be_eq_obj, napi);
57744 - struct be_adapter *adapter =
57745 - container_of(tx_eq, struct be_adapter, tx_eq);
57746 - struct be_tx_obj *tx_obj = &adapter->tx_obj;
57747 - struct be_queue_info *tx_cq = &tx_obj->cq;
57748 - struct be_queue_info *txq = &tx_obj->q;
57749 - struct be_eth_tx_compl *txcp;
57750 - u32 num_cmpl = 0;
57751 - u16 end_idx;
57752 -
57753 - while ((txcp = be_tx_compl_get(adapter))) {
57754 - end_idx = AMAP_GET_BITS(struct amap_eth_tx_compl,
57755 - wrb_index, txcp);
57756 - be_tx_compl_process(adapter, end_idx);
57757 - num_cmpl++;
57758 - }
57759 -
57760 - /* As Tx wrbs have been freed up, wake up netdev queue if
57761 - * it was stopped due to lack of tx wrbs.
57762 - */
57763 - if (netif_queue_stopped(adapter->netdev) &&
57764 - atomic_read(&txq->used) < txq->len / 2) {
57765 - netif_wake_queue(adapter->netdev);
57766 - }
57767 -
57768 - napi_complete(napi);
57769 -
57770 - be_cq_notify(&adapter->ctrl, tx_cq->id, true, num_cmpl);
57771 -
57772 - drvr_stats(adapter)->be_tx_events++;
57773 - drvr_stats(adapter)->be_tx_compl += num_cmpl;
57774 -
57775 - return 1;
57776 -}
57777 -
57778 -static void be_worker(struct work_struct *work)
57779 -{
57780 - struct be_adapter *adapter =
57781 - container_of(work, struct be_adapter, work.work);
57782 - int status;
57783 -
57784 - /* Check link */
57785 - be_link_status_update(adapter);
57786 -
57787 - /* Get Stats */
57788 - status = be_cmd_get_stats(&adapter->ctrl, &adapter->stats.cmd);
57789 - if (!status)
57790 - netdev_stats_update(adapter);
57791 -
57792 - /* Set EQ delay */
57793 - be_rx_eqd_update(adapter);
57794 -
57795 - if (adapter->rx_post_starved) {
57796 - adapter->rx_post_starved = false;
57797 - be_post_rx_frags(adapter);
57798 - }
57799 -
57800 - schedule_delayed_work(&adapter->work, msecs_to_jiffies(1000));
57801 -}
57802 -
57803 -static void be_msix_enable(struct be_adapter *adapter)
57804 -{
57805 - int i, status;
57806 -
57807 - for (i = 0; i < BE_NUM_MSIX_VECTORS; i++)
57808 - adapter->msix_entries[i].entry = i;
57809 -
57810 - status = pci_enable_msix(adapter->pdev, adapter->msix_entries,
57811 - BE_NUM_MSIX_VECTORS);
57812 - if (status == 0)
57813 - adapter->msix_enabled = true;
57814 - return;
57815 -}
57816 -
57817 -static inline int be_msix_vec_get(struct be_adapter *adapter, u32 eq_id)
57818 -{
57819 - return adapter->msix_entries[eq_id -
57820 - 8 * adapter->ctrl.pci_func].vector;
57821 -}
57822 -
57823 -static int be_msix_register(struct be_adapter *adapter)
57824 -{
57825 - struct net_device *netdev = adapter->netdev;
57826 - struct be_eq_obj *tx_eq = &adapter->tx_eq;
57827 - struct be_eq_obj *rx_eq = &adapter->rx_eq;
57828 - int status, vec;
57829 -
57830 - sprintf(tx_eq->desc, "%s-tx", netdev->name);
57831 - vec = be_msix_vec_get(adapter, tx_eq->q.id);
57832 - status = request_irq(vec, be_msix_tx, 0, tx_eq->desc, adapter);
57833 - if (status)
57834 - goto err;
57835 -
57836 - sprintf(rx_eq->desc, "%s-rx", netdev->name);
57837 - vec = be_msix_vec_get(adapter, rx_eq->q.id);
57838 - status = request_irq(vec, be_msix_rx, 0, rx_eq->desc, adapter);
57839 - if (status) { /* Free TX IRQ */
57840 - vec = be_msix_vec_get(adapter, tx_eq->q.id);
57841 - free_irq(vec, adapter);
57842 - goto err;
57843 - }
57844 - return 0;
57845 -err:
57846 - dev_warn(&adapter->pdev->dev,
57847 - "MSIX Request IRQ failed - err %d\n", status);
57848 - pci_disable_msix(adapter->pdev);
57849 - adapter->msix_enabled = false;
57850 - return status;
57851 -}
57852 -
57853 -static int be_irq_register(struct be_adapter *adapter)
57854 -{
57855 - struct net_device *netdev = adapter->netdev;
57856 - int status;
57857 -
57858 - if (adapter->msix_enabled) {
57859 - status = be_msix_register(adapter);
57860 - if (status == 0)
57861 - goto done;
57862 - }
57863 -
57864 - /* INTx */
57865 - netdev->irq = adapter->pdev->irq;
57866 - status = request_irq(netdev->irq, be_intx, IRQF_SHARED, netdev->name,
57867 - adapter);
57868 - if (status) {
57869 - dev_err(&adapter->pdev->dev,
57870 - "INTx request IRQ failed - err %d\n", status);
57871 - return status;
57872 - }
57873 -done:
57874 - adapter->isr_registered = true;
57875 - return 0;
57876 -}
57877 -
57878 -static void be_irq_unregister(struct be_adapter *adapter)
57879 -{
57880 - struct net_device *netdev = adapter->netdev;
57881 - int vec;
57882 -
57883 - if (!adapter->isr_registered)
57884 - return;
57885 -
57886 - /* INTx */
57887 - if (!adapter->msix_enabled) {
57888 - free_irq(netdev->irq, adapter);
57889 - goto done;
57890 - }
57891 -
57892 - /* MSIx */
57893 - vec = be_msix_vec_get(adapter, adapter->tx_eq.q.id);
57894 - free_irq(vec, adapter);
57895 - vec = be_msix_vec_get(adapter, adapter->rx_eq.q.id);
57896 - free_irq(vec, adapter);
57897 -done:
57898 - adapter->isr_registered = false;
57899 - return;
57900 -}
57901 -
57902 -static int be_open(struct net_device *netdev)
57903 -{
57904 - struct be_adapter *adapter = netdev_priv(netdev);
57905 - struct be_ctrl_info *ctrl = &adapter->ctrl;
57906 - struct be_eq_obj *rx_eq = &adapter->rx_eq;
57907 - struct be_eq_obj *tx_eq = &adapter->tx_eq;
57908 - u32 if_flags;
57909 - int status;
57910 -
57911 - if_flags = BE_IF_FLAGS_BROADCAST | BE_IF_FLAGS_PROMISCUOUS |
57912 - BE_IF_FLAGS_MCAST_PROMISCUOUS | BE_IF_FLAGS_UNTAGGED |
57913 - BE_IF_FLAGS_PASS_L3L4_ERRORS;
57914 - status = be_cmd_if_create(ctrl, if_flags, netdev->dev_addr,
57915 - false/* pmac_invalid */, &adapter->if_handle,
57916 - &adapter->pmac_id);
57917 - if (status != 0)
57918 - goto do_none;
57919 -
57920 - be_vid_config(netdev);
57921 -
57922 - status = be_cmd_set_flow_control(ctrl, true, true);
57923 - if (status != 0)
57924 - goto if_destroy;
57925 -
57926 - status = be_tx_queues_create(adapter);
57927 - if (status != 0)
57928 - goto if_destroy;
57929 -
57930 - status = be_rx_queues_create(adapter);
57931 - if (status != 0)
57932 - goto tx_qs_destroy;
57933 -
57934 - /* First time posting */
57935 - be_post_rx_frags(adapter);
57936 -
57937 - napi_enable(&rx_eq->napi);
57938 - napi_enable(&tx_eq->napi);
57939 -
57940 - be_irq_register(adapter);
57941 -
57942 - be_intr_set(ctrl, true);
57943 -
57944 - /* The evt queues are created in the unarmed state; arm them */
57945 - be_eq_notify(ctrl, rx_eq->q.id, true, false, 0);
57946 - be_eq_notify(ctrl, tx_eq->q.id, true, false, 0);
57947 -
57948 - /* The compl queues are created in the unarmed state; arm them */
57949 - be_cq_notify(ctrl, adapter->rx_obj.cq.id, true, 0);
57950 - be_cq_notify(ctrl, adapter->tx_obj.cq.id, true, 0);
57951 -
57952 - be_link_status_update(adapter);
57953 -
57954 - schedule_delayed_work(&adapter->work, msecs_to_jiffies(100));
57955 - return 0;
57956 -
57957 -tx_qs_destroy:
57958 - be_tx_queues_destroy(adapter);
57959 -if_destroy:
57960 - be_cmd_if_destroy(ctrl, adapter->if_handle);
57961 -do_none:
57962 - return status;
57963 -}
57964 -
57965 -static int be_close(struct net_device *netdev)
57966 -{
57967 - struct be_adapter *adapter = netdev_priv(netdev);
57968 - struct be_ctrl_info *ctrl = &adapter->ctrl;
57969 - struct be_eq_obj *rx_eq = &adapter->rx_eq;
57970 - struct be_eq_obj *tx_eq = &adapter->tx_eq;
57971 - int vec;
57972 -
57973 - cancel_delayed_work(&adapter->work);
57974 -
57975 - netif_stop_queue(netdev);
57976 - netif_carrier_off(netdev);
57977 - adapter->link.speed = PHY_LINK_SPEED_ZERO;
57978 -
57979 - be_intr_set(ctrl, false);
57980 -
57981 - if (adapter->msix_enabled) {
57982 - vec = be_msix_vec_get(adapter, tx_eq->q.id);
57983 - synchronize_irq(vec);
57984 - vec = be_msix_vec_get(adapter, rx_eq->q.id);
57985 - synchronize_irq(vec);
57986 - } else {
57987 - synchronize_irq(netdev->irq);
57988 - }
57989 - be_irq_unregister(adapter);
57990 -
57991 - napi_disable(&rx_eq->napi);
57992 - napi_disable(&tx_eq->napi);
57993 -
57994 - be_rx_queues_destroy(adapter);
57995 - be_tx_queues_destroy(adapter);
57996 -
57997 - be_cmd_if_destroy(ctrl, adapter->if_handle);
57998 - return 0;
57999 -}
58000 -
58001 -static int be_get_frag_header(struct skb_frag_struct *frag, void **mac_hdr,
58002 - void **ip_hdr, void **tcpudp_hdr,
58003 - u64 *hdr_flags, void *priv)
58004 -{
58005 - struct ethhdr *eh;
58006 - struct vlan_ethhdr *veh;
58007 - struct iphdr *iph;
58008 - u8 *va = page_address(frag->page) + frag->page_offset;
58009 - unsigned long ll_hlen;
58010 -
58011 - prefetch(va);
58012 - eh = (struct ethhdr *)va;
58013 - *mac_hdr = eh;
58014 - ll_hlen = ETH_HLEN;
58015 - if (eh->h_proto != htons(ETH_P_IP)) {
58016 - if (eh->h_proto == htons(ETH_P_8021Q)) {
58017 - veh = (struct vlan_ethhdr *)va;
58018 - if (veh->h_vlan_encapsulated_proto != htons(ETH_P_IP))
58019 - return -1;
58020 -
58021 - ll_hlen += VLAN_HLEN;
58022 - } else {
58023 - return -1;
58024 - }
58025 - }
58026 - *hdr_flags = LRO_IPV4;
58027 - iph = (struct iphdr *)(va + ll_hlen);
58028 - *ip_hdr = iph;
58029 - if (iph->protocol != IPPROTO_TCP)
58030 - return -1;
58031 - *hdr_flags |= LRO_TCP;
58032 - *tcpudp_hdr = (u8 *) (*ip_hdr) + (iph->ihl << 2);
58033 -
58034 - return 0;
58035 -}
58036 -
58037 -static void be_lro_init(struct be_adapter *adapter, struct net_device *netdev)
58038 -{
58039 - struct net_lro_mgr *lro_mgr;
58040 -
58041 - lro_mgr = &adapter->rx_obj.lro_mgr;
58042 - lro_mgr->dev = netdev;
58043 - lro_mgr->features = LRO_F_NAPI;
58044 - lro_mgr->ip_summed = CHECKSUM_UNNECESSARY;
58045 - lro_mgr->ip_summed_aggr = CHECKSUM_UNNECESSARY;
58046 - lro_mgr->max_desc = BE_MAX_LRO_DESCRIPTORS;
58047 - lro_mgr->lro_arr = adapter->rx_obj.lro_desc;
58048 - lro_mgr->get_frag_header = be_get_frag_header;
58049 - lro_mgr->max_aggr = BE_MAX_FRAGS_PER_FRAME;
58050 -}
58051 -
58052 -static struct net_device_ops be_netdev_ops = {
58053 - .ndo_open = be_open,
58054 - .ndo_stop = be_close,
58055 - .ndo_start_xmit = be_xmit,
58056 - .ndo_get_stats = be_get_stats,
58057 - .ndo_set_rx_mode = be_set_multicast_list,
58058 - .ndo_set_mac_address = be_mac_addr_set,
58059 - .ndo_change_mtu = be_change_mtu,
58060 - .ndo_validate_addr = eth_validate_addr,
58061 - .ndo_vlan_rx_register = be_vlan_register,
58062 - .ndo_vlan_rx_add_vid = be_vlan_add_vid,
58063 - .ndo_vlan_rx_kill_vid = be_vlan_rem_vid,
58064 -};
58065 -
58066 -static void be_netdev_init(struct net_device *netdev)
58067 -{
58068 - struct be_adapter *adapter = netdev_priv(netdev);
58069 -
58070 - netdev->features |= NETIF_F_SG | NETIF_F_HW_VLAN_RX | NETIF_F_TSO |
58071 - NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_FILTER | NETIF_F_IP_CSUM |
58072 - NETIF_F_IPV6_CSUM | NETIF_F_TSO6;
58073 -
58074 - netdev->flags |= IFF_MULTICAST;
58075 -
58076 - BE_SET_NETDEV_OPS(netdev, &be_netdev_ops);
58077 -
58078 - SET_ETHTOOL_OPS(netdev, &be_ethtool_ops);
58079 -
58080 - be_lro_init(adapter, netdev);
58081 -
58082 - netif_napi_add(netdev, &adapter->rx_eq.napi, be_poll_rx,
58083 - BE_NAPI_WEIGHT);
58084 - netif_napi_add(netdev, &adapter->tx_eq.napi, be_poll_tx,
58085 - BE_NAPI_WEIGHT);
58086 -
58087 - netif_carrier_off(netdev);
58088 - netif_stop_queue(netdev);
58089 -}
58090 -
58091 -static void be_unmap_pci_bars(struct be_adapter *adapter)
58092 -{
58093 - struct be_ctrl_info *ctrl = &adapter->ctrl;
58094 - if (ctrl->csr)
58095 - iounmap(ctrl->csr);
58096 - if (ctrl->db)
58097 - iounmap(ctrl->db);
58098 - if (ctrl->pcicfg)
58099 - iounmap(ctrl->pcicfg);
58100 -}
58101 -
58102 -static int be_map_pci_bars(struct be_adapter *adapter)
58103 -{
58104 - u8 __iomem *addr;
58105 -
58106 - addr = ioremap_nocache(pci_resource_start(adapter->pdev, 2),
58107 - pci_resource_len(adapter->pdev, 2));
58108 - if (addr == NULL)
58109 - return -ENOMEM;
58110 - adapter->ctrl.csr = addr;
58111 -
58112 - addr = ioremap_nocache(pci_resource_start(adapter->pdev, 4),
58113 - 128 * 1024);
58114 - if (addr == NULL)
58115 - goto pci_map_err;
58116 - adapter->ctrl.db = addr;
58117 -
58118 - addr = ioremap_nocache(pci_resource_start(adapter->pdev, 1),
58119 - pci_resource_len(adapter->pdev, 1));
58120 - if (addr == NULL)
58121 - goto pci_map_err;
58122 - adapter->ctrl.pcicfg = addr;
58123 -
58124 - return 0;
58125 -pci_map_err:
58126 - be_unmap_pci_bars(adapter);
58127 - return -ENOMEM;
58128 -}
58129 -
58130 -
58131 -static void be_ctrl_cleanup(struct be_adapter *adapter)
58132 -{
58133 - struct be_dma_mem *mem = &adapter->ctrl.mbox_mem_alloced;
58134 -
58135 - be_unmap_pci_bars(adapter);
58136 -
58137 - if (mem->va)
58138 - pci_free_consistent(adapter->pdev, mem->size,
58139 - mem->va, mem->dma);
58140 -}
58141 -
58142 -/* Initialize the mbox required to send cmds to BE */
58143 -static int be_ctrl_init(struct be_adapter *adapter)
58144 -{
58145 - struct be_ctrl_info *ctrl = &adapter->ctrl;
58146 - struct be_dma_mem *mbox_mem_alloc = &ctrl->mbox_mem_alloced;
58147 - struct be_dma_mem *mbox_mem_align = &ctrl->mbox_mem;
58148 - int status;
58149 - u32 val;
58150 -
58151 - status = be_map_pci_bars(adapter);
58152 - if (status)
58153 - return status;
58154 -
58155 - mbox_mem_alloc->size = sizeof(struct be_mcc_mailbox) + 16;
58156 - mbox_mem_alloc->va = pci_alloc_consistent(adapter->pdev,
58157 - mbox_mem_alloc->size, &mbox_mem_alloc->dma);
58158 - if (!mbox_mem_alloc->va) {
58159 - be_unmap_pci_bars(adapter);
58160 - return -1;
58161 - }
58162 - mbox_mem_align->size = sizeof(struct be_mcc_mailbox);
58163 - mbox_mem_align->va = PTR_ALIGN(mbox_mem_alloc->va, 16);
58164 - mbox_mem_align->dma = PTR_ALIGN(mbox_mem_alloc->dma, 16);
58165 - memset(mbox_mem_align->va, 0, sizeof(struct be_mcc_mailbox));
58166 - spin_lock_init(&ctrl->cmd_lock);
58167 -
58168 - val = ioread32(ctrl->pcicfg + PCICFG_MEMBAR_CTRL_INT_CTRL_OFFSET);
58169 - ctrl->pci_func = (val >> MEMBAR_CTRL_INT_CTRL_PFUNC_SHIFT) &
58170 - MEMBAR_CTRL_INT_CTRL_PFUNC_MASK;
58171 - return 0;
58172 -}
58173 -
58174 -static void be_stats_cleanup(struct be_adapter *adapter)
58175 -{
58176 - struct be_stats_obj *stats = &adapter->stats;
58177 - struct be_dma_mem *cmd = &stats->cmd;
58178 -
58179 - if (cmd->va)
58180 - pci_free_consistent(adapter->pdev, cmd->size,
58181 - cmd->va, cmd->dma);
58182 -}
58183 -
58184 -static int be_stats_init(struct be_adapter *adapter)
58185 -{
58186 - struct be_stats_obj *stats = &adapter->stats;
58187 - struct be_dma_mem *cmd = &stats->cmd;
58188 -
58189 - cmd->size = sizeof(struct be_cmd_req_get_stats);
58190 - cmd->va = pci_alloc_consistent(adapter->pdev, cmd->size, &cmd->dma);
58191 - if (cmd->va == NULL)
58192 - return -1;
58193 - return 0;
58194 -}
58195 -
58196 -static void __devexit be_remove(struct pci_dev *pdev)
58197 -{
58198 - struct be_adapter *adapter = pci_get_drvdata(pdev);
58199 - if (!adapter)
58200 - return;
58201 -
58202 - unregister_netdev(adapter->netdev);
58203 -
58204 - be_stats_cleanup(adapter);
58205 -
58206 - be_ctrl_cleanup(adapter);
58207 -
58208 - if (adapter->msix_enabled) {
58209 - pci_disable_msix(adapter->pdev);
58210 - adapter->msix_enabled = false;
58211 - }
58212 -
58213 - pci_set_drvdata(pdev, NULL);
58214 - pci_release_regions(pdev);
58215 - pci_disable_device(pdev);
58216 -
58217 - free_netdev(adapter->netdev);
58218 -}
58219 -
58220 -static int be_hw_up(struct be_adapter *adapter)
58221 -{
58222 - struct be_ctrl_info *ctrl = &adapter->ctrl;
58223 - int status;
58224 -
58225 - status = be_cmd_POST(ctrl);
58226 - if (status)
58227 - return status;
58228 -
58229 - status = be_cmd_get_fw_ver(ctrl, adapter->fw_ver);
58230 - if (status)
58231 - return status;
58232 -
58233 - status = be_cmd_query_fw_cfg(ctrl, &adapter->port_num);
58234 - return status;
58235 -}
58236 -
58237 -static int __devinit be_probe(struct pci_dev *pdev,
58238 - const struct pci_device_id *pdev_id)
58239 -{
58240 - int status = 0;
58241 - struct be_adapter *adapter;
58242 - struct net_device *netdev;
58243 - struct be_ctrl_info *ctrl;
58244 - u8 mac[ETH_ALEN];
58245 -
58246 - status = pci_enable_device(pdev);
58247 - if (status)
58248 - goto do_none;
58249 -
58250 - status = pci_request_regions(pdev, DRV_NAME);
58251 - if (status)
58252 - goto disable_dev;
58253 - pci_set_master(pdev);
58254 -
58255 - netdev = alloc_etherdev(sizeof(struct be_adapter));
58256 - if (netdev == NULL) {
58257 - status = -ENOMEM;
58258 - goto rel_reg;
58259 - }
58260 - adapter = netdev_priv(netdev);
58261 - adapter->pdev = pdev;
58262 - pci_set_drvdata(pdev, adapter);
58263 - adapter->netdev = netdev;
58264 -
58265 - be_msix_enable(adapter);
58266 -
58267 - status = pci_set_dma_mask(pdev, DMA_64BIT_MASK);
58268 - if (!status) {
58269 - netdev->features |= NETIF_F_HIGHDMA;
58270 - } else {
58271 - status = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
58272 - if (status) {
58273 - dev_err(&pdev->dev, "Could not set PCI DMA Mask\n");
58274 - goto free_netdev;
58275 - }
58276 - }
58277 -
58278 - ctrl = &adapter->ctrl;
58279 - status = be_ctrl_init(adapter);
58280 - if (status)
58281 - goto free_netdev;
58282 -
58283 - status = be_stats_init(adapter);
58284 - if (status)
58285 - goto ctrl_clean;
58286 -
58287 - status = be_hw_up(adapter);
58288 - if (status)
58289 - goto stats_clean;
58290 -
58291 - status = be_cmd_mac_addr_query(ctrl, mac, MAC_ADDRESS_TYPE_NETWORK,
58292 - true /* permanent */, 0);
58293 - if (status)
58294 - goto stats_clean;
58295 - memcpy(netdev->dev_addr, mac, ETH_ALEN);
58296 -
58297 - INIT_DELAYED_WORK(&adapter->work, be_worker);
58298 - be_netdev_init(netdev);
58299 - SET_NETDEV_DEV(netdev, &adapter->pdev->dev);
58300 -
58301 - status = register_netdev(netdev);
58302 - if (status != 0)
58303 - goto stats_clean;
58304 -
58305 - dev_info(&pdev->dev, BE_NAME " port %d\n", adapter->port_num);
58306 - return 0;
58307 -
58308 -stats_clean:
58309 - be_stats_cleanup(adapter);
58310 -ctrl_clean:
58311 - be_ctrl_cleanup(adapter);
58312 -free_netdev:
58313 - free_netdev(adapter->netdev);
58314 -rel_reg:
58315 - pci_release_regions(pdev);
58316 -disable_dev:
58317 - pci_disable_device(pdev);
58318 -do_none:
58319 - dev_warn(&pdev->dev, BE_NAME " initialization failed\n");
58320 - return status;
58321 -}
58322 -
58323 -static int be_suspend(struct pci_dev *pdev, pm_message_t state)
58324 -{
58325 - struct be_adapter *adapter = pci_get_drvdata(pdev);
58326 - struct net_device *netdev = adapter->netdev;
58327 -
58328 - netif_device_detach(netdev);
58329 - if (netif_running(netdev)) {
58330 - rtnl_lock();
58331 - be_close(netdev);
58332 - rtnl_unlock();
58333 - }
58334 -
58335 - pci_save_state(pdev);
58336 - pci_disable_device(pdev);
58337 - pci_set_power_state(pdev, pci_choose_state(pdev, state));
58338 - return 0;
58339 -}
58340 -
58341 -static int be_resume(struct pci_dev *pdev)
58342 -{
58343 - int status = 0;
58344 - struct be_adapter *adapter = pci_get_drvdata(pdev);
58345 - struct net_device *netdev = adapter->netdev;
58346 -
58347 - netif_device_detach(netdev);
58348 -
58349 - status = pci_enable_device(pdev);
58350 - if (status)
58351 - return status;
58352 -
58353 - pci_set_power_state(pdev, 0);
58354 - pci_restore_state(pdev);
58355 -
58356 - if (netif_running(netdev)) {
58357 - rtnl_lock();
58358 - be_open(netdev);
58359 - rtnl_unlock();
58360 - }
58361 - netif_device_attach(netdev);
58362 - return 0;
58363 -}
58364 -
58365 -static struct pci_driver be_driver = {
58366 - .name = DRV_NAME,
58367 - .id_table = be_dev_ids,
58368 - .probe = be_probe,
58369 - .remove = be_remove,
58370 - .suspend = be_suspend,
58371 - .resume = be_resume
58372 -};
58373 -
58374 -static int __init be_init_module(void)
58375 -{
58376 - if (rx_frag_size != 8192 && rx_frag_size != 4096
58377 - && rx_frag_size != 2048) {
58378 - printk(KERN_WARNING DRV_NAME
58379 - " : Module param rx_frag_size must be 2048/4096/8192."
58380 - " Using 2048\n");
58381 - rx_frag_size = 2048;
58382 - }
58383 - /* Ensure rx_frag_size is aligned to chache line */
58384 - if (SKB_DATA_ALIGN(rx_frag_size) != rx_frag_size) {
58385 - printk(KERN_WARNING DRV_NAME
58386 - " : Bad module param rx_frag_size. Using 2048\n");
58387 - rx_frag_size = 2048;
58388 - }
58389 -
58390 - return pci_register_driver(&be_driver);
58391 -}
58392 -module_init(be_init_module);
58393 -
58394 -static void __exit be_exit_module(void)
58395 -{
58396 - pci_unregister_driver(&be_driver);
58397 -}
58398 -module_exit(be_exit_module);
58399 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/benet/Kconfig linux-2.6.29-rc3.owrt/drivers/net/benet/Kconfig
58400 --- linux-2.6.29.owrt/drivers/net/benet/Kconfig 2009-05-10 22:04:38.000000000 +0200
58401 +++ linux-2.6.29-rc3.owrt/drivers/net/benet/Kconfig 1970-01-01 01:00:00.000000000 +0100
58402 @@ -1,7 +0,0 @@
58403 -config BE2NET
58404 - tristate "ServerEngines' 10Gbps NIC - BladeEngine 2"
58405 - depends on PCI && INET
58406 - select INET_LRO
58407 - help
58408 - This driver implements the NIC functionality for ServerEngines'
58409 - 10Gbps network adapter - BladeEngine 2.
58410 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/benet/Makefile linux-2.6.29-rc3.owrt/drivers/net/benet/Makefile
58411 --- linux-2.6.29.owrt/drivers/net/benet/Makefile 2009-05-10 22:04:38.000000000 +0200
58412 +++ linux-2.6.29-rc3.owrt/drivers/net/benet/Makefile 1970-01-01 01:00:00.000000000 +0100
58413 @@ -1,7 +0,0 @@
58414 -#
58415 -# Makefile to build the network driver for ServerEngine's BladeEngine.
58416 -#
58417 -
58418 -obj-$(CONFIG_BE2NET) += be2net.o
58419 -
58420 -be2net-y := be_main.o be_cmds.o be_ethtool.o
58421 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/bnx2.c linux-2.6.29-rc3.owrt/drivers/net/bnx2.c
58422 --- linux-2.6.29.owrt/drivers/net/bnx2.c 2009-05-10 22:04:38.000000000 +0200
58423 +++ linux-2.6.29-rc3.owrt/drivers/net/bnx2.c 2009-05-10 23:48:28.000000000 +0200
58424 @@ -1,6 +1,6 @@
58425 /* bnx2.c: Broadcom NX2 network driver.
58426 *
58427 - * Copyright (c) 2004-2009 Broadcom Corporation
58428 + * Copyright (c) 2004-2008 Broadcom Corporation
58429 *
58430 * This program is free software; you can redistribute it and/or modify
58431 * it under the terms of the GNU General Public License as published by
58432 @@ -57,8 +57,8 @@
58433
58434 #define DRV_MODULE_NAME "bnx2"
58435 #define PFX DRV_MODULE_NAME ": "
58436 -#define DRV_MODULE_VERSION "1.9.3"
58437 -#define DRV_MODULE_RELDATE "March 17, 2009"
58438 +#define DRV_MODULE_VERSION "1.9.0"
58439 +#define DRV_MODULE_RELDATE "Dec 16, 2008"
58440
58441 #define RUN_AT(x) (jiffies + (x))
58442
58443 @@ -2910,8 +2910,18 @@
58444
58445 rx_hdr = (struct l2_fhdr *) skb->data;
58446 len = rx_hdr->l2_fhdr_pkt_len;
58447 - status = rx_hdr->l2_fhdr_status;
58448
58449 + if ((status = rx_hdr->l2_fhdr_status) &
58450 + (L2_FHDR_ERRORS_BAD_CRC |
58451 + L2_FHDR_ERRORS_PHY_DECODE |
58452 + L2_FHDR_ERRORS_ALIGNMENT |
58453 + L2_FHDR_ERRORS_TOO_SHORT |
58454 + L2_FHDR_ERRORS_GIANT_FRAME)) {
58455 +
58456 + bnx2_reuse_rx_skb(bp, rxr, skb, sw_ring_cons,
58457 + sw_ring_prod);
58458 + goto next_rx;
58459 + }
58460 hdr_len = 0;
58461 if (status & L2_FHDR_STATUS_SPLIT) {
58462 hdr_len = rx_hdr->l2_fhdr_ip_xsum;
58463 @@ -2921,24 +2931,6 @@
58464 pg_ring_used = 1;
58465 }
58466
58467 - if (unlikely(status & (L2_FHDR_ERRORS_BAD_CRC |
58468 - L2_FHDR_ERRORS_PHY_DECODE |
58469 - L2_FHDR_ERRORS_ALIGNMENT |
58470 - L2_FHDR_ERRORS_TOO_SHORT |
58471 - L2_FHDR_ERRORS_GIANT_FRAME))) {
58472 -
58473 - bnx2_reuse_rx_skb(bp, rxr, skb, sw_ring_cons,
58474 - sw_ring_prod);
58475 - if (pg_ring_used) {
58476 - int pages;
58477 -
58478 - pages = PAGE_ALIGN(len - hdr_len) >> PAGE_SHIFT;
58479 -
58480 - bnx2_reuse_rx_skb_pages(bp, rxr, NULL, pages);
58481 - }
58482 - goto next_rx;
58483 - }
58484 -
58485 len -= 4;
58486
58487 if (len <= bp->rx_copy_thresh) {
58488 @@ -5843,6 +5835,9 @@
58489 for (i = 0; i < BNX2_MAX_MSIX_VEC; i++) {
58490 msix_ent[i].entry = i;
58491 msix_ent[i].vector = 0;
58492 +
58493 + snprintf(bp->irq_tbl[i].name, len, "%s-%d", dev->name, i);
58494 + bp->irq_tbl[i].handler = bnx2_msi_1shot;
58495 }
58496
58497 rc = pci_enable_msix(bp->pdev, msix_ent, BNX2_MAX_MSIX_VEC);
58498 @@ -5851,11 +5846,8 @@
58499
58500 bp->irq_nvecs = msix_vecs;
58501 bp->flags |= BNX2_FLAG_USING_MSIX | BNX2_FLAG_ONE_SHOT_MSI;
58502 - for (i = 0; i < BNX2_MAX_MSIX_VEC; i++) {
58503 + for (i = 0; i < BNX2_MAX_MSIX_VEC; i++)
58504 bp->irq_tbl[i].vector = msix_ent[i].vector;
58505 - snprintf(bp->irq_tbl[i].name, len, "%s-%d", dev->name, i);
58506 - bp->irq_tbl[i].handler = bnx2_msi_1shot;
58507 - }
58508 }
58509
58510 static void
58511 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/bnx2.h linux-2.6.29-rc3.owrt/drivers/net/bnx2.h
58512 --- linux-2.6.29.owrt/drivers/net/bnx2.h 2009-05-10 22:04:38.000000000 +0200
58513 +++ linux-2.6.29-rc3.owrt/drivers/net/bnx2.h 2009-05-10 23:48:28.000000000 +0200
58514 @@ -1,6 +1,6 @@
58515 /* bnx2.h: Broadcom NX2 network driver.
58516 *
58517 - * Copyright (c) 2004-2009 Broadcom Corporation
58518 + * Copyright (c) 2004-2007 Broadcom Corporation
58519 *
58520 * This program is free software; you can redistribute it and/or modify
58521 * it under the terms of the GNU General Public License as published by
58522 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/bnx2x.h linux-2.6.29-rc3.owrt/drivers/net/bnx2x.h
58523 --- linux-2.6.29.owrt/drivers/net/bnx2x.h 2009-05-10 22:04:38.000000000 +0200
58524 +++ linux-2.6.29-rc3.owrt/drivers/net/bnx2x.h 2009-05-10 23:48:28.000000000 +0200
58525 @@ -152,7 +152,7 @@
58526 #define PAGES_PER_SGE (1 << PAGES_PER_SGE_SHIFT)
58527 #define SGE_PAGE_SIZE PAGE_SIZE
58528 #define SGE_PAGE_SHIFT PAGE_SHIFT
58529 -#define SGE_PAGE_ALIGN(addr) PAGE_ALIGN((typeof(PAGE_SIZE))addr)
58530 +#define SGE_PAGE_ALIGN(addr) PAGE_ALIGN(addr)
58531
58532 #define BCM_RX_ETH_PAYLOAD_ALIGN 64
58533
58534 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/bnx2x_init.h linux-2.6.29-rc3.owrt/drivers/net/bnx2x_init.h
58535 --- linux-2.6.29.owrt/drivers/net/bnx2x_init.h 2009-05-10 22:04:38.000000000 +0200
58536 +++ linux-2.6.29-rc3.owrt/drivers/net/bnx2x_init.h 2009-05-10 23:48:28.000000000 +0200
58537 @@ -150,6 +150,7 @@
58538
58539 static void bnx2x_write_big_buf(struct bnx2x *bp, u32 addr, u32 len)
58540 {
58541 +#ifdef USE_DMAE
58542 int offset = 0;
58543
58544 if (bp->dmae_ready) {
58545 @@ -163,6 +164,9 @@
58546 addr + offset, len);
58547 } else
58548 bnx2x_init_str_wr(bp, addr, bp->gunzip_buf, len);
58549 +#else
58550 + bnx2x_init_str_wr(bp, addr, bp->gunzip_buf, len);
58551 +#endif
58552 }
58553
58554 static void bnx2x_init_fill(struct bnx2x *bp, u32 addr, int fill, u32 len)
58555 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/bnx2x_main.c linux-2.6.29-rc3.owrt/drivers/net/bnx2x_main.c
58556 --- linux-2.6.29.owrt/drivers/net/bnx2x_main.c 2009-05-10 22:04:38.000000000 +0200
58557 +++ linux-2.6.29-rc3.owrt/drivers/net/bnx2x_main.c 2009-05-10 23:48:28.000000000 +0200
58558 @@ -57,7 +57,7 @@
58559 #include "bnx2x.h"
58560 #include "bnx2x_init.h"
58561
58562 -#define DRV_MODULE_VERSION "1.45.27"
58563 +#define DRV_MODULE_VERSION "1.45.26"
58564 #define DRV_MODULE_RELDATE "2009/01/26"
58565 #define BNX2X_BC_VER 0x040200
58566
58567 @@ -4035,10 +4035,10 @@
58568 {
58569 int port = BP_PORT(bp);
58570
58571 - bnx2x_init_fill(bp, USTORM_INTMEM_ADDR +
58572 + bnx2x_init_fill(bp, BAR_USTRORM_INTMEM +
58573 USTORM_SB_HOST_STATUS_BLOCK_OFFSET(port, sb_id), 0,
58574 sizeof(struct ustorm_status_block)/4);
58575 - bnx2x_init_fill(bp, CSTORM_INTMEM_ADDR +
58576 + bnx2x_init_fill(bp, BAR_CSTRORM_INTMEM +
58577 CSTORM_SB_HOST_STATUS_BLOCK_OFFSET(port, sb_id), 0,
58578 sizeof(struct cstorm_status_block)/4);
58579 }
58580 @@ -4092,18 +4092,18 @@
58581 {
58582 int func = BP_FUNC(bp);
58583
58584 - bnx2x_init_fill(bp, TSTORM_INTMEM_ADDR +
58585 - TSTORM_DEF_SB_HOST_STATUS_BLOCK_OFFSET(func), 0,
58586 - sizeof(struct tstorm_def_status_block)/4);
58587 - bnx2x_init_fill(bp, USTORM_INTMEM_ADDR +
58588 + bnx2x_init_fill(bp, BAR_USTRORM_INTMEM +
58589 USTORM_DEF_SB_HOST_STATUS_BLOCK_OFFSET(func), 0,
58590 sizeof(struct ustorm_def_status_block)/4);
58591 - bnx2x_init_fill(bp, CSTORM_INTMEM_ADDR +
58592 + bnx2x_init_fill(bp, BAR_CSTRORM_INTMEM +
58593 CSTORM_DEF_SB_HOST_STATUS_BLOCK_OFFSET(func), 0,
58594 sizeof(struct cstorm_def_status_block)/4);
58595 - bnx2x_init_fill(bp, XSTORM_INTMEM_ADDR +
58596 + bnx2x_init_fill(bp, BAR_XSTRORM_INTMEM +
58597 XSTORM_DEF_SB_HOST_STATUS_BLOCK_OFFSET(func), 0,
58598 sizeof(struct xstorm_def_status_block)/4);
58599 + bnx2x_init_fill(bp, BAR_TSTRORM_INTMEM +
58600 + TSTORM_DEF_SB_HOST_STATUS_BLOCK_OFFSET(func), 0,
58601 + sizeof(struct tstorm_def_status_block)/4);
58602 }
58603
58604 static void bnx2x_init_def_sb(struct bnx2x *bp,
58605 @@ -4518,8 +4518,7 @@
58606 (USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_TPA |
58607 USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_SGE_RING);
58608 context->ustorm_st_context.common.sge_buff_size =
58609 - (u16)min((u32)SGE_PAGE_SIZE*PAGES_PER_SGE,
58610 - (u32)0xffff);
58611 + (u16)(BCM_PAGE_SIZE*PAGES_PER_SGE);
58612 context->ustorm_st_context.common.sge_page_base_hi =
58613 U64_HI(fp->rx_sge_mapping);
58614 context->ustorm_st_context.common.sge_page_base_lo =
58615 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/bonding/bond_main.c linux-2.6.29-rc3.owrt/drivers/net/bonding/bond_main.c
58616 --- linux-2.6.29.owrt/drivers/net/bonding/bond_main.c 2009-05-10 22:04:38.000000000 +0200
58617 +++ linux-2.6.29-rc3.owrt/drivers/net/bonding/bond_main.c 2009-05-10 23:48:28.000000000 +0200
58618 @@ -3537,26 +3537,11 @@
58619 }
58620 break;
58621 case NETDEV_CHANGE:
58622 - if (bond->params.mode == BOND_MODE_8023AD || bond_is_lb(bond)) {
58623 - struct slave *slave;
58624 -
58625 - slave = bond_get_slave_by_dev(bond, slave_dev);
58626 - if (slave) {
58627 - u16 old_speed = slave->speed;
58628 - u16 old_duplex = slave->duplex;
58629 -
58630 - bond_update_speed_duplex(slave);
58631 -
58632 - if (bond_is_lb(bond))
58633 - break;
58634 -
58635 - if (old_speed != slave->speed)
58636 - bond_3ad_adapter_speed_changed(slave);
58637 - if (old_duplex != slave->duplex)
58638 - bond_3ad_adapter_duplex_changed(slave);
58639 - }
58640 - }
58641 -
58642 + /*
58643 + * TODO: is this what we get if somebody
58644 + * sets up a hierarchical bond, then rmmod's
58645 + * one of the slave bonding devices?
58646 + */
58647 break;
58648 case NETDEV_DOWN:
58649 /*
58650 @@ -4128,7 +4113,7 @@
58651 const struct net_device_ops *slave_ops
58652 = slave->dev->netdev_ops;
58653 if (slave_ops->ndo_neigh_setup)
58654 - return slave_ops->ndo_neigh_setup(slave->dev, parms);
58655 + return slave_ops->ndo_neigh_setup(dev, parms);
58656 }
58657 return 0;
58658 }
58659 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/cassini.c linux-2.6.29-rc3.owrt/drivers/net/cassini.c
58660 --- linux-2.6.29.owrt/drivers/net/cassini.c 2009-05-10 22:04:38.000000000 +0200
58661 +++ linux-2.6.29-rc3.owrt/drivers/net/cassini.c 2009-05-10 23:48:28.000000000 +0200
58662 @@ -806,7 +806,7 @@
58663
58664 cas_phy_write(cp, MII_BMCR, BMCR_RESET);
58665 udelay(100);
58666 - while (--limit) {
58667 + while (limit--) {
58668 val = cas_phy_read(cp, MII_BMCR);
58669 if ((val & BMCR_RESET) == 0)
58670 break;
58671 @@ -979,7 +979,7 @@
58672 writel(val, cp->regs + REG_PCS_MII_CTRL);
58673
58674 limit = STOP_TRIES;
58675 - while (--limit > 0) {
58676 + while (limit-- > 0) {
58677 udelay(10);
58678 if ((readl(cp->regs + REG_PCS_MII_CTRL) &
58679 PCS_MII_RESET) == 0)
58680 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/cxgb3/cxgb3_main.c linux-2.6.29-rc3.owrt/drivers/net/cxgb3/cxgb3_main.c
58681 --- linux-2.6.29.owrt/drivers/net/cxgb3/cxgb3_main.c 2009-05-10 22:04:38.000000000 +0200
58682 +++ linux-2.6.29-rc3.owrt/drivers/net/cxgb3/cxgb3_main.c 2009-05-10 23:48:28.000000000 +0200
58683 @@ -90,7 +90,6 @@
58684 CH_DEVICE(0x30, 2), /* T3B10 */
58685 CH_DEVICE(0x31, 3), /* T3B20 */
58686 CH_DEVICE(0x32, 1), /* T3B02 */
58687 - CH_DEVICE(0x35, 6), /* T3C20-derived T3C10 */
58688 {0,}
58689 };
58690
58691 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/cxgb3/sge.c linux-2.6.29-rc3.owrt/drivers/net/cxgb3/sge.c
58692 --- linux-2.6.29.owrt/drivers/net/cxgb3/sge.c 2009-05-10 22:04:38.000000000 +0200
58693 +++ linux-2.6.29-rc3.owrt/drivers/net/cxgb3/sge.c 2009-05-10 23:48:28.000000000 +0200
58694 @@ -2276,7 +2276,8 @@
58695 } else if ((len = ntohl(r->len_cq)) != 0) {
58696 struct sge_fl *fl;
58697
58698 - lro &= eth && is_eth_tcp(rss_hi);
58699 + if (eth)
58700 + lro = qs->lro_enabled && is_eth_tcp(rss_hi);
58701
58702 fl = (len & F_RSPD_FLQ) ? &qs->fl[1] : &qs->fl[0];
58703 if (fl->use_pages) {
58704 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/cxgb3/t3_hw.c linux-2.6.29-rc3.owrt/drivers/net/cxgb3/t3_hw.c
58705 --- linux-2.6.29.owrt/drivers/net/cxgb3/t3_hw.c 2009-05-10 22:04:38.000000000 +0200
58706 +++ linux-2.6.29-rc3.owrt/drivers/net/cxgb3/t3_hw.c 2009-05-10 23:48:28.000000000 +0200
58707 @@ -512,13 +512,6 @@
58708 F_GPIO5_OUT_VAL | F_GPIO6_OUT_VAL | F_GPIO10_OUT_VAL,
58709 { S_GPIO9, S_GPIO3 }, SUPPORTED_10000baseT_Full | SUPPORTED_AUI,
58710 &mi1_mdio_ext_ops, "Chelsio T320"},
58711 - {},
58712 - {},
58713 - {1, 0,
58714 - F_GPIO1_OEN | F_GPIO2_OEN | F_GPIO4_OEN | F_GPIO6_OEN | F_GPIO7_OEN |
58715 - F_GPIO10_OEN | F_GPIO1_OUT_VAL | F_GPIO6_OUT_VAL | F_GPIO10_OUT_VAL,
58716 - { S_GPIO9 }, SUPPORTED_10000baseT_Full | SUPPORTED_AUI,
58717 - &mi1_mdio_ext_ops, "Chelsio T310" },
58718 };
58719
58720 /*
58721 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/dm9000.c linux-2.6.29-rc3.owrt/drivers/net/dm9000.c
58722 --- linux-2.6.29.owrt/drivers/net/dm9000.c 2009-05-10 22:04:38.000000000 +0200
58723 +++ linux-2.6.29-rc3.owrt/drivers/net/dm9000.c 2009-05-10 23:48:28.000000000 +0200
58724 @@ -930,15 +930,13 @@
58725 struct net_device *dev = dev_id;
58726 board_info_t *db = netdev_priv(dev);
58727 int int_status;
58728 - unsigned long flags;
58729 u8 reg_save;
58730
58731 dm9000_dbg(db, 3, "entering %s\n", __func__);
58732
58733 /* A real interrupt coming */
58734
58735 - /* holders of db->lock must always block IRQs */
58736 - spin_lock_irqsave(&db->lock, flags);
58737 + spin_lock(&db->lock);
58738
58739 /* Save previous register address */
58740 reg_save = readb(db->io_addr);
58741 @@ -974,7 +972,7 @@
58742 /* Restore previous register address */
58743 writeb(reg_save, db->io_addr);
58744
58745 - spin_unlock_irqrestore(&db->lock, flags);
58746 + spin_unlock(&db->lock);
58747
58748 return IRQ_HANDLED;
58749 }
58750 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/dnet.c linux-2.6.29-rc3.owrt/drivers/net/dnet.c
58751 --- linux-2.6.29.owrt/drivers/net/dnet.c 2009-05-10 22:04:38.000000000 +0200
58752 +++ linux-2.6.29-rc3.owrt/drivers/net/dnet.c 1970-01-01 01:00:00.000000000 +0100
58753 @@ -1,994 +0,0 @@
58754 -/*
58755 - * Dave DNET Ethernet Controller driver
58756 - *
58757 - * Copyright (C) 2008 Dave S.r.l. <www.dave.eu>
58758 - * Copyright (C) 2009 Ilya Yanok, Emcraft Systems Ltd, <yanok@emcraft.com>
58759 - *
58760 - * This program is free software; you can redistribute it and/or modify
58761 - * it under the terms of the GNU General Public License version 2 as
58762 - * published by the Free Software Foundation.
58763 - */
58764 -#include <linux/version.h>
58765 -#include <linux/module.h>
58766 -#include <linux/moduleparam.h>
58767 -#include <linux/kernel.h>
58768 -#include <linux/types.h>
58769 -#include <linux/slab.h>
58770 -#include <linux/delay.h>
58771 -#include <linux/init.h>
58772 -#include <linux/netdevice.h>
58773 -#include <linux/etherdevice.h>
58774 -#include <linux/dma-mapping.h>
58775 -#include <linux/platform_device.h>
58776 -#include <linux/phy.h>
58777 -#include <linux/platform_device.h>
58778 -
58779 -#include "dnet.h"
58780 -
58781 -#undef DEBUG
58782 -
58783 -/* function for reading internal MAC register */
58784 -u16 dnet_readw_mac(struct dnet *bp, u16 reg)
58785 -{
58786 - u16 data_read;
58787 -
58788 - /* issue a read */
58789 - dnet_writel(bp, reg, MACREG_ADDR);
58790 -
58791 - /* since a read/write op to the MAC is very slow,
58792 - * we must wait before reading the data */
58793 - ndelay(500);
58794 -
58795 - /* read data read from the MAC register */
58796 - data_read = dnet_readl(bp, MACREG_DATA);
58797 -
58798 - /* all done */
58799 - return data_read;
58800 -}
58801 -
58802 -/* function for writing internal MAC register */
58803 -void dnet_writew_mac(struct dnet *bp, u16 reg, u16 val)
58804 -{
58805 - /* load data to write */
58806 - dnet_writel(bp, val, MACREG_DATA);
58807 -
58808 - /* issue a write */
58809 - dnet_writel(bp, reg | DNET_INTERNAL_WRITE, MACREG_ADDR);
58810 -
58811 - /* since a read/write op to the MAC is very slow,
58812 - * we must wait before exiting */
58813 - ndelay(500);
58814 -}
58815 -
58816 -static void __dnet_set_hwaddr(struct dnet *bp)
58817 -{
58818 - u16 tmp;
58819 -
58820 - tmp = cpu_to_be16(*((u16 *) bp->dev->dev_addr));
58821 - dnet_writew_mac(bp, DNET_INTERNAL_MAC_ADDR_0_REG, tmp);
58822 - tmp = cpu_to_be16(*((u16 *) (bp->dev->dev_addr + 2)));
58823 - dnet_writew_mac(bp, DNET_INTERNAL_MAC_ADDR_1_REG, tmp);
58824 - tmp = cpu_to_be16(*((u16 *) (bp->dev->dev_addr + 4)));
58825 - dnet_writew_mac(bp, DNET_INTERNAL_MAC_ADDR_2_REG, tmp);
58826 -}
58827 -
58828 -static void __devinit dnet_get_hwaddr(struct dnet *bp)
58829 -{
58830 - u16 tmp;
58831 - u8 addr[6];
58832 -
58833 - /*
58834 - * from MAC docs:
58835 - * "Note that the MAC address is stored in the registers in Hexadecimal
58836 - * form. For example, to set the MAC Address to: AC-DE-48-00-00-80
58837 - * would require writing 0xAC (octet 0) to address 0x0B (high byte of
58838 - * Mac_addr[15:0]), 0xDE (octet 1) to address 0x0A (Low byte of
58839 - * Mac_addr[15:0]), 0x48 (octet 2) to address 0x0D (high byte of
58840 - * Mac_addr[15:0]), 0x00 (octet 3) to address 0x0C (Low byte of
58841 - * Mac_addr[15:0]), 0x00 (octet 4) to address 0x0F (high byte of
58842 - * Mac_addr[15:0]), and 0x80 (octet 5) to address * 0x0E (Low byte of
58843 - * Mac_addr[15:0]).
58844 - */
58845 - tmp = dnet_readw_mac(bp, DNET_INTERNAL_MAC_ADDR_0_REG);
58846 - *((u16 *) addr) = be16_to_cpu(tmp);
58847 - tmp = dnet_readw_mac(bp, DNET_INTERNAL_MAC_ADDR_1_REG);
58848 - *((u16 *) (addr + 2)) = be16_to_cpu(tmp);
58849 - tmp = dnet_readw_mac(bp, DNET_INTERNAL_MAC_ADDR_2_REG);
58850 - *((u16 *) (addr + 4)) = be16_to_cpu(tmp);
58851 -
58852 - if (is_valid_ether_addr(addr))
58853 - memcpy(bp->dev->dev_addr, addr, sizeof(addr));
58854 -}
58855 -
58856 -static int dnet_mdio_read(struct mii_bus *bus, int mii_id, int regnum)
58857 -{
58858 - struct dnet *bp = bus->priv;
58859 - u16 value;
58860 -
58861 - while (!(dnet_readw_mac(bp, DNET_INTERNAL_GMII_MNG_CTL_REG)
58862 - & DNET_INTERNAL_GMII_MNG_CMD_FIN))
58863 - cpu_relax();
58864 -
58865 - /* only 5 bits allowed for phy-addr and reg_offset */
58866 - mii_id &= 0x1f;
58867 - regnum &= 0x1f;
58868 -
58869 - /* prepare reg_value for a read */
58870 - value = (mii_id << 8);
58871 - value |= regnum;
58872 -
58873 - /* write control word */
58874 - dnet_writew_mac(bp, DNET_INTERNAL_GMII_MNG_CTL_REG, value);
58875 -
58876 - /* wait for end of transfer */
58877 - while (!(dnet_readw_mac(bp, DNET_INTERNAL_GMII_MNG_CTL_REG)
58878 - & DNET_INTERNAL_GMII_MNG_CMD_FIN))
58879 - cpu_relax();
58880 -
58881 - value = dnet_readw_mac(bp, DNET_INTERNAL_GMII_MNG_DAT_REG);
58882 -
58883 - pr_debug("mdio_read %02x:%02x <- %04x\n", mii_id, regnum, value);
58884 -
58885 - return value;
58886 -}
58887 -
58888 -static int dnet_mdio_write(struct mii_bus *bus, int mii_id, int regnum,
58889 - u16 value)
58890 -{
58891 - struct dnet *bp = bus->priv;
58892 - u16 tmp;
58893 -
58894 - pr_debug("mdio_write %02x:%02x <- %04x\n", mii_id, regnum, value);
58895 -
58896 - while (!(dnet_readw_mac(bp, DNET_INTERNAL_GMII_MNG_CTL_REG)
58897 - & DNET_INTERNAL_GMII_MNG_CMD_FIN))
58898 - cpu_relax();
58899 -
58900 - /* prepare for a write operation */
58901 - tmp = (1 << 13);
58902 -
58903 - /* only 5 bits allowed for phy-addr and reg_offset */
58904 - mii_id &= 0x1f;
58905 - regnum &= 0x1f;
58906 -
58907 - /* only 16 bits on data */
58908 - value &= 0xffff;
58909 -
58910 - /* prepare reg_value for a write */
58911 - tmp |= (mii_id << 8);
58912 - tmp |= regnum;
58913 -
58914 - /* write data to write first */
58915 - dnet_writew_mac(bp, DNET_INTERNAL_GMII_MNG_DAT_REG, value);
58916 -
58917 - /* write control word */
58918 - dnet_writew_mac(bp, DNET_INTERNAL_GMII_MNG_CTL_REG, tmp);
58919 -
58920 - while (!(dnet_readw_mac(bp, DNET_INTERNAL_GMII_MNG_CTL_REG)
58921 - & DNET_INTERNAL_GMII_MNG_CMD_FIN))
58922 - cpu_relax();
58923 -
58924 - return 0;
58925 -}
58926 -
58927 -static int dnet_mdio_reset(struct mii_bus *bus)
58928 -{
58929 - return 0;
58930 -}
58931 -
58932 -static void dnet_handle_link_change(struct net_device *dev)
58933 -{
58934 - struct dnet *bp = netdev_priv(dev);
58935 - struct phy_device *phydev = bp->phy_dev;
58936 - unsigned long flags;
58937 - u32 mode_reg, ctl_reg;
58938 -
58939 - int status_change = 0;
58940 -
58941 - spin_lock_irqsave(&bp->lock, flags);
58942 -
58943 - mode_reg = dnet_readw_mac(bp, DNET_INTERNAL_MODE_REG);
58944 - ctl_reg = dnet_readw_mac(bp, DNET_INTERNAL_RXTX_CONTROL_REG);
58945 -
58946 - if (phydev->link) {
58947 - if (bp->duplex != phydev->duplex) {
58948 - if (phydev->duplex)
58949 - ctl_reg &=
58950 - ~(DNET_INTERNAL_RXTX_CONTROL_ENABLEHALFDUP);
58951 - else
58952 - ctl_reg |=
58953 - DNET_INTERNAL_RXTX_CONTROL_ENABLEHALFDUP;
58954 -
58955 - bp->duplex = phydev->duplex;
58956 - status_change = 1;
58957 - }
58958 -
58959 - if (bp->speed != phydev->speed) {
58960 - status_change = 1;
58961 - switch (phydev->speed) {
58962 - case 1000:
58963 - mode_reg |= DNET_INTERNAL_MODE_GBITEN;
58964 - break;
58965 - case 100:
58966 - case 10:
58967 - mode_reg &= ~DNET_INTERNAL_MODE_GBITEN;
58968 - break;
58969 - default:
58970 - printk(KERN_WARNING
58971 - "%s: Ack! Speed (%d) is not "
58972 - "10/100/1000!\n", dev->name,
58973 - phydev->speed);
58974 - break;
58975 - }
58976 - bp->speed = phydev->speed;
58977 - }
58978 - }
58979 -
58980 - if (phydev->link != bp->link) {
58981 - if (phydev->link) {
58982 - mode_reg |=
58983 - (DNET_INTERNAL_MODE_RXEN | DNET_INTERNAL_MODE_TXEN);
58984 - } else {
58985 - mode_reg &=
58986 - ~(DNET_INTERNAL_MODE_RXEN |
58987 - DNET_INTERNAL_MODE_TXEN);
58988 - bp->speed = 0;
58989 - bp->duplex = -1;
58990 - }
58991 - bp->link = phydev->link;
58992 -
58993 - status_change = 1;
58994 - }
58995 -
58996 - if (status_change) {
58997 - dnet_writew_mac(bp, DNET_INTERNAL_RXTX_CONTROL_REG, ctl_reg);
58998 - dnet_writew_mac(bp, DNET_INTERNAL_MODE_REG, mode_reg);
58999 - }
59000 -
59001 - spin_unlock_irqrestore(&bp->lock, flags);
59002 -
59003 - if (status_change) {
59004 - if (phydev->link)
59005 - printk(KERN_INFO "%s: link up (%d/%s)\n",
59006 - dev->name, phydev->speed,
59007 - DUPLEX_FULL == phydev->duplex ? "Full" : "Half");
59008 - else
59009 - printk(KERN_INFO "%s: link down\n", dev->name);
59010 - }
59011 -}
59012 -
59013 -static int dnet_mii_probe(struct net_device *dev)
59014 -{
59015 - struct dnet *bp = netdev_priv(dev);
59016 - struct phy_device *phydev = NULL;
59017 - int phy_addr;
59018 -
59019 - /* find the first phy */
59020 - for (phy_addr = 0; phy_addr < PHY_MAX_ADDR; phy_addr++) {
59021 - if (bp->mii_bus->phy_map[phy_addr]) {
59022 - phydev = bp->mii_bus->phy_map[phy_addr];
59023 - break;
59024 - }
59025 - }
59026 -
59027 - if (!phydev) {
59028 - printk(KERN_ERR "%s: no PHY found\n", dev->name);
59029 - return -ENODEV;
59030 - }
59031 -
59032 - /* TODO : add pin_irq */
59033 -
59034 - /* attach the mac to the phy */
59035 - if (bp->capabilities & DNET_HAS_RMII) {
59036 - phydev = phy_connect(dev, dev_name(&phydev->dev),
59037 - &dnet_handle_link_change, 0,
59038 - PHY_INTERFACE_MODE_RMII);
59039 - } else {
59040 - phydev = phy_connect(dev, dev_name(&phydev->dev),
59041 - &dnet_handle_link_change, 0,
59042 - PHY_INTERFACE_MODE_MII);
59043 - }
59044 -
59045 - if (IS_ERR(phydev)) {
59046 - printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name);
59047 - return PTR_ERR(phydev);
59048 - }
59049 -
59050 - /* mask with MAC supported features */
59051 - if (bp->capabilities & DNET_HAS_GIGABIT)
59052 - phydev->supported &= PHY_GBIT_FEATURES;
59053 - else
59054 - phydev->supported &= PHY_BASIC_FEATURES;
59055 -
59056 - phydev->supported |= SUPPORTED_Asym_Pause | SUPPORTED_Pause;
59057 -
59058 - phydev->advertising = phydev->supported;
59059 -
59060 - bp->link = 0;
59061 - bp->speed = 0;
59062 - bp->duplex = -1;
59063 - bp->phy_dev = phydev;
59064 -
59065 - return 0;
59066 -}
59067 -
59068 -static int dnet_mii_init(struct dnet *bp)
59069 -{
59070 - int err, i;
59071 -
59072 - bp->mii_bus = mdiobus_alloc();
59073 - if (bp->mii_bus == NULL)
59074 - return -ENOMEM;
59075 -
59076 - bp->mii_bus->name = "dnet_mii_bus";
59077 - bp->mii_bus->read = &dnet_mdio_read;
59078 - bp->mii_bus->write = &dnet_mdio_write;
59079 - bp->mii_bus->reset = &dnet_mdio_reset;
59080 -
59081 - snprintf(bp->mii_bus->id, MII_BUS_ID_SIZE, "%x", 0);
59082 -
59083 - bp->mii_bus->priv = bp;
59084 -
59085 - bp->mii_bus->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL);
59086 - if (!bp->mii_bus->irq) {
59087 - err = -ENOMEM;
59088 - goto err_out;
59089 - }
59090 -
59091 - for (i = 0; i < PHY_MAX_ADDR; i++)
59092 - bp->mii_bus->irq[i] = PHY_POLL;
59093 -
59094 - platform_set_drvdata(bp->dev, bp->mii_bus);
59095 -
59096 - if (mdiobus_register(bp->mii_bus)) {
59097 - err = -ENXIO;
59098 - goto err_out_free_mdio_irq;
59099 - }
59100 -
59101 - if (dnet_mii_probe(bp->dev) != 0) {
59102 - err = -ENXIO;
59103 - goto err_out_unregister_bus;
59104 - }
59105 -
59106 - return 0;
59107 -
59108 -err_out_unregister_bus:
59109 - mdiobus_unregister(bp->mii_bus);
59110 -err_out_free_mdio_irq:
59111 - kfree(bp->mii_bus->irq);
59112 -err_out:
59113 - mdiobus_free(bp->mii_bus);
59114 - return err;
59115 -}
59116 -
59117 -/* For Neptune board: LINK1000 as Link LED and TX as activity LED */
59118 -int dnet_phy_marvell_fixup(struct phy_device *phydev)
59119 -{
59120 - return phy_write(phydev, 0x18, 0x4148);
59121 -}
59122 -
59123 -static void dnet_update_stats(struct dnet *bp)
59124 -{
59125 - u32 __iomem *reg = bp->regs + DNET_RX_PKT_IGNR_CNT;
59126 - u32 *p = &bp->hw_stats.rx_pkt_ignr;
59127 - u32 *end = &bp->hw_stats.rx_byte + 1;
59128 -
59129 - WARN_ON((unsigned long)(end - p - 1) !=
59130 - (DNET_RX_BYTE_CNT - DNET_RX_PKT_IGNR_CNT) / 4);
59131 -
59132 - for (; p < end; p++, reg++)
59133 - *p += readl(reg);
59134 -
59135 - reg = bp->regs + DNET_TX_UNICAST_CNT;
59136 - p = &bp->hw_stats.tx_unicast;
59137 - end = &bp->hw_stats.tx_byte + 1;
59138 -
59139 - WARN_ON((unsigned long)(end - p - 1) !=
59140 - (DNET_TX_BYTE_CNT - DNET_TX_UNICAST_CNT) / 4);
59141 -
59142 - for (; p < end; p++, reg++)
59143 - *p += readl(reg);
59144 -}
59145 -
59146 -static int dnet_poll(struct napi_struct *napi, int budget)
59147 -{
59148 - struct dnet *bp = container_of(napi, struct dnet, napi);
59149 - struct net_device *dev = bp->dev;
59150 - int npackets = 0;
59151 - unsigned int pkt_len;
59152 - struct sk_buff *skb;
59153 - unsigned int *data_ptr;
59154 - u32 int_enable;
59155 - u32 cmd_word;
59156 - int i;
59157 -
59158 - while (npackets < budget) {
59159 - /*
59160 - * break out of while loop if there are no more
59161 - * packets waiting
59162 - */
59163 - if (!(dnet_readl(bp, RX_FIFO_WCNT) >> 16)) {
59164 - napi_complete(napi);
59165 - int_enable = dnet_readl(bp, INTR_ENB);
59166 - int_enable |= DNET_INTR_SRC_RX_CMDFIFOAF;
59167 - dnet_writel(bp, int_enable, INTR_ENB);
59168 - return 0;
59169 - }
59170 -
59171 - cmd_word = dnet_readl(bp, RX_LEN_FIFO);
59172 - pkt_len = cmd_word & 0xFFFF;
59173 -
59174 - if (cmd_word & 0xDF180000)
59175 - printk(KERN_ERR "%s packet receive error %x\n",
59176 - __func__, cmd_word);
59177 -
59178 - skb = dev_alloc_skb(pkt_len + 5);
59179 - if (skb != NULL) {
59180 - /* Align IP on 16 byte boundaries */
59181 - skb_reserve(skb, 2);
59182 - /*
59183 - * 'skb_put()' points to the start of sk_buff
59184 - * data area.
59185 - */
59186 - data_ptr = (unsigned int *)skb_put(skb, pkt_len);
59187 - for (i = 0; i < (pkt_len + 3) >> 2; i++)
59188 - *data_ptr++ = dnet_readl(bp, RX_DATA_FIFO);
59189 - skb->protocol = eth_type_trans(skb, dev);
59190 - netif_receive_skb(skb);
59191 - npackets++;
59192 - } else
59193 - printk(KERN_NOTICE
59194 - "%s: No memory to allocate a sk_buff of "
59195 - "size %u.\n", dev->name, pkt_len);
59196 - }
59197 -
59198 - budget -= npackets;
59199 -
59200 - if (npackets < budget) {
59201 - /* We processed all packets available. Tell NAPI it can
59202 - * stop polling then re-enable rx interrupts */
59203 - napi_complete(napi);
59204 - int_enable = dnet_readl(bp, INTR_ENB);
59205 - int_enable |= DNET_INTR_SRC_RX_CMDFIFOAF;
59206 - dnet_writel(bp, int_enable, INTR_ENB);
59207 - return 0;
59208 - }
59209 -
59210 - /* There are still packets waiting */
59211 - return 1;
59212 -}
59213 -
59214 -static irqreturn_t dnet_interrupt(int irq, void *dev_id)
59215 -{
59216 - struct net_device *dev = dev_id;
59217 - struct dnet *bp = netdev_priv(dev);
59218 - u32 int_src, int_enable, int_current;
59219 - unsigned long flags;
59220 - unsigned int handled = 0;
59221 -
59222 - spin_lock_irqsave(&bp->lock, flags);
59223 -
59224 - /* read and clear the DNET irq (clear on read) */
59225 - int_src = dnet_readl(bp, INTR_SRC);
59226 - int_enable = dnet_readl(bp, INTR_ENB);
59227 - int_current = int_src & int_enable;
59228 -
59229 - /* restart the queue if we had stopped it for TX fifo almost full */
59230 - if (int_current & DNET_INTR_SRC_TX_FIFOAE) {
59231 - int_enable = dnet_readl(bp, INTR_ENB);
59232 - int_enable &= ~DNET_INTR_ENB_TX_FIFOAE;
59233 - dnet_writel(bp, int_enable, INTR_ENB);
59234 - netif_wake_queue(dev);
59235 - handled = 1;
59236 - }
59237 -
59238 - /* RX FIFO error checking */
59239 - if (int_current &
59240 - (DNET_INTR_SRC_RX_CMDFIFOFF | DNET_INTR_SRC_RX_DATAFIFOFF)) {
59241 - printk(KERN_ERR "%s: RX fifo error %x, irq %x\n", __func__,
59242 - dnet_readl(bp, RX_STATUS), int_current);
59243 - /* we can only flush the RX FIFOs */
59244 - dnet_writel(bp, DNET_SYS_CTL_RXFIFOFLUSH, SYS_CTL);
59245 - ndelay(500);
59246 - dnet_writel(bp, 0, SYS_CTL);
59247 - handled = 1;
59248 - }
59249 -
59250 - /* TX FIFO error checking */
59251 - if (int_current &
59252 - (DNET_INTR_SRC_TX_FIFOFULL | DNET_INTR_SRC_TX_DISCFRM)) {
59253 - printk(KERN_ERR "%s: TX fifo error %x, irq %x\n", __func__,
59254 - dnet_readl(bp, TX_STATUS), int_current);
59255 - /* we can only flush the TX FIFOs */
59256 - dnet_writel(bp, DNET_SYS_CTL_TXFIFOFLUSH, SYS_CTL);
59257 - ndelay(500);
59258 - dnet_writel(bp, 0, SYS_CTL);
59259 - handled = 1;
59260 - }
59261 -
59262 - if (int_current & DNET_INTR_SRC_RX_CMDFIFOAF) {
59263 - if (napi_schedule_prep(&bp->napi)) {
59264 - /*
59265 - * There's no point taking any more interrupts
59266 - * until we have processed the buffers
59267 - */
59268 - /* Disable Rx interrupts and schedule NAPI poll */
59269 - int_enable = dnet_readl(bp, INTR_ENB);
59270 - int_enable &= ~DNET_INTR_SRC_RX_CMDFIFOAF;
59271 - dnet_writel(bp, int_enable, INTR_ENB);
59272 - __napi_schedule(&bp->napi);
59273 - }
59274 - handled = 1;
59275 - }
59276 -
59277 - if (!handled)
59278 - pr_debug("%s: irq %x remains\n", __func__, int_current);
59279 -
59280 - spin_unlock_irqrestore(&bp->lock, flags);
59281 -
59282 - return IRQ_RETVAL(handled);
59283 -}
59284 -
59285 -#ifdef DEBUG
59286 -static inline void dnet_print_skb(struct sk_buff *skb)
59287 -{
59288 - int k;
59289 - printk(KERN_DEBUG PFX "data:");
59290 - for (k = 0; k < skb->len; k++)
59291 - printk(" %02x", (unsigned int)skb->data[k]);
59292 - printk("\n");
59293 -}
59294 -#else
59295 -#define dnet_print_skb(skb) do {} while (0)
59296 -#endif
59297 -
59298 -static int dnet_start_xmit(struct sk_buff *skb, struct net_device *dev)
59299 -{
59300 -
59301 - struct dnet *bp = netdev_priv(dev);
59302 - u32 tx_status, irq_enable;
59303 - unsigned int len, i, tx_cmd, wrsz;
59304 - unsigned long flags;
59305 - unsigned int *bufp;
59306 -
59307 - tx_status = dnet_readl(bp, TX_STATUS);
59308 -
59309 - pr_debug("start_xmit: len %u head %p data %p\n",
59310 - skb->len, skb->head, skb->data);
59311 - dnet_print_skb(skb);
59312 -
59313 - /* frame size (words) */
59314 - len = (skb->len + 3) >> 2;
59315 -
59316 - spin_lock_irqsave(&bp->lock, flags);
59317 -
59318 - tx_status = dnet_readl(bp, TX_STATUS);
59319 -
59320 - bufp = (unsigned int *)(((unsigned long) skb->data) & ~0x3UL);
59321 - wrsz = (u32) skb->len + 3;
59322 - wrsz += ((unsigned long) skb->data) & 0x3;
59323 - wrsz >>= 2;
59324 - tx_cmd = ((((unsigned long)(skb->data)) & 0x03) << 16) | (u32) skb->len;
59325 -
59326 - /* check if there is enough room for the current frame */
59327 - if (wrsz < (DNET_FIFO_SIZE - dnet_readl(bp, TX_FIFO_WCNT))) {
59328 - for (i = 0; i < wrsz; i++)
59329 - dnet_writel(bp, *bufp++, TX_DATA_FIFO);
59330 -
59331 - /*
59332 - * inform MAC that a packet's written and ready to be
59333 - * shipped out
59334 - */
59335 - dnet_writel(bp, tx_cmd, TX_LEN_FIFO);
59336 - }
59337 -
59338 - if (dnet_readl(bp, TX_FIFO_WCNT) > DNET_FIFO_TX_DATA_AF_TH) {
59339 - netif_stop_queue(dev);
59340 - tx_status = dnet_readl(bp, INTR_SRC);
59341 - irq_enable = dnet_readl(bp, INTR_ENB);
59342 - irq_enable |= DNET_INTR_ENB_TX_FIFOAE;
59343 - dnet_writel(bp, irq_enable, INTR_ENB);
59344 - }
59345 -
59346 - /* free the buffer */
59347 - dev_kfree_skb(skb);
59348 -
59349 - spin_unlock_irqrestore(&bp->lock, flags);
59350 -
59351 - dev->trans_start = jiffies;
59352 -
59353 - return 0;
59354 -}
59355 -
59356 -static void dnet_reset_hw(struct dnet *bp)
59357 -{
59358 - /* put ts_mac in IDLE state i.e. disable rx/tx */
59359 - dnet_writew_mac(bp, DNET_INTERNAL_MODE_REG, DNET_INTERNAL_MODE_FCEN);
59360 -
59361 - /*
59362 - * RX FIFO almost full threshold: only cmd FIFO almost full is
59363 - * implemented for RX side
59364 - */
59365 - dnet_writel(bp, DNET_FIFO_RX_CMD_AF_TH, RX_FIFO_TH);
59366 - /*
59367 - * TX FIFO almost empty threshold: only data FIFO almost empty
59368 - * is implemented for TX side
59369 - */
59370 - dnet_writel(bp, DNET_FIFO_TX_DATA_AE_TH, TX_FIFO_TH);
59371 -
59372 - /* flush rx/tx fifos */
59373 - dnet_writel(bp, DNET_SYS_CTL_RXFIFOFLUSH | DNET_SYS_CTL_TXFIFOFLUSH,
59374 - SYS_CTL);
59375 - msleep(1);
59376 - dnet_writel(bp, 0, SYS_CTL);
59377 -}
59378 -
59379 -static void dnet_init_hw(struct dnet *bp)
59380 -{
59381 - u32 config;
59382 -
59383 - dnet_reset_hw(bp);
59384 - __dnet_set_hwaddr(bp);
59385 -
59386 - config = dnet_readw_mac(bp, DNET_INTERNAL_RXTX_CONTROL_REG);
59387 -
59388 - if (bp->dev->flags & IFF_PROMISC)
59389 - /* Copy All Frames */
59390 - config |= DNET_INTERNAL_RXTX_CONTROL_ENPROMISC;
59391 - if (!(bp->dev->flags & IFF_BROADCAST))
59392 - /* No BroadCast */
59393 - config |= DNET_INTERNAL_RXTX_CONTROL_RXMULTICAST;
59394 -
59395 - config |= DNET_INTERNAL_RXTX_CONTROL_RXPAUSE |
59396 - DNET_INTERNAL_RXTX_CONTROL_RXBROADCAST |
59397 - DNET_INTERNAL_RXTX_CONTROL_DROPCONTROL |
59398 - DNET_INTERNAL_RXTX_CONTROL_DISCFXFCS;
59399 -
59400 - dnet_writew_mac(bp, DNET_INTERNAL_RXTX_CONTROL_REG, config);
59401 -
59402 - /* clear irq before enabling them */
59403 - config = dnet_readl(bp, INTR_SRC);
59404 -
59405 - /* enable RX/TX interrupt, recv packet ready interrupt */
59406 - dnet_writel(bp, DNET_INTR_ENB_GLOBAL_ENABLE | DNET_INTR_ENB_RX_SUMMARY |
59407 - DNET_INTR_ENB_TX_SUMMARY | DNET_INTR_ENB_RX_FIFOERR |
59408 - DNET_INTR_ENB_RX_ERROR | DNET_INTR_ENB_RX_FIFOFULL |
59409 - DNET_INTR_ENB_TX_FIFOFULL | DNET_INTR_ENB_TX_DISCFRM |
59410 - DNET_INTR_ENB_RX_PKTRDY, INTR_ENB);
59411 -}
59412 -
59413 -static int dnet_open(struct net_device *dev)
59414 -{
59415 - struct dnet *bp = netdev_priv(dev);
59416 -
59417 - /* if the phy is not yet register, retry later */
59418 - if (!bp->phy_dev)
59419 - return -EAGAIN;
59420 -
59421 - if (!is_valid_ether_addr(dev->dev_addr))
59422 - return -EADDRNOTAVAIL;
59423 -
59424 - napi_enable(&bp->napi);
59425 - dnet_init_hw(bp);
59426 -
59427 - phy_start_aneg(bp->phy_dev);
59428 -
59429 - /* schedule a link state check */
59430 - phy_start(bp->phy_dev);
59431 -
59432 - netif_start_queue(dev);
59433 -
59434 - return 0;
59435 -}
59436 -
59437 -static int dnet_close(struct net_device *dev)
59438 -{
59439 - struct dnet *bp = netdev_priv(dev);
59440 -
59441 - netif_stop_queue(dev);
59442 - napi_disable(&bp->napi);
59443 -
59444 - if (bp->phy_dev)
59445 - phy_stop(bp->phy_dev);
59446 -
59447 - dnet_reset_hw(bp);
59448 - netif_carrier_off(dev);
59449 -
59450 - return 0;
59451 -}
59452 -
59453 -static inline void dnet_print_pretty_hwstats(struct dnet_stats *hwstat)
59454 -{
59455 - pr_debug("%s\n", __func__);
59456 - pr_debug("----------------------------- RX statistics "
59457 - "-------------------------------\n");
59458 - pr_debug("RX_PKT_IGNR_CNT %-8x\n", hwstat->rx_pkt_ignr);
59459 - pr_debug("RX_LEN_CHK_ERR_CNT %-8x\n", hwstat->rx_len_chk_err);
59460 - pr_debug("RX_LNG_FRM_CNT %-8x\n", hwstat->rx_lng_frm);
59461 - pr_debug("RX_SHRT_FRM_CNT %-8x\n", hwstat->rx_shrt_frm);
59462 - pr_debug("RX_IPG_VIOL_CNT %-8x\n", hwstat->rx_ipg_viol);
59463 - pr_debug("RX_CRC_ERR_CNT %-8x\n", hwstat->rx_crc_err);
59464 - pr_debug("RX_OK_PKT_CNT %-8x\n", hwstat->rx_ok_pkt);
59465 - pr_debug("RX_CTL_FRM_CNT %-8x\n", hwstat->rx_ctl_frm);
59466 - pr_debug("RX_PAUSE_FRM_CNT %-8x\n", hwstat->rx_pause_frm);
59467 - pr_debug("RX_MULTICAST_CNT %-8x\n", hwstat->rx_multicast);
59468 - pr_debug("RX_BROADCAST_CNT %-8x\n", hwstat->rx_broadcast);
59469 - pr_debug("RX_VLAN_TAG_CNT %-8x\n", hwstat->rx_vlan_tag);
59470 - pr_debug("RX_PRE_SHRINK_CNT %-8x\n", hwstat->rx_pre_shrink);
59471 - pr_debug("RX_DRIB_NIB_CNT %-8x\n", hwstat->rx_drib_nib);
59472 - pr_debug("RX_UNSUP_OPCD_CNT %-8x\n", hwstat->rx_unsup_opcd);
59473 - pr_debug("RX_BYTE_CNT %-8x\n", hwstat->rx_byte);
59474 - pr_debug("----------------------------- TX statistics "
59475 - "-------------------------------\n");
59476 - pr_debug("TX_UNICAST_CNT %-8x\n", hwstat->tx_unicast);
59477 - pr_debug("TX_PAUSE_FRM_CNT %-8x\n", hwstat->tx_pause_frm);
59478 - pr_debug("TX_MULTICAST_CNT %-8x\n", hwstat->tx_multicast);
59479 - pr_debug("TX_BRDCAST_CNT %-8x\n", hwstat->tx_brdcast);
59480 - pr_debug("TX_VLAN_TAG_CNT %-8x\n", hwstat->tx_vlan_tag);
59481 - pr_debug("TX_BAD_FCS_CNT %-8x\n", hwstat->tx_bad_fcs);
59482 - pr_debug("TX_JUMBO_CNT %-8x\n", hwstat->tx_jumbo);
59483 - pr_debug("TX_BYTE_CNT %-8x\n", hwstat->tx_byte);
59484 -}
59485 -
59486 -static struct net_device_stats *dnet_get_stats(struct net_device *dev)
59487 -{
59488 -
59489 - struct dnet *bp = netdev_priv(dev);
59490 - struct net_device_stats *nstat = &dev->stats;
59491 - struct dnet_stats *hwstat = &bp->hw_stats;
59492 -
59493 - /* read stats from hardware */
59494 - dnet_update_stats(bp);
59495 -
59496 - /* Convert HW stats into netdevice stats */
59497 - nstat->rx_errors = (hwstat->rx_len_chk_err +
59498 - hwstat->rx_lng_frm + hwstat->rx_shrt_frm +
59499 - /* ignore IGP violation error
59500 - hwstat->rx_ipg_viol + */
59501 - hwstat->rx_crc_err +
59502 - hwstat->rx_pre_shrink +
59503 - hwstat->rx_drib_nib + hwstat->rx_unsup_opcd);
59504 - nstat->tx_errors = hwstat->tx_bad_fcs;
59505 - nstat->rx_length_errors = (hwstat->rx_len_chk_err +
59506 - hwstat->rx_lng_frm +
59507 - hwstat->rx_shrt_frm + hwstat->rx_pre_shrink);
59508 - nstat->rx_crc_errors = hwstat->rx_crc_err;
59509 - nstat->rx_frame_errors = hwstat->rx_pre_shrink + hwstat->rx_drib_nib;
59510 - nstat->rx_packets = hwstat->rx_ok_pkt;
59511 - nstat->tx_packets = (hwstat->tx_unicast +
59512 - hwstat->tx_multicast + hwstat->tx_brdcast);
59513 - nstat->rx_bytes = hwstat->rx_byte;
59514 - nstat->tx_bytes = hwstat->tx_byte;
59515 - nstat->multicast = hwstat->rx_multicast;
59516 - nstat->rx_missed_errors = hwstat->rx_pkt_ignr;
59517 -
59518 - dnet_print_pretty_hwstats(hwstat);
59519 -
59520 - return nstat;
59521 -}
59522 -
59523 -static int dnet_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
59524 -{
59525 - struct dnet *bp = netdev_priv(dev);
59526 - struct phy_device *phydev = bp->phy_dev;
59527 -
59528 - if (!phydev)
59529 - return -ENODEV;
59530 -
59531 - return phy_ethtool_gset(phydev, cmd);
59532 -}
59533 -
59534 -static int dnet_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
59535 -{
59536 - struct dnet *bp = netdev_priv(dev);
59537 - struct phy_device *phydev = bp->phy_dev;
59538 -
59539 - if (!phydev)
59540 - return -ENODEV;
59541 -
59542 - return phy_ethtool_sset(phydev, cmd);
59543 -}
59544 -
59545 -static int dnet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
59546 -{
59547 - struct dnet *bp = netdev_priv(dev);
59548 - struct phy_device *phydev = bp->phy_dev;
59549 -
59550 - if (!netif_running(dev))
59551 - return -EINVAL;
59552 -
59553 - if (!phydev)
59554 - return -ENODEV;
59555 -
59556 - return phy_mii_ioctl(phydev, if_mii(rq), cmd);
59557 -}
59558 -
59559 -static void dnet_get_drvinfo(struct net_device *dev,
59560 - struct ethtool_drvinfo *info)
59561 -{
59562 - strcpy(info->driver, DRV_NAME);
59563 - strcpy(info->version, DRV_VERSION);
59564 - strcpy(info->bus_info, "0");
59565 -}
59566 -
59567 -static const struct ethtool_ops dnet_ethtool_ops = {
59568 - .get_settings = dnet_get_settings,
59569 - .set_settings = dnet_set_settings,
59570 - .get_drvinfo = dnet_get_drvinfo,
59571 - .get_link = ethtool_op_get_link,
59572 -};
59573 -
59574 -static const struct net_device_ops dnet_netdev_ops = {
59575 - .ndo_open = dnet_open,
59576 - .ndo_stop = dnet_close,
59577 - .ndo_get_stats = dnet_get_stats,
59578 - .ndo_start_xmit = dnet_start_xmit,
59579 - .ndo_do_ioctl = dnet_ioctl,
59580 - .ndo_set_mac_address = eth_mac_addr,
59581 - .ndo_validate_addr = eth_validate_addr,
59582 - .ndo_change_mtu = eth_change_mtu,
59583 -};
59584 -
59585 -static int __devinit dnet_probe(struct platform_device *pdev)
59586 -{
59587 - struct resource *res;
59588 - struct net_device *dev;
59589 - struct dnet *bp;
59590 - struct phy_device *phydev;
59591 - int err = -ENXIO;
59592 - unsigned int mem_base, mem_size, irq;
59593 -
59594 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
59595 - if (!res) {
59596 - dev_err(&pdev->dev, "no mmio resource defined\n");
59597 - goto err_out;
59598 - }
59599 - mem_base = res->start;
59600 - mem_size = resource_size(res);
59601 - irq = platform_get_irq(pdev, 0);
59602 -
59603 - if (!request_mem_region(mem_base, mem_size, DRV_NAME)) {
59604 - dev_err(&pdev->dev, "no memory region available\n");
59605 - err = -EBUSY;
59606 - goto err_out;
59607 - }
59608 -
59609 - err = -ENOMEM;
59610 - dev = alloc_etherdev(sizeof(*bp));
59611 - if (!dev) {
59612 - dev_err(&pdev->dev, "etherdev alloc failed, aborting.\n");
59613 - goto err_out;
59614 - }
59615 -
59616 - /* TODO: Actually, we have some interesting features... */
59617 - dev->features |= 0;
59618 -
59619 - bp = netdev_priv(dev);
59620 - bp->dev = dev;
59621 -
59622 - SET_NETDEV_DEV(dev, &pdev->dev);
59623 -
59624 - spin_lock_init(&bp->lock);
59625 -
59626 - bp->regs = ioremap(mem_base, mem_size);
59627 - if (!bp->regs) {
59628 - dev_err(&pdev->dev, "failed to map registers, aborting.\n");
59629 - err = -ENOMEM;
59630 - goto err_out_free_dev;
59631 - }
59632 -
59633 - dev->irq = irq;
59634 - err = request_irq(dev->irq, dnet_interrupt, 0, DRV_NAME, dev);
59635 - if (err) {
59636 - dev_err(&pdev->dev, "Unable to request IRQ %d (error %d)\n",
59637 - irq, err);
59638 - goto err_out_iounmap;
59639 - }
59640 -
59641 - dev->netdev_ops = &dnet_netdev_ops;
59642 - netif_napi_add(dev, &bp->napi, dnet_poll, 64);
59643 - dev->ethtool_ops = &dnet_ethtool_ops;
59644 -
59645 - dev->base_addr = (unsigned long)bp->regs;
59646 -
59647 - bp->capabilities = dnet_readl(bp, VERCAPS) & DNET_CAPS_MASK;
59648 -
59649 - dnet_get_hwaddr(bp);
59650 -
59651 - if (!is_valid_ether_addr(dev->dev_addr)) {
59652 - /* choose a random ethernet address */
59653 - random_ether_addr(dev->dev_addr);
59654 - __dnet_set_hwaddr(bp);
59655 - }
59656 -
59657 - err = register_netdev(dev);
59658 - if (err) {
59659 - dev_err(&pdev->dev, "Cannot register net device, aborting.\n");
59660 - goto err_out_free_irq;
59661 - }
59662 -
59663 - /* register the PHY board fixup (for Marvell 88E1111) */
59664 - err = phy_register_fixup_for_uid(0x01410cc0, 0xfffffff0,
59665 - dnet_phy_marvell_fixup);
59666 - /* we can live without it, so just issue a warning */
59667 - if (err)
59668 - dev_warn(&pdev->dev, "Cannot register PHY board fixup.\n");
59669 -
59670 - if (dnet_mii_init(bp) != 0)
59671 - goto err_out_unregister_netdev;
59672 -
59673 - dev_info(&pdev->dev, "Dave DNET at 0x%p (0x%08x) irq %d %pM\n",
59674 - bp->regs, mem_base, dev->irq, dev->dev_addr);
59675 - dev_info(&pdev->dev, "has %smdio, %sirq, %sgigabit, %sdma \n",
59676 - (bp->capabilities & DNET_HAS_MDIO) ? "" : "no ",
59677 - (bp->capabilities & DNET_HAS_IRQ) ? "" : "no ",
59678 - (bp->capabilities & DNET_HAS_GIGABIT) ? "" : "no ",
59679 - (bp->capabilities & DNET_HAS_DMA) ? "" : "no ");
59680 - phydev = bp->phy_dev;
59681 - dev_info(&pdev->dev, "attached PHY driver [%s] "
59682 - "(mii_bus:phy_addr=%s, irq=%d)\n",
59683 - phydev->drv->name, dev_name(&phydev->dev), phydev->irq);
59684 -
59685 - return 0;
59686 -
59687 -err_out_unregister_netdev:
59688 - unregister_netdev(dev);
59689 -err_out_free_irq:
59690 - free_irq(dev->irq, dev);
59691 -err_out_iounmap:
59692 - iounmap(bp->regs);
59693 -err_out_free_dev:
59694 - free_netdev(dev);
59695 -err_out:
59696 - return err;
59697 -}
59698 -
59699 -static int __devexit dnet_remove(struct platform_device *pdev)
59700 -{
59701 -
59702 - struct net_device *dev;
59703 - struct dnet *bp;
59704 -
59705 - dev = platform_get_drvdata(pdev);
59706 -
59707 - if (dev) {
59708 - bp = netdev_priv(dev);
59709 - if (bp->phy_dev)
59710 - phy_disconnect(bp->phy_dev);
59711 - mdiobus_unregister(bp->mii_bus);
59712 - kfree(bp->mii_bus->irq);
59713 - mdiobus_free(bp->mii_bus);
59714 - unregister_netdev(dev);
59715 - free_irq(dev->irq, dev);
59716 - iounmap(bp->regs);
59717 - free_netdev(dev);
59718 - }
59719 -
59720 - return 0;
59721 -}
59722 -
59723 -static struct platform_driver dnet_driver = {
59724 - .probe = dnet_probe,
59725 - .remove = __devexit_p(dnet_remove),
59726 - .driver = {
59727 - .name = "dnet",
59728 - },
59729 -};
59730 -
59731 -static int __init dnet_init(void)
59732 -{
59733 - return platform_driver_register(&dnet_driver);
59734 -}
59735 -
59736 -static void __exit dnet_exit(void)
59737 -{
59738 - platform_driver_unregister(&dnet_driver);
59739 -}
59740 -
59741 -module_init(dnet_init);
59742 -module_exit(dnet_exit);
59743 -
59744 -MODULE_LICENSE("GPL");
59745 -MODULE_DESCRIPTION("Dave DNET Ethernet driver");
59746 -MODULE_AUTHOR("Ilya Yanok <yanok@emcraft.com>, "
59747 - "Matteo Vit <matteo.vit@dave.eu>");
59748 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/dnet.h linux-2.6.29-rc3.owrt/drivers/net/dnet.h
59749 --- linux-2.6.29.owrt/drivers/net/dnet.h 2009-05-10 22:04:38.000000000 +0200
59750 +++ linux-2.6.29-rc3.owrt/drivers/net/dnet.h 1970-01-01 01:00:00.000000000 +0100
59751 @@ -1,225 +0,0 @@
59752 -/*
59753 - * Dave DNET Ethernet Controller driver
59754 - *
59755 - * Copyright (C) 2008 Dave S.r.l. <www.dave.eu>
59756 - *
59757 - * This program is free software; you can redistribute it and/or modify
59758 - * it under the terms of the GNU General Public License version 2 as
59759 - * published by the Free Software Foundation.
59760 - */
59761 -#ifndef _DNET_H
59762 -#define _DNET_H
59763 -
59764 -#define DRV_NAME "dnet"
59765 -#define DRV_VERSION "0.9.1"
59766 -#define PFX DRV_NAME ": "
59767 -
59768 -/* Register access macros */
59769 -#define dnet_writel(port, value, reg) \
59770 - writel((value), (port)->regs + DNET_##reg)
59771 -#define dnet_readl(port, reg) readl((port)->regs + DNET_##reg)
59772 -
59773 -/* ALL DNET FIFO REGISTERS */
59774 -#define DNET_RX_LEN_FIFO 0x000 /* RX_LEN_FIFO */
59775 -#define DNET_RX_DATA_FIFO 0x004 /* RX_DATA_FIFO */
59776 -#define DNET_TX_LEN_FIFO 0x008 /* TX_LEN_FIFO */
59777 -#define DNET_TX_DATA_FIFO 0x00C /* TX_DATA_FIFO */
59778 -
59779 -/* ALL DNET CONTROL/STATUS REGISTERS OFFSETS */
59780 -#define DNET_VERCAPS 0x100 /* VERCAPS */
59781 -#define DNET_INTR_SRC 0x104 /* INTR_SRC */
59782 -#define DNET_INTR_ENB 0x108 /* INTR_ENB */
59783 -#define DNET_RX_STATUS 0x10C /* RX_STATUS */
59784 -#define DNET_TX_STATUS 0x110 /* TX_STATUS */
59785 -#define DNET_RX_FRAMES_CNT 0x114 /* RX_FRAMES_CNT */
59786 -#define DNET_TX_FRAMES_CNT 0x118 /* TX_FRAMES_CNT */
59787 -#define DNET_RX_FIFO_TH 0x11C /* RX_FIFO_TH */
59788 -#define DNET_TX_FIFO_TH 0x120 /* TX_FIFO_TH */
59789 -#define DNET_SYS_CTL 0x124 /* SYS_CTL */
59790 -#define DNET_PAUSE_TMR 0x128 /* PAUSE_TMR */
59791 -#define DNET_RX_FIFO_WCNT 0x12C /* RX_FIFO_WCNT */
59792 -#define DNET_TX_FIFO_WCNT 0x130 /* TX_FIFO_WCNT */
59793 -
59794 -/* ALL DNET MAC REGISTERS */
59795 -#define DNET_MACREG_DATA 0x200 /* Mac-Reg Data */
59796 -#define DNET_MACREG_ADDR 0x204 /* Mac-Reg Addr */
59797 -
59798 -/* ALL DNET RX STATISTICS COUNTERS */
59799 -#define DNET_RX_PKT_IGNR_CNT 0x300
59800 -#define DNET_RX_LEN_CHK_ERR_CNT 0x304
59801 -#define DNET_RX_LNG_FRM_CNT 0x308
59802 -#define DNET_RX_SHRT_FRM_CNT 0x30C
59803 -#define DNET_RX_IPG_VIOL_CNT 0x310
59804 -#define DNET_RX_CRC_ERR_CNT 0x314
59805 -#define DNET_RX_OK_PKT_CNT 0x318
59806 -#define DNET_RX_CTL_FRM_CNT 0x31C
59807 -#define DNET_RX_PAUSE_FRM_CNT 0x320
59808 -#define DNET_RX_MULTICAST_CNT 0x324
59809 -#define DNET_RX_BROADCAST_CNT 0x328
59810 -#define DNET_RX_VLAN_TAG_CNT 0x32C
59811 -#define DNET_RX_PRE_SHRINK_CNT 0x330
59812 -#define DNET_RX_DRIB_NIB_CNT 0x334
59813 -#define DNET_RX_UNSUP_OPCD_CNT 0x338
59814 -#define DNET_RX_BYTE_CNT 0x33C
59815 -
59816 -/* DNET TX STATISTICS COUNTERS */
59817 -#define DNET_TX_UNICAST_CNT 0x400
59818 -#define DNET_TX_PAUSE_FRM_CNT 0x404
59819 -#define DNET_TX_MULTICAST_CNT 0x408
59820 -#define DNET_TX_BRDCAST_CNT 0x40C
59821 -#define DNET_TX_VLAN_TAG_CNT 0x410
59822 -#define DNET_TX_BAD_FCS_CNT 0x414
59823 -#define DNET_TX_JUMBO_CNT 0x418
59824 -#define DNET_TX_BYTE_CNT 0x41C
59825 -
59826 -/* SOME INTERNAL MAC-CORE REGISTER */
59827 -#define DNET_INTERNAL_MODE_REG 0x0
59828 -#define DNET_INTERNAL_RXTX_CONTROL_REG 0x2
59829 -#define DNET_INTERNAL_MAX_PKT_SIZE_REG 0x4
59830 -#define DNET_INTERNAL_IGP_REG 0x8
59831 -#define DNET_INTERNAL_MAC_ADDR_0_REG 0xa
59832 -#define DNET_INTERNAL_MAC_ADDR_1_REG 0xc
59833 -#define DNET_INTERNAL_MAC_ADDR_2_REG 0xe
59834 -#define DNET_INTERNAL_TX_RX_STS_REG 0x12
59835 -#define DNET_INTERNAL_GMII_MNG_CTL_REG 0x14
59836 -#define DNET_INTERNAL_GMII_MNG_DAT_REG 0x16
59837 -
59838 -#define DNET_INTERNAL_GMII_MNG_CMD_FIN (1 << 14)
59839 -
59840 -#define DNET_INTERNAL_WRITE (1 << 31)
59841 -
59842 -/* MAC-CORE REGISTER FIELDS */
59843 -
59844 -/* MAC-CORE MODE REGISTER FIELDS */
59845 -#define DNET_INTERNAL_MODE_GBITEN (1 << 0)
59846 -#define DNET_INTERNAL_MODE_FCEN (1 << 1)
59847 -#define DNET_INTERNAL_MODE_RXEN (1 << 2)
59848 -#define DNET_INTERNAL_MODE_TXEN (1 << 3)
59849 -
59850 -/* MAC-CORE RXTX CONTROL REGISTER FIELDS */
59851 -#define DNET_INTERNAL_RXTX_CONTROL_RXSHORTFRAME (1 << 8)
59852 -#define DNET_INTERNAL_RXTX_CONTROL_RXBROADCAST (1 << 7)
59853 -#define DNET_INTERNAL_RXTX_CONTROL_RXMULTICAST (1 << 4)
59854 -#define DNET_INTERNAL_RXTX_CONTROL_RXPAUSE (1 << 3)
59855 -#define DNET_INTERNAL_RXTX_CONTROL_DISTXFCS (1 << 2)
59856 -#define DNET_INTERNAL_RXTX_CONTROL_DISCFXFCS (1 << 1)
59857 -#define DNET_INTERNAL_RXTX_CONTROL_ENPROMISC (1 << 0)
59858 -#define DNET_INTERNAL_RXTX_CONTROL_DROPCONTROL (1 << 6)
59859 -#define DNET_INTERNAL_RXTX_CONTROL_ENABLEHALFDUP (1 << 5)
59860 -
59861 -/* SYSTEM CONTROL REGISTER FIELDS */
59862 -#define DNET_SYS_CTL_IGNORENEXTPKT (1 << 0)
59863 -#define DNET_SYS_CTL_SENDPAUSE (1 << 2)
59864 -#define DNET_SYS_CTL_RXFIFOFLUSH (1 << 3)
59865 -#define DNET_SYS_CTL_TXFIFOFLUSH (1 << 4)
59866 -
59867 -/* TX STATUS REGISTER FIELDS */
59868 -#define DNET_TX_STATUS_FIFO_ALMOST_EMPTY (1 << 2)
59869 -#define DNET_TX_STATUS_FIFO_ALMOST_FULL (1 << 1)
59870 -
59871 -/* INTERRUPT SOURCE REGISTER FIELDS */
59872 -#define DNET_INTR_SRC_TX_PKTSENT (1 << 0)
59873 -#define DNET_INTR_SRC_TX_FIFOAF (1 << 1)
59874 -#define DNET_INTR_SRC_TX_FIFOAE (1 << 2)
59875 -#define DNET_INTR_SRC_TX_DISCFRM (1 << 3)
59876 -#define DNET_INTR_SRC_TX_FIFOFULL (1 << 4)
59877 -#define DNET_INTR_SRC_RX_CMDFIFOAF (1 << 8)
59878 -#define DNET_INTR_SRC_RX_CMDFIFOFF (1 << 9)
59879 -#define DNET_INTR_SRC_RX_DATAFIFOFF (1 << 10)
59880 -#define DNET_INTR_SRC_TX_SUMMARY (1 << 16)
59881 -#define DNET_INTR_SRC_RX_SUMMARY (1 << 17)
59882 -#define DNET_INTR_SRC_PHY (1 << 19)
59883 -
59884 -/* INTERRUPT ENABLE REGISTER FIELDS */
59885 -#define DNET_INTR_ENB_TX_PKTSENT (1 << 0)
59886 -#define DNET_INTR_ENB_TX_FIFOAF (1 << 1)
59887 -#define DNET_INTR_ENB_TX_FIFOAE (1 << 2)
59888 -#define DNET_INTR_ENB_TX_DISCFRM (1 << 3)
59889 -#define DNET_INTR_ENB_TX_FIFOFULL (1 << 4)
59890 -#define DNET_INTR_ENB_RX_PKTRDY (1 << 8)
59891 -#define DNET_INTR_ENB_RX_FIFOAF (1 << 9)
59892 -#define DNET_INTR_ENB_RX_FIFOERR (1 << 10)
59893 -#define DNET_INTR_ENB_RX_ERROR (1 << 11)
59894 -#define DNET_INTR_ENB_RX_FIFOFULL (1 << 12)
59895 -#define DNET_INTR_ENB_RX_FIFOAE (1 << 13)
59896 -#define DNET_INTR_ENB_TX_SUMMARY (1 << 16)
59897 -#define DNET_INTR_ENB_RX_SUMMARY (1 << 17)
59898 -#define DNET_INTR_ENB_GLOBAL_ENABLE (1 << 18)
59899 -
59900 -/* default values:
59901 - * almost empty = less than one full sized ethernet frame (no jumbo) inside
59902 - * the fifo almost full = can write less than one full sized ethernet frame
59903 - * (no jumbo) inside the fifo
59904 - */
59905 -#define DNET_CFG_TX_FIFO_FULL_THRES 25
59906 -#define DNET_CFG_RX_FIFO_FULL_THRES 20
59907 -
59908 -/*
59909 - * Capabilities. Used by the driver to know the capabilities that the ethernet
59910 - * controller inside the FPGA have.
59911 - */
59912 -
59913 -#define DNET_HAS_MDIO (1 << 0)
59914 -#define DNET_HAS_IRQ (1 << 1)
59915 -#define DNET_HAS_GIGABIT (1 << 2)
59916 -#define DNET_HAS_DMA (1 << 3)
59917 -
59918 -#define DNET_HAS_MII (1 << 4) /* or GMII */
59919 -#define DNET_HAS_RMII (1 << 5) /* or RGMII */
59920 -
59921 -#define DNET_CAPS_MASK 0xFFFF
59922 -
59923 -#define DNET_FIFO_SIZE 1024 /* 1K x 32 bit */
59924 -#define DNET_FIFO_TX_DATA_AF_TH (DNET_FIFO_SIZE - 384) /* 384 = 1536 / 4 */
59925 -#define DNET_FIFO_TX_DATA_AE_TH 384
59926 -
59927 -#define DNET_FIFO_RX_CMD_AF_TH (1 << 16) /* just one frame inside the FIFO */
59928 -
59929 -/*
59930 - * Hardware-collected statistics.
59931 - */
59932 -struct dnet_stats {
59933 - u32 rx_pkt_ignr;
59934 - u32 rx_len_chk_err;
59935 - u32 rx_lng_frm;
59936 - u32 rx_shrt_frm;
59937 - u32 rx_ipg_viol;
59938 - u32 rx_crc_err;
59939 - u32 rx_ok_pkt;
59940 - u32 rx_ctl_frm;
59941 - u32 rx_pause_frm;
59942 - u32 rx_multicast;
59943 - u32 rx_broadcast;
59944 - u32 rx_vlan_tag;
59945 - u32 rx_pre_shrink;
59946 - u32 rx_drib_nib;
59947 - u32 rx_unsup_opcd;
59948 - u32 rx_byte;
59949 - u32 tx_unicast;
59950 - u32 tx_pause_frm;
59951 - u32 tx_multicast;
59952 - u32 tx_brdcast;
59953 - u32 tx_vlan_tag;
59954 - u32 tx_bad_fcs;
59955 - u32 tx_jumbo;
59956 - u32 tx_byte;
59957 -};
59958 -
59959 -struct dnet {
59960 - void __iomem *regs;
59961 - spinlock_t lock;
59962 - struct platform_device *pdev;
59963 - struct net_device *dev;
59964 - struct dnet_stats hw_stats;
59965 - unsigned int capabilities; /* read from FPGA */
59966 - struct napi_struct napi;
59967 -
59968 - /* PHY stuff */
59969 - struct mii_bus *mii_bus;
59970 - struct phy_device *phy_dev;
59971 - unsigned int link;
59972 - unsigned int speed;
59973 - unsigned int duplex;
59974 -};
59975 -
59976 -#endif /* _DNET_H */
59977 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/e1000/e1000_main.c linux-2.6.29-rc3.owrt/drivers/net/e1000/e1000_main.c
59978 --- linux-2.6.29.owrt/drivers/net/e1000/e1000_main.c 2009-05-10 22:04:38.000000000 +0200
59979 +++ linux-2.6.29-rc3.owrt/drivers/net/e1000/e1000_main.c 2009-05-10 23:48:28.000000000 +0200
59980 @@ -31,7 +31,7 @@
59981
59982 char e1000_driver_name[] = "e1000";
59983 static char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver";
59984 -#define DRV_VERSION "7.3.21-k3-NAPI"
59985 +#define DRV_VERSION "7.3.20-k3-NAPI"
59986 const char e1000_driver_version[] = DRV_VERSION;
59987 static const char e1000_copyright[] = "Copyright (c) 1999-2006 Intel Corporation.";
59988
59989 @@ -940,7 +940,7 @@
59990 err = pci_enable_device(pdev);
59991 } else {
59992 bars = pci_select_bars(pdev, IORESOURCE_MEM);
59993 - err = pci_enable_device_mem(pdev);
59994 + err = pci_enable_device(pdev);
59995 }
59996 if (err)
59997 return err;
59998 @@ -3712,7 +3712,7 @@
59999 struct e1000_hw *hw = &adapter->hw;
60000 u32 rctl, icr = er32(ICR);
60001
60002 - if (unlikely((!icr) || test_bit(__E1000_RESETTING, &adapter->flags)))
60003 + if (unlikely(!icr))
60004 return IRQ_NONE; /* Not our interrupt */
60005
60006 /* IMS will not auto-mask if INT_ASSERTED is not set, and if it is
60007 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/forcedeth.c linux-2.6.29-rc3.owrt/drivers/net/forcedeth.c
60008 --- linux-2.6.29.owrt/drivers/net/forcedeth.c 2009-05-10 22:04:38.000000000 +0200
60009 +++ linux-2.6.29-rc3.owrt/drivers/net/forcedeth.c 2009-05-10 23:48:28.000000000 +0200
60010 @@ -6011,20 +6011,9 @@
60011 if (netif_running(dev))
60012 nv_close(dev);
60013
60014 - /*
60015 - * Restore the MAC so a kernel started by kexec won't get confused.
60016 - * If we really go for poweroff, we must not restore the MAC,
60017 - * otherwise the MAC for WOL will be reversed at least on some boards.
60018 - */
60019 - if (system_state != SYSTEM_POWER_OFF) {
60020 - nv_restore_mac_addr(pdev);
60021 - }
60022 + nv_restore_mac_addr(pdev);
60023
60024 pci_disable_device(pdev);
60025 - /*
60026 - * Apparently it is not possible to reinitialise from D3 hot,
60027 - * only put the device into D3 if we really go for poweroff.
60028 - */
60029 if (system_state == SYSTEM_POWER_OFF) {
60030 if (pci_enable_wake(pdev, PCI_D3cold, np->wolenabled))
60031 pci_enable_wake(pdev, PCI_D3hot, np->wolenabled);
60032 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/gianfar.c linux-2.6.29-rc3.owrt/drivers/net/gianfar.c
60033 --- linux-2.6.29.owrt/drivers/net/gianfar.c 2009-05-10 22:04:38.000000000 +0200
60034 +++ linux-2.6.29-rc3.owrt/drivers/net/gianfar.c 2009-05-10 23:48:28.000000000 +0200
60035 @@ -351,9 +351,6 @@
60036 /* Reset MAC layer */
60037 gfar_write(&priv->regs->maccfg1, MACCFG1_SOFT_RESET);
60038
60039 - /* We need to delay at least 3 TX clocks */
60040 - udelay(2);
60041 -
60042 tempval = (MACCFG1_TX_FLOW | MACCFG1_RX_FLOW);
60043 gfar_write(&priv->regs->maccfg1, tempval);
60044
60045 @@ -1284,7 +1281,7 @@
60046 spin_lock_irqsave(&priv->txlock, flags);
60047
60048 /* check if there is space to queue this packet */
60049 - if ((nr_frags+1) > priv->num_txbdfree) {
60050 + if (nr_frags > priv->num_txbdfree) {
60051 /* no space, stop the queue */
60052 netif_stop_queue(dev);
60053 dev->stats.tx_fifo_errors++;
60054 @@ -1629,12 +1626,6 @@
60055 if (netif_rx_schedule_prep(&priv->napi)) {
60056 gfar_write(&priv->regs->imask, IMASK_RTX_DISABLED);
60057 __netif_rx_schedule(&priv->napi);
60058 - } else {
60059 - /*
60060 - * Clear IEVENT, so interrupts aren't called again
60061 - * because of the packets that have already arrived.
60062 - */
60063 - gfar_write(&priv->regs->ievent, IEVENT_RTX_MASK);
60064 }
60065
60066 spin_unlock(&priv->rxlock);
60067 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/gianfar.h linux-2.6.29-rc3.owrt/drivers/net/gianfar.h
60068 --- linux-2.6.29.owrt/drivers/net/gianfar.h 2009-05-10 22:04:38.000000000 +0200
60069 +++ linux-2.6.29-rc3.owrt/drivers/net/gianfar.h 2009-05-10 23:48:28.000000000 +0200
60070 @@ -312,7 +312,7 @@
60071 #define ATTRELI_EI(x) (x)
60072
60073 #define BD_LFLAG(flags) ((flags) << 16)
60074 -#define BD_LENGTH_MASK 0x0000ffff
60075 +#define BD_LENGTH_MASK 0x00ff
60076
60077 /* TxBD status field bits */
60078 #define TXBD_READY 0x8000
60079 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/gianfar_mii.c linux-2.6.29-rc3.owrt/drivers/net/gianfar_mii.c
60080 --- linux-2.6.29.owrt/drivers/net/gianfar_mii.c 2009-05-10 22:04:38.000000000 +0200
60081 +++ linux-2.6.29-rc3.owrt/drivers/net/gianfar_mii.c 2009-05-10 23:48:28.000000000 +0200
60082 @@ -234,8 +234,6 @@
60083 if (NULL == new_bus)
60084 return -ENOMEM;
60085
60086 - device_init_wakeup(&ofdev->dev, 1);
60087 -
60088 new_bus->name = "Gianfar MII Bus",
60089 new_bus->read = &gfar_mdio_read,
60090 new_bus->write = &gfar_mdio_write,
60091 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/hp-plus.c linux-2.6.29-rc3.owrt/drivers/net/hp-plus.c
60092 --- linux-2.6.29.owrt/drivers/net/hp-plus.c 2009-05-10 22:04:38.000000000 +0200
60093 +++ linux-2.6.29-rc3.owrt/drivers/net/hp-plus.c 2009-05-10 23:48:28.000000000 +0200
60094 @@ -467,7 +467,7 @@
60095 if (this_dev != 0) break; /* only autoprobe 1st one */
60096 printk(KERN_NOTICE "hp-plus.c: Presently autoprobing (not recommended) for a single card.\n");
60097 }
60098 - dev = alloc_eip_netdev();
60099 + dev = alloc_ei_netdev();
60100 if (!dev)
60101 break;
60102 dev->irq = irq[this_dev];
60103 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/ibm_newemac/core.c linux-2.6.29-rc3.owrt/drivers/net/ibm_newemac/core.c
60104 --- linux-2.6.29.owrt/drivers/net/ibm_newemac/core.c 2009-05-10 22:04:38.000000000 +0200
60105 +++ linux-2.6.29-rc3.owrt/drivers/net/ibm_newemac/core.c 2009-05-10 23:48:28.000000000 +0200
60106 @@ -2594,9 +2594,6 @@
60107 if (of_device_is_compatible(np, "ibm,emac-460ex") ||
60108 of_device_is_compatible(np, "ibm,emac-460gt"))
60109 dev->features |= EMAC_FTR_460EX_PHY_CLK_FIX;
60110 - if (of_device_is_compatible(np, "ibm,emac-405ex") ||
60111 - of_device_is_compatible(np, "ibm,emac-405exr"))
60112 - dev->features |= EMAC_FTR_440EP_PHY_CLK_FIX;
60113 } else if (of_device_is_compatible(np, "ibm,emac4")) {
60114 dev->features |= EMAC_FTR_EMAC4;
60115 if (of_device_is_compatible(np, "ibm,emac-440gx"))
60116 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/ibm_newemac/phy.c linux-2.6.29-rc3.owrt/drivers/net/ibm_newemac/phy.c
60117 --- linux-2.6.29.owrt/drivers/net/ibm_newemac/phy.c 2009-05-10 22:04:38.000000000 +0200
60118 +++ linux-2.6.29-rc3.owrt/drivers/net/ibm_newemac/phy.c 2009-05-10 23:48:28.000000000 +0200
60119 @@ -60,7 +60,7 @@
60120
60121 udelay(300);
60122
60123 - while (--limit) {
60124 + while (limit--) {
60125 val = phy_read(phy, MII_BMCR);
60126 if (val >= 0 && (val & BMCR_RESET) == 0)
60127 break;
60128 @@ -84,7 +84,7 @@
60129
60130 udelay(300);
60131
60132 - while (--limit) {
60133 + while (limit--) {
60134 val = gpcs_phy_read(phy, MII_BMCR);
60135 if (val >= 0 && (val & BMCR_RESET) == 0)
60136 break;
60137 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/igb/e1000_82575.c linux-2.6.29-rc3.owrt/drivers/net/igb/e1000_82575.c
60138 --- linux-2.6.29.owrt/drivers/net/igb/e1000_82575.c 2009-05-10 22:04:38.000000000 +0200
60139 +++ linux-2.6.29-rc3.owrt/drivers/net/igb/e1000_82575.c 2009-05-10 23:48:28.000000000 +0200
60140 @@ -699,18 +699,11 @@
60141
60142 /* SGMII link check is done through the PCS register. */
60143 if ((hw->phy.media_type != e1000_media_type_copper) ||
60144 - (igb_sgmii_active_82575(hw))) {
60145 + (igb_sgmii_active_82575(hw)))
60146 ret_val = igb_get_pcs_speed_and_duplex_82575(hw, &speed,
60147 &duplex);
60148 - /*
60149 - * Use this flag to determine if link needs to be checked or
60150 - * not. If we have link clear the flag so that we do not
60151 - * continue to check for link.
60152 - */
60153 - hw->mac.get_link_status = !hw->mac.serdes_has_link;
60154 - } else {
60155 + else
60156 ret_val = igb_check_for_copper_link(hw);
60157 - }
60158
60159 return ret_val;
60160 }
60161 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/igb/igb.h linux-2.6.29-rc3.owrt/drivers/net/igb/igb.h
60162 --- linux-2.6.29.owrt/drivers/net/igb/igb.h 2009-05-10 22:04:38.000000000 +0200
60163 +++ linux-2.6.29-rc3.owrt/drivers/net/igb/igb.h 2009-05-10 23:48:28.000000000 +0200
60164 @@ -300,10 +300,11 @@
60165
60166 #define IGB_FLAG_HAS_MSI (1 << 0)
60167 #define IGB_FLAG_MSI_ENABLE (1 << 1)
60168 -#define IGB_FLAG_DCA_ENABLED (1 << 2)
60169 -#define IGB_FLAG_IN_NETPOLL (1 << 3)
60170 -#define IGB_FLAG_QUAD_PORT_A (1 << 4)
60171 -#define IGB_FLAG_NEED_CTX_IDX (1 << 5)
60172 +#define IGB_FLAG_HAS_DCA (1 << 2)
60173 +#define IGB_FLAG_DCA_ENABLED (1 << 3)
60174 +#define IGB_FLAG_IN_NETPOLL (1 << 5)
60175 +#define IGB_FLAG_QUAD_PORT_A (1 << 6)
60176 +#define IGB_FLAG_NEED_CTX_IDX (1 << 7)
60177
60178 enum e1000_state_t {
60179 __IGB_TESTING,
60180 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/igb/igb_main.c linux-2.6.29-rc3.owrt/drivers/net/igb/igb_main.c
60181 --- linux-2.6.29.owrt/drivers/net/igb/igb_main.c 2009-05-10 22:04:38.000000000 +0200
60182 +++ linux-2.6.29-rc3.owrt/drivers/net/igb/igb_main.c 2009-05-10 23:48:28.000000000 +0200
60183 @@ -206,11 +206,10 @@
60184
60185 global_quad_port_a = 0;
60186
60187 + ret = pci_register_driver(&igb_driver);
60188 #ifdef CONFIG_IGB_DCA
60189 dca_register_notify(&dca_notifier);
60190 #endif
60191 -
60192 - ret = pci_register_driver(&igb_driver);
60193 return ret;
60194 }
60195
60196 @@ -1023,10 +1022,11 @@
60197 struct net_device *netdev;
60198 struct igb_adapter *adapter;
60199 struct e1000_hw *hw;
60200 + struct pci_dev *us_dev;
60201 const struct e1000_info *ei = igb_info_tbl[ent->driver_data];
60202 unsigned long mmio_start, mmio_len;
60203 - int i, err, pci_using_dac;
60204 - u16 eeprom_data = 0;
60205 + int i, err, pci_using_dac, pos;
60206 + u16 eeprom_data = 0, state = 0;
60207 u16 eeprom_apme_mask = IGB_EEPROM_APME;
60208 u32 part_num;
60209 int bars, need_ioport;
60210 @@ -1061,6 +1061,27 @@
60211 }
60212 }
60213
60214 + /* 82575 requires that the pci-e link partner disable the L0s state */
60215 + switch (pdev->device) {
60216 + case E1000_DEV_ID_82575EB_COPPER:
60217 + case E1000_DEV_ID_82575EB_FIBER_SERDES:
60218 + case E1000_DEV_ID_82575GB_QUAD_COPPER:
60219 + us_dev = pdev->bus->self;
60220 + pos = pci_find_capability(us_dev, PCI_CAP_ID_EXP);
60221 + if (pos) {
60222 + pci_read_config_word(us_dev, pos + PCI_EXP_LNKCTL,
60223 + &state);
60224 + state &= ~PCIE_LINK_STATE_L0S;
60225 + pci_write_config_word(us_dev, pos + PCI_EXP_LNKCTL,
60226 + state);
60227 + dev_info(&pdev->dev,
60228 + "Disabling ASPM L0s upstream switch port %s\n",
60229 + pci_name(us_dev));
60230 + }
60231 + default:
60232 + break;
60233 + }
60234 +
60235 err = pci_request_selected_regions(pdev, bars, igb_driver_name);
60236 if (err)
60237 goto err_pci_reg;
60238 @@ -1135,10 +1156,11 @@
60239
60240 /* set flags */
60241 switch (hw->mac.type) {
60242 + case e1000_82576:
60243 case e1000_82575:
60244 + adapter->flags |= IGB_FLAG_HAS_DCA;
60245 adapter->flags |= IGB_FLAG_NEED_CTX_IDX;
60246 break;
60247 - case e1000_82576:
60248 default:
60249 break;
60250 }
60251 @@ -1288,7 +1310,8 @@
60252 goto err_register;
60253
60254 #ifdef CONFIG_IGB_DCA
60255 - if (dca_add_requester(&pdev->dev) == 0) {
60256 + if ((adapter->flags & IGB_FLAG_HAS_DCA) &&
60257 + (dca_add_requester(&pdev->dev) == 0)) {
60258 adapter->flags |= IGB_FLAG_DCA_ENABLED;
60259 dev_info(&pdev->dev, "DCA enabled\n");
60260 /* Always use CB2 mode, difference is masked
60261 @@ -1812,11 +1835,11 @@
60262 rctl |= E1000_RCTL_SECRC;
60263
60264 /*
60265 - * disable store bad packets and clear size bits.
60266 + * disable store bad packets, long packet enable, and clear size bits.
60267 */
60268 - rctl &= ~(E1000_RCTL_SBP | E1000_RCTL_SZ_256);
60269 + rctl &= ~(E1000_RCTL_SBP | E1000_RCTL_LPE | E1000_RCTL_SZ_256);
60270
60271 - /* enable LPE when to prevent packets larger than max_frame_size */
60272 + if (adapter->netdev->mtu > ETH_DATA_LEN)
60273 rctl |= E1000_RCTL_LPE;
60274
60275 /* Setup buffer sizes */
60276 @@ -1842,7 +1865,7 @@
60277 */
60278 /* allocations using alloc_page take too long for regular MTU
60279 * so only enable packet split for jumbo frames */
60280 - if (adapter->netdev->mtu > ETH_DATA_LEN) {
60281 + if (rctl & E1000_RCTL_LPE) {
60282 adapter->rx_ps_hdr_size = IGB_RXBUFFER_128;
60283 srrctl |= adapter->rx_ps_hdr_size <<
60284 E1000_SRRCTL_BSIZEHDRSIZE_SHIFT;
60285 @@ -3450,16 +3473,19 @@
60286 struct e1000_hw *hw = &adapter->hw;
60287 unsigned long event = *(unsigned long *)data;
60288
60289 + if (!(adapter->flags & IGB_FLAG_HAS_DCA))
60290 + goto out;
60291 +
60292 switch (event) {
60293 case DCA_PROVIDER_ADD:
60294 /* if already enabled, don't do it again */
60295 if (adapter->flags & IGB_FLAG_DCA_ENABLED)
60296 break;
60297 + adapter->flags |= IGB_FLAG_DCA_ENABLED;
60298 /* Always use CB2 mode, difference is masked
60299 * in the CB driver. */
60300 wr32(E1000_DCA_CTRL, 2);
60301 if (dca_add_requester(dev) == 0) {
60302 - adapter->flags |= IGB_FLAG_DCA_ENABLED;
60303 dev_info(&adapter->pdev->dev, "DCA enabled\n");
60304 igb_setup_dca(adapter);
60305 break;
60306 @@ -3476,7 +3502,7 @@
60307 }
60308 break;
60309 }
60310 -
60311 +out:
60312 return 0;
60313 }
60314
60315 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/irda/mcs7780.c linux-2.6.29-rc3.owrt/drivers/net/irda/mcs7780.c
60316 --- linux-2.6.29.owrt/drivers/net/irda/mcs7780.c 2009-05-10 22:04:38.000000000 +0200
60317 +++ linux-2.6.29-rc3.owrt/drivers/net/irda/mcs7780.c 2009-05-10 23:48:28.000000000 +0200
60318 @@ -585,7 +585,7 @@
60319 mcs_get_reg(mcs, MCS_RESV_REG, &rval);
60320 } while(cnt++ < 100 && (rval & MCS_IRINTX));
60321
60322 - if (cnt > 100) {
60323 + if(cnt >= 100) {
60324 IRDA_ERROR("unable to change speed\n");
60325 ret = -EIO;
60326 goto error;
60327 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/ixgbe/ixgbe_main.c linux-2.6.29-rc3.owrt/drivers/net/ixgbe/ixgbe_main.c
60328 --- linux-2.6.29.owrt/drivers/net/ixgbe/ixgbe_main.c 2009-05-10 22:04:38.000000000 +0200
60329 +++ linux-2.6.29-rc3.owrt/drivers/net/ixgbe/ixgbe_main.c 2009-05-10 23:48:28.000000000 +0200
60330 @@ -3973,7 +3973,6 @@
60331 .ndo_stop = ixgbe_close,
60332 .ndo_start_xmit = ixgbe_xmit_frame,
60333 .ndo_get_stats = ixgbe_get_stats,
60334 - .ndo_set_rx_mode = ixgbe_set_rx_mode,
60335 .ndo_set_multicast_list = ixgbe_set_rx_mode,
60336 .ndo_validate_addr = eth_validate_addr,
60337 .ndo_set_mac_address = ixgbe_set_mac,
60338 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/jme.c linux-2.6.29-rc3.owrt/drivers/net/jme.c
60339 --- linux-2.6.29.owrt/drivers/net/jme.c 2009-05-10 22:04:38.000000000 +0200
60340 +++ linux-2.6.29-rc3.owrt/drivers/net/jme.c 2009-05-10 23:48:28.000000000 +0200
60341 @@ -957,14 +957,13 @@
60342 goto out_inc;
60343
60344 i = atomic_read(&rxring->next_to_clean);
60345 - while (limit > 0) {
60346 + while (limit-- > 0) {
60347 rxdesc = rxring->desc;
60348 rxdesc += i;
60349
60350 if ((rxdesc->descwb.flags & cpu_to_le16(RXWBFLAG_OWN)) ||
60351 !(rxdesc->descwb.desccnt & RXWBDCNT_WBCPL))
60352 goto out;
60353 - --limit;
60354
60355 desccnt = rxdesc->descwb.desccnt & RXWBDCNT_DCNT;
60356
60357 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/Kconfig linux-2.6.29-rc3.owrt/drivers/net/Kconfig
60358 --- linux-2.6.29.owrt/drivers/net/Kconfig 2009-05-10 22:04:38.000000000 +0200
60359 +++ linux-2.6.29-rc3.owrt/drivers/net/Kconfig 2009-05-10 23:48:28.000000000 +0200
60360 @@ -1163,17 +1163,6 @@
60361 To compile this driver as a module, choose M here. The module
60362 will be called ni65.
60363
60364 -config DNET
60365 - tristate "Dave ethernet support (DNET)"
60366 - depends on NET_ETHERNET && HAS_IOMEM
60367 - select PHYLIB
60368 - help
60369 - The Dave ethernet interface (DNET) is found on Qong Board FPGA.
60370 - Say Y to include support for the DNET chip.
60371 -
60372 - To compile this driver as a module, choose M here: the module
60373 - will be called dnet.
60374 -
60375 source "drivers/net/tulip/Kconfig"
60376
60377 config AT1700
60378 @@ -2476,17 +2465,6 @@
60379 To compile this driver as a module, choose M here. The module
60380 will be called atl1e.
60381
60382 -config ATL1C
60383 - tristate "Atheros L1C Gigabit Ethernet support (EXPERIMENTAL)"
60384 - depends on PCI && EXPERIMENTAL
60385 - select CRC32
60386 - select MII
60387 - help
60388 - This driver supports the Atheros L1C gigabit ethernet adapter.
60389 -
60390 - To compile this driver as a module, choose M here. The module
60391 - will be called atl1c.
60392 -
60393 config JME
60394 tristate "JMicron(R) PCI-Express Gigabit Ethernet support"
60395 depends on PCI
60396 @@ -2753,8 +2731,6 @@
60397
60398 source "drivers/net/sfc/Kconfig"
60399
60400 -source "drivers/net/benet/Kconfig"
60401 -
60402 endif # NETDEV_10000
60403
60404 source "drivers/net/tokenring/Kconfig"
60405 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/Makefile linux-2.6.29-rc3.owrt/drivers/net/Makefile
60406 --- linux-2.6.29.owrt/drivers/net/Makefile 2009-05-10 22:04:38.000000000 +0200
60407 +++ linux-2.6.29-rc3.owrt/drivers/net/Makefile 2009-05-10 23:48:28.000000000 +0200
60408 @@ -17,12 +17,10 @@
60409 obj-$(CONFIG_ATL1) += atlx/
60410 obj-$(CONFIG_ATL2) += atlx/
60411 obj-$(CONFIG_ATL1E) += atl1e/
60412 -obj-$(CONFIG_ATL1C) += atl1c/
60413 obj-$(CONFIG_GIANFAR) += gianfar_driver.o
60414 obj-$(CONFIG_TEHUTI) += tehuti.o
60415 obj-$(CONFIG_ENIC) += enic/
60416 obj-$(CONFIG_JME) += jme.o
60417 -obj-$(CONFIG_BE2NET) += benet/
60418
60419 gianfar_driver-objs := gianfar.o \
60420 gianfar_ethtool.o \
60421 @@ -233,7 +231,6 @@
60422
60423 obj-$(CONFIG_XTENSA_XT2000_SONIC) += xtsonic.o
60424
60425 -obj-$(CONFIG_DNET) += dnet.o
60426 obj-$(CONFIG_MACB) += macb.o
60427
60428 obj-$(CONFIG_ARM) += arm/
60429 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/mv643xx_eth.c linux-2.6.29-rc3.owrt/drivers/net/mv643xx_eth.c
60430 --- linux-2.6.29.owrt/drivers/net/mv643xx_eth.c 2009-05-10 22:04:38.000000000 +0200
60431 +++ linux-2.6.29-rc3.owrt/drivers/net/mv643xx_eth.c 2009-05-10 23:48:28.000000000 +0200
60432 @@ -1175,7 +1175,7 @@
60433 {
60434 struct mib_counters *p = &mp->mib_counters;
60435
60436 - spin_lock_bh(&mp->mib_counters_lock);
60437 + spin_lock(&mp->mib_counters_lock);
60438 p->good_octets_received += mib_read(mp, 0x00);
60439 p->good_octets_received += (u64)mib_read(mp, 0x04) << 32;
60440 p->bad_octets_received += mib_read(mp, 0x08);
60441 @@ -1208,7 +1208,7 @@
60442 p->bad_crc_event += mib_read(mp, 0x74);
60443 p->collision += mib_read(mp, 0x78);
60444 p->late_collision += mib_read(mp, 0x7c);
60445 - spin_unlock_bh(&mp->mib_counters_lock);
60446 + spin_unlock(&mp->mib_counters_lock);
60447
60448 mod_timer(&mp->mib_counters_timer, jiffies + 30 * HZ);
60449 }
60450 @@ -1575,7 +1575,7 @@
60451 return;
60452 }
60453
60454 - mc_spec = kmalloc(0x200, GFP_ATOMIC);
60455 + mc_spec = kmalloc(0x200, GFP_KERNEL);
60456 if (mc_spec == NULL)
60457 goto oom;
60458 mc_other = mc_spec + (0x100 >> 2);
60459 @@ -2030,6 +2030,11 @@
60460 }
60461
60462 /*
60463 + * Add configured unicast address to address filter table.
60464 + */
60465 + mv643xx_eth_program_unicast_filter(mp->dev);
60466 +
60467 + /*
60468 * Receive all unmatched unicast, TCP, UDP, BPDU and broadcast
60469 * frames to RX queue #0, and include the pseudo-header when
60470 * calculating receive checksums.
60471 @@ -2042,11 +2047,6 @@
60472 wrlp(mp, PORT_CONFIG_EXT, 0x00000000);
60473
60474 /*
60475 - * Add configured unicast addresses to address filter table.
60476 - */
60477 - mv643xx_eth_program_unicast_filter(mp->dev);
60478 -
60479 - /*
60480 * Enable the receive queues.
60481 */
60482 for (i = 0; i < mp->rxq_count; i++) {
60483 @@ -2216,6 +2216,8 @@
60484 wrlp(mp, INT_MASK, 0x00000000);
60485 rdlp(mp, INT_MASK);
60486
60487 + del_timer_sync(&mp->mib_counters_timer);
60488 +
60489 napi_disable(&mp->napi);
60490
60491 del_timer_sync(&mp->rx_oom);
60492 @@ -2227,7 +2229,6 @@
60493 port_reset(mp);
60494 mv643xx_eth_get_stats(dev);
60495 mib_counters_update(mp);
60496 - del_timer_sync(&mp->mib_counters_timer);
60497
60498 skb_queue_purge(&mp->rx_recycle);
60499
60500 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/netxen/netxen_nic.h linux-2.6.29-rc3.owrt/drivers/net/netxen/netxen_nic.h
60501 --- linux-2.6.29.owrt/drivers/net/netxen/netxen_nic.h 2009-05-10 22:04:38.000000000 +0200
60502 +++ linux-2.6.29-rc3.owrt/drivers/net/netxen/netxen_nic.h 2009-05-10 23:48:29.000000000 +0200
60503 @@ -210,7 +210,7 @@
60504 #define MAX_CMD_DESCRIPTORS_HOST 1024
60505 #define MAX_RCV_DESCRIPTORS_1G 2048
60506 #define MAX_RCV_DESCRIPTORS_10G 4096
60507 -#define MAX_JUMBO_RCV_DESCRIPTORS 1024
60508 +#define MAX_JUMBO_RCV_DESCRIPTORS 512
60509 #define MAX_LRO_RCV_DESCRIPTORS 8
60510 #define MAX_RCVSTATUS_DESCRIPTORS MAX_RCV_DESCRIPTORS
60511 #define MAX_JUMBO_RCV_DESC MAX_JUMBO_RCV_DESCRIPTORS
60512 @@ -1203,7 +1203,7 @@
60513 #define NETXEN_IS_MSI_FAMILY(adapter) \
60514 ((adapter)->flags & (NETXEN_NIC_MSI_ENABLED | NETXEN_NIC_MSIX_ENABLED))
60515
60516 -#define MSIX_ENTRIES_PER_ADAPTER 1
60517 +#define MSIX_ENTRIES_PER_ADAPTER 8
60518 #define NETXEN_MSIX_TBL_SPACE 8192
60519 #define NETXEN_PCI_REG_MSIX_TBL 0x44
60520
60521 @@ -1595,6 +1595,7 @@
60522 }
60523
60524
60525 +int netxen_is_flash_supported(struct netxen_adapter *adapter);
60526 int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, __le64 *mac);
60527 int netxen_p3_get_mac_addr(struct netxen_adapter *adapter, __le64 *mac);
60528 extern void netxen_change_ringparam(struct netxen_adapter *adapter);
60529 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/netxen/netxen_nic_hw.c linux-2.6.29-rc3.owrt/drivers/net/netxen/netxen_nic_hw.c
60530 --- linux-2.6.29.owrt/drivers/net/netxen/netxen_nic_hw.c 2009-05-10 22:04:38.000000000 +0200
60531 +++ linux-2.6.29-rc3.owrt/drivers/net/netxen/netxen_nic_hw.c 2009-05-10 23:48:29.000000000 +0200
60532 @@ -706,6 +706,28 @@
60533 return rc;
60534 }
60535
60536 +int netxen_is_flash_supported(struct netxen_adapter *adapter)
60537 +{
60538 + const int locs[] = { 0, 0x4, 0x100, 0x4000, 0x4128 };
60539 + int addr, val01, val02, i, j;
60540 +
60541 + /* if the flash size less than 4Mb, make huge war cry and die */
60542 + for (j = 1; j < 4; j++) {
60543 + addr = j * NETXEN_NIC_WINDOW_MARGIN;
60544 + for (i = 0; i < ARRAY_SIZE(locs); i++) {
60545 + if (netxen_rom_fast_read(adapter, locs[i], &val01) == 0
60546 + && netxen_rom_fast_read(adapter, (addr + locs[i]),
60547 + &val02) == 0) {
60548 + if (val01 == val02)
60549 + return -1;
60550 + } else
60551 + return -1;
60552 + }
60553 + }
60554 +
60555 + return 0;
60556 +}
60557 +
60558 static int netxen_get_flash_block(struct netxen_adapter *adapter, int base,
60559 int size, __le32 * buf)
60560 {
60561 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/netxen/netxen_nic_init.c linux-2.6.29-rc3.owrt/drivers/net/netxen/netxen_nic_init.c
60562 --- linux-2.6.29.owrt/drivers/net/netxen/netxen_nic_init.c 2009-05-10 22:04:38.000000000 +0200
60563 +++ linux-2.6.29-rc3.owrt/drivers/net/netxen/netxen_nic_init.c 2009-05-10 23:48:29.000000000 +0200
60564 @@ -947,10 +947,8 @@
60565 }
60566 for (i = 0; i < n; i++) {
60567 if (netxen_rom_fast_read(adapter, 8*i + 4*offset, &val) != 0 ||
60568 - netxen_rom_fast_read(adapter, 8*i + 4*offset + 4, &addr) != 0) {
60569 - kfree(buf);
60570 + netxen_rom_fast_read(adapter, 8*i + 4*offset + 4, &addr) != 0)
60571 return -EIO;
60572 - }
60573
60574 buf[i].addr = addr;
60575 buf[i].data = val;
60576 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/netxen/netxen_nic_main.c linux-2.6.29-rc3.owrt/drivers/net/netxen/netxen_nic_main.c
60577 --- linux-2.6.29.owrt/drivers/net/netxen/netxen_nic_main.c 2009-05-10 22:04:38.000000000 +0200
60578 +++ linux-2.6.29-rc3.owrt/drivers/net/netxen/netxen_nic_main.c 2009-05-10 23:48:29.000000000 +0200
60579 @@ -76,7 +76,6 @@
60580 #endif
60581 static irqreturn_t netxen_intr(int irq, void *data);
60582 static irqreturn_t netxen_msi_intr(int irq, void *data);
60583 -static irqreturn_t netxen_msix_intr(int irq, void *data);
60584
60585 /* PCI Device ID Table */
60586 #define ENTRY(device) \
60587 @@ -201,9 +200,9 @@
60588 adapter->pci_using_dac = 1;
60589 return 0;
60590 }
60591 -set_32_bit_mask:
60592 #endif /* CONFIG_IA64 */
60593
60594 +set_32_bit_mask:
60595 err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
60596 if (!err)
60597 err = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
60598 @@ -372,6 +371,67 @@
60599 }
60600 }
60601
60602 +#define PCI_CAP_ID_GEN 0x10
60603 +
60604 +static void netxen_pcie_strap_init(struct netxen_adapter *adapter)
60605 +{
60606 + u32 pdevfuncsave;
60607 + u32 c8c9value = 0;
60608 + u32 chicken = 0;
60609 + u32 control = 0;
60610 + int i, pos;
60611 + struct pci_dev *pdev;
60612 +
60613 + pdev = adapter->pdev;
60614 +
60615 + adapter->hw_read_wx(adapter,
60616 + NETXEN_PCIE_REG(PCIE_CHICKEN3), &chicken, 4);
60617 + /* clear chicken3.25:24 */
60618 + chicken &= 0xFCFFFFFF;
60619 + /*
60620 + * if gen1 and B0, set F1020 - if gen 2, do nothing
60621 + * if gen2 set to F1000
60622 + */
60623 + pos = pci_find_capability(pdev, PCI_CAP_ID_GEN);
60624 + if (pos == 0xC0) {
60625 + pci_read_config_dword(pdev, pos + 0x10, &control);
60626 + if ((control & 0x000F0000) != 0x00020000) {
60627 + /* set chicken3.24 if gen1 */
60628 + chicken |= 0x01000000;
60629 + }
60630 + printk(KERN_INFO "%s Gen2 strapping detected\n",
60631 + netxen_nic_driver_name);
60632 + c8c9value = 0xF1000;
60633 + } else {
60634 + /* set chicken3.24 if gen1 */
60635 + chicken |= 0x01000000;
60636 + printk(KERN_INFO "%s Gen1 strapping detected\n",
60637 + netxen_nic_driver_name);
60638 + if (adapter->ahw.revision_id == NX_P3_B0)
60639 + c8c9value = 0xF1020;
60640 + else
60641 + c8c9value = 0;
60642 +
60643 + }
60644 + adapter->hw_write_wx(adapter,
60645 + NETXEN_PCIE_REG(PCIE_CHICKEN3), &chicken, 4);
60646 +
60647 + if (!c8c9value)
60648 + return;
60649 +
60650 + pdevfuncsave = pdev->devfn;
60651 + if (pdevfuncsave & 0x07)
60652 + return;
60653 +
60654 + for (i = 0; i < 8; i++) {
60655 + pci_read_config_dword(pdev, pos + 8, &control);
60656 + pci_read_config_dword(pdev, pos + 8, &control);
60657 + pci_write_config_dword(pdev, pos + 8, c8c9value);
60658 + pdev->devfn++;
60659 + }
60660 + pdev->devfn = pdevfuncsave;
60661 +}
60662 +
60663 static void netxen_set_msix_bit(struct pci_dev *pdev, int enable)
60664 {
60665 u32 control;
60666 @@ -405,6 +465,9 @@
60667 struct net_device *netdev = adapter->netdev;
60668 struct pci_dev *pdev = adapter->pdev;
60669
60670 + if (netxen_is_flash_supported(adapter) != 0)
60671 + return -EIO;
60672 +
60673 if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) {
60674 if (netxen_p3_get_mac_addr(adapter, &mac_addr) != 0)
60675 return -EIO;
60676 @@ -585,12 +648,7 @@
60677 adapter->pci_mem_read = netxen_nic_pci_mem_read_2M;
60678 adapter->pci_mem_write = netxen_nic_pci_mem_write_2M;
60679
60680 - mem_ptr0 = pci_ioremap_bar(pdev, 0);
60681 - if (mem_ptr0 == NULL) {
60682 - dev_err(&pdev->dev, "failed to map PCI bar 0\n");
60683 - return -EIO;
60684 - }
60685 -
60686 + mem_ptr0 = ioremap(mem_base, mem_len);
60687 pci_len0 = mem_len;
60688 first_page_group_start = 0;
60689 first_page_group_end = 0;
60690 @@ -753,6 +811,9 @@
60691 }
60692 netxen_load_firmware(adapter);
60693
60694 + if (NX_IS_REVISION_P3(revision_id))
60695 + netxen_pcie_strap_init(adapter);
60696 +
60697 if (NX_IS_REVISION_P2(revision_id)) {
60698
60699 /* Initialize multicast addr pool owners */
60700 @@ -797,12 +858,9 @@
60701 * See if the firmware gave us a virtual-physical port mapping.
60702 */
60703 adapter->physical_port = adapter->portnum;
60704 - if (adapter->fw_major < 4) {
60705 - i = adapter->pci_read_normalize(adapter,
60706 - CRB_V2P(adapter->portnum));
60707 - if (i != 0x55555555)
60708 - adapter->physical_port = i;
60709 - }
60710 + i = adapter->pci_read_normalize(adapter, CRB_V2P(adapter->portnum));
60711 + if (i != 0x55555555)
60712 + adapter->physical_port = i;
60713
60714 adapter->flags &= ~(NETXEN_NIC_MSI_ENABLED | NETXEN_NIC_MSIX_ENABLED);
60715
60716 @@ -1026,9 +1084,7 @@
60717 for (ring = 0; ring < adapter->max_rds_rings; ring++)
60718 netxen_post_rx_buffers(adapter, ctx, ring);
60719 }
60720 - if (adapter->flags & NETXEN_NIC_MSIX_ENABLED)
60721 - handler = netxen_msix_intr;
60722 - else if (adapter->flags & NETXEN_NIC_MSI_ENABLED)
60723 + if (NETXEN_IS_MSI_FAMILY(adapter))
60724 handler = netxen_msi_intr;
60725 else {
60726 flags |= IRQF_SHARED;
60727 @@ -1556,14 +1612,6 @@
60728 return IRQ_HANDLED;
60729 }
60730
60731 -static irqreturn_t netxen_msix_intr(int irq, void *data)
60732 -{
60733 - struct netxen_adapter *adapter = data;
60734 -
60735 - napi_schedule(&adapter->napi);
60736 - return IRQ_HANDLED;
60737 -}
60738 -
60739 static int netxen_nic_poll(struct napi_struct *napi, int budget)
60740 {
60741 struct netxen_adapter *adapter = container_of(napi, struct netxen_adapter, napi);
60742 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/pcmcia/3c574_cs.c linux-2.6.29-rc3.owrt/drivers/net/pcmcia/3c574_cs.c
60743 --- linux-2.6.29.owrt/drivers/net/pcmcia/3c574_cs.c 2009-05-10 22:04:38.000000000 +0200
60744 +++ linux-2.6.29-rc3.owrt/drivers/net/pcmcia/3c574_cs.c 2009-05-10 23:48:29.000000000 +0200
60745 @@ -1035,8 +1035,7 @@
60746 DEBUG(3, "%s: in rx_packet(), status %4.4x, rx_status %4.4x.\n",
60747 dev->name, inw(ioaddr+EL3_STATUS), inw(ioaddr+RxStatus));
60748 while (!((rx_status = inw(ioaddr + RxStatus)) & 0x8000) &&
60749 - worklimit > 0) {
60750 - worklimit--;
60751 + (--worklimit >= 0)) {
60752 if (rx_status & 0x4000) { /* Error, update stats. */
60753 short error = rx_status & 0x3800;
60754 dev->stats.rx_errors++;
60755 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/pcmcia/3c589_cs.c linux-2.6.29-rc3.owrt/drivers/net/pcmcia/3c589_cs.c
60756 --- linux-2.6.29.owrt/drivers/net/pcmcia/3c589_cs.c 2009-05-10 22:04:38.000000000 +0200
60757 +++ linux-2.6.29-rc3.owrt/drivers/net/pcmcia/3c589_cs.c 2009-05-10 23:48:29.000000000 +0200
60758 @@ -857,8 +857,7 @@
60759 DEBUG(3, "%s: in rx_packet(), status %4.4x, rx_status %4.4x.\n",
60760 dev->name, inw(ioaddr+EL3_STATUS), inw(ioaddr+RX_STATUS));
60761 while (!((rx_status = inw(ioaddr + RX_STATUS)) & 0x8000) &&
60762 - worklimit > 0) {
60763 - worklimit--;
60764 + (--worklimit >= 0)) {
60765 if (rx_status & 0x4000) { /* Error, update stats. */
60766 short error = rx_status & 0x3800;
60767 dev->stats.rx_errors++;
60768 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/pcmcia/pcnet_cs.c linux-2.6.29-rc3.owrt/drivers/net/pcmcia/pcnet_cs.c
60769 --- linux-2.6.29.owrt/drivers/net/pcmcia/pcnet_cs.c 2009-05-10 22:04:38.000000000 +0200
60770 +++ linux-2.6.29-rc3.owrt/drivers/net/pcmcia/pcnet_cs.c 2009-05-10 23:48:29.000000000 +0200
60771 @@ -586,7 +586,7 @@
60772 }
60773
60774 if ((link->conf.ConfigBase == 0x03c0)
60775 - && (link->manf_id == 0x149) && (link->card_id == 0xc1ab)) {
60776 + && (link->manf_id == 0x149) && (link->card_id = 0xc1ab)) {
60777 printk(KERN_INFO "pcnet_cs: this is an AX88190 card!\n");
60778 printk(KERN_INFO "pcnet_cs: use axnet_cs instead.\n");
60779 goto failed;
60780 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/phy/mdio-gpio.c linux-2.6.29-rc3.owrt/drivers/net/phy/mdio-gpio.c
60781 --- linux-2.6.29.owrt/drivers/net/phy/mdio-gpio.c 2009-05-10 22:04:38.000000000 +0200
60782 +++ linux-2.6.29-rc3.owrt/drivers/net/phy/mdio-gpio.c 2009-05-10 23:48:29.000000000 +0200
60783 @@ -125,8 +125,6 @@
60784 if (gpio_request(bitbang->mdio, "mdio"))
60785 goto out_free_mdc;
60786
60787 - gpio_direction_output(bitbang->mdc, 0);
60788 -
60789 dev_set_drvdata(dev, new_bus);
60790
60791 ret = mdiobus_register(new_bus);
60792 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/ps3_gelic_wireless.c linux-2.6.29-rc3.owrt/drivers/net/ps3_gelic_wireless.c
60793 --- linux-2.6.29.owrt/drivers/net/ps3_gelic_wireless.c 2009-05-10 22:04:38.000000000 +0200
60794 +++ linux-2.6.29-rc3.owrt/drivers/net/ps3_gelic_wireless.c 2009-05-10 23:48:29.000000000 +0200
60795 @@ -2168,7 +2168,7 @@
60796 complete(&wl->assoc_done);
60797 netif_carrier_on(port_to_netdev(wl_port(wl)));
60798 } else
60799 - pr_debug("%s: event %#llx under wpa\n",
60800 + pr_debug("%s: event %#lx under wpa\n",
60801 __func__, event);
60802 }
60803
60804 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/qlge/qlge.h linux-2.6.29-rc3.owrt/drivers/net/qlge/qlge.h
60805 --- linux-2.6.29.owrt/drivers/net/qlge/qlge.h 2009-05-10 22:04:38.000000000 +0200
60806 +++ linux-2.6.29-rc3.owrt/drivers/net/qlge/qlge.h 2009-05-10 23:48:29.000000000 +0200
60807 @@ -787,12 +787,12 @@
60808
60809 struct flash_params {
60810 u8 dev_id_str[4];
60811 - __le16 size;
60812 - __le16 csum;
60813 - __le16 ver;
60814 - __le16 sub_dev_id;
60815 + u16 size;
60816 + u16 csum;
60817 + u16 ver;
60818 + u16 sub_dev_id;
60819 u8 mac_addr[6];
60820 - __le16 res;
60821 + u16 res;
60822 };
60823
60824
60825 @@ -927,7 +927,6 @@
60826 u8 flags1;
60827 #define IB_MAC_IOCB_RSP_OI 0x01 /* Overide intr delay */
60828 #define IB_MAC_IOCB_RSP_I 0x02 /* Disble Intr Generation */
60829 -#define IB_MAC_CSUM_ERR_MASK 0x1c /* A mask to use for csum errs */
60830 #define IB_MAC_IOCB_RSP_TE 0x04 /* Checksum error */
60831 #define IB_MAC_IOCB_RSP_NU 0x08 /* No checksum rcvd */
60832 #define IB_MAC_IOCB_RSP_IE 0x10 /* IPv4 checksum error */
60833 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/qlge/qlge_main.c linux-2.6.29-rc3.owrt/drivers/net/qlge/qlge_main.c
60834 --- linux-2.6.29.owrt/drivers/net/qlge/qlge_main.c 2009-05-10 22:04:38.000000000 +0200
60835 +++ linux-2.6.29-rc3.owrt/drivers/net/qlge/qlge_main.c 2009-05-10 23:48:29.000000000 +0200
60836 @@ -641,7 +641,7 @@
60837
60838 }
60839
60840 -static int ql_read_flash_word(struct ql_adapter *qdev, int offset, __le32 *data)
60841 +static int ql_read_flash_word(struct ql_adapter *qdev, int offset, u32 *data)
60842 {
60843 int status = 0;
60844 /* wait for reg to come ready */
60845 @@ -656,11 +656,8 @@
60846 FLASH_ADDR, FLASH_ADDR_RDY, FLASH_ADDR_ERR);
60847 if (status)
60848 goto exit;
60849 - /* This data is stored on flash as an array of
60850 - * __le32. Since ql_read32() returns cpu endian
60851 - * we need to swap it back.
60852 - */
60853 - *data = cpu_to_le32(ql_read32(qdev, FLASH_DATA));
60854 + /* get the data */
60855 + *data = ql_read32(qdev, FLASH_DATA);
60856 exit:
60857 return status;
60858 }
60859 @@ -669,20 +666,13 @@
60860 {
60861 int i;
60862 int status;
60863 - __le32 *p = (__le32 *)&qdev->flash;
60864 - u32 offset = 0;
60865 -
60866 - /* Second function's parameters follow the first
60867 - * function's.
60868 - */
60869 - if (qdev->func)
60870 - offset = sizeof(qdev->flash) / sizeof(u32);
60871 + u32 *p = (u32 *)&qdev->flash;
60872
60873 if (ql_sem_spinlock(qdev, SEM_FLASH_MASK))
60874 return -ETIMEDOUT;
60875
60876 for (i = 0; i < sizeof(qdev->flash) / sizeof(u32); i++, p++) {
60877 - status = ql_read_flash_word(qdev, i+offset, p);
60878 + status = ql_read_flash_word(qdev, i, p);
60879 if (status) {
60880 QPRINTK(qdev, IFUP, ERR, "Error reading flash.\n");
60881 goto exit;
60882 @@ -898,7 +888,6 @@
60883 lbq_desc->index);
60884 lbq_desc->p.lbq_page = alloc_page(GFP_ATOMIC);
60885 if (lbq_desc->p.lbq_page == NULL) {
60886 - rx_ring->lbq_clean_idx = clean_idx;
60887 QPRINTK(qdev, RX_STATUS, ERR,
60888 "Couldn't get a page.\n");
60889 return;
60890 @@ -908,9 +897,6 @@
60891 0, PAGE_SIZE,
60892 PCI_DMA_FROMDEVICE);
60893 if (pci_dma_mapping_error(qdev->pdev, map)) {
60894 - rx_ring->lbq_clean_idx = clean_idx;
60895 - put_page(lbq_desc->p.lbq_page);
60896 - lbq_desc->p.lbq_page = NULL;
60897 QPRINTK(qdev, RX_STATUS, ERR,
60898 "PCI mapping failed.\n");
60899 return;
60900 @@ -972,8 +958,6 @@
60901 if (pci_dma_mapping_error(qdev->pdev, map)) {
60902 QPRINTK(qdev, IFUP, ERR, "PCI mapping failed.\n");
60903 rx_ring->sbq_clean_idx = clean_idx;
60904 - dev_kfree_skb_any(sbq_desc->p.skb);
60905 - sbq_desc->p.skb = NULL;
60906 return;
60907 }
60908 pci_unmap_addr_set(sbq_desc, mapaddr, map);
60909 @@ -1436,32 +1420,18 @@
60910 if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_P) {
60911 QPRINTK(qdev, RX_STATUS, DEBUG, "Promiscuous Packet.\n");
60912 }
60913 -
60914 - skb->protocol = eth_type_trans(skb, ndev);
60915 - skb->ip_summed = CHECKSUM_NONE;
60916 -
60917 - /* If rx checksum is on, and there are no
60918 - * csum or frame errors.
60919 - */
60920 - if (qdev->rx_csum &&
60921 - !(ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK) &&
60922 - !(ib_mac_rsp->flags1 & IB_MAC_CSUM_ERR_MASK)) {
60923 - /* TCP frame. */
60924 - if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_T) {
60925 - QPRINTK(qdev, RX_STATUS, DEBUG,
60926 - "TCP checksum done!\n");
60927 - skb->ip_summed = CHECKSUM_UNNECESSARY;
60928 - } else if ((ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_U) &&
60929 - (ib_mac_rsp->flags3 & IB_MAC_IOCB_RSP_V4)) {
60930 - /* Unfragmented ipv4 UDP frame. */
60931 - struct iphdr *iph = (struct iphdr *) skb->data;
60932 - if (!(iph->frag_off &
60933 - cpu_to_be16(IP_MF|IP_OFFSET))) {
60934 - skb->ip_summed = CHECKSUM_UNNECESSARY;
60935 - QPRINTK(qdev, RX_STATUS, DEBUG,
60936 - "TCP checksum done!\n");
60937 - }
60938 - }
60939 + if (ib_mac_rsp->flags1 & (IB_MAC_IOCB_RSP_IE | IB_MAC_IOCB_RSP_TE)) {
60940 + QPRINTK(qdev, RX_STATUS, ERR,
60941 + "Bad checksum for this %s packet.\n",
60942 + ((ib_mac_rsp->
60943 + flags2 & IB_MAC_IOCB_RSP_T) ? "TCP" : "UDP"));
60944 + skb->ip_summed = CHECKSUM_NONE;
60945 + } else if (qdev->rx_csum &&
60946 + ((ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_T) ||
60947 + ((ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_U) &&
60948 + !(ib_mac_rsp->flags1 & IB_MAC_IOCB_RSP_NU)))) {
60949 + QPRINTK(qdev, RX_STATUS, DEBUG, "RX checksum done!\n");
60950 + skb->ip_summed = CHECKSUM_UNNECESSARY;
60951 }
60952 qdev->stats.rx_packets++;
60953 qdev->stats.rx_bytes += skb->len;
60954 @@ -1469,12 +1439,12 @@
60955 if (qdev->vlgrp && (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_V)) {
60956 QPRINTK(qdev, RX_STATUS, DEBUG,
60957 "Passing a VLAN packet upstream.\n");
60958 - vlan_hwaccel_receive_skb(skb, qdev->vlgrp,
60959 + vlan_hwaccel_rx(skb, qdev->vlgrp,
60960 le16_to_cpu(ib_mac_rsp->vlan_id));
60961 } else {
60962 QPRINTK(qdev, RX_STATUS, DEBUG,
60963 "Passing a normal packet upstream.\n");
60964 - netif_receive_skb(skb);
60965 + netif_rx(skb);
60966 }
60967 }
60968
60969 @@ -1531,11 +1501,6 @@
60970 netif_stop_queue(qdev->ndev);
60971 netif_carrier_off(qdev->ndev);
60972 ql_disable_interrupts(qdev);
60973 - /* Clear adapter up bit to signal the recovery
60974 - * process that it shouldn't kill the reset worker
60975 - * thread
60976 - */
60977 - clear_bit(QL_ADAPTER_UP, &qdev->flags);
60978 queue_delayed_work(qdev->workqueue, &qdev->asic_reset_work, 0);
60979 }
60980
60981 @@ -1941,9 +1906,6 @@
60982
60983 tx_ring = &qdev->tx_ring[tx_ring_idx];
60984
60985 - if (skb_padto(skb, ETH_ZLEN))
60986 - return NETDEV_TX_OK;
60987 -
60988 if (unlikely(atomic_read(&tx_ring->tx_count) < 2)) {
60989 QPRINTK(qdev, TX_QUEUED, INFO,
60990 "%s: shutting down tx queue %d du to lack of resources.\n",
60991 @@ -1955,6 +1917,10 @@
60992 tx_ring_desc = &tx_ring->q[tx_ring->prod_idx];
60993 mac_iocb_ptr = tx_ring_desc->queue_entry;
60994 memset((void *)mac_iocb_ptr, 0, sizeof(mac_iocb_ptr));
60995 + if (ql_map_send(qdev, mac_iocb_ptr, skb, tx_ring_desc) != NETDEV_TX_OK) {
60996 + QPRINTK(qdev, TX_QUEUED, ERR, "Could not map the segments.\n");
60997 + return NETDEV_TX_BUSY;
60998 + }
60999
61000 mac_iocb_ptr->opcode = OPCODE_OB_MAC_IOCB;
61001 mac_iocb_ptr->tid = tx_ring_desc->index;
61002 @@ -1980,12 +1946,6 @@
61003 ql_hw_csum_setup(skb,
61004 (struct ob_mac_tso_iocb_req *)mac_iocb_ptr);
61005 }
61006 - if (ql_map_send(qdev, mac_iocb_ptr, skb, tx_ring_desc) !=
61007 - NETDEV_TX_OK) {
61008 - QPRINTK(qdev, TX_QUEUED, ERR,
61009 - "Could not map the segments.\n");
61010 - return NETDEV_TX_BUSY;
61011 - }
61012 QL_DUMP_OB_MAC_IOCB(mac_iocb_ptr);
61013 tx_ring->prod_idx++;
61014 if (tx_ring->prod_idx == tx_ring->wq_len)
61015 @@ -2903,8 +2863,8 @@
61016 /*
61017 * Fill out the Indirection Table.
61018 */
61019 - for (i = 0; i < 256; i++)
61020 - hash_id[i] = i & (qdev->rss_ring_count - 1);
61021 + for (i = 0; i < 32; i++)
61022 + hash_id[i] = i & 1;
61023
61024 /*
61025 * Random values for the IPv6 and IPv4 Hash Keys.
61026 @@ -2987,9 +2947,9 @@
61027 mask = value << 16;
61028 ql_write32(qdev, SYS, mask | value);
61029
61030 - /* Set the default queue, and VLAN behavior. */
61031 - value = NIC_RCV_CFG_DFQ | NIC_RCV_CFG_RV;
61032 - mask = NIC_RCV_CFG_DFQ_MASK | (NIC_RCV_CFG_RV << 16);
61033 + /* Set the default queue. */
61034 + value = NIC_RCV_CFG_DFQ;
61035 + mask = NIC_RCV_CFG_DFQ_MASK;
61036 ql_write32(qdev, NIC_RCV_CFG, (mask | value));
61037
61038 /* Set the MPI interrupt to enabled. */
61039 @@ -3130,11 +3090,7 @@
61040 netif_stop_queue(ndev);
61041 netif_carrier_off(ndev);
61042
61043 - /* Don't kill the reset worker thread if we
61044 - * are in the process of recovery.
61045 - */
61046 - if (test_bit(QL_ADAPTER_UP, &qdev->flags))
61047 - cancel_delayed_work_sync(&qdev->asic_reset_work);
61048 + cancel_delayed_work_sync(&qdev->asic_reset_work);
61049 cancel_delayed_work_sync(&qdev->mpi_reset_work);
61050 cancel_delayed_work_sync(&qdev->mpi_work);
61051
61052 @@ -3166,11 +3122,6 @@
61053
61054 ql_tx_ring_clean(qdev);
61055
61056 - /* Call netif_napi_del() from common point.
61057 - */
61058 - for (i = qdev->rss_ring_first_cq_id; i < qdev->rx_ring_count; i++)
61059 - netif_napi_del(&qdev->rx_ring[i].napi);
61060 -
61061 spin_lock(&qdev->hw_lock);
61062 status = ql_adapter_reset(qdev);
61063 if (status)
61064 @@ -3540,7 +3491,7 @@
61065 static void qlge_tx_timeout(struct net_device *ndev)
61066 {
61067 struct ql_adapter *qdev = (struct ql_adapter *)netdev_priv(ndev);
61068 - ql_queue_asic_error(qdev);
61069 + queue_delayed_work(qdev->workqueue, &qdev->asic_reset_work, 0);
61070 }
61071
61072 static void ql_asic_reset_work(struct work_struct *work)
61073 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/r6040.c linux-2.6.29-rc3.owrt/drivers/net/r6040.c
61074 --- linux-2.6.29.owrt/drivers/net/r6040.c 2009-05-10 22:04:38.000000000 +0200
61075 +++ linux-2.6.29-rc3.owrt/drivers/net/r6040.c 2009-05-10 23:48:29.000000000 +0200
61076 @@ -438,6 +438,7 @@
61077 {
61078 struct r6040_private *lp = netdev_priv(dev);
61079 void __iomem *ioaddr = lp->base;
61080 + struct pci_dev *pdev = lp->pdev;
61081 int limit = 2048;
61082 u16 *adrp;
61083 u16 cmd;
61084 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/r8169.c linux-2.6.29-rc3.owrt/drivers/net/r8169.c
61085 --- linux-2.6.29.owrt/drivers/net/r8169.c 2009-05-10 22:04:38.000000000 +0200
61086 +++ linux-2.6.29-rc3.owrt/drivers/net/r8169.c 2009-05-10 23:48:29.000000000 +0200
61087 @@ -437,22 +437,6 @@
61088 RTL_FEATURE_GMII = (1 << 2),
61089 };
61090
61091 -struct rtl8169_counters {
61092 - __le64 tx_packets;
61093 - __le64 rx_packets;
61094 - __le64 tx_errors;
61095 - __le32 rx_errors;
61096 - __le16 rx_missed;
61097 - __le16 align_errors;
61098 - __le32 tx_one_collision;
61099 - __le32 tx_multi_collision;
61100 - __le64 rx_unicast;
61101 - __le64 rx_broadcast;
61102 - __le32 rx_multicast;
61103 - __le16 tx_aborted;
61104 - __le16 tx_underun;
61105 -};
61106 -
61107 struct rtl8169_private {
61108 void __iomem *mmio_addr; /* memory map physical address */
61109 struct pci_dev *pci_dev; /* Index of PCI device */
61110 @@ -496,7 +480,6 @@
61111 unsigned features;
61112
61113 struct mii_if_info mii;
61114 - struct rtl8169_counters counters;
61115 };
61116
61117 MODULE_AUTHOR("Realtek and the Linux r8169 crew <netdev@vger.kernel.org>");
61118 @@ -1117,6 +1100,22 @@
61119 "tx_underrun",
61120 };
61121
61122 +struct rtl8169_counters {
61123 + __le64 tx_packets;
61124 + __le64 rx_packets;
61125 + __le64 tx_errors;
61126 + __le32 rx_errors;
61127 + __le16 rx_missed;
61128 + __le16 align_errors;
61129 + __le32 tx_one_collision;
61130 + __le32 tx_multi_collision;
61131 + __le64 rx_unicast;
61132 + __le64 rx_broadcast;
61133 + __le32 rx_multicast;
61134 + __le16 tx_aborted;
61135 + __le16 tx_underun;
61136 +};
61137 +
61138 static int rtl8169_get_sset_count(struct net_device *dev, int sset)
61139 {
61140 switch (sset) {
61141 @@ -1127,21 +1126,16 @@
61142 }
61143 }
61144
61145 -static void rtl8169_update_counters(struct net_device *dev)
61146 +static void rtl8169_get_ethtool_stats(struct net_device *dev,
61147 + struct ethtool_stats *stats, u64 *data)
61148 {
61149 struct rtl8169_private *tp = netdev_priv(dev);
61150 void __iomem *ioaddr = tp->mmio_addr;
61151 struct rtl8169_counters *counters;
61152 dma_addr_t paddr;
61153 u32 cmd;
61154 - int wait = 1000;
61155
61156 - /*
61157 - * Some chips are unable to dump tally counters when the receiver
61158 - * is disabled.
61159 - */
61160 - if ((RTL_R8(ChipCmd) & CmdRxEnb) == 0)
61161 - return;
61162 + ASSERT_RTNL();
61163
61164 counters = pci_alloc_consistent(tp->pci_dev, sizeof(*counters), &paddr);
61165 if (!counters)
61166 @@ -1152,43 +1146,29 @@
61167 RTL_W32(CounterAddrLow, cmd);
61168 RTL_W32(CounterAddrLow, cmd | CounterDump);
61169
61170 - while (wait--) {
61171 - if ((RTL_R32(CounterAddrLow) & CounterDump) == 0) {
61172 - /* copy updated counters */
61173 - memcpy(&tp->counters, counters, sizeof(*counters));
61174 + while (RTL_R32(CounterAddrLow) & CounterDump) {
61175 + if (msleep_interruptible(1))
61176 break;
61177 - }
61178 - udelay(10);
61179 }
61180
61181 RTL_W32(CounterAddrLow, 0);
61182 RTL_W32(CounterAddrHigh, 0);
61183
61184 - pci_free_consistent(tp->pci_dev, sizeof(*counters), counters, paddr);
61185 -}
61186 + data[0] = le64_to_cpu(counters->tx_packets);
61187 + data[1] = le64_to_cpu(counters->rx_packets);
61188 + data[2] = le64_to_cpu(counters->tx_errors);
61189 + data[3] = le32_to_cpu(counters->rx_errors);
61190 + data[4] = le16_to_cpu(counters->rx_missed);
61191 + data[5] = le16_to_cpu(counters->align_errors);
61192 + data[6] = le32_to_cpu(counters->tx_one_collision);
61193 + data[7] = le32_to_cpu(counters->tx_multi_collision);
61194 + data[8] = le64_to_cpu(counters->rx_unicast);
61195 + data[9] = le64_to_cpu(counters->rx_broadcast);
61196 + data[10] = le32_to_cpu(counters->rx_multicast);
61197 + data[11] = le16_to_cpu(counters->tx_aborted);
61198 + data[12] = le16_to_cpu(counters->tx_underun);
61199
61200 -static void rtl8169_get_ethtool_stats(struct net_device *dev,
61201 - struct ethtool_stats *stats, u64 *data)
61202 -{
61203 - struct rtl8169_private *tp = netdev_priv(dev);
61204 -
61205 - ASSERT_RTNL();
61206 -
61207 - rtl8169_update_counters(dev);
61208 -
61209 - data[0] = le64_to_cpu(tp->counters.tx_packets);
61210 - data[1] = le64_to_cpu(tp->counters.rx_packets);
61211 - data[2] = le64_to_cpu(tp->counters.tx_errors);
61212 - data[3] = le32_to_cpu(tp->counters.rx_errors);
61213 - data[4] = le16_to_cpu(tp->counters.rx_missed);
61214 - data[5] = le16_to_cpu(tp->counters.align_errors);
61215 - data[6] = le32_to_cpu(tp->counters.tx_one_collision);
61216 - data[7] = le32_to_cpu(tp->counters.tx_multi_collision);
61217 - data[8] = le64_to_cpu(tp->counters.rx_unicast);
61218 - data[9] = le64_to_cpu(tp->counters.rx_broadcast);
61219 - data[10] = le32_to_cpu(tp->counters.rx_multicast);
61220 - data[11] = le16_to_cpu(tp->counters.tx_aborted);
61221 - data[12] = le16_to_cpu(tp->counters.tx_underun);
61222 + pci_free_consistent(tp->pci_dev, sizeof(*counters), counters, paddr);
61223 }
61224
61225 static void rtl8169_get_strings(struct net_device *dev, u32 stringset, u8 *data)
61226 @@ -3253,6 +3233,13 @@
61227 opts1 |= FirstFrag;
61228 } else {
61229 len = skb->len;
61230 +
61231 + if (unlikely(len < ETH_ZLEN)) {
61232 + if (skb_padto(skb, ETH_ZLEN))
61233 + goto err_update_stats;
61234 + len = ETH_ZLEN;
61235 + }
61236 +
61237 opts1 |= FirstFrag | LastFrag;
61238 tp->tx_skb[entry].skb = skb;
61239 }
61240 @@ -3290,6 +3277,7 @@
61241 err_stop:
61242 netif_stop_queue(dev);
61243 ret = NETDEV_TX_BUSY;
61244 +err_update_stats:
61245 dev->stats.tx_dropped++;
61246 goto out;
61247 }
61248 @@ -3696,9 +3684,6 @@
61249 struct rtl8169_private *tp = netdev_priv(dev);
61250 struct pci_dev *pdev = tp->pci_dev;
61251
61252 - /* update counters before going down */
61253 - rtl8169_update_counters(dev);
61254 -
61255 rtl8169_down(dev);
61256
61257 free_irq(dev->irq, dev);
61258 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/sfc/efx.c linux-2.6.29-rc3.owrt/drivers/net/sfc/efx.c
61259 --- linux-2.6.29.owrt/drivers/net/sfc/efx.c 2009-05-10 22:04:38.000000000 +0200
61260 +++ linux-2.6.29-rc3.owrt/drivers/net/sfc/efx.c 2009-05-10 23:48:29.000000000 +0200
61261 @@ -676,8 +676,9 @@
61262 rc = efx->phy_op->init(efx);
61263 if (rc)
61264 return rc;
61265 - mutex_lock(&efx->mac_lock);
61266 efx->phy_op->reconfigure(efx);
61267 +
61268 + mutex_lock(&efx->mac_lock);
61269 rc = falcon_switch_mac(efx);
61270 mutex_unlock(&efx->mac_lock);
61271 if (rc)
61272 @@ -685,7 +686,7 @@
61273 efx->mac_op->reconfigure(efx);
61274
61275 efx->port_initialized = true;
61276 - efx_stats_enable(efx);
61277 + efx->stats_enabled = true;
61278 return 0;
61279
61280 fail:
61281 @@ -734,7 +735,6 @@
61282 if (!efx->port_initialized)
61283 return;
61284
61285 - efx_stats_disable(efx);
61286 efx->phy_op->fini(efx);
61287 efx->port_initialized = false;
61288
61289 @@ -1361,20 +1361,6 @@
61290 return 0;
61291 }
61292
61293 -void efx_stats_disable(struct efx_nic *efx)
61294 -{
61295 - spin_lock(&efx->stats_lock);
61296 - ++efx->stats_disable_count;
61297 - spin_unlock(&efx->stats_lock);
61298 -}
61299 -
61300 -void efx_stats_enable(struct efx_nic *efx)
61301 -{
61302 - spin_lock(&efx->stats_lock);
61303 - --efx->stats_disable_count;
61304 - spin_unlock(&efx->stats_lock);
61305 -}
61306 -
61307 /* Context: process, dev_base_lock or RTNL held, non-blocking. */
61308 static struct net_device_stats *efx_net_stats(struct net_device *net_dev)
61309 {
61310 @@ -1383,12 +1369,12 @@
61311 struct net_device_stats *stats = &net_dev->stats;
61312
61313 /* Update stats if possible, but do not wait if another thread
61314 - * is updating them or if MAC stats fetches are temporarily
61315 - * disabled; slightly stale stats are acceptable.
61316 + * is updating them (or resetting the NIC); slightly stale
61317 + * stats are acceptable.
61318 */
61319 if (!spin_trylock(&efx->stats_lock))
61320 return stats;
61321 - if (!efx->stats_disable_count) {
61322 + if (efx->stats_enabled) {
61323 efx->mac_op->update_stats(efx);
61324 falcon_update_nic_stats(efx);
61325 }
61326 @@ -1636,12 +1622,16 @@
61327
61328 /* Tears down the entire software state and most of the hardware state
61329 * before reset. */
61330 -void efx_reset_down(struct efx_nic *efx, enum reset_type method,
61331 - struct ethtool_cmd *ecmd)
61332 +void efx_reset_down(struct efx_nic *efx, struct ethtool_cmd *ecmd)
61333 {
61334 EFX_ASSERT_RESET_SERIALISED(efx);
61335
61336 - efx_stats_disable(efx);
61337 + /* The net_dev->get_stats handler is quite slow, and will fail
61338 + * if a fetch is pending over reset. Serialise against it. */
61339 + spin_lock(&efx->stats_lock);
61340 + efx->stats_enabled = false;
61341 + spin_unlock(&efx->stats_lock);
61342 +
61343 efx_stop_all(efx);
61344 mutex_lock(&efx->mac_lock);
61345 mutex_lock(&efx->spi_lock);
61346 @@ -1649,8 +1639,6 @@
61347 efx->phy_op->get_settings(efx, ecmd);
61348
61349 efx_fini_channels(efx);
61350 - if (efx->port_initialized && method != RESET_TYPE_INVISIBLE)
61351 - efx->phy_op->fini(efx);
61352 }
61353
61354 /* This function will always ensure that the locks acquired in
61355 @@ -1658,8 +1646,7 @@
61356 * that we were unable to reinitialise the hardware, and the
61357 * driver should be disabled. If ok is false, then the rx and tx
61358 * engines are not restarted, pending a RESET_DISABLE. */
61359 -int efx_reset_up(struct efx_nic *efx, enum reset_type method,
61360 - struct ethtool_cmd *ecmd, bool ok)
61361 +int efx_reset_up(struct efx_nic *efx, struct ethtool_cmd *ecmd, bool ok)
61362 {
61363 int rc;
61364
61365 @@ -1671,15 +1658,6 @@
61366 ok = false;
61367 }
61368
61369 - if (efx->port_initialized && method != RESET_TYPE_INVISIBLE) {
61370 - if (ok) {
61371 - rc = efx->phy_op->init(efx);
61372 - if (rc)
61373 - ok = false;
61374 - } else
61375 - efx->port_initialized = false;
61376 - }
61377 -
61378 if (ok) {
61379 efx_init_channels(efx);
61380
61381 @@ -1692,7 +1670,7 @@
61382
61383 if (ok) {
61384 efx_start_all(efx);
61385 - efx_stats_enable(efx);
61386 + efx->stats_enabled = true;
61387 }
61388 return rc;
61389 }
61390 @@ -1724,7 +1702,7 @@
61391
61392 EFX_INFO(efx, "resetting (%d)\n", method);
61393
61394 - efx_reset_down(efx, method, &ecmd);
61395 + efx_reset_down(efx, &ecmd);
61396
61397 rc = falcon_reset_hw(efx, method);
61398 if (rc) {
61399 @@ -1743,10 +1721,10 @@
61400
61401 /* Leave device stopped if necessary */
61402 if (method == RESET_TYPE_DISABLE) {
61403 - efx_reset_up(efx, method, &ecmd, false);
61404 + efx_reset_up(efx, &ecmd, false);
61405 rc = -EIO;
61406 } else {
61407 - rc = efx_reset_up(efx, method, &ecmd, true);
61408 + rc = efx_reset_up(efx, &ecmd, true);
61409 }
61410
61411 out_disable:
61412 @@ -1898,7 +1876,6 @@
61413 efx->rx_checksum_enabled = true;
61414 spin_lock_init(&efx->netif_stop_lock);
61415 spin_lock_init(&efx->stats_lock);
61416 - efx->stats_disable_count = 1;
61417 mutex_init(&efx->mac_lock);
61418 efx->mac_op = &efx_dummy_mac_operations;
61419 efx->phy_op = &efx_dummy_phy_operations;
61420 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/sfc/efx.h linux-2.6.29-rc3.owrt/drivers/net/sfc/efx.h
61421 --- linux-2.6.29.owrt/drivers/net/sfc/efx.h 2009-05-10 22:04:38.000000000 +0200
61422 +++ linux-2.6.29-rc3.owrt/drivers/net/sfc/efx.h 2009-05-10 23:48:29.000000000 +0200
61423 @@ -36,16 +36,13 @@
61424 extern void efx_flush_queues(struct efx_nic *efx);
61425
61426 /* Ports */
61427 -extern void efx_stats_disable(struct efx_nic *efx);
61428 -extern void efx_stats_enable(struct efx_nic *efx);
61429 extern void efx_reconfigure_port(struct efx_nic *efx);
61430 extern void __efx_reconfigure_port(struct efx_nic *efx);
61431
61432 /* Reset handling */
61433 -extern void efx_reset_down(struct efx_nic *efx, enum reset_type method,
61434 - struct ethtool_cmd *ecmd);
61435 -extern int efx_reset_up(struct efx_nic *efx, enum reset_type method,
61436 - struct ethtool_cmd *ecmd, bool ok);
61437 +extern void efx_reset_down(struct efx_nic *efx, struct ethtool_cmd *ecmd);
61438 +extern int efx_reset_up(struct efx_nic *efx, struct ethtool_cmd *ecmd,
61439 + bool ok);
61440
61441 /* Global */
61442 extern void efx_schedule_reset(struct efx_nic *efx, enum reset_type type);
61443 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/sfc/ethtool.c linux-2.6.29-rc3.owrt/drivers/net/sfc/ethtool.c
61444 --- linux-2.6.29.owrt/drivers/net/sfc/ethtool.c 2009-05-10 22:04:38.000000000 +0200
61445 +++ linux-2.6.29-rc3.owrt/drivers/net/sfc/ethtool.c 2009-05-10 23:48:29.000000000 +0200
61446 @@ -219,6 +219,9 @@
61447 struct efx_nic *efx = netdev_priv(net_dev);
61448 int rc;
61449
61450 + if (EFX_WORKAROUND_13963(efx) && !ecmd->autoneg)
61451 + return -EINVAL;
61452 +
61453 /* Falcon GMAC does not support 1000Mbps HD */
61454 if (ecmd->speed == SPEED_1000 && ecmd->duplex != DUPLEX_FULL) {
61455 EFX_LOG(efx, "rejecting unsupported 1000Mbps HD"
61456 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/sfc/falcon.c linux-2.6.29-rc3.owrt/drivers/net/sfc/falcon.c
61457 --- linux-2.6.29.owrt/drivers/net/sfc/falcon.c 2009-05-10 22:04:38.000000000 +0200
61458 +++ linux-2.6.29-rc3.owrt/drivers/net/sfc/falcon.c 2009-05-10 23:48:29.000000000 +0200
61459 @@ -824,6 +824,10 @@
61460 rx_ev_pause_frm ? " [PAUSE]" : "");
61461 }
61462 #endif
61463 +
61464 + if (unlikely(rx_ev_eth_crc_err && EFX_WORKAROUND_10750(efx) &&
61465 + efx->phy_type == PHY_TYPE_SFX7101))
61466 + tenxpress_crc_err(efx);
61467 }
61468
61469 /* Handle receive events that are not in-order. */
61470 @@ -1883,7 +1887,7 @@
61471
61472 /* MAC stats will fail whilst the TX fifo is draining. Serialise
61473 * the drain sequence with the statistics fetch */
61474 - efx_stats_disable(efx);
61475 + spin_lock(&efx->stats_lock);
61476
61477 falcon_read(efx, &reg, MAC0_CTRL_REG_KER);
61478 EFX_SET_OWORD_FIELD(reg, TXFIFO_DRAIN_EN_B0, 1);
61479 @@ -1913,7 +1917,7 @@
61480 udelay(10);
61481 }
61482
61483 - efx_stats_enable(efx);
61484 + spin_unlock(&efx->stats_lock);
61485
61486 /* If we've reset the EM block and the link is up, then
61487 * we'll have to kick the XAUI link so the PHY can recover */
61488 @@ -2273,10 +2277,6 @@
61489 struct efx_mac_operations *old_mac_op = efx->mac_op;
61490 efx_oword_t nic_stat;
61491 unsigned strap_val;
61492 - int rc = 0;
61493 -
61494 - /* Don't try to fetch MAC stats while we're switching MACs */
61495 - efx_stats_disable(efx);
61496
61497 /* Internal loopbacks override the phy speed setting */
61498 if (efx->loopback_mode == LOOPBACK_GMAC) {
61499 @@ -2287,12 +2287,16 @@
61500 efx->link_fd = true;
61501 }
61502
61503 - WARN_ON(!mutex_is_locked(&efx->mac_lock));
61504 efx->mac_op = (EFX_IS10G(efx) ?
61505 &falcon_xmac_operations : &falcon_gmac_operations);
61506 + if (old_mac_op == efx->mac_op)
61507 + return 0;
61508 +
61509 + WARN_ON(!mutex_is_locked(&efx->mac_lock));
61510 +
61511 + /* Not all macs support a mac-level link state */
61512 + efx->mac_up = true;
61513
61514 - /* Always push the NIC_STAT_REG setting even if the mac hasn't
61515 - * changed, because this function is run post online reset */
61516 falcon_read(efx, &nic_stat, NIC_STAT_REG);
61517 strap_val = EFX_IS10G(efx) ? 5 : 3;
61518 if (falcon_rev(efx) >= FALCON_REV_B0) {
61519 @@ -2305,17 +2309,9 @@
61520 BUG_ON(EFX_OWORD_FIELD(nic_stat, STRAP_PINS) != strap_val);
61521 }
61522
61523 - if (old_mac_op == efx->mac_op)
61524 - goto out;
61525
61526 EFX_LOG(efx, "selected %cMAC\n", EFX_IS10G(efx) ? 'X' : 'G');
61527 - /* Not all macs support a mac-level link state */
61528 - efx->mac_up = true;
61529 -
61530 - rc = falcon_reset_macs(efx);
61531 -out:
61532 - efx_stats_enable(efx);
61533 - return rc;
61534 + return falcon_reset_macs(efx);
61535 }
61536
61537 /* This call is responsible for hooking in the MAC and PHY operations */
61538 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/sfc/mdio_10g.c linux-2.6.29-rc3.owrt/drivers/net/sfc/mdio_10g.c
61539 --- linux-2.6.29.owrt/drivers/net/sfc/mdio_10g.c 2009-05-10 22:04:38.000000000 +0200
61540 +++ linux-2.6.29-rc3.owrt/drivers/net/sfc/mdio_10g.c 2009-05-10 23:48:29.000000000 +0200
61541 @@ -15,7 +15,6 @@
61542 #include "net_driver.h"
61543 #include "mdio_10g.h"
61544 #include "boards.h"
61545 -#include "workarounds.h"
61546
61547 int mdio_clause45_reset_mmd(struct efx_nic *port, int mmd,
61548 int spins, int spintime)
61549 @@ -180,12 +179,17 @@
61550 return false;
61551 else if (efx_phy_mode_disabled(efx->phy_mode))
61552 return false;
61553 - else if (efx->loopback_mode == LOOPBACK_PHYXS)
61554 + else if (efx->loopback_mode == LOOPBACK_PHYXS) {
61555 mmd_mask &= ~(MDIO_MMDREG_DEVS_PHYXS |
61556 MDIO_MMDREG_DEVS_PCS |
61557 MDIO_MMDREG_DEVS_PMAPMD |
61558 MDIO_MMDREG_DEVS_AN);
61559 - else if (efx->loopback_mode == LOOPBACK_PCS)
61560 + if (!mmd_mask) {
61561 + reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_PHYXS,
61562 + MDIO_PHYXS_STATUS2);
61563 + return !(reg & (1 << MDIO_PHYXS_STATUS2_RX_FAULT_LBN));
61564 + }
61565 + } else if (efx->loopback_mode == LOOPBACK_PCS)
61566 mmd_mask &= ~(MDIO_MMDREG_DEVS_PCS |
61567 MDIO_MMDREG_DEVS_PMAPMD |
61568 MDIO_MMDREG_DEVS_AN);
61569 @@ -193,13 +197,6 @@
61570 mmd_mask &= ~(MDIO_MMDREG_DEVS_PMAPMD |
61571 MDIO_MMDREG_DEVS_AN);
61572
61573 - if (!mmd_mask) {
61574 - /* Use presence of XGMII faults in leui of link state */
61575 - reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_PHYXS,
61576 - MDIO_PHYXS_STATUS2);
61577 - return !(reg & (1 << MDIO_PHYXS_STATUS2_RX_FAULT_LBN));
61578 - }
61579 -
61580 while (mmd_mask) {
61581 if (mmd_mask & 1) {
61582 /* Double reads because link state is latched, and a
61583 @@ -266,7 +263,7 @@
61584 }
61585 }
61586
61587 -static u32 mdio_clause45_get_an(struct efx_nic *efx, u16 addr)
61588 +static u32 mdio_clause45_get_an(struct efx_nic *efx, u16 addr, u32 xnp)
61589 {
61590 int phy_id = efx->mii.phy_id;
61591 u32 result = 0;
61592 @@ -281,6 +278,9 @@
61593 result |= ADVERTISED_100baseT_Half;
61594 if (reg & ADVERTISE_100FULL)
61595 result |= ADVERTISED_100baseT_Full;
61596 + if (reg & LPA_RESV)
61597 + result |= xnp;
61598 +
61599 return result;
61600 }
61601
61602 @@ -310,7 +310,7 @@
61603 */
61604 void mdio_clause45_get_settings_ext(struct efx_nic *efx,
61605 struct ethtool_cmd *ecmd,
61606 - u32 npage_adv, u32 npage_lpa)
61607 + u32 xnp, u32 xnp_lpa)
61608 {
61609 int phy_id = efx->mii.phy_id;
61610 int reg;
61611 @@ -361,8 +361,8 @@
61612 ecmd->autoneg = AUTONEG_ENABLE;
61613 ecmd->advertising |=
61614 ADVERTISED_Autoneg |
61615 - mdio_clause45_get_an(efx, MDIO_AN_ADVERTISE) |
61616 - npage_adv;
61617 + mdio_clause45_get_an(efx,
61618 + MDIO_AN_ADVERTISE, xnp);
61619 } else
61620 ecmd->autoneg = AUTONEG_DISABLE;
61621 } else
61622 @@ -371,30 +371,27 @@
61623 if (ecmd->autoneg) {
61624 /* If AN is complete, report best common mode,
61625 * otherwise report best advertised mode. */
61626 - u32 modes = 0;
61627 + u32 common = ecmd->advertising;
61628 if (mdio_clause45_read(efx, phy_id, MDIO_MMD_AN,
61629 MDIO_MMDREG_STAT1) &
61630 - (1 << MDIO_AN_STATUS_AN_DONE_LBN))
61631 - modes = (ecmd->advertising &
61632 - (mdio_clause45_get_an(efx, MDIO_AN_LPA) |
61633 - npage_lpa));
61634 - if (modes == 0)
61635 - modes = ecmd->advertising;
61636 -
61637 - if (modes & ADVERTISED_10000baseT_Full) {
61638 + (1 << MDIO_AN_STATUS_AN_DONE_LBN)) {
61639 + common &= mdio_clause45_get_an(efx, MDIO_AN_LPA,
61640 + xnp_lpa);
61641 + }
61642 + if (common & ADVERTISED_10000baseT_Full) {
61643 ecmd->speed = SPEED_10000;
61644 ecmd->duplex = DUPLEX_FULL;
61645 - } else if (modes & (ADVERTISED_1000baseT_Full |
61646 - ADVERTISED_1000baseT_Half)) {
61647 + } else if (common & (ADVERTISED_1000baseT_Full |
61648 + ADVERTISED_1000baseT_Half)) {
61649 ecmd->speed = SPEED_1000;
61650 - ecmd->duplex = !!(modes & ADVERTISED_1000baseT_Full);
61651 - } else if (modes & (ADVERTISED_100baseT_Full |
61652 - ADVERTISED_100baseT_Half)) {
61653 + ecmd->duplex = !!(common & ADVERTISED_1000baseT_Full);
61654 + } else if (common & (ADVERTISED_100baseT_Full |
61655 + ADVERTISED_100baseT_Half)) {
61656 ecmd->speed = SPEED_100;
61657 - ecmd->duplex = !!(modes & ADVERTISED_100baseT_Full);
61658 + ecmd->duplex = !!(common & ADVERTISED_100baseT_Full);
61659 } else {
61660 ecmd->speed = SPEED_10;
61661 - ecmd->duplex = !!(modes & ADVERTISED_10baseT_Full);
61662 + ecmd->duplex = !!(common & ADVERTISED_10baseT_Full);
61663 }
61664 } else {
61665 /* Report forced settings */
61666 @@ -418,7 +415,7 @@
61667 int phy_id = efx->mii.phy_id;
61668 struct ethtool_cmd prev;
61669 u32 required;
61670 - int reg;
61671 + int ctrl1_bits, reg;
61672
61673 efx->phy_op->get_settings(efx, &prev);
61674
61675 @@ -433,83 +430,99 @@
61676 if (prev.port != PORT_TP || ecmd->port != PORT_TP)
61677 return -EINVAL;
61678
61679 - /* Check that PHY supports these settings */
61680 - if (ecmd->autoneg) {
61681 - required = SUPPORTED_Autoneg;
61682 - } else if (ecmd->duplex) {
61683 + /* Check that PHY supports these settings and work out the
61684 + * basic control bits */
61685 + if (ecmd->duplex) {
61686 switch (ecmd->speed) {
61687 - case SPEED_10: required = SUPPORTED_10baseT_Full; break;
61688 - case SPEED_100: required = SUPPORTED_100baseT_Full; break;
61689 - default: return -EINVAL;
61690 + case SPEED_10:
61691 + ctrl1_bits = BMCR_FULLDPLX;
61692 + required = SUPPORTED_10baseT_Full;
61693 + break;
61694 + case SPEED_100:
61695 + ctrl1_bits = BMCR_SPEED100 | BMCR_FULLDPLX;
61696 + required = SUPPORTED_100baseT_Full;
61697 + break;
61698 + case SPEED_1000:
61699 + ctrl1_bits = BMCR_SPEED1000 | BMCR_FULLDPLX;
61700 + required = SUPPORTED_1000baseT_Full;
61701 + break;
61702 + case SPEED_10000:
61703 + ctrl1_bits = (BMCR_SPEED1000 | BMCR_SPEED100 |
61704 + BMCR_FULLDPLX);
61705 + required = SUPPORTED_10000baseT_Full;
61706 + break;
61707 + default:
61708 + return -EINVAL;
61709 }
61710 } else {
61711 switch (ecmd->speed) {
61712 - case SPEED_10: required = SUPPORTED_10baseT_Half; break;
61713 - case SPEED_100: required = SUPPORTED_100baseT_Half; break;
61714 - default: return -EINVAL;
61715 + case SPEED_10:
61716 + ctrl1_bits = 0;
61717 + required = SUPPORTED_10baseT_Half;
61718 + break;
61719 + case SPEED_100:
61720 + ctrl1_bits = BMCR_SPEED100;
61721 + required = SUPPORTED_100baseT_Half;
61722 + break;
61723 + case SPEED_1000:
61724 + ctrl1_bits = BMCR_SPEED1000;
61725 + required = SUPPORTED_1000baseT_Half;
61726 + break;
61727 + default:
61728 + return -EINVAL;
61729 }
61730 }
61731 + if (ecmd->autoneg)
61732 + required |= SUPPORTED_Autoneg;
61733 required |= ecmd->advertising;
61734 if (required & ~prev.supported)
61735 return -EINVAL;
61736
61737 - if (ecmd->autoneg) {
61738 - bool xnp = (ecmd->advertising & ADVERTISED_10000baseT_Full
61739 - || EFX_WORKAROUND_13204(efx));
61740 -
61741 - /* Set up the base page */
61742 - reg = ADVERTISE_CSMA;
61743 - if (ecmd->advertising & ADVERTISED_10baseT_Half)
61744 - reg |= ADVERTISE_10HALF;
61745 - if (ecmd->advertising & ADVERTISED_10baseT_Full)
61746 - reg |= ADVERTISE_10FULL;
61747 - if (ecmd->advertising & ADVERTISED_100baseT_Half)
61748 - reg |= ADVERTISE_100HALF;
61749 - if (ecmd->advertising & ADVERTISED_100baseT_Full)
61750 - reg |= ADVERTISE_100FULL;
61751 - if (xnp)
61752 - reg |= ADVERTISE_RESV;
61753 - else if (ecmd->advertising & (ADVERTISED_1000baseT_Half |
61754 - ADVERTISED_1000baseT_Full))
61755 - reg |= ADVERTISE_NPAGE;
61756 - reg |= efx_fc_advertise(efx->wanted_fc);
61757 - mdio_clause45_write(efx, phy_id, MDIO_MMD_AN,
61758 - MDIO_AN_ADVERTISE, reg);
61759 -
61760 - /* Set up the (extended) next page if necessary */
61761 - if (efx->phy_op->set_npage_adv)
61762 - efx->phy_op->set_npage_adv(efx, ecmd->advertising);
61763 + /* Set the basic control bits */
61764 + reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_PMAPMD,
61765 + MDIO_MMDREG_CTRL1);
61766 + reg &= ~(BMCR_SPEED1000 | BMCR_SPEED100 | BMCR_FULLDPLX | 0x003c);
61767 + reg |= ctrl1_bits;
61768 + mdio_clause45_write(efx, phy_id, MDIO_MMD_PMAPMD, MDIO_MMDREG_CTRL1,
61769 + reg);
61770 +
61771 + /* Set the AN registers */
61772 + if (ecmd->autoneg != prev.autoneg ||
61773 + ecmd->advertising != prev.advertising) {
61774 + bool xnp = false;
61775 +
61776 + if (efx->phy_op->set_xnp_advertise)
61777 + xnp = efx->phy_op->set_xnp_advertise(efx,
61778 + ecmd->advertising);
61779 +
61780 + if (ecmd->autoneg) {
61781 + reg = 0;
61782 + if (ecmd->advertising & ADVERTISED_10baseT_Half)
61783 + reg |= ADVERTISE_10HALF;
61784 + if (ecmd->advertising & ADVERTISED_10baseT_Full)
61785 + reg |= ADVERTISE_10FULL;
61786 + if (ecmd->advertising & ADVERTISED_100baseT_Half)
61787 + reg |= ADVERTISE_100HALF;
61788 + if (ecmd->advertising & ADVERTISED_100baseT_Full)
61789 + reg |= ADVERTISE_100FULL;
61790 + if (xnp)
61791 + reg |= ADVERTISE_RESV;
61792 + mdio_clause45_write(efx, phy_id, MDIO_MMD_AN,
61793 + MDIO_AN_ADVERTISE, reg);
61794 + }
61795
61796 - /* Enable and restart AN */
61797 reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_AN,
61798 MDIO_MMDREG_CTRL1);
61799 - reg |= BMCR_ANENABLE;
61800 - if (!(EFX_WORKAROUND_15195(efx) &&
61801 - LOOPBACK_MASK(efx) & efx->phy_op->loopbacks))
61802 - reg |= BMCR_ANRESTART;
61803 + if (ecmd->autoneg)
61804 + reg |= BMCR_ANENABLE | BMCR_ANRESTART;
61805 + else
61806 + reg &= ~BMCR_ANENABLE;
61807 if (xnp)
61808 reg |= 1 << MDIO_AN_CTRL_XNP_LBN;
61809 else
61810 reg &= ~(1 << MDIO_AN_CTRL_XNP_LBN);
61811 mdio_clause45_write(efx, phy_id, MDIO_MMD_AN,
61812 MDIO_MMDREG_CTRL1, reg);
61813 - } else {
61814 - /* Disable AN */
61815 - mdio_clause45_set_flag(efx, phy_id, MDIO_MMD_AN,
61816 - MDIO_MMDREG_CTRL1,
61817 - __ffs(BMCR_ANENABLE), false);
61818 -
61819 - /* Set the basic control bits */
61820 - reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_PMAPMD,
61821 - MDIO_MMDREG_CTRL1);
61822 - reg &= ~(BMCR_SPEED1000 | BMCR_SPEED100 | BMCR_FULLDPLX |
61823 - 0x003c);
61824 - if (ecmd->speed == SPEED_100)
61825 - reg |= BMCR_SPEED100;
61826 - if (ecmd->duplex)
61827 - reg |= BMCR_FULLDPLX;
61828 - mdio_clause45_write(efx, phy_id, MDIO_MMD_PMAPMD,
61829 - MDIO_MMDREG_CTRL1, reg);
61830 }
61831
61832 return 0;
61833 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/sfc/mdio_10g.h linux-2.6.29-rc3.owrt/drivers/net/sfc/mdio_10g.h
61834 --- linux-2.6.29.owrt/drivers/net/sfc/mdio_10g.h 2009-05-10 22:04:38.000000000 +0200
61835 +++ linux-2.6.29-rc3.owrt/drivers/net/sfc/mdio_10g.h 2009-05-10 23:48:29.000000000 +0200
61836 @@ -155,8 +155,7 @@
61837 #define MDIO_AN_XNP 22
61838 #define MDIO_AN_LPA_XNP 25
61839
61840 -#define MDIO_AN_10GBT_CTRL 32
61841 -#define MDIO_AN_10GBT_CTRL_ADV_10G_LBN 12
61842 +#define MDIO_AN_10GBT_ADVERTISE 32
61843 #define MDIO_AN_10GBT_STATUS (33)
61844 #define MDIO_AN_10GBT_STATUS_MS_FLT_LBN (15) /* MASTER/SLAVE config fault */
61845 #define MDIO_AN_10GBT_STATUS_MS_LBN (14) /* MASTER/SLAVE config */
61846 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/sfc/net_driver.h linux-2.6.29-rc3.owrt/drivers/net/sfc/net_driver.h
61847 --- linux-2.6.29.owrt/drivers/net/sfc/net_driver.h 2009-05-10 22:04:38.000000000 +0200
61848 +++ linux-2.6.29-rc3.owrt/drivers/net/sfc/net_driver.h 2009-05-10 23:48:29.000000000 +0200
61849 @@ -566,7 +566,7 @@
61850 * @poll: Poll for hardware state. Serialised by the mac_lock.
61851 * @get_settings: Get ethtool settings. Serialised by the mac_lock.
61852 * @set_settings: Set ethtool settings. Serialised by the mac_lock.
61853 - * @set_npage_adv: Set abilities advertised in (Extended) Next Page
61854 + * @set_xnp_advertise: Set abilities advertised in Extended Next Page
61855 * (only needed where AN bit is set in mmds)
61856 * @num_tests: Number of PHY-specific tests/results
61857 * @test_names: Names of the tests/results
61858 @@ -586,7 +586,7 @@
61859 struct ethtool_cmd *ecmd);
61860 int (*set_settings) (struct efx_nic *efx,
61861 struct ethtool_cmd *ecmd);
61862 - void (*set_npage_adv) (struct efx_nic *efx, u32);
61863 + bool (*set_xnp_advertise) (struct efx_nic *efx, u32);
61864 u32 num_tests;
61865 const char *const *test_names;
61866 int (*run_tests) (struct efx_nic *efx, int *results, unsigned flags);
61867 @@ -754,7 +754,8 @@
61868 * &struct net_device_stats.
61869 * @stats_buffer: DMA buffer for statistics
61870 * @stats_lock: Statistics update lock. Serialises statistics fetches
61871 - * @stats_disable_count: Nest count for disabling statistics fetches
61872 + * @stats_enabled: Temporarily disable statistics fetches.
61873 + * Serialised by @stats_lock
61874 * @mac_op: MAC interface
61875 * @mac_address: Permanent MAC address
61876 * @phy_type: PHY type
61877 @@ -836,7 +837,7 @@
61878 struct efx_mac_stats mac_stats;
61879 struct efx_buffer stats_buffer;
61880 spinlock_t stats_lock;
61881 - unsigned int stats_disable_count;
61882 + bool stats_enabled;
61883
61884 struct efx_mac_operations *mac_op;
61885 unsigned char mac_address[ETH_ALEN];
61886 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/sfc/phy.h linux-2.6.29-rc3.owrt/drivers/net/sfc/phy.h
61887 --- linux-2.6.29.owrt/drivers/net/sfc/phy.h 2009-05-10 22:04:38.000000000 +0200
61888 +++ linux-2.6.29-rc3.owrt/drivers/net/sfc/phy.h 2009-05-10 23:48:29.000000000 +0200
61889 @@ -17,6 +17,7 @@
61890 extern struct efx_phy_operations falcon_sft9001_phy_ops;
61891
61892 extern void tenxpress_phy_blink(struct efx_nic *efx, bool blink);
61893 +extern void tenxpress_crc_err(struct efx_nic *efx);
61894
61895 /****************************************************************************
61896 * Exported functions from the driver for XFP optical PHYs
61897 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/sfc/selftest.c linux-2.6.29-rc3.owrt/drivers/net/sfc/selftest.c
61898 --- linux-2.6.29.owrt/drivers/net/sfc/selftest.c 2009-05-10 22:04:38.000000000 +0200
61899 +++ linux-2.6.29-rc3.owrt/drivers/net/sfc/selftest.c 2009-05-10 23:48:29.000000000 +0200
61900 @@ -665,7 +665,6 @@
61901 {
61902 enum efx_loopback_mode loopback_mode = efx->loopback_mode;
61903 int phy_mode = efx->phy_mode;
61904 - enum reset_type reset_method = RESET_TYPE_INVISIBLE;
61905 struct ethtool_cmd ecmd;
61906 struct efx_channel *channel;
61907 int rc_test = 0, rc_reset = 0, rc;
61908 @@ -719,21 +718,21 @@
61909 mutex_unlock(&efx->mac_lock);
61910
61911 /* free up all consumers of SRAM (including all the queues) */
61912 - efx_reset_down(efx, reset_method, &ecmd);
61913 + efx_reset_down(efx, &ecmd);
61914
61915 rc = efx_test_chip(efx, tests);
61916 if (rc && !rc_test)
61917 rc_test = rc;
61918
61919 /* reset the chip to recover from the register test */
61920 - rc_reset = falcon_reset_hw(efx, reset_method);
61921 + rc_reset = falcon_reset_hw(efx, RESET_TYPE_ALL);
61922
61923 /* Ensure that the phy is powered and out of loopback
61924 * for the bist and loopback tests */
61925 efx->phy_mode &= ~PHY_MODE_LOW_POWER;
61926 efx->loopback_mode = LOOPBACK_NONE;
61927
61928 - rc = efx_reset_up(efx, reset_method, &ecmd, rc_reset == 0);
61929 + rc = efx_reset_up(efx, &ecmd, rc_reset == 0);
61930 if (rc && !rc_reset)
61931 rc_reset = rc;
61932
61933 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/sfc/sfe4001.c linux-2.6.29-rc3.owrt/drivers/net/sfc/sfe4001.c
61934 --- linux-2.6.29.owrt/drivers/net/sfc/sfe4001.c 2009-05-10 22:04:38.000000000 +0200
61935 +++ linux-2.6.29-rc3.owrt/drivers/net/sfc/sfe4001.c 2009-05-10 23:48:29.000000000 +0200
61936 @@ -186,22 +186,19 @@
61937 {
61938 efx_oword_t reg;
61939
61940 - /* GPIO 3 and the GPIO register are shared with I2C, so block that */
61941 + /* GPIO pins are also used for I2C, so block that temporarily */
61942 mutex_lock(&efx->i2c_adap.bus_lock);
61943
61944 - /* Pull RST_N (GPIO 2) low then let it up again, setting the
61945 - * FLASH_CFG_1 strap (GPIO 3) appropriately. Only change the
61946 - * output enables; the output levels should always be 0 (low)
61947 - * and we rely on external pull-ups. */
61948 falcon_read(efx, &reg, GPIO_CTL_REG_KER);
61949 EFX_SET_OWORD_FIELD(reg, GPIO2_OEN, true);
61950 + EFX_SET_OWORD_FIELD(reg, GPIO2_OUT, false);
61951 falcon_write(efx, &reg, GPIO_CTL_REG_KER);
61952 msleep(1000);
61953 - EFX_SET_OWORD_FIELD(reg, GPIO2_OEN, false);
61954 - EFX_SET_OWORD_FIELD(reg, GPIO3_OEN,
61955 - !!(efx->phy_mode & PHY_MODE_SPECIAL));
61956 + EFX_SET_OWORD_FIELD(reg, GPIO2_OUT, true);
61957 + EFX_SET_OWORD_FIELD(reg, GPIO3_OEN, true);
61958 + EFX_SET_OWORD_FIELD(reg, GPIO3_OUT,
61959 + !(efx->phy_mode & PHY_MODE_SPECIAL));
61960 falcon_write(efx, &reg, GPIO_CTL_REG_KER);
61961 - msleep(1);
61962
61963 mutex_unlock(&efx->i2c_adap.bus_lock);
61964
61965 @@ -235,18 +232,12 @@
61966 } else if (efx->state != STATE_RUNNING || netif_running(efx->net_dev)) {
61967 err = -EBUSY;
61968 } else {
61969 - /* Reset the PHY, reconfigure the MAC and enable/disable
61970 - * MAC stats accordingly. */
61971 efx->phy_mode = new_mode;
61972 - if (new_mode & PHY_MODE_SPECIAL)
61973 - efx_stats_disable(efx);
61974 if (efx->board_info.type == EFX_BOARD_SFE4001)
61975 err = sfe4001_poweron(efx);
61976 else
61977 err = sfn4111t_reset(efx);
61978 efx_reconfigure_port(efx);
61979 - if (!(new_mode & PHY_MODE_SPECIAL))
61980 - efx_stats_enable(efx);
61981 }
61982 rtnl_unlock();
61983
61984 @@ -335,11 +326,6 @@
61985 efx->board_info.monitor = sfe4001_check_hw;
61986 efx->board_info.fini = sfe4001_fini;
61987
61988 - if (efx->phy_mode & PHY_MODE_SPECIAL) {
61989 - /* PHY won't generate a 156.25 MHz clock and MAC stats fetch
61990 - * will fail. */
61991 - efx_stats_disable(efx);
61992 - }
61993 rc = sfe4001_poweron(efx);
61994 if (rc)
61995 goto fail_ioexp;
61996 @@ -386,25 +372,17 @@
61997 i2c_unregister_device(efx->board_info.hwmon_client);
61998 }
61999
62000 -static struct i2c_board_info sfn4111t_a0_hwmon_info = {
62001 +static struct i2c_board_info sfn4111t_hwmon_info = {
62002 I2C_BOARD_INFO("max6647", 0x4e),
62003 .irq = -1,
62004 };
62005
62006 -static struct i2c_board_info sfn4111t_r5_hwmon_info = {
62007 - I2C_BOARD_INFO("max6646", 0x4d),
62008 - .irq = -1,
62009 -};
62010 -
62011 int sfn4111t_init(struct efx_nic *efx)
62012 {
62013 int rc;
62014
62015 efx->board_info.hwmon_client =
62016 - i2c_new_device(&efx->i2c_adap,
62017 - (efx->board_info.minor < 5) ?
62018 - &sfn4111t_a0_hwmon_info :
62019 - &sfn4111t_r5_hwmon_info);
62020 + i2c_new_device(&efx->i2c_adap, &sfn4111t_hwmon_info);
62021 if (!efx->board_info.hwmon_client)
62022 return -EIO;
62023
62024 @@ -416,10 +394,8 @@
62025 if (rc)
62026 goto fail_hwmon;
62027
62028 - if (efx->phy_mode & PHY_MODE_SPECIAL) {
62029 - efx_stats_disable(efx);
62030 + if (efx->phy_mode & PHY_MODE_SPECIAL)
62031 sfn4111t_reset(efx);
62032 - }
62033
62034 return 0;
62035
62036 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/sfc/tenxpress.c linux-2.6.29-rc3.owrt/drivers/net/sfc/tenxpress.c
62037 --- linux-2.6.29.owrt/drivers/net/sfc/tenxpress.c 2009-05-10 22:04:38.000000000 +0200
62038 +++ linux-2.6.29-rc3.owrt/drivers/net/sfc/tenxpress.c 2009-05-10 23:48:29.000000000 +0200
62039 @@ -67,8 +67,6 @@
62040 #define PMA_PMD_EXT_CLK312_WIDTH 1
62041 #define PMA_PMD_EXT_LPOWER_LBN 12
62042 #define PMA_PMD_EXT_LPOWER_WIDTH 1
62043 -#define PMA_PMD_EXT_ROBUST_LBN 14
62044 -#define PMA_PMD_EXT_ROBUST_WIDTH 1
62045 #define PMA_PMD_EXT_SSR_LBN 15
62046 #define PMA_PMD_EXT_SSR_WIDTH 1
62047
62048 @@ -179,24 +177,35 @@
62049 #define C22EXT_STATUS_LINK_LBN 2
62050 #define C22EXT_STATUS_LINK_WIDTH 1
62051
62052 -#define C22EXT_MSTSLV_CTRL 49161
62053 -#define C22EXT_MSTSLV_CTRL_ADV_1000_HD_LBN 8
62054 -#define C22EXT_MSTSLV_CTRL_ADV_1000_FD_LBN 9
62055 -
62056 -#define C22EXT_MSTSLV_STATUS 49162
62057 -#define C22EXT_MSTSLV_STATUS_LP_1000_HD_LBN 10
62058 -#define C22EXT_MSTSLV_STATUS_LP_1000_FD_LBN 11
62059 +#define C22EXT_MSTSLV_REG 49162
62060 +#define C22EXT_MSTSLV_1000_HD_LBN 10
62061 +#define C22EXT_MSTSLV_1000_HD_WIDTH 1
62062 +#define C22EXT_MSTSLV_1000_FD_LBN 11
62063 +#define C22EXT_MSTSLV_1000_FD_WIDTH 1
62064
62065 /* Time to wait between powering down the LNPGA and turning off the power
62066 * rails */
62067 #define LNPGA_PDOWN_WAIT (HZ / 5)
62068
62069 +static int crc_error_reset_threshold = 100;
62070 +module_param(crc_error_reset_threshold, int, 0644);
62071 +MODULE_PARM_DESC(crc_error_reset_threshold,
62072 + "Max number of CRC errors before XAUI reset");
62073 +
62074 struct tenxpress_phy_data {
62075 enum efx_loopback_mode loopback_mode;
62076 + atomic_t bad_crc_count;
62077 enum efx_phy_mode phy_mode;
62078 int bad_lp_tries;
62079 };
62080
62081 +void tenxpress_crc_err(struct efx_nic *efx)
62082 +{
62083 + struct tenxpress_phy_data *phy_data = efx->phy_data;
62084 + if (phy_data != NULL)
62085 + atomic_inc(&phy_data->bad_crc_count);
62086 +}
62087 +
62088 static ssize_t show_phy_short_reach(struct device *dev,
62089 struct device_attribute *attr, char *buf)
62090 {
62091 @@ -275,9 +284,7 @@
62092 PMA_PMD_XCONTROL_REG);
62093 reg |= ((1 << PMA_PMD_EXT_GMII_EN_LBN) |
62094 (1 << PMA_PMD_EXT_CLK_OUT_LBN) |
62095 - (1 << PMA_PMD_EXT_CLK312_LBN) |
62096 - (1 << PMA_PMD_EXT_ROBUST_LBN));
62097 -
62098 + (1 << PMA_PMD_EXT_CLK312_LBN));
62099 mdio_clause45_write(efx, phy_id, MDIO_MMD_PMAPMD,
62100 PMA_PMD_XCONTROL_REG, reg);
62101 mdio_clause45_set_flag(efx, phy_id, MDIO_MMD_C22EXT,
62102 @@ -339,7 +346,6 @@
62103 rc = tenxpress_init(efx);
62104 if (rc < 0)
62105 goto fail;
62106 - mdio_clause45_set_pause(efx);
62107
62108 if (efx->phy_type == PHY_TYPE_SFT9001B) {
62109 rc = device_create_file(&efx->pci_dev->dev,
62110 @@ -370,8 +376,8 @@
62111
62112 /* The XGMAC clock is driven from the SFC7101/SFT9001 312MHz clock, so
62113 * a special software reset can glitch the XGMAC sufficiently for stats
62114 - * requests to fail. */
62115 - efx_stats_disable(efx);
62116 + * requests to fail. Since we don't often special_reset, just lock. */
62117 + spin_lock(&efx->stats_lock);
62118
62119 /* Initiate reset */
62120 reg = mdio_clause45_read(efx, efx->mii.phy_id,
62121 @@ -386,17 +392,17 @@
62122 rc = mdio_clause45_wait_reset_mmds(efx,
62123 TENXPRESS_REQUIRED_DEVS);
62124 if (rc < 0)
62125 - goto out;
62126 + goto unlock;
62127
62128 /* Try and reconfigure the device */
62129 rc = tenxpress_init(efx);
62130 if (rc < 0)
62131 - goto out;
62132 + goto unlock;
62133
62134 /* Wait for the XGXS state machine to churn */
62135 mdelay(10);
62136 -out:
62137 - efx_stats_enable(efx);
62138 +unlock:
62139 + spin_unlock(&efx->stats_lock);
62140 return rc;
62141 }
62142
62143 @@ -514,7 +520,7 @@
62144 {
62145 struct tenxpress_phy_data *phy_data = efx->phy_data;
62146 struct ethtool_cmd ecmd;
62147 - bool phy_mode_change, loop_reset;
62148 + bool phy_mode_change, loop_reset, loop_toggle, loopback;
62149
62150 if (efx->phy_mode & (PHY_MODE_OFF | PHY_MODE_SPECIAL)) {
62151 phy_data->phy_mode = efx->phy_mode;
62152 @@ -525,10 +531,12 @@
62153
62154 phy_mode_change = (efx->phy_mode == PHY_MODE_NORMAL &&
62155 phy_data->phy_mode != PHY_MODE_NORMAL);
62156 + loopback = LOOPBACK_MASK(efx) & efx->phy_op->loopbacks;
62157 + loop_toggle = LOOPBACK_CHANGED(phy_data, efx, efx->phy_op->loopbacks);
62158 loop_reset = (LOOPBACK_OUT_OF(phy_data, efx, efx->phy_op->loopbacks) ||
62159 LOOPBACK_CHANGED(phy_data, efx, 1 << LOOPBACK_GPHY));
62160
62161 - if (loop_reset || phy_mode_change) {
62162 + if (loop_reset || loop_toggle || loopback || phy_mode_change) {
62163 int rc;
62164
62165 efx->phy_op->get_settings(efx, &ecmd);
62166 @@ -543,6 +551,20 @@
62167 falcon_reset_xaui(efx);
62168 }
62169
62170 + if (efx->phy_type != PHY_TYPE_SFX7101) {
62171 + /* Only change autoneg once, on coming out or
62172 + * going into loopback */
62173 + if (loop_toggle)
62174 + ecmd.autoneg = !loopback;
62175 + if (loopback) {
62176 + ecmd.duplex = DUPLEX_FULL;
62177 + if (efx->loopback_mode == LOOPBACK_GPHY)
62178 + ecmd.speed = SPEED_1000;
62179 + else
62180 + ecmd.speed = SPEED_10000;
62181 + }
62182 + }
62183 +
62184 rc = efx->phy_op->set_settings(efx, &ecmd);
62185 WARN_ON(rc);
62186 }
62187 @@ -601,6 +623,13 @@
62188
62189 if (phy_data->phy_mode != PHY_MODE_NORMAL)
62190 return;
62191 +
62192 + if (EFX_WORKAROUND_10750(efx) &&
62193 + atomic_read(&phy_data->bad_crc_count) > crc_error_reset_threshold) {
62194 + EFX_ERR(efx, "Resetting XAUI due to too many CRC errors\n");
62195 + falcon_reset_xaui(efx);
62196 + atomic_set(&phy_data->bad_crc_count, 0);
62197 + }
62198 }
62199
62200 static void tenxpress_phy_fini(struct efx_nic *efx)
62201 @@ -743,76 +772,107 @@
62202 return rc;
62203 }
62204
62205 -static void
62206 -tenxpress_get_settings(struct efx_nic *efx, struct ethtool_cmd *ecmd)
62207 +static u32 tenxpress_get_xnp_lpa(struct efx_nic *efx)
62208 {
62209 - int phy_id = efx->mii.phy_id;
62210 - u32 adv = 0, lpa = 0;
62211 + int phy = efx->mii.phy_id;
62212 + u32 lpa = 0;
62213 int reg;
62214
62215 if (efx->phy_type != PHY_TYPE_SFX7101) {
62216 - reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_C22EXT,
62217 - C22EXT_MSTSLV_CTRL);
62218 - if (reg & (1 << C22EXT_MSTSLV_CTRL_ADV_1000_FD_LBN))
62219 - adv |= ADVERTISED_1000baseT_Full;
62220 - reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_C22EXT,
62221 - C22EXT_MSTSLV_STATUS);
62222 - if (reg & (1 << C22EXT_MSTSLV_STATUS_LP_1000_HD_LBN))
62223 + reg = mdio_clause45_read(efx, phy, MDIO_MMD_C22EXT,
62224 + C22EXT_MSTSLV_REG);
62225 + if (reg & (1 << C22EXT_MSTSLV_1000_HD_LBN))
62226 lpa |= ADVERTISED_1000baseT_Half;
62227 - if (reg & (1 << C22EXT_MSTSLV_STATUS_LP_1000_FD_LBN))
62228 + if (reg & (1 << C22EXT_MSTSLV_1000_FD_LBN))
62229 lpa |= ADVERTISED_1000baseT_Full;
62230 }
62231 - reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_AN,
62232 - MDIO_AN_10GBT_CTRL);
62233 - if (reg & (1 << MDIO_AN_10GBT_CTRL_ADV_10G_LBN))
62234 - adv |= ADVERTISED_10000baseT_Full;
62235 - reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_AN,
62236 - MDIO_AN_10GBT_STATUS);
62237 + reg = mdio_clause45_read(efx, phy, MDIO_MMD_AN, MDIO_AN_10GBT_STATUS);
62238 if (reg & (1 << MDIO_AN_10GBT_STATUS_LP_10G_LBN))
62239 lpa |= ADVERTISED_10000baseT_Full;
62240 -
62241 - mdio_clause45_get_settings_ext(efx, ecmd, adv, lpa);
62242 -
62243 - if (efx->phy_type != PHY_TYPE_SFX7101)
62244 - ecmd->supported |= (SUPPORTED_100baseT_Full |
62245 - SUPPORTED_1000baseT_Full);
62246 -
62247 - /* In loopback, the PHY automatically brings up the correct interface,
62248 - * but doesn't advertise the correct speed. So override it */
62249 - if (efx->loopback_mode == LOOPBACK_GPHY)
62250 - ecmd->speed = SPEED_1000;
62251 - else if (LOOPBACK_MASK(efx) & efx->phy_op->loopbacks)
62252 - ecmd->speed = SPEED_10000;
62253 + return lpa;
62254 }
62255
62256 -static int tenxpress_set_settings(struct efx_nic *efx, struct ethtool_cmd *ecmd)
62257 +static void sfx7101_get_settings(struct efx_nic *efx, struct ethtool_cmd *ecmd)
62258 {
62259 - if (!ecmd->autoneg)
62260 - return -EINVAL;
62261 -
62262 - return mdio_clause45_set_settings(efx, ecmd);
62263 + mdio_clause45_get_settings_ext(efx, ecmd, ADVERTISED_10000baseT_Full,
62264 + tenxpress_get_xnp_lpa(efx));
62265 + ecmd->supported |= SUPPORTED_10000baseT_Full;
62266 + ecmd->advertising |= ADVERTISED_10000baseT_Full;
62267 }
62268
62269 -static void sfx7101_set_npage_adv(struct efx_nic *efx, u32 advertising)
62270 +static void sft9001_get_settings(struct efx_nic *efx, struct ethtool_cmd *ecmd)
62271 {
62272 - mdio_clause45_set_flag(efx, efx->mii.phy_id, MDIO_MMD_AN,
62273 - MDIO_AN_10GBT_CTRL,
62274 - MDIO_AN_10GBT_CTRL_ADV_10G_LBN,
62275 - advertising & ADVERTISED_10000baseT_Full);
62276 + int phy_id = efx->mii.phy_id;
62277 + u32 xnp_adv = 0;
62278 + int reg;
62279 +
62280 + reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_PMAPMD,
62281 + PMA_PMD_SPEED_ENABLE_REG);
62282 + if (EFX_WORKAROUND_13204(efx) && (reg & (1 << PMA_PMD_100TX_ADV_LBN)))
62283 + xnp_adv |= ADVERTISED_100baseT_Full;
62284 + if (reg & (1 << PMA_PMD_1000T_ADV_LBN))
62285 + xnp_adv |= ADVERTISED_1000baseT_Full;
62286 + if (reg & (1 << PMA_PMD_10000T_ADV_LBN))
62287 + xnp_adv |= ADVERTISED_10000baseT_Full;
62288 +
62289 + mdio_clause45_get_settings_ext(efx, ecmd, xnp_adv,
62290 + tenxpress_get_xnp_lpa(efx));
62291 +
62292 + ecmd->supported |= (SUPPORTED_100baseT_Half |
62293 + SUPPORTED_100baseT_Full |
62294 + SUPPORTED_1000baseT_Full);
62295 +
62296 + /* Use the vendor defined C22ext register for duplex settings */
62297 + if (ecmd->speed != SPEED_10000 && !ecmd->autoneg) {
62298 + reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_C22EXT,
62299 + GPHY_XCONTROL_REG);
62300 + ecmd->duplex = (reg & (1 << GPHY_DUPLEX_LBN) ?
62301 + DUPLEX_FULL : DUPLEX_HALF);
62302 + }
62303 }
62304
62305 -static void sft9001_set_npage_adv(struct efx_nic *efx, u32 advertising)
62306 +static int sft9001_set_settings(struct efx_nic *efx, struct ethtool_cmd *ecmd)
62307 {
62308 int phy_id = efx->mii.phy_id;
62309 + int rc;
62310
62311 - mdio_clause45_set_flag(efx, phy_id, MDIO_MMD_C22EXT,
62312 - C22EXT_MSTSLV_CTRL,
62313 - C22EXT_MSTSLV_CTRL_ADV_1000_FD_LBN,
62314 - advertising & ADVERTISED_1000baseT_Full);
62315 - mdio_clause45_set_flag(efx, phy_id, MDIO_MMD_AN,
62316 - MDIO_AN_10GBT_CTRL,
62317 - MDIO_AN_10GBT_CTRL_ADV_10G_LBN,
62318 - advertising & ADVERTISED_10000baseT_Full);
62319 + rc = mdio_clause45_set_settings(efx, ecmd);
62320 + if (rc)
62321 + return rc;
62322 +
62323 + if (ecmd->speed != SPEED_10000 && !ecmd->autoneg)
62324 + mdio_clause45_set_flag(efx, phy_id, MDIO_MMD_C22EXT,
62325 + GPHY_XCONTROL_REG, GPHY_DUPLEX_LBN,
62326 + ecmd->duplex == DUPLEX_FULL);
62327 +
62328 + return rc;
62329 +}
62330 +
62331 +static bool sft9001_set_xnp_advertise(struct efx_nic *efx, u32 advertising)
62332 +{
62333 + int phy = efx->mii.phy_id;
62334 + int reg = mdio_clause45_read(efx, phy, MDIO_MMD_PMAPMD,
62335 + PMA_PMD_SPEED_ENABLE_REG);
62336 + bool enabled;
62337 +
62338 + reg &= ~((1 << 2) | (1 << 3));
62339 + if (EFX_WORKAROUND_13204(efx) &&
62340 + (advertising & ADVERTISED_100baseT_Full))
62341 + reg |= 1 << PMA_PMD_100TX_ADV_LBN;
62342 + if (advertising & ADVERTISED_1000baseT_Full)
62343 + reg |= 1 << PMA_PMD_1000T_ADV_LBN;
62344 + if (advertising & ADVERTISED_10000baseT_Full)
62345 + reg |= 1 << PMA_PMD_10000T_ADV_LBN;
62346 + mdio_clause45_write(efx, phy, MDIO_MMD_PMAPMD,
62347 + PMA_PMD_SPEED_ENABLE_REG, reg);
62348 +
62349 + enabled = (advertising &
62350 + (ADVERTISED_1000baseT_Half |
62351 + ADVERTISED_1000baseT_Full |
62352 + ADVERTISED_10000baseT_Full));
62353 + if (EFX_WORKAROUND_13204(efx))
62354 + enabled |= (advertising & ADVERTISED_100baseT_Full);
62355 + return enabled;
62356 }
62357
62358 struct efx_phy_operations falcon_sfx7101_phy_ops = {
62359 @@ -822,9 +882,8 @@
62360 .poll = tenxpress_phy_poll,
62361 .fini = tenxpress_phy_fini,
62362 .clear_interrupt = efx_port_dummy_op_void,
62363 - .get_settings = tenxpress_get_settings,
62364 - .set_settings = tenxpress_set_settings,
62365 - .set_npage_adv = sfx7101_set_npage_adv,
62366 + .get_settings = sfx7101_get_settings,
62367 + .set_settings = mdio_clause45_set_settings,
62368 .num_tests = ARRAY_SIZE(sfx7101_test_names),
62369 .test_names = sfx7101_test_names,
62370 .run_tests = sfx7101_run_tests,
62371 @@ -839,9 +898,9 @@
62372 .poll = tenxpress_phy_poll,
62373 .fini = tenxpress_phy_fini,
62374 .clear_interrupt = efx_port_dummy_op_void,
62375 - .get_settings = tenxpress_get_settings,
62376 - .set_settings = tenxpress_set_settings,
62377 - .set_npage_adv = sft9001_set_npage_adv,
62378 + .get_settings = sft9001_get_settings,
62379 + .set_settings = sft9001_set_settings,
62380 + .set_xnp_advertise = sft9001_set_xnp_advertise,
62381 .num_tests = ARRAY_SIZE(sft9001_test_names),
62382 .test_names = sft9001_test_names,
62383 .run_tests = sft9001_run_tests,
62384 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/sfc/workarounds.h linux-2.6.29-rc3.owrt/drivers/net/sfc/workarounds.h
62385 --- linux-2.6.29.owrt/drivers/net/sfc/workarounds.h 2009-05-10 22:04:38.000000000 +0200
62386 +++ linux-2.6.29-rc3.owrt/drivers/net/sfc/workarounds.h 2009-05-10 23:48:29.000000000 +0200
62387 @@ -18,8 +18,8 @@
62388 #define EFX_WORKAROUND_ALWAYS(efx) 1
62389 #define EFX_WORKAROUND_FALCON_A(efx) (falcon_rev(efx) <= FALCON_REV_A1)
62390 #define EFX_WORKAROUND_10G(efx) EFX_IS10G(efx)
62391 -#define EFX_WORKAROUND_SFT9001(efx) ((efx)->phy_type == PHY_TYPE_SFT9001A || \
62392 - (efx)->phy_type == PHY_TYPE_SFT9001B)
62393 +#define EFX_WORKAROUND_SFX7101(efx) ((efx)->phy_type == PHY_TYPE_SFX7101)
62394 +#define EFX_WORKAROUND_SFT9001A(efx) ((efx)->phy_type == PHY_TYPE_SFT9001A)
62395
62396 /* XAUI resets if link not detected */
62397 #define EFX_WORKAROUND_5147 EFX_WORKAROUND_ALWAYS
62398 @@ -29,6 +29,8 @@
62399 #define EFX_WORKAROUND_7884 EFX_WORKAROUND_10G
62400 /* TX pkt parser problem with <= 16 byte TXes */
62401 #define EFX_WORKAROUND_9141 EFX_WORKAROUND_ALWAYS
62402 +/* Low rate CRC errors require XAUI reset */
62403 +#define EFX_WORKAROUND_10750 EFX_WORKAROUND_SFX7101
62404 /* TX_EV_PKT_ERR can be caused by a dangling TX descriptor
62405 * or a PCIe error (bug 11028) */
62406 #define EFX_WORKAROUND_10727 EFX_WORKAROUND_ALWAYS
62407 @@ -53,8 +55,8 @@
62408 #define EFX_WORKAROUND_8071 EFX_WORKAROUND_FALCON_A
62409
62410 /* Need to send XNP pages for 100BaseT */
62411 -#define EFX_WORKAROUND_13204 EFX_WORKAROUND_SFT9001
62412 -/* Don't restart AN in near-side loopback */
62413 -#define EFX_WORKAROUND_15195 EFX_WORKAROUND_SFT9001
62414 +#define EFX_WORKAROUND_13204 EFX_WORKAROUND_SFT9001A
62415 +/* Need to keep AN enabled */
62416 +#define EFX_WORKAROUND_13963 EFX_WORKAROUND_SFT9001A
62417
62418 #endif /* EFX_WORKAROUNDS_H */
62419 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/sh_eth.c linux-2.6.29-rc3.owrt/drivers/net/sh_eth.c
62420 --- linux-2.6.29.owrt/drivers/net/sh_eth.c 2009-05-10 22:04:38.000000000 +0200
62421 +++ linux-2.6.29-rc3.owrt/drivers/net/sh_eth.c 2009-05-10 23:48:29.000000000 +0200
62422 @@ -687,7 +687,6 @@
62423 {
62424 struct net_device *ndev = netdev;
62425 struct sh_eth_private *mdp = netdev_priv(ndev);
62426 - irqreturn_t ret = IRQ_NONE;
62427 u32 ioaddr, boguscnt = RX_RING_SIZE;
62428 u32 intr_status = 0;
62429
62430 @@ -697,13 +696,7 @@
62431 /* Get interrpt stat */
62432 intr_status = ctrl_inl(ioaddr + EESR);
62433 /* Clear interrupt */
62434 - if (intr_status & (EESR_FRC | EESR_RMAF | EESR_RRF |
62435 - EESR_RTLF | EESR_RTSF | EESR_PRE | EESR_CERF |
62436 - TX_CHECK | EESR_ERR_CHECK)) {
62437 - ctrl_outl(intr_status, ioaddr + EESR);
62438 - ret = IRQ_HANDLED;
62439 - } else
62440 - goto other_irq;
62441 + ctrl_outl(intr_status, ioaddr + EESR);
62442
62443 if (intr_status & (EESR_FRC | /* Frame recv*/
62444 EESR_RMAF | /* Multi cast address recv*/
62445 @@ -730,10 +723,9 @@
62446 ndev->name, intr_status);
62447 }
62448
62449 -other_irq:
62450 spin_unlock(&mdp->lock);
62451
62452 - return ret;
62453 + return IRQ_HANDLED;
62454 }
62455
62456 static void sh_eth_timer(unsigned long data)
62457 @@ -852,13 +844,7 @@
62458 int ret = 0;
62459 struct sh_eth_private *mdp = netdev_priv(ndev);
62460
62461 - ret = request_irq(ndev->irq, &sh_eth_interrupt,
62462 -#if defined(CONFIG_CPU_SUBTYPE_SH7763) || defined(CONFIG_CPU_SUBTYPE_SH7764)
62463 - IRQF_SHARED,
62464 -#else
62465 - 0,
62466 -#endif
62467 - ndev->name, ndev);
62468 + ret = request_irq(ndev->irq, &sh_eth_interrupt, 0, ndev->name, ndev);
62469 if (ret) {
62470 printk(KERN_ERR "Can not assign IRQ number to %s\n", CARDNAME);
62471 return ret;
62472 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/sh_eth.h linux-2.6.29-rc3.owrt/drivers/net/sh_eth.h
62473 --- linux-2.6.29.owrt/drivers/net/sh_eth.h 2009-05-10 22:04:38.000000000 +0200
62474 +++ linux-2.6.29-rc3.owrt/drivers/net/sh_eth.h 2009-05-10 23:48:29.000000000 +0200
62475 @@ -43,8 +43,8 @@
62476
62477 #define SH7763_SKB_ALIGN 32
62478 /* Chip Base Address */
62479 -# define SH_TSU_ADDR 0xFEE01800
62480 -# define ARSTR SH_TSU_ADDR
62481 +# define SH_TSU_ADDR 0xFFE01800
62482 +# define ARSTR 0xFFE01800
62483
62484 /* Chip Registers */
62485 /* E-DMAC */
62486 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/skfp/skfddi.c linux-2.6.29-rc3.owrt/drivers/net/skfp/skfddi.c
62487 --- linux-2.6.29.owrt/drivers/net/skfp/skfddi.c 2009-05-10 22:04:38.000000000 +0200
62488 +++ linux-2.6.29-rc3.owrt/drivers/net/skfp/skfddi.c 2009-05-10 23:48:29.000000000 +0200
62489 @@ -1003,9 +1003,9 @@
62490 break;
62491 case SKFP_CLR_STATS: /* Zero out the driver statistics */
62492 if (!capable(CAP_NET_ADMIN)) {
62493 - status = -EPERM;
62494 - } else {
62495 memset(&lp->MacStat, 0, sizeof(lp->MacStat));
62496 + } else {
62497 + status = -EPERM;
62498 }
62499 break;
62500 default:
62501 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/sky2.c linux-2.6.29-rc3.owrt/drivers/net/sky2.c
62502 --- linux-2.6.29.owrt/drivers/net/sky2.c 2009-05-10 22:04:38.000000000 +0200
62503 +++ linux-2.6.29-rc3.owrt/drivers/net/sky2.c 2009-05-10 23:48:29.000000000 +0200
62504 @@ -1403,6 +1403,9 @@
62505
62506 }
62507
62508 + if (netif_msg_ifup(sky2))
62509 + printk(KERN_INFO PFX "%s: enabling interface\n", dev->name);
62510 +
62511 netif_carrier_off(dev);
62512
62513 /* must be power of 2 */
62514 @@ -1481,9 +1484,6 @@
62515 sky2_write32(hw, B0_IMSK, imask);
62516
62517 sky2_set_multicast(dev);
62518 -
62519 - if (netif_msg_ifup(sky2))
62520 - printk(KERN_INFO PFX "%s: enabling interface\n", dev->name);
62521 return 0;
62522
62523 err_out:
62524 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/smc911x.c linux-2.6.29-rc3.owrt/drivers/net/smc911x.c
62525 --- linux-2.6.29.owrt/drivers/net/smc911x.c 2009-05-10 22:04:38.000000000 +0200
62526 +++ linux-2.6.29-rc3.owrt/drivers/net/smc911x.c 2009-05-10 23:48:29.000000000 +0200
62527 @@ -220,9 +220,9 @@
62528
62529 /* make sure EEPROM has finished loading before setting GPIO_CFG */
62530 timeout=1000;
62531 - while (--timeout && (SMC_GET_E2P_CMD(lp) & E2P_CMD_EPC_BUSY_))
62532 + while ( timeout-- && (SMC_GET_E2P_CMD(lp) & E2P_CMD_EPC_BUSY_)) {
62533 udelay(10);
62534 -
62535 + }
62536 if (timeout == 0){
62537 PRINTK("%s: smc911x_reset timeout waiting for EEPROM busy\n", dev->name);
62538 return;
62539 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/smc911x.h linux-2.6.29-rc3.owrt/drivers/net/smc911x.h
62540 --- linux-2.6.29.owrt/drivers/net/smc911x.h 2009-05-10 22:04:38.000000000 +0200
62541 +++ linux-2.6.29-rc3.owrt/drivers/net/smc911x.h 2009-05-10 23:48:29.000000000 +0200
62542 @@ -42,16 +42,6 @@
62543 #define SMC_USE_16BIT 0
62544 #define SMC_USE_32BIT 1
62545 #define SMC_IRQ_SENSE IRQF_TRIGGER_LOW
62546 -#elif defined(CONFIG_ARCH_OMAP34XX)
62547 - #define SMC_USE_16BIT 0
62548 - #define SMC_USE_32BIT 1
62549 - #define SMC_IRQ_SENSE IRQF_TRIGGER_LOW
62550 - #define SMC_MEM_RESERVED 1
62551 -#elif defined(CONFIG_ARCH_OMAP24XX)
62552 - #define SMC_USE_16BIT 0
62553 - #define SMC_USE_32BIT 1
62554 - #define SMC_IRQ_SENSE IRQF_TRIGGER_LOW
62555 - #define SMC_MEM_RESERVED 1
62556 #else
62557 /*
62558 * Default configuration
62559 @@ -685,7 +675,6 @@
62560 #define CHIP_9116 0x0116
62561 #define CHIP_9117 0x0117
62562 #define CHIP_9118 0x0118
62563 -#define CHIP_9211 0x9211
62564 #define CHIP_9215 0x115A
62565 #define CHIP_9217 0x117A
62566 #define CHIP_9218 0x118A
62567 @@ -700,7 +689,6 @@
62568 { CHIP_9116, "LAN9116" },
62569 { CHIP_9117, "LAN9117" },
62570 { CHIP_9118, "LAN9118" },
62571 - { CHIP_9211, "LAN9211" },
62572 { CHIP_9215, "LAN9215" },
62573 { CHIP_9217, "LAN9217" },
62574 { CHIP_9218, "LAN9218" },
62575 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/smsc911x.c linux-2.6.29-rc3.owrt/drivers/net/smsc911x.c
62576 --- linux-2.6.29.owrt/drivers/net/smsc911x.c 2009-05-10 22:04:38.000000000 +0200
62577 +++ linux-2.6.29-rc3.owrt/drivers/net/smsc911x.c 2009-05-10 23:48:29.000000000 +0200
62578 @@ -953,7 +953,7 @@
62579 do {
62580 udelay(1);
62581 val = smsc911x_reg_read(pdata, RX_DP_CTRL);
62582 - } while (--timeout && (val & RX_DP_CTRL_RX_FFWD_));
62583 + } while (timeout-- && (val & RX_DP_CTRL_RX_FFWD_));
62584
62585 if (unlikely(timeout == 0))
62586 SMSC_WARNING(HW, "Timed out waiting for "
62587 @@ -1225,10 +1225,6 @@
62588 dev_info(&dev->dev, "SMSC911x/921x identified at %#08lx, IRQ: %d\n",
62589 (unsigned long)pdata->ioaddr, dev->irq);
62590
62591 - /* Reset the last known duplex and carrier */
62592 - pdata->last_duplex = -1;
62593 - pdata->last_carrier = -1;
62594 -
62595 /* Bring the PHY up */
62596 phy_start(pdata->phy_dev);
62597
62598 @@ -1628,7 +1624,7 @@
62599 do {
62600 msleep(1);
62601 e2cmd = smsc911x_reg_read(pdata, E2P_CMD);
62602 - } while ((e2cmd & E2P_CMD_EPC_BUSY_) && (--timeout));
62603 + } while ((e2cmd & E2P_CMD_EPC_BUSY_) && (timeout--));
62604
62605 if (!timeout) {
62606 SMSC_TRACE(DRV, "TIMED OUT");
62607 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/smsc9420.c linux-2.6.29-rc3.owrt/drivers/net/smsc9420.c
62608 --- linux-2.6.29.owrt/drivers/net/smsc9420.c 2009-05-10 22:04:38.000000000 +0200
62609 +++ linux-2.6.29-rc3.owrt/drivers/net/smsc9420.c 2009-05-10 23:48:29.000000000 +0200
62610 @@ -341,7 +341,7 @@
62611 do {
62612 msleep(1);
62613 e2cmd = smsc9420_reg_read(pd, E2P_CMD);
62614 - } while ((e2cmd & E2P_CMD_EPC_BUSY_) && (--timeout));
62615 + } while ((e2cmd & E2P_CMD_EPC_BUSY_) && (timeout--));
62616
62617 if (!timeout) {
62618 smsc_info(HW, "TIMED OUT");
62619 @@ -413,7 +413,6 @@
62620 }
62621
62622 memcpy(data, &eeprom_data[eeprom->offset], len);
62623 - eeprom->magic = SMSC9420_EEPROM_MAGIC;
62624 eeprom->len = len;
62625 return 0;
62626 }
62627 @@ -424,9 +423,6 @@
62628 struct smsc9420_pdata *pd = netdev_priv(dev);
62629 int ret;
62630
62631 - if (eeprom->magic != SMSC9420_EEPROM_MAGIC)
62632 - return -EINVAL;
62633 -
62634 smsc9420_eeprom_enable_access(pd);
62635 smsc9420_eeprom_send_cmd(pd, E2P_CMD_EPC_CMD_EWEN_);
62636 ret = smsc9420_eeprom_write_location(pd, eeprom->offset, *data);
62637 @@ -502,7 +498,7 @@
62638 static void smsc9420_stop_tx(struct smsc9420_pdata *pd)
62639 {
62640 u32 dmac_control, mac_cr, dma_intr_ena;
62641 - int timeout = 1000;
62642 + int timeOut = 1000;
62643
62644 /* disable TX DMAC */
62645 dmac_control = smsc9420_reg_read(pd, DMAC_CONTROL);
62646 @@ -510,13 +506,13 @@
62647 smsc9420_reg_write(pd, DMAC_CONTROL, dmac_control);
62648
62649 /* Wait max 10ms for transmit process to stop */
62650 - while (--timeout) {
62651 + while (timeOut--) {
62652 if (smsc9420_reg_read(pd, DMAC_STATUS) & DMAC_STS_TS_)
62653 break;
62654 udelay(10);
62655 }
62656
62657 - if (!timeout)
62658 + if (!timeOut)
62659 smsc_warn(IFDOWN, "TX DMAC failed to stop");
62660
62661 /* ACK Tx DMAC stop bit */
62662 @@ -600,7 +596,7 @@
62663
62664 static void smsc9420_stop_rx(struct smsc9420_pdata *pd)
62665 {
62666 - int timeout = 1000;
62667 + int timeOut = 1000;
62668 u32 mac_cr, dmac_control, dma_intr_ena;
62669
62670 /* mask RX DMAC interrupts */
62671 @@ -621,13 +617,13 @@
62672 smsc9420_pci_flush_write(pd);
62673
62674 /* wait up to 10ms for receive to stop */
62675 - while (--timeout) {
62676 + while (timeOut--) {
62677 if (smsc9420_reg_read(pd, DMAC_STATUS) & DMAC_STS_RS_)
62678 break;
62679 udelay(10);
62680 }
62681
62682 - if (!timeout)
62683 + if (!timeOut)
62684 smsc_warn(IFDOWN, "RX DMAC did not stop! timeout.");
62685
62686 /* ACK the Rx DMAC stop bit */
62687 @@ -1382,7 +1378,6 @@
62688
62689 /* test the IRQ connection to the ISR */
62690 smsc_dbg(IFUP, "Testing ISR using IRQ %d", dev->irq);
62691 - pd->software_irq_signal = false;
62692
62693 spin_lock_irqsave(&pd->int_lock, flags);
62694 /* configure interrupt deassertion timer and enable interrupts */
62695 @@ -1398,6 +1393,8 @@
62696 smsc9420_pci_flush_write(pd);
62697
62698 timeout = 1000;
62699 + pd->software_irq_signal = false;
62700 + smp_wmb();
62701 while (timeout--) {
62702 if (pd->software_irq_signal)
62703 break;
62704 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/smsc9420.h linux-2.6.29-rc3.owrt/drivers/net/smsc9420.h
62705 --- linux-2.6.29.owrt/drivers/net/smsc9420.h 2009-05-10 22:04:38.000000000 +0200
62706 +++ linux-2.6.29-rc3.owrt/drivers/net/smsc9420.h 2009-05-10 23:48:29.000000000 +0200
62707 @@ -44,7 +44,6 @@
62708 #define LAN_REGISTER_EXTENT (0x400)
62709
62710 #define SMSC9420_EEPROM_SIZE ((u32)11)
62711 -#define SMSC9420_EEPROM_MAGIC (0x9420)
62712
62713 #define PKT_BUF_SZ (VLAN_ETH_FRAME_LEN + NET_IP_ALIGN + 4)
62714
62715 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/sun3lance.c linux-2.6.29-rc3.owrt/drivers/net/sun3lance.c
62716 --- linux-2.6.29.owrt/drivers/net/sun3lance.c 2009-05-10 22:04:38.000000000 +0200
62717 +++ linux-2.6.29-rc3.owrt/drivers/net/sun3lance.c 2009-05-10 23:48:29.000000000 +0200
62718 @@ -428,7 +428,7 @@
62719 while (--i > 0)
62720 if (DREG & CSR0_IDON)
62721 break;
62722 - if (i <= 0 || (DREG & CSR0_ERR)) {
62723 + if (i < 0 || (DREG & CSR0_ERR)) {
62724 DPRINTK( 2, ( "lance_open(): opening %s failed, i=%d, csr0=%04x\n",
62725 dev->name, i, DREG ));
62726 DREG = CSR0_STOP;
62727 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/sundance.c linux-2.6.29-rc3.owrt/drivers/net/sundance.c
62728 --- linux-2.6.29.owrt/drivers/net/sundance.c 2009-05-10 22:04:38.000000000 +0200
62729 +++ linux-2.6.29-rc3.owrt/drivers/net/sundance.c 2009-05-10 23:48:29.000000000 +0200
62730 @@ -909,7 +909,7 @@
62731 printk(KERN_INFO "%s: Setting %s-duplex based on MII #%d "
62732 "negotiated capability %4.4x.\n", dev->name,
62733 duplex ? "full" : "half", np->phys[0], negotiated);
62734 - iowrite16(ioread16(ioaddr + MACCtrl0) | (duplex ? 0x20 : 0), ioaddr + MACCtrl0);
62735 + iowrite16(ioread16(ioaddr + MACCtrl0) | duplex ? 0x20 : 0, ioaddr + MACCtrl0);
62736 }
62737 }
62738
62739 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/sungem.c linux-2.6.29-rc3.owrt/drivers/net/sungem.c
62740 --- linux-2.6.29.owrt/drivers/net/sungem.c 2009-05-10 22:04:38.000000000 +0200
62741 +++ linux-2.6.29-rc3.owrt/drivers/net/sungem.c 2009-05-10 23:48:29.000000000 +0200
62742 @@ -148,7 +148,7 @@
62743 cmd |= (MIF_FRAME_TAMSB);
62744 writel(cmd, gp->regs + MIF_FRAME);
62745
62746 - while (--limit) {
62747 + while (limit--) {
62748 cmd = readl(gp->regs + MIF_FRAME);
62749 if (cmd & MIF_FRAME_TALSB)
62750 break;
62751 @@ -1157,7 +1157,7 @@
62752 if (limit-- <= 0)
62753 break;
62754 }
62755 - if (limit < 0)
62756 + if (limit <= 0)
62757 printk(KERN_WARNING "%s: PCS reset bit would not clear.\n",
62758 gp->dev->name);
62759 }
62760 @@ -1229,7 +1229,7 @@
62761 break;
62762 } while (val & (GREG_SWRST_TXRST | GREG_SWRST_RXRST));
62763
62764 - if (limit < 0)
62765 + if (limit <= 0)
62766 printk(KERN_ERR "%s: SW reset is ghetto.\n", gp->dev->name);
62767
62768 if (gp->phy_type == phy_serialink || gp->phy_type == phy_serdes)
62769 @@ -2221,8 +2221,6 @@
62770
62771 gp->running = 1;
62772
62773 - napi_enable(&gp->napi);
62774 -
62775 if (gp->lstate == link_up) {
62776 netif_carrier_on(gp->dev);
62777 gem_set_link_modes(gp);
62778 @@ -2240,8 +2238,6 @@
62779 spin_lock_irqsave(&gp->lock, flags);
62780 spin_lock(&gp->tx_lock);
62781
62782 - napi_disable(&gp->napi);
62783 -
62784 gp->running = 0;
62785 gem_reset(gp);
62786 gem_clean_rings(gp);
62787 @@ -2342,6 +2338,8 @@
62788 if (!gp->asleep)
62789 rc = gem_do_start(dev);
62790 gp->opened = (rc == 0);
62791 + if (gp->opened)
62792 + napi_enable(&gp->napi);
62793
62794 mutex_unlock(&gp->pm_mutex);
62795
62796 @@ -2478,6 +2476,8 @@
62797
62798 /* Re-attach net device */
62799 netif_device_attach(dev);
62800 +
62801 + napi_enable(&gp->napi);
62802 }
62803
62804 spin_lock_irqsave(&gp->lock, flags);
62805 @@ -2998,11 +2998,8 @@
62806 .ndo_do_ioctl = gem_ioctl,
62807 .ndo_tx_timeout = gem_tx_timeout,
62808 .ndo_change_mtu = gem_change_mtu,
62809 + .ndo_set_mac_address = eth_mac_addr,
62810 .ndo_validate_addr = eth_validate_addr,
62811 - .ndo_set_mac_address = gem_set_mac_address,
62812 -#ifdef CONFIG_NET_POLL_CONTROLLER
62813 - .ndo_poll_controller = gem_poll_controller,
62814 -#endif
62815 };
62816
62817 static int __devinit gem_init_one(struct pci_dev *pdev,
62818 @@ -3164,6 +3161,10 @@
62819 dev->watchdog_timeo = 5 * HZ;
62820 dev->irq = pdev->irq;
62821 dev->dma = 0;
62822 + dev->set_mac_address = gem_set_mac_address;
62823 +#ifdef CONFIG_NET_POLL_CONTROLLER
62824 + dev->poll_controller = gem_poll_controller;
62825 +#endif
62826
62827 /* Set that now, in case PM kicks in now */
62828 pci_set_drvdata(pdev, dev);
62829 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/sungem_phy.c linux-2.6.29-rc3.owrt/drivers/net/sungem_phy.c
62830 --- linux-2.6.29.owrt/drivers/net/sungem_phy.c 2009-05-10 22:04:38.000000000 +0200
62831 +++ linux-2.6.29-rc3.owrt/drivers/net/sungem_phy.c 2009-05-10 23:48:29.000000000 +0200
62832 @@ -79,7 +79,7 @@
62833
62834 udelay(100);
62835
62836 - while (--limit) {
62837 + while (limit--) {
62838 val = __phy_read(phy, phy_id, MII_BMCR);
62839 if ((val & BMCR_RESET) == 0)
62840 break;
62841 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/sunhme.c linux-2.6.29-rc3.owrt/drivers/net/sunhme.c
62842 --- linux-2.6.29.owrt/drivers/net/sunhme.c 2009-05-10 22:04:38.000000000 +0200
62843 +++ linux-2.6.29-rc3.owrt/drivers/net/sunhme.c 2009-05-10 23:48:29.000000000 +0200
62844 @@ -2543,36 +2543,25 @@
62845 }
62846
62847 /* After all quattro cards have been probed, we call these functions
62848 - * to register the IRQ handlers for the cards that have been
62849 - * successfully probed and skip the cards that failed to initialize
62850 + * to register the IRQ handlers.
62851 */
62852 -static int __init quattro_sbus_register_irqs(void)
62853 +static void __init quattro_sbus_register_irqs(void)
62854 {
62855 struct quattro *qp;
62856
62857 for (qp = qfe_sbus_list; qp != NULL; qp = qp->next) {
62858 struct of_device *op = qp->quattro_dev;
62859 - int err, qfe_slot, skip = 0;
62860 -
62861 - for (qfe_slot = 0; qfe_slot < 4; qfe_slot++) {
62862 - if (!qp->happy_meals[qfe_slot])
62863 - skip = 1;
62864 - }
62865 - if (skip)
62866 - continue;
62867 + int err;
62868
62869 err = request_irq(op->irqs[0],
62870 quattro_sbus_interrupt,
62871 IRQF_SHARED, "Quattro",
62872 qp);
62873 if (err != 0) {
62874 - printk(KERN_ERR "Quattro HME: IRQ registration "
62875 - "error %d.\n", err);
62876 - return err;
62877 + printk(KERN_ERR "Quattro: Fatal IRQ registery error %d.\n", err);
62878 + panic("QFE request irq");
62879 }
62880 }
62881 -
62882 - return 0;
62883 }
62884
62885 static void quattro_sbus_free_irqs(void)
62886 @@ -2581,14 +2570,6 @@
62887
62888 for (qp = qfe_sbus_list; qp != NULL; qp = qp->next) {
62889 struct of_device *op = qp->quattro_dev;
62890 - int qfe_slot, skip = 0;
62891 -
62892 - for (qfe_slot = 0; qfe_slot < 4; qfe_slot++) {
62893 - if (!qp->happy_meals[qfe_slot])
62894 - skip = 1;
62895 - }
62896 - if (skip)
62897 - continue;
62898
62899 free_irq(op->irqs[0], qp);
62900 }
62901 @@ -2648,12 +2629,6 @@
62902 int i, qfe_slot = -1;
62903 int err = -ENODEV;
62904
62905 - sbus_dp = to_of_device(op->dev.parent)->node;
62906 -
62907 - /* We can match PCI devices too, do not accept those here. */
62908 - if (strcmp(sbus_dp->name, "sbus"))
62909 - return err;
62910 -
62911 if (is_qfe) {
62912 qp = quattro_sbus_find(op);
62913 if (qp == NULL)
62914 @@ -2759,6 +2734,10 @@
62915 if (qp != NULL)
62916 hp->happy_flags |= HFLAG_QUATTRO;
62917
62918 + sbus_dp = to_of_device(op->dev.parent)->node;
62919 + if (is_qfe)
62920 + sbus_dp = to_of_device(op->dev.parent->parent)->node;
62921 +
62922 /* Get the supported DVMA burst sizes from our Happy SBUS. */
62923 hp->happy_bursts = of_getintprop_default(sbus_dp,
62924 "burst-sizes", 0x00);
62925 @@ -2845,9 +2824,6 @@
62926 if (hp->tcvregs)
62927 of_iounmap(&op->resource[4], hp->tcvregs, TCVR_REG_SIZE);
62928
62929 - if (qp)
62930 - qp->happy_meals[qfe_slot] = NULL;
62931 -
62932 err_out_free_netdev:
62933 free_netdev(dev);
62934
62935 @@ -3305,7 +3281,7 @@
62936
62937 err = of_register_driver(&hme_sbus_driver, &of_bus_type);
62938 if (!err)
62939 - err = quattro_sbus_register_irqs();
62940 + quattro_sbus_register_irqs();
62941
62942 return err;
62943 }
62944 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/sunlance.c linux-2.6.29-rc3.owrt/drivers/net/sunlance.c
62945 --- linux-2.6.29.owrt/drivers/net/sunlance.c 2009-05-10 22:04:38.000000000 +0200
62946 +++ linux-2.6.29-rc3.owrt/drivers/net/sunlance.c 2009-05-10 23:48:29.000000000 +0200
62947 @@ -343,7 +343,7 @@
62948 ib->phys_addr [5] = dev->dev_addr [4];
62949
62950 /* Setup the Tx ring entries */
62951 - for (i = 0; i < TX_RING_SIZE; i++) {
62952 + for (i = 0; i <= TX_RING_SIZE; i++) {
62953 leptr = LANCE_ADDR(aib + libbuff_offset(tx_buf, i));
62954 ib->btx_ring [i].tmd0 = leptr;
62955 ib->btx_ring [i].tmd1_hadr = leptr >> 16;
62956 @@ -399,7 +399,7 @@
62957 sbus_writeb(dev->dev_addr[4], &ib->phys_addr[5]);
62958
62959 /* Setup the Tx ring entries */
62960 - for (i = 0; i < TX_RING_SIZE; i++) {
62961 + for (i = 0; i <= TX_RING_SIZE; i++) {
62962 leptr = libbuff_offset(tx_buf, i);
62963 sbus_writew(leptr, &ib->btx_ring [i].tmd0);
62964 sbus_writeb(leptr >> 16,&ib->btx_ring [i].tmd1_hadr);
62965 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/sunqe.c linux-2.6.29-rc3.owrt/drivers/net/sunqe.c
62966 --- linux-2.6.29.owrt/drivers/net/sunqe.c 2009-05-10 22:04:38.000000000 +0200
62967 +++ linux-2.6.29-rc3.owrt/drivers/net/sunqe.c 2009-05-10 23:48:29.000000000 +0200
62968 @@ -227,7 +227,7 @@
62969 if (!(sbus_readb(mregs + MREGS_PHYCONFIG) & MREGS_PHYCONFIG_LTESTDIS)) {
62970 int tries = 50;
62971
62972 - while (--tries) {
62973 + while (tries--) {
62974 u8 tmp;
62975
62976 mdelay(5);
62977 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/tg3.c linux-2.6.29-rc3.owrt/drivers/net/tg3.c
62978 --- linux-2.6.29.owrt/drivers/net/tg3.c 2009-05-10 22:04:38.000000000 +0200
62979 +++ linux-2.6.29-rc3.owrt/drivers/net/tg3.c 2009-05-10 23:48:29.000000000 +0200
62980 @@ -852,7 +852,7 @@
62981 }
62982 udelay(10);
62983 }
62984 - if (limit < 0)
62985 + if (limit <= 0)
62986 return -EBUSY;
62987
62988 return 0;
62989 @@ -1473,8 +1473,7 @@
62990 {
62991 u32 reg;
62992
62993 - if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS) ||
62994 - GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
62995 + if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS))
62996 return;
62997
62998 reg = MII_TG3_MISC_SHDW_WREN |
62999 @@ -1604,7 +1603,7 @@
63000 break;
63001 }
63002 }
63003 - if (limit < 0)
63004 + if (limit <= 0)
63005 return -EBUSY;
63006
63007 return 0;
63008 @@ -2238,8 +2237,8 @@
63009 phyid = phydev->drv->phy_id & phydev->drv->phy_id_mask;
63010 if (phyid != TG3_PHY_ID_BCMAC131) {
63011 phyid &= TG3_PHY_OUI_MASK;
63012 - if (phyid == TG3_PHY_OUI_1 ||
63013 - phyid == TG3_PHY_OUI_2 ||
63014 + if (phyid == TG3_PHY_OUI_1 &&
63015 + phyid == TG3_PHY_OUI_2 &&
63016 phyid == TG3_PHY_OUI_3)
63017 do_low_power = true;
63018 }
63019 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/tokenring/tmspci.c linux-2.6.29-rc3.owrt/drivers/net/tokenring/tmspci.c
63020 --- linux-2.6.29.owrt/drivers/net/tokenring/tmspci.c 2009-05-10 22:04:38.000000000 +0200
63021 +++ linux-2.6.29-rc3.owrt/drivers/net/tokenring/tmspci.c 2009-05-10 23:48:29.000000000 +0200
63022 @@ -121,6 +121,11 @@
63023 goto err_out_trdev;
63024 }
63025
63026 + ret = request_irq(pdev->irq, tms380tr_interrupt, IRQF_SHARED,
63027 + dev->name, dev);
63028 + if (ret)
63029 + goto err_out_region;
63030 +
63031 dev->base_addr = pci_ioaddr;
63032 dev->irq = pci_irq_line;
63033 dev->dma = 0;
63034 @@ -137,7 +142,7 @@
63035 ret = tmsdev_init(dev, &pdev->dev);
63036 if (ret) {
63037 printk("%s: unable to get memory for dev->priv.\n", dev->name);
63038 - goto err_out_region;
63039 + goto err_out_irq;
63040 }
63041
63042 tp = netdev_priv(dev);
63043 @@ -152,11 +157,6 @@
63044
63045 tp->tmspriv = cardinfo;
63046
63047 - ret = request_irq(pdev->irq, tms380tr_interrupt, IRQF_SHARED,
63048 - dev->name, dev);
63049 - if (ret)
63050 - goto err_out_tmsdev;
63051 -
63052 dev->open = tms380tr_open;
63053 dev->stop = tms380tr_close;
63054 pci_set_drvdata(pdev, dev);
63055 @@ -164,15 +164,15 @@
63056
63057 ret = register_netdev(dev);
63058 if (ret)
63059 - goto err_out_irq;
63060 + goto err_out_tmsdev;
63061
63062 return 0;
63063
63064 -err_out_irq:
63065 - free_irq(pdev->irq, dev);
63066 err_out_tmsdev:
63067 pci_set_drvdata(pdev, NULL);
63068 tmsdev_term(dev);
63069 +err_out_irq:
63070 + free_irq(pdev->irq, dev);
63071 err_out_region:
63072 release_region(pci_ioaddr, TMS_PCI_IO_EXTENT);
63073 err_out_trdev:
63074 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/tsi108_eth.c linux-2.6.29-rc3.owrt/drivers/net/tsi108_eth.c
63075 --- linux-2.6.29.owrt/drivers/net/tsi108_eth.c 2009-05-10 22:04:38.000000000 +0200
63076 +++ linux-2.6.29-rc3.owrt/drivers/net/tsi108_eth.c 2009-05-10 23:48:29.000000000 +0200
63077 @@ -1237,7 +1237,7 @@
63078 spin_lock_irqsave(&phy_lock, flags);
63079
63080 tsi108_write_mii(data, MII_BMCR, BMCR_RESET);
63081 - while (--i) {
63082 + while (i--){
63083 if(!(tsi108_read_mii(data, MII_BMCR) & BMCR_RESET))
63084 break;
63085 udelay(10);
63086 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/tulip/21142.c linux-2.6.29-rc3.owrt/drivers/net/tulip/21142.c
63087 --- linux-2.6.29.owrt/drivers/net/tulip/21142.c 2009-05-10 22:04:38.000000000 +0200
63088 +++ linux-2.6.29-rc3.owrt/drivers/net/tulip/21142.c 2009-05-10 23:48:29.000000000 +0200
63089 @@ -9,11 +9,6 @@
63090
63091 Please refer to Documentation/DocBook/tulip-user.{pdf,ps,html}
63092 for more information on this driver.
63093 -
63094 - DC21143 manual "21143 PCI/CardBus 10/100Mb/s Ethernet LAN Controller
63095 - Hardware Reference Manual" is currently available at :
63096 - http://developer.intel.com/design/network/manuals/278074.htm
63097 -
63098 Please submit bugs to http://bugzilla.kernel.org/ .
63099 */
63100
63101 @@ -37,11 +32,7 @@
63102 int csr12 = ioread32(ioaddr + CSR12);
63103 int next_tick = 60*HZ;
63104 int new_csr6 = 0;
63105 - int csr14 = ioread32(ioaddr + CSR14);
63106
63107 - /* CSR12[LS10,LS100] are not reliable during autonegotiation */
63108 - if ((csr14 & 0x80) && (csr12 & 0x7000) != 0x5000)
63109 - csr12 |= 6;
63110 if (tulip_debug > 2)
63111 printk(KERN_INFO"%s: 21143 negotiation status %8.8x, %s.\n",
63112 dev->name, csr12, medianame[dev->if_port]);
63113 @@ -85,7 +76,7 @@
63114 new_csr6 = 0x83860000;
63115 dev->if_port = 3;
63116 iowrite32(0, ioaddr + CSR13);
63117 - iowrite32(0x0003FFFF, ioaddr + CSR14);
63118 + iowrite32(0x0003FF7F, ioaddr + CSR14);
63119 iowrite16(8, ioaddr + CSR15);
63120 iowrite32(1, ioaddr + CSR13);
63121 }
63122 @@ -141,14 +132,10 @@
63123 struct tulip_private *tp = netdev_priv(dev);
63124 void __iomem *ioaddr = tp->base_addr;
63125 int csr12 = ioread32(ioaddr + CSR12);
63126 - int csr14 = ioread32(ioaddr + CSR14);
63127
63128 - /* CSR12[LS10,LS100] are not reliable during autonegotiation */
63129 - if ((csr14 & 0x80) && (csr12 & 0x7000) != 0x5000)
63130 - csr12 |= 6;
63131 if (tulip_debug > 1)
63132 printk(KERN_INFO"%s: 21143 link status interrupt %8.8x, CSR5 %x, "
63133 - "%8.8x.\n", dev->name, csr12, csr5, csr14);
63134 + "%8.8x.\n", dev->name, csr12, csr5, ioread32(ioaddr + CSR14));
63135
63136 /* If NWay finished and we have a negotiated partner capability. */
63137 if (tp->nway && !tp->nwayset && (csr12 & 0x7000) == 0x5000) {
63138 @@ -156,9 +143,7 @@
63139 int negotiated = tp->sym_advertise & (csr12 >> 16);
63140 tp->lpar = csr12 >> 16;
63141 tp->nwayset = 1;
63142 - /* If partner cannot negotiate, it is 10Mbps Half Duplex */
63143 - if (!(csr12 & 0x8000)) dev->if_port = 0;
63144 - else if (negotiated & 0x0100) dev->if_port = 5;
63145 + if (negotiated & 0x0100) dev->if_port = 5;
63146 else if (negotiated & 0x0080) dev->if_port = 3;
63147 else if (negotiated & 0x0040) dev->if_port = 4;
63148 else if (negotiated & 0x0020) dev->if_port = 0;
63149 @@ -229,7 +214,7 @@
63150 tp->timer.expires = RUN_AT(3*HZ);
63151 add_timer(&tp->timer);
63152 } else if (dev->if_port == 5)
63153 - iowrite32(csr14 & ~0x080, ioaddr + CSR14);
63154 + iowrite32(ioread32(ioaddr + CSR14) & ~0x080, ioaddr + CSR14);
63155 } else if (dev->if_port == 0 || dev->if_port == 4) {
63156 if ((csr12 & 4) == 0)
63157 printk(KERN_INFO"%s: 21143 10baseT link beat good.\n",
63158 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/tulip/de2104x.c linux-2.6.29-rc3.owrt/drivers/net/tulip/de2104x.c
63159 --- linux-2.6.29.owrt/drivers/net/tulip/de2104x.c 2009-05-10 22:04:38.000000000 +0200
63160 +++ linux-2.6.29-rc3.owrt/drivers/net/tulip/de2104x.c 2009-05-10 23:48:29.000000000 +0200
63161 @@ -392,7 +392,7 @@
63162 unsigned drop = 0;
63163 int rc;
63164
63165 - while (--rx_work) {
63166 + while (rx_work--) {
63167 u32 status, len;
63168 dma_addr_t mapping;
63169 struct sk_buff *skb, *copy_skb;
63170 @@ -464,14 +464,13 @@
63171 drop = 1;
63172
63173 rx_next:
63174 + de->rx_ring[rx_tail].opts1 = cpu_to_le32(DescOwn);
63175 if (rx_tail == (DE_RX_RING_SIZE - 1))
63176 de->rx_ring[rx_tail].opts2 =
63177 cpu_to_le32(RingEnd | de->rx_buf_sz);
63178 else
63179 de->rx_ring[rx_tail].opts2 = cpu_to_le32(de->rx_buf_sz);
63180 de->rx_ring[rx_tail].addr1 = cpu_to_le32(mapping);
63181 - wmb();
63182 - de->rx_ring[rx_tail].opts1 = cpu_to_le32(DescOwn);
63183 rx_tail = NEXT_RX(rx_tail);
63184 }
63185
63186 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/tulip/tulip_core.c linux-2.6.29-rc3.owrt/drivers/net/tulip/tulip_core.c
63187 --- linux-2.6.29.owrt/drivers/net/tulip/tulip_core.c 2009-05-10 22:04:38.000000000 +0200
63188 +++ linux-2.6.29-rc3.owrt/drivers/net/tulip/tulip_core.c 2009-05-10 23:48:29.000000000 +0200
63189 @@ -255,7 +255,6 @@
63190
63191 static void tulip_tx_timeout(struct net_device *dev);
63192 static void tulip_init_ring(struct net_device *dev);
63193 -static void tulip_free_ring(struct net_device *dev);
63194 static int tulip_start_xmit(struct sk_buff *skb, struct net_device *dev);
63195 static int tulip_open(struct net_device *dev);
63196 static int tulip_close(struct net_device *dev);
63197 @@ -503,21 +502,16 @@
63198 {
63199 int retval;
63200
63201 - tulip_init_ring (dev);
63202 + if ((retval = request_irq(dev->irq, &tulip_interrupt, IRQF_SHARED, dev->name, dev)))
63203 + return retval;
63204
63205 - retval = request_irq(dev->irq, &tulip_interrupt, IRQF_SHARED, dev->name, dev);
63206 - if (retval)
63207 - goto free_ring;
63208 + tulip_init_ring (dev);
63209
63210 tulip_up (dev);
63211
63212 netif_start_queue (dev);
63213
63214 return 0;
63215 -
63216 -free_ring:
63217 - tulip_free_ring (dev);
63218 - return retval;
63219 }
63220
63221
63222 @@ -774,11 +768,23 @@
63223 tulip_set_power_state (tp, 0, 1);
63224 }
63225
63226 -static void tulip_free_ring (struct net_device *dev)
63227 +
63228 +static int tulip_close (struct net_device *dev)
63229 {
63230 struct tulip_private *tp = netdev_priv(dev);
63231 + void __iomem *ioaddr = tp->base_addr;
63232 int i;
63233
63234 + netif_stop_queue (dev);
63235 +
63236 + tulip_down (dev);
63237 +
63238 + if (tulip_debug > 1)
63239 + printk (KERN_DEBUG "%s: Shutting down ethercard, status was %2.2x.\n",
63240 + dev->name, ioread32 (ioaddr + CSR5));
63241 +
63242 + free_irq (dev->irq, dev);
63243 +
63244 /* Free all the skbuffs in the Rx queue. */
63245 for (i = 0; i < RX_RING_SIZE; i++) {
63246 struct sk_buff *skb = tp->rx_buffers[i].skb;
63247 @@ -797,7 +803,6 @@
63248 dev_kfree_skb (skb);
63249 }
63250 }
63251 -
63252 for (i = 0; i < TX_RING_SIZE; i++) {
63253 struct sk_buff *skb = tp->tx_buffers[i].skb;
63254
63255 @@ -809,24 +814,6 @@
63256 tp->tx_buffers[i].skb = NULL;
63257 tp->tx_buffers[i].mapping = 0;
63258 }
63259 -}
63260 -
63261 -static int tulip_close (struct net_device *dev)
63262 -{
63263 - struct tulip_private *tp = netdev_priv(dev);
63264 - void __iomem *ioaddr = tp->base_addr;
63265 -
63266 - netif_stop_queue (dev);
63267 -
63268 - tulip_down (dev);
63269 -
63270 - if (tulip_debug > 1)
63271 - printk (KERN_DEBUG "%s: Shutting down ethercard, status was %2.2x.\n",
63272 - dev->name, ioread32 (ioaddr + CSR5));
63273 -
63274 - free_irq (dev->irq, dev);
63275 -
63276 - tulip_free_ring (dev);
63277
63278 return 0;
63279 }
63280 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/tun.c linux-2.6.29-rc3.owrt/drivers/net/tun.c
63281 --- linux-2.6.29.owrt/drivers/net/tun.c 2009-05-10 22:04:38.000000000 +0200
63282 +++ linux-2.6.29-rc3.owrt/drivers/net/tun.c 2009-05-10 23:48:29.000000000 +0200
63283 @@ -157,16 +157,10 @@
63284
63285 nexact = n;
63286
63287 - /* Remaining multicast addresses are hashed,
63288 - * unicast will leave the filter disabled. */
63289 + /* The rest is hashed */
63290 memset(filter->mask, 0, sizeof(filter->mask));
63291 - for (; n < uf.count; n++) {
63292 - if (!is_multicast_ether_addr(addr[n].u)) {
63293 - err = 0; /* no filter */
63294 - goto done;
63295 - }
63296 + for (; n < uf.count; n++)
63297 addr_hash_set(filter->mask, addr[n].u);
63298 - }
63299
63300 /* For ALLMULTI just set the mask to all ones.
63301 * This overrides the mask populated above. */
63302 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/ucc_geth.c linux-2.6.29-rc3.owrt/drivers/net/ucc_geth.c
63303 --- linux-2.6.29.owrt/drivers/net/ucc_geth.c 2009-05-10 22:04:38.000000000 +0200
63304 +++ linux-2.6.29-rc3.owrt/drivers/net/ucc_geth.c 2009-05-10 23:48:29.000000000 +0200
63305 @@ -1536,15 +1536,17 @@
63306 static int init_phy(struct net_device *dev)
63307 {
63308 struct ucc_geth_private *priv = netdev_priv(dev);
63309 - struct ucc_geth_info *ug_info = priv->ug_info;
63310 struct phy_device *phydev;
63311 + char phy_id[BUS_ID_SIZE];
63312
63313 priv->oldlink = 0;
63314 priv->oldspeed = 0;
63315 priv->oldduplex = -1;
63316
63317 - phydev = phy_connect(dev, ug_info->phy_bus_id, &adjust_link, 0,
63318 - priv->phy_interface);
63319 + snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT, priv->ug_info->mdio_bus,
63320 + priv->ug_info->phy_address);
63321 +
63322 + phydev = phy_connect(dev, phy_id, &adjust_link, 0, priv->phy_interface);
63323
63324 if (IS_ERR(phydev)) {
63325 printk("%s: Could not attach to PHY\n", dev->name);
63326 @@ -3612,12 +3614,10 @@
63327 ug_info->uf_info.irq = irq_of_parse_and_map(np, 0);
63328 fixed_link = of_get_property(np, "fixed-link", NULL);
63329 if (fixed_link) {
63330 - snprintf(ug_info->phy_bus_id, sizeof(ug_info->phy_bus_id),
63331 - PHY_ID_FMT, "0", fixed_link[0]);
63332 + snprintf(ug_info->mdio_bus, MII_BUS_ID_SIZE, "0");
63333 + ug_info->phy_address = fixed_link[0];
63334 phy = NULL;
63335 } else {
63336 - char bus_name[MII_BUS_ID_SIZE];
63337 -
63338 ph = of_get_property(np, "phy-handle", NULL);
63339 phy = of_find_node_by_phandle(*ph);
63340
63341 @@ -3628,6 +3628,7 @@
63342 prop = of_get_property(phy, "reg", NULL);
63343 if (prop == NULL)
63344 return -1;
63345 + ug_info->phy_address = *prop;
63346
63347 /* Set the bus id */
63348 mdio = of_get_parent(phy);
63349 @@ -3641,9 +3642,7 @@
63350 if (err)
63351 return -1;
63352
63353 - uec_mdio_bus_name(bus_name, mdio);
63354 - snprintf(ug_info->phy_bus_id, sizeof(ug_info->phy_bus_id),
63355 - "%s:%02x", bus_name, *prop);
63356 + snprintf(ug_info->mdio_bus, MII_BUS_ID_SIZE, "%x", res.start);
63357 }
63358
63359 /* get the phy interface type, or default to MII */
63360 @@ -3749,7 +3748,6 @@
63361
63362 ugeth->ug_info = ug_info;
63363 ugeth->dev = dev;
63364 - ugeth->node = np;
63365
63366 return 0;
63367 }
63368 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/ucc_geth.h linux-2.6.29-rc3.owrt/drivers/net/ucc_geth.h
63369 --- linux-2.6.29.owrt/drivers/net/ucc_geth.h 2009-05-10 22:04:38.000000000 +0200
63370 +++ linux-2.6.29-rc3.owrt/drivers/net/ucc_geth.h 2009-05-10 23:48:29.000000000 +0200
63371 @@ -1091,7 +1091,8 @@
63372 u32 eventRegMask;
63373 u16 pausePeriod;
63374 u16 extensionField;
63375 - char phy_bus_id[BUS_ID_SIZE];
63376 + u8 phy_address;
63377 + char mdio_bus[MII_BUS_ID_SIZE];
63378 u8 weightfactor[NUM_TX_QUEUES];
63379 u8 interruptcoalescingmaxvalue[NUM_RX_QUEUES];
63380 u8 l2qt[UCC_GETH_VLAN_PRIORITY_MAX];
63381 @@ -1185,8 +1186,6 @@
63382 int oldspeed;
63383 int oldduplex;
63384 int oldlink;
63385 -
63386 - struct device_node *node;
63387 };
63388
63389 void uec_set_ethtool_ops(struct net_device *netdev);
63390 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/ucc_geth_mii.c linux-2.6.29-rc3.owrt/drivers/net/ucc_geth_mii.c
63391 --- linux-2.6.29.owrt/drivers/net/ucc_geth_mii.c 2009-05-10 22:04:38.000000000 +0200
63392 +++ linux-2.6.29-rc3.owrt/drivers/net/ucc_geth_mii.c 2009-05-10 23:48:29.000000000 +0200
63393 @@ -107,7 +107,7 @@
63394 static int uec_mdio_reset(struct mii_bus *bus)
63395 {
63396 struct ucc_mii_mng __iomem *regs = (void __iomem *)bus->priv;
63397 - int timeout = PHY_INIT_TIMEOUT;
63398 + unsigned int timeout = PHY_INIT_TIMEOUT;
63399
63400 mutex_lock(&bus->mdio_lock);
63401
63402 @@ -123,7 +123,7 @@
63403
63404 mutex_unlock(&bus->mdio_lock);
63405
63406 - if (timeout < 0) {
63407 + if (timeout <= 0) {
63408 printk(KERN_ERR "%s: The MII Bus is stuck!\n", bus->name);
63409 return -EBUSY;
63410 }
63411 @@ -156,7 +156,7 @@
63412 if (err)
63413 goto reg_map_fail;
63414
63415 - uec_mdio_bus_name(new_bus->id, np);
63416 + snprintf(new_bus->id, MII_BUS_ID_SIZE, "%x", res.start);
63417
63418 new_bus->irq = kmalloc(32 * sizeof(int), GFP_KERNEL);
63419
63420 @@ -283,13 +283,3 @@
63421 {
63422 of_unregister_platform_driver(&uec_mdio_driver);
63423 }
63424 -
63425 -void uec_mdio_bus_name(char *name, struct device_node *np)
63426 -{
63427 - const u32 *reg;
63428 -
63429 - reg = of_get_property(np, "reg", NULL);
63430 -
63431 - snprintf(name, MII_BUS_ID_SIZE, "%s@%x", np->name, reg ? *reg : 0);
63432 -}
63433 -
63434 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/ucc_geth_mii.h linux-2.6.29-rc3.owrt/drivers/net/ucc_geth_mii.h
63435 --- linux-2.6.29.owrt/drivers/net/ucc_geth_mii.h 2009-05-10 22:04:38.000000000 +0200
63436 +++ linux-2.6.29-rc3.owrt/drivers/net/ucc_geth_mii.h 2009-05-10 23:48:29.000000000 +0200
63437 @@ -97,5 +97,4 @@
63438 int uec_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 value);
63439 int __init uec_mdio_init(void);
63440 void uec_mdio_exit(void);
63441 -void uec_mdio_bus_name(char *name, struct device_node *np);
63442 #endif /* __UEC_MII_H */
63443 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/usb/asix.c linux-2.6.29-rc3.owrt/drivers/net/usb/asix.c
63444 --- linux-2.6.29.owrt/drivers/net/usb/asix.c 2009-05-10 22:04:38.000000000 +0200
63445 +++ linux-2.6.29-rc3.owrt/drivers/net/usb/asix.c 2009-05-10 23:48:29.000000000 +0200
63446 @@ -1451,14 +1451,6 @@
63447 // Cables-to-Go USB Ethernet Adapter
63448 USB_DEVICE(0x0b95, 0x772a),
63449 .driver_info = (unsigned long) &ax88772_info,
63450 -}, {
63451 - // ABOCOM for pci
63452 - USB_DEVICE(0x14ea, 0xab11),
63453 - .driver_info = (unsigned long) &ax88178_info,
63454 -}, {
63455 - // ASIX 88772a
63456 - USB_DEVICE(0x0db0, 0xa877),
63457 - .driver_info = (unsigned long) &ax88772_info,
63458 },
63459 { }, // END
63460 };
63461 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/usb/cdc_ether.c linux-2.6.29-rc3.owrt/drivers/net/usb/cdc_ether.c
63462 --- linux-2.6.29.owrt/drivers/net/usb/cdc_ether.c 2009-05-10 22:04:38.000000000 +0200
63463 +++ linux-2.6.29-rc3.owrt/drivers/net/usb/cdc_ether.c 2009-05-10 23:48:29.000000000 +0200
63464 @@ -559,11 +559,6 @@
63465 USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ETHERNET,
63466 USB_CDC_PROTO_NONE),
63467 .driver_info = (unsigned long) &cdc_info,
63468 -}, {
63469 - /* Ericsson F3507g */
63470 - USB_DEVICE_AND_INTERFACE_INFO(0x0bdb, 0x1900, USB_CLASS_COMM,
63471 - USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
63472 - .driver_info = (unsigned long) &cdc_info,
63473 },
63474 { }, // END
63475 };
63476 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/usb/dm9601.c linux-2.6.29-rc3.owrt/drivers/net/usb/dm9601.c
63477 --- linux-2.6.29.owrt/drivers/net/usb/dm9601.c 2009-05-10 22:04:38.000000000 +0200
63478 +++ linux-2.6.29-rc3.owrt/drivers/net/usb/dm9601.c 2009-05-10 23:48:29.000000000 +0200
63479 @@ -635,10 +635,6 @@
63480 USB_DEVICE(0x0a47, 0x9601), /* Hirose USB-100 */
63481 .driver_info = (unsigned long)&dm9601_info,
63482 },
63483 - {
63484 - USB_DEVICE(0x0fe6, 0x8101), /* DM9601 USB to Fast Ethernet Adapter */
63485 - .driver_info = (unsigned long)&dm9601_info,
63486 - },
63487 {}, // END
63488 };
63489
63490 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/usb/hso.c linux-2.6.29-rc3.owrt/drivers/net/usb/hso.c
63491 --- linux-2.6.29.owrt/drivers/net/usb/hso.c 2009-05-10 22:04:38.000000000 +0200
63492 +++ linux-2.6.29-rc3.owrt/drivers/net/usb/hso.c 2009-05-10 23:48:29.000000000 +0200
63493 @@ -455,7 +455,6 @@
63494 {icon321_port_device(0x0af0, 0xd033)}, /* Icon-322 */
63495 {USB_DEVICE(0x0af0, 0x7301)}, /* GE40x */
63496 {USB_DEVICE(0x0af0, 0x7361)}, /* GE40x */
63497 - {USB_DEVICE(0x0af0, 0x7381)}, /* GE40x */
63498 {USB_DEVICE(0x0af0, 0x7401)}, /* GI 0401 */
63499 {USB_DEVICE(0x0af0, 0x7501)}, /* GTM 382 */
63500 {USB_DEVICE(0x0af0, 0x7601)}, /* GE40x */
63501 @@ -463,8 +462,7 @@
63502 {USB_DEVICE(0x0af0, 0x7801)},
63503 {USB_DEVICE(0x0af0, 0x7901)},
63504 {USB_DEVICE(0x0af0, 0x7361)},
63505 - {USB_DEVICE(0x0af0, 0xd057)},
63506 - {USB_DEVICE(0x0af0, 0xd055)},
63507 + {icon321_port_device(0x0af0, 0xd051)},
63508 {}
63509 };
63510 MODULE_DEVICE_TABLE(usb, hso_ids);
63511 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/usb/usbnet.c linux-2.6.29-rc3.owrt/drivers/net/usb/usbnet.c
63512 --- linux-2.6.29.owrt/drivers/net/usb/usbnet.c 2009-05-10 22:04:38.000000000 +0200
63513 +++ linux-2.6.29-rc3.owrt/drivers/net/usb/usbnet.c 2009-05-10 23:48:29.000000000 +0200
63514 @@ -723,8 +723,8 @@
63515 if (dev->mii.mdio_read)
63516 return mii_link_ok(&dev->mii);
63517
63518 - /* Otherwise, dtrt for drivers calling netif_carrier_{on,off} */
63519 - return ethtool_op_get_link(net);
63520 + /* Otherwise, say we're up (to avoid breaking scripts) */
63521 + return 1;
63522 }
63523 EXPORT_SYMBOL_GPL(usbnet_get_link);
63524
63525 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/usb/zaurus.c linux-2.6.29-rc3.owrt/drivers/net/usb/zaurus.c
63526 --- linux-2.6.29.owrt/drivers/net/usb/zaurus.c 2009-05-10 22:04:38.000000000 +0200
63527 +++ linux-2.6.29-rc3.owrt/drivers/net/usb/zaurus.c 2009-05-10 23:48:29.000000000 +0200
63528 @@ -341,11 +341,6 @@
63529 USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_MDLM,
63530 USB_CDC_PROTO_NONE),
63531 .driver_info = (unsigned long) &bogus_mdlm_info,
63532 -}, {
63533 - /* Motorola MOTOMAGX phones */
63534 - USB_DEVICE_AND_INTERFACE_INFO(0x22b8, 0x6425, USB_CLASS_COMM,
63535 - USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
63536 - .driver_info = (unsigned long) &bogus_mdlm_info,
63537 },
63538
63539 /* Olympus has some models with a Zaurus-compatible option.
63540 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/veth.c linux-2.6.29-rc3.owrt/drivers/net/veth.c
63541 --- linux-2.6.29.owrt/drivers/net/veth.c 2009-05-10 22:04:38.000000000 +0200
63542 +++ linux-2.6.29-rc3.owrt/drivers/net/veth.c 2009-05-10 23:48:29.000000000 +0200
63543 @@ -239,16 +239,6 @@
63544 return 0;
63545 }
63546
63547 -static int veth_close(struct net_device *dev)
63548 -{
63549 - struct veth_priv *priv = netdev_priv(dev);
63550 -
63551 - netif_carrier_off(dev);
63552 - netif_carrier_off(priv->peer);
63553 -
63554 - return 0;
63555 -}
63556 -
63557 static int veth_dev_init(struct net_device *dev)
63558 {
63559 struct veth_net_stats *stats;
63560 @@ -273,12 +263,10 @@
63561 }
63562
63563 static const struct net_device_ops veth_netdev_ops = {
63564 - .ndo_init = veth_dev_init,
63565 - .ndo_open = veth_open,
63566 - .ndo_stop = veth_close,
63567 - .ndo_start_xmit = veth_xmit,
63568 - .ndo_get_stats = veth_get_stats,
63569 - .ndo_set_mac_address = eth_mac_addr,
63570 + .ndo_init = veth_dev_init,
63571 + .ndo_open = veth_open,
63572 + .ndo_start_xmit = veth_xmit,
63573 + .ndo_get_stats = veth_get_stats,
63574 };
63575
63576 static void veth_setup(struct net_device *dev)
63577 @@ -291,6 +279,44 @@
63578 dev->destructor = veth_dev_free;
63579 }
63580
63581 +static void veth_change_state(struct net_device *dev)
63582 +{
63583 + struct net_device *peer;
63584 + struct veth_priv *priv;
63585 +
63586 + priv = netdev_priv(dev);
63587 + peer = priv->peer;
63588 +
63589 + if (netif_carrier_ok(peer)) {
63590 + if (!netif_carrier_ok(dev))
63591 + netif_carrier_on(dev);
63592 + } else {
63593 + if (netif_carrier_ok(dev))
63594 + netif_carrier_off(dev);
63595 + }
63596 +}
63597 +
63598 +static int veth_device_event(struct notifier_block *unused,
63599 + unsigned long event, void *ptr)
63600 +{
63601 + struct net_device *dev = ptr;
63602 +
63603 + if (dev->netdev_ops->ndo_open != veth_open)
63604 + goto out;
63605 +
63606 + switch (event) {
63607 + case NETDEV_CHANGE:
63608 + veth_change_state(dev);
63609 + break;
63610 + }
63611 +out:
63612 + return NOTIFY_DONE;
63613 +}
63614 +
63615 +static struct notifier_block veth_notifier_block __read_mostly = {
63616 + .notifier_call = veth_device_event,
63617 +};
63618 +
63619 /*
63620 * netlink interface
63621 */
63622 @@ -441,12 +467,14 @@
63623
63624 static __init int veth_init(void)
63625 {
63626 + register_netdevice_notifier(&veth_notifier_block);
63627 return rtnl_link_register(&veth_link_ops);
63628 }
63629
63630 static __exit void veth_exit(void)
63631 {
63632 rtnl_link_unregister(&veth_link_ops);
63633 + unregister_netdevice_notifier(&veth_notifier_block);
63634 }
63635
63636 module_init(veth_init);
63637 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/via-velocity.c linux-2.6.29-rc3.owrt/drivers/net/via-velocity.c
63638 --- linux-2.6.29.owrt/drivers/net/via-velocity.c 2009-05-10 22:04:38.000000000 +0200
63639 +++ linux-2.6.29-rc3.owrt/drivers/net/via-velocity.c 2009-05-10 23:48:29.000000000 +0200
63640 @@ -1838,19 +1838,17 @@
63641 {
63642 struct sk_buff *skb = tdinfo->skb;
63643 int i;
63644 - int pktlen;
63645
63646 /*
63647 * Don't unmap the pre-allocated tx_bufs
63648 */
63649 if (tdinfo->skb_dma) {
63650
63651 - pktlen = (skb->len > ETH_ZLEN ? : ETH_ZLEN);
63652 for (i = 0; i < tdinfo->nskb_dma; i++) {
63653 #ifdef VELOCITY_ZERO_COPY_SUPPORT
63654 pci_unmap_single(vptr->pdev, tdinfo->skb_dma[i], le16_to_cpu(td->tdesc1.len), PCI_DMA_TODEVICE);
63655 #else
63656 - pci_unmap_single(vptr->pdev, tdinfo->skb_dma[i], pktlen, PCI_DMA_TODEVICE);
63657 + pci_unmap_single(vptr->pdev, tdinfo->skb_dma[i], skb->len, PCI_DMA_TODEVICE);
63658 #endif
63659 tdinfo->skb_dma[i] = 0;
63660 }
63661 @@ -2082,14 +2080,17 @@
63662 struct tx_desc *td_ptr;
63663 struct velocity_td_info *tdinfo;
63664 unsigned long flags;
63665 - int pktlen;
63666 + int pktlen = skb->len;
63667 __le16 len;
63668 int index;
63669
63670
63671 - if (skb_padto(skb, ETH_ZLEN))
63672 - goto out;
63673 - pktlen = max_t(unsigned int, skb->len, ETH_ZLEN);
63674 +
63675 + if (skb->len < ETH_ZLEN) {
63676 + if (skb_padto(skb, ETH_ZLEN))
63677 + goto out;
63678 + pktlen = ETH_ZLEN;
63679 + }
63680
63681 len = cpu_to_le16(pktlen);
63682
63683 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/virtio_net.c linux-2.6.29-rc3.owrt/drivers/net/virtio_net.c
63684 --- linux-2.6.29.owrt/drivers/net/virtio_net.c 2009-05-10 22:04:38.000000000 +0200
63685 +++ linux-2.6.29-rc3.owrt/drivers/net/virtio_net.c 2009-05-10 23:48:29.000000000 +0200
63686 @@ -287,7 +287,7 @@
63687 skb_put(skb, MAX_PACKET_LEN);
63688
63689 hdr = skb_vnet_hdr(skb);
63690 - sg_set_buf(sg, hdr, sizeof(*hdr));
63691 + sg_init_one(sg, hdr, sizeof(*hdr));
63692
63693 if (vi->big_packets) {
63694 for (i = 0; i < MAX_SKB_FRAGS; i++) {
63695 @@ -488,9 +488,9 @@
63696
63697 /* Encode metadata header at front. */
63698 if (vi->mergeable_rx_bufs)
63699 - sg_set_buf(sg, mhdr, sizeof(*mhdr));
63700 + sg_init_one(sg, mhdr, sizeof(*mhdr));
63701 else
63702 - sg_set_buf(sg, hdr, sizeof(*hdr));
63703 + sg_init_one(sg, hdr, sizeof(*hdr));
63704
63705 num = skb_to_sgvec(skb, sg+1, 0, skb->len) + 1;
63706
63707 @@ -612,7 +612,6 @@
63708 .set_tx_csum = virtnet_set_tx_csum,
63709 .set_sg = ethtool_op_set_sg,
63710 .set_tso = ethtool_op_set_tso,
63711 - .get_link = ethtool_op_get_link,
63712 };
63713
63714 #define MIN_MTU 68
63715 @@ -740,8 +739,6 @@
63716 goto unregister;
63717 }
63718
63719 - netif_carrier_on(dev);
63720 -
63721 pr_debug("virtnet: registered device %s\n", dev->name);
63722 return 0;
63723
63724 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/wimax/i2400m/debugfs.c linux-2.6.29-rc3.owrt/drivers/net/wimax/i2400m/debugfs.c
63725 --- linux-2.6.29.owrt/drivers/net/wimax/i2400m/debugfs.c 2009-05-10 22:04:38.000000000 +0200
63726 +++ linux-2.6.29-rc3.owrt/drivers/net/wimax/i2400m/debugfs.c 2009-05-10 23:48:29.000000000 +0200
63727 @@ -234,6 +234,20 @@
63728 &fops_i2400m_reset);
63729 }
63730
63731 +/*
63732 + * Debug levels control; see debug.h
63733 + */
63734 +struct d_level D_LEVEL[] = {
63735 + D_SUBMODULE_DEFINE(control),
63736 + D_SUBMODULE_DEFINE(driver),
63737 + D_SUBMODULE_DEFINE(debugfs),
63738 + D_SUBMODULE_DEFINE(fw),
63739 + D_SUBMODULE_DEFINE(netdev),
63740 + D_SUBMODULE_DEFINE(rfkill),
63741 + D_SUBMODULE_DEFINE(rx),
63742 + D_SUBMODULE_DEFINE(tx),
63743 +};
63744 +size_t D_LEVEL_SIZE = ARRAY_SIZE(D_LEVEL);
63745
63746 #define __debugfs_register(prefix, name, parent) \
63747 do { \
63748 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/wimax/i2400m/driver.c linux-2.6.29-rc3.owrt/drivers/net/wimax/i2400m/driver.c
63749 --- linux-2.6.29.owrt/drivers/net/wimax/i2400m/driver.c 2009-05-10 22:04:38.000000000 +0200
63750 +++ linux-2.6.29-rc3.owrt/drivers/net/wimax/i2400m/driver.c 2009-05-10 23:48:29.000000000 +0200
63751 @@ -707,22 +707,6 @@
63752 EXPORT_SYMBOL_GPL(i2400m_release);
63753
63754
63755 -/*
63756 - * Debug levels control; see debug.h
63757 - */
63758 -struct d_level D_LEVEL[] = {
63759 - D_SUBMODULE_DEFINE(control),
63760 - D_SUBMODULE_DEFINE(driver),
63761 - D_SUBMODULE_DEFINE(debugfs),
63762 - D_SUBMODULE_DEFINE(fw),
63763 - D_SUBMODULE_DEFINE(netdev),
63764 - D_SUBMODULE_DEFINE(rfkill),
63765 - D_SUBMODULE_DEFINE(rx),
63766 - D_SUBMODULE_DEFINE(tx),
63767 -};
63768 -size_t D_LEVEL_SIZE = ARRAY_SIZE(D_LEVEL);
63769 -
63770 -
63771 static
63772 int __init i2400m_driver_init(void)
63773 {
63774 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/wimax/i2400m/i2400m.h linux-2.6.29-rc3.owrt/drivers/net/wimax/i2400m/i2400m.h
63775 --- linux-2.6.29.owrt/drivers/net/wimax/i2400m/i2400m.h 2009-05-10 22:04:38.000000000 +0200
63776 +++ linux-2.6.29-rc3.owrt/drivers/net/wimax/i2400m/i2400m.h 2009-05-10 23:48:29.000000000 +0200
63777 @@ -157,7 +157,7 @@
63778
63779
63780 /* Firmware version we request when pulling the fw image file */
63781 -#define I2400M_FW_VERSION "1.4"
63782 +#define I2400M_FW_VERSION "1.3"
63783
63784
63785 /**
63786 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/wireless/ath5k/base.c linux-2.6.29-rc3.owrt/drivers/net/wireless/ath5k/base.c
63787 --- linux-2.6.29.owrt/drivers/net/wireless/ath5k/base.c 2009-05-10 22:04:38.000000000 +0200
63788 +++ linux-2.6.29-rc3.owrt/drivers/net/wireless/ath5k/base.c 2009-05-10 23:48:29.000000000 +0200
63789 @@ -1028,8 +1028,6 @@
63790 * it's done by reseting the chip. To accomplish this we must
63791 * first cleanup any pending DMA, then restart stuff after a la
63792 * ath5k_init.
63793 - *
63794 - * Called with sc->lock.
63795 */
63796 static int
63797 ath5k_chan_set(struct ath5k_softc *sc, struct ieee80211_channel *chan)
63798 @@ -1098,42 +1096,6 @@
63799 * Buffers setup *
63800 \***************/
63801
63802 -static
63803 -struct sk_buff *ath5k_rx_skb_alloc(struct ath5k_softc *sc, dma_addr_t *skb_addr)
63804 -{
63805 - struct sk_buff *skb;
63806 - unsigned int off;
63807 -
63808 - /*
63809 - * Allocate buffer with headroom_needed space for the
63810 - * fake physical layer header at the start.
63811 - */
63812 - skb = dev_alloc_skb(sc->rxbufsize + sc->cachelsz - 1);
63813 -
63814 - if (!skb) {
63815 - ATH5K_ERR(sc, "can't alloc skbuff of size %u\n",
63816 - sc->rxbufsize + sc->cachelsz - 1);
63817 - return NULL;
63818 - }
63819 - /*
63820 - * Cache-line-align. This is important (for the
63821 - * 5210 at least) as not doing so causes bogus data
63822 - * in rx'd frames.
63823 - */
63824 - off = ((unsigned long)skb->data) % sc->cachelsz;
63825 - if (off != 0)
63826 - skb_reserve(skb, sc->cachelsz - off);
63827 -
63828 - *skb_addr = pci_map_single(sc->pdev,
63829 - skb->data, sc->rxbufsize, PCI_DMA_FROMDEVICE);
63830 - if (unlikely(pci_dma_mapping_error(sc->pdev, *skb_addr))) {
63831 - ATH5K_ERR(sc, "%s: DMA mapping failed\n", __func__);
63832 - dev_kfree_skb(skb);
63833 - return NULL;
63834 - }
63835 - return skb;
63836 -}
63837 -
63838 static int
63839 ath5k_rxbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf)
63840 {
63841 @@ -1141,11 +1103,37 @@
63842 struct sk_buff *skb = bf->skb;
63843 struct ath5k_desc *ds;
63844
63845 - if (!skb) {
63846 - skb = ath5k_rx_skb_alloc(sc, &bf->skbaddr);
63847 - if (!skb)
63848 + if (likely(skb == NULL)) {
63849 + unsigned int off;
63850 +
63851 + /*
63852 + * Allocate buffer with headroom_needed space for the
63853 + * fake physical layer header at the start.
63854 + */
63855 + skb = dev_alloc_skb(sc->rxbufsize + sc->cachelsz - 1);
63856 + if (unlikely(skb == NULL)) {
63857 + ATH5K_ERR(sc, "can't alloc skbuff of size %u\n",
63858 + sc->rxbufsize + sc->cachelsz - 1);
63859 return -ENOMEM;
63860 + }
63861 + /*
63862 + * Cache-line-align. This is important (for the
63863 + * 5210 at least) as not doing so causes bogus data
63864 + * in rx'd frames.
63865 + */
63866 + off = ((unsigned long)skb->data) % sc->cachelsz;
63867 + if (off != 0)
63868 + skb_reserve(skb, sc->cachelsz - off);
63869 +
63870 bf->skb = skb;
63871 + bf->skbaddr = pci_map_single(sc->pdev,
63872 + skb->data, sc->rxbufsize, PCI_DMA_FROMDEVICE);
63873 + if (unlikely(pci_dma_mapping_error(sc->pdev, bf->skbaddr))) {
63874 + ATH5K_ERR(sc, "%s: DMA mapping failed\n", __func__);
63875 + dev_kfree_skb(skb);
63876 + bf->skb = NULL;
63877 + return -ENOMEM;
63878 + }
63879 }
63880
63881 /*
63882 @@ -1674,8 +1662,7 @@
63883 {
63884 struct ieee80211_rx_status rxs = {};
63885 struct ath5k_rx_status rs = {};
63886 - struct sk_buff *skb, *next_skb;
63887 - dma_addr_t next_skb_addr;
63888 + struct sk_buff *skb;
63889 struct ath5k_softc *sc = (void *)data;
63890 struct ath5k_buf *bf, *bf_last;
63891 struct ath5k_desc *ds;
63892 @@ -1760,17 +1747,10 @@
63893 goto next;
63894 }
63895 accept:
63896 - next_skb = ath5k_rx_skb_alloc(sc, &next_skb_addr);
63897 -
63898 - /*
63899 - * If we can't replace bf->skb with a new skb under memory
63900 - * pressure, just skip this packet
63901 - */
63902 - if (!next_skb)
63903 - goto next;
63904 -
63905 pci_unmap_single(sc->pdev, bf->skbaddr, sc->rxbufsize,
63906 PCI_DMA_FROMDEVICE);
63907 + bf->skb = NULL;
63908 +
63909 skb_put(skb, rs.rs_datalen);
63910
63911 /* The MAC header is padded to have 32-bit boundary if the
63912 @@ -1843,9 +1823,6 @@
63913 ath5k_check_ibss_tsf(sc, skb, &rxs);
63914
63915 __ieee80211_rx(sc->hw, skb, &rxs);
63916 -
63917 - bf->skb = next_skb;
63918 - bf->skbaddr = next_skb_addr;
63919 next:
63920 list_move_tail(&bf->list, &sc->rxbuf);
63921 } while (ath5k_rxbuf_setup(sc, bf) == 0);
63922 @@ -2837,17 +2814,11 @@
63923 {
63924 struct ath5k_softc *sc = hw->priv;
63925 struct ieee80211_conf *conf = &hw->conf;
63926 - int ret;
63927 -
63928 - mutex_lock(&sc->lock);
63929
63930 sc->bintval = conf->beacon_int;
63931 sc->power_level = conf->power_level;
63932
63933 - ret = ath5k_chan_set(sc, conf->channel);
63934 -
63935 - mutex_unlock(&sc->lock);
63936 - return ret;
63937 + return ath5k_chan_set(sc, conf->channel);
63938 }
63939
63940 static int
63941 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/wireless/ath9k/ath9k.h linux-2.6.29-rc3.owrt/drivers/net/wireless/ath9k/ath9k.h
63942 --- linux-2.6.29.owrt/drivers/net/wireless/ath9k/ath9k.h 2009-05-10 22:04:38.000000000 +0200
63943 +++ linux-2.6.29-rc3.owrt/drivers/net/wireless/ath9k/ath9k.h 2009-05-10 23:48:29.000000000 +0200
63944 @@ -587,8 +587,8 @@
63945 u8 iso[3];
63946 };
63947
63948 -#define REG_WRITE(_ah, _reg, _val) ath9k_iowrite32((_ah), (_reg), (_val))
63949 -#define REG_READ(_ah, _reg) ath9k_ioread32((_ah), (_reg))
63950 +#define REG_WRITE(_ah, _reg, _val) iowrite32(_val, _ah->ah_sh + _reg)
63951 +#define REG_READ(_ah, _reg) ioread32(_ah->ah_sh + _reg)
63952
63953 #define SM(_v, _f) (((_v) << _f##_S) & _f)
63954 #define MS(_v, _f) (((_v) & _f) >> _f##_S)
63955 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/wireless/ath9k/core.h linux-2.6.29-rc3.owrt/drivers/net/wireless/ath9k/core.h
63956 --- linux-2.6.29.owrt/drivers/net/wireless/ath9k/core.h 2009-05-10 22:04:38.000000000 +0200
63957 +++ linux-2.6.29-rc3.owrt/drivers/net/wireless/ath9k/core.h 2009-05-10 23:48:29.000000000 +0200
63958 @@ -701,7 +701,6 @@
63959 struct ath_hal *sc_ah;
63960 void __iomem *mem;
63961 spinlock_t sc_resetlock;
63962 - spinlock_t sc_serial_rw;
63963 struct mutex mutex;
63964
63965 u8 sc_curbssid[ETH_ALEN];
63966 @@ -752,36 +751,4 @@
63967 int ath_get_mac80211_qnum(u32 queue, struct ath_softc *sc);
63968 int ath_cabq_update(struct ath_softc *);
63969
63970 -/*
63971 - * Read and write, they both share the same lock. We do this to serialize
63972 - * reads and writes on Atheros 802.11n PCI devices only. This is required
63973 - * as the FIFO on these devices can only accept sanely 2 requests. After
63974 - * that the device goes bananas. Serializing the reads/writes prevents this
63975 - * from happening.
63976 - */
63977 -
63978 -static inline void ath9k_iowrite32(struct ath_hal *ah, u32 reg_offset, u32 val)
63979 -{
63980 - if (ah->ah_config.serialize_regmode == SER_REG_MODE_ON) {
63981 - unsigned long flags;
63982 - spin_lock_irqsave(&ah->ah_sc->sc_serial_rw, flags);
63983 - iowrite32(val, ah->ah_sc->mem + reg_offset);
63984 - spin_unlock_irqrestore(&ah->ah_sc->sc_serial_rw, flags);
63985 - } else
63986 - iowrite32(val, ah->ah_sc->mem + reg_offset);
63987 -}
63988 -
63989 -static inline unsigned int ath9k_ioread32(struct ath_hal *ah, u32 reg_offset)
63990 -{
63991 - u32 val;
63992 - if (ah->ah_config.serialize_regmode == SER_REG_MODE_ON) {
63993 - unsigned long flags;
63994 - spin_lock_irqsave(&ah->ah_sc->sc_serial_rw, flags);
63995 - val = ioread32(ah->ah_sc->mem + reg_offset);
63996 - spin_unlock_irqrestore(&ah->ah_sc->sc_serial_rw, flags);
63997 - } else
63998 - val = ioread32(ah->ah_sc->mem + reg_offset);
63999 - return val;
64000 -}
64001 -
64002 #endif /* CORE_H */
64003 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/wireless/ath9k/hw.c linux-2.6.29-rc3.owrt/drivers/net/wireless/ath9k/hw.c
64004 --- linux-2.6.29.owrt/drivers/net/wireless/ath9k/hw.c 2009-05-10 22:04:38.000000000 +0200
64005 +++ linux-2.6.29-rc3.owrt/drivers/net/wireless/ath9k/hw.c 2009-05-10 23:48:29.000000000 +0200
64006 @@ -437,25 +437,6 @@
64007 }
64008
64009 ah->ah_config.intr_mitigation = 1;
64010 -
64011 - /*
64012 - * We need this for PCI devices only (Cardbus, PCI, miniPCI)
64013 - * _and_ if on non-uniprocessor systems (Multiprocessor/HT).
64014 - * This means we use it for all AR5416 devices, and the few
64015 - * minor PCI AR9280 devices out there.
64016 - *
64017 - * Serialization is required because these devices do not handle
64018 - * well the case of two concurrent reads/writes due to the latency
64019 - * involved. During one read/write another read/write can be issued
64020 - * on another CPU while the previous read/write may still be working
64021 - * on our hardware, if we hit this case the hardware poops in a loop.
64022 - * We prevent this by serializing reads and writes.
64023 - *
64024 - * This issue is not present on PCI-Express devices or pre-AR5416
64025 - * devices (legacy, 802.11abg).
64026 - */
64027 - if (num_possible_cpus() > 1)
64028 - ah->ah_config.serialize_regmode = SER_REG_MODE_AUTO;
64029 }
64030
64031 static struct ath_hal_5416 *ath9k_hw_newstate(u16 devid,
64032 @@ -687,8 +668,7 @@
64033 }
64034
64035 if (ah->ah_config.serialize_regmode == SER_REG_MODE_AUTO) {
64036 - if (ah->ah_macVersion == AR_SREV_VERSION_5416_PCI ||
64037 - (AR_SREV_9280(ah) && !ah->ah_isPciExpress)) {
64038 + if (ah->ah_macVersion == AR_SREV_VERSION_5416_PCI) {
64039 ah->ah_config.serialize_regmode =
64040 SER_REG_MODE_ON;
64041 } else {
64042 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/wireless/ath9k/main.c linux-2.6.29-rc3.owrt/drivers/net/wireless/ath9k/main.c
64043 --- linux-2.6.29.owrt/drivers/net/wireless/ath9k/main.c 2009-05-10 22:04:38.000000000 +0200
64044 +++ linux-2.6.29-rc3.owrt/drivers/net/wireless/ath9k/main.c 2009-05-10 23:48:29.000000000 +0200
64045 @@ -1336,7 +1336,6 @@
64046 printk(KERN_ERR "Unable to create debugfs files\n");
64047
64048 spin_lock_init(&sc->sc_resetlock);
64049 - spin_lock_init(&sc->sc_serial_rw);
64050 mutex_init(&sc->mutex);
64051 tasklet_init(&sc->intr_tq, ath9k_tasklet, (unsigned long)sc);
64052 tasklet_init(&sc->bcon_tasklet, ath9k_beacon_tasklet,
64053 @@ -1539,7 +1538,6 @@
64054 bad:
64055 if (ah)
64056 ath9k_hw_detach(ah);
64057 - ath9k_exit_debug(sc);
64058
64059 return error;
64060 }
64061 @@ -1547,7 +1545,7 @@
64062 static int ath_attach(u16 devid, struct ath_softc *sc)
64063 {
64064 struct ieee80211_hw *hw = sc->hw;
64065 - int error = 0, i;
64066 + int error = 0;
64067
64068 DPRINTF(sc, ATH_DBG_CONFIG, "Attach ATH hw\n");
64069
64070 @@ -1591,11 +1589,11 @@
64071 /* initialize tx/rx engine */
64072 error = ath_tx_init(sc, ATH_TXBUF);
64073 if (error != 0)
64074 - goto error_attach;
64075 + goto detach;
64076
64077 error = ath_rx_init(sc, ATH_RXBUF);
64078 if (error != 0)
64079 - goto error_attach;
64080 + goto detach;
64081
64082 #if defined(CONFIG_RFKILL) || defined(CONFIG_RFKILL_MODULE)
64083 /* Initialze h/w Rfkill */
64084 @@ -1603,9 +1601,8 @@
64085 INIT_DELAYED_WORK(&sc->rf_kill.rfkill_poll, ath_rfkill_poll);
64086
64087 /* Initialize s/w rfkill */
64088 - error = ath_init_sw_rfkill(sc);
64089 - if (error)
64090 - goto error_attach;
64091 + if (ath_init_sw_rfkill(sc))
64092 + goto detach;
64093 #endif
64094
64095 error = ieee80211_register_hw(hw);
64096 @@ -1614,16 +1611,8 @@
64097 ath_init_leds(sc);
64098
64099 return 0;
64100 -
64101 -error_attach:
64102 - /* cleanup tx queues */
64103 - for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++)
64104 - if (ATH_TXQ_SETUP(sc, i))
64105 - ath_tx_cleanupq(sc, &sc->tx.txq[i]);
64106 -
64107 - ath9k_hw_detach(sc->sc_ah);
64108 - ath9k_exit_debug(sc);
64109 -
64110 +detach:
64111 + ath_detach(sc);
64112 return error;
64113 }
64114
64115 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/wireless/iwlwifi/iwl3945-base.c linux-2.6.29-rc3.owrt/drivers/net/wireless/iwlwifi/iwl3945-base.c
64116 --- linux-2.6.29.owrt/drivers/net/wireless/iwlwifi/iwl3945-base.c 2009-05-10 22:04:38.000000000 +0200
64117 +++ linux-2.6.29-rc3.owrt/drivers/net/wireless/iwlwifi/iwl3945-base.c 2009-05-10 23:48:29.000000000 +0200
64118 @@ -7911,7 +7911,7 @@
64119 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000);
64120 if (err < 0) {
64121 IWL_DEBUG_INFO("Failed to init the card\n");
64122 - goto out_iounmap;
64123 + goto out_remove_sysfs;
64124 }
64125
64126 /***********************
64127 @@ -7921,7 +7921,7 @@
64128 err = iwl3945_eeprom_init(priv);
64129 if (err) {
64130 IWL_ERROR("Unable to init EEPROM\n");
64131 - goto out_iounmap;
64132 + goto out_remove_sysfs;
64133 }
64134 /* MAC Address location in EEPROM same for 3945/4965 */
64135 get_eeprom_mac(priv, priv->mac_addr);
64136 @@ -7975,7 +7975,7 @@
64137 err = iwl3945_init_channel_map(priv);
64138 if (err) {
64139 IWL_ERROR("initializing regulatory failed: %d\n", err);
64140 - goto out_unset_hw_setting;
64141 + goto out_release_irq;
64142 }
64143
64144 err = iwl3945_init_geos(priv);
64145 @@ -8045,22 +8045,25 @@
64146 return 0;
64147
64148 out_remove_sysfs:
64149 - destroy_workqueue(priv->workqueue);
64150 - priv->workqueue = NULL;
64151 sysfs_remove_group(&pdev->dev.kobj, &iwl3945_attribute_group);
64152 out_free_geos:
64153 iwl3945_free_geos(priv);
64154 out_free_channel_map:
64155 iwl3945_free_channel_map(priv);
64156 - out_unset_hw_setting:
64157 +
64158 +
64159 + out_release_irq:
64160 + destroy_workqueue(priv->workqueue);
64161 + priv->workqueue = NULL;
64162 iwl3945_unset_hw_setting(priv);
64163 +
64164 out_iounmap:
64165 pci_iounmap(pdev, priv->hw_base);
64166 out_pci_release_regions:
64167 pci_release_regions(pdev);
64168 out_pci_disable_device:
64169 - pci_set_drvdata(pdev, NULL);
64170 pci_disable_device(pdev);
64171 + pci_set_drvdata(pdev, NULL);
64172 out_ieee80211_free_hw:
64173 ieee80211_free_hw(priv->hw);
64174 out:
64175 @@ -8140,19 +8143,6 @@
64176 priv->is_open = 1;
64177 }
64178
64179 - /* pci driver assumes state will be saved in this function.
64180 - * pci state is saved and device disabled when interface is
64181 - * stopped, so at this time pci device will always be disabled -
64182 - * whether interface was started or not. saving pci state now will
64183 - * cause saved state be that of a disabled device, which will cause
64184 - * problems during resume in that we will end up with a disabled device.
64185 - *
64186 - * indicate that the current saved state (from when interface was
64187 - * stopped) is valid. if interface was never up at time of suspend
64188 - * then the saved state will still be valid as it was saved during
64189 - * .probe. */
64190 - pdev->state_saved = true;
64191 -
64192 pci_set_power_state(pdev, PCI_D3hot);
64193
64194 return 0;
64195 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/wireless/iwlwifi/iwl-agn.c linux-2.6.29-rc3.owrt/drivers/net/wireless/iwlwifi/iwl-agn.c
64196 --- linux-2.6.29.owrt/drivers/net/wireless/iwlwifi/iwl-agn.c 2009-05-10 22:04:38.000000000 +0200
64197 +++ linux-2.6.29-rc3.owrt/drivers/net/wireless/iwlwifi/iwl-agn.c 2009-05-10 23:48:29.000000000 +0200
64198 @@ -1719,10 +1719,6 @@
64199 priv->ucode_data_backup.len = data_size;
64200 iwl_alloc_fw_desc(priv->pci_dev, &priv->ucode_data_backup);
64201
64202 - if (!priv->ucode_code.v_addr || !priv->ucode_data.v_addr ||
64203 - !priv->ucode_data_backup.v_addr)
64204 - goto err_pci_alloc;
64205 -
64206 /* Initialization instructions and data */
64207 if (init_size && init_data_size) {
64208 priv->ucode_init.len = init_size;
64209 @@ -3868,7 +3864,7 @@
64210 }
64211 err = iwl_eeprom_check_version(priv);
64212 if (err)
64213 - goto out_free_eeprom;
64214 + goto out_iounmap;
64215
64216 /* extract MAC Address */
64217 iwl_eeprom_get_mac(priv, priv->mac_addr);
64218 @@ -3945,8 +3941,6 @@
64219 return 0;
64220
64221 out_remove_sysfs:
64222 - destroy_workqueue(priv->workqueue);
64223 - priv->workqueue = NULL;
64224 sysfs_remove_group(&pdev->dev.kobj, &iwl_attribute_group);
64225 out_uninit_drv:
64226 iwl_uninit_drv(priv);
64227 @@ -3955,8 +3949,8 @@
64228 out_iounmap:
64229 pci_iounmap(pdev, priv->hw_base);
64230 out_pci_release_regions:
64231 - pci_set_drvdata(pdev, NULL);
64232 pci_release_regions(pdev);
64233 + pci_set_drvdata(pdev, NULL);
64234 out_pci_disable_device:
64235 pci_disable_device(pdev);
64236 out_ieee80211_free_hw:
64237 @@ -4044,19 +4038,6 @@
64238 priv->is_open = 1;
64239 }
64240
64241 - /* pci driver assumes state will be saved in this function.
64242 - * pci state is saved and device disabled when interface is
64243 - * stopped, so at this time pci device will always be disabled -
64244 - * whether interface was started or not. saving pci state now will
64245 - * cause saved state be that of a disabled device, which will cause
64246 - * problems during resume in that we will end up with a disabled device.
64247 - *
64248 - * indicate that the current saved state (from when interface was
64249 - * stopped) is valid. if interface was never up at time of suspend
64250 - * then the saved state will still be valid as it was saved during
64251 - * .probe. */
64252 - pdev->state_saved = true;
64253 -
64254 pci_set_power_state(pdev, PCI_D3hot);
64255
64256 return 0;
64257 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/wireless/iwlwifi/iwl-sta.c linux-2.6.29-rc3.owrt/drivers/net/wireless/iwlwifi/iwl-sta.c
64258 --- linux-2.6.29.owrt/drivers/net/wireless/iwlwifi/iwl-sta.c 2009-05-10 22:04:38.000000000 +0200
64259 +++ linux-2.6.29-rc3.owrt/drivers/net/wireless/iwlwifi/iwl-sta.c 2009-05-10 23:48:29.000000000 +0200
64260 @@ -480,9 +480,6 @@
64261 priv->num_stations = 0;
64262 memset(priv->stations, 0, sizeof(priv->stations));
64263
64264 - /* clean ucode key table bit map */
64265 - priv->ucode_key_table = 0;
64266 -
64267 spin_unlock_irqrestore(&priv->sta_lock, flags);
64268 }
64269 EXPORT_SYMBOL(iwl_clear_stations_table);
64270 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/wireless/iwlwifi/iwl-tx.c linux-2.6.29-rc3.owrt/drivers/net/wireless/iwlwifi/iwl-tx.c
64271 --- linux-2.6.29.owrt/drivers/net/wireless/iwlwifi/iwl-tx.c 2009-05-10 22:04:38.000000000 +0200
64272 +++ linux-2.6.29-rc3.owrt/drivers/net/wireless/iwlwifi/iwl-tx.c 2009-05-10 23:48:29.000000000 +0200
64273 @@ -148,7 +148,7 @@
64274 pci_unmap_single(dev,
64275 pci_unmap_addr(&txq->cmd[index]->meta, mapping),
64276 pci_unmap_len(&txq->cmd[index]->meta, len),
64277 - PCI_DMA_BIDIRECTIONAL);
64278 + PCI_DMA_TODEVICE);
64279
64280 /* Unmap chunks, if any. */
64281 for (i = 1; i < num_tbs; i++) {
64282 @@ -964,7 +964,7 @@
64283 * within command buffer array. */
64284 txcmd_phys = pci_map_single(priv->pci_dev,
64285 out_cmd, sizeof(struct iwl_cmd),
64286 - PCI_DMA_BIDIRECTIONAL);
64287 + PCI_DMA_TODEVICE);
64288 pci_unmap_addr_set(&out_cmd->meta, mapping, txcmd_phys);
64289 pci_unmap_len_set(&out_cmd->meta, len, sizeof(struct iwl_cmd));
64290 /* Add buffer containing Tx command and MAC(!) header to TFD's
64291 @@ -1115,7 +1115,7 @@
64292 IWL_MAX_SCAN_SIZE : sizeof(struct iwl_cmd);
64293
64294 phys_addr = pci_map_single(priv->pci_dev, out_cmd,
64295 - len, PCI_DMA_BIDIRECTIONAL);
64296 + len, PCI_DMA_TODEVICE);
64297 pci_unmap_addr_set(&out_cmd->meta, mapping, phys_addr);
64298 pci_unmap_len_set(&out_cmd->meta, len, len);
64299 phys_addr += offsetof(struct iwl_cmd, hdr);
64300 @@ -1212,7 +1212,7 @@
64301 pci_unmap_single(priv->pci_dev,
64302 pci_unmap_addr(&txq->cmd[cmd_idx]->meta, mapping),
64303 pci_unmap_len(&txq->cmd[cmd_idx]->meta, len),
64304 - PCI_DMA_BIDIRECTIONAL);
64305 + PCI_DMA_TODEVICE);
64306
64307 for (idx = iwl_queue_inc_wrap(idx, q->n_bd); q->read_ptr != idx;
64308 q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) {
64309 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/wireless/libertas/ethtool.c linux-2.6.29-rc3.owrt/drivers/net/wireless/libertas/ethtool.c
64310 --- linux-2.6.29.owrt/drivers/net/wireless/libertas/ethtool.c 2009-05-10 22:04:38.000000000 +0200
64311 +++ linux-2.6.29-rc3.owrt/drivers/net/wireless/libertas/ethtool.c 2009-05-10 23:48:29.000000000 +0200
64312 @@ -23,7 +23,7 @@
64313 static void lbs_ethtool_get_drvinfo(struct net_device *dev,
64314 struct ethtool_drvinfo *info)
64315 {
64316 - struct lbs_private *priv = dev->ml_priv;
64317 + struct lbs_private *priv = netdev_priv(dev);
64318
64319 snprintf(info->fw_version, 32, "%u.%u.%u.p%u",
64320 priv->fwrelease >> 24 & 0xff,
64321 @@ -47,7 +47,7 @@
64322 static int lbs_ethtool_get_eeprom(struct net_device *dev,
64323 struct ethtool_eeprom *eeprom, u8 * bytes)
64324 {
64325 - struct lbs_private *priv = dev->ml_priv;
64326 + struct lbs_private *priv = netdev_priv(dev);
64327 struct cmd_ds_802_11_eeprom_access cmd;
64328 int ret;
64329
64330 @@ -76,7 +76,7 @@
64331 static void lbs_ethtool_get_stats(struct net_device *dev,
64332 struct ethtool_stats *stats, uint64_t *data)
64333 {
64334 - struct lbs_private *priv = dev->ml_priv;
64335 + struct lbs_private *priv = netdev_priv(dev);
64336 struct cmd_ds_mesh_access mesh_access;
64337 int ret;
64338
64339 @@ -113,7 +113,7 @@
64340
64341 static int lbs_ethtool_get_sset_count(struct net_device *dev, int sset)
64342 {
64343 - struct lbs_private *priv = dev->ml_priv;
64344 + struct lbs_private *priv = netdev_priv(dev);
64345
64346 if (sset == ETH_SS_STATS && dev == priv->mesh_dev)
64347 return MESH_STATS_NUM;
64348 @@ -143,7 +143,7 @@
64349 static void lbs_ethtool_get_wol(struct net_device *dev,
64350 struct ethtool_wolinfo *wol)
64351 {
64352 - struct lbs_private *priv = dev->ml_priv;
64353 + struct lbs_private *priv = netdev_priv(dev);
64354
64355 if (priv->wol_criteria == 0xffffffff) {
64356 /* Interface driver didn't configure wake */
64357 @@ -166,7 +166,7 @@
64358 static int lbs_ethtool_set_wol(struct net_device *dev,
64359 struct ethtool_wolinfo *wol)
64360 {
64361 - struct lbs_private *priv = dev->ml_priv;
64362 + struct lbs_private *priv = netdev_priv(dev);
64363 uint32_t criteria = 0;
64364
64365 if (priv->wol_criteria == 0xffffffff && wol->wolopts)
64366 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/wireless/libertas/if_usb.c linux-2.6.29-rc3.owrt/drivers/net/wireless/libertas/if_usb.c
64367 --- linux-2.6.29.owrt/drivers/net/wireless/libertas/if_usb.c 2009-05-10 22:04:38.000000000 +0200
64368 +++ linux-2.6.29-rc3.owrt/drivers/net/wireless/libertas/if_usb.c 2009-05-10 23:48:29.000000000 +0200
64369 @@ -59,7 +59,7 @@
64370 static ssize_t if_usb_firmware_set(struct device *dev,
64371 struct device_attribute *attr, const char *buf, size_t count)
64372 {
64373 - struct lbs_private *priv = to_net_dev(dev)->ml_priv;
64374 + struct lbs_private *priv = netdev_priv(to_net_dev(dev));
64375 struct if_usb_card *cardp = priv->card;
64376 char fwname[FIRMWARE_NAME_MAX];
64377 int ret;
64378 @@ -86,7 +86,7 @@
64379 static ssize_t if_usb_boot2_set(struct device *dev,
64380 struct device_attribute *attr, const char *buf, size_t count)
64381 {
64382 - struct lbs_private *priv = to_net_dev(dev)->ml_priv;
64383 + struct lbs_private *priv = netdev_priv(to_net_dev(dev));
64384 struct if_usb_card *cardp = priv->card;
64385 char fwname[FIRMWARE_NAME_MAX];
64386 int ret;
64387 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/wireless/libertas/main.c linux-2.6.29-rc3.owrt/drivers/net/wireless/libertas/main.c
64388 --- linux-2.6.29.owrt/drivers/net/wireless/libertas/main.c 2009-05-10 22:04:38.000000000 +0200
64389 +++ linux-2.6.29-rc3.owrt/drivers/net/wireless/libertas/main.c 2009-05-10 23:48:29.000000000 +0200
64390 @@ -222,7 +222,7 @@
64391 static ssize_t lbs_anycast_get(struct device *dev,
64392 struct device_attribute *attr, char * buf)
64393 {
64394 - struct lbs_private *priv = to_net_dev(dev)->ml_priv;
64395 + struct lbs_private *priv = netdev_priv(to_net_dev(dev));
64396 struct cmd_ds_mesh_access mesh_access;
64397 int ret;
64398
64399 @@ -241,7 +241,7 @@
64400 static ssize_t lbs_anycast_set(struct device *dev,
64401 struct device_attribute *attr, const char * buf, size_t count)
64402 {
64403 - struct lbs_private *priv = to_net_dev(dev)->ml_priv;
64404 + struct lbs_private *priv = netdev_priv(to_net_dev(dev));
64405 struct cmd_ds_mesh_access mesh_access;
64406 uint32_t datum;
64407 int ret;
64408 @@ -263,7 +263,7 @@
64409 static ssize_t lbs_prb_rsp_limit_get(struct device *dev,
64410 struct device_attribute *attr, char *buf)
64411 {
64412 - struct lbs_private *priv = to_net_dev(dev)->ml_priv;
64413 + struct lbs_private *priv = netdev_priv(to_net_dev(dev));
64414 struct cmd_ds_mesh_access mesh_access;
64415 int ret;
64416 u32 retry_limit;
64417 @@ -286,7 +286,7 @@
64418 static ssize_t lbs_prb_rsp_limit_set(struct device *dev,
64419 struct device_attribute *attr, const char *buf, size_t count)
64420 {
64421 - struct lbs_private *priv = to_net_dev(dev)->ml_priv;
64422 + struct lbs_private *priv = netdev_priv(to_net_dev(dev));
64423 struct cmd_ds_mesh_access mesh_access;
64424 int ret;
64425 unsigned long retry_limit;
64426 @@ -321,7 +321,7 @@
64427 static ssize_t lbs_rtap_get(struct device *dev,
64428 struct device_attribute *attr, char * buf)
64429 {
64430 - struct lbs_private *priv = to_net_dev(dev)->ml_priv;
64431 + struct lbs_private *priv = netdev_priv(to_net_dev(dev));
64432 return snprintf(buf, 5, "0x%X\n", priv->monitormode);
64433 }
64434
64435 @@ -332,7 +332,7 @@
64436 struct device_attribute *attr, const char * buf, size_t count)
64437 {
64438 int monitor_mode;
64439 - struct lbs_private *priv = to_net_dev(dev)->ml_priv;
64440 + struct lbs_private *priv = netdev_priv(to_net_dev(dev));
64441
64442 sscanf(buf, "%x", &monitor_mode);
64443 if (monitor_mode) {
64444 @@ -383,7 +383,7 @@
64445 static ssize_t lbs_mesh_get(struct device *dev,
64446 struct device_attribute *attr, char * buf)
64447 {
64448 - struct lbs_private *priv = to_net_dev(dev)->ml_priv;
64449 + struct lbs_private *priv = netdev_priv(to_net_dev(dev));
64450 return snprintf(buf, 5, "0x%X\n", !!priv->mesh_dev);
64451 }
64452
64453 @@ -393,7 +393,7 @@
64454 static ssize_t lbs_mesh_set(struct device *dev,
64455 struct device_attribute *attr, const char * buf, size_t count)
64456 {
64457 - struct lbs_private *priv = to_net_dev(dev)->ml_priv;
64458 + struct lbs_private *priv = netdev_priv(to_net_dev(dev));
64459 int enable;
64460 int ret, action = CMD_ACT_MESH_CONFIG_STOP;
64461
64462 @@ -452,7 +452,7 @@
64463 */
64464 static int lbs_dev_open(struct net_device *dev)
64465 {
64466 - struct lbs_private *priv = dev->ml_priv;
64467 + struct lbs_private *priv = netdev_priv(dev) ;
64468 int ret = 0;
64469
64470 lbs_deb_enter(LBS_DEB_NET);
64471 @@ -521,7 +521,7 @@
64472 */
64473 static int lbs_eth_stop(struct net_device *dev)
64474 {
64475 - struct lbs_private *priv = dev->ml_priv;
64476 + struct lbs_private *priv = netdev_priv(dev);
64477
64478 lbs_deb_enter(LBS_DEB_NET);
64479
64480 @@ -538,7 +538,7 @@
64481
64482 static void lbs_tx_timeout(struct net_device *dev)
64483 {
64484 - struct lbs_private *priv = dev->ml_priv;
64485 + struct lbs_private *priv = netdev_priv(dev);
64486
64487 lbs_deb_enter(LBS_DEB_TX);
64488
64489 @@ -590,7 +590,7 @@
64490 */
64491 static struct net_device_stats *lbs_get_stats(struct net_device *dev)
64492 {
64493 - struct lbs_private *priv = dev->ml_priv;
64494 + struct lbs_private *priv = netdev_priv(dev);
64495
64496 lbs_deb_enter(LBS_DEB_NET);
64497 return &priv->stats;
64498 @@ -599,7 +599,7 @@
64499 static int lbs_set_mac_address(struct net_device *dev, void *addr)
64500 {
64501 int ret = 0;
64502 - struct lbs_private *priv = dev->ml_priv;
64503 + struct lbs_private *priv = netdev_priv(dev);
64504 struct sockaddr *phwaddr = addr;
64505 struct cmd_ds_802_11_mac_address cmd;
64506
64507 @@ -732,7 +732,7 @@
64508
64509 static void lbs_set_multicast_list(struct net_device *dev)
64510 {
64511 - struct lbs_private *priv = dev->ml_priv;
64512 + struct lbs_private *priv = netdev_priv(dev);
64513
64514 schedule_work(&priv->mcast_work);
64515 }
64516 @@ -748,7 +748,7 @@
64517 static int lbs_thread(void *data)
64518 {
64519 struct net_device *dev = data;
64520 - struct lbs_private *priv = dev->ml_priv;
64521 + struct lbs_private *priv = netdev_priv(dev);
64522 wait_queue_t wait;
64523
64524 lbs_deb_enter(LBS_DEB_THREAD);
64525 @@ -1184,7 +1184,6 @@
64526 goto done;
64527 }
64528 priv = netdev_priv(dev);
64529 - dev->ml_priv = priv;
64530
64531 if (lbs_init_adapter(priv)) {
64532 lbs_pr_err("failed to initialize adapter structure.\n");
64533 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/wireless/libertas/persistcfg.c linux-2.6.29-rc3.owrt/drivers/net/wireless/libertas/persistcfg.c
64534 --- linux-2.6.29.owrt/drivers/net/wireless/libertas/persistcfg.c 2009-05-10 22:04:38.000000000 +0200
64535 +++ linux-2.6.29-rc3.owrt/drivers/net/wireless/libertas/persistcfg.c 2009-05-10 23:48:29.000000000 +0200
64536 @@ -18,7 +18,7 @@
64537 static int mesh_get_default_parameters(struct device *dev,
64538 struct mrvl_mesh_defaults *defs)
64539 {
64540 - struct lbs_private *priv = to_net_dev(dev)->ml_priv;
64541 + struct lbs_private *priv = netdev_priv(to_net_dev(dev));
64542 struct cmd_ds_mesh_config cmd;
64543 int ret;
64544
64545 @@ -57,7 +57,7 @@
64546 static ssize_t bootflag_set(struct device *dev, struct device_attribute *attr,
64547 const char *buf, size_t count)
64548 {
64549 - struct lbs_private *priv = to_net_dev(dev)->ml_priv;
64550 + struct lbs_private *priv = netdev_priv(to_net_dev(dev));
64551 struct cmd_ds_mesh_config cmd;
64552 uint32_t datum;
64553 int ret;
64554 @@ -100,7 +100,7 @@
64555 static ssize_t boottime_set(struct device *dev,
64556 struct device_attribute *attr, const char *buf, size_t count)
64557 {
64558 - struct lbs_private *priv = to_net_dev(dev)->ml_priv;
64559 + struct lbs_private *priv = netdev_priv(to_net_dev(dev));
64560 struct cmd_ds_mesh_config cmd;
64561 uint32_t datum;
64562 int ret;
64563 @@ -152,7 +152,7 @@
64564 static ssize_t channel_set(struct device *dev, struct device_attribute *attr,
64565 const char *buf, size_t count)
64566 {
64567 - struct lbs_private *priv = to_net_dev(dev)->ml_priv;
64568 + struct lbs_private *priv = netdev_priv(to_net_dev(dev));
64569 struct cmd_ds_mesh_config cmd;
64570 uint32_t datum;
64571 int ret;
64572 @@ -210,7 +210,7 @@
64573 struct cmd_ds_mesh_config cmd;
64574 struct mrvl_mesh_defaults defs;
64575 struct mrvl_meshie *ie;
64576 - struct lbs_private *priv = to_net_dev(dev)->ml_priv;
64577 + struct lbs_private *priv = netdev_priv(to_net_dev(dev));
64578 int len;
64579 int ret;
64580
64581 @@ -269,7 +269,7 @@
64582 struct cmd_ds_mesh_config cmd;
64583 struct mrvl_mesh_defaults defs;
64584 struct mrvl_meshie *ie;
64585 - struct lbs_private *priv = to_net_dev(dev)->ml_priv;
64586 + struct lbs_private *priv = netdev_priv(to_net_dev(dev));
64587 uint32_t datum;
64588 int ret;
64589
64590 @@ -323,7 +323,7 @@
64591 struct cmd_ds_mesh_config cmd;
64592 struct mrvl_mesh_defaults defs;
64593 struct mrvl_meshie *ie;
64594 - struct lbs_private *priv = to_net_dev(dev)->ml_priv;
64595 + struct lbs_private *priv = netdev_priv(to_net_dev(dev));
64596 uint32_t datum;
64597 int ret;
64598
64599 @@ -377,7 +377,7 @@
64600 struct cmd_ds_mesh_config cmd;
64601 struct mrvl_mesh_defaults defs;
64602 struct mrvl_meshie *ie;
64603 - struct lbs_private *priv = to_net_dev(dev)->ml_priv;
64604 + struct lbs_private *priv = netdev_priv(to_net_dev(dev));
64605 uint32_t datum;
64606 int ret;
64607
64608 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/wireless/libertas/scan.c linux-2.6.29-rc3.owrt/drivers/net/wireless/libertas/scan.c
64609 --- linux-2.6.29.owrt/drivers/net/wireless/libertas/scan.c 2009-05-10 22:04:38.000000000 +0200
64610 +++ linux-2.6.29-rc3.owrt/drivers/net/wireless/libertas/scan.c 2009-05-10 23:48:29.000000000 +0200
64611 @@ -945,7 +945,7 @@
64612 union iwreq_data *wrqu, char *extra)
64613 {
64614 DECLARE_SSID_BUF(ssid);
64615 - struct lbs_private *priv = dev->ml_priv;
64616 + struct lbs_private *priv = netdev_priv(dev);
64617 int ret = 0;
64618
64619 lbs_deb_enter(LBS_DEB_WEXT);
64620 @@ -1008,7 +1008,7 @@
64621 struct iw_point *dwrq, char *extra)
64622 {
64623 #define SCAN_ITEM_SIZE 128
64624 - struct lbs_private *priv = dev->ml_priv;
64625 + struct lbs_private *priv = netdev_priv(dev);
64626 int err = 0;
64627 char *ev = extra;
64628 char *stop = ev + dwrq->length;
64629 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/wireless/libertas/tx.c linux-2.6.29-rc3.owrt/drivers/net/wireless/libertas/tx.c
64630 --- linux-2.6.29.owrt/drivers/net/wireless/libertas/tx.c 2009-05-10 22:04:38.000000000 +0200
64631 +++ linux-2.6.29-rc3.owrt/drivers/net/wireless/libertas/tx.c 2009-05-10 23:48:29.000000000 +0200
64632 @@ -60,7 +60,7 @@
64633 int lbs_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
64634 {
64635 unsigned long flags;
64636 - struct lbs_private *priv = dev->ml_priv;
64637 + struct lbs_private *priv = netdev_priv(dev);
64638 struct txpd *txpd;
64639 char *p802x_hdr;
64640 uint16_t pkt_len;
64641 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/wireless/libertas/wext.c linux-2.6.29-rc3.owrt/drivers/net/wireless/libertas/wext.c
64642 --- linux-2.6.29.owrt/drivers/net/wireless/libertas/wext.c 2009-05-10 22:04:38.000000000 +0200
64643 +++ linux-2.6.29-rc3.owrt/drivers/net/wireless/libertas/wext.c 2009-05-10 23:48:29.000000000 +0200
64644 @@ -163,7 +163,7 @@
64645 static int lbs_get_freq(struct net_device *dev, struct iw_request_info *info,
64646 struct iw_freq *fwrq, char *extra)
64647 {
64648 - struct lbs_private *priv = dev->ml_priv;
64649 + struct lbs_private *priv = netdev_priv(dev);
64650 struct chan_freq_power *cfp;
64651
64652 lbs_deb_enter(LBS_DEB_WEXT);
64653 @@ -189,7 +189,7 @@
64654 static int lbs_get_wap(struct net_device *dev, struct iw_request_info *info,
64655 struct sockaddr *awrq, char *extra)
64656 {
64657 - struct lbs_private *priv = dev->ml_priv;
64658 + struct lbs_private *priv = netdev_priv(dev);
64659
64660 lbs_deb_enter(LBS_DEB_WEXT);
64661
64662 @@ -207,7 +207,7 @@
64663 static int lbs_set_nick(struct net_device *dev, struct iw_request_info *info,
64664 struct iw_point *dwrq, char *extra)
64665 {
64666 - struct lbs_private *priv = dev->ml_priv;
64667 + struct lbs_private *priv = netdev_priv(dev);
64668
64669 lbs_deb_enter(LBS_DEB_WEXT);
64670
64671 @@ -231,7 +231,7 @@
64672 static int lbs_get_nick(struct net_device *dev, struct iw_request_info *info,
64673 struct iw_point *dwrq, char *extra)
64674 {
64675 - struct lbs_private *priv = dev->ml_priv;
64676 + struct lbs_private *priv = netdev_priv(dev);
64677
64678 lbs_deb_enter(LBS_DEB_WEXT);
64679
64680 @@ -248,7 +248,7 @@
64681 static int mesh_get_nick(struct net_device *dev, struct iw_request_info *info,
64682 struct iw_point *dwrq, char *extra)
64683 {
64684 - struct lbs_private *priv = dev->ml_priv;
64685 + struct lbs_private *priv = netdev_priv(dev);
64686
64687 lbs_deb_enter(LBS_DEB_WEXT);
64688
64689 @@ -273,7 +273,7 @@
64690 struct iw_param *vwrq, char *extra)
64691 {
64692 int ret = 0;
64693 - struct lbs_private *priv = dev->ml_priv;
64694 + struct lbs_private *priv = netdev_priv(dev);
64695 u32 val = vwrq->value;
64696
64697 lbs_deb_enter(LBS_DEB_WEXT);
64698 @@ -293,7 +293,7 @@
64699 static int lbs_get_rts(struct net_device *dev, struct iw_request_info *info,
64700 struct iw_param *vwrq, char *extra)
64701 {
64702 - struct lbs_private *priv = dev->ml_priv;
64703 + struct lbs_private *priv = netdev_priv(dev);
64704 int ret = 0;
64705 u16 val = 0;
64706
64707 @@ -315,7 +315,7 @@
64708 static int lbs_set_frag(struct net_device *dev, struct iw_request_info *info,
64709 struct iw_param *vwrq, char *extra)
64710 {
64711 - struct lbs_private *priv = dev->ml_priv;
64712 + struct lbs_private *priv = netdev_priv(dev);
64713 int ret = 0;
64714 u32 val = vwrq->value;
64715
64716 @@ -336,7 +336,7 @@
64717 static int lbs_get_frag(struct net_device *dev, struct iw_request_info *info,
64718 struct iw_param *vwrq, char *extra)
64719 {
64720 - struct lbs_private *priv = dev->ml_priv;
64721 + struct lbs_private *priv = netdev_priv(dev);
64722 int ret = 0;
64723 u16 val = 0;
64724
64725 @@ -359,7 +359,7 @@
64726 static int lbs_get_mode(struct net_device *dev,
64727 struct iw_request_info *info, u32 * uwrq, char *extra)
64728 {
64729 - struct lbs_private *priv = dev->ml_priv;
64730 + struct lbs_private *priv = netdev_priv(dev);
64731
64732 lbs_deb_enter(LBS_DEB_WEXT);
64733
64734 @@ -385,7 +385,7 @@
64735 struct iw_request_info *info,
64736 struct iw_param *vwrq, char *extra)
64737 {
64738 - struct lbs_private *priv = dev->ml_priv;
64739 + struct lbs_private *priv = netdev_priv(dev);
64740 s16 curlevel = 0;
64741 int ret = 0;
64742
64743 @@ -418,7 +418,7 @@
64744 static int lbs_set_retry(struct net_device *dev, struct iw_request_info *info,
64745 struct iw_param *vwrq, char *extra)
64746 {
64747 - struct lbs_private *priv = dev->ml_priv;
64748 + struct lbs_private *priv = netdev_priv(dev);
64749 int ret = 0;
64750 u16 slimit = 0, llimit = 0;
64751
64752 @@ -466,7 +466,7 @@
64753 static int lbs_get_retry(struct net_device *dev, struct iw_request_info *info,
64754 struct iw_param *vwrq, char *extra)
64755 {
64756 - struct lbs_private *priv = dev->ml_priv;
64757 + struct lbs_private *priv = netdev_priv(dev);
64758 int ret = 0;
64759 u16 val = 0;
64760
64761 @@ -542,7 +542,7 @@
64762 struct iw_point *dwrq, char *extra)
64763 {
64764 int i, j;
64765 - struct lbs_private *priv = dev->ml_priv;
64766 + struct lbs_private *priv = netdev_priv(dev);
64767 struct iw_range *range = (struct iw_range *)extra;
64768 struct chan_freq_power *cfp;
64769 u8 rates[MAX_RATES + 1];
64770 @@ -708,7 +708,7 @@
64771 static int lbs_set_power(struct net_device *dev, struct iw_request_info *info,
64772 struct iw_param *vwrq, char *extra)
64773 {
64774 - struct lbs_private *priv = dev->ml_priv;
64775 + struct lbs_private *priv = netdev_priv(dev);
64776
64777 lbs_deb_enter(LBS_DEB_WEXT);
64778
64779 @@ -758,7 +758,7 @@
64780 static int lbs_get_power(struct net_device *dev, struct iw_request_info *info,
64781 struct iw_param *vwrq, char *extra)
64782 {
64783 - struct lbs_private *priv = dev->ml_priv;
64784 + struct lbs_private *priv = netdev_priv(dev);
64785
64786 lbs_deb_enter(LBS_DEB_WEXT);
64787
64788 @@ -781,7 +781,7 @@
64789 EXCELLENT = 95,
64790 PERFECT = 100
64791 };
64792 - struct lbs_private *priv = dev->ml_priv;
64793 + struct lbs_private *priv = netdev_priv(dev);
64794 u32 rssi_qual;
64795 u32 tx_qual;
64796 u32 quality = 0;
64797 @@ -886,7 +886,7 @@
64798 struct iw_freq *fwrq, char *extra)
64799 {
64800 int ret = -EINVAL;
64801 - struct lbs_private *priv = dev->ml_priv;
64802 + struct lbs_private *priv = netdev_priv(dev);
64803 struct chan_freq_power *cfp;
64804 struct assoc_request * assoc_req;
64805
64806 @@ -943,7 +943,7 @@
64807 struct iw_request_info *info,
64808 struct iw_freq *fwrq, char *extra)
64809 {
64810 - struct lbs_private *priv = dev->ml_priv;
64811 + struct lbs_private *priv = netdev_priv(dev);
64812 struct chan_freq_power *cfp;
64813 int ret = -EINVAL;
64814
64815 @@ -994,7 +994,7 @@
64816 static int lbs_set_rate(struct net_device *dev, struct iw_request_info *info,
64817 struct iw_param *vwrq, char *extra)
64818 {
64819 - struct lbs_private *priv = dev->ml_priv;
64820 + struct lbs_private *priv = netdev_priv(dev);
64821 u8 new_rate = 0;
64822 int ret = -EINVAL;
64823 u8 rates[MAX_RATES + 1];
64824 @@ -1054,7 +1054,7 @@
64825 static int lbs_get_rate(struct net_device *dev, struct iw_request_info *info,
64826 struct iw_param *vwrq, char *extra)
64827 {
64828 - struct lbs_private *priv = dev->ml_priv;
64829 + struct lbs_private *priv = netdev_priv(dev);
64830
64831 lbs_deb_enter(LBS_DEB_WEXT);
64832
64833 @@ -1079,7 +1079,7 @@
64834 struct iw_request_info *info, u32 * uwrq, char *extra)
64835 {
64836 int ret = 0;
64837 - struct lbs_private *priv = dev->ml_priv;
64838 + struct lbs_private *priv = netdev_priv(dev);
64839 struct assoc_request * assoc_req;
64840
64841 lbs_deb_enter(LBS_DEB_WEXT);
64842 @@ -1124,7 +1124,7 @@
64843 struct iw_request_info *info,
64844 struct iw_point *dwrq, u8 * extra)
64845 {
64846 - struct lbs_private *priv = dev->ml_priv;
64847 + struct lbs_private *priv = netdev_priv(dev);
64848 int index = (dwrq->flags & IW_ENCODE_INDEX) - 1;
64849
64850 lbs_deb_enter(LBS_DEB_WEXT);
64851 @@ -1319,7 +1319,7 @@
64852 struct iw_point *dwrq, char *extra)
64853 {
64854 int ret = 0;
64855 - struct lbs_private *priv = dev->ml_priv;
64856 + struct lbs_private *priv = netdev_priv(dev);
64857 struct assoc_request * assoc_req;
64858 u16 is_default = 0, index = 0, set_tx_key = 0;
64859
64860 @@ -1395,7 +1395,7 @@
64861 char *extra)
64862 {
64863 int ret = -EINVAL;
64864 - struct lbs_private *priv = dev->ml_priv;
64865 + struct lbs_private *priv = netdev_priv(dev);
64866 struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
64867 int index, max_key_len;
64868
64869 @@ -1501,7 +1501,7 @@
64870 char *extra)
64871 {
64872 int ret = 0;
64873 - struct lbs_private *priv = dev->ml_priv;
64874 + struct lbs_private *priv = netdev_priv(dev);
64875 struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
64876 int alg = ext->alg;
64877 struct assoc_request * assoc_req;
64878 @@ -1639,7 +1639,7 @@
64879 struct iw_point *dwrq,
64880 char *extra)
64881 {
64882 - struct lbs_private *priv = dev->ml_priv;
64883 + struct lbs_private *priv = netdev_priv(dev);
64884 int ret = 0;
64885 struct assoc_request * assoc_req;
64886
64887 @@ -1685,7 +1685,7 @@
64888 char *extra)
64889 {
64890 int ret = 0;
64891 - struct lbs_private *priv = dev->ml_priv;
64892 + struct lbs_private *priv = netdev_priv(dev);
64893
64894 lbs_deb_enter(LBS_DEB_WEXT);
64895
64896 @@ -1713,7 +1713,7 @@
64897 struct iw_param *dwrq,
64898 char *extra)
64899 {
64900 - struct lbs_private *priv = dev->ml_priv;
64901 + struct lbs_private *priv = netdev_priv(dev);
64902 struct assoc_request * assoc_req;
64903 int ret = 0;
64904 int updated = 0;
64905 @@ -1816,7 +1816,7 @@
64906 char *extra)
64907 {
64908 int ret = 0;
64909 - struct lbs_private *priv = dev->ml_priv;
64910 + struct lbs_private *priv = netdev_priv(dev);
64911
64912 lbs_deb_enter(LBS_DEB_WEXT);
64913
64914 @@ -1857,7 +1857,7 @@
64915 struct iw_param *vwrq, char *extra)
64916 {
64917 int ret = 0;
64918 - struct lbs_private *priv = dev->ml_priv;
64919 + struct lbs_private *priv = netdev_priv(dev);
64920 s16 dbm = (s16) vwrq->value;
64921
64922 lbs_deb_enter(LBS_DEB_WEXT);
64923 @@ -1936,7 +1936,7 @@
64924 static int lbs_get_essid(struct net_device *dev, struct iw_request_info *info,
64925 struct iw_point *dwrq, char *extra)
64926 {
64927 - struct lbs_private *priv = dev->ml_priv;
64928 + struct lbs_private *priv = netdev_priv(dev);
64929
64930 lbs_deb_enter(LBS_DEB_WEXT);
64931
64932 @@ -1971,7 +1971,7 @@
64933 static int lbs_set_essid(struct net_device *dev, struct iw_request_info *info,
64934 struct iw_point *dwrq, char *extra)
64935 {
64936 - struct lbs_private *priv = dev->ml_priv;
64937 + struct lbs_private *priv = netdev_priv(dev);
64938 int ret = 0;
64939 u8 ssid[IW_ESSID_MAX_SIZE];
64940 u8 ssid_len = 0;
64941 @@ -2040,7 +2040,7 @@
64942 struct iw_request_info *info,
64943 struct iw_point *dwrq, char *extra)
64944 {
64945 - struct lbs_private *priv = dev->ml_priv;
64946 + struct lbs_private *priv = netdev_priv(dev);
64947
64948 lbs_deb_enter(LBS_DEB_WEXT);
64949
64950 @@ -2058,7 +2058,7 @@
64951 struct iw_request_info *info,
64952 struct iw_point *dwrq, char *extra)
64953 {
64954 - struct lbs_private *priv = dev->ml_priv;
64955 + struct lbs_private *priv = netdev_priv(dev);
64956 int ret = 0;
64957
64958 lbs_deb_enter(LBS_DEB_WEXT);
64959 @@ -2102,7 +2102,7 @@
64960 static int lbs_set_wap(struct net_device *dev, struct iw_request_info *info,
64961 struct sockaddr *awrq, char *extra)
64962 {
64963 - struct lbs_private *priv = dev->ml_priv;
64964 + struct lbs_private *priv = netdev_priv(dev);
64965 struct assoc_request * assoc_req;
64966 int ret = 0;
64967
64968 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/wireless/orinoco/orinoco.c linux-2.6.29-rc3.owrt/drivers/net/wireless/orinoco/orinoco.c
64969 --- linux-2.6.29.owrt/drivers/net/wireless/orinoco/orinoco.c 2009-05-10 22:04:38.000000000 +0200
64970 +++ linux-2.6.29-rc3.owrt/drivers/net/wireless/orinoco/orinoco.c 2009-05-10 23:48:29.000000000 +0200
64971 @@ -3157,20 +3157,8 @@
64972
64973 return NOTIFY_DONE;
64974 }
64975 -
64976 -static void orinoco_register_pm_notifier(struct orinoco_private *priv)
64977 -{
64978 - priv->pm_notifier.notifier_call = orinoco_pm_notifier;
64979 - register_pm_notifier(&priv->pm_notifier);
64980 -}
64981 -
64982 -static void orinoco_unregister_pm_notifier(struct orinoco_private *priv)
64983 -{
64984 - unregister_pm_notifier(&priv->pm_notifier);
64985 -}
64986 #else /* !PM_SLEEP || HERMES_CACHE_FW_ON_INIT */
64987 -#define orinoco_register_pm_notifier(priv) do { } while(0)
64988 -#define orinoco_unregister_pm_notifier(priv) do { } while(0)
64989 +#define orinoco_pm_notifier NULL
64990 #endif
64991
64992 /********************************************************************/
64993 @@ -3660,7 +3648,8 @@
64994 priv->cached_fw = NULL;
64995
64996 /* Register PM notifiers */
64997 - orinoco_register_pm_notifier(priv);
64998 + priv->pm_notifier.notifier_call = orinoco_pm_notifier;
64999 + register_pm_notifier(&priv->pm_notifier);
65000
65001 return dev;
65002 }
65003 @@ -3684,7 +3673,7 @@
65004 kfree(rx_data);
65005 }
65006
65007 - orinoco_unregister_pm_notifier(priv);
65008 + unregister_pm_notifier(&priv->pm_notifier);
65009 orinoco_uncache_fw(priv);
65010
65011 priv->wpa_ie_len = 0;
65012 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/wireless/p54/p54common.c linux-2.6.29-rc3.owrt/drivers/net/wireless/p54/p54common.c
65013 --- linux-2.6.29.owrt/drivers/net/wireless/p54/p54common.c 2009-05-10 22:04:38.000000000 +0200
65014 +++ linux-2.6.29-rc3.owrt/drivers/net/wireless/p54/p54common.c 2009-05-10 23:48:29.000000000 +0200
65015 @@ -710,11 +710,10 @@
65016 __le32 req_id)
65017 {
65018 struct p54_common *priv = dev->priv;
65019 - struct sk_buff *entry;
65020 + struct sk_buff *entry = priv->tx_queue.next;
65021 unsigned long flags;
65022
65023 spin_lock_irqsave(&priv->tx_queue.lock, flags);
65024 - entry = priv->tx_queue.next;
65025 while (entry != (struct sk_buff *)&priv->tx_queue) {
65026 struct p54_hdr *hdr = (struct p54_hdr *) entry->data;
65027
65028 @@ -733,7 +732,7 @@
65029 struct p54_common *priv = dev->priv;
65030 struct p54_hdr *hdr = (struct p54_hdr *) skb->data;
65031 struct p54_frame_sent *payload = (struct p54_frame_sent *) hdr->data;
65032 - struct sk_buff *entry;
65033 + struct sk_buff *entry = (struct sk_buff *) priv->tx_queue.next;
65034 u32 addr = le32_to_cpu(hdr->req_id) - priv->headroom;
65035 struct memrecord *range = NULL;
65036 u32 freed = 0;
65037 @@ -742,7 +741,6 @@
65038 int count, idx;
65039
65040 spin_lock_irqsave(&priv->tx_queue.lock, flags);
65041 - entry = (struct sk_buff *) priv->tx_queue.next;
65042 while (entry != (struct sk_buff *)&priv->tx_queue) {
65043 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(entry);
65044 struct p54_hdr *entry_hdr;
65045 @@ -978,7 +976,7 @@
65046 struct p54_hdr *data, u32 len)
65047 {
65048 struct p54_common *priv = dev->priv;
65049 - struct sk_buff *entry;
65050 + struct sk_buff *entry = priv->tx_queue.next;
65051 struct sk_buff *target_skb = NULL;
65052 struct ieee80211_tx_info *info;
65053 struct memrecord *range;
65054 @@ -1016,7 +1014,6 @@
65055 }
65056 }
65057
65058 - entry = priv->tx_queue.next;
65059 while (left--) {
65060 u32 hole_size;
65061 info = IEEE80211_SKB_CB(entry);
65062 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/wireless/rt2x00/rt2500usb.c linux-2.6.29-rc3.owrt/drivers/net/wireless/rt2x00/rt2500usb.c
65063 --- linux-2.6.29.owrt/drivers/net/wireless/rt2x00/rt2500usb.c 2009-05-10 22:04:38.000000000 +0200
65064 +++ linux-2.6.29-rc3.owrt/drivers/net/wireless/rt2x00/rt2500usb.c 2009-05-10 23:48:29.000000000 +0200
65065 @@ -1952,8 +1952,6 @@
65066 { USB_DEVICE(0x13b1, 0x000d), USB_DEVICE_DATA(&rt2500usb_ops) },
65067 { USB_DEVICE(0x13b1, 0x0011), USB_DEVICE_DATA(&rt2500usb_ops) },
65068 { USB_DEVICE(0x13b1, 0x001a), USB_DEVICE_DATA(&rt2500usb_ops) },
65069 - /* CNet */
65070 - { USB_DEVICE(0x1371, 0x9022), USB_DEVICE_DATA(&rt2500usb_ops) },
65071 /* Conceptronic */
65072 { USB_DEVICE(0x14b2, 0x3c02), USB_DEVICE_DATA(&rt2500usb_ops) },
65073 /* D-LINK */
65074 @@ -1978,20 +1976,14 @@
65075 { USB_DEVICE(0x148f, 0x2570), USB_DEVICE_DATA(&rt2500usb_ops) },
65076 { USB_DEVICE(0x148f, 0x2573), USB_DEVICE_DATA(&rt2500usb_ops) },
65077 { USB_DEVICE(0x148f, 0x9020), USB_DEVICE_DATA(&rt2500usb_ops) },
65078 - /* Sagem */
65079 - { USB_DEVICE(0x079b, 0x004b), USB_DEVICE_DATA(&rt2500usb_ops) },
65080 /* Siemens */
65081 { USB_DEVICE(0x0681, 0x3c06), USB_DEVICE_DATA(&rt2500usb_ops) },
65082 /* SMC */
65083 { USB_DEVICE(0x0707, 0xee13), USB_DEVICE_DATA(&rt2500usb_ops) },
65084 /* Spairon */
65085 { USB_DEVICE(0x114b, 0x0110), USB_DEVICE_DATA(&rt2500usb_ops) },
65086 - /* SURECOM */
65087 - { USB_DEVICE(0x0769, 0x11f3), USB_DEVICE_DATA(&rt2500usb_ops) },
65088 /* Trust */
65089 { USB_DEVICE(0x0eb0, 0x9020), USB_DEVICE_DATA(&rt2500usb_ops) },
65090 - /* VTech */
65091 - { USB_DEVICE(0x0f88, 0x3012), USB_DEVICE_DATA(&rt2500usb_ops) },
65092 /* Zinwell */
65093 { USB_DEVICE(0x5a57, 0x0260), USB_DEVICE_DATA(&rt2500usb_ops) },
65094 { 0, }
65095 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/wireless/rt2x00/rt73usb.c linux-2.6.29-rc3.owrt/drivers/net/wireless/rt2x00/rt73usb.c
65096 --- linux-2.6.29.owrt/drivers/net/wireless/rt2x00/rt73usb.c 2009-05-10 22:04:38.000000000 +0200
65097 +++ linux-2.6.29-rc3.owrt/drivers/net/wireless/rt2x00/rt73usb.c 2009-05-10 23:48:29.000000000 +0200
65098 @@ -2281,18 +2281,7 @@
65099 */
65100 static struct usb_device_id rt73usb_device_table[] = {
65101 /* AboCom */
65102 - { USB_DEVICE(0x07b8, 0xb21b), USB_DEVICE_DATA(&rt73usb_ops) },
65103 - { USB_DEVICE(0x07b8, 0xb21c), USB_DEVICE_DATA(&rt73usb_ops) },
65104 { USB_DEVICE(0x07b8, 0xb21d), USB_DEVICE_DATA(&rt73usb_ops) },
65105 - { USB_DEVICE(0x07b8, 0xb21e), USB_DEVICE_DATA(&rt73usb_ops) },
65106 - { USB_DEVICE(0x07b8, 0xb21f), USB_DEVICE_DATA(&rt73usb_ops) },
65107 - /* AL */
65108 - { USB_DEVICE(0x14b2, 0x3c10), USB_DEVICE_DATA(&rt73usb_ops) },
65109 - /* Amigo */
65110 - { USB_DEVICE(0x148f, 0x9021), USB_DEVICE_DATA(&rt73usb_ops) },
65111 - { USB_DEVICE(0x0eb0, 0x9021), USB_DEVICE_DATA(&rt73usb_ops) },
65112 - /* AMIT */
65113 - { USB_DEVICE(0x18c5, 0x0002), USB_DEVICE_DATA(&rt73usb_ops) },
65114 /* Askey */
65115 { USB_DEVICE(0x1690, 0x0722), USB_DEVICE_DATA(&rt73usb_ops) },
65116 /* ASUS */
65117 @@ -2305,9 +2294,7 @@
65118 { USB_DEVICE(0x050d, 0x905c), USB_DEVICE_DATA(&rt73usb_ops) },
65119 /* Billionton */
65120 { USB_DEVICE(0x1631, 0xc019), USB_DEVICE_DATA(&rt73usb_ops) },
65121 - { USB_DEVICE(0x08dd, 0x0120), USB_DEVICE_DATA(&rt73usb_ops) },
65122 /* Buffalo */
65123 - { USB_DEVICE(0x0411, 0x00d8), USB_DEVICE_DATA(&rt73usb_ops) },
65124 { USB_DEVICE(0x0411, 0x00f4), USB_DEVICE_DATA(&rt73usb_ops) },
65125 /* CNet */
65126 { USB_DEVICE(0x1371, 0x9022), USB_DEVICE_DATA(&rt73usb_ops) },
65127 @@ -2321,11 +2308,6 @@
65128 { USB_DEVICE(0x07d1, 0x3c04), USB_DEVICE_DATA(&rt73usb_ops) },
65129 { USB_DEVICE(0x07d1, 0x3c06), USB_DEVICE_DATA(&rt73usb_ops) },
65130 { USB_DEVICE(0x07d1, 0x3c07), USB_DEVICE_DATA(&rt73usb_ops) },
65131 - /* Edimax */
65132 - { USB_DEVICE(0x7392, 0x7318), USB_DEVICE_DATA(&rt73usb_ops) },
65133 - { USB_DEVICE(0x7392, 0x7618), USB_DEVICE_DATA(&rt73usb_ops) },
65134 - /* EnGenius */
65135 - { USB_DEVICE(0x1740, 0x3701), USB_DEVICE_DATA(&rt73usb_ops) },
65136 /* Gemtek */
65137 { USB_DEVICE(0x15a9, 0x0004), USB_DEVICE_DATA(&rt73usb_ops) },
65138 /* Gigabyte */
65139 @@ -2346,34 +2328,22 @@
65140 { USB_DEVICE(0x0db0, 0xa861), USB_DEVICE_DATA(&rt73usb_ops) },
65141 { USB_DEVICE(0x0db0, 0xa874), USB_DEVICE_DATA(&rt73usb_ops) },
65142 /* Ralink */
65143 - { USB_DEVICE(0x04bb, 0x093d), USB_DEVICE_DATA(&rt73usb_ops) },
65144 { USB_DEVICE(0x148f, 0x2573), USB_DEVICE_DATA(&rt73usb_ops) },
65145 { USB_DEVICE(0x148f, 0x2671), USB_DEVICE_DATA(&rt73usb_ops) },
65146 /* Qcom */
65147 { USB_DEVICE(0x18e8, 0x6196), USB_DEVICE_DATA(&rt73usb_ops) },
65148 { USB_DEVICE(0x18e8, 0x6229), USB_DEVICE_DATA(&rt73usb_ops) },
65149 { USB_DEVICE(0x18e8, 0x6238), USB_DEVICE_DATA(&rt73usb_ops) },
65150 - /* Samsung */
65151 - { USB_DEVICE(0x04e8, 0x4471), USB_DEVICE_DATA(&rt73usb_ops) },
65152 /* Senao */
65153 { USB_DEVICE(0x1740, 0x7100), USB_DEVICE_DATA(&rt73usb_ops) },
65154 /* Sitecom */
65155 - { USB_DEVICE(0x0df6, 0x0024), USB_DEVICE_DATA(&rt73usb_ops) },
65156 - { USB_DEVICE(0x0df6, 0x0027), USB_DEVICE_DATA(&rt73usb_ops) },
65157 - { USB_DEVICE(0x0df6, 0x002f), USB_DEVICE_DATA(&rt73usb_ops) },
65158 - { USB_DEVICE(0x0df6, 0x90ac), USB_DEVICE_DATA(&rt73usb_ops) },
65159 { USB_DEVICE(0x0df6, 0x9712), USB_DEVICE_DATA(&rt73usb_ops) },
65160 + { USB_DEVICE(0x0df6, 0x90ac), USB_DEVICE_DATA(&rt73usb_ops) },
65161 /* Surecom */
65162 { USB_DEVICE(0x0769, 0x31f3), USB_DEVICE_DATA(&rt73usb_ops) },
65163 - /* Philips */
65164 - { USB_DEVICE(0x0471, 0x200a), USB_DEVICE_DATA(&rt73usb_ops) },
65165 /* Planex */
65166 { USB_DEVICE(0x2019, 0xab01), USB_DEVICE_DATA(&rt73usb_ops) },
65167 { USB_DEVICE(0x2019, 0xab50), USB_DEVICE_DATA(&rt73usb_ops) },
65168 - /* Zcom */
65169 - { USB_DEVICE(0x0cde, 0x001c), USB_DEVICE_DATA(&rt73usb_ops) },
65170 - /* ZyXEL */
65171 - { USB_DEVICE(0x0586, 0x3415), USB_DEVICE_DATA(&rt73usb_ops) },
65172 { 0, }
65173 };
65174
65175 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/wireless/rtl818x/rtl8187_dev.c linux-2.6.29-rc3.owrt/drivers/net/wireless/rtl818x/rtl8187_dev.c
65176 --- linux-2.6.29.owrt/drivers/net/wireless/rtl818x/rtl8187_dev.c 2009-05-10 22:04:38.000000000 +0200
65177 +++ linux-2.6.29-rc3.owrt/drivers/net/wireless/rtl818x/rtl8187_dev.c 2009-05-10 23:48:29.000000000 +0200
65178 @@ -48,10 +48,6 @@
65179 {USB_DEVICE(0x0bda, 0x8189), .driver_info = DEVICE_RTL8187B},
65180 {USB_DEVICE(0x0bda, 0x8197), .driver_info = DEVICE_RTL8187B},
65181 {USB_DEVICE(0x0bda, 0x8198), .driver_info = DEVICE_RTL8187B},
65182 - /* Surecom */
65183 - {USB_DEVICE(0x0769, 0x11F2), .driver_info = DEVICE_RTL8187},
65184 - /* Logitech */
65185 - {USB_DEVICE(0x0789, 0x010C), .driver_info = DEVICE_RTL8187},
65186 /* Netgear */
65187 {USB_DEVICE(0x0846, 0x6100), .driver_info = DEVICE_RTL8187},
65188 {USB_DEVICE(0x0846, 0x6a00), .driver_info = DEVICE_RTL8187},
65189 @@ -61,16 +57,8 @@
65190 /* Sitecom */
65191 {USB_DEVICE(0x0df6, 0x000d), .driver_info = DEVICE_RTL8187},
65192 {USB_DEVICE(0x0df6, 0x0028), .driver_info = DEVICE_RTL8187B},
65193 - /* Sphairon Access Systems GmbH */
65194 - {USB_DEVICE(0x114B, 0x0150), .driver_info = DEVICE_RTL8187},
65195 - /* Dick Smith Electronics */
65196 - {USB_DEVICE(0x1371, 0x9401), .driver_info = DEVICE_RTL8187},
65197 /* Abocom */
65198 {USB_DEVICE(0x13d1, 0xabe6), .driver_info = DEVICE_RTL8187},
65199 - /* Qcom */
65200 - {USB_DEVICE(0x18E8, 0x6232), .driver_info = DEVICE_RTL8187},
65201 - /* AirLive */
65202 - {USB_DEVICE(0x1b75, 0x8187), .driver_info = DEVICE_RTL8187},
65203 {}
65204 };
65205
65206 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/wireless/rtl818x/rtl8187_rtl8225.c linux-2.6.29-rc3.owrt/drivers/net/wireless/rtl818x/rtl8187_rtl8225.c
65207 --- linux-2.6.29.owrt/drivers/net/wireless/rtl818x/rtl8187_rtl8225.c 2009-05-10 22:04:38.000000000 +0200
65208 +++ linux-2.6.29-rc3.owrt/drivers/net/wireless/rtl818x/rtl8187_rtl8225.c 2009-05-10 23:48:29.000000000 +0200
65209 @@ -285,10 +285,7 @@
65210 ofdm_power = priv->channels[channel - 1].hw_value >> 4;
65211
65212 cck_power = min(cck_power, (u8)11);
65213 - if (ofdm_power > (u8)15)
65214 - ofdm_power = 25;
65215 - else
65216 - ofdm_power += 10;
65217 + ofdm_power = min(ofdm_power, (u8)35);
65218
65219 rtl818x_iowrite8(priv, &priv->map->TX_GAIN_CCK,
65220 rtl8225_tx_gain_cck_ofdm[cck_power / 6] >> 1);
65221 @@ -539,10 +536,7 @@
65222 cck_power += priv->txpwr_base & 0xF;
65223 cck_power = min(cck_power, (u8)35);
65224
65225 - if (ofdm_power > (u8)15)
65226 - ofdm_power = 25;
65227 - else
65228 - ofdm_power += 10;
65229 + ofdm_power = min(ofdm_power, (u8)15);
65230 ofdm_power += priv->txpwr_base >> 4;
65231 ofdm_power = min(ofdm_power, (u8)35);
65232
65233 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/wireless/zd1211rw/zd_mac.c linux-2.6.29-rc3.owrt/drivers/net/wireless/zd1211rw/zd_mac.c
65234 --- linux-2.6.29.owrt/drivers/net/wireless/zd1211rw/zd_mac.c 2009-05-10 22:04:38.000000000 +0200
65235 +++ linux-2.6.29-rc3.owrt/drivers/net/wireless/zd1211rw/zd_mac.c 2009-05-10 23:48:29.000000000 +0200
65236 @@ -575,17 +575,13 @@
65237
65238 r = fill_ctrlset(mac, skb);
65239 if (r)
65240 - goto fail;
65241 + return r;
65242
65243 info->rate_driver_data[0] = hw;
65244
65245 r = zd_usb_tx(&mac->chip.usb, skb);
65246 if (r)
65247 - goto fail;
65248 - return 0;
65249 -
65250 -fail:
65251 - dev_kfree_skb(skb);
65252 + return r;
65253 return 0;
65254 }
65255
65256 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/wireless/zd1211rw/zd_rf.c linux-2.6.29-rc3.owrt/drivers/net/wireless/zd1211rw/zd_rf.c
65257 --- linux-2.6.29.owrt/drivers/net/wireless/zd1211rw/zd_rf.c 2009-05-10 22:04:38.000000000 +0200
65258 +++ linux-2.6.29-rc3.owrt/drivers/net/wireless/zd1211rw/zd_rf.c 2009-05-10 23:48:29.000000000 +0200
65259 @@ -86,7 +86,6 @@
65260 case AL7230B_RF:
65261 r = zd_rf_init_al7230b(rf);
65262 break;
65263 - case MAXIM_NEW_RF:
65264 case UW2453_RF:
65265 r = zd_rf_init_uw2453(rf);
65266 break;
65267 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/net/wireless/zd1211rw/zd_usb.c linux-2.6.29-rc3.owrt/drivers/net/wireless/zd1211rw/zd_usb.c
65268 --- linux-2.6.29.owrt/drivers/net/wireless/zd1211rw/zd_usb.c 2009-05-10 22:04:38.000000000 +0200
65269 +++ linux-2.6.29-rc3.owrt/drivers/net/wireless/zd1211rw/zd_usb.c 2009-05-10 23:48:29.000000000 +0200
65270 @@ -37,7 +37,6 @@
65271 static struct usb_device_id usb_ids[] = {
65272 /* ZD1211 */
65273 { USB_DEVICE(0x0ace, 0x1211), .driver_info = DEVICE_ZD1211 },
65274 - { USB_DEVICE(0x0ace, 0xa211), .driver_info = DEVICE_ZD1211 },
65275 { USB_DEVICE(0x07b8, 0x6001), .driver_info = DEVICE_ZD1211 },
65276 { USB_DEVICE(0x126f, 0xa006), .driver_info = DEVICE_ZD1211 },
65277 { USB_DEVICE(0x6891, 0xa727), .driver_info = DEVICE_ZD1211 },
65278 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/parisc/dino.c linux-2.6.29-rc3.owrt/drivers/parisc/dino.c
65279 --- linux-2.6.29.owrt/drivers/parisc/dino.c 2009-05-10 22:04:38.000000000 +0200
65280 +++ linux-2.6.29-rc3.owrt/drivers/parisc/dino.c 2009-05-10 23:48:29.000000000 +0200
65281 @@ -479,7 +479,7 @@
65282 res = &dino_dev->hba.lmmio_space;
65283 res->flags = IORESOURCE_MEM;
65284 size = scnprintf(name, sizeof(name), "Dino LMMIO (%s)",
65285 - dev_name(bus->bridge));
65286 + bus->bridge->bus_id);
65287 res->name = kmalloc(size+1, GFP_KERNEL);
65288 if(res->name)
65289 strcpy((char *)res->name, name);
65290 @@ -493,7 +493,7 @@
65291 struct list_head *ln, *tmp_ln;
65292
65293 printk(KERN_ERR "Dino: cannot attach bus %s\n",
65294 - dev_name(bus->bridge));
65295 + bus->bridge->bus_id);
65296 /* kill the bus, we can't do anything with it */
65297 list_for_each_safe(ln, tmp_ln, &bus->devices) {
65298 struct pci_dev *dev = pci_dev_b(ln);
65299 @@ -587,7 +587,7 @@
65300 bus->resource[i+1] = &res[i];
65301 }
65302
65303 - } else if (bus->parent) {
65304 + } else if(bus->self) {
65305 int i;
65306
65307 pci_read_bridge_bases(bus);
65308 @@ -611,12 +611,12 @@
65309 }
65310
65311 DBG("DEBUG %s assigning %d [0x%lx,0x%lx]\n",
65312 - dev_name(&bus->self->dev), i,
65313 + bus->self->dev.bus_id, i,
65314 bus->self->resource[i].start,
65315 bus->self->resource[i].end);
65316 pci_assign_resource(bus->self, i);
65317 DBG("DEBUG %s after assign %d [0x%lx,0x%lx]\n",
65318 - dev_name(&bus->self->dev), i,
65319 + bus->self->dev.bus_id, i,
65320 bus->self->resource[i].start,
65321 bus->self->resource[i].end);
65322 }
65323 @@ -1026,8 +1026,7 @@
65324 dino_current_bus = bus->subordinate + 1;
65325 pci_bus_assign_resources(bus);
65326 } else {
65327 - printk(KERN_ERR "ERROR: failed to scan PCI bus on %s (probably duplicate bus number %d)\n",
65328 - dev_name(&dev->dev), dino_current_bus);
65329 + printk(KERN_ERR "ERROR: failed to scan PCI bus on %s (probably duplicate bus number %d)\n", dev->dev.bus_id, dino_current_bus);
65330 /* increment the bus number in case of duplicates */
65331 dino_current_bus++;
65332 }
65333 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/parisc/gsc.c linux-2.6.29-rc3.owrt/drivers/parisc/gsc.c
65334 --- linux-2.6.29.owrt/drivers/parisc/gsc.c 2009-05-10 22:04:38.000000000 +0200
65335 +++ linux-2.6.29-rc3.owrt/drivers/parisc/gsc.c 2009-05-10 23:48:29.000000000 +0200
65336 @@ -186,34 +186,29 @@
65337 *irqp = irq;
65338 }
65339
65340 -struct gsc_fixup_struct {
65341 - void (*choose_irq)(struct parisc_device *, void *);
65342 - void *ctrl;
65343 -};
65344 -
65345 -static int gsc_fixup_irqs_callback(struct device *dev, void *data)
65346 +static struct device *next_device(struct klist_iter *i)
65347 {
65348 - struct parisc_device *padev = to_parisc_device(dev);
65349 - struct gsc_fixup_struct *gf = data;
65350 -
65351 - /* work-around for 715/64 and others which have parent
65352 - at path [5] and children at path [5/0/x] */
65353 - if (padev->id.hw_type == HPHW_FAULTY)
65354 - gsc_fixup_irqs(padev, gf->ctrl, gf->choose_irq);
65355 - gf->choose_irq(padev, gf->ctrl);
65356 -
65357 - return 0;
65358 + struct klist_node * n = klist_next(i);
65359 + return n ? container_of(n, struct device, knode_parent) : NULL;
65360 }
65361
65362 void gsc_fixup_irqs(struct parisc_device *parent, void *ctrl,
65363 void (*choose_irq)(struct parisc_device *, void *))
65364 {
65365 - struct gsc_fixup_struct data = {
65366 - .choose_irq = choose_irq,
65367 - .ctrl = ctrl,
65368 - };
65369 + struct device *dev;
65370 + struct klist_iter i;
65371
65372 - device_for_each_child(&parent->dev, &data, gsc_fixup_irqs_callback);
65373 + klist_iter_init(&parent->dev.klist_children, &i);
65374 + while ((dev = next_device(&i))) {
65375 + struct parisc_device *padev = to_parisc_device(dev);
65376 +
65377 + /* work-around for 715/64 and others which have parent
65378 + at path [5] and children at path [5/0/x] */
65379 + if (padev->id.hw_type == HPHW_FAULTY)
65380 + return gsc_fixup_irqs(padev, ctrl, choose_irq);
65381 + choose_irq(padev, ctrl);
65382 + }
65383 + klist_iter_exit(&i);
65384 }
65385
65386 int gsc_common_setup(struct parisc_device *parent, struct gsc_asic *gsc_asic)
65387 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/parisc/iosapic.c linux-2.6.29-rc3.owrt/drivers/parisc/iosapic.c
65388 --- linux-2.6.29.owrt/drivers/parisc/iosapic.c 2009-05-10 22:04:38.000000000 +0200
65389 +++ linux-2.6.29-rc3.owrt/drivers/parisc/iosapic.c 2009-05-10 23:48:29.000000000 +0200
65390 @@ -487,7 +487,7 @@
65391 }
65392
65393 /* Check if pcidev behind a PPB */
65394 - if (pcidev->bus->parent) {
65395 + if (NULL != pcidev->bus->self) {
65396 /* Convert pcidev INTR_PIN into something we
65397 ** can lookup in the IRT.
65398 */
65399 @@ -523,9 +523,10 @@
65400 #endif /* PCI_BRIDGE_FUNCS */
65401
65402 /*
65403 - * Locate the host slot of the PPB.
65404 - */
65405 - while (p->parent->parent)
65406 + ** Locate the host slot the PPB nearest the Host bus
65407 + ** adapter.
65408 + */
65409 + while (NULL != p->parent->self)
65410 p = p->parent;
65411
65412 intr_slot = PCI_SLOT(p->self->devfn);
65413 @@ -708,14 +709,11 @@
65414 struct vector_info *vi = iosapic_get_vector(irq);
65415 u32 d0, d1, dummy_d0;
65416 unsigned long flags;
65417 - int dest_cpu;
65418
65419 - dest_cpu = cpu_check_affinity(irq, dest);
65420 - if (dest_cpu < 0)
65421 + if (cpu_check_affinity(irq, dest))
65422 return;
65423
65424 - irq_desc[irq].affinity = cpumask_of_cpu(dest_cpu);
65425 - vi->txn_addr = txn_affinity_addr(irq, dest_cpu);
65426 + vi->txn_addr = txn_affinity_addr(irq, cpumask_first(dest));
65427
65428 spin_lock_irqsave(&iosapic_lock, flags);
65429 /* d1 contains the destination CPU, so only want to set that
65430 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/parisc/lba_pci.c linux-2.6.29-rc3.owrt/drivers/parisc/lba_pci.c
65431 --- linux-2.6.29.owrt/drivers/parisc/lba_pci.c 2009-05-10 22:04:38.000000000 +0200
65432 +++ linux-2.6.29-rc3.owrt/drivers/parisc/lba_pci.c 2009-05-10 23:48:29.000000000 +0200
65433 @@ -644,7 +644,7 @@
65434 ** Properly Setup MMIO resources for this bus.
65435 ** pci_alloc_primary_bus() mangles this.
65436 */
65437 - if (bus->parent) {
65438 + if (bus->self) {
65439 int i;
65440 /* PCI-PCI Bridge */
65441 pci_read_bridge_bases(bus);
65442 @@ -802,7 +802,7 @@
65443 ** Can't fixup here anyway....garr...
65444 */
65445 if (fbb_enable) {
65446 - if (bus->parent) {
65447 + if (bus->self) {
65448 u8 control;
65449 /* enable on PPB */
65450 (void) pci_read_config_byte(bus->self, PCI_BRIDGE_CONTROL, &control);
65451 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/parisc/sba_iommu.c linux-2.6.29-rc3.owrt/drivers/parisc/sba_iommu.c
65452 --- linux-2.6.29.owrt/drivers/parisc/sba_iommu.c 2009-05-10 22:04:38.000000000 +0200
65453 +++ linux-2.6.29-rc3.owrt/drivers/parisc/sba_iommu.c 2009-05-10 23:48:29.000000000 +0200
65454 @@ -668,7 +668,7 @@
65455 * @dev: instance of PCI owned by the driver that's asking
65456 * @mask: number of address bits this PCI device can handle
65457 *
65458 - * See Documentation/PCI/PCI-DMA-mapping.txt
65459 + * See Documentation/DMA-mapping.txt
65460 */
65461 static int sba_dma_supported( struct device *dev, u64 mask)
65462 {
65463 @@ -680,8 +680,8 @@
65464 return(0);
65465 }
65466
65467 - /* Documentation/PCI/PCI-DMA-mapping.txt tells drivers to try 64-bit
65468 - * first, then fall back to 32-bit if that fails.
65469 + /* Documentation/DMA-mapping.txt tells drivers to try 64-bit first,
65470 + * then fall back to 32-bit if that fails.
65471 * We are just "encouraging" 32-bit DMA masks here since we can
65472 * never allow IOMMU bypass unless we add special support for ZX1.
65473 */
65474 @@ -706,7 +706,7 @@
65475 * @size: number of bytes to map in driver buffer.
65476 * @direction: R/W or both.
65477 *
65478 - * See Documentation/PCI/PCI-DMA-mapping.txt
65479 + * See Documentation/DMA-mapping.txt
65480 */
65481 static dma_addr_t
65482 sba_map_single(struct device *dev, void *addr, size_t size,
65483 @@ -785,7 +785,7 @@
65484 * @size: number of bytes mapped in driver buffer.
65485 * @direction: R/W or both.
65486 *
65487 - * See Documentation/PCI/PCI-DMA-mapping.txt
65488 + * See Documentation/DMA-mapping.txt
65489 */
65490 static void
65491 sba_unmap_single(struct device *dev, dma_addr_t iova, size_t size,
65492 @@ -861,7 +861,7 @@
65493 * @size: number of bytes mapped in driver buffer.
65494 * @dma_handle: IOVA of new buffer.
65495 *
65496 - * See Documentation/PCI/PCI-DMA-mapping.txt
65497 + * See Documentation/DMA-mapping.txt
65498 */
65499 static void *sba_alloc_consistent(struct device *hwdev, size_t size,
65500 dma_addr_t *dma_handle, gfp_t gfp)
65501 @@ -892,7 +892,7 @@
65502 * @vaddr: virtual address IOVA of "consistent" buffer.
65503 * @dma_handler: IO virtual address of "consistent" buffer.
65504 *
65505 - * See Documentation/PCI/PCI-DMA-mapping.txt
65506 + * See Documentation/DMA-mapping.txt
65507 */
65508 static void
65509 sba_free_consistent(struct device *hwdev, size_t size, void *vaddr,
65510 @@ -927,7 +927,7 @@
65511 * @nents: number of entries in list
65512 * @direction: R/W or both.
65513 *
65514 - * See Documentation/PCI/PCI-DMA-mapping.txt
65515 + * See Documentation/DMA-mapping.txt
65516 */
65517 static int
65518 sba_map_sg(struct device *dev, struct scatterlist *sglist, int nents,
65519 @@ -1011,7 +1011,7 @@
65520 * @nents: number of entries in list
65521 * @direction: R/W or both.
65522 *
65523 - * See Documentation/PCI/PCI-DMA-mapping.txt
65524 + * See Documentation/DMA-mapping.txt
65525 */
65526 static void
65527 sba_unmap_sg(struct device *dev, struct scatterlist *sglist, int nents,
65528 @@ -1206,48 +1206,30 @@
65529 return (void *) pdir_base;
65530 }
65531
65532 -struct ibase_data_struct {
65533 - struct ioc *ioc;
65534 - int ioc_num;
65535 -};
65536 -
65537 -static int setup_ibase_imask_callback(struct device *dev, void *data)
65538 +static struct device *next_device(struct klist_iter *i)
65539 {
65540 - /* lba_set_iregs() is in drivers/parisc/lba_pci.c */
65541 - extern void lba_set_iregs(struct parisc_device *, u32, u32);
65542 - struct parisc_device *lba = to_parisc_device(dev);
65543 - struct ibase_data_struct *ibd = data;
65544 - int rope_num = (lba->hpa.start >> 13) & 0xf;
65545 - if (rope_num >> 3 == ibd->ioc_num)
65546 - lba_set_iregs(lba, ibd->ioc->ibase, ibd->ioc->imask);
65547 - return 0;
65548 + struct klist_node * n = klist_next(i);
65549 + return n ? container_of(n, struct device, knode_parent) : NULL;
65550 }
65551
65552 /* setup Mercury or Elroy IBASE/IMASK registers. */
65553 static void
65554 setup_ibase_imask(struct parisc_device *sba, struct ioc *ioc, int ioc_num)
65555 {
65556 - struct ibase_data_struct ibase_data = {
65557 - .ioc = ioc,
65558 - .ioc_num = ioc_num,
65559 - };
65560 -
65561 - device_for_each_child(&sba->dev, &ibase_data,
65562 - setup_ibase_imask_callback);
65563 -}
65564 -
65565 -#ifdef SBA_AGP_SUPPORT
65566 -static int
65567 -sba_ioc_find_quicksilver(struct device *dev, void *data)
65568 -{
65569 - int *agp_found = data;
65570 - struct parisc_device *lba = to_parisc_device(dev);
65571 + /* lba_set_iregs() is in drivers/parisc/lba_pci.c */
65572 + extern void lba_set_iregs(struct parisc_device *, u32, u32);
65573 + struct device *dev;
65574 + struct klist_iter i;
65575
65576 - if (IS_QUICKSILVER(lba))
65577 - *agp_found = 1;
65578 - return 0;
65579 + klist_iter_init(&sba->dev.klist_children, &i);
65580 + while ((dev = next_device(&i))) {
65581 + struct parisc_device *lba = to_parisc_device(dev);
65582 + int rope_num = (lba->hpa.start >> 13) & 0xf;
65583 + if (rope_num >> 3 == ioc_num)
65584 + lba_set_iregs(lba, ioc->ibase, ioc->imask);
65585 + }
65586 + klist_iter_exit(&i);
65587 }
65588 -#endif
65589
65590 static void
65591 sba_ioc_init_pluto(struct parisc_device *sba, struct ioc *ioc, int ioc_num)
65592 @@ -1350,6 +1332,9 @@
65593 WRITE_REG(ioc->ibase | 31, ioc->ioc_hpa + IOC_PCOM);
65594
65595 #ifdef SBA_AGP_SUPPORT
65596 +{
65597 + struct klist_iter i;
65598 + struct device *dev = NULL;
65599
65600 /*
65601 ** If an AGP device is present, only use half of the IOV space
65602 @@ -1359,7 +1344,13 @@
65603 ** We program the next pdir index after we stop w/ a key for
65604 ** the GART code to handshake on.
65605 */
65606 - device_for_each_child(&sba->dev, &agp_found, sba_ioc_find_quicksilver);
65607 + klist_iter_init(&sba->dev.klist_children, &i);
65608 + while ((dev = next_device(&i))) {
65609 + struct parisc_device *lba = to_parisc_device(dev);
65610 + if (IS_QUICKSILVER(lba))
65611 + agp_found = 1;
65612 + }
65613 + klist_iter_exit(&i);
65614
65615 if (agp_found && sba_reserve_agpgart) {
65616 printk(KERN_INFO "%s: reserving %dMb of IOVA space for agpgart\n",
65617 @@ -1367,7 +1358,9 @@
65618 ioc->pdir_size /= 2;
65619 ioc->pdir_base[PDIR_INDEX(iova_space_size/2)] = SBA_AGPGART_COOKIE;
65620 }
65621 +}
65622 #endif /*SBA_AGP_SUPPORT*/
65623 +
65624 }
65625
65626 static void
65627 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/parport/parport_atari.c linux-2.6.29-rc3.owrt/drivers/parport/parport_atari.c
65628 --- linux-2.6.29.owrt/drivers/parport/parport_atari.c 2009-05-10 22:04:39.000000000 +0200
65629 +++ linux-2.6.29-rc3.owrt/drivers/parport/parport_atari.c 2009-05-10 23:48:29.000000000 +0200
65630 @@ -84,7 +84,7 @@
65631 static unsigned char
65632 parport_atari_read_status(struct parport *p)
65633 {
65634 - return ((st_mfp.par_dt_reg & 1 ? 0 : PARPORT_STATUS_BUSY) |
65635 + return ((mfp.par_dt_reg & 1 ? 0 : PARPORT_STATUS_BUSY) |
65636 PARPORT_STATUS_SELECT | PARPORT_STATUS_ERROR);
65637 }
65638
65639 @@ -193,9 +193,9 @@
65640 sound_ym.wd_data = sound_ym.rd_data_reg_sel | (1 << 5);
65641 local_irq_restore(flags);
65642 /* MFP port I0 as input. */
65643 - st_mfp.data_dir &= ~1;
65644 + mfp.data_dir &= ~1;
65645 /* MFP port I0 interrupt on high->low edge. */
65646 - st_mfp.active_edge &= ~1;
65647 + mfp.active_edge &= ~1;
65648 p = parport_register_port((unsigned long)&sound_ym.wd_data,
65649 IRQ_MFP_BUSY, PARPORT_DMA_NONE,
65650 &parport_atari_ops);
65651 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/parport/parport_serial.c linux-2.6.29-rc3.owrt/drivers/parport/parport_serial.c
65652 --- linux-2.6.29.owrt/drivers/parport/parport_serial.c 2009-05-10 22:04:39.000000000 +0200
65653 +++ linux-2.6.29-rc3.owrt/drivers/parport/parport_serial.c 2009-05-10 23:48:29.000000000 +0200
65654 @@ -64,11 +64,6 @@
65655
65656 static int __devinit netmos_parallel_init(struct pci_dev *dev, struct parport_pc_pci *card, int autoirq, int autodma)
65657 {
65658 - /* the rule described below doesn't hold for this device */
65659 - if (dev->device == PCI_DEVICE_ID_NETMOS_9835 &&
65660 - dev->subsystem_vendor == PCI_VENDOR_ID_IBM &&
65661 - dev->subsystem_device == 0x0299)
65662 - return -ENODEV;
65663 /*
65664 * Netmos uses the subdevice ID to indicate the number of parallel
65665 * and serial ports. The form is 0x00PS, where <P> is the number of
65666 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/pci/dmar.c linux-2.6.29-rc3.owrt/drivers/pci/dmar.c
65667 --- linux-2.6.29.owrt/drivers/pci/dmar.c 2009-05-10 22:04:39.000000000 +0200
65668 +++ linux-2.6.29-rc3.owrt/drivers/pci/dmar.c 2009-05-10 23:48:29.000000000 +0200
65669 @@ -330,14 +330,6 @@
65670 entry_header = (struct acpi_dmar_header *)(dmar + 1);
65671 while (((unsigned long)entry_header) <
65672 (((unsigned long)dmar) + dmar_tbl->length)) {
65673 - /* Avoid looping forever on bad ACPI tables */
65674 - if (entry_header->length == 0) {
65675 - printk(KERN_WARNING PREFIX
65676 - "Invalid 0-length structure\n");
65677 - ret = -EINVAL;
65678 - break;
65679 - }
65680 -
65681 dmar_table_print_dmar_entry(entry_header);
65682
65683 switch (entry_header->type) {
65684 @@ -499,7 +491,7 @@
65685 int map_size;
65686 u32 ver;
65687 static int iommu_allocated = 0;
65688 - int agaw = 0;
65689 + int agaw;
65690
65691 iommu = kzalloc(sizeof(*iommu), GFP_KERNEL);
65692 if (!iommu)
65693 @@ -515,7 +507,6 @@
65694 iommu->cap = dmar_readq(iommu->reg + DMAR_CAP_REG);
65695 iommu->ecap = dmar_readq(iommu->reg + DMAR_ECAP_REG);
65696
65697 -#ifdef CONFIG_DMAR
65698 agaw = iommu_calculate_agaw(iommu);
65699 if (agaw < 0) {
65700 printk(KERN_ERR
65701 @@ -523,7 +514,6 @@
65702 iommu->seq_id);
65703 goto error;
65704 }
65705 -#endif
65706 iommu->agaw = agaw;
65707
65708 /* the registers might be more than one page */
65709 @@ -581,49 +571,19 @@
65710 }
65711 }
65712
65713 -static int qi_check_fault(struct intel_iommu *iommu, int index)
65714 -{
65715 - u32 fault;
65716 - int head;
65717 - struct q_inval *qi = iommu->qi;
65718 - int wait_index = (index + 1) % QI_LENGTH;
65719 -
65720 - fault = readl(iommu->reg + DMAR_FSTS_REG);
65721 -
65722 - /*
65723 - * If IQE happens, the head points to the descriptor associated
65724 - * with the error. No new descriptors are fetched until the IQE
65725 - * is cleared.
65726 - */
65727 - if (fault & DMA_FSTS_IQE) {
65728 - head = readl(iommu->reg + DMAR_IQH_REG);
65729 - if ((head >> 4) == index) {
65730 - memcpy(&qi->desc[index], &qi->desc[wait_index],
65731 - sizeof(struct qi_desc));
65732 - __iommu_flush_cache(iommu, &qi->desc[index],
65733 - sizeof(struct qi_desc));
65734 - writel(DMA_FSTS_IQE, iommu->reg + DMAR_FSTS_REG);
65735 - return -EINVAL;
65736 - }
65737 - }
65738 -
65739 - return 0;
65740 -}
65741 -
65742 /*
65743 * Submit the queued invalidation descriptor to the remapping
65744 * hardware unit and wait for its completion.
65745 */
65746 -int qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu)
65747 +void qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu)
65748 {
65749 - int rc = 0;
65750 struct q_inval *qi = iommu->qi;
65751 struct qi_desc *hw, wait_desc;
65752 int wait_index, index;
65753 unsigned long flags;
65754
65755 if (!qi)
65756 - return 0;
65757 + return;
65758
65759 hw = qi->desc;
65760
65761 @@ -641,8 +601,7 @@
65762
65763 hw[index] = *desc;
65764
65765 - wait_desc.low = QI_IWD_STATUS_DATA(QI_DONE) |
65766 - QI_IWD_STATUS_WRITE | QI_IWD_TYPE;
65767 + wait_desc.low = QI_IWD_STATUS_DATA(2) | QI_IWD_STATUS_WRITE | QI_IWD_TYPE;
65768 wait_desc.high = virt_to_phys(&qi->desc_status[wait_index]);
65769
65770 hw[wait_index] = wait_desc;
65771 @@ -653,11 +612,13 @@
65772 qi->free_head = (qi->free_head + 2) % QI_LENGTH;
65773 qi->free_cnt -= 2;
65774
65775 + spin_lock(&iommu->register_lock);
65776 /*
65777 * update the HW tail register indicating the presence of
65778 * new descriptors.
65779 */
65780 writel(qi->free_head << 4, iommu->reg + DMAR_IQT_REG);
65781 + spin_unlock(&iommu->register_lock);
65782
65783 while (qi->desc_status[wait_index] != QI_DONE) {
65784 /*
65785 @@ -667,21 +628,15 @@
65786 * a deadlock where the interrupt context can wait indefinitely
65787 * for free slots in the queue.
65788 */
65789 - rc = qi_check_fault(iommu, index);
65790 - if (rc)
65791 - goto out;
65792 -
65793 spin_unlock(&qi->q_lock);
65794 cpu_relax();
65795 spin_lock(&qi->q_lock);
65796 }
65797 -out:
65798 - qi->desc_status[index] = qi->desc_status[wait_index] = QI_DONE;
65799 +
65800 + qi->desc_status[index] = QI_DONE;
65801
65802 reclaim_free_desc(qi);
65803 spin_unlock_irqrestore(&qi->q_lock, flags);
65804 -
65805 - return rc;
65806 }
65807
65808 /*
65809 @@ -694,13 +649,13 @@
65810 desc.low = QI_IEC_TYPE;
65811 desc.high = 0;
65812
65813 - /* should never fail */
65814 qi_submit_sync(&desc, iommu);
65815 }
65816
65817 int qi_flush_context(struct intel_iommu *iommu, u16 did, u16 sid, u8 fm,
65818 u64 type, int non_present_entry_flush)
65819 {
65820 +
65821 struct qi_desc desc;
65822
65823 if (non_present_entry_flush) {
65824 @@ -714,7 +669,10 @@
65825 | QI_CC_GRAN(type) | QI_CC_TYPE;
65826 desc.high = 0;
65827
65828 - return qi_submit_sync(&desc, iommu);
65829 + qi_submit_sync(&desc, iommu);
65830 +
65831 + return 0;
65832 +
65833 }
65834
65835 int qi_flush_iotlb(struct intel_iommu *iommu, u16 did, u64 addr,
65836 @@ -744,7 +702,10 @@
65837 desc.high = QI_IOTLB_ADDR(addr) | QI_IOTLB_IH(ih)
65838 | QI_IOTLB_AM(size_order);
65839
65840 - return qi_submit_sync(&desc, iommu);
65841 + qi_submit_sync(&desc, iommu);
65842 +
65843 + return 0;
65844 +
65845 }
65846
65847 /*
65848 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/pci/hotplug/fakephp.c linux-2.6.29-rc3.owrt/drivers/pci/hotplug/fakephp.c
65849 --- linux-2.6.29.owrt/drivers/pci/hotplug/fakephp.c 2009-05-10 22:04:39.000000000 +0200
65850 +++ linux-2.6.29-rc3.owrt/drivers/pci/hotplug/fakephp.c 2009-05-10 23:48:29.000000000 +0200
65851 @@ -195,13 +195,13 @@
65852 * Tries hard not to re-enable already existing devices;
65853 * also handles scanning of subfunctions.
65854 */
65855 -static int pci_rescan_slot(struct pci_dev *temp)
65856 +static void pci_rescan_slot(struct pci_dev *temp)
65857 {
65858 struct pci_bus *bus = temp->bus;
65859 struct pci_dev *dev;
65860 int func;
65861 + int retval;
65862 u8 hdr_type;
65863 - int count = 0;
65864
65865 if (!pci_read_config_byte(temp, PCI_HEADER_TYPE, &hdr_type)) {
65866 temp->hdr_type = hdr_type & 0x7f;
65867 @@ -213,12 +213,17 @@
65868 dbg("New device on %s function %x:%x\n",
65869 bus->name, temp->devfn >> 3,
65870 temp->devfn & 7);
65871 - count++;
65872 + retval = pci_bus_add_device(dev);
65873 + if (retval)
65874 + dev_err(&dev->dev, "error adding "
65875 + "device, continuing.\n");
65876 + else
65877 + add_slot(dev);
65878 }
65879 }
65880 /* multifunction device? */
65881 if (!(hdr_type & 0x80))
65882 - return count;
65883 + return;
65884
65885 /* continue scanning for other functions */
65886 for (func = 1, temp->devfn++; func < 8; func++, temp->devfn++) {
65887 @@ -234,13 +239,16 @@
65888 dbg("New device on %s function %x:%x\n",
65889 bus->name, temp->devfn >> 3,
65890 temp->devfn & 7);
65891 - count++;
65892 + retval = pci_bus_add_device(dev);
65893 + if (retval)
65894 + dev_err(&dev->dev, "error adding "
65895 + "device, continuing.\n");
65896 + else
65897 + add_slot(dev);
65898 }
65899 }
65900 }
65901 }
65902 -
65903 - return count;
65904 }
65905
65906
65907 @@ -254,8 +262,6 @@
65908 {
65909 unsigned int devfn;
65910 struct pci_dev *dev;
65911 - int retval;
65912 - int found = 0;
65913 dev = alloc_pci_dev();
65914 if (!dev)
65915 return;
65916 @@ -264,23 +270,7 @@
65917 dev->sysdata = bus->sysdata;
65918 for (devfn = 0; devfn < 0x100; devfn += 8) {
65919 dev->devfn = devfn;
65920 - found += pci_rescan_slot(dev);
65921 - }
65922 -
65923 - if (found) {
65924 - pci_bus_assign_resources(bus);
65925 - list_for_each_entry(dev, &bus->devices, bus_list) {
65926 - /* Skip already-added devices */
65927 - if (dev->is_added)
65928 - continue;
65929 - retval = pci_bus_add_device(dev);
65930 - if (retval)
65931 - dev_err(&dev->dev,
65932 - "Error adding device, continuing\n");
65933 - else
65934 - add_slot(dev);
65935 - }
65936 - pci_bus_add_devices(bus);
65937 + pci_rescan_slot(dev);
65938 }
65939 kfree(dev);
65940 }
65941 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/pci/hotplug/Kconfig linux-2.6.29-rc3.owrt/drivers/pci/hotplug/Kconfig
65942 --- linux-2.6.29.owrt/drivers/pci/hotplug/Kconfig 2009-05-10 22:04:39.000000000 +0200
65943 +++ linux-2.6.29-rc3.owrt/drivers/pci/hotplug/Kconfig 2009-05-10 23:48:29.000000000 +0200
65944 @@ -143,7 +143,7 @@
65945
65946 config HOTPLUG_PCI_RPA
65947 tristate "RPA PCI Hotplug driver"
65948 - depends on PPC_PSERIES && EEH && !HOTPLUG_PCI_FAKE
65949 + depends on PPC_PSERIES && PPC64 && !HOTPLUG_PCI_FAKE
65950 help
65951 Say Y here if you have a RPA system that supports PCI Hotplug.
65952
65953 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/pci/hotplug/Makefile linux-2.6.29-rc3.owrt/drivers/pci/hotplug/Makefile
65954 --- linux-2.6.29.owrt/drivers/pci/hotplug/Makefile 2009-05-10 22:04:39.000000000 +0200
65955 +++ linux-2.6.29-rc3.owrt/drivers/pci/hotplug/Makefile 2009-05-10 23:48:29.000000000 +0200
65956 @@ -5,15 +5,11 @@
65957 obj-$(CONFIG_HOTPLUG_PCI) += pci_hotplug.o
65958 obj-$(CONFIG_HOTPLUG_PCI_COMPAQ) += cpqphp.o
65959 obj-$(CONFIG_HOTPLUG_PCI_IBM) += ibmphp.o
65960 -
65961 -# pciehp should be linked before acpiphp in order to allow the native driver
65962 -# to attempt to bind first. We can then fall back to generic support.
65963 -
65964 -obj-$(CONFIG_HOTPLUG_PCI_PCIE) += pciehp.o
65965 obj-$(CONFIG_HOTPLUG_PCI_ACPI) += acpiphp.o
65966 obj-$(CONFIG_HOTPLUG_PCI_ACPI_IBM) += acpiphp_ibm.o
65967 obj-$(CONFIG_HOTPLUG_PCI_CPCI_ZT5550) += cpcihp_zt5550.o
65968 obj-$(CONFIG_HOTPLUG_PCI_CPCI_GENERIC) += cpcihp_generic.o
65969 +obj-$(CONFIG_HOTPLUG_PCI_PCIE) += pciehp.o
65970 obj-$(CONFIG_HOTPLUG_PCI_SHPC) += shpchp.o
65971 obj-$(CONFIG_HOTPLUG_PCI_RPA) += rpaphp.o
65972 obj-$(CONFIG_HOTPLUG_PCI_RPA_DLPAR) += rpadlpar_io.o
65973 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/pci/hotplug/pciehp_core.c linux-2.6.29-rc3.owrt/drivers/pci/hotplug/pciehp_core.c
65974 --- linux-2.6.29.owrt/drivers/pci/hotplug/pciehp_core.c 2009-05-10 22:04:39.000000000 +0200
65975 +++ linux-2.6.29-rc3.owrt/drivers/pci/hotplug/pciehp_core.c 2009-05-10 23:48:29.000000000 +0200
65976 @@ -434,13 +434,6 @@
65977 goto err_out_release_ctlr;
65978 }
65979
65980 - /* Enable events after we have setup the data structures */
65981 - rc = pcie_init_notification(ctrl);
65982 - if (rc) {
65983 - ctrl_err(ctrl, "Notification initialization failed\n");
65984 - goto err_out_release_ctlr;
65985 - }
65986 -
65987 /* Check if slot is occupied */
65988 t_slot = pciehp_find_slot(ctrl, ctrl->slot_device_offset);
65989 t_slot->hpc_ops->get_adapter_status(t_slot, &value);
65990 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/pci/hotplug/pciehp.h linux-2.6.29-rc3.owrt/drivers/pci/hotplug/pciehp.h
65991 --- linux-2.6.29.owrt/drivers/pci/hotplug/pciehp.h 2009-05-10 22:04:39.000000000 +0200
65992 +++ linux-2.6.29-rc3.owrt/drivers/pci/hotplug/pciehp.h 2009-05-10 23:48:29.000000000 +0200
65993 @@ -111,7 +111,6 @@
65994 int cmd_busy;
65995 unsigned int no_cmd_complete:1;
65996 unsigned int link_active_reporting:1;
65997 - unsigned int notification_enabled:1;
65998 };
65999
66000 #define INT_BUTTON_IGNORE 0
66001 @@ -171,7 +170,6 @@
66002 extern int pciehp_unconfigure_device(struct slot *p_slot);
66003 extern void pciehp_queue_pushbutton_work(struct work_struct *work);
66004 struct controller *pcie_init(struct pcie_device *dev);
66005 -int pcie_init_notification(struct controller *ctrl);
66006 int pciehp_enable_slot(struct slot *p_slot);
66007 int pciehp_disable_slot(struct slot *p_slot);
66008 int pcie_enable_notification(struct controller *ctrl);
66009 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/pci/hotplug/pciehp_hpc.c linux-2.6.29-rc3.owrt/drivers/pci/hotplug/pciehp_hpc.c
66010 --- linux-2.6.29.owrt/drivers/pci/hotplug/pciehp_hpc.c 2009-05-10 22:04:39.000000000 +0200
66011 +++ linux-2.6.29-rc3.owrt/drivers/pci/hotplug/pciehp_hpc.c 2009-05-10 23:48:29.000000000 +0200
66012 @@ -934,7 +934,7 @@
66013 ctrl_warn(ctrl, "Cannot disable software notification\n");
66014 }
66015
66016 -int pcie_init_notification(struct controller *ctrl)
66017 +static int pcie_init_notification(struct controller *ctrl)
66018 {
66019 if (pciehp_request_irq(ctrl))
66020 return -1;
66021 @@ -942,17 +942,13 @@
66022 pciehp_free_irq(ctrl);
66023 return -1;
66024 }
66025 - ctrl->notification_enabled = 1;
66026 return 0;
66027 }
66028
66029 static void pcie_shutdown_notification(struct controller *ctrl)
66030 {
66031 - if (ctrl->notification_enabled) {
66032 - pcie_disable_notification(ctrl);
66033 - pciehp_free_irq(ctrl);
66034 - ctrl->notification_enabled = 0;
66035 - }
66036 + pcie_disable_notification(ctrl);
66037 + pciehp_free_irq(ctrl);
66038 }
66039
66040 static int pcie_init_slot(struct controller *ctrl)
66041 @@ -1114,8 +1110,13 @@
66042 if (pcie_init_slot(ctrl))
66043 goto abort_ctrl;
66044
66045 + if (pcie_init_notification(ctrl))
66046 + goto abort_slot;
66047 +
66048 return ctrl;
66049
66050 +abort_slot:
66051 + pcie_cleanup_slot(ctrl);
66052 abort_ctrl:
66053 kfree(ctrl);
66054 abort:
66055 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/pci/intel-iommu.c linux-2.6.29-rc3.owrt/drivers/pci/intel-iommu.c
66056 --- linux-2.6.29.owrt/drivers/pci/intel-iommu.c 2009-05-10 22:04:39.000000000 +0200
66057 +++ linux-2.6.29-rc3.owrt/drivers/pci/intel-iommu.c 2009-05-10 23:48:29.000000000 +0200
66058 @@ -61,8 +61,6 @@
66059 /* global iommu list, set NULL for ignored DMAR units */
66060 static struct intel_iommu **g_iommus;
66061
66062 -static int rwbf_quirk;
66063 -
66064 /*
66065 * 0: Present
66066 * 1-11: Reserved
66067 @@ -270,12 +268,7 @@
66068
66069 static void domain_remove_dev_info(struct dmar_domain *domain);
66070
66071 -#ifdef CONFIG_DMAR_DEFAULT_ON
66072 -int dmar_disabled = 0;
66073 -#else
66074 -int dmar_disabled = 1;
66075 -#endif /*CONFIG_DMAR_DEFAULT_ON*/
66076 -
66077 +int dmar_disabled;
66078 static int __initdata dmar_map_gfx = 1;
66079 static int dmar_forcedac;
66080 static int intel_iommu_strict;
66081 @@ -291,12 +284,9 @@
66082 if (!str)
66083 return -EINVAL;
66084 while (*str) {
66085 - if (!strncmp(str, "on", 2)) {
66086 - dmar_disabled = 0;
66087 - printk(KERN_INFO "Intel-IOMMU: enabled\n");
66088 - } else if (!strncmp(str, "off", 3)) {
66089 + if (!strncmp(str, "off", 3)) {
66090 dmar_disabled = 1;
66091 - printk(KERN_INFO "Intel-IOMMU: disabled\n");
66092 + printk(KERN_INFO"Intel-IOMMU: disabled\n");
66093 } else if (!strncmp(str, "igfx_off", 8)) {
66094 dmar_map_gfx = 0;
66095 printk(KERN_INFO
66096 @@ -787,7 +777,7 @@
66097 u32 val;
66098 unsigned long flag;
66099
66100 - if (!rwbf_quirk && !cap_rwbf(iommu->cap))
66101 + if (!cap_rwbf(iommu->cap))
66102 return;
66103 val = iommu->gcmd | DMA_GCMD_WBF;
66104
66105 @@ -3139,15 +3129,3 @@
66106 .unmap = intel_iommu_unmap_range,
66107 .iova_to_phys = intel_iommu_iova_to_phys,
66108 };
66109 -
66110 -static void __devinit quirk_iommu_rwbf(struct pci_dev *dev)
66111 -{
66112 - /*
66113 - * Mobile 4 Series Chipset neglects to set RWBF capability,
66114 - * but needs it:
66115 - */
66116 - printk(KERN_INFO "DMAR: Forcing write-buffer flush capability\n");
66117 - rwbf_quirk = 1;
66118 -}
66119 -
66120 -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2a40, quirk_iommu_rwbf);
66121 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/pci/intr_remapping.c linux-2.6.29-rc3.owrt/drivers/pci/intr_remapping.c
66122 --- linux-2.6.29.owrt/drivers/pci/intr_remapping.c 2009-05-10 22:04:39.000000000 +0200
66123 +++ linux-2.6.29-rc3.owrt/drivers/pci/intr_remapping.c 2009-05-10 23:48:29.000000000 +0200
66124 @@ -207,7 +207,7 @@
66125 return index;
66126 }
66127
66128 -static int qi_flush_iec(struct intel_iommu *iommu, int index, int mask)
66129 +static void qi_flush_iec(struct intel_iommu *iommu, int index, int mask)
66130 {
66131 struct qi_desc desc;
66132
66133 @@ -215,7 +215,7 @@
66134 | QI_IEC_SELECTIVE;
66135 desc.high = 0;
66136
66137 - return qi_submit_sync(&desc, iommu);
66138 + qi_submit_sync(&desc, iommu);
66139 }
66140
66141 int map_irq_to_irte_handle(int irq, u16 *sub_handle)
66142 @@ -283,7 +283,6 @@
66143
66144 int modify_irte(int irq, struct irte *irte_modified)
66145 {
66146 - int rc;
66147 int index;
66148 struct irte *irte;
66149 struct intel_iommu *iommu;
66150 @@ -304,15 +303,14 @@
66151 set_64bit((unsigned long *)irte, irte_modified->low | (1 << 1));
66152 __iommu_flush_cache(iommu, irte, sizeof(*irte));
66153
66154 - rc = qi_flush_iec(iommu, index, 0);
66155 - spin_unlock(&irq_2_ir_lock);
66156 + qi_flush_iec(iommu, index, 0);
66157
66158 - return rc;
66159 + spin_unlock(&irq_2_ir_lock);
66160 + return 0;
66161 }
66162
66163 int flush_irte(int irq)
66164 {
66165 - int rc;
66166 int index;
66167 struct intel_iommu *iommu;
66168 struct irq_2_iommu *irq_iommu;
66169 @@ -328,10 +326,10 @@
66170
66171 index = irq_iommu->irte_index + irq_iommu->sub_handle;
66172
66173 - rc = qi_flush_iec(iommu, index, irq_iommu->irte_mask);
66174 + qi_flush_iec(iommu, index, irq_iommu->irte_mask);
66175 spin_unlock(&irq_2_ir_lock);
66176
66177 - return rc;
66178 + return 0;
66179 }
66180
66181 struct intel_iommu *map_ioapic_to_ir(int apic)
66182 @@ -357,7 +355,6 @@
66183
66184 int free_irte(int irq)
66185 {
66186 - int rc = 0;
66187 int index, i;
66188 struct irte *irte;
66189 struct intel_iommu *iommu;
66190 @@ -378,7 +375,7 @@
66191 if (!irq_iommu->sub_handle) {
66192 for (i = 0; i < (1 << irq_iommu->irte_mask); i++)
66193 set_64bit((unsigned long *)irte, 0);
66194 - rc = qi_flush_iec(iommu, index, irq_iommu->irte_mask);
66195 + qi_flush_iec(iommu, index, irq_iommu->irte_mask);
66196 }
66197
66198 irq_iommu->iommu = NULL;
66199 @@ -388,7 +385,7 @@
66200
66201 spin_unlock(&irq_2_ir_lock);
66202
66203 - return rc;
66204 + return 0;
66205 }
66206
66207 static void iommu_set_intr_remapping(struct intel_iommu *iommu, int mode)
66208 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/pci/msi.c linux-2.6.29-rc3.owrt/drivers/pci/msi.c
66209 --- linux-2.6.29.owrt/drivers/pci/msi.c 2009-05-10 22:04:39.000000000 +0200
66210 +++ linux-2.6.29-rc3.owrt/drivers/pci/msi.c 2009-05-10 23:48:29.000000000 +0200
66211 @@ -103,14 +103,6 @@
66212 }
66213 }
66214
66215 -static inline __attribute_const__ u32 msi_mask(unsigned x)
66216 -{
66217 - /* Don't shift by >= width of type */
66218 - if (x >= 5)
66219 - return 0xffffffff;
66220 - return (1 << (1 << x)) - 1;
66221 -}
66222 -
66223 static void msix_flush_writes(struct irq_desc *desc)
66224 {
66225 struct msi_desc *entry;
66226 @@ -415,7 +407,8 @@
66227
66228 /* All MSIs are unmasked by default, Mask them all */
66229 pci_read_config_dword(dev, base, &maskbits);
66230 - temp = msi_mask((control & PCI_MSI_FLAGS_QMASK) >> 1);
66231 + temp = (1 << multi_msi_capable(control));
66232 + temp = ((temp - 1) & ~temp);
66233 maskbits |= temp;
66234 pci_write_config_dword(dev, base, maskbits);
66235 entry->msi_attrib.maskbits_mask = temp;
66236 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/pci/pci.c linux-2.6.29-rc3.owrt/drivers/pci/pci.c
66237 --- linux-2.6.29.owrt/drivers/pci/pci.c 2009-05-10 22:04:39.000000000 +0200
66238 +++ linux-2.6.29-rc3.owrt/drivers/pci/pci.c 2009-05-10 23:48:29.000000000 +0200
66239 @@ -1393,35 +1393,35 @@
66240 pci_power_t prev_state;
66241 int error;
66242
66243 + pci_restore_state(dev);
66244 pci_update_current_state(dev, PCI_D0);
66245
66246 prev_state = dev->current_state;
66247 if (prev_state == PCI_D0)
66248 - goto Restore;
66249 + return 0;
66250
66251 error = pci_raw_set_power_state(dev, PCI_D0, false);
66252 if (error)
66253 return error;
66254
66255 - /*
66256 - * This assumes that we won't get a bus in B2 or B3 from the BIOS, but
66257 - * we've made this assumption forever and it appears to be universally
66258 - * satisfied.
66259 - */
66260 - switch(prev_state) {
66261 - case PCI_D3cold:
66262 - case PCI_D3hot:
66263 - mdelay(pci_pm_d3_delay);
66264 - break;
66265 - case PCI_D2:
66266 - udelay(PCI_PM_D2_DELAY);
66267 - break;
66268 + if (pci_is_bridge(dev)) {
66269 + if (prev_state > PCI_D1)
66270 + mdelay(PCI_PM_BUS_WAIT);
66271 + } else {
66272 + switch(prev_state) {
66273 + case PCI_D3cold:
66274 + case PCI_D3hot:
66275 + mdelay(pci_pm_d3_delay);
66276 + break;
66277 + case PCI_D2:
66278 + udelay(PCI_PM_D2_DELAY);
66279 + break;
66280 + }
66281 }
66282
66283 - pci_update_current_state(dev, PCI_D0);
66284 + dev->current_state = PCI_D0;
66285
66286 - Restore:
66287 - return dev->state_saved ? pci_restore_state(dev) : 0;
66288 + return 0;
66289 }
66290
66291 /**
66292 @@ -1540,21 +1540,16 @@
66293 }
66294
66295 /**
66296 - * __pci_request_region - Reserved PCI I/O and memory resource
66297 + * pci_request_region - Reserved PCI I/O and memory resource
66298 * @pdev: PCI device whose resources are to be reserved
66299 * @bar: BAR to be reserved
66300 * @res_name: Name to be associated with resource.
66301 - * @exclusive: whether the region access is exclusive or not
66302 *
66303 * Mark the PCI region associated with PCI device @pdev BR @bar as
66304 * being reserved by owner @res_name. Do not access any
66305 * address inside the PCI regions unless this call returns
66306 * successfully.
66307 *
66308 - * If @exclusive is set, then the region is marked so that userspace
66309 - * is explicitly not allowed to map the resource via /dev/mem or
66310 - * sysfs MMIO access.
66311 - *
66312 * Returns 0 on success, or %EBUSY on error. A warning
66313 * message is also printed on failure.
66314 */
66315 @@ -1593,12 +1588,12 @@
66316 }
66317
66318 /**
66319 - * pci_request_region - Reserve PCI I/O and memory resource
66320 + * pci_request_region - Reserved PCI I/O and memory resource
66321 * @pdev: PCI device whose resources are to be reserved
66322 * @bar: BAR to be reserved
66323 - * @res_name: Name to be associated with resource
66324 + * @res_name: Name to be associated with resource.
66325 *
66326 - * Mark the PCI region associated with PCI device @pdev BAR @bar as
66327 + * Mark the PCI region associated with PCI device @pdev BR @bar as
66328 * being reserved by owner @res_name. Do not access any
66329 * address inside the PCI regions unless this call returns
66330 * successfully.
66331 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/pci/pci-driver.c linux-2.6.29-rc3.owrt/drivers/pci/pci-driver.c
66332 --- linux-2.6.29.owrt/drivers/pci/pci-driver.c 2009-05-10 22:04:39.000000000 +0200
66333 +++ linux-2.6.29-rc3.owrt/drivers/pci/pci-driver.c 2009-05-10 23:48:29.000000000 +0200
66334 @@ -355,8 +355,6 @@
66335 int i = 0;
66336
66337 if (drv && drv->suspend) {
66338 - pci_power_t prev = pci_dev->current_state;
66339 -
66340 pci_dev->state_saved = false;
66341
66342 i = drv->suspend(pci_dev, state);
66343 @@ -367,13 +365,8 @@
66344 if (pci_dev->state_saved)
66345 goto Fixup;
66346
66347 - if (pci_dev->current_state != PCI_D0
66348 - && pci_dev->current_state != PCI_UNKNOWN) {
66349 - WARN_ONCE(pci_dev->current_state != prev,
66350 - "PCI PM: Device state not saved by %pF\n",
66351 - drv->suspend);
66352 + if (WARN_ON_ONCE(pci_dev->current_state != PCI_D0))
66353 goto Fixup;
66354 - }
66355 }
66356
66357 pci_save_state(pci_dev);
66358 @@ -426,24 +419,38 @@
66359 static void pci_pm_default_resume_noirq(struct pci_dev *pci_dev)
66360 {
66361 pci_restore_standard_config(pci_dev);
66362 - pci_dev->state_saved = false;
66363 pci_fixup_device(pci_fixup_resume_early, pci_dev);
66364 }
66365
66366 -static void pci_pm_default_resume(struct pci_dev *pci_dev)
66367 +static int pci_pm_default_resume(struct pci_dev *pci_dev)
66368 {
66369 pci_fixup_device(pci_fixup_resume, pci_dev);
66370
66371 if (!pci_is_bridge(pci_dev))
66372 pci_enable_wake(pci_dev, PCI_D0, false);
66373 +
66374 + return pci_pm_reenable_device(pci_dev);
66375 +}
66376 +
66377 +static void pci_pm_default_suspend_generic(struct pci_dev *pci_dev)
66378 +{
66379 + /* If device is enabled at this point, disable it */
66380 + pci_disable_enabled_device(pci_dev);
66381 + /*
66382 + * Save state with interrupts enabled, because in principle the bus the
66383 + * device is on may be put into a low power state after this code runs.
66384 + */
66385 + pci_save_state(pci_dev);
66386 }
66387
66388 static void pci_pm_default_suspend(struct pci_dev *pci_dev)
66389 {
66390 - /* Disable non-bridge devices without PM support */
66391 + pci_pm_default_suspend_generic(pci_dev);
66392 +
66393 if (!pci_is_bridge(pci_dev))
66394 - pci_disable_enabled_device(pci_dev);
66395 - pci_save_state(pci_dev);
66396 + pci_prepare_to_sleep(pci_dev);
66397 +
66398 + pci_fixup_device(pci_fixup_suspend, pci_dev);
66399 }
66400
66401 static bool pci_has_legacy_pm_support(struct pci_dev *pci_dev)
66402 @@ -488,49 +495,21 @@
66403 static int pci_pm_suspend(struct device *dev)
66404 {
66405 struct pci_dev *pci_dev = to_pci_dev(dev);
66406 - struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
66407 + struct device_driver *drv = dev->driver;
66408 + int error = 0;
66409
66410 if (pci_has_legacy_pm_support(pci_dev))
66411 return pci_legacy_suspend(dev, PMSG_SUSPEND);
66412
66413 - if (!pm) {
66414 - pci_pm_default_suspend(pci_dev);
66415 - goto Fixup;
66416 - }
66417 -
66418 - pci_dev->state_saved = false;
66419 -
66420 - if (pm->suspend) {
66421 - pci_power_t prev = pci_dev->current_state;
66422 - int error;
66423 -
66424 - error = pm->suspend(dev);
66425 - suspend_report_result(pm->suspend, error);
66426 - if (error)
66427 - return error;
66428 -
66429 - if (pci_dev->state_saved)
66430 - goto Fixup;
66431 -
66432 - if (pci_dev->current_state != PCI_D0
66433 - && pci_dev->current_state != PCI_UNKNOWN) {
66434 - WARN_ONCE(pci_dev->current_state != prev,
66435 - "PCI PM: State of device not saved by %pF\n",
66436 - pm->suspend);
66437 - goto Fixup;
66438 - }
66439 - }
66440 -
66441 - if (!pci_dev->state_saved) {
66442 - pci_save_state(pci_dev);
66443 - if (!pci_is_bridge(pci_dev))
66444 - pci_prepare_to_sleep(pci_dev);
66445 + if (drv && drv->pm && drv->pm->suspend) {
66446 + error = drv->pm->suspend(dev);
66447 + suspend_report_result(drv->pm->suspend, error);
66448 }
66449
66450 - Fixup:
66451 - pci_fixup_device(pci_fixup_suspend, pci_dev);
66452 + if (!error)
66453 + pci_pm_default_suspend(pci_dev);
66454
66455 - return 0;
66456 + return error;
66457 }
66458
66459 static int pci_pm_suspend_noirq(struct device *dev)
66460 @@ -573,29 +552,18 @@
66461 static int pci_pm_resume(struct device *dev)
66462 {
66463 struct pci_dev *pci_dev = to_pci_dev(dev);
66464 - struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
66465 + struct device_driver *drv = dev->driver;
66466 int error = 0;
66467
66468 - /*
66469 - * This is necessary for the suspend error path in which resume is
66470 - * called without restoring the standard config registers of the device.
66471 - */
66472 - if (pci_dev->state_saved)
66473 - pci_restore_standard_config(pci_dev);
66474 -
66475 if (pci_has_legacy_pm_support(pci_dev))
66476 return pci_legacy_resume(dev);
66477
66478 - pci_pm_default_resume(pci_dev);
66479 + error = pci_pm_default_resume(pci_dev);
66480
66481 - if (pm) {
66482 - if (pm->resume)
66483 - error = pm->resume(dev);
66484 - } else {
66485 - pci_pm_reenable_device(pci_dev);
66486 - }
66487 + if (!error && drv && drv->pm && drv->pm->resume)
66488 + error = drv->pm->resume(dev);
66489
66490 - return 0;
66491 + return error;
66492 }
66493
66494 #else /* !CONFIG_SUSPEND */
66495 @@ -612,31 +580,21 @@
66496 static int pci_pm_freeze(struct device *dev)
66497 {
66498 struct pci_dev *pci_dev = to_pci_dev(dev);
66499 - struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
66500 + struct device_driver *drv = dev->driver;
66501 + int error = 0;
66502
66503 if (pci_has_legacy_pm_support(pci_dev))
66504 return pci_legacy_suspend(dev, PMSG_FREEZE);
66505
66506 - if (!pm) {
66507 - pci_pm_default_suspend(pci_dev);
66508 - return 0;
66509 + if (drv && drv->pm && drv->pm->freeze) {
66510 + error = drv->pm->freeze(dev);
66511 + suspend_report_result(drv->pm->freeze, error);
66512 }
66513
66514 - pci_dev->state_saved = false;
66515 -
66516 - if (pm->freeze) {
66517 - int error;
66518 -
66519 - error = pm->freeze(dev);
66520 - suspend_report_result(pm->freeze, error);
66521 - if (error)
66522 - return error;
66523 - }
66524 -
66525 - if (!pci_dev->state_saved)
66526 - pci_save_state(pci_dev);
66527 + if (!error)
66528 + pci_pm_default_suspend_generic(pci_dev);
66529
66530 - return 0;
66531 + return error;
66532 }
66533
66534 static int pci_pm_freeze_noirq(struct device *dev)
66535 @@ -679,18 +637,16 @@
66536 static int pci_pm_thaw(struct device *dev)
66537 {
66538 struct pci_dev *pci_dev = to_pci_dev(dev);
66539 - struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
66540 + struct device_driver *drv = dev->driver;
66541 int error = 0;
66542
66543 if (pci_has_legacy_pm_support(pci_dev))
66544 return pci_legacy_resume(dev);
66545
66546 - if (pm) {
66547 - if (pm->thaw)
66548 - error = pm->thaw(dev);
66549 - } else {
66550 - pci_pm_reenable_device(pci_dev);
66551 - }
66552 + pci_pm_reenable_device(pci_dev);
66553 +
66554 + if (drv && drv->pm && drv->pm->thaw)
66555 + error = drv->pm->thaw(dev);
66556
66557 return error;
66558 }
66559 @@ -698,29 +654,19 @@
66560 static int pci_pm_poweroff(struct device *dev)
66561 {
66562 struct pci_dev *pci_dev = to_pci_dev(dev);
66563 - struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
66564 + struct device_driver *drv = dev->driver;
66565 int error = 0;
66566
66567 if (pci_has_legacy_pm_support(pci_dev))
66568 return pci_legacy_suspend(dev, PMSG_HIBERNATE);
66569
66570 - if (!pm) {
66571 - pci_pm_default_suspend(pci_dev);
66572 - goto Fixup;
66573 + if (drv && drv->pm && drv->pm->poweroff) {
66574 + error = drv->pm->poweroff(dev);
66575 + suspend_report_result(drv->pm->poweroff, error);
66576 }
66577
66578 - pci_dev->state_saved = false;
66579 -
66580 - if (pm->poweroff) {
66581 - error = pm->poweroff(dev);
66582 - suspend_report_result(pm->poweroff, error);
66583 - }
66584 -
66585 - if (!pci_dev->state_saved && !pci_is_bridge(pci_dev))
66586 - pci_prepare_to_sleep(pci_dev);
66587 -
66588 - Fixup:
66589 - pci_fixup_device(pci_fixup_suspend, pci_dev);
66590 + if (!error)
66591 + pci_pm_default_suspend(pci_dev);
66592
66593 return error;
66594 }
66595 @@ -761,27 +707,16 @@
66596 static int pci_pm_restore(struct device *dev)
66597 {
66598 struct pci_dev *pci_dev = to_pci_dev(dev);
66599 - struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
66600 + struct device_driver *drv = dev->driver;
66601 int error = 0;
66602
66603 - /*
66604 - * This is necessary for the hibernation error path in which restore is
66605 - * called without restoring the standard config registers of the device.
66606 - */
66607 - if (pci_dev->state_saved)
66608 - pci_restore_standard_config(pci_dev);
66609 -
66610 if (pci_has_legacy_pm_support(pci_dev))
66611 return pci_legacy_resume(dev);
66612
66613 - pci_pm_default_resume(pci_dev);
66614 + error = pci_pm_default_resume(pci_dev);
66615
66616 - if (pm) {
66617 - if (pm->restore)
66618 - error = pm->restore(dev);
66619 - } else {
66620 - pci_pm_reenable_device(pci_dev);
66621 - }
66622 + if (!error && drv && drv->pm && drv->pm->restore)
66623 + error = drv->pm->restore(dev);
66624
66625 return error;
66626 }
66627 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/pci/pcie/aer/aerdrv_core.c linux-2.6.29-rc3.owrt/drivers/pci/pcie/aer/aerdrv_core.c
66628 --- linux-2.6.29.owrt/drivers/pci/pcie/aer/aerdrv_core.c 2009-05-10 22:04:39.000000000 +0200
66629 +++ linux-2.6.29-rc3.owrt/drivers/pci/pcie/aer/aerdrv_core.c 2009-05-10 23:48:29.000000000 +0200
66630 @@ -108,37 +108,6 @@
66631 }
66632 #endif /* 0 */
66633
66634 -
66635 -static void set_device_error_reporting(struct pci_dev *dev, void *data)
66636 -{
66637 - bool enable = *((bool *)data);
66638 -
66639 - if (dev->pcie_type != PCIE_RC_PORT &&
66640 - dev->pcie_type != PCIE_SW_UPSTREAM_PORT &&
66641 - dev->pcie_type != PCIE_SW_DOWNSTREAM_PORT)
66642 - return;
66643 -
66644 - if (enable)
66645 - pci_enable_pcie_error_reporting(dev);
66646 - else
66647 - pci_disable_pcie_error_reporting(dev);
66648 -}
66649 -
66650 -/**
66651 - * set_downstream_devices_error_reporting - enable/disable the error reporting bits on the root port and its downstream ports.
66652 - * @dev: pointer to root port's pci_dev data structure
66653 - * @enable: true = enable error reporting, false = disable error reporting.
66654 - */
66655 -static void set_downstream_devices_error_reporting(struct pci_dev *dev,
66656 - bool enable)
66657 -{
66658 - set_device_error_reporting(dev, &enable);
66659 -
66660 - if (!dev->subordinate)
66661 - return;
66662 - pci_walk_bus(dev->subordinate, set_device_error_reporting, &enable);
66663 -}
66664 -
66665 static int find_device_iter(struct device *device, void *data)
66666 {
66667 struct pci_dev *dev;
66668 @@ -556,11 +525,15 @@
66669 pci_read_config_dword(pdev, aer_pos + PCI_ERR_UNCOR_STATUS, &reg32);
66670 pci_write_config_dword(pdev, aer_pos + PCI_ERR_UNCOR_STATUS, reg32);
66671
66672 - /*
66673 - * Enable error reporting for the root port device and downstream port
66674 - * devices.
66675 - */
66676 - set_downstream_devices_error_reporting(pdev, true);
66677 + /* Enable Root Port device reporting error itself */
66678 + pci_read_config_word(pdev, pos+PCI_EXP_DEVCTL, &reg16);
66679 + reg16 = reg16 |
66680 + PCI_EXP_DEVCTL_CERE |
66681 + PCI_EXP_DEVCTL_NFERE |
66682 + PCI_EXP_DEVCTL_FERE |
66683 + PCI_EXP_DEVCTL_URRE;
66684 + pci_write_config_word(pdev, pos+PCI_EXP_DEVCTL,
66685 + reg16);
66686
66687 /* Enable Root Port's interrupt in response to error messages */
66688 pci_write_config_dword(pdev,
66689 @@ -580,12 +553,6 @@
66690 u32 reg32;
66691 int pos;
66692
66693 - /*
66694 - * Disable error reporting for the root port device and downstream port
66695 - * devices.
66696 - */
66697 - set_downstream_devices_error_reporting(pdev, false);
66698 -
66699 pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_ERR);
66700 /* Disable Root's interrupt in response to error messages */
66701 pci_write_config_dword(pdev, pos + PCI_ERR_ROOT_COMMAND, 0);
66702 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/pci/pcie/aspm.c linux-2.6.29-rc3.owrt/drivers/pci/pcie/aspm.c
66703 --- linux-2.6.29.owrt/drivers/pci/pcie/aspm.c 2009-05-10 22:04:39.000000000 +0200
66704 +++ linux-2.6.29-rc3.owrt/drivers/pci/pcie/aspm.c 2009-05-10 23:48:29.000000000 +0200
66705 @@ -718,9 +718,9 @@
66706
66707 /*
66708 * All PCIe functions are in one slot, remove one function will remove
66709 - * the whole slot, so just wait until we are the last function left.
66710 + * the the whole slot, so just wait
66711 */
66712 - if (!list_is_last(&pdev->bus_list, &parent->subordinate->devices))
66713 + if (!list_empty(&parent->subordinate->devices))
66714 goto out;
66715
66716 /* All functions are removed, so just disable ASPM for the link */
66717 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/pci/pcie/portdrv_pci.c linux-2.6.29-rc3.owrt/drivers/pci/pcie/portdrv_pci.c
66718 --- linux-2.6.29.owrt/drivers/pci/pcie/portdrv_pci.c 2009-05-10 22:04:39.000000000 +0200
66719 +++ linux-2.6.29-rc3.owrt/drivers/pci/pcie/portdrv_pci.c 2009-05-10 23:48:29.000000000 +0200
66720 @@ -55,13 +55,25 @@
66721
66722 }
66723
66724 +static int pcie_portdrv_suspend_late(struct pci_dev *dev, pm_message_t state)
66725 +{
66726 + return pci_save_state(dev);
66727 +}
66728 +
66729 +static int pcie_portdrv_resume_early(struct pci_dev *dev)
66730 +{
66731 + return pci_restore_state(dev);
66732 +}
66733 +
66734 static int pcie_portdrv_resume(struct pci_dev *dev)
66735 {
66736 - pci_set_master(dev);
66737 + pcie_portdrv_restore_config(dev);
66738 return pcie_port_device_resume(dev);
66739 }
66740 #else
66741 #define pcie_portdrv_suspend NULL
66742 +#define pcie_portdrv_suspend_late NULL
66743 +#define pcie_portdrv_resume_early NULL
66744 #define pcie_portdrv_resume NULL
66745 #endif
66746
66747 @@ -97,13 +109,14 @@
66748
66749 pcie_portdrv_save_config(dev);
66750
66751 + pci_enable_pcie_error_reporting(dev);
66752 +
66753 return 0;
66754 }
66755
66756 static void pcie_portdrv_remove (struct pci_dev *dev)
66757 {
66758 pcie_port_device_remove(dev);
66759 - pci_disable_device(dev);
66760 kfree(pci_get_drvdata(dev));
66761 }
66762
66763 @@ -279,6 +292,8 @@
66764 .remove = pcie_portdrv_remove,
66765
66766 .suspend = pcie_portdrv_suspend,
66767 + .suspend_late = pcie_portdrv_suspend_late,
66768 + .resume_early = pcie_portdrv_resume_early,
66769 .resume = pcie_portdrv_resume,
66770
66771 .err_handler = &pcie_portdrv_err_handler,
66772 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/pci/pci.h linux-2.6.29-rc3.owrt/drivers/pci/pci.h
66773 --- linux-2.6.29.owrt/drivers/pci/pci.h 2009-05-10 22:04:39.000000000 +0200
66774 +++ linux-2.6.29-rc3.owrt/drivers/pci/pci.h 2009-05-10 23:48:29.000000000 +0200
66775 @@ -16,21 +16,21 @@
66776 #endif
66777
66778 /**
66779 - * struct pci_platform_pm_ops - Firmware PM callbacks
66780 + * Firmware PM callbacks
66781 *
66782 - * @is_manageable: returns 'true' if given device is power manageable by the
66783 - * platform firmware
66784 + * @is_manageable - returns 'true' if given device is power manageable by the
66785 + * platform firmware
66786 *
66787 - * @set_state: invokes the platform firmware to set the device's power state
66788 + * @set_state - invokes the platform firmware to set the device's power state
66789 *
66790 - * @choose_state: returns PCI power state of given device preferred by the
66791 - * platform; to be used during system-wide transitions from a
66792 - * sleeping state to the working state and vice versa
66793 + * @choose_state - returns PCI power state of given device preferred by the
66794 + * platform; to be used during system-wide transitions from a
66795 + * sleeping state to the working state and vice versa
66796 *
66797 - * @can_wakeup: returns 'true' if given device is capable of waking up the
66798 - * system from a sleeping state
66799 + * @can_wakeup - returns 'true' if given device is capable of waking up the
66800 + * system from a sleeping state
66801 *
66802 - * @sleep_wake: enables/disables the system wake up capability of given device
66803 + * @sleep_wake - enables/disables the system wake up capability of given device
66804 *
66805 * If given platform is generally capable of power managing PCI devices, all of
66806 * these callbacks are mandatory.
66807 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/pci/pci-sysfs.c linux-2.6.29-rc3.owrt/drivers/pci/pci-sysfs.c
66808 --- linux-2.6.29.owrt/drivers/pci/pci-sysfs.c 2009-05-10 22:04:39.000000000 +0200
66809 +++ linux-2.6.29-rc3.owrt/drivers/pci/pci-sysfs.c 2009-05-10 23:48:29.000000000 +0200
66810 @@ -768,8 +768,8 @@
66811 return -EINVAL;
66812
66813 rom = pci_map_rom(pdev, &size); /* size starts out as PCI window size */
66814 - if (!rom || !size)
66815 - return -EIO;
66816 + if (!rom)
66817 + return 0;
66818
66819 if (off >= size)
66820 count = 0;
66821 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/pci/quirks.c linux-2.6.29-rc3.owrt/drivers/pci/quirks.c
66822 --- linux-2.6.29.owrt/drivers/pci/quirks.c 2009-05-10 22:04:39.000000000 +0200
66823 +++ linux-2.6.29-rc3.owrt/drivers/pci/quirks.c 2009-05-10 23:48:29.000000000 +0200
66824 @@ -23,7 +23,6 @@
66825 #include <linux/acpi.h>
66826 #include <linux/kallsyms.h>
66827 #include <linux/dmi.h>
66828 -#include <linux/pci-aspm.h>
66829 #include "pci.h"
66830
66831 int isa_dma_bridge_buggy;
66832 @@ -1585,7 +1584,6 @@
66833 */
66834 #define AMD_813X_MISC 0x40
66835 #define AMD_813X_NOIOAMODE (1<<0)
66836 -#define AMD_813X_REV_B2 0x13
66837
66838 static void quirk_disable_amd_813x_boot_interrupt(struct pci_dev *dev)
66839 {
66840 @@ -1593,8 +1591,6 @@
66841
66842 if (noioapicquirk)
66843 return;
66844 - if (dev->revision == AMD_813X_REV_B2)
66845 - return;
66846
66847 pci_read_config_dword(dev, AMD_813X_MISC, &pci_config_dword);
66848 pci_config_dword &= ~AMD_813X_NOIOAMODE;
66849 @@ -1750,30 +1746,6 @@
66850 }
66851 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_ANY_ID, quirk_e100_interrupt);
66852
66853 -/*
66854 - * The 82575 and 82598 may experience data corruption issues when transitioning
66855 - * out of L0S. To prevent this we need to disable L0S on the pci-e link
66856 - */
66857 -static void __devinit quirk_disable_aspm_l0s(struct pci_dev *dev)
66858 -{
66859 - dev_info(&dev->dev, "Disabling L0s\n");
66860 - pci_disable_link_state(dev, PCIE_LINK_STATE_L0S);
66861 -}
66862 -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10a7, quirk_disable_aspm_l0s);
66863 -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10a9, quirk_disable_aspm_l0s);
66864 -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10b6, quirk_disable_aspm_l0s);
66865 -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10c6, quirk_disable_aspm_l0s);
66866 -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10c7, quirk_disable_aspm_l0s);
66867 -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10c8, quirk_disable_aspm_l0s);
66868 -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10d6, quirk_disable_aspm_l0s);
66869 -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10db, quirk_disable_aspm_l0s);
66870 -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10dd, quirk_disable_aspm_l0s);
66871 -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10e1, quirk_disable_aspm_l0s);
66872 -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10ec, quirk_disable_aspm_l0s);
66873 -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10f1, quirk_disable_aspm_l0s);
66874 -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10f4, quirk_disable_aspm_l0s);
66875 -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1508, quirk_disable_aspm_l0s);
66876 -
66877 static void __devinit fixup_rev1_53c810(struct pci_dev* dev)
66878 {
66879 /* rev 1 ncr53c810 chips don't set the class at all which means
66880 @@ -2009,6 +1981,7 @@
66881 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_HT2000_PCIE,
66882 quirk_msi_ht_cap);
66883
66884 +
66885 /* The nVidia CK804 chipset may have 2 HT MSI mappings.
66886 * MSI are supported if the MSI capability set in any of these mappings.
66887 */
66888 @@ -2059,9 +2032,6 @@
66889 PCI_DEVICE_ID_SERVERWORKS_HT1000_PXB,
66890 ht_enable_msi_mapping);
66891
66892 -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8132_BRIDGE,
66893 - ht_enable_msi_mapping);
66894 -
66895 /* The P5N32-SLI Premium motherboard from Asus has a problem with msi
66896 * for the MCP55 NIC. It is not yet determined whether the msi problem
66897 * also affects other devices. As for now, turn off msi for this device.
66898 @@ -2078,104 +2048,10 @@
66899 PCI_DEVICE_ID_NVIDIA_NVENET_15,
66900 nvenet_msi_disable);
66901
66902 -static void __devinit nv_ht_enable_msi_mapping(struct pci_dev *dev)
66903 -{
66904 - struct pci_dev *host_bridge;
66905 - int pos;
66906 - int i, dev_no;
66907 - int found = 0;
66908 -
66909 - dev_no = dev->devfn >> 3;
66910 - for (i = dev_no; i >= 0; i--) {
66911 - host_bridge = pci_get_slot(dev->bus, PCI_DEVFN(i, 0));
66912 - if (!host_bridge)
66913 - continue;
66914 -
66915 - pos = pci_find_ht_capability(host_bridge, HT_CAPTYPE_SLAVE);
66916 - if (pos != 0) {
66917 - found = 1;
66918 - break;
66919 - }
66920 - pci_dev_put(host_bridge);
66921 - }
66922 -
66923 - if (!found)
66924 - return;
66925 -
66926 - /* root did that ! */
66927 - if (msi_ht_cap_enabled(host_bridge))
66928 - goto out;
66929 -
66930 - ht_enable_msi_mapping(dev);
66931 -
66932 -out:
66933 - pci_dev_put(host_bridge);
66934 -}
66935 -
66936 -static void __devinit ht_disable_msi_mapping(struct pci_dev *dev)
66937 -{
66938 - int pos, ttl = 48;
66939 -
66940 - pos = pci_find_ht_capability(dev, HT_CAPTYPE_MSI_MAPPING);
66941 - while (pos && ttl--) {
66942 - u8 flags;
66943 -
66944 - if (pci_read_config_byte(dev, pos + HT_MSI_FLAGS,
66945 - &flags) == 0) {
66946 - dev_info(&dev->dev, "Disabling HT MSI Mapping\n");
66947 -
66948 - pci_write_config_byte(dev, pos + HT_MSI_FLAGS,
66949 - flags & ~HT_MSI_FLAGS_ENABLE);
66950 - }
66951 - pos = pci_find_next_ht_capability(dev, pos,
66952 - HT_CAPTYPE_MSI_MAPPING);
66953 - }
66954 -}
66955 -
66956 -static int __devinit ht_check_msi_mapping(struct pci_dev *dev)
66957 -{
66958 - int pos, ttl = 48;
66959 - int found = 0;
66960 -
66961 - /* check if there is HT MSI cap or enabled on this device */
66962 - pos = pci_find_ht_capability(dev, HT_CAPTYPE_MSI_MAPPING);
66963 - while (pos && ttl--) {
66964 - u8 flags;
66965 -
66966 - if (found < 1)
66967 - found = 1;
66968 - if (pci_read_config_byte(dev, pos + HT_MSI_FLAGS,
66969 - &flags) == 0) {
66970 - if (flags & HT_MSI_FLAGS_ENABLE) {
66971 - if (found < 2) {
66972 - found = 2;
66973 - break;
66974 - }
66975 - }
66976 - }
66977 - pos = pci_find_next_ht_capability(dev, pos,
66978 - HT_CAPTYPE_MSI_MAPPING);
66979 - }
66980 -
66981 - return found;
66982 -}
66983 -
66984 static void __devinit nv_msi_ht_cap_quirk(struct pci_dev *dev)
66985 {
66986 struct pci_dev *host_bridge;
66987 - int pos;
66988 - int found;
66989 -
66990 - /* Enabling HT MSI mapping on this device breaks MCP51 */
66991 - if (dev->device == 0x270)
66992 - return;
66993 -
66994 - /* check if there is HT MSI cap or enabled on this device */
66995 - found = ht_check_msi_mapping(dev);
66996 -
66997 - /* no HT MSI CAP */
66998 - if (found == 0)
66999 - return;
67000 + int pos, ttl = 48;
67001
67002 /*
67003 * HT MSI mapping should be disabled on devices that are below
67004 @@ -2191,19 +2067,24 @@
67005 pos = pci_find_ht_capability(host_bridge, HT_CAPTYPE_SLAVE);
67006 if (pos != 0) {
67007 /* Host bridge is to HT */
67008 - if (found == 1) {
67009 - /* it is not enabled, try to enable it */
67010 - nv_ht_enable_msi_mapping(dev);
67011 - }
67012 + ht_enable_msi_mapping(dev);
67013 return;
67014 }
67015
67016 - /* HT MSI is not enabled */
67017 - if (found == 1)
67018 - return;
67019 -
67020 /* Host bridge is not to HT, disable HT MSI mapping on this device */
67021 - ht_disable_msi_mapping(dev);
67022 + pos = pci_find_ht_capability(dev, HT_CAPTYPE_MSI_MAPPING);
67023 + while (pos && ttl--) {
67024 + u8 flags;
67025 +
67026 + if (pci_read_config_byte(dev, pos + HT_MSI_FLAGS,
67027 + &flags) == 0) {
67028 + dev_info(&dev->dev, "Disabling HT MSI mapping");
67029 + pci_write_config_byte(dev, pos + HT_MSI_FLAGS,
67030 + flags & ~HT_MSI_FLAGS_ENABLE);
67031 + }
67032 + pos = pci_find_next_ht_capability(dev, pos,
67033 + HT_CAPTYPE_MSI_MAPPING);
67034 + }
67035 }
67036 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID, nv_msi_ht_cap_quirk);
67037 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, PCI_ANY_ID, nv_msi_ht_cap_quirk);
67038 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/pci/rom.c linux-2.6.29-rc3.owrt/drivers/pci/rom.c
67039 --- linux-2.6.29.owrt/drivers/pci/rom.c 2009-05-10 22:04:39.000000000 +0200
67040 +++ linux-2.6.29-rc3.owrt/drivers/pci/rom.c 2009-05-10 23:48:29.000000000 +0200
67041 @@ -55,7 +55,6 @@
67042
67043 /**
67044 * pci_get_rom_size - obtain the actual size of the ROM image
67045 - * @pdev: target PCI device
67046 * @rom: kernel virtual pointer to image of ROM
67047 * @size: size of PCI window
67048 * return: size of actual ROM image
67049 @@ -64,7 +63,7 @@
67050 * The PCI window size could be much larger than the
67051 * actual image size.
67052 */
67053 -size_t pci_get_rom_size(struct pci_dev *pdev, void __iomem *rom, size_t size)
67054 +size_t pci_get_rom_size(void __iomem *rom, size_t size)
67055 {
67056 void __iomem *image;
67057 int last_image;
67058 @@ -73,10 +72,8 @@
67059 do {
67060 void __iomem *pds;
67061 /* Standard PCI ROMs start out with these bytes 55 AA */
67062 - if (readb(image) != 0x55) {
67063 - dev_err(&pdev->dev, "Invalid ROM contents\n");
67064 + if (readb(image) != 0x55)
67065 break;
67066 - }
67067 if (readb(image + 1) != 0xAA)
67068 break;
67069 /* get the PCI data structure and check its signature */
67070 @@ -162,7 +159,7 @@
67071 * size is much larger than the actual size of the ROM.
67072 * True size is important if the ROM is going to be copied.
67073 */
67074 - *size = pci_get_rom_size(pdev, rom, *size);
67075 + *size = pci_get_rom_size(rom, *size);
67076 return rom;
67077 }
67078
67079 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/platform/x86/acer-wmi.c linux-2.6.29-rc3.owrt/drivers/platform/x86/acer-wmi.c
67080 --- linux-2.6.29.owrt/drivers/platform/x86/acer-wmi.c 2009-05-10 22:04:39.000000000 +0200
67081 +++ linux-2.6.29-rc3.owrt/drivers/platform/x86/acer-wmi.c 2009-05-10 23:48:29.000000000 +0200
67082 @@ -1026,7 +1026,7 @@
67083 kfree(wireless_rfkill->data);
67084 rfkill_unregister(wireless_rfkill);
67085 if (has_cap(ACER_CAP_BLUETOOTH)) {
67086 - kfree(bluetooth_rfkill->data);
67087 + kfree(wireless_rfkill->data);
67088 rfkill_unregister(bluetooth_rfkill);
67089 }
67090 return;
67091 @@ -1297,7 +1297,7 @@
67092
67093 set_quirks();
67094
67095 - if (acpi_video_backlight_support() && has_cap(ACER_CAP_BRIGHTNESS)) {
67096 + if (!acpi_video_backlight_support() && has_cap(ACER_CAP_BRIGHTNESS)) {
67097 interface->capability &= ~ACER_CAP_BRIGHTNESS;
67098 printk(ACER_INFO "Brightness must be controlled by "
67099 "generic video driver\n");
67100 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/platform/x86/asus_acpi.c linux-2.6.29-rc3.owrt/drivers/platform/x86/asus_acpi.c
67101 --- linux-2.6.29.owrt/drivers/platform/x86/asus_acpi.c 2009-05-10 22:04:39.000000000 +0200
67102 +++ linux-2.6.29-rc3.owrt/drivers/platform/x86/asus_acpi.c 2009-05-10 23:48:29.000000000 +0200
67103 @@ -143,7 +143,6 @@
67104 S1300N, S5200N*/
67105 A4S, /* Z81sp */
67106 F3Sa, /* (Centrino) */
67107 - R1F,
67108 END_MODEL
67109 } model; /* Models currently supported */
67110 u16 event_count[128]; /* Count for each event TODO make this better */
67111 @@ -421,18 +420,7 @@
67112 .display_get = "\\ADVG",
67113 .display_set = "SDSP",
67114 },
67115 - {
67116 - .name = "R1F",
67117 - .mt_bt_switch = "BLED",
67118 - .mt_mled = "MLED",
67119 - .mt_wled = "WLED",
67120 - .mt_lcd_switch = "\\Q10",
67121 - .lcd_status = "\\GP06",
67122 - .brightness_set = "SPLV",
67123 - .brightness_get = "GPLV",
67124 - .display_set = "SDSP",
67125 - .display_get = "\\INFB"
67126 - }
67127 +
67128 };
67129
67130 /* procdir we use */
67131 @@ -1177,8 +1165,6 @@
67132 return W3V;
67133 else if (strncmp(model, "W5A", 3) == 0)
67134 return W5A;
67135 - else if (strncmp(model, "R1F", 3) == 0)
67136 - return R1F;
67137 else if (strncmp(model, "A4S", 3) == 0)
67138 return A4S;
67139 else if (strncmp(model, "F3Sa", 4) == 0)
67140 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/platform/x86/asus-laptop.c linux-2.6.29-rc3.owrt/drivers/platform/x86/asus-laptop.c
67141 --- linux-2.6.29.owrt/drivers/platform/x86/asus-laptop.c 2009-05-10 22:04:39.000000000 +0200
67142 +++ linux-2.6.29-rc3.owrt/drivers/platform/x86/asus-laptop.c 2009-05-10 23:48:29.000000000 +0200
67143 @@ -46,7 +46,6 @@
67144 #include <acpi/acpi_drivers.h>
67145 #include <acpi/acpi_bus.h>
67146 #include <asm/uaccess.h>
67147 -#include <linux/input.h>
67148
67149 #define ASUS_LAPTOP_VERSION "0.42"
67150
67151 @@ -182,8 +181,6 @@
67152 u8 light_level; //light sensor level
67153 u8 light_switch; //light sensor switch value
67154 u16 event_count[128]; //count for each event TODO make this better
67155 - struct input_dev *inputdev;
67156 - u16 *keycode_map;
67157 };
67158
67159 /*
67160 @@ -253,37 +250,6 @@
67161 ASUS_LED(pled, "phone");
67162 ASUS_LED(gled, "gaming");
67163
67164 -struct key_entry {
67165 - char type;
67166 - u8 code;
67167 - u16 keycode;
67168 -};
67169 -
67170 -enum { KE_KEY, KE_END };
67171 -
67172 -static struct key_entry asus_keymap[] = {
67173 - {KE_KEY, 0x30, KEY_VOLUMEUP},
67174 - {KE_KEY, 0x31, KEY_VOLUMEDOWN},
67175 - {KE_KEY, 0x32, KEY_MUTE},
67176 - {KE_KEY, 0x33, KEY_SWITCHVIDEOMODE},
67177 - {KE_KEY, 0x34, KEY_SWITCHVIDEOMODE},
67178 - {KE_KEY, 0x40, KEY_PREVIOUSSONG},
67179 - {KE_KEY, 0x41, KEY_NEXTSONG},
67180 - {KE_KEY, 0x43, KEY_STOP},
67181 - {KE_KEY, 0x45, KEY_PLAYPAUSE},
67182 - {KE_KEY, 0x50, KEY_EMAIL},
67183 - {KE_KEY, 0x51, KEY_WWW},
67184 - {KE_KEY, 0x5C, BTN_EXTRA}, /* Performance */
67185 - {KE_KEY, 0x5D, KEY_WLAN},
67186 - {KE_KEY, 0x61, KEY_SWITCHVIDEOMODE},
67187 - {KE_KEY, 0x6B, BTN_TOUCH}, /* Lock Mouse */
67188 - {KE_KEY, 0x82, KEY_CAMERA},
67189 - {KE_KEY, 0x8A, KEY_TV},
67190 - {KE_KEY, 0x95, KEY_MEDIA},
67191 - {KE_KEY, 0x99, KEY_PHONE},
67192 - {KE_END, 0},
67193 -};
67194 -
67195 /*
67196 * This function evaluates an ACPI method, given an int as parameter, the
67197 * method is searched within the scope of the handle, can be NULL. The output
67198 @@ -754,69 +720,8 @@
67199 return store_status(buf, count, NULL, GPS_ON);
67200 }
67201
67202 -/*
67203 - * Hotkey functions
67204 - */
67205 -static struct key_entry *asus_get_entry_by_scancode(int code)
67206 -{
67207 - struct key_entry *key;
67208 -
67209 - for (key = asus_keymap; key->type != KE_END; key++)
67210 - if (code == key->code)
67211 - return key;
67212 -
67213 - return NULL;
67214 -}
67215 -
67216 -static struct key_entry *asus_get_entry_by_keycode(int code)
67217 -{
67218 - struct key_entry *key;
67219 -
67220 - for (key = asus_keymap; key->type != KE_END; key++)
67221 - if (code == key->keycode && key->type == KE_KEY)
67222 - return key;
67223 -
67224 - return NULL;
67225 -}
67226 -
67227 -static int asus_getkeycode(struct input_dev *dev, int scancode, int *keycode)
67228 -{
67229 - struct key_entry *key = asus_get_entry_by_scancode(scancode);
67230 -
67231 - if (key && key->type == KE_KEY) {
67232 - *keycode = key->keycode;
67233 - return 0;
67234 - }
67235 -
67236 - return -EINVAL;
67237 -}
67238 -
67239 -static int asus_setkeycode(struct input_dev *dev, int scancode, int keycode)
67240 -{
67241 - struct key_entry *key;
67242 - int old_keycode;
67243 -
67244 - if (keycode < 0 || keycode > KEY_MAX)
67245 - return -EINVAL;
67246 -
67247 - key = asus_get_entry_by_scancode(scancode);
67248 - if (key && key->type == KE_KEY) {
67249 - old_keycode = key->keycode;
67250 - key->keycode = keycode;
67251 - set_bit(keycode, dev->keybit);
67252 - if (!asus_get_entry_by_keycode(old_keycode))
67253 - clear_bit(old_keycode, dev->keybit);
67254 - return 0;
67255 - }
67256 -
67257 - return -EINVAL;
67258 -}
67259 -
67260 static void asus_hotk_notify(acpi_handle handle, u32 event, void *data)
67261 {
67262 - static struct key_entry *key;
67263 - u16 count;
67264 -
67265 /* TODO Find a better way to handle events count. */
67266 if (!hotk)
67267 return;
67268 @@ -833,26 +738,10 @@
67269 lcd_blank(FB_BLANK_POWERDOWN);
67270 }
67271
67272 - count = hotk->event_count[event % 128]++;
67273 - acpi_bus_generate_proc_event(hotk->device, event, count);
67274 - acpi_bus_generate_netlink_event(hotk->device->pnp.device_class,
67275 - dev_name(&hotk->device->dev), event,
67276 - count);
67277 -
67278 - if (hotk->inputdev) {
67279 - key = asus_get_entry_by_scancode(event);
67280 - if (!key)
67281 - return ;
67282 -
67283 - switch (key->type) {
67284 - case KE_KEY:
67285 - input_report_key(hotk->inputdev, key->keycode, 1);
67286 - input_sync(hotk->inputdev);
67287 - input_report_key(hotk->inputdev, key->keycode, 0);
67288 - input_sync(hotk->inputdev);
67289 - break;
67290 - }
67291 - }
67292 + acpi_bus_generate_proc_event(hotk->device, event,
67293 + hotk->event_count[event % 128]++);
67294 +
67295 + return;
67296 }
67297
67298 #define ASUS_CREATE_DEVICE_ATTR(_name) \
67299 @@ -1070,38 +959,6 @@
67300 return AE_OK;
67301 }
67302
67303 -static int asus_input_init(void)
67304 -{
67305 - const struct key_entry *key;
67306 - int result;
67307 -
67308 - hotk->inputdev = input_allocate_device();
67309 - if (!hotk->inputdev) {
67310 - printk(ASUS_INFO "Unable to allocate input device\n");
67311 - return 0;
67312 - }
67313 - hotk->inputdev->name = "Asus Laptop extra buttons";
67314 - hotk->inputdev->phys = ASUS_HOTK_FILE "/input0";
67315 - hotk->inputdev->id.bustype = BUS_HOST;
67316 - hotk->inputdev->getkeycode = asus_getkeycode;
67317 - hotk->inputdev->setkeycode = asus_setkeycode;
67318 -
67319 - for (key = asus_keymap; key->type != KE_END; key++) {
67320 - switch (key->type) {
67321 - case KE_KEY:
67322 - set_bit(EV_KEY, hotk->inputdev->evbit);
67323 - set_bit(key->keycode, hotk->inputdev->keybit);
67324 - break;
67325 - }
67326 - }
67327 - result = input_register_device(hotk->inputdev);
67328 - if (result) {
67329 - printk(ASUS_INFO "Unable to register input device\n");
67330 - input_free_device(hotk->inputdev);
67331 - }
67332 - return result;
67333 -}
67334 -
67335 static int asus_hotk_check(void)
67336 {
67337 int result = 0;
67338 @@ -1187,7 +1044,7 @@
67339 /* GPS is on by default */
67340 write_status(NULL, 1, GPS_ON);
67341
67342 -end:
67343 + end:
67344 if (result) {
67345 kfree(hotk->name);
67346 kfree(hotk);
67347 @@ -1234,17 +1091,10 @@
67348 ASUS_LED_UNREGISTER(gled);
67349 }
67350
67351 -static void asus_input_exit(void)
67352 -{
67353 - if (hotk->inputdev)
67354 - input_unregister_device(hotk->inputdev);
67355 -}
67356 -
67357 static void __exit asus_laptop_exit(void)
67358 {
67359 asus_backlight_exit();
67360 asus_led_exit();
67361 - asus_input_exit();
67362
67363 acpi_bus_unregister_driver(&asus_hotk_driver);
67364 sysfs_remove_group(&asuspf_device->dev.kobj, &asuspf_attribute_group);
67365 @@ -1366,10 +1216,6 @@
67366 printk(ASUS_INFO "Brightness ignored, must be controlled by "
67367 "ACPI video driver\n");
67368
67369 - result = asus_input_init();
67370 - if (result)
67371 - goto fail_input;
67372 -
67373 result = asus_led_init(dev);
67374 if (result)
67375 goto fail_led;
67376 @@ -1396,25 +1242,22 @@
67377
67378 return 0;
67379
67380 -fail_sysfs:
67381 + fail_sysfs:
67382 platform_device_del(asuspf_device);
67383
67384 -fail_platform_device2:
67385 + fail_platform_device2:
67386 platform_device_put(asuspf_device);
67387
67388 -fail_platform_device1:
67389 + fail_platform_device1:
67390 platform_driver_unregister(&asuspf_driver);
67391
67392 -fail_platform_driver:
67393 + fail_platform_driver:
67394 asus_led_exit();
67395
67396 -fail_led:
67397 - asus_input_exit();
67398 -
67399 -fail_input:
67400 + fail_led:
67401 asus_backlight_exit();
67402
67403 -fail_backlight:
67404 + fail_backlight:
67405
67406 return result;
67407 }
67408 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/platform/x86/eeepc-laptop.c linux-2.6.29-rc3.owrt/drivers/platform/x86/eeepc-laptop.c
67409 --- linux-2.6.29.owrt/drivers/platform/x86/eeepc-laptop.c 2009-05-10 22:04:39.000000000 +0200
67410 +++ linux-2.6.29-rc3.owrt/drivers/platform/x86/eeepc-laptop.c 2009-05-10 23:48:29.000000000 +0200
67411 @@ -30,7 +30,6 @@
67412 #include <linux/uaccess.h>
67413 #include <linux/input.h>
67414 #include <linux/rfkill.h>
67415 -#include <linux/pci.h>
67416
67417 #define EEEPC_LAPTOP_VERSION "0.1"
67418
67419 @@ -162,10 +161,6 @@
67420 {KE_KEY, 0x13, KEY_MUTE },
67421 {KE_KEY, 0x14, KEY_VOLUMEDOWN },
67422 {KE_KEY, 0x15, KEY_VOLUMEUP },
67423 - {KE_KEY, 0x1a, KEY_COFFEE },
67424 - {KE_KEY, 0x1b, KEY_ZOOM },
67425 - {KE_KEY, 0x1c, KEY_PROG2 },
67426 - {KE_KEY, 0x1d, KEY_PROG3 },
67427 {KE_KEY, 0x30, KEY_SWITCHVIDEOMODE },
67428 {KE_KEY, 0x31, KEY_SWITCHVIDEOMODE },
67429 {KE_KEY, 0x32, KEY_SWITCHVIDEOMODE },
67430 @@ -515,59 +510,18 @@
67431 static void notify_brn(void)
67432 {
67433 struct backlight_device *bd = eeepc_backlight_device;
67434 - if (bd)
67435 - bd->props.brightness = read_brightness(bd);
67436 -}
67437 -
67438 -static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data)
67439 -{
67440 - struct pci_dev *dev;
67441 - struct pci_bus *bus = pci_find_bus(0, 1);
67442 -
67443 - if (event != ACPI_NOTIFY_BUS_CHECK)
67444 - return;
67445 -
67446 - if (!bus) {
67447 - printk(EEEPC_WARNING "Unable to find PCI bus 1?\n");
67448 - return;
67449 - }
67450 -
67451 - if (get_acpi(CM_ASL_WLAN) == 1) {
67452 - dev = pci_get_slot(bus, 0);
67453 - if (dev) {
67454 - /* Device already present */
67455 - pci_dev_put(dev);
67456 - return;
67457 - }
67458 - dev = pci_scan_single_device(bus, 0);
67459 - if (dev) {
67460 - pci_bus_assign_resources(bus);
67461 - if (pci_bus_add_device(dev))
67462 - printk(EEEPC_ERR "Unable to hotplug wifi\n");
67463 - }
67464 - } else {
67465 - dev = pci_get_slot(bus, 0);
67466 - if (dev) {
67467 - pci_remove_bus_device(dev);
67468 - pci_dev_put(dev);
67469 - }
67470 - }
67471 + bd->props.brightness = read_brightness(bd);
67472 }
67473
67474 static void eeepc_hotk_notify(acpi_handle handle, u32 event, void *data)
67475 {
67476 static struct key_entry *key;
67477 - u16 count;
67478 -
67479 if (!ehotk)
67480 return;
67481 if (event >= NOTIFY_BRN_MIN && event <= NOTIFY_BRN_MAX)
67482 notify_brn();
67483 - count = ehotk->event_count[event % 128]++;
67484 - acpi_bus_generate_proc_event(ehotk->device, event, count);
67485 - acpi_bus_generate_netlink_event(ehotk->device->pnp.device_class,
67486 - dev_name(&ehotk->device->dev), event,
67487 - count);
67488 + acpi_bus_generate_proc_event(ehotk->device, event,
67489 + ehotk->event_count[event % 128]++);
67490 if (ehotk->inputdev) {
67491 key = eepc_get_entry_by_scancode(event);
67492 if (key) {
67493 @@ -585,45 +539,6 @@
67494 }
67495 }
67496
67497 -static int eeepc_register_rfkill_notifier(char *node)
67498 -{
67499 - acpi_status status = AE_OK;
67500 - acpi_handle handle;
67501 -
67502 - status = acpi_get_handle(NULL, node, &handle);
67503 -
67504 - if (ACPI_SUCCESS(status)) {
67505 - status = acpi_install_notify_handler(handle,
67506 - ACPI_SYSTEM_NOTIFY,
67507 - eeepc_rfkill_notify,
67508 - NULL);
67509 - if (ACPI_FAILURE(status))
67510 - printk(EEEPC_WARNING
67511 - "Failed to register notify on %s\n", node);
67512 - } else
67513 - return -ENODEV;
67514 -
67515 - return 0;
67516 -}
67517 -
67518 -static void eeepc_unregister_rfkill_notifier(char *node)
67519 -{
67520 - acpi_status status = AE_OK;
67521 - acpi_handle handle;
67522 -
67523 - status = acpi_get_handle(NULL, node, &handle);
67524 -
67525 - if (ACPI_SUCCESS(status)) {
67526 - status = acpi_remove_notify_handler(handle,
67527 - ACPI_SYSTEM_NOTIFY,
67528 - eeepc_rfkill_notify);
67529 - if (ACPI_FAILURE(status))
67530 - printk(EEEPC_ERR
67531 - "Error removing rfkill notify handler %s\n",
67532 - node);
67533 - }
67534 -}
67535 -
67536 static int eeepc_hotk_add(struct acpi_device *device)
67537 {
67538 acpi_status status = AE_OK;
67539 @@ -643,7 +558,7 @@
67540 ehotk->device = device;
67541 result = eeepc_hotk_check();
67542 if (result)
67543 - goto ehotk_fail;
67544 + goto end;
67545 status = acpi_install_notify_handler(ehotk->handle, ACPI_SYSTEM_NOTIFY,
67546 eeepc_hotk_notify, ehotk);
67547 if (ACPI_FAILURE(status))
67548 @@ -654,25 +569,18 @@
67549 RFKILL_TYPE_WLAN);
67550
67551 if (!ehotk->eeepc_wlan_rfkill)
67552 - goto wlan_fail;
67553 + goto end;
67554
67555 ehotk->eeepc_wlan_rfkill->name = "eeepc-wlan";
67556 ehotk->eeepc_wlan_rfkill->toggle_radio = eeepc_wlan_rfkill_set;
67557 ehotk->eeepc_wlan_rfkill->get_state = eeepc_wlan_rfkill_state;
67558 - if (get_acpi(CM_ASL_WLAN) == 1) {
67559 + if (get_acpi(CM_ASL_WLAN) == 1)
67560 ehotk->eeepc_wlan_rfkill->state =
67561 RFKILL_STATE_UNBLOCKED;
67562 - rfkill_set_default(RFKILL_TYPE_WLAN,
67563 - RFKILL_STATE_UNBLOCKED);
67564 - } else {
67565 + else
67566 ehotk->eeepc_wlan_rfkill->state =
67567 RFKILL_STATE_SOFT_BLOCKED;
67568 - rfkill_set_default(RFKILL_TYPE_WLAN,
67569 - RFKILL_STATE_SOFT_BLOCKED);
67570 - }
67571 - result = rfkill_register(ehotk->eeepc_wlan_rfkill);
67572 - if (result)
67573 - goto wlan_fail;
67574 + rfkill_register(ehotk->eeepc_wlan_rfkill);
67575 }
67576
67577 if (get_acpi(CM_ASL_BLUETOOTH) != -1) {
67578 @@ -680,47 +588,27 @@
67579 rfkill_allocate(&device->dev, RFKILL_TYPE_BLUETOOTH);
67580
67581 if (!ehotk->eeepc_bluetooth_rfkill)
67582 - goto bluetooth_fail;
67583 + goto end;
67584
67585 ehotk->eeepc_bluetooth_rfkill->name = "eeepc-bluetooth";
67586 ehotk->eeepc_bluetooth_rfkill->toggle_radio =
67587 eeepc_bluetooth_rfkill_set;
67588 ehotk->eeepc_bluetooth_rfkill->get_state =
67589 eeepc_bluetooth_rfkill_state;
67590 - if (get_acpi(CM_ASL_BLUETOOTH) == 1) {
67591 + if (get_acpi(CM_ASL_BLUETOOTH) == 1)
67592 ehotk->eeepc_bluetooth_rfkill->state =
67593 RFKILL_STATE_UNBLOCKED;
67594 - rfkill_set_default(RFKILL_TYPE_BLUETOOTH,
67595 - RFKILL_STATE_UNBLOCKED);
67596 - } else {
67597 + else
67598 ehotk->eeepc_bluetooth_rfkill->state =
67599 RFKILL_STATE_SOFT_BLOCKED;
67600 - rfkill_set_default(RFKILL_TYPE_BLUETOOTH,
67601 - RFKILL_STATE_SOFT_BLOCKED);
67602 - }
67603 -
67604 - result = rfkill_register(ehotk->eeepc_bluetooth_rfkill);
67605 - if (result)
67606 - goto bluetooth_fail;
67607 + rfkill_register(ehotk->eeepc_bluetooth_rfkill);
67608 }
67609
67610 - eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P6");
67611 - eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P7");
67612 -
67613 - return 0;
67614 -
67615 - bluetooth_fail:
67616 - if (ehotk->eeepc_bluetooth_rfkill)
67617 - rfkill_free(ehotk->eeepc_bluetooth_rfkill);
67618 - rfkill_unregister(ehotk->eeepc_wlan_rfkill);
67619 - ehotk->eeepc_wlan_rfkill = NULL;
67620 - wlan_fail:
67621 - if (ehotk->eeepc_wlan_rfkill)
67622 - rfkill_free(ehotk->eeepc_wlan_rfkill);
67623 - ehotk_fail:
67624 - kfree(ehotk);
67625 - ehotk = NULL;
67626 -
67627 + end:
67628 + if (result) {
67629 + kfree(ehotk);
67630 + ehotk = NULL;
67631 + }
67632 return result;
67633 }
67634
67635 @@ -734,10 +622,6 @@
67636 eeepc_hotk_notify);
67637 if (ACPI_FAILURE(status))
67638 printk(EEEPC_ERR "Error removing notify handler\n");
67639 -
67640 - eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P6");
67641 - eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P7");
67642 -
67643 kfree(ehotk);
67644 return 0;
67645 }
67646 @@ -853,21 +737,13 @@
67647 {
67648 if (eeepc_backlight_device)
67649 backlight_device_unregister(eeepc_backlight_device);
67650 - eeepc_backlight_device = NULL;
67651 -}
67652 -
67653 -static void eeepc_rfkill_exit(void)
67654 -{
67655 + if (ehotk->inputdev)
67656 + input_unregister_device(ehotk->inputdev);
67657 if (ehotk->eeepc_wlan_rfkill)
67658 rfkill_unregister(ehotk->eeepc_wlan_rfkill);
67659 if (ehotk->eeepc_bluetooth_rfkill)
67660 rfkill_unregister(ehotk->eeepc_bluetooth_rfkill);
67661 -}
67662 -
67663 -static void eeepc_input_exit(void)
67664 -{
67665 - if (ehotk->inputdev)
67666 - input_unregister_device(ehotk->inputdev);
67667 + eeepc_backlight_device = NULL;
67668 }
67669
67670 static void eeepc_hwmon_exit(void)
67671 @@ -886,8 +762,6 @@
67672 static void __exit eeepc_laptop_exit(void)
67673 {
67674 eeepc_backlight_exit();
67675 - eeepc_rfkill_exit();
67676 - eeepc_input_exit();
67677 eeepc_hwmon_exit();
67678 acpi_bus_unregister_driver(&eeepc_hotk_driver);
67679 sysfs_remove_group(&platform_device->dev.kobj,
67680 @@ -991,8 +865,6 @@
67681 fail_hwmon:
67682 eeepc_backlight_exit();
67683 fail_backlight:
67684 - eeepc_input_exit();
67685 - eeepc_rfkill_exit();
67686 return result;
67687 }
67688
67689 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/platform/x86/fujitsu-laptop.c linux-2.6.29-rc3.owrt/drivers/platform/x86/fujitsu-laptop.c
67690 --- linux-2.6.29.owrt/drivers/platform/x86/fujitsu-laptop.c 2009-05-10 22:04:39.000000000 +0200
67691 +++ linux-2.6.29-rc3.owrt/drivers/platform/x86/fujitsu-laptop.c 2009-05-10 23:48:29.000000000 +0200
67692 @@ -166,7 +166,6 @@
67693 struct platform_device *pf_device;
67694 struct kfifo *fifo;
67695 spinlock_t fifo_lock;
67696 - int rfkill_supported;
67697 int rfkill_state;
67698 int logolamp_registered;
67699 int kblamps_registered;
67700 @@ -527,7 +526,7 @@
67701 show_lid_state(struct device *dev,
67702 struct device_attribute *attr, char *buf)
67703 {
67704 - if (!(fujitsu_hotkey->rfkill_supported & 0x100))
67705 + if (fujitsu_hotkey->rfkill_state == UNSUPPORTED_CMD)
67706 return sprintf(buf, "unknown\n");
67707 if (fujitsu_hotkey->rfkill_state & 0x100)
67708 return sprintf(buf, "open\n");
67709 @@ -539,7 +538,7 @@
67710 show_dock_state(struct device *dev,
67711 struct device_attribute *attr, char *buf)
67712 {
67713 - if (!(fujitsu_hotkey->rfkill_supported & 0x200))
67714 + if (fujitsu_hotkey->rfkill_state == UNSUPPORTED_CMD)
67715 return sprintf(buf, "unknown\n");
67716 if (fujitsu_hotkey->rfkill_state & 0x200)
67717 return sprintf(buf, "docked\n");
67718 @@ -551,7 +550,7 @@
67719 show_radios_state(struct device *dev,
67720 struct device_attribute *attr, char *buf)
67721 {
67722 - if (!(fujitsu_hotkey->rfkill_supported & 0x20))
67723 + if (fujitsu_hotkey->rfkill_state == UNSUPPORTED_CMD)
67724 return sprintf(buf, "unknown\n");
67725 if (fujitsu_hotkey->rfkill_state & 0x20)
67726 return sprintf(buf, "on\n");
67727 @@ -929,17 +928,8 @@
67728 ; /* No action, result is discarded */
67729 vdbg_printk(FUJLAPTOP_DBG_INFO, "Discarded %i ringbuffer entries\n", i);
67730
67731 - fujitsu_hotkey->rfkill_supported =
67732 - call_fext_func(FUNC_RFKILL, 0x0, 0x0, 0x0);
67733 -
67734 - /* Make sure our bitmask of supported functions is cleared if the
67735 - RFKILL function block is not implemented, like on the S7020. */
67736 - if (fujitsu_hotkey->rfkill_supported == UNSUPPORTED_CMD)
67737 - fujitsu_hotkey->rfkill_supported = 0;
67738 -
67739 - if (fujitsu_hotkey->rfkill_supported)
67740 - fujitsu_hotkey->rfkill_state =
67741 - call_fext_func(FUNC_RFKILL, 0x4, 0x0, 0x0);
67742 + fujitsu_hotkey->rfkill_state =
67743 + call_fext_func(FUNC_RFKILL, 0x4, 0x0, 0x0);
67744
67745 /* Suspect this is a keymap of the application panel, print it */
67746 printk(KERN_INFO "fujitsu-laptop: BTNI: [0x%x]\n",
67747 @@ -1015,9 +1005,8 @@
67748
67749 input = fujitsu_hotkey->input;
67750
67751 - if (fujitsu_hotkey->rfkill_supported)
67752 - fujitsu_hotkey->rfkill_state =
67753 - call_fext_func(FUNC_RFKILL, 0x4, 0x0, 0x0);
67754 + fujitsu_hotkey->rfkill_state =
67755 + call_fext_func(FUNC_RFKILL, 0x4, 0x0, 0x0);
67756
67757 switch (event) {
67758 case ACPI_FUJITSU_NOTIFY_CODE1:
67759 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/platform/x86/hp-wmi.c linux-2.6.29-rc3.owrt/drivers/platform/x86/hp-wmi.c
67760 --- linux-2.6.29.owrt/drivers/platform/x86/hp-wmi.c 2009-05-10 22:04:39.000000000 +0200
67761 +++ linux-2.6.29-rc3.owrt/drivers/platform/x86/hp-wmi.c 2009-05-10 23:48:29.000000000 +0200
67762 @@ -382,11 +382,6 @@
67763 case KE_SW:
67764 set_bit(EV_SW, hp_wmi_input_dev->evbit);
67765 set_bit(key->keycode, hp_wmi_input_dev->swbit);
67766 -
67767 - /* Set initial dock state */
67768 - input_report_switch(hp_wmi_input_dev, key->keycode,
67769 - hp_wmi_dock_state());
67770 - input_sync(hp_wmi_input_dev);
67771 break;
67772 }
67773 }
67774 @@ -446,7 +441,6 @@
67775 bluetooth_rfkill->toggle_radio = hp_wmi_bluetooth_set;
67776 bluetooth_rfkill->user_claim_unsupported = 1;
67777 err = rfkill_register(bluetooth_rfkill);
67778 - if (err)
67779 goto register_bluetooth_error;
67780 }
67781
67782 @@ -463,11 +457,9 @@
67783
67784 return 0;
67785 register_wwan_err:
67786 - if (bluetooth_rfkill)
67787 - rfkill_unregister(bluetooth_rfkill);
67788 + rfkill_unregister(bluetooth_rfkill);
67789 register_bluetooth_error:
67790 - if (wifi_rfkill)
67791 - rfkill_unregister(wifi_rfkill);
67792 + rfkill_unregister(wifi_rfkill);
67793 add_sysfs_error:
67794 cleanup_sysfs(device);
67795 return err;
67796 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/platform/x86/Kconfig linux-2.6.29-rc3.owrt/drivers/platform/x86/Kconfig
67797 --- linux-2.6.29.owrt/drivers/platform/x86/Kconfig 2009-05-10 22:04:39.000000000 +0200
67798 +++ linux-2.6.29-rc3.owrt/drivers/platform/x86/Kconfig 2009-05-10 23:48:29.000000000 +0200
67799 @@ -15,7 +15,8 @@
67800 if X86_PLATFORM_DEVICES
67801
67802 config ACER_WMI
67803 - tristate "Acer WMI Laptop Extras"
67804 + tristate "Acer WMI Laptop Extras (EXPERIMENTAL)"
67805 + depends on EXPERIMENTAL
67806 depends on ACPI
67807 depends on LEDS_CLASS
67808 depends on NEW_LEDS
67809 @@ -38,10 +39,9 @@
67810 tristate "Asus Laptop Extras (EXPERIMENTAL)"
67811 depends on ACPI
67812 depends on EXPERIMENTAL && !ACPI_ASUS
67813 - select LEDS_CLASS
67814 - select NEW_LEDS
67815 - select BACKLIGHT_CLASS_DEVICE
67816 - depends on INPUT
67817 + depends on LEDS_CLASS
67818 + depends on NEW_LEDS
67819 + depends on BACKLIGHT_CLASS_DEVICE
67820 ---help---
67821 This is the new Linux driver for Asus laptops. It may also support some
67822 MEDION, JVC or VICTOR laptops. It makes all the extra buttons generate
67823 @@ -61,7 +61,6 @@
67824 depends on EXPERIMENTAL
67825 depends on BACKLIGHT_CLASS_DEVICE
67826 depends on RFKILL
67827 - depends on POWER_SUPPLY
67828 default n
67829 ---help---
67830 This driver adds support for rfkill and backlight control to Dell
67831 @@ -184,11 +183,11 @@
67832 config THINKPAD_ACPI
67833 tristate "ThinkPad ACPI Laptop Extras"
67834 depends on ACPI
67835 - depends on INPUT
67836 select BACKLIGHT_LCD_SUPPORT
67837 select BACKLIGHT_CLASS_DEVICE
67838 select HWMON
67839 select NVRAM
67840 + select INPUT
67841 select NEW_LEDS
67842 select LEDS_CLASS
67843 select NET
67844 @@ -301,7 +300,6 @@
67845 config EEEPC_LAPTOP
67846 tristate "Eee PC Hotkey Driver (EXPERIMENTAL)"
67847 depends on ACPI
67848 - depends on INPUT
67849 depends on EXPERIMENTAL
67850 select BACKLIGHT_CLASS_DEVICE
67851 select HWMON
67852 @@ -314,8 +312,9 @@
67853
67854
67855 config ACPI_WMI
67856 - tristate "WMI"
67857 + tristate "WMI (EXPERIMENTAL)"
67858 depends on ACPI
67859 + depends on EXPERIMENTAL
67860 help
67861 This driver adds support for the ACPI-WMI (Windows Management
67862 Instrumentation) mapper device (PNP0C14) found on some systems.
67863 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/platform/x86/panasonic-laptop.c linux-2.6.29-rc3.owrt/drivers/platform/x86/panasonic-laptop.c
67864 --- linux-2.6.29.owrt/drivers/platform/x86/panasonic-laptop.c 2009-05-10 22:04:39.000000000 +0200
67865 +++ linux-2.6.29-rc3.owrt/drivers/platform/x86/panasonic-laptop.c 2009-05-10 23:48:29.000000000 +0200
67866 @@ -507,7 +507,7 @@
67867
67868 hkey_num = result & 0xf;
67869
67870 - if (hkey_num < 0 || hkey_num >= ARRAY_SIZE(pcc->keymap)) {
67871 + if (hkey_num < 0 || hkey_num > ARRAY_SIZE(pcc->keymap)) {
67872 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
67873 "hotkey number out of range: %d\n",
67874 hkey_num));
67875 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/platform/x86/thinkpad_acpi.c linux-2.6.29-rc3.owrt/drivers/platform/x86/thinkpad_acpi.c
67876 --- linux-2.6.29.owrt/drivers/platform/x86/thinkpad_acpi.c 2009-05-10 22:04:39.000000000 +0200
67877 +++ linux-2.6.29-rc3.owrt/drivers/platform/x86/thinkpad_acpi.c 2009-05-10 23:48:29.000000000 +0200
67878 @@ -7532,7 +7532,7 @@
67879 * if it is not there yet.
67880 */
67881 #define IBM_BIOS_MODULE_ALIAS(__type) \
67882 - MODULE_ALIAS("dmi:bvnIBM:bvr" __type "ET??WW*")
67883 + MODULE_ALIAS("dmi:bvnIBM:bvr" __type "ET??WW")
67884
67885 /* Non-ancient thinkpads */
67886 MODULE_ALIAS("dmi:bvnIBM:*:svnIBM:*:pvrThinkPad*:rvnIBM:*");
67887 @@ -7541,9 +7541,9 @@
67888 /* Ancient thinkpad BIOSes have to be identified by
67889 * BIOS type or model number, and there are far less
67890 * BIOS types than model numbers... */
67891 -IBM_BIOS_MODULE_ALIAS("I[BDHIMNOTWVYZ]");
67892 -IBM_BIOS_MODULE_ALIAS("1[0368A-GIKM-PST]");
67893 -IBM_BIOS_MODULE_ALIAS("K[UX-Z]");
67894 +IBM_BIOS_MODULE_ALIAS("I[B,D,H,I,M,N,O,T,W,V,Y,Z]");
67895 +IBM_BIOS_MODULE_ALIAS("1[0,3,6,8,A-G,I,K,M-P,S,T]");
67896 +IBM_BIOS_MODULE_ALIAS("K[U,X-Z]");
67897
67898 MODULE_AUTHOR("Borislav Deianov, Henrique de Moraes Holschuh");
67899 MODULE_DESCRIPTION(TPACPI_DESC);
67900 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/platform/x86/wmi.c linux-2.6.29-rc3.owrt/drivers/platform/x86/wmi.c
67901 --- linux-2.6.29.owrt/drivers/platform/x86/wmi.c 2009-05-10 22:04:39.000000000 +0200
67902 +++ linux-2.6.29-rc3.owrt/drivers/platform/x86/wmi.c 2009-05-10 23:48:29.000000000 +0200
67903 @@ -708,7 +708,7 @@
67904
67905 static int __init acpi_wmi_init(void)
67906 {
67907 - int result;
67908 + acpi_status result;
67909
67910 INIT_LIST_HEAD(&wmi_blocks.list);
67911
67912 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/power/ds2760_battery.c linux-2.6.29-rc3.owrt/drivers/power/ds2760_battery.c
67913 --- linux-2.6.29.owrt/drivers/power/ds2760_battery.c 2009-05-10 22:04:38.000000000 +0200
67914 +++ linux-2.6.29-rc3.owrt/drivers/power/ds2760_battery.c 2009-05-10 23:48:29.000000000 +0200
67915 @@ -180,13 +180,10 @@
67916 di->empty_uAh = battery_interpolate(scale, di->temp_C / 10);
67917 di->empty_uAh *= 1000; /* convert to µAh */
67918
67919 - if (di->full_active_uAh == di->empty_uAh)
67920 - di->rem_capacity = 0;
67921 - else
67922 - /* From Maxim Application Note 131: remaining capacity =
67923 - * ((ICA - Empty Value) / (Full Value - Empty Value)) x 100% */
67924 - di->rem_capacity = ((di->accum_current_uAh - di->empty_uAh) * 100L) /
67925 - (di->full_active_uAh - di->empty_uAh);
67926 + /* From Maxim Application Note 131: remaining capacity =
67927 + * ((ICA - Empty Value) / (Full Value - Empty Value)) x 100% */
67928 + di->rem_capacity = ((di->accum_current_uAh - di->empty_uAh) * 100L) /
67929 + (di->full_active_uAh - di->empty_uAh);
67930
67931 if (di->rem_capacity < 0)
67932 di->rem_capacity = 0;
67933 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/power/pcf50633-charger.c linux-2.6.29-rc3.owrt/drivers/power/pcf50633-charger.c
67934 --- linux-2.6.29.owrt/drivers/power/pcf50633-charger.c 2009-05-10 22:04:38.000000000 +0200
67935 +++ linux-2.6.29-rc3.owrt/drivers/power/pcf50633-charger.c 2009-05-10 23:48:29.000000000 +0200
67936 @@ -199,8 +199,7 @@
67937 enum power_supply_property psp,
67938 union power_supply_propval *val)
67939 {
67940 - struct pcf50633_mbc *mbc = container_of(psy,
67941 - struct pcf50633_mbc, adapter);
67942 + struct pcf50633_mbc *mbc = container_of(psy, struct pcf50633_mbc, usb);
67943 int ret = 0;
67944
67945 switch (psp) {
67946 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/regulator/bq24022.c linux-2.6.29-rc3.owrt/drivers/regulator/bq24022.c
67947 --- linux-2.6.29.owrt/drivers/regulator/bq24022.c 2009-05-10 22:04:38.000000000 +0200
67948 +++ linux-2.6.29-rc3.owrt/drivers/regulator/bq24022.c 2009-05-10 23:48:29.000000000 +0200
67949 @@ -152,7 +152,11 @@
67950 platform_driver_unregister(&bq24022_driver);
67951 }
67952
67953 -module_init(bq24022_init);
67954 +/*
67955 + * make sure this is probed before gpio_vbus and pda_power,
67956 + * but after asic3 or other GPIO expander drivers.
67957 + */
67958 +subsys_initcall(bq24022_init);
67959 module_exit(bq24022_exit);
67960
67961 MODULE_AUTHOR("Philipp Zabel");
67962 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/regulator/wm8350-regulator.c linux-2.6.29-rc3.owrt/drivers/regulator/wm8350-regulator.c
67963 --- linux-2.6.29.owrt/drivers/regulator/wm8350-regulator.c 2009-05-10 22:04:38.000000000 +0200
67964 +++ linux-2.6.29-rc3.owrt/drivers/regulator/wm8350-regulator.c 2009-05-10 23:48:29.000000000 +0200
67965 @@ -1435,7 +1435,7 @@
67966 struct platform_device *pdev;
67967 int ret;
67968
67969 - if (lednum >= ARRAY_SIZE(wm8350->pmic.led) || lednum < 0) {
67970 + if (lednum > ARRAY_SIZE(wm8350->pmic.led) || lednum < 0) {
67971 dev_err(wm8350->dev, "Invalid LED index %d\n", lednum);
67972 return -ENODEV;
67973 }
67974 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/rtc/Kconfig linux-2.6.29-rc3.owrt/drivers/rtc/Kconfig
67975 --- linux-2.6.29.owrt/drivers/rtc/Kconfig 2009-05-10 22:04:38.000000000 +0200
67976 +++ linux-2.6.29-rc3.owrt/drivers/rtc/Kconfig 2009-05-10 23:48:29.000000000 +0200
67977 @@ -241,12 +241,6 @@
67978 If you say Y here you will get support for the
67979 watchdog timer in the ST M41T60 and M41T80 RTC chips series.
67980
67981 -config RTC_DRV_DM355EVM
67982 - tristate "TI DaVinci DM355 EVM RTC"
67983 - depends on MFD_DM355EVM_MSP
67984 - help
67985 - Supports the RTC firmware in the MSP430 on the DM355 EVM.
67986 -
67987 config RTC_DRV_TWL92330
67988 boolean "TI TWL92330/Menelaus"
67989 depends on MENELAUS
67990 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/rtc/Makefile linux-2.6.29-rc3.owrt/drivers/rtc/Makefile
67991 --- linux-2.6.29.owrt/drivers/rtc/Makefile 2009-05-10 22:04:38.000000000 +0200
67992 +++ linux-2.6.29-rc3.owrt/drivers/rtc/Makefile 2009-05-10 23:48:29.000000000 +0200
67993 @@ -23,7 +23,6 @@
67994 obj-$(CONFIG_RTC_DRV_AU1XXX) += rtc-au1xxx.o
67995 obj-$(CONFIG_RTC_DRV_BFIN) += rtc-bfin.o
67996 obj-$(CONFIG_RTC_DRV_CMOS) += rtc-cmos.o
67997 -obj-$(CONFIG_RTC_DRV_DM355EVM) += rtc-dm355evm.o
67998 obj-$(CONFIG_RTC_DRV_DS1216) += rtc-ds1216.o
67999 obj-$(CONFIG_RTC_DRV_DS1286) += rtc-ds1286.o
68000 obj-$(CONFIG_RTC_DRV_DS1302) += rtc-ds1302.o
68001 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/rtc/rtc-au1xxx.c linux-2.6.29-rc3.owrt/drivers/rtc/rtc-au1xxx.c
68002 --- linux-2.6.29.owrt/drivers/rtc/rtc-au1xxx.c 2009-05-10 22:04:38.000000000 +0200
68003 +++ linux-2.6.29-rc3.owrt/drivers/rtc/rtc-au1xxx.c 2009-05-10 23:48:29.000000000 +0200
68004 @@ -81,7 +81,7 @@
68005 if (au_readl(SYS_TOYTRIM) != 32767) {
68006 /* wait until hardware gives access to TRIM register */
68007 t = 0x00100000;
68008 - while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T0S) && --t)
68009 + while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T0S) && t--)
68010 msleep(1);
68011
68012 if (!t) {
68013 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/rtc/rtc-dm355evm.c linux-2.6.29-rc3.owrt/drivers/rtc/rtc-dm355evm.c
68014 --- linux-2.6.29.owrt/drivers/rtc/rtc-dm355evm.c 2009-05-10 22:04:38.000000000 +0200
68015 +++ linux-2.6.29-rc3.owrt/drivers/rtc/rtc-dm355evm.c 1970-01-01 01:00:00.000000000 +0100
68016 @@ -1,175 +0,0 @@
68017 -/*
68018 - * rtc-dm355evm.c - access battery-backed counter in MSP430 firmware
68019 - *
68020 - * Copyright (c) 2008 by David Brownell
68021 - *
68022 - * This program is free software; you can redistribute it and/or
68023 - * modify it under the terms of the GNU General Public License
68024 - * as published by the Free Software Foundation; either version
68025 - * 2 of the License, or (at your option) any later version.
68026 - */
68027 -#include <linux/kernel.h>
68028 -#include <linux/init.h>
68029 -#include <linux/rtc.h>
68030 -#include <linux/platform_device.h>
68031 -
68032 -#include <linux/i2c/dm355evm_msp.h>
68033 -
68034 -
68035 -/*
68036 - * The MSP430 firmware on the DM355 EVM uses a watch crystal to feed
68037 - * a 1 Hz counter. When a backup battery is supplied, that makes a
68038 - * reasonable RTC for applications where alarms and non-NTP drift
68039 - * compensation aren't important.
68040 - *
68041 - * The only real glitch is the inability to read or write all four
68042 - * counter bytes atomically: the count may increment in the middle
68043 - * of an operation, causing trouble when the LSB rolls over.
68044 - *
68045 - * This driver was tested with firmware revision A4.
68046 - */
68047 -union evm_time {
68048 - u8 bytes[4];
68049 - u32 value;
68050 -};
68051 -
68052 -static int dm355evm_rtc_read_time(struct device *dev, struct rtc_time *tm)
68053 -{
68054 - union evm_time time;
68055 - int status;
68056 - int tries = 0;
68057 -
68058 - do {
68059 - /*
68060 - * Read LSB(0) to MSB(3) bytes. Defend against the counter
68061 - * rolling over by re-reading until the value is stable,
68062 - * and assuming the four reads take at most a few seconds.
68063 - */
68064 - status = dm355evm_msp_read(DM355EVM_MSP_RTC_0);
68065 - if (status < 0)
68066 - return status;
68067 - if (tries && time.bytes[0] == status)
68068 - break;
68069 - time.bytes[0] = status;
68070 -
68071 - status = dm355evm_msp_read(DM355EVM_MSP_RTC_1);
68072 - if (status < 0)
68073 - return status;
68074 - if (tries && time.bytes[1] == status)
68075 - break;
68076 - time.bytes[1] = status;
68077 -
68078 - status = dm355evm_msp_read(DM355EVM_MSP_RTC_2);
68079 - if (status < 0)
68080 - return status;
68081 - if (tries && time.bytes[2] == status)
68082 - break;
68083 - time.bytes[2] = status;
68084 -
68085 - status = dm355evm_msp_read(DM355EVM_MSP_RTC_3);
68086 - if (status < 0)
68087 - return status;
68088 - if (tries && time.bytes[3] == status)
68089 - break;
68090 - time.bytes[3] = status;
68091 -
68092 - } while (++tries < 5);
68093 -
68094 - dev_dbg(dev, "read timestamp %08x\n", time.value);
68095 -
68096 - rtc_time_to_tm(le32_to_cpu(time.value), tm);
68097 - return 0;
68098 -}
68099 -
68100 -static int dm355evm_rtc_set_time(struct device *dev, struct rtc_time *tm)
68101 -{
68102 - union evm_time time;
68103 - unsigned long value;
68104 - int status;
68105 -
68106 - rtc_tm_to_time(tm, &value);
68107 - time.value = cpu_to_le32(value);
68108 -
68109 - dev_dbg(dev, "write timestamp %08x\n", time.value);
68110 -
68111 - /*
68112 - * REVISIT handle non-atomic writes ... maybe just retry until
68113 - * byte[1] sticks (no rollover)?
68114 - */
68115 - status = dm355evm_msp_write(time.bytes[0], DM355EVM_MSP_RTC_0);
68116 - if (status < 0)
68117 - return status;
68118 -
68119 - status = dm355evm_msp_write(time.bytes[1], DM355EVM_MSP_RTC_1);
68120 - if (status < 0)
68121 - return status;
68122 -
68123 - status = dm355evm_msp_write(time.bytes[2], DM355EVM_MSP_RTC_2);
68124 - if (status < 0)
68125 - return status;
68126 -
68127 - status = dm355evm_msp_write(time.bytes[3], DM355EVM_MSP_RTC_3);
68128 - if (status < 0)
68129 - return status;
68130 -
68131 - return 0;
68132 -}
68133 -
68134 -static struct rtc_class_ops dm355evm_rtc_ops = {
68135 - .read_time = dm355evm_rtc_read_time,
68136 - .set_time = dm355evm_rtc_set_time,
68137 -};
68138 -
68139 -/*----------------------------------------------------------------------*/
68140 -
68141 -static int __devinit dm355evm_rtc_probe(struct platform_device *pdev)
68142 -{
68143 - struct rtc_device *rtc;
68144 -
68145 - rtc = rtc_device_register(pdev->name,
68146 - &pdev->dev, &dm355evm_rtc_ops, THIS_MODULE);
68147 - if (IS_ERR(rtc)) {
68148 - dev_err(&pdev->dev, "can't register RTC device, err %ld\n",
68149 - PTR_ERR(rtc));
68150 - return PTR_ERR(rtc);
68151 - }
68152 - platform_set_drvdata(pdev, rtc);
68153 -
68154 - return 0;
68155 -}
68156 -
68157 -static int __devexit dm355evm_rtc_remove(struct platform_device *pdev)
68158 -{
68159 - struct rtc_device *rtc = platform_get_drvdata(pdev);
68160 -
68161 - rtc_device_unregister(rtc);
68162 - platform_set_drvdata(pdev, NULL);
68163 - return 0;
68164 -}
68165 -
68166 -/*
68167 - * I2C is used to talk to the MSP430, but this platform device is
68168 - * exposed by an MFD driver that manages I2C communications.
68169 - */
68170 -static struct platform_driver rtc_dm355evm_driver = {
68171 - .probe = dm355evm_rtc_probe,
68172 - .remove = __devexit_p(dm355evm_rtc_remove),
68173 - .driver = {
68174 - .owner = THIS_MODULE,
68175 - .name = "rtc-dm355evm",
68176 - },
68177 -};
68178 -
68179 -static int __init dm355evm_rtc_init(void)
68180 -{
68181 - return platform_driver_register(&rtc_dm355evm_driver);
68182 -}
68183 -module_init(dm355evm_rtc_init);
68184 -
68185 -static void __exit dm355evm_rtc_exit(void)
68186 -{
68187 - platform_driver_unregister(&rtc_dm355evm_driver);
68188 -}
68189 -module_exit(dm355evm_rtc_exit);
68190 -
68191 -MODULE_LICENSE("GPL");
68192 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/rtc/rtc-ds1390.c linux-2.6.29-rc3.owrt/drivers/rtc/rtc-ds1390.c
68193 --- linux-2.6.29.owrt/drivers/rtc/rtc-ds1390.c 2009-05-10 22:04:38.000000000 +0200
68194 +++ linux-2.6.29-rc3.owrt/drivers/rtc/rtc-ds1390.c 2009-05-10 23:48:29.000000000 +0200
68195 @@ -122,6 +122,7 @@
68196
68197 static int __devinit ds1390_probe(struct spi_device *spi)
68198 {
68199 + struct rtc_device *rtc;
68200 unsigned char tmp;
68201 struct ds1390 *chip;
68202 int res;
68203 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/rtc/rtc-pxa.c linux-2.6.29-rc3.owrt/drivers/rtc/rtc-pxa.c
68204 --- linux-2.6.29.owrt/drivers/rtc/rtc-pxa.c 2009-05-10 22:04:38.000000000 +0200
68205 +++ linux-2.6.29-rc3.owrt/drivers/rtc/rtc-pxa.c 2009-05-10 23:48:29.000000000 +0200
68206 @@ -485,7 +485,7 @@
68207 module_init(pxa_rtc_init);
68208 module_exit(pxa_rtc_exit);
68209
68210 -MODULE_AUTHOR("Robert Jarzmik <robert.jarzmik@free.fr>");
68211 +MODULE_AUTHOR("Robert Jarzmik");
68212 MODULE_DESCRIPTION("PXA27x/PXA3xx Realtime Clock Driver (RTC)");
68213 MODULE_LICENSE("GPL");
68214 MODULE_ALIAS("platform:pxa-rtc");
68215 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/s390/block/dasd.c linux-2.6.29-rc3.owrt/drivers/s390/block/dasd.c
68216 --- linux-2.6.29.owrt/drivers/s390/block/dasd.c 2009-05-10 22:04:38.000000000 +0200
68217 +++ linux-2.6.29-rc3.owrt/drivers/s390/block/dasd.c 2009-05-10 23:48:29.000000000 +0200
68218 @@ -57,8 +57,6 @@
68219 static void dasd_block_tasklet(struct dasd_block *);
68220 static void do_kick_device(struct work_struct *);
68221 static void dasd_return_cqr_cb(struct dasd_ccw_req *, void *);
68222 -static void dasd_device_timeout(unsigned long);
68223 -static void dasd_block_timeout(unsigned long);
68224
68225 /*
68226 * SECTION: Operations on the device structure.
68227 @@ -101,8 +99,6 @@
68228 (unsigned long) device);
68229 INIT_LIST_HEAD(&device->ccw_queue);
68230 init_timer(&device->timer);
68231 - device->timer.function = dasd_device_timeout;
68232 - device->timer.data = (unsigned long) device;
68233 INIT_WORK(&device->kick_work, do_kick_device);
68234 device->state = DASD_STATE_NEW;
68235 device->target = DASD_STATE_NEW;
68236 @@ -142,8 +138,6 @@
68237 INIT_LIST_HEAD(&block->ccw_queue);
68238 spin_lock_init(&block->queue_lock);
68239 init_timer(&block->timer);
68240 - block->timer.function = dasd_block_timeout;
68241 - block->timer.data = (unsigned long) block;
68242
68243 return block;
68244 }
68245 @@ -921,10 +915,19 @@
68246 */
68247 void dasd_device_set_timer(struct dasd_device *device, int expires)
68248 {
68249 - if (expires == 0)
68250 - del_timer(&device->timer);
68251 - else
68252 - mod_timer(&device->timer, jiffies + expires);
68253 + if (expires == 0) {
68254 + if (timer_pending(&device->timer))
68255 + del_timer(&device->timer);
68256 + return;
68257 + }
68258 + if (timer_pending(&device->timer)) {
68259 + if (mod_timer(&device->timer, jiffies + expires))
68260 + return;
68261 + }
68262 + device->timer.function = dasd_device_timeout;
68263 + device->timer.data = (unsigned long) device;
68264 + device->timer.expires = jiffies + expires;
68265 + add_timer(&device->timer);
68266 }
68267
68268 /*
68269 @@ -932,7 +935,8 @@
68270 */
68271 void dasd_device_clear_timer(struct dasd_device *device)
68272 {
68273 - del_timer(&device->timer);
68274 + if (timer_pending(&device->timer))
68275 + del_timer(&device->timer);
68276 }
68277
68278 static void dasd_handle_killed_request(struct ccw_device *cdev,
68279 @@ -1582,10 +1586,19 @@
68280 */
68281 void dasd_block_set_timer(struct dasd_block *block, int expires)
68282 {
68283 - if (expires == 0)
68284 - del_timer(&block->timer);
68285 - else
68286 - mod_timer(&block->timer, jiffies + expires);
68287 + if (expires == 0) {
68288 + if (timer_pending(&block->timer))
68289 + del_timer(&block->timer);
68290 + return;
68291 + }
68292 + if (timer_pending(&block->timer)) {
68293 + if (mod_timer(&block->timer, jiffies + expires))
68294 + return;
68295 + }
68296 + block->timer.function = dasd_block_timeout;
68297 + block->timer.data = (unsigned long) block;
68298 + block->timer.expires = jiffies + expires;
68299 + add_timer(&block->timer);
68300 }
68301
68302 /*
68303 @@ -1593,7 +1606,8 @@
68304 */
68305 void dasd_block_clear_timer(struct dasd_block *block)
68306 {
68307 - del_timer(&block->timer);
68308 + if (timer_pending(&block->timer))
68309 + del_timer(&block->timer);
68310 }
68311
68312 /*
68313 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/s390/block/dasd_devmap.c linux-2.6.29-rc3.owrt/drivers/s390/block/dasd_devmap.c
68314 --- linux-2.6.29.owrt/drivers/s390/block/dasd_devmap.c 2009-05-10 22:04:38.000000000 +0200
68315 +++ linux-2.6.29-rc3.owrt/drivers/s390/block/dasd_devmap.c 2009-05-10 23:48:29.000000000 +0200
68316 @@ -677,7 +677,7 @@
68317 struct dasd_devmap *devmap;
68318 int ff_flag;
68319
68320 - devmap = dasd_find_busid(dev_name(dev));
68321 + devmap = dasd_find_busid(dev->bus_id);
68322 if (!IS_ERR(devmap))
68323 ff_flag = (devmap->features & DASD_FEATURE_FAILFAST) != 0;
68324 else
68325 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/s390/char/sclp.c linux-2.6.29-rc3.owrt/drivers/s390/char/sclp.c
68326 --- linux-2.6.29.owrt/drivers/s390/char/sclp.c 2009-05-10 22:04:38.000000000 +0200
68327 +++ linux-2.6.29-rc3.owrt/drivers/s390/char/sclp.c 2009-05-10 23:48:29.000000000 +0200
68328 @@ -280,11 +280,8 @@
68329 rc = 0;
68330 for (offset = sizeof(struct sccb_header); offset < sccb->length;
68331 offset += evbuf->length) {
68332 - evbuf = (struct evbuf_header *) ((addr_t) sccb + offset);
68333 - /* Check for malformed hardware response */
68334 - if (evbuf->length == 0)
68335 - break;
68336 /* Search for event handler */
68337 + evbuf = (struct evbuf_header *) ((addr_t) sccb + offset);
68338 reg = NULL;
68339 list_for_each(l, &sclp_reg_list) {
68340 reg = list_entry(l, struct sclp_register, list);
68341 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/s390/char/sclp_cmd.c linux-2.6.29-rc3.owrt/drivers/s390/char/sclp_cmd.c
68342 --- linux-2.6.29.owrt/drivers/s390/char/sclp_cmd.c 2009-05-10 22:04:38.000000000 +0200
68343 +++ linux-2.6.29-rc3.owrt/drivers/s390/char/sclp_cmd.c 2009-05-10 23:48:29.000000000 +0200
68344 @@ -19,7 +19,6 @@
68345 #include <linux/memory.h>
68346 #include <asm/chpid.h>
68347 #include <asm/sclp.h>
68348 -#include <asm/setup.h>
68349
68350 #include "sclp.h"
68351
68352 @@ -475,10 +474,6 @@
68353 goto skip_add;
68354 if (start + size > VMEM_MAX_PHYS)
68355 size = VMEM_MAX_PHYS - start;
68356 - if (memory_end_set && (start >= memory_end))
68357 - goto skip_add;
68358 - if (memory_end_set && (start + size > memory_end))
68359 - size = memory_end - start;
68360 add_memory(0, start, size);
68361 skip_add:
68362 first_rn = rn;
68363 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/sbus/char/bbc_i2c.c linux-2.6.29-rc3.owrt/drivers/sbus/char/bbc_i2c.c
68364 --- linux-2.6.29.owrt/drivers/sbus/char/bbc_i2c.c 2009-05-10 22:04:38.000000000 +0200
68365 +++ linux-2.6.29-rc3.owrt/drivers/sbus/char/bbc_i2c.c 2009-05-10 23:48:29.000000000 +0200
68366 @@ -129,7 +129,7 @@
68367 bp->waiting = 1;
68368 add_wait_queue(&bp->wq, &wait);
68369 while (limit-- > 0) {
68370 - long val;
68371 + unsigned long val;
68372
68373 val = wait_event_interruptible_timeout(
68374 bp->wq,
68375 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/sbus/char/jsflash.c linux-2.6.29-rc3.owrt/drivers/sbus/char/jsflash.c
68376 --- linux-2.6.29.owrt/drivers/sbus/char/jsflash.c 2009-05-10 22:04:38.000000000 +0200
68377 +++ linux-2.6.29-rc3.owrt/drivers/sbus/char/jsflash.c 2009-05-10 23:48:29.000000000 +0200
68378 @@ -38,6 +38,9 @@
68379 #include <linux/string.h>
68380 #include <linux/genhd.h>
68381 #include <linux/blkdev.h>
68382 +
68383 +#define MAJOR_NR JSFD_MAJOR
68384 +
68385 #include <asm/uaccess.h>
68386 #include <asm/pgtable.h>
68387 #include <asm/io.h>
68388 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/sbus/char/openprom.c linux-2.6.29-rc3.owrt/drivers/sbus/char/openprom.c
68389 --- linux-2.6.29.owrt/drivers/sbus/char/openprom.c 2009-05-10 22:04:38.000000000 +0200
68390 +++ linux-2.6.29-rc3.owrt/drivers/sbus/char/openprom.c 2009-05-10 23:48:29.000000000 +0200
68391 @@ -51,7 +51,6 @@
68392 MODULE_DESCRIPTION("OPENPROM Configuration Driver");
68393 MODULE_LICENSE("GPL");
68394 MODULE_VERSION("1.0");
68395 -MODULE_ALIAS_MISCDEV(SUN_OPENPROM_MINOR);
68396
68397 /* Private data kept by the driver for each descriptor. */
68398 typedef struct openprom_private_data
68399 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/cxgb3i/cxgb3i_ddp.c linux-2.6.29-rc3.owrt/drivers/scsi/cxgb3i/cxgb3i_ddp.c
68400 --- linux-2.6.29.owrt/drivers/scsi/cxgb3i/cxgb3i_ddp.c 2009-05-10 22:04:39.000000000 +0200
68401 +++ linux-2.6.29-rc3.owrt/drivers/scsi/cxgb3i/cxgb3i_ddp.c 2009-05-10 23:48:29.000000000 +0200
68402 @@ -639,11 +639,10 @@
68403 write_unlock(&cxgb3i_ddp_rwlock);
68404
68405 ddp_log_info("nppods %u (0x%x ~ 0x%x), bits %u, mask 0x%x,0x%x "
68406 - "pkt %u/%u, %u/%u.\n",
68407 + "pkt %u,%u.\n",
68408 ppmax, ddp->llimit, ddp->ulimit, ddp->idx_bits,
68409 ddp->idx_mask, ddp->rsvd_tag_mask,
68410 - ddp->max_txsz, uinfo.max_txsz,
68411 - ddp->max_rxsz, uinfo.max_rxsz);
68412 + ddp->max_txsz, ddp->max_rxsz);
68413 return 0;
68414
68415 free_ddp_map:
68416 @@ -655,8 +654,8 @@
68417 * cxgb3i_adapter_ddp_init - initialize the adapter's ddp resource
68418 * @tdev: t3cdev adapter
68419 * @tformat: tag format
68420 - * @txsz: max tx pdu payload size, filled in by this func.
68421 - * @rxsz: max rx pdu payload size, filled in by this func.
68422 + * @txsz: max tx pkt size, filled in by this func.
68423 + * @rxsz: max rx pkt size, filled in by this func.
68424 * initialize the ddp pagepod manager for a given adapter if needed and
68425 * setup the tag format for a given iscsi entity
68426 */
68427 @@ -686,12 +685,10 @@
68428 tformat->sw_bits, tformat->rsvd_bits,
68429 tformat->rsvd_shift, tformat->rsvd_mask);
68430
68431 - *txsz = min_t(unsigned int, ULP2_MAX_PDU_PAYLOAD,
68432 - ddp->max_txsz - ISCSI_PDU_NONPAYLOAD_LEN);
68433 - *rxsz = min_t(unsigned int, ULP2_MAX_PDU_PAYLOAD,
68434 - ddp->max_rxsz - ISCSI_PDU_NONPAYLOAD_LEN);
68435 - ddp_log_info("max payload size: %u/%u, %u/%u.\n",
68436 - *txsz, ddp->max_txsz, *rxsz, ddp->max_rxsz);
68437 + *txsz = ddp->max_txsz;
68438 + *rxsz = ddp->max_rxsz;
68439 + ddp_log_info("ddp max pkt size: %u, %u.\n",
68440 + ddp->max_txsz, ddp->max_rxsz);
68441 return 0;
68442 }
68443 EXPORT_SYMBOL_GPL(cxgb3i_adapter_ddp_init);
68444 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/cxgb3i/cxgb3i_ddp.h linux-2.6.29-rc3.owrt/drivers/scsi/cxgb3i/cxgb3i_ddp.h
68445 --- linux-2.6.29.owrt/drivers/scsi/cxgb3i/cxgb3i_ddp.h 2009-05-10 22:04:39.000000000 +0200
68446 +++ linux-2.6.29-rc3.owrt/drivers/scsi/cxgb3i/cxgb3i_ddp.h 2009-05-10 23:48:29.000000000 +0200
68447 @@ -13,8 +13,6 @@
68448 #ifndef __CXGB3I_ULP2_DDP_H__
68449 #define __CXGB3I_ULP2_DDP_H__
68450
68451 -#include <linux/vmalloc.h>
68452 -
68453 /**
68454 * struct cxgb3i_tag_format - cxgb3i ulp tag format for an iscsi entity
68455 *
68456 @@ -87,9 +85,8 @@
68457 struct sk_buff **gl_skb;
68458 };
68459
68460 -#define ISCSI_PDU_NONPAYLOAD_LEN 312 /* bhs(48) + ahs(256) + digest(8) */
68461 #define ULP2_MAX_PKT_SIZE 16224
68462 -#define ULP2_MAX_PDU_PAYLOAD (ULP2_MAX_PKT_SIZE - ISCSI_PDU_NONPAYLOAD_LEN)
68463 +#define ULP2_MAX_PDU_PAYLOAD (ULP2_MAX_PKT_SIZE - ISCSI_PDU_NONPAYLOAD_MAX)
68464 #define PPOD_PAGES_MAX 4
68465 #define PPOD_PAGES_SHIFT 2 /* 4 pages per pod */
68466
68467 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/cxgb3i/cxgb3i.h linux-2.6.29-rc3.owrt/drivers/scsi/cxgb3i/cxgb3i.h
68468 --- linux-2.6.29.owrt/drivers/scsi/cxgb3i/cxgb3i.h 2009-05-10 22:04:39.000000000 +0200
68469 +++ linux-2.6.29-rc3.owrt/drivers/scsi/cxgb3i/cxgb3i.h 2009-05-10 23:48:29.000000000 +0200
68470 @@ -20,7 +20,6 @@
68471 #include <linux/list.h>
68472 #include <linux/netdevice.h>
68473 #include <linux/scatterlist.h>
68474 -#include <linux/skbuff.h>
68475 #include <scsi/libiscsi_tcp.h>
68476
68477 /* from cxgb3 LLD */
68478 @@ -114,26 +113,6 @@
68479 struct cxgb3i_conn *cconn;
68480 };
68481
68482 -/**
68483 - * struct cxgb3i_task_data - private iscsi task data
68484 - *
68485 - * @nr_frags: # of coalesced page frags (from scsi sgl)
68486 - * @frags: coalesced page frags (from scsi sgl)
68487 - * @skb: tx pdu skb
68488 - * @offset: data offset for the next pdu
68489 - * @count: max. possible pdu payload
68490 - * @sgoffset: offset to the first sg entry for a given offset
68491 - */
68492 -#define MAX_PDU_FRAGS ((ULP2_MAX_PDU_PAYLOAD + 512 - 1) / 512)
68493 -struct cxgb3i_task_data {
68494 - unsigned short nr_frags;
68495 - skb_frag_t frags[MAX_PDU_FRAGS];
68496 - struct sk_buff *skb;
68497 - unsigned int offset;
68498 - unsigned int count;
68499 - unsigned int sgoffset;
68500 -};
68501 -
68502 int cxgb3i_iscsi_init(void);
68503 void cxgb3i_iscsi_cleanup(void);
68504
68505 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/cxgb3i/cxgb3i_init.c linux-2.6.29-rc3.owrt/drivers/scsi/cxgb3i/cxgb3i_init.c
68506 --- linux-2.6.29.owrt/drivers/scsi/cxgb3i/cxgb3i_init.c 2009-05-10 22:04:39.000000000 +0200
68507 +++ linux-2.6.29-rc3.owrt/drivers/scsi/cxgb3i/cxgb3i_init.c 2009-05-10 23:48:29.000000000 +0200
68508 @@ -12,8 +12,8 @@
68509 #include "cxgb3i.h"
68510
68511 #define DRV_MODULE_NAME "cxgb3i"
68512 -#define DRV_MODULE_VERSION "1.0.1"
68513 -#define DRV_MODULE_RELDATE "Jan. 2009"
68514 +#define DRV_MODULE_VERSION "1.0.0"
68515 +#define DRV_MODULE_RELDATE "Jun. 1, 2008"
68516
68517 static char version[] =
68518 "Chelsio S3xx iSCSI Driver " DRV_MODULE_NAME
68519 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/cxgb3i/cxgb3i_iscsi.c linux-2.6.29-rc3.owrt/drivers/scsi/cxgb3i/cxgb3i_iscsi.c
68520 --- linux-2.6.29.owrt/drivers/scsi/cxgb3i/cxgb3i_iscsi.c 2009-05-10 22:04:39.000000000 +0200
68521 +++ linux-2.6.29-rc3.owrt/drivers/scsi/cxgb3i/cxgb3i_iscsi.c 2009-05-10 23:48:29.000000000 +0200
68522 @@ -364,8 +364,7 @@
68523
68524 cls_session = iscsi_session_setup(&cxgb3i_iscsi_transport, shost,
68525 cmds_max,
68526 - sizeof(struct iscsi_tcp_task) +
68527 - sizeof(struct cxgb3i_task_data),
68528 + sizeof(struct iscsi_tcp_task),
68529 initial_cmdsn, ISCSI_MAX_TARGET);
68530 if (!cls_session)
68531 return NULL;
68532 @@ -403,15 +402,17 @@
68533 {
68534 struct iscsi_tcp_conn *tcp_conn = conn->dd_data;
68535 struct cxgb3i_conn *cconn = tcp_conn->dd_data;
68536 - unsigned int max = max(512 * MAX_SKB_FRAGS, SKB_TX_HEADROOM);
68537 + unsigned int max = min_t(unsigned int, ULP2_MAX_PDU_PAYLOAD,
68538 + cconn->hba->snic->tx_max_size -
68539 + ISCSI_PDU_NONPAYLOAD_MAX);
68540
68541 - max = min(cconn->hba->snic->tx_max_size, max);
68542 if (conn->max_xmit_dlength)
68543 - conn->max_xmit_dlength = min(conn->max_xmit_dlength, max);
68544 + conn->max_xmit_dlength = min_t(unsigned int,
68545 + conn->max_xmit_dlength, max);
68546 else
68547 conn->max_xmit_dlength = max;
68548 align_pdu_size(conn->max_xmit_dlength);
68549 - cxgb3i_api_debug("conn 0x%p, max xmit %u.\n",
68550 + cxgb3i_log_info("conn 0x%p, max xmit %u.\n",
68551 conn, conn->max_xmit_dlength);
68552 return 0;
68553 }
68554 @@ -426,7 +427,9 @@
68555 {
68556 struct iscsi_tcp_conn *tcp_conn = conn->dd_data;
68557 struct cxgb3i_conn *cconn = tcp_conn->dd_data;
68558 - unsigned int max = cconn->hba->snic->rx_max_size;
68559 + unsigned int max = min_t(unsigned int, ULP2_MAX_PDU_PAYLOAD,
68560 + cconn->hba->snic->rx_max_size -
68561 + ISCSI_PDU_NONPAYLOAD_MAX);
68562
68563 align_pdu_size(max);
68564 if (conn->max_recv_dlength) {
68565 @@ -436,7 +439,8 @@
68566 conn->max_recv_dlength, max);
68567 return -EINVAL;
68568 }
68569 - conn->max_recv_dlength = min(conn->max_recv_dlength, max);
68570 + conn->max_recv_dlength = min_t(unsigned int,
68571 + conn->max_recv_dlength, max);
68572 align_pdu_size(conn->max_recv_dlength);
68573 } else
68574 conn->max_recv_dlength = max;
68575 @@ -840,7 +844,7 @@
68576 .proc_name = "cxgb3i",
68577 .queuecommand = iscsi_queuecommand,
68578 .change_queue_depth = iscsi_change_queue_depth,
68579 - .can_queue = CXGB3I_SCSI_QDEPTH_DFLT - 1,
68580 + .can_queue = 128 * (ISCSI_DEF_XMIT_CMDS_MAX - 1),
68581 .sg_tablesize = SG_ALL,
68582 .max_sectors = 0xFFFF,
68583 .cmd_per_lun = ISCSI_DEF_CMD_PER_LUN,
68584 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/cxgb3i/cxgb3i_offload.c linux-2.6.29-rc3.owrt/drivers/scsi/cxgb3i/cxgb3i_offload.c
68585 --- linux-2.6.29.owrt/drivers/scsi/cxgb3i/cxgb3i_offload.c 2009-05-10 22:04:39.000000000 +0200
68586 +++ linux-2.6.29-rc3.owrt/drivers/scsi/cxgb3i/cxgb3i_offload.c 2009-05-10 23:48:29.000000000 +0200
68587 @@ -23,19 +23,19 @@
68588 #include "cxgb3i_ddp.h"
68589
68590 #ifdef __DEBUG_C3CN_CONN__
68591 -#define c3cn_conn_debug cxgb3i_log_debug
68592 +#define c3cn_conn_debug cxgb3i_log_info
68593 #else
68594 #define c3cn_conn_debug(fmt...)
68595 #endif
68596
68597 #ifdef __DEBUG_C3CN_TX__
68598 -#define c3cn_tx_debug cxgb3i_log_debug
68599 +#define c3cn_tx_debug cxgb3i_log_debug
68600 #else
68601 #define c3cn_tx_debug(fmt...)
68602 #endif
68603
68604 #ifdef __DEBUG_C3CN_RX__
68605 -#define c3cn_rx_debug cxgb3i_log_debug
68606 +#define c3cn_rx_debug cxgb3i_log_debug
68607 #else
68608 #define c3cn_rx_debug(fmt...)
68609 #endif
68610 @@ -47,9 +47,9 @@
68611 module_param(cxgb3_rcv_win, int, 0644);
68612 MODULE_PARM_DESC(cxgb3_rcv_win, "TCP receive window in bytes (default=256KB)");
68613
68614 -static int cxgb3_snd_win = 128 * 1024;
68615 +static int cxgb3_snd_win = 64 * 1024;
68616 module_param(cxgb3_snd_win, int, 0644);
68617 -MODULE_PARM_DESC(cxgb3_snd_win, "TCP send window in bytes (default=128KB)");
68618 +MODULE_PARM_DESC(cxgb3_snd_win, "TCP send window in bytes (default=64KB)");
68619
68620 static int cxgb3_rx_credit_thres = 10 * 1024;
68621 module_param(cxgb3_rx_credit_thres, int, 0644);
68622 @@ -301,8 +301,8 @@
68623 static void skb_entail(struct s3_conn *c3cn, struct sk_buff *skb,
68624 int flags)
68625 {
68626 - skb_tcp_seq(skb) = c3cn->write_seq;
68627 - skb_flags(skb) = flags;
68628 + CXGB3_SKB_CB(skb)->seq = c3cn->write_seq;
68629 + CXGB3_SKB_CB(skb)->flags = flags;
68630 __skb_queue_tail(&c3cn->write_queue, skb);
68631 }
68632
68633 @@ -457,9 +457,12 @@
68634 * The number of WRs needed for an skb depends on the number of fragments
68635 * in the skb and whether it has any payload in its main body. This maps the
68636 * length of the gather list represented by an skb into the # of necessary WRs.
68637 - * The extra two fragments are for iscsi bhs and payload padding.
68638 + *
68639 + * The max. length of an skb is controlled by the max pdu size which is ~16K.
68640 + * Also, assume the min. fragment length is the sector size (512), then add
68641 + * extra fragment counts for iscsi bhs and payload padding.
68642 */
68643 -#define SKB_WR_LIST_SIZE (MAX_SKB_FRAGS + 2)
68644 +#define SKB_WR_LIST_SIZE (16384/512 + 3)
68645 static unsigned int skb_wrs[SKB_WR_LIST_SIZE] __read_mostly;
68646
68647 static void s3_init_wr_tab(unsigned int wr_len)
68648 @@ -482,7 +485,7 @@
68649
68650 static inline void reset_wr_list(struct s3_conn *c3cn)
68651 {
68652 - c3cn->wr_pending_head = c3cn->wr_pending_tail = NULL;
68653 + c3cn->wr_pending_head = NULL;
68654 }
68655
68656 /*
68657 @@ -493,7 +496,7 @@
68658 static inline void enqueue_wr(struct s3_conn *c3cn,
68659 struct sk_buff *skb)
68660 {
68661 - skb_tx_wr_next(skb) = NULL;
68662 + skb_wr_data(skb) = NULL;
68663
68664 /*
68665 * We want to take an extra reference since both us and the driver
68666 @@ -506,22 +509,10 @@
68667 if (!c3cn->wr_pending_head)
68668 c3cn->wr_pending_head = skb;
68669 else
68670 - skb_tx_wr_next(c3cn->wr_pending_tail) = skb;
68671 + skb_wr_data(skb) = skb;
68672 c3cn->wr_pending_tail = skb;
68673 }
68674
68675 -static int count_pending_wrs(struct s3_conn *c3cn)
68676 -{
68677 - int n = 0;
68678 - const struct sk_buff *skb = c3cn->wr_pending_head;
68679 -
68680 - while (skb) {
68681 - n += skb->csum;
68682 - skb = skb_tx_wr_next(skb);
68683 - }
68684 - return n;
68685 -}
68686 -
68687 static inline struct sk_buff *peek_wr(const struct s3_conn *c3cn)
68688 {
68689 return c3cn->wr_pending_head;
68690 @@ -538,8 +529,8 @@
68691
68692 if (likely(skb)) {
68693 /* Don't bother clearing the tail */
68694 - c3cn->wr_pending_head = skb_tx_wr_next(skb);
68695 - skb_tx_wr_next(skb) = NULL;
68696 + c3cn->wr_pending_head = skb_wr_data(skb);
68697 + skb_wr_data(skb) = NULL;
68698 }
68699 return skb;
68700 }
68701 @@ -552,14 +543,13 @@
68702 }
68703
68704 static inline void make_tx_data_wr(struct s3_conn *c3cn, struct sk_buff *skb,
68705 - int len, int req_completion)
68706 + int len)
68707 {
68708 struct tx_data_wr *req;
68709
68710 skb_reset_transport_header(skb);
68711 req = (struct tx_data_wr *)__skb_push(skb, sizeof(*req));
68712 - req->wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_TX_DATA) |
68713 - (req_completion ? F_WR_COMPL : 0));
68714 + req->wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_TX_DATA));
68715 req->wr_lo = htonl(V_WR_TID(c3cn->tid));
68716 req->sndseq = htonl(c3cn->snd_nxt);
68717 /* len includes the length of any HW ULP additions */
68718 @@ -602,7 +592,7 @@
68719
68720 if (unlikely(c3cn->state == C3CN_STATE_CONNECTING ||
68721 c3cn->state == C3CN_STATE_CLOSE_WAIT_1 ||
68722 - c3cn->state >= C3CN_STATE_ABORTING)) {
68723 + c3cn->state == C3CN_STATE_ABORTING)) {
68724 c3cn_tx_debug("c3cn 0x%p, in closing state %u.\n",
68725 c3cn, c3cn->state);
68726 return 0;
68727 @@ -625,7 +615,7 @@
68728 if (c3cn->wr_avail < wrs_needed) {
68729 c3cn_tx_debug("c3cn 0x%p, skb len %u/%u, frag %u, "
68730 "wr %d < %u.\n",
68731 - c3cn, skb->len, skb->data_len, frags,
68732 + c3cn, skb->len, skb->datalen, frags,
68733 wrs_needed, c3cn->wr_avail);
68734 break;
68735 }
68736 @@ -637,24 +627,20 @@
68737 c3cn->wr_unacked += wrs_needed;
68738 enqueue_wr(c3cn, skb);
68739
68740 - c3cn_tx_debug("c3cn 0x%p, enqueue, skb len %u/%u, frag %u, "
68741 - "wr %d, left %u, unack %u.\n",
68742 - c3cn, skb->len, skb->data_len, frags,
68743 - wrs_needed, c3cn->wr_avail, c3cn->wr_unacked);
68744 -
68745 + if (likely(CXGB3_SKB_CB(skb)->flags & C3CB_FLAG_NEED_HDR)) {
68746 + len += ulp_extra_len(skb);
68747 + make_tx_data_wr(c3cn, skb, len);
68748 + c3cn->snd_nxt += len;
68749 + if ((req_completion
68750 + && c3cn->wr_unacked == wrs_needed)
68751 + || (CXGB3_SKB_CB(skb)->flags & C3CB_FLAG_COMPL)
68752 + || c3cn->wr_unacked >= c3cn->wr_max / 2) {
68753 + struct work_request_hdr *wr = cplhdr(skb);
68754
68755 - if (likely(skb_flags(skb) & C3CB_FLAG_NEED_HDR)) {
68756 - if ((req_completion &&
68757 - c3cn->wr_unacked == wrs_needed) ||
68758 - (skb_flags(skb) & C3CB_FLAG_COMPL) ||
68759 - c3cn->wr_unacked >= c3cn->wr_max / 2) {
68760 - req_completion = 1;
68761 + wr->wr_hi |= htonl(F_WR_COMPL);
68762 c3cn->wr_unacked = 0;
68763 }
68764 - len += ulp_extra_len(skb);
68765 - make_tx_data_wr(c3cn, skb, len, req_completion);
68766 - c3cn->snd_nxt += len;
68767 - skb_flags(skb) &= ~C3CB_FLAG_NEED_HDR;
68768 + CXGB3_SKB_CB(skb)->flags &= ~C3CB_FLAG_NEED_HDR;
68769 }
68770
68771 total_size += skb->truesize;
68772 @@ -749,11 +735,8 @@
68773 if (unlikely(c3cn_flag(c3cn, C3CN_ACTIVE_CLOSE_NEEDED)))
68774 /* upper layer has requested closing */
68775 send_abort_req(c3cn);
68776 - else {
68777 - if (skb_queue_len(&c3cn->write_queue))
68778 - c3cn_push_tx_frames(c3cn, 1);
68779 + else if (c3cn_push_tx_frames(c3cn, 1))
68780 cxgb3i_conn_tx_open(c3cn);
68781 - }
68782 }
68783
68784 static int do_act_establish(struct t3cdev *cdev, struct sk_buff *skb,
68785 @@ -1099,8 +1082,8 @@
68786 return;
68787 }
68788
68789 - skb_tcp_seq(skb) = ntohl(hdr_cpl->seq);
68790 - skb_flags(skb) = 0;
68791 + CXGB3_SKB_CB(skb)->seq = ntohl(hdr_cpl->seq);
68792 + CXGB3_SKB_CB(skb)->flags = 0;
68793
68794 skb_reset_transport_header(skb);
68795 __skb_pull(skb, sizeof(struct cpl_iscsi_hdr));
68796 @@ -1120,12 +1103,12 @@
68797 goto abort_conn;
68798
68799 skb_ulp_mode(skb) = ULP2_FLAG_DATA_READY;
68800 - skb_rx_pdulen(skb) = ntohs(ddp_cpl.len);
68801 - skb_rx_ddigest(skb) = ntohl(ddp_cpl.ulp_crc);
68802 + skb_ulp_pdulen(skb) = ntohs(ddp_cpl.len);
68803 + skb_ulp_ddigest(skb) = ntohl(ddp_cpl.ulp_crc);
68804 status = ntohl(ddp_cpl.ddp_status);
68805
68806 c3cn_rx_debug("rx skb 0x%p, len %u, pdulen %u, ddp status 0x%x.\n",
68807 - skb, skb->len, skb_rx_pdulen(skb), status);
68808 + skb, skb->len, skb_ulp_pdulen(skb), status);
68809
68810 if (status & (1 << RX_DDP_STATUS_HCRC_SHIFT))
68811 skb_ulp_mode(skb) |= ULP2_FLAG_HCRC_ERROR;
68812 @@ -1143,7 +1126,7 @@
68813 } else if (status & (1 << RX_DDP_STATUS_DDP_SHIFT))
68814 skb_ulp_mode(skb) |= ULP2_FLAG_DATA_DDPED;
68815
68816 - c3cn->rcv_nxt = ntohl(ddp_cpl.seq) + skb_rx_pdulen(skb);
68817 + c3cn->rcv_nxt = ntohl(ddp_cpl.seq) + skb_ulp_pdulen(skb);
68818 __pskb_trim(skb, len);
68819 __skb_queue_tail(&c3cn->receive_queue, skb);
68820 cxgb3i_conn_pdu_ready(c3cn);
68821 @@ -1168,27 +1151,12 @@
68822 * Process an acknowledgment of WR completion. Advance snd_una and send the
68823 * next batch of work requests from the write queue.
68824 */
68825 -static void check_wr_invariants(struct s3_conn *c3cn)
68826 -{
68827 - int pending = count_pending_wrs(c3cn);
68828 -
68829 - if (unlikely(c3cn->wr_avail + pending != c3cn->wr_max))
68830 - cxgb3i_log_error("TID %u: credit imbalance: avail %u, "
68831 - "pending %u, total should be %u\n",
68832 - c3cn->tid, c3cn->wr_avail, pending,
68833 - c3cn->wr_max);
68834 -}
68835 -
68836 static void process_wr_ack(struct s3_conn *c3cn, struct sk_buff *skb)
68837 {
68838 struct cpl_wr_ack *hdr = cplhdr(skb);
68839 unsigned int credits = ntohs(hdr->credits);
68840 u32 snd_una = ntohl(hdr->snd_una);
68841
68842 - c3cn_tx_debug("%u WR credits, avail %u, unack %u, TID %u, state %u.\n",
68843 - credits, c3cn->wr_avail, c3cn->wr_unacked,
68844 - c3cn->tid, c3cn->state);
68845 -
68846 c3cn->wr_avail += credits;
68847 if (c3cn->wr_unacked > c3cn->wr_max - c3cn->wr_avail)
68848 c3cn->wr_unacked = c3cn->wr_max - c3cn->wr_avail;
68849 @@ -1203,17 +1171,6 @@
68850 break;
68851 }
68852 if (unlikely(credits < p->csum)) {
68853 - struct tx_data_wr *w = cplhdr(p);
68854 - cxgb3i_log_error("TID %u got %u WR credits need %u, "
68855 - "len %u, main body %u, frags %u, "
68856 - "seq # %u, ACK una %u, ACK nxt %u, "
68857 - "WR_AVAIL %u, WRs pending %u\n",
68858 - c3cn->tid, credits, p->csum, p->len,
68859 - p->len - p->data_len,
68860 - skb_shinfo(p)->nr_frags,
68861 - ntohl(w->sndseq), snd_una,
68862 - ntohl(hdr->snd_nxt), c3cn->wr_avail,
68863 - count_pending_wrs(c3cn) - credits);
68864 p->csum -= credits;
68865 break;
68866 } else {
68867 @@ -1223,24 +1180,15 @@
68868 }
68869 }
68870
68871 - check_wr_invariants(c3cn);
68872 -
68873 - if (unlikely(before(snd_una, c3cn->snd_una))) {
68874 - cxgb3i_log_error("TID %u, unexpected sequence # %u in WR_ACK "
68875 - "snd_una %u\n",
68876 - c3cn->tid, snd_una, c3cn->snd_una);
68877 + if (unlikely(before(snd_una, c3cn->snd_una)))
68878 goto out_free;
68879 - }
68880
68881 if (c3cn->snd_una != snd_una) {
68882 c3cn->snd_una = snd_una;
68883 dst_confirm(c3cn->dst_cache);
68884 }
68885
68886 - if (skb_queue_len(&c3cn->write_queue)) {
68887 - if (c3cn_push_tx_frames(c3cn, 0))
68888 - cxgb3i_conn_tx_open(c3cn);
68889 - } else
68890 + if (skb_queue_len(&c3cn->write_queue) && c3cn_push_tx_frames(c3cn, 0))
68891 cxgb3i_conn_tx_open(c3cn);
68892 out_free:
68893 __kfree_skb(skb);
68894 @@ -1504,7 +1452,7 @@
68895 struct dst_entry *dst)
68896 {
68897 BUG_ON(c3cn->cdev != cdev);
68898 - c3cn->wr_max = c3cn->wr_avail = T3C_DATA(cdev)->max_wrs - 1;
68899 + c3cn->wr_max = c3cn->wr_avail = T3C_DATA(cdev)->max_wrs;
68900 c3cn->wr_unacked = 0;
68901 c3cn->mss_idx = select_mss(c3cn, dst_mtu(dst));
68902
68903 @@ -1723,17 +1671,9 @@
68904 goto out_err;
68905 }
68906
68907 + err = -EPIPE;
68908 if (c3cn->err) {
68909 c3cn_tx_debug("c3cn 0x%p, err %d.\n", c3cn, c3cn->err);
68910 - err = -EPIPE;
68911 - goto out_err;
68912 - }
68913 -
68914 - if (c3cn->write_seq - c3cn->snd_una >= cxgb3_snd_win) {
68915 - c3cn_tx_debug("c3cn 0x%p, snd %u - %u > %u.\n",
68916 - c3cn, c3cn->write_seq, c3cn->snd_una,
68917 - cxgb3_snd_win);
68918 - err = -EAGAIN;
68919 goto out_err;
68920 }
68921
68922 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/cxgb3i/cxgb3i_offload.h linux-2.6.29-rc3.owrt/drivers/scsi/cxgb3i/cxgb3i_offload.h
68923 --- linux-2.6.29.owrt/drivers/scsi/cxgb3i/cxgb3i_offload.h 2009-05-10 22:04:39.000000000 +0200
68924 +++ linux-2.6.29-rc3.owrt/drivers/scsi/cxgb3i/cxgb3i_offload.h 2009-05-10 23:48:29.000000000 +0200
68925 @@ -178,33 +178,25 @@
68926 * @flag: see C3CB_FLAG_* below
68927 * @ulp_mode: ULP mode/submode of sk_buff
68928 * @seq: tcp sequence number
68929 + * @ddigest: pdu data digest
68930 + * @pdulen: recovered pdu length
68931 + * @wr_data: scratch area for tx wr
68932 */
68933 -struct cxgb3_skb_rx_cb {
68934 - __u32 ddigest; /* data digest */
68935 - __u32 pdulen; /* recovered pdu length */
68936 -};
68937 -
68938 -struct cxgb3_skb_tx_cb {
68939 - struct sk_buff *wr_next; /* next wr */
68940 -};
68941 -
68942 struct cxgb3_skb_cb {
68943 __u8 flags;
68944 __u8 ulp_mode;
68945 __u32 seq;
68946 - union {
68947 - struct cxgb3_skb_rx_cb rx;
68948 - struct cxgb3_skb_tx_cb tx;
68949 - };
68950 + __u32 ddigest;
68951 + __u32 pdulen;
68952 + struct sk_buff *wr_data;
68953 };
68954
68955 #define CXGB3_SKB_CB(skb) ((struct cxgb3_skb_cb *)&((skb)->cb[0]))
68956 -#define skb_flags(skb) (CXGB3_SKB_CB(skb)->flags)
68957 +
68958 #define skb_ulp_mode(skb) (CXGB3_SKB_CB(skb)->ulp_mode)
68959 -#define skb_tcp_seq(skb) (CXGB3_SKB_CB(skb)->seq)
68960 -#define skb_rx_ddigest(skb) (CXGB3_SKB_CB(skb)->rx.ddigest)
68961 -#define skb_rx_pdulen(skb) (CXGB3_SKB_CB(skb)->rx.pdulen)
68962 -#define skb_tx_wr_next(skb) (CXGB3_SKB_CB(skb)->tx.wr_next)
68963 +#define skb_ulp_ddigest(skb) (CXGB3_SKB_CB(skb)->ddigest)
68964 +#define skb_ulp_pdulen(skb) (CXGB3_SKB_CB(skb)->pdulen)
68965 +#define skb_wr_data(skb) (CXGB3_SKB_CB(skb)->wr_data)
68966
68967 enum c3cb_flags {
68968 C3CB_FLAG_NEED_HDR = 1 << 0, /* packet needs a TX_DATA_WR header */
68969 @@ -225,7 +217,6 @@
68970 /* for TX: a skb must have a headroom of at least TX_HEADER_LEN bytes */
68971 #define TX_HEADER_LEN \
68972 (sizeof(struct tx_data_wr) + sizeof(struct sge_opaque_hdr))
68973 -#define SKB_TX_HEADROOM SKB_MAX_HEAD(TX_HEADER_LEN)
68974
68975 /*
68976 * get and set private ip for iscsi traffic
68977 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/cxgb3i/cxgb3i_pdu.c linux-2.6.29-rc3.owrt/drivers/scsi/cxgb3i/cxgb3i_pdu.c
68978 --- linux-2.6.29.owrt/drivers/scsi/cxgb3i/cxgb3i_pdu.c 2009-05-10 22:04:39.000000000 +0200
68979 +++ linux-2.6.29-rc3.owrt/drivers/scsi/cxgb3i/cxgb3i_pdu.c 2009-05-10 23:48:29.000000000 +0200
68980 @@ -32,10 +32,6 @@
68981 #define cxgb3i_tx_debug(fmt...)
68982 #endif
68983
68984 -/* always allocate rooms for AHS */
68985 -#define SKB_TX_PDU_HEADER_LEN \
68986 - (sizeof(struct iscsi_hdr) + ISCSI_MAX_AHS_SIZE)
68987 -static unsigned int skb_extra_headroom;
68988 static struct page *pad_page;
68989
68990 /*
68991 @@ -150,13 +146,12 @@
68992
68993 void cxgb3i_conn_cleanup_task(struct iscsi_task *task)
68994 {
68995 - struct cxgb3i_task_data *tdata = task->dd_data +
68996 - sizeof(struct iscsi_tcp_task);
68997 + struct iscsi_tcp_task *tcp_task = task->dd_data;
68998
68999 /* never reached the xmit task callout */
69000 - if (tdata->skb)
69001 - __kfree_skb(tdata->skb);
69002 - memset(tdata, 0, sizeof(struct cxgb3i_task_data));
69003 + if (tcp_task->dd_data)
69004 + kfree_skb(tcp_task->dd_data);
69005 + tcp_task->dd_data = NULL;
69006
69007 /* MNC - Do we need a check in case this is called but
69008 * cxgb3i_conn_alloc_pdu has never been called on the task */
69009 @@ -164,102 +159,28 @@
69010 iscsi_tcp_cleanup_task(task);
69011 }
69012
69013 -static int sgl_seek_offset(struct scatterlist *sgl, unsigned int sgcnt,
69014 - unsigned int offset, unsigned int *off,
69015 - struct scatterlist **sgp)
69016 -{
69017 - int i;
69018 - struct scatterlist *sg;
69019 -
69020 - for_each_sg(sgl, sg, sgcnt, i) {
69021 - if (offset < sg->length) {
69022 - *off = offset;
69023 - *sgp = sg;
69024 - return 0;
69025 - }
69026 - offset -= sg->length;
69027 - }
69028 - return -EFAULT;
69029 -}
69030 -
69031 -static int sgl_read_to_frags(struct scatterlist *sg, unsigned int sgoffset,
69032 - unsigned int dlen, skb_frag_t *frags,
69033 - int frag_max)
69034 -{
69035 - unsigned int datalen = dlen;
69036 - unsigned int sglen = sg->length - sgoffset;
69037 - struct page *page = sg_page(sg);
69038 - int i;
69039 -
69040 - i = 0;
69041 - do {
69042 - unsigned int copy;
69043 -
69044 - if (!sglen) {
69045 - sg = sg_next(sg);
69046 - if (!sg) {
69047 - cxgb3i_log_error("%s, sg NULL, len %u/%u.\n",
69048 - __func__, datalen, dlen);
69049 - return -EINVAL;
69050 - }
69051 - sgoffset = 0;
69052 - sglen = sg->length;
69053 - page = sg_page(sg);
69054 -
69055 - }
69056 - copy = min(datalen, sglen);
69057 - if (i && page == frags[i - 1].page &&
69058 - sgoffset + sg->offset ==
69059 - frags[i - 1].page_offset + frags[i - 1].size) {
69060 - frags[i - 1].size += copy;
69061 - } else {
69062 - if (i >= frag_max) {
69063 - cxgb3i_log_error("%s, too many pages %u, "
69064 - "dlen %u.\n", __func__,
69065 - frag_max, dlen);
69066 - return -EINVAL;
69067 - }
69068 -
69069 - frags[i].page = page;
69070 - frags[i].page_offset = sg->offset + sgoffset;
69071 - frags[i].size = copy;
69072 - i++;
69073 - }
69074 - datalen -= copy;
69075 - sgoffset += copy;
69076 - sglen -= copy;
69077 - } while (datalen);
69078 -
69079 - return i;
69080 -}
69081 -
69082 +/*
69083 + * We do not support ahs yet
69084 + */
69085 int cxgb3i_conn_alloc_pdu(struct iscsi_task *task, u8 opcode)
69086 {
69087 - struct iscsi_conn *conn = task->conn;
69088 struct iscsi_tcp_task *tcp_task = task->dd_data;
69089 - struct cxgb3i_task_data *tdata = task->dd_data + sizeof(*tcp_task);
69090 - struct scsi_cmnd *sc = task->sc;
69091 - int headroom = SKB_TX_PDU_HEADER_LEN;
69092 + struct sk_buff *skb;
69093
69094 - tcp_task->dd_data = tdata;
69095 task->hdr = NULL;
69096 -
69097 - /* write command, need to send data pdus */
69098 - if (skb_extra_headroom && (opcode == ISCSI_OP_SCSI_DATA_OUT ||
69099 - (opcode == ISCSI_OP_SCSI_CMD &&
69100 - (scsi_bidi_cmnd(sc) || sc->sc_data_direction == DMA_TO_DEVICE))))
69101 - headroom += min(skb_extra_headroom, conn->max_xmit_dlength);
69102 -
69103 - tdata->skb = alloc_skb(TX_HEADER_LEN + headroom, GFP_ATOMIC);
69104 - if (!tdata->skb)
69105 + /* always allocate rooms for AHS */
69106 + skb = alloc_skb(sizeof(struct iscsi_hdr) + ISCSI_MAX_AHS_SIZE +
69107 + TX_HEADER_LEN, GFP_ATOMIC);
69108 + if (!skb)
69109 return -ENOMEM;
69110 - skb_reserve(tdata->skb, TX_HEADER_LEN);
69111
69112 cxgb3i_tx_debug("task 0x%p, opcode 0x%x, skb 0x%p.\n",
69113 - task, opcode, tdata->skb);
69114 + task, opcode, skb);
69115
69116 - task->hdr = (struct iscsi_hdr *)tdata->skb->data;
69117 - task->hdr_max = SKB_TX_PDU_HEADER_LEN;
69118 + tcp_task->dd_data = skb;
69119 + skb_reserve(skb, TX_HEADER_LEN);
69120 + task->hdr = (struct iscsi_hdr *)skb->data;
69121 + task->hdr_max = sizeof(struct iscsi_hdr);
69122
69123 /* data_out uses scsi_cmd's itt */
69124 if (opcode != ISCSI_OP_SCSI_DATA_OUT)
69125 @@ -271,13 +192,13 @@
69126 int cxgb3i_conn_init_pdu(struct iscsi_task *task, unsigned int offset,
69127 unsigned int count)
69128 {
69129 - struct iscsi_conn *conn = task->conn;
69130 struct iscsi_tcp_task *tcp_task = task->dd_data;
69131 - struct cxgb3i_task_data *tdata = tcp_task->dd_data;
69132 - struct sk_buff *skb = tdata->skb;
69133 + struct sk_buff *skb = tcp_task->dd_data;
69134 + struct iscsi_conn *conn = task->conn;
69135 + struct page *pg;
69136 unsigned int datalen = count;
69137 int i, padlen = iscsi_padding(count);
69138 - struct page *pg;
69139 + skb_frag_t *frag;
69140
69141 cxgb3i_tx_debug("task 0x%p,0x%p, offset %u, count %u, skb 0x%p.\n",
69142 task, task->sc, offset, count, skb);
69143 @@ -288,94 +209,90 @@
69144 return 0;
69145
69146 if (task->sc) {
69147 - struct scsi_data_buffer *sdb = scsi_out(task->sc);
69148 - struct scatterlist *sg = NULL;
69149 - int err;
69150 -
69151 - tdata->offset = offset;
69152 - tdata->count = count;
69153 - err = sgl_seek_offset(sdb->table.sgl, sdb->table.nents,
69154 - tdata->offset, &tdata->sgoffset, &sg);
69155 - if (err < 0) {
69156 - cxgb3i_log_warn("tpdu, sgl %u, bad offset %u/%u.\n",
69157 - sdb->table.nents, tdata->offset,
69158 - sdb->length);
69159 - return err;
69160 + struct scatterlist *sg;
69161 + struct scsi_data_buffer *sdb;
69162 + unsigned int sgoffset = offset;
69163 + struct page *sgpg;
69164 + unsigned int sglen;
69165 +
69166 + sdb = scsi_out(task->sc);
69167 + sg = sdb->table.sgl;
69168 +
69169 + for_each_sg(sdb->table.sgl, sg, sdb->table.nents, i) {
69170 + cxgb3i_tx_debug("sg %d, page 0x%p, len %u offset %u\n",
69171 + i, sg_page(sg), sg->length, sg->offset);
69172 +
69173 + if (sgoffset < sg->length)
69174 + break;
69175 + sgoffset -= sg->length;
69176 }
69177 - err = sgl_read_to_frags(sg, tdata->sgoffset, tdata->count,
69178 - tdata->frags, MAX_PDU_FRAGS);
69179 - if (err < 0) {
69180 - cxgb3i_log_warn("tpdu, sgl %u, bad offset %u + %u.\n",
69181 - sdb->table.nents, tdata->offset,
69182 - tdata->count);
69183 - return err;
69184 - }
69185 - tdata->nr_frags = err;
69186 + sgpg = sg_page(sg);
69187 + sglen = sg->length - sgoffset;
69188
69189 - if (tdata->nr_frags > MAX_SKB_FRAGS ||
69190 - (padlen && tdata->nr_frags == MAX_SKB_FRAGS)) {
69191 - char *dst = skb->data + task->hdr_len;
69192 - skb_frag_t *frag = tdata->frags;
69193 -
69194 - /* data fits in the skb's headroom */
69195 - for (i = 0; i < tdata->nr_frags; i++, frag++) {
69196 - char *src = kmap_atomic(frag->page,
69197 - KM_SOFTIRQ0);
69198 -
69199 - memcpy(dst, src+frag->page_offset, frag->size);
69200 - dst += frag->size;
69201 - kunmap_atomic(src, KM_SOFTIRQ0);
69202 + do {
69203 + int j = skb_shinfo(skb)->nr_frags;
69204 + unsigned int copy;
69205 +
69206 + if (!sglen) {
69207 + sg = sg_next(sg);
69208 + sgpg = sg_page(sg);
69209 + sgoffset = 0;
69210 + sglen = sg->length;
69211 + ++i;
69212 }
69213 - if (padlen) {
69214 - memset(dst, 0, padlen);
69215 - padlen = 0;
69216 + copy = min(sglen, datalen);
69217 + if (j && skb_can_coalesce(skb, j, sgpg,
69218 + sg->offset + sgoffset)) {
69219 + skb_shinfo(skb)->frags[j - 1].size += copy;
69220 + } else {
69221 + get_page(sgpg);
69222 + skb_fill_page_desc(skb, j, sgpg,
69223 + sg->offset + sgoffset, copy);
69224 }
69225 - skb_put(skb, count + padlen);
69226 - } else {
69227 - /* data fit into frag_list */
69228 - for (i = 0; i < tdata->nr_frags; i++)
69229 - get_page(tdata->frags[i].page);
69230 -
69231 - memcpy(skb_shinfo(skb)->frags, tdata->frags,
69232 - sizeof(skb_frag_t) * tdata->nr_frags);
69233 - skb_shinfo(skb)->nr_frags = tdata->nr_frags;
69234 - skb->len += count;
69235 - skb->data_len += count;
69236 - skb->truesize += count;
69237 - }
69238 -
69239 + sgoffset += copy;
69240 + sglen -= copy;
69241 + datalen -= copy;
69242 + } while (datalen);
69243 } else {
69244 pg = virt_to_page(task->data);
69245
69246 - get_page(pg);
69247 - skb_fill_page_desc(skb, 0, pg, offset_in_page(task->data),
69248 - count);
69249 - skb->len += count;
69250 - skb->data_len += count;
69251 - skb->truesize += count;
69252 + while (datalen) {
69253 + i = skb_shinfo(skb)->nr_frags;
69254 + frag = &skb_shinfo(skb)->frags[i];
69255 +
69256 + get_page(pg);
69257 + frag->page = pg;
69258 + frag->page_offset = 0;
69259 + frag->size = min((unsigned int)PAGE_SIZE, datalen);
69260 +
69261 + skb_shinfo(skb)->nr_frags++;
69262 + datalen -= frag->size;
69263 + pg++;
69264 + }
69265 }
69266
69267 if (padlen) {
69268 i = skb_shinfo(skb)->nr_frags;
69269 - get_page(pad_page);
69270 - skb_fill_page_desc(skb, skb_shinfo(skb)->nr_frags, pad_page, 0,
69271 - padlen);
69272 -
69273 - skb->data_len += padlen;
69274 - skb->truesize += padlen;
69275 - skb->len += padlen;
69276 + frag = &skb_shinfo(skb)->frags[i];
69277 + frag->page = pad_page;
69278 + frag->page_offset = 0;
69279 + frag->size = padlen;
69280 + skb_shinfo(skb)->nr_frags++;
69281 }
69282
69283 + datalen = count + padlen;
69284 + skb->data_len += datalen;
69285 + skb->truesize += datalen;
69286 + skb->len += datalen;
69287 return 0;
69288 }
69289
69290 int cxgb3i_conn_xmit_pdu(struct iscsi_task *task)
69291 {
69292 + struct iscsi_tcp_task *tcp_task = task->dd_data;
69293 + struct sk_buff *skb = tcp_task->dd_data;
69294 struct iscsi_tcp_conn *tcp_conn = task->conn->dd_data;
69295 struct cxgb3i_conn *cconn = tcp_conn->dd_data;
69296 - struct iscsi_tcp_task *tcp_task = task->dd_data;
69297 - struct cxgb3i_task_data *tdata = tcp_task->dd_data;
69298 - struct sk_buff *skb = tdata->skb;
69299 unsigned int datalen;
69300 int err;
69301
69302 @@ -383,13 +300,12 @@
69303 return 0;
69304
69305 datalen = skb->data_len;
69306 - tdata->skb = NULL;
69307 + tcp_task->dd_data = NULL;
69308 err = cxgb3i_c3cn_send_pdus(cconn->cep->c3cn, skb);
69309 - if (err > 0) {
69310 - int pdulen = err;
69311 -
69312 cxgb3i_tx_debug("task 0x%p, skb 0x%p, len %u/%u, rv %d.\n",
69313 task, skb, skb->len, skb->data_len, err);
69314 + if (err > 0) {
69315 + int pdulen = err;
69316
69317 if (task->conn->hdrdgst_en)
69318 pdulen += ISCSI_DIGEST_SIZE;
69319 @@ -409,14 +325,12 @@
69320 return err;
69321 }
69322 /* reset skb to send when we are called again */
69323 - tdata->skb = skb;
69324 + tcp_task->dd_data = skb;
69325 return -EAGAIN;
69326 }
69327
69328 int cxgb3i_pdu_init(void)
69329 {
69330 - if (SKB_TX_HEADROOM > (512 * MAX_SKB_FRAGS))
69331 - skb_extra_headroom = SKB_TX_HEADROOM;
69332 pad_page = alloc_page(GFP_KERNEL);
69333 if (!pad_page)
69334 return -ENOMEM;
69335 @@ -452,9 +366,7 @@
69336 skb = skb_peek(&c3cn->receive_queue);
69337 while (!err && skb) {
69338 __skb_unlink(skb, &c3cn->receive_queue);
69339 - read += skb_rx_pdulen(skb);
69340 - cxgb3i_rx_debug("conn 0x%p, cn 0x%p, rx skb 0x%p, pdulen %u.\n",
69341 - conn, c3cn, skb, skb_rx_pdulen(skb));
69342 + read += skb_ulp_pdulen(skb);
69343 err = cxgb3i_conn_read_pdu_skb(conn, skb);
69344 __kfree_skb(skb);
69345 skb = skb_peek(&c3cn->receive_queue);
69346 @@ -465,11 +377,6 @@
69347 cxgb3i_c3cn_rx_credits(c3cn, read);
69348 }
69349 conn->rxdata_octets += read;
69350 -
69351 - if (err) {
69352 - cxgb3i_log_info("conn 0x%p rx failed err %d.\n", conn, err);
69353 - iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED);
69354 - }
69355 }
69356
69357 void cxgb3i_conn_tx_open(struct s3_conn *c3cn)
69358 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/cxgb3i/cxgb3i_pdu.h linux-2.6.29-rc3.owrt/drivers/scsi/cxgb3i/cxgb3i_pdu.h
69359 --- linux-2.6.29.owrt/drivers/scsi/cxgb3i/cxgb3i_pdu.h 2009-05-10 22:04:39.000000000 +0200
69360 +++ linux-2.6.29-rc3.owrt/drivers/scsi/cxgb3i/cxgb3i_pdu.h 2009-05-10 23:48:29.000000000 +0200
69361 @@ -53,7 +53,7 @@
69362 #define ULP2_FLAG_DCRC_ERROR 0x20
69363 #define ULP2_FLAG_PAD_ERROR 0x40
69364
69365 -void cxgb3i_conn_closing(struct s3_conn *c3cn);
69366 +void cxgb3i_conn_closing(struct s3_conn *);
69367 void cxgb3i_conn_pdu_ready(struct s3_conn *c3cn);
69368 void cxgb3i_conn_tx_open(struct s3_conn *c3cn);
69369 #endif
69370 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/fcoe/fcoe_sw.c linux-2.6.29-rc3.owrt/drivers/scsi/fcoe/fcoe_sw.c
69371 --- linux-2.6.29.owrt/drivers/scsi/fcoe/fcoe_sw.c 2009-05-10 22:04:39.000000000 +0200
69372 +++ linux-2.6.29-rc3.owrt/drivers/scsi/fcoe/fcoe_sw.c 2009-05-10 23:48:29.000000000 +0200
69373 @@ -104,19 +104,19 @@
69374 .max_sectors = 0xffff,
69375 };
69376
69377 -/**
69378 - * fcoe_sw_lport_config() - sets up the fc_lport
69379 +/*
69380 + * fcoe_sw_lport_config - sets up the fc_lport
69381 * @lp: ptr to the fc_lport
69382 * @shost: ptr to the parent scsi host
69383 *
69384 * Returns: 0 for success
69385 + *
69386 */
69387 static int fcoe_sw_lport_config(struct fc_lport *lp)
69388 {
69389 int i = 0;
69390
69391 - lp->link_up = 0;
69392 - lp->qfull = 0;
69393 + lp->link_status = 0;
69394 lp->max_retry_count = 3;
69395 lp->e_d_tov = 2 * 1000; /* FC-FS default */
69396 lp->r_a_tov = 2 * 2 * 1000;
69397 @@ -136,14 +136,16 @@
69398 return 0;
69399 }
69400
69401 -/**
69402 - * fcoe_sw_netdev_config() - Set up netdev for SW FCoE
69403 +/*
69404 + * fcoe_sw_netdev_config - sets up fcoe_softc for lport and network
69405 + * related properties
69406 * @lp : ptr to the fc_lport
69407 * @netdev : ptr to the associated netdevice struct
69408 *
69409 * Must be called after fcoe_sw_lport_config() as it will use lport mutex
69410 *
69411 * Returns : 0 for success
69412 + *
69413 */
69414 static int fcoe_sw_netdev_config(struct fc_lport *lp, struct net_device *netdev)
69415 {
69416 @@ -179,8 +181,9 @@
69417 if (fc_set_mfs(lp, mfs))
69418 return -EINVAL;
69419
69420 + lp->link_status = ~FC_PAUSE & ~FC_LINK_UP;
69421 if (!fcoe_link_ok(lp))
69422 - lp->link_up = 1;
69423 + lp->link_status |= FC_LINK_UP;
69424
69425 /* offload features support */
69426 if (fc->real_dev->features & NETIF_F_SG)
69427 @@ -188,7 +191,6 @@
69428
69429
69430 skb_queue_head_init(&fc->fcoe_pending_queue);
69431 - fc->fcoe_pending_queue_active = 0;
69432
69433 /* setup Source Mac Address */
69434 memcpy(fc->ctl_src_addr, fc->real_dev->dev_addr,
69435 @@ -222,15 +224,16 @@
69436 return 0;
69437 }
69438
69439 -/**
69440 - * fcoe_sw_shost_config() - Sets up fc_lport->host
69441 +/*
69442 + * fcoe_sw_shost_config - sets up fc_lport->host
69443 * @lp : ptr to the fc_lport
69444 * @shost : ptr to the associated scsi host
69445 * @dev : device associated to scsi host
69446 *
69447 - * Must be called after fcoe_sw_lport_config() and fcoe_sw_netdev_config()
69448 + * Must be called after fcoe_sw_lport_config) and fcoe_sw_netdev_config()
69449 *
69450 * Returns : 0 for success
69451 + *
69452 */
69453 static int fcoe_sw_shost_config(struct fc_lport *lp, struct Scsi_Host *shost,
69454 struct device *dev)
69455 @@ -258,8 +261,8 @@
69456 return 0;
69457 }
69458
69459 -/**
69460 - * fcoe_sw_em_config() - allocates em for this lport
69461 +/*
69462 + * fcoe_sw_em_config - allocates em for this lport
69463 * @lp: the port that em is to allocated for
69464 *
69465 * Returns : 0 on success
69466 @@ -276,8 +279,8 @@
69467 return 0;
69468 }
69469
69470 -/**
69471 - * fcoe_sw_destroy() - FCoE software HBA tear-down function
69472 +/*
69473 + * fcoe_sw_destroy - FCoE software HBA tear-down function
69474 * @netdev: ptr to the associated net_device
69475 *
69476 * Returns: 0 if link is OK for use by FCoE.
69477 @@ -298,7 +301,7 @@
69478 if (!lp)
69479 return -ENODEV;
69480
69481 - fc = lport_priv(lp);
69482 + fc = fcoe_softc(lp);
69483
69484 /* Logout of the fabric */
69485 fc_fabric_logoff(lp);
69486 @@ -350,8 +353,8 @@
69487 .frame_send = fcoe_xmit,
69488 };
69489
69490 -/**
69491 - * fcoe_sw_create() - this function creates the fcoe interface
69492 +/*
69493 + * fcoe_sw_create - this function creates the fcoe interface
69494 * @netdev: pointer the associated netdevice
69495 *
69496 * Creates fc_lport struct and scsi_host for lport, configures lport
69497 @@ -437,8 +440,8 @@
69498 return rc;
69499 }
69500
69501 -/**
69502 - * fcoe_sw_match() - The FCoE SW transport match function
69503 +/*
69504 + * fcoe_sw_match - the fcoe sw transport match function
69505 *
69506 * Returns : false always
69507 */
69508 @@ -458,8 +461,8 @@
69509 .device = 0xffff,
69510 };
69511
69512 -/**
69513 - * fcoe_sw_init() - Registers fcoe_sw_transport
69514 +/*
69515 + * fcoe_sw_init - registers fcoe_sw_transport
69516 *
69517 * Returns : 0 on success
69518 */
69519 @@ -468,22 +471,17 @@
69520 /* attach to scsi transport */
69521 scsi_transport_fcoe_sw =
69522 fc_attach_transport(&fcoe_sw_transport_function);
69523 -
69524 if (!scsi_transport_fcoe_sw) {
69525 printk(KERN_ERR "fcoe_sw_init:fc_attach_transport() failed\n");
69526 return -ENODEV;
69527 }
69528 -
69529 - mutex_init(&fcoe_sw_transport.devlock);
69530 - INIT_LIST_HEAD(&fcoe_sw_transport.devlist);
69531 -
69532 /* register sw transport */
69533 fcoe_transport_register(&fcoe_sw_transport);
69534 return 0;
69535 }
69536
69537 -/**
69538 - * fcoe_sw_exit() - Unregisters fcoe_sw_transport
69539 +/*
69540 + * fcoe_sw_exit - unregisters fcoe_sw_transport
69541 *
69542 * Returns : 0 on success
69543 */
69544 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/fcoe/fc_transport_fcoe.c linux-2.6.29-rc3.owrt/drivers/scsi/fcoe/fc_transport_fcoe.c
69545 --- linux-2.6.29.owrt/drivers/scsi/fcoe/fc_transport_fcoe.c 2009-05-10 22:04:39.000000000 +0200
69546 +++ linux-2.6.29-rc3.owrt/drivers/scsi/fcoe/fc_transport_fcoe.c 2009-05-10 23:48:29.000000000 +0200
69547 @@ -33,19 +33,19 @@
69548 static DEFINE_MUTEX(fcoe_transports_lock);
69549
69550 /**
69551 - * fcoe_transport_default() - Returns ptr to the default transport fcoe_sw
69552 - */
69553 + * fcoe_transport_default - returns ptr to the default transport fcoe_sw
69554 + **/
69555 struct fcoe_transport *fcoe_transport_default(void)
69556 {
69557 return &fcoe_sw_transport;
69558 }
69559
69560 /**
69561 - * fcoe_transport_to_pcidev() - get the pci dev from a netdev
69562 + * fcoe_transport_to_pcidev - get the pci dev from a netdev
69563 * @netdev: the netdev that pci dev will be retrived from
69564 *
69565 * Returns: NULL or the corrsponding pci_dev
69566 - */
69567 + **/
69568 struct pci_dev *fcoe_transport_pcidev(const struct net_device *netdev)
69569 {
69570 if (!netdev->dev.parent)
69571 @@ -54,17 +54,18 @@
69572 }
69573
69574 /**
69575 - * fcoe_transport_device_lookup() - Lookup a transport
69576 + * fcoe_transport_device_lookup - find out netdev is managed by the
69577 + * transport
69578 + * assign a transport to a device
69579 * @netdev: the netdev the transport to be attached to
69580 *
69581 * This will look for existing offload driver, if not found, it falls back to
69582 * the default sw hba (fcoe_sw) as its fcoe transport.
69583 *
69584 * Returns: 0 for success
69585 - */
69586 -static struct fcoe_transport_internal *
69587 -fcoe_transport_device_lookup(struct fcoe_transport *t,
69588 - struct net_device *netdev)
69589 + **/
69590 +static struct fcoe_transport_internal *fcoe_transport_device_lookup(
69591 + struct fcoe_transport *t, struct net_device *netdev)
69592 {
69593 struct fcoe_transport_internal *ti;
69594
69595 @@ -80,14 +81,14 @@
69596 return NULL;
69597 }
69598 /**
69599 - * fcoe_transport_device_add() - Assign a transport to a device
69600 + * fcoe_transport_device_add - assign a transport to a device
69601 * @netdev: the netdev the transport to be attached to
69602 *
69603 * This will look for existing offload driver, if not found, it falls back to
69604 * the default sw hba (fcoe_sw) as its fcoe transport.
69605 *
69606 * Returns: 0 for success
69607 - */
69608 + **/
69609 static int fcoe_transport_device_add(struct fcoe_transport *t,
69610 struct net_device *netdev)
69611 {
69612 @@ -122,14 +123,14 @@
69613 }
69614
69615 /**
69616 - * fcoe_transport_device_remove() - Remove a device from its transport
69617 + * fcoe_transport_device_remove - remove a device from its transport
69618 * @netdev: the netdev the transport to be attached to
69619 *
69620 - * This removes the device from the transport so the given transport will
69621 + * this removes the device from the transport so the given transport will
69622 * not manage this device any more
69623 *
69624 * Returns: 0 for success
69625 - */
69626 + **/
69627 static int fcoe_transport_device_remove(struct fcoe_transport *t,
69628 struct net_device *netdev)
69629 {
69630 @@ -154,13 +155,13 @@
69631 }
69632
69633 /**
69634 - * fcoe_transport_device_remove_all() - Remove all from transport devlist
69635 + * fcoe_transport_device_remove_all - remove all from transport devlist
69636 *
69637 - * This removes the device from the transport so the given transport will
69638 + * this removes the device from the transport so the given transport will
69639 * not manage this device any more
69640 *
69641 * Returns: 0 for success
69642 - */
69643 + **/
69644 static void fcoe_transport_device_remove_all(struct fcoe_transport *t)
69645 {
69646 struct fcoe_transport_internal *ti, *tmp;
69647 @@ -174,18 +175,18 @@
69648 }
69649
69650 /**
69651 - * fcoe_transport_match() - Use the bus device match function to match the hw
69652 - * @t: The fcoe transport to check
69653 - * @netdev: The netdev to match against
69654 + * fcoe_transport_match - use the bus device match function to match the hw
69655 + * @t: the fcoe transport
69656 + * @netdev:
69657 *
69658 - * This function is used to check if the given transport wants to manage the
69659 + * This function is used to check if the givne transport wants to manage the
69660 * input netdev. if the transports implements the match function, it will be
69661 * called, o.w. we just compare the pci vendor and device id.
69662 *
69663 * Returns: true for match up
69664 - */
69665 + **/
69666 static bool fcoe_transport_match(struct fcoe_transport *t,
69667 - struct net_device *netdev)
69668 + struct net_device *netdev)
69669 {
69670 /* match transport by vendor and device id */
69671 struct pci_dev *pci;
69672 @@ -209,17 +210,17 @@
69673 }
69674
69675 /**
69676 - * fcoe_transport_lookup() - Check if the transport is already registered
69677 + * fcoe_transport_lookup - check if the transport is already registered
69678 * @t: the transport to be looked up
69679 *
69680 * This compares the parent device (pci) vendor and device id
69681 *
69682 * Returns: NULL if not found
69683 *
69684 - * TODO: return default sw transport if no other transport is found
69685 - */
69686 -static struct fcoe_transport *
69687 -fcoe_transport_lookup(struct net_device *netdev)
69688 + * TODO - return default sw transport if no other transport is found
69689 + **/
69690 +static struct fcoe_transport *fcoe_transport_lookup(
69691 + struct net_device *netdev)
69692 {
69693 struct fcoe_transport *t;
69694
69695 @@ -238,11 +239,11 @@
69696 }
69697
69698 /**
69699 - * fcoe_transport_register() - Adds a fcoe transport to the fcoe transports list
69700 + * fcoe_transport_register - adds a fcoe transport to the fcoe transports list
69701 * @t: ptr to the fcoe transport to be added
69702 *
69703 * Returns: 0 for success
69704 - */
69705 + **/
69706 int fcoe_transport_register(struct fcoe_transport *t)
69707 {
69708 struct fcoe_transport *tt;
69709 @@ -258,6 +259,9 @@
69710 list_add_tail(&t->list, &fcoe_transports);
69711 mutex_unlock(&fcoe_transports_lock);
69712
69713 + mutex_init(&t->devlock);
69714 + INIT_LIST_HEAD(&t->devlist);
69715 +
69716 printk(KERN_DEBUG "fcoe_transport_register:%s\n", t->name);
69717
69718 return 0;
69719 @@ -265,11 +269,11 @@
69720 EXPORT_SYMBOL_GPL(fcoe_transport_register);
69721
69722 /**
69723 - * fcoe_transport_unregister() - Remove the tranport fro the fcoe transports list
69724 + * fcoe_transport_unregister - remove the tranport fro the fcoe transports list
69725 * @t: ptr to the fcoe transport to be removed
69726 *
69727 * Returns: 0 for success
69728 - */
69729 + **/
69730 int fcoe_transport_unregister(struct fcoe_transport *t)
69731 {
69732 struct fcoe_transport *tt, *tmp;
69733 @@ -290,8 +294,8 @@
69734 }
69735 EXPORT_SYMBOL_GPL(fcoe_transport_unregister);
69736
69737 -/**
69738 - * fcoe_load_transport_driver() - Load an offload driver by alias name
69739 +/*
69740 + * fcoe_load_transport_driver - load an offload driver by alias name
69741 * @netdev: the target net device
69742 *
69743 * Requests for an offload driver module as the fcoe transport, if fails, it
69744 @@ -303,7 +307,7 @@
69745 * 3. pure hw fcoe hba may not have netdev
69746 *
69747 * Returns: 0 for success
69748 - */
69749 + **/
69750 int fcoe_load_transport_driver(struct net_device *netdev)
69751 {
69752 struct pci_dev *pci;
69753 @@ -331,14 +335,14 @@
69754 EXPORT_SYMBOL_GPL(fcoe_load_transport_driver);
69755
69756 /**
69757 - * fcoe_transport_attach() - Load transport to fcoe
69758 + * fcoe_transport_attach - load transport to fcoe
69759 * @netdev: the netdev the transport to be attached to
69760 *
69761 * This will look for existing offload driver, if not found, it falls back to
69762 * the default sw hba (fcoe_sw) as its fcoe transport.
69763 *
69764 * Returns: 0 for success
69765 - */
69766 + **/
69767 int fcoe_transport_attach(struct net_device *netdev)
69768 {
69769 struct fcoe_transport *t;
69770 @@ -369,11 +373,11 @@
69771 EXPORT_SYMBOL_GPL(fcoe_transport_attach);
69772
69773 /**
69774 - * fcoe_transport_release() - Unload transport from fcoe
69775 + * fcoe_transport_release - unload transport from fcoe
69776 * @netdev: the net device on which fcoe is to be released
69777 *
69778 * Returns: 0 for success
69779 - */
69780 + **/
69781 int fcoe_transport_release(struct net_device *netdev)
69782 {
69783 struct fcoe_transport *t;
69784 @@ -406,12 +410,12 @@
69785 EXPORT_SYMBOL_GPL(fcoe_transport_release);
69786
69787 /**
69788 - * fcoe_transport_init() - Initializes fcoe transport layer
69789 + * fcoe_transport_init - initializes fcoe transport layer
69790 *
69791 * This prepares for the fcoe transport layer
69792 *
69793 * Returns: none
69794 - */
69795 + **/
69796 int __init fcoe_transport_init(void)
69797 {
69798 INIT_LIST_HEAD(&fcoe_transports);
69799 @@ -420,13 +424,12 @@
69800 }
69801
69802 /**
69803 - * fcoe_transport_exit() - Cleans up the fcoe transport layer
69804 - *
69805 + * fcoe_transport_exit - cleans up the fcoe transport layer
69806 * This cleans up the fcoe transport layer. removing any transport on the list,
69807 * note that the transport destroy func is not called here.
69808 *
69809 * Returns: none
69810 - */
69811 + **/
69812 int __exit fcoe_transport_exit(void)
69813 {
69814 struct fcoe_transport *t, *tmp;
69815 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/fcoe/libfcoe.c linux-2.6.29-rc3.owrt/drivers/scsi/fcoe/libfcoe.c
69816 --- linux-2.6.29.owrt/drivers/scsi/fcoe/libfcoe.c 2009-05-10 22:04:39.000000000 +0200
69817 +++ linux-2.6.29-rc3.owrt/drivers/scsi/fcoe/libfcoe.c 2009-05-10 23:48:29.000000000 +0200
69818 @@ -49,7 +49,6 @@
69819 static int debug_fcoe;
69820
69821 #define FCOE_MAX_QUEUE_DEPTH 256
69822 -#define FCOE_LOW_QUEUE_DEPTH 32
69823
69824 /* destination address mode */
69825 #define FCOE_GW_ADDR_MODE 0x00
69826 @@ -70,6 +69,8 @@
69827
69828 /* Function Prototyes */
69829 static int fcoe_check_wait_queue(struct fc_lport *);
69830 +static void fcoe_insert_wait_queue_head(struct fc_lport *, struct sk_buff *);
69831 +static void fcoe_insert_wait_queue(struct fc_lport *, struct sk_buff *);
69832 static void fcoe_recv_flogi(struct fcoe_softc *, struct fc_frame *, u8 *);
69833 #ifdef CONFIG_HOTPLUG_CPU
69834 static int fcoe_cpu_callback(struct notifier_block *, ulong, void *);
69835 @@ -90,13 +91,13 @@
69836 };
69837
69838 /**
69839 - * fcoe_create_percpu_data() - creates the associated cpu data
69840 + * fcoe_create_percpu_data - creates the associated cpu data
69841 * @cpu: index for the cpu where fcoe cpu data will be created
69842 *
69843 * create percpu stats block, from cpu add notifier
69844 *
69845 * Returns: none
69846 - */
69847 + **/
69848 static void fcoe_create_percpu_data(int cpu)
69849 {
69850 struct fc_lport *lp;
69851 @@ -114,13 +115,13 @@
69852 }
69853
69854 /**
69855 - * fcoe_destroy_percpu_data() - destroys the associated cpu data
69856 + * fcoe_destroy_percpu_data - destroys the associated cpu data
69857 * @cpu: index for the cpu where fcoe cpu data will destroyed
69858 *
69859 * destroy percpu stats block called by cpu add/remove notifier
69860 *
69861 * Retuns: none
69862 - */
69863 + **/
69864 static void fcoe_destroy_percpu_data(int cpu)
69865 {
69866 struct fc_lport *lp;
69867 @@ -136,7 +137,7 @@
69868 }
69869
69870 /**
69871 - * fcoe_cpu_callback() - fcoe cpu hotplug event callback
69872 + * fcoe_cpu_callback - fcoe cpu hotplug event callback
69873 * @nfb: callback data block
69874 * @action: event triggering the callback
69875 * @hcpu: index for the cpu of this event
69876 @@ -144,7 +145,7 @@
69877 * this creates or destroys per cpu data for fcoe
69878 *
69879 * Returns NOTIFY_OK always.
69880 - */
69881 + **/
69882 static int fcoe_cpu_callback(struct notifier_block *nfb, unsigned long action,
69883 void *hcpu)
69884 {
69885 @@ -165,7 +166,7 @@
69886 #endif /* CONFIG_HOTPLUG_CPU */
69887
69888 /**
69889 - * fcoe_rcv() - this is the fcoe receive function called by NET_RX_SOFTIRQ
69890 + * fcoe_rcv - this is the fcoe receive function called by NET_RX_SOFTIRQ
69891 * @skb: the receive skb
69892 * @dev: associated net device
69893 * @ptype: context
69894 @@ -174,7 +175,7 @@
69895 * this function will receive the packet and build fc frame and pass it up
69896 *
69897 * Returns: 0 for success
69898 - */
69899 + **/
69900 int fcoe_rcv(struct sk_buff *skb, struct net_device *dev,
69901 struct packet_type *ptype, struct net_device *olddev)
69902 {
69903 @@ -264,11 +265,11 @@
69904 EXPORT_SYMBOL_GPL(fcoe_rcv);
69905
69906 /**
69907 - * fcoe_start_io() - pass to netdev to start xmit for fcoe
69908 + * fcoe_start_io - pass to netdev to start xmit for fcoe
69909 * @skb: the skb to be xmitted
69910 *
69911 * Returns: 0 for success
69912 - */
69913 + **/
69914 static inline int fcoe_start_io(struct sk_buff *skb)
69915 {
69916 int rc;
69917 @@ -282,12 +283,12 @@
69918 }
69919
69920 /**
69921 - * fcoe_get_paged_crc_eof() - in case we need alloc a page for crc_eof
69922 + * fcoe_get_paged_crc_eof - in case we need alloc a page for crc_eof
69923 * @skb: the skb to be xmitted
69924 * @tlen: total len
69925 *
69926 * Returns: 0 for success
69927 - */
69928 + **/
69929 static int fcoe_get_paged_crc_eof(struct sk_buff *skb, int tlen)
69930 {
69931 struct fcoe_percpu_s *fps;
69932 @@ -325,12 +326,13 @@
69933 }
69934
69935 /**
69936 - * fcoe_fc_crc() - calculates FC CRC in this fcoe skb
69937 + * fcoe_fc_crc - calculates FC CRC in this fcoe skb
69938 * @fp: the fc_frame containg data to be checksummed
69939 *
69940 * This uses crc32() to calculate the crc for fc frame
69941 * Return : 32 bit crc
69942 - */
69943 + *
69944 + **/
69945 u32 fcoe_fc_crc(struct fc_frame *fp)
69946 {
69947 struct sk_buff *skb = fp_skb(fp);
69948 @@ -361,12 +363,13 @@
69949 EXPORT_SYMBOL_GPL(fcoe_fc_crc);
69950
69951 /**
69952 - * fcoe_xmit() - FCoE frame transmit function
69953 + * fcoe_xmit - FCoE frame transmit function
69954 * @lp: the associated local port
69955 * @fp: the fc_frame to be transmitted
69956 *
69957 * Return : 0 for success
69958 - */
69959 + *
69960 + **/
69961 int fcoe_xmit(struct fc_lport *lp, struct fc_frame *fp)
69962 {
69963 int wlen, rc = 0;
69964 @@ -386,7 +389,7 @@
69965
69966 WARN_ON((fr_len(fp) % sizeof(u32)) != 0);
69967
69968 - fc = lport_priv(lp);
69969 + fc = fcoe_softc(lp);
69970 /*
69971 * if it is a flogi then we need to learn gw-addr
69972 * and my own fcid
69973 @@ -436,7 +439,7 @@
69974 if (skb_is_nonlinear(skb)) {
69975 skb_frag_t *frag;
69976 if (fcoe_get_paged_crc_eof(skb, tlen)) {
69977 - kfree_skb(skb);
69978 + kfree(skb);
69979 return -ENOMEM;
69980 }
69981 frag = &skb_shinfo(skb)->frags[skb_shinfo(skb)->nr_frags - 1];
69982 @@ -499,22 +502,21 @@
69983 rc = fcoe_start_io(skb);
69984
69985 if (rc) {
69986 - spin_lock_bh(&fc->fcoe_pending_queue.lock);
69987 - __skb_queue_tail(&fc->fcoe_pending_queue, skb);
69988 - spin_unlock_bh(&fc->fcoe_pending_queue.lock);
69989 + fcoe_insert_wait_queue(lp, skb);
69990 if (fc->fcoe_pending_queue.qlen > FCOE_MAX_QUEUE_DEPTH)
69991 - lp->qfull = 1;
69992 + fc_pause(lp);
69993 }
69994
69995 return 0;
69996 }
69997 EXPORT_SYMBOL_GPL(fcoe_xmit);
69998
69999 -/**
70000 - * fcoe_percpu_receive_thread() - recv thread per cpu
70001 +/*
70002 + * fcoe_percpu_receive_thread - recv thread per cpu
70003 * @arg: ptr to the fcoe per cpu struct
70004 *
70005 * Return: 0 for success
70006 + *
70007 */
70008 int fcoe_percpu_receive_thread(void *arg)
70009 {
70010 @@ -531,7 +533,7 @@
70011 struct fcoe_softc *fc;
70012 struct fcoe_hdr *hp;
70013
70014 - set_user_nice(current, -20);
70015 + set_user_nice(current, 19);
70016
70017 while (!kthread_should_stop()) {
70018
70019 @@ -656,7 +658,7 @@
70020 }
70021
70022 /**
70023 - * fcoe_recv_flogi() - flogi receive function
70024 + * fcoe_recv_flogi - flogi receive function
70025 * @fc: associated fcoe_softc
70026 * @fp: the recieved frame
70027 * @sa: the source address of this flogi
70028 @@ -665,7 +667,7 @@
70029 * mac address for the initiator, eitehr OUI based or GW based.
70030 *
70031 * Returns: none
70032 - */
70033 + **/
70034 static void fcoe_recv_flogi(struct fcoe_softc *fc, struct fc_frame *fp, u8 *sa)
70035 {
70036 struct fc_frame_header *fh;
70037 @@ -713,23 +715,32 @@
70038 }
70039
70040 /**
70041 - * fcoe_watchdog() - fcoe timer callback
70042 + * fcoe_watchdog - fcoe timer callback
70043 * @vp:
70044 *
70045 - * This checks the pending queue length for fcoe and set lport qfull
70046 + * This checks the pending queue length for fcoe and put fcoe to be paused state
70047 * if the FCOE_MAX_QUEUE_DEPTH is reached. This is done for all fc_lport on the
70048 * fcoe_hostlist.
70049 *
70050 * Returns: 0 for success
70051 - */
70052 + **/
70053 void fcoe_watchdog(ulong vp)
70054 {
70055 + struct fc_lport *lp;
70056 struct fcoe_softc *fc;
70057 + int paused = 0;
70058
70059 read_lock(&fcoe_hostlist_lock);
70060 list_for_each_entry(fc, &fcoe_hostlist, list) {
70061 - if (fc->lp)
70062 - fcoe_check_wait_queue(fc->lp);
70063 + lp = fc->lp;
70064 + if (lp) {
70065 + if (fc->fcoe_pending_queue.qlen > FCOE_MAX_QUEUE_DEPTH)
70066 + paused = 1;
70067 + if (fcoe_check_wait_queue(lp) < FCOE_MAX_QUEUE_DEPTH) {
70068 + if (paused)
70069 + fc_unpause(lp);
70070 + }
70071 + }
70072 }
70073 read_unlock(&fcoe_hostlist_lock);
70074
70075 @@ -739,64 +750,96 @@
70076
70077
70078 /**
70079 - * fcoe_check_wait_queue() - put the skb into fcoe pending xmit queue
70080 + * fcoe_check_wait_queue - put the skb into fcoe pending xmit queue
70081 * @lp: the fc_port for this skb
70082 * @skb: the associated skb to be xmitted
70083 *
70084 * This empties the wait_queue, dequeue the head of the wait_queue queue
70085 * and calls fcoe_start_io() for each packet, if all skb have been
70086 - * transmitted, return qlen or -1 if a error occurs, then restore
70087 - * wait_queue and try again later.
70088 + * transmitted, return 0 if a error occurs, then restore wait_queue and
70089 + * try again later.
70090 *
70091 * The wait_queue is used when the skb transmit fails. skb will go
70092 * in the wait_queue which will be emptied by the time function OR
70093 * by the next skb transmit.
70094 *
70095 * Returns: 0 for success
70096 - */
70097 + **/
70098 static int fcoe_check_wait_queue(struct fc_lport *lp)
70099 {
70100 - struct fcoe_softc *fc = lport_priv(lp);
70101 + int rc, unpause = 0;
70102 + int paused = 0;
70103 struct sk_buff *skb;
70104 - int rc = -1;
70105 + struct fcoe_softc *fc;
70106
70107 + fc = fcoe_softc(lp);
70108 spin_lock_bh(&fc->fcoe_pending_queue.lock);
70109 - if (fc->fcoe_pending_queue_active)
70110 - goto out;
70111 - fc->fcoe_pending_queue_active = 1;
70112 -
70113 - while (fc->fcoe_pending_queue.qlen) {
70114 - /* keep qlen > 0 until fcoe_start_io succeeds */
70115 - fc->fcoe_pending_queue.qlen++;
70116 - skb = __skb_dequeue(&fc->fcoe_pending_queue);
70117 -
70118 - spin_unlock_bh(&fc->fcoe_pending_queue.lock);
70119 - rc = fcoe_start_io(skb);
70120 - spin_lock_bh(&fc->fcoe_pending_queue.lock);
70121
70122 - if (rc) {
70123 - __skb_queue_head(&fc->fcoe_pending_queue, skb);
70124 - /* undo temporary increment above */
70125 - fc->fcoe_pending_queue.qlen--;
70126 - break;
70127 + /*
70128 + * is this interface paused?
70129 + */
70130 + if (fc->fcoe_pending_queue.qlen > FCOE_MAX_QUEUE_DEPTH)
70131 + paused = 1;
70132 + if (fc->fcoe_pending_queue.qlen) {
70133 + while ((skb = __skb_dequeue(&fc->fcoe_pending_queue)) != NULL) {
70134 + spin_unlock_bh(&fc->fcoe_pending_queue.lock);
70135 + rc = fcoe_start_io(skb);
70136 + if (rc) {
70137 + fcoe_insert_wait_queue_head(lp, skb);
70138 + return rc;
70139 + }
70140 + spin_lock_bh(&fc->fcoe_pending_queue.lock);
70141 }
70142 - /* undo temporary increment above */
70143 - fc->fcoe_pending_queue.qlen--;
70144 + if (fc->fcoe_pending_queue.qlen < FCOE_MAX_QUEUE_DEPTH)
70145 + unpause = 1;
70146 }
70147 + spin_unlock_bh(&fc->fcoe_pending_queue.lock);
70148 + if ((unpause) && (paused))
70149 + fc_unpause(lp);
70150 + return fc->fcoe_pending_queue.qlen;
70151 +}
70152
70153 - if (fc->fcoe_pending_queue.qlen < FCOE_LOW_QUEUE_DEPTH)
70154 - lp->qfull = 0;
70155 - fc->fcoe_pending_queue_active = 0;
70156 - rc = fc->fcoe_pending_queue.qlen;
70157 -out:
70158 +/**
70159 + * fcoe_insert_wait_queue_head - puts skb to fcoe pending queue head
70160 + * @lp: the fc_port for this skb
70161 + * @skb: the associated skb to be xmitted
70162 + *
70163 + * Returns: none
70164 + **/
70165 +static void fcoe_insert_wait_queue_head(struct fc_lport *lp,
70166 + struct sk_buff *skb)
70167 +{
70168 + struct fcoe_softc *fc;
70169 +
70170 + fc = fcoe_softc(lp);
70171 + spin_lock_bh(&fc->fcoe_pending_queue.lock);
70172 + __skb_queue_head(&fc->fcoe_pending_queue, skb);
70173 spin_unlock_bh(&fc->fcoe_pending_queue.lock);
70174 - return rc;
70175 }
70176
70177 /**
70178 - * fcoe_dev_setup() - setup link change notification interface
70179 - */
70180 -static void fcoe_dev_setup()
70181 + * fcoe_insert_wait_queue - put the skb into fcoe pending queue tail
70182 + * @lp: the fc_port for this skb
70183 + * @skb: the associated skb to be xmitted
70184 + *
70185 + * Returns: none
70186 + **/
70187 +static void fcoe_insert_wait_queue(struct fc_lport *lp,
70188 + struct sk_buff *skb)
70189 +{
70190 + struct fcoe_softc *fc;
70191 +
70192 + fc = fcoe_softc(lp);
70193 + spin_lock_bh(&fc->fcoe_pending_queue.lock);
70194 + __skb_queue_tail(&fc->fcoe_pending_queue, skb);
70195 + spin_unlock_bh(&fc->fcoe_pending_queue.lock);
70196 +}
70197 +
70198 +/**
70199 + * fcoe_dev_setup - setup link change notification interface
70200 + *
70201 + **/
70202 +static void fcoe_dev_setup(void)
70203 {
70204 /*
70205 * here setup a interface specific wd time to
70206 @@ -806,15 +849,15 @@
70207 }
70208
70209 /**
70210 - * fcoe_dev_setup() - cleanup link change notification interface
70211 - */
70212 + * fcoe_dev_setup - cleanup link change notification interface
70213 + **/
70214 static void fcoe_dev_cleanup(void)
70215 {
70216 unregister_netdevice_notifier(&fcoe_notifier);
70217 }
70218
70219 /**
70220 - * fcoe_device_notification() - netdev event notification callback
70221 + * fcoe_device_notification - netdev event notification callback
70222 * @notifier: context of the notification
70223 * @event: type of event
70224 * @ptr: fixed array for output parsed ifname
70225 @@ -822,7 +865,7 @@
70226 * This function is called by the ethernet driver in case of link change event
70227 *
70228 * Returns: 0 for success
70229 - */
70230 + **/
70231 static int fcoe_device_notification(struct notifier_block *notifier,
70232 ulong event, void *ptr)
70233 {
70234 @@ -830,7 +873,7 @@
70235 struct net_device *real_dev = ptr;
70236 struct fcoe_softc *fc;
70237 struct fcoe_dev_stats *stats;
70238 - u32 new_link_up;
70239 + u16 new_status;
70240 u32 mfs;
70241 int rc = NOTIFY_OK;
70242
70243 @@ -847,15 +890,17 @@
70244 goto out;
70245 }
70246
70247 - new_link_up = lp->link_up;
70248 + new_status = lp->link_status;
70249 switch (event) {
70250 case NETDEV_DOWN:
70251 case NETDEV_GOING_DOWN:
70252 - new_link_up = 0;
70253 + new_status &= ~FC_LINK_UP;
70254 break;
70255 case NETDEV_UP:
70256 case NETDEV_CHANGE:
70257 - new_link_up = !fcoe_link_ok(lp);
70258 + new_status &= ~FC_LINK_UP;
70259 + if (!fcoe_link_ok(lp))
70260 + new_status |= FC_LINK_UP;
70261 break;
70262 case NETDEV_CHANGEMTU:
70263 mfs = fc->real_dev->mtu -
70264 @@ -863,15 +908,17 @@
70265 sizeof(struct fcoe_crc_eof));
70266 if (mfs >= FC_MIN_MAX_FRAME)
70267 fc_set_mfs(lp, mfs);
70268 - new_link_up = !fcoe_link_ok(lp);
70269 + new_status &= ~FC_LINK_UP;
70270 + if (!fcoe_link_ok(lp))
70271 + new_status |= FC_LINK_UP;
70272 break;
70273 case NETDEV_REGISTER:
70274 break;
70275 default:
70276 FC_DBG("unknown event %ld call", event);
70277 }
70278 - if (lp->link_up != new_link_up) {
70279 - if (new_link_up)
70280 + if (lp->link_status != new_status) {
70281 + if ((new_status & FC_LINK_UP) == FC_LINK_UP)
70282 fc_linkup(lp);
70283 else {
70284 stats = lp->dev_stats[smp_processor_id()];
70285 @@ -886,12 +933,12 @@
70286 }
70287
70288 /**
70289 - * fcoe_if_to_netdev() - parse a name buffer to get netdev
70290 + * fcoe_if_to_netdev - parse a name buffer to get netdev
70291 * @ifname: fixed array for output parsed ifname
70292 * @buffer: incoming buffer to be copied
70293 *
70294 * Returns: NULL or ptr to netdeive
70295 - */
70296 + **/
70297 static struct net_device *fcoe_if_to_netdev(const char *buffer)
70298 {
70299 char *cp;
70300 @@ -908,13 +955,13 @@
70301 }
70302
70303 /**
70304 - * fcoe_netdev_to_module_owner() - finds out the nic drive moddule of the netdev
70305 + * fcoe_netdev_to_module_owner - finds out the nic drive moddule of the netdev
70306 * @netdev: the target netdev
70307 *
70308 * Returns: ptr to the struct module, NULL for failure
70309 - */
70310 -static struct module *
70311 -fcoe_netdev_to_module_owner(const struct net_device *netdev)
70312 + **/
70313 +static struct module *fcoe_netdev_to_module_owner(
70314 + const struct net_device *netdev)
70315 {
70316 struct device *dev;
70317
70318 @@ -932,14 +979,12 @@
70319 }
70320
70321 /**
70322 - * fcoe_ethdrv_get() - Hold the Ethernet driver
70323 - * @netdev: the target netdev
70324 - *
70325 - * Holds the Ethernet driver module by try_module_get() for
70326 + * fcoe_ethdrv_get - holds the nic driver module by try_module_get() for
70327 * the corresponding netdev.
70328 + * @netdev: the target netdev
70329 *
70330 * Returns: 0 for succsss
70331 - */
70332 + **/
70333 static int fcoe_ethdrv_get(const struct net_device *netdev)
70334 {
70335 struct module *owner;
70336 @@ -954,14 +999,12 @@
70337 }
70338
70339 /**
70340 - * fcoe_ethdrv_put() - Release the Ethernet driver
70341 - * @netdev: the target netdev
70342 - *
70343 - * Releases the Ethernet driver module by module_put for
70344 + * fcoe_ethdrv_get - releases the nic driver module by module_put for
70345 * the corresponding netdev.
70346 + * @netdev: the target netdev
70347 *
70348 * Returns: 0 for succsss
70349 - */
70350 + **/
70351 static int fcoe_ethdrv_put(const struct net_device *netdev)
70352 {
70353 struct module *owner;
70354 @@ -977,12 +1020,12 @@
70355 }
70356
70357 /**
70358 - * fcoe_destroy() - handles the destroy from sysfs
70359 + * fcoe_destroy- handles the destroy from sysfs
70360 * @buffer: expcted to be a eth if name
70361 * @kp: associated kernel param
70362 *
70363 * Returns: 0 for success
70364 - */
70365 + **/
70366 static int fcoe_destroy(const char *buffer, struct kernel_param *kp)
70367 {
70368 int rc;
70369 @@ -1015,12 +1058,12 @@
70370 }
70371
70372 /**
70373 - * fcoe_create() - Handles the create call from sysfs
70374 + * fcoe_create - handles the create call from sysfs
70375 * @buffer: expcted to be a eth if name
70376 * @kp: associated kernel param
70377 *
70378 * Returns: 0 for success
70379 - */
70380 + **/
70381 static int fcoe_create(const char *buffer, struct kernel_param *kp)
70382 {
70383 int rc;
70384 @@ -1061,8 +1104,8 @@
70385 __MODULE_PARM_TYPE(destroy, "string");
70386 MODULE_PARM_DESC(destroy, "Destroy fcoe port");
70387
70388 -/**
70389 - * fcoe_link_ok() - Check if link is ok for the fc_lport
70390 +/*
70391 + * fcoe_link_ok - check if link is ok for the fc_lport
70392 * @lp: ptr to the fc_lport
70393 *
70394 * Any permanently-disqualifying conditions have been previously checked.
70395 @@ -1077,7 +1120,7 @@
70396 */
70397 int fcoe_link_ok(struct fc_lport *lp)
70398 {
70399 - struct fcoe_softc *fc = lport_priv(lp);
70400 + struct fcoe_softc *fc = fcoe_softc(lp);
70401 struct net_device *dev = fc->real_dev;
70402 struct ethtool_cmd ecmd = { ETHTOOL_GSET };
70403 int rc = 0;
70404 @@ -1106,8 +1149,9 @@
70405 }
70406 EXPORT_SYMBOL_GPL(fcoe_link_ok);
70407
70408 -/**
70409 - * fcoe_percpu_clean() - Clear the pending skbs for an lport
70410 +/*
70411 + * fcoe_percpu_clean - frees skb of the corresponding lport from the per
70412 + * cpu queue.
70413 * @lp: the fc_lport
70414 */
70415 void fcoe_percpu_clean(struct fc_lport *lp)
70416 @@ -1141,11 +1185,11 @@
70417 EXPORT_SYMBOL_GPL(fcoe_percpu_clean);
70418
70419 /**
70420 - * fcoe_clean_pending_queue() - Dequeue a skb and free it
70421 + * fcoe_clean_pending_queue - dequeue skb and free it
70422 * @lp: the corresponding fc_lport
70423 *
70424 * Returns: none
70425 - */
70426 + **/
70427 void fcoe_clean_pending_queue(struct fc_lport *lp)
70428 {
70429 struct fcoe_softc *fc = lport_priv(lp);
70430 @@ -1162,21 +1206,21 @@
70431 EXPORT_SYMBOL_GPL(fcoe_clean_pending_queue);
70432
70433 /**
70434 - * libfc_host_alloc() - Allocate a Scsi_Host with room for the fc_lport
70435 + * libfc_host_alloc - allocate a Scsi_Host with room for the fc_lport
70436 * @sht: ptr to the scsi host templ
70437 * @priv_size: size of private data after fc_lport
70438 *
70439 * Returns: ptr to Scsi_Host
70440 - * TODO: to libfc?
70441 + * TODO - to libfc?
70442 */
70443 -static inline struct Scsi_Host *
70444 -libfc_host_alloc(struct scsi_host_template *sht, int priv_size)
70445 +static inline struct Scsi_Host *libfc_host_alloc(
70446 + struct scsi_host_template *sht, int priv_size)
70447 {
70448 return scsi_host_alloc(sht, sizeof(struct fc_lport) + priv_size);
70449 }
70450
70451 /**
70452 - * fcoe_host_alloc() - Allocate a Scsi_Host with room for the fcoe_softc
70453 + * fcoe_host_alloc - allocate a Scsi_Host with room for the fcoe_softc
70454 * @sht: ptr to the scsi host templ
70455 * @priv_size: size of private data after fc_lport
70456 *
70457 @@ -1188,8 +1232,8 @@
70458 }
70459 EXPORT_SYMBOL_GPL(fcoe_host_alloc);
70460
70461 -/**
70462 - * fcoe_reset() - Resets the fcoe
70463 +/*
70464 + * fcoe_reset - resets the fcoe
70465 * @shost: shost the reset is from
70466 *
70467 * Returns: always 0
70468 @@ -1202,8 +1246,8 @@
70469 }
70470 EXPORT_SYMBOL_GPL(fcoe_reset);
70471
70472 -/**
70473 - * fcoe_wwn_from_mac() - Converts 48-bit IEEE MAC address to 64-bit FC WWN.
70474 +/*
70475 + * fcoe_wwn_from_mac - converts 48-bit IEEE MAC address to 64-bit FC WWN.
70476 * @mac: mac address
70477 * @scheme: check port
70478 * @port: port indicator for converting
70479 @@ -1242,15 +1286,14 @@
70480 return wwn;
70481 }
70482 EXPORT_SYMBOL_GPL(fcoe_wwn_from_mac);
70483 -
70484 -/**
70485 - * fcoe_hostlist_lookup_softc() - find the corresponding lport by a given device
70486 +/*
70487 + * fcoe_hostlist_lookup_softc - find the corresponding lport by a given device
70488 * @device: this is currently ptr to net_device
70489 *
70490 * Returns: NULL or the located fcoe_softc
70491 */
70492 -static struct fcoe_softc *
70493 -fcoe_hostlist_lookup_softc(const struct net_device *dev)
70494 +static struct fcoe_softc *fcoe_hostlist_lookup_softc(
70495 + const struct net_device *dev)
70496 {
70497 struct fcoe_softc *fc;
70498
70499 @@ -1265,8 +1308,8 @@
70500 return NULL;
70501 }
70502
70503 -/**
70504 - * fcoe_hostlist_lookup() - Find the corresponding lport by netdev
70505 +/*
70506 + * fcoe_hostlist_lookup - find the corresponding lport by netdev
70507 * @netdev: ptr to net_device
70508 *
70509 * Returns: 0 for success
70510 @@ -1281,8 +1324,8 @@
70511 }
70512 EXPORT_SYMBOL_GPL(fcoe_hostlist_lookup);
70513
70514 -/**
70515 - * fcoe_hostlist_add() - Add a lport to lports list
70516 +/*
70517 + * fcoe_hostlist_add - add a lport to lports list
70518 * @lp: ptr to the fc_lport to badded
70519 *
70520 * Returns: 0 for success
70521 @@ -1293,7 +1336,7 @@
70522
70523 fc = fcoe_hostlist_lookup_softc(fcoe_netdev(lp));
70524 if (!fc) {
70525 - fc = lport_priv(lp);
70526 + fc = fcoe_softc(lp);
70527 write_lock_bh(&fcoe_hostlist_lock);
70528 list_add_tail(&fc->list, &fcoe_hostlist);
70529 write_unlock_bh(&fcoe_hostlist_lock);
70530 @@ -1302,8 +1345,8 @@
70531 }
70532 EXPORT_SYMBOL_GPL(fcoe_hostlist_add);
70533
70534 -/**
70535 - * fcoe_hostlist_remove() - remove a lport from lports list
70536 +/*
70537 + * fcoe_hostlist_remove - remove a lport from lports list
70538 * @lp: ptr to the fc_lport to badded
70539 *
70540 * Returns: 0 for success
70541 @@ -1323,12 +1366,12 @@
70542 EXPORT_SYMBOL_GPL(fcoe_hostlist_remove);
70543
70544 /**
70545 - * fcoe_libfc_config() - sets up libfc related properties for lport
70546 + * fcoe_libfc_config - sets up libfc related properties for lport
70547 * @lp: ptr to the fc_lport
70548 * @tt: libfc function template
70549 *
70550 * Returns : 0 for success
70551 - */
70552 + **/
70553 int fcoe_libfc_config(struct fc_lport *lp, struct libfc_function_template *tt)
70554 {
70555 /* Set the function pointers set by the LLDD */
70556 @@ -1346,14 +1389,14 @@
70557 EXPORT_SYMBOL_GPL(fcoe_libfc_config);
70558
70559 /**
70560 - * fcoe_init() - fcoe module loading initialization
70561 + * fcoe_init - fcoe module loading initialization
70562 *
70563 * Initialization routine
70564 * 1. Will create fc transport software structure
70565 * 2. initialize the link list of port information structure
70566 *
70567 * Returns 0 on success, negative on failure
70568 - */
70569 + **/
70570 static int __init fcoe_init(void)
70571 {
70572 int cpu;
70573 @@ -1390,6 +1433,7 @@
70574 } else {
70575 fcoe_percpu[cpu] = NULL;
70576 kfree(p);
70577 +
70578 }
70579 }
70580 }
70581 @@ -1399,9 +1443,11 @@
70582 */
70583 fcoe_dev_setup();
70584
70585 - setup_timer(&fcoe_timer, fcoe_watchdog, 0);
70586 -
70587 - mod_timer(&fcoe_timer, jiffies + (10 * HZ));
70588 + init_timer(&fcoe_timer);
70589 + fcoe_timer.data = 0;
70590 + fcoe_timer.function = fcoe_watchdog;
70591 + fcoe_timer.expires = (jiffies + (10 * HZ));
70592 + add_timer(&fcoe_timer);
70593
70594 /* initiatlize the fcoe transport */
70595 fcoe_transport_init();
70596 @@ -1413,10 +1459,10 @@
70597 module_init(fcoe_init);
70598
70599 /**
70600 - * fcoe_exit() - fcoe module unloading cleanup
70601 + * fcoe_exit - fcoe module unloading cleanup
70602 *
70603 * Returns 0 on success, negative on failure
70604 - */
70605 + **/
70606 static void __exit fcoe_exit(void)
70607 {
70608 u32 idx;
70609 @@ -1437,7 +1483,7 @@
70610 */
70611 del_timer_sync(&fcoe_timer);
70612
70613 - /* releases the associated fcoe transport for each lport */
70614 + /* releases the assocaited fcoe transport for each lport */
70615 list_for_each_entry_safe(fc, tmp, &fcoe_hostlist, list)
70616 fcoe_transport_release(fc->real_dev);
70617
70618 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/hptiop.c linux-2.6.29-rc3.owrt/drivers/scsi/hptiop.c
70619 --- linux-2.6.29.owrt/drivers/scsi/hptiop.c 2009-05-10 22:04:39.000000000 +0200
70620 +++ linux-2.6.29-rc3.owrt/drivers/scsi/hptiop.c 2009-05-10 23:48:29.000000000 +0200
70621 @@ -1251,7 +1251,6 @@
70622 { PCI_VDEVICE(TTI, 0x3530), (kernel_ulong_t)&hptiop_itl_ops },
70623 { PCI_VDEVICE(TTI, 0x3560), (kernel_ulong_t)&hptiop_itl_ops },
70624 { PCI_VDEVICE(TTI, 0x4322), (kernel_ulong_t)&hptiop_itl_ops },
70625 - { PCI_VDEVICE(TTI, 0x4321), (kernel_ulong_t)&hptiop_itl_ops },
70626 { PCI_VDEVICE(TTI, 0x4210), (kernel_ulong_t)&hptiop_itl_ops },
70627 { PCI_VDEVICE(TTI, 0x4211), (kernel_ulong_t)&hptiop_itl_ops },
70628 { PCI_VDEVICE(TTI, 0x4310), (kernel_ulong_t)&hptiop_itl_ops },
70629 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/ibmvscsi/ibmvfc.c linux-2.6.29-rc3.owrt/drivers/scsi/ibmvscsi/ibmvfc.c
70630 --- linux-2.6.29.owrt/drivers/scsi/ibmvscsi/ibmvfc.c 2009-05-10 22:04:39.000000000 +0200
70631 +++ linux-2.6.29-rc3.owrt/drivers/scsi/ibmvscsi/ibmvfc.c 2009-05-10 23:48:29.000000000 +0200
70632 @@ -1573,6 +1573,9 @@
70633 vfc_cmd->resp_len = sizeof(vfc_cmd->rsp);
70634 vfc_cmd->cancel_key = (unsigned long)cmnd->device->hostdata;
70635 vfc_cmd->tgt_scsi_id = rport->port_id;
70636 + if ((rport->supported_classes & FC_COS_CLASS3) &&
70637 + (fc_host_supported_classes(vhost->host) & FC_COS_CLASS3))
70638 + vfc_cmd->flags = IBMVFC_CLASS_3_ERR;
70639 vfc_cmd->iu.xfer_len = scsi_bufflen(cmnd);
70640 int_to_scsilun(cmnd->device->lun, &vfc_cmd->iu.lun);
70641 memcpy(vfc_cmd->iu.cdb, cmnd->cmnd, cmnd->cmd_len);
70642 @@ -3263,7 +3266,6 @@
70643 return -ENOMEM;
70644 }
70645
70646 - memset(tgt, 0, sizeof(*tgt));
70647 tgt->scsi_id = scsi_id;
70648 tgt->new_scsi_id = scsi_id;
70649 tgt->vhost = vhost;
70650 @@ -3574,18 +3576,9 @@
70651 static void ibmvfc_tgt_add_rport(struct ibmvfc_target *tgt)
70652 {
70653 struct ibmvfc_host *vhost = tgt->vhost;
70654 - struct fc_rport *rport = tgt->rport;
70655 + struct fc_rport *rport;
70656 unsigned long flags;
70657
70658 - if (rport) {
70659 - tgt_dbg(tgt, "Setting rport roles\n");
70660 - fc_remote_port_rolechg(rport, tgt->ids.roles);
70661 - spin_lock_irqsave(vhost->host->host_lock, flags);
70662 - ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_NONE);
70663 - spin_unlock_irqrestore(vhost->host->host_lock, flags);
70664 - return;
70665 - }
70666 -
70667 tgt_dbg(tgt, "Adding rport\n");
70668 rport = fc_remote_port_add(vhost->host, 0, &tgt->ids);
70669 spin_lock_irqsave(vhost->host->host_lock, flags);
70670 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/ibmvscsi/ibmvfc.h linux-2.6.29-rc3.owrt/drivers/scsi/ibmvscsi/ibmvfc.h
70671 --- linux-2.6.29.owrt/drivers/scsi/ibmvscsi/ibmvfc.h 2009-05-10 22:04:39.000000000 +0200
70672 +++ linux-2.6.29-rc3.owrt/drivers/scsi/ibmvscsi/ibmvfc.h 2009-05-10 23:48:29.000000000 +0200
70673 @@ -32,7 +32,7 @@
70674 #define IBMVFC_DRIVER_VERSION "1.0.4"
70675 #define IBMVFC_DRIVER_DATE "(November 14, 2008)"
70676
70677 -#define IBMVFC_DEFAULT_TIMEOUT 60
70678 +#define IBMVFC_DEFAULT_TIMEOUT 15
70679 #define IBMVFC_INIT_TIMEOUT 120
70680 #define IBMVFC_MAX_REQUESTS_DEFAULT 100
70681
70682 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/ibmvscsi/ibmvscsi.c linux-2.6.29-rc3.owrt/drivers/scsi/ibmvscsi/ibmvscsi.c
70683 --- linux-2.6.29.owrt/drivers/scsi/ibmvscsi/ibmvscsi.c 2009-05-10 22:04:39.000000000 +0200
70684 +++ linux-2.6.29-rc3.owrt/drivers/scsi/ibmvscsi/ibmvscsi.c 2009-05-10 23:48:29.000000000 +0200
70685 @@ -432,7 +432,6 @@
70686 sdev_printk(KERN_ERR, cmd->device,
70687 "Can't allocate memory "
70688 "for indirect table\n");
70689 - scsi_dma_unmap(cmd);
70690 return 0;
70691 }
70692 }
70693 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/lasi700.c linux-2.6.29-rc3.owrt/drivers/scsi/lasi700.c
70694 --- linux-2.6.29.owrt/drivers/scsi/lasi700.c 2009-05-10 22:04:39.000000000 +0200
70695 +++ linux-2.6.29-rc3.owrt/drivers/scsi/lasi700.c 2009-05-10 23:48:29.000000000 +0200
70696 @@ -103,7 +103,7 @@
70697
70698 hostdata = kzalloc(sizeof(*hostdata), GFP_KERNEL);
70699 if (!hostdata) {
70700 - dev_printk(KERN_ERR, &dev->dev, "Failed to allocate host data\n");
70701 + dev_printk(KERN_ERR, dev, "Failed to allocate host data\n");
70702 return -ENOMEM;
70703 }
70704
70705 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/libfc/fc_disc.c linux-2.6.29-rc3.owrt/drivers/scsi/libfc/fc_disc.c
70706 --- linux-2.6.29.owrt/drivers/scsi/libfc/fc_disc.c 2009-05-10 22:04:39.000000000 +0200
70707 +++ linux-2.6.29-rc3.owrt/drivers/scsi/libfc/fc_disc.c 2009-05-10 23:48:29.000000000 +0200
70708 @@ -64,7 +64,7 @@
70709 static void fc_disc_restart(struct fc_disc *);
70710
70711 /**
70712 - * fc_disc_lookup_rport() - lookup a remote port by port_id
70713 + * fc_disc_lookup_rport - lookup a remote port by port_id
70714 * @lport: Fibre Channel host port instance
70715 * @port_id: remote port port_id to match
70716 */
70717 @@ -92,7 +92,7 @@
70718 }
70719
70720 /**
70721 - * fc_disc_stop_rports() - delete all the remote ports associated with the lport
70722 + * fc_disc_stop_rports - delete all the remote ports associated with the lport
70723 * @disc: The discovery job to stop rports on
70724 *
70725 * Locking Note: This function expects that the lport mutex is locked before
70726 @@ -117,7 +117,7 @@
70727 }
70728
70729 /**
70730 - * fc_disc_rport_callback() - Event handler for rport events
70731 + * fc_disc_rport_callback - Event handler for rport events
70732 * @lport: The lport which is receiving the event
70733 * @rport: The rport which the event has occured on
70734 * @event: The event that occured
70735 @@ -151,7 +151,7 @@
70736 }
70737
70738 /**
70739 - * fc_disc_recv_rscn_req() - Handle Registered State Change Notification (RSCN)
70740 + * fc_disc_recv_rscn_req - Handle Registered State Change Notification (RSCN)
70741 * @sp: Current sequence of the RSCN exchange
70742 * @fp: RSCN Frame
70743 * @lport: Fibre Channel host port instance
70744 @@ -246,7 +246,7 @@
70745 list_del(&dp->peers);
70746 rport = lport->tt.rport_lookup(lport, dp->ids.port_id);
70747 if (rport) {
70748 - rdata = rport->dd_data;
70749 + rdata = RPORT_TO_PRIV(rport);
70750 list_del(&rdata->peers);
70751 lport->tt.rport_logoff(rport);
70752 }
70753 @@ -265,7 +265,7 @@
70754 }
70755
70756 /**
70757 - * fc_disc_recv_req() - Handle incoming requests
70758 + * fc_disc_recv_req - Handle incoming requests
70759 * @sp: Current sequence of the request exchange
70760 * @fp: The frame
70761 * @lport: The FC local port
70762 @@ -294,7 +294,7 @@
70763 }
70764
70765 /**
70766 - * fc_disc_restart() - Restart discovery
70767 + * fc_disc_restart - Restart discovery
70768 * @lport: FC discovery context
70769 *
70770 * Locking Note: This function expects that the disc mutex
70771 @@ -322,7 +322,7 @@
70772 }
70773
70774 /**
70775 - * fc_disc_start() - Fibre Channel Target discovery
70776 + * fc_disc_start - Fibre Channel Target discovery
70777 * @lport: FC local port
70778 *
70779 * Returns non-zero if discovery cannot be started.
70780 @@ -383,7 +383,7 @@
70781 };
70782
70783 /**
70784 - * fc_disc_new_target() - Handle new target found by discovery
70785 + * fc_disc_new_target - Handle new target found by discovery
70786 * @lport: FC local port
70787 * @rport: The previous FC remote port (NULL if new remote port)
70788 * @ids: Identifiers for the new FC remote port
70789 @@ -396,7 +396,7 @@
70790 struct fc_rport_identifiers *ids)
70791 {
70792 struct fc_lport *lport = disc->lport;
70793 - struct fc_rport_libfc_priv *rdata;
70794 + struct fc_rport_libfc_priv *rp;
70795 int error = 0;
70796
70797 if (rport && ids->port_name) {
70798 @@ -430,15 +430,15 @@
70799 dp.ids.port_name = ids->port_name;
70800 dp.ids.node_name = ids->node_name;
70801 dp.ids.roles = ids->roles;
70802 - rport = lport->tt.rport_create(&dp);
70803 + rport = fc_rport_rogue_create(&dp);
70804 }
70805 if (!rport)
70806 error = -ENOMEM;
70807 }
70808 if (rport) {
70809 - rdata = rport->dd_data;
70810 - rdata->ops = &fc_disc_rport_ops;
70811 - rdata->rp_state = RPORT_ST_INIT;
70812 + rp = rport->dd_data;
70813 + rp->ops = &fc_disc_rport_ops;
70814 + rp->rp_state = RPORT_ST_INIT;
70815 lport->tt.rport_login(rport);
70816 }
70817 }
70818 @@ -446,20 +446,20 @@
70819 }
70820
70821 /**
70822 - * fc_disc_del_target() - Delete a target
70823 + * fc_disc_del_target - Delete a target
70824 * @disc: FC discovery context
70825 * @rport: The remote port to be removed
70826 */
70827 static void fc_disc_del_target(struct fc_disc *disc, struct fc_rport *rport)
70828 {
70829 struct fc_lport *lport = disc->lport;
70830 - struct fc_rport_libfc_priv *rdata = rport->dd_data;
70831 + struct fc_rport_libfc_priv *rdata = RPORT_TO_PRIV(rport);
70832 list_del(&rdata->peers);
70833 lport->tt.rport_logoff(rport);
70834 }
70835
70836 /**
70837 - * fc_disc_done() - Discovery has been completed
70838 + * fc_disc_done - Discovery has been completed
70839 * @disc: FC discovery context
70840 */
70841 static void fc_disc_done(struct fc_disc *disc)
70842 @@ -479,7 +479,7 @@
70843 }
70844
70845 /**
70846 - * fc_disc_error() - Handle error on dNS request
70847 + * fc_disc_error - Handle error on dNS request
70848 * @disc: FC discovery context
70849 * @fp: The frame pointer
70850 */
70851 @@ -519,7 +519,7 @@
70852 }
70853
70854 /**
70855 - * fc_disc_gpn_ft_req() - Send Get Port Names by FC-4 type (GPN_FT) request
70856 + * fc_disc_gpn_ft_req - Send Get Port Names by FC-4 type (GPN_FT) request
70857 * @lport: FC discovery context
70858 *
70859 * Locking Note: This function expects that the disc_mutex is locked
70860 @@ -553,7 +553,7 @@
70861 }
70862
70863 /**
70864 - * fc_disc_gpn_ft_parse() - Parse the list of IDs and names resulting from a request
70865 + * fc_disc_gpn_ft_parse - Parse the list of IDs and names resulting from a request
70866 * @lport: Fibre Channel host port instance
70867 * @buf: GPN_FT response buffer
70868 * @len: size of response buffer
70869 @@ -617,7 +617,7 @@
70870
70871 if ((dp.ids.port_id != fc_host_port_id(lport->host)) &&
70872 (dp.ids.port_name != lport->wwpn)) {
70873 - rport = lport->tt.rport_create(&dp);
70874 + rport = fc_rport_rogue_create(&dp);
70875 if (rport) {
70876 rdata = rport->dd_data;
70877 rdata->ops = &fc_disc_rport_ops;
70878 @@ -658,10 +658,7 @@
70879 return error;
70880 }
70881
70882 -/**
70883 - * fc_disc_timeout() - Retry handler for the disc component
70884 - * @work: Structure holding disc obj that needs retry discovery
70885 - *
70886 +/*
70887 * Handle retry of memory allocation for remote ports.
70888 */
70889 static void fc_disc_timeout(struct work_struct *work)
70890 @@ -676,7 +673,7 @@
70891 }
70892
70893 /**
70894 - * fc_disc_gpn_ft_resp() - Handle a response frame from Get Port Names (GPN_FT)
70895 + * fc_disc_gpn_ft_resp - Handle a response frame from Get Port Names (GPN_FT)
70896 * @sp: Current sequence of GPN_FT exchange
70897 * @fp: response frame
70898 * @lp_arg: Fibre Channel host port instance
70899 @@ -715,7 +712,9 @@
70900 fr_len(fp));
70901 } else if (ntohs(cp->ct_cmd) == FC_FS_ACC) {
70902
70903 - /* Accepted, parse the response. */
70904 + /*
70905 + * Accepted. Parse response.
70906 + */
70907 buf = cp + 1;
70908 len -= sizeof(*cp);
70909 } else if (ntohs(cp->ct_cmd) == FC_FS_RJT) {
70910 @@ -747,7 +746,7 @@
70911 }
70912
70913 /**
70914 - * fc_disc_single() - Discover the directory information for a single target
70915 + * fc_disc_single - Discover the directory information for a single target
70916 * @lport: FC local port
70917 * @dp: The port to rediscover
70918 *
70919 @@ -770,7 +769,7 @@
70920 if (rport)
70921 fc_disc_del_target(disc, rport);
70922
70923 - new_rport = lport->tt.rport_create(dp);
70924 + new_rport = fc_rport_rogue_create(dp);
70925 if (new_rport) {
70926 rdata = new_rport->dd_data;
70927 rdata->ops = &fc_disc_rport_ops;
70928 @@ -783,7 +782,7 @@
70929 }
70930
70931 /**
70932 - * fc_disc_stop() - Stop discovery for a given lport
70933 + * fc_disc_stop - Stop discovery for a given lport
70934 * @lport: The lport that discovery should stop for
70935 */
70936 void fc_disc_stop(struct fc_lport *lport)
70937 @@ -797,7 +796,7 @@
70938 }
70939
70940 /**
70941 - * fc_disc_stop_final() - Stop discovery for a given lport
70942 + * fc_disc_stop_final - Stop discovery for a given lport
70943 * @lport: The lport that discovery should stop for
70944 *
70945 * This function will block until discovery has been
70946 @@ -810,7 +809,7 @@
70947 }
70948
70949 /**
70950 - * fc_disc_init() - Initialize the discovery block
70951 + * fc_disc_init - Initialize the discovery block
70952 * @lport: FC local port
70953 */
70954 int fc_disc_init(struct fc_lport *lport)
70955 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/libfc/fc_exch.c linux-2.6.29-rc3.owrt/drivers/scsi/libfc/fc_exch.c
70956 --- linux-2.6.29.owrt/drivers/scsi/libfc/fc_exch.c 2009-05-10 22:04:39.000000000 +0200
70957 +++ linux-2.6.29-rc3.owrt/drivers/scsi/libfc/fc_exch.c 2009-05-10 23:48:29.000000000 +0200
70958 @@ -32,6 +32,8 @@
70959 #include <scsi/libfc.h>
70960 #include <scsi/fc_encode.h>
70961
70962 +#define FC_DEF_R_A_TOV (10 * 1000) /* resource allocation timeout */
70963 +
70964 /*
70965 * fc_exch_debug can be set in debugger or at compile time to get more logs.
70966 */
70967 @@ -625,6 +627,7 @@
70968 {
70969 struct fc_exch *ep;
70970 struct fc_frame_header *fh;
70971 + u16 rxid;
70972
70973 ep = mp->lp->tt.exch_get(mp->lp, fp);
70974 if (ep) {
70975 @@ -651,6 +654,18 @@
70976 if ((ntoh24(fh->fh_f_ctl) & FC_FC_SEQ_INIT) == 0)
70977 ep->esb_stat &= ~ESB_ST_SEQ_INIT;
70978
70979 + /*
70980 + * Set the responder ID in the frame header.
70981 + * The old one should've been 0xffff.
70982 + * If it isn't, don't assign one.
70983 + * Incoming basic link service frames may specify
70984 + * a referenced RX_ID.
70985 + */
70986 + if (fh->fh_type != FC_TYPE_BLS) {
70987 + rxid = ntohs(fh->fh_rx_id);
70988 + WARN_ON(rxid != FC_XID_UNKNOWN);
70989 + fh->fh_rx_id = htons(ep->rxid);
70990 + }
70991 fc_exch_hold(ep); /* hold for caller */
70992 spin_unlock_bh(&ep->ex_lock); /* lock from exch_get */
70993 }
70994 @@ -662,8 +677,8 @@
70995 * If fc_pf_rjt_reason is FC_RJT_NONE then this function will have a hold
70996 * on the ep that should be released by the caller.
70997 */
70998 -static enum fc_pf_rjt_reason fc_seq_lookup_recip(struct fc_exch_mgr *mp,
70999 - struct fc_frame *fp)
71000 +static enum fc_pf_rjt_reason
71001 +fc_seq_lookup_recip(struct fc_exch_mgr *mp, struct fc_frame *fp)
71002 {
71003 struct fc_frame_header *fh = fc_frame_header_get(fp);
71004 struct fc_exch *ep = NULL;
71005 @@ -981,9 +996,9 @@
71006 * Send BLS Reject.
71007 * This is for rejecting BA_ABTS only.
71008 */
71009 -static void fc_exch_send_ba_rjt(struct fc_frame *rx_fp,
71010 - enum fc_ba_rjt_reason reason,
71011 - enum fc_ba_rjt_explan explan)
71012 +static void
71013 +fc_exch_send_ba_rjt(struct fc_frame *rx_fp, enum fc_ba_rjt_reason reason,
71014 + enum fc_ba_rjt_explan explan)
71015 {
71016 struct fc_frame *fp;
71017 struct fc_frame_header *rx_fh;
71018 @@ -1081,7 +1096,7 @@
71019 ap->ba_high_seq_cnt = fh->fh_seq_cnt;
71020 ap->ba_low_seq_cnt = htons(sp->cnt);
71021 }
71022 - sp = fc_seq_start_next_locked(sp);
71023 + sp = fc_seq_start_next(sp);
71024 spin_unlock_bh(&ep->ex_lock);
71025 fc_seq_send_last(sp, fp, FC_RCTL_BA_ACC, FC_TYPE_BLS);
71026 fc_frame_free(rx_fp);
71027 @@ -1465,11 +1480,10 @@
71028 * If sid is non-zero, reset only exchanges we source from that FID.
71029 * If did is non-zero, reset only exchanges destined to that FID.
71030 */
71031 -void fc_exch_mgr_reset(struct fc_lport *lp, u32 sid, u32 did)
71032 +void fc_exch_mgr_reset(struct fc_exch_mgr *mp, u32 sid, u32 did)
71033 {
71034 struct fc_exch *ep;
71035 struct fc_exch *next;
71036 - struct fc_exch_mgr *mp = lp->emp;
71037
71038 spin_lock_bh(&mp->em_lock);
71039 restart:
71040 @@ -1593,7 +1607,7 @@
71041 if (IS_ERR(fp)) {
71042 int err = PTR_ERR(fp);
71043
71044 - if (err == -FC_EX_CLOSED || err == -FC_EX_TIMEOUT)
71045 + if (err == -FC_EX_CLOSED)
71046 goto cleanup;
71047 FC_DBG("Cannot process RRQ, because of frame error %d\n", err);
71048 return;
71049 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/libfc/fc_fcp.c linux-2.6.29-rc3.owrt/drivers/scsi/libfc/fc_fcp.c
71050 --- linux-2.6.29.owrt/drivers/scsi/libfc/fc_fcp.c 2009-05-10 22:04:39.000000000 +0200
71051 +++ linux-2.6.29-rc3.owrt/drivers/scsi/libfc/fc_fcp.c 2009-05-10 23:48:29.000000000 +0200
71052 @@ -161,7 +161,7 @@
71053 }
71054
71055 /**
71056 - * fc_fcp_pkt_release() - release hold on scsi_pkt packet
71057 + * fc_fcp_pkt_release - release hold on scsi_pkt packet
71058 * @fsp: fcp packet struct
71059 *
71060 * This is used by upper layer scsi driver.
71061 @@ -183,7 +183,8 @@
71062 }
71063
71064 /**
71065 - * fc_fcp_pkt_destory() - release hold on scsi_pkt packet
71066 + * fc_fcp_pkt_destory - release hold on scsi_pkt packet
71067 + *
71068 * @seq: exchange sequence
71069 * @fsp: fcp packet struct
71070 *
71071 @@ -198,7 +199,7 @@
71072 }
71073
71074 /**
71075 - * fc_fcp_lock_pkt() - lock a packet and get a ref to it.
71076 + * fc_fcp_lock_pkt - lock a packet and get a ref to it.
71077 * @fsp: fcp packet
71078 *
71079 * We should only return error if we return a command to scsi-ml before
71080 @@ -290,7 +291,9 @@
71081 buf = fc_frame_payload_get(fp, 0);
71082
71083 if (offset + len > fsp->data_len) {
71084 - /* this should never happen */
71085 + /*
71086 + * this should never happen
71087 + */
71088 if ((fr_flags(fp) & FCPHF_CRC_UNCHECKED) &&
71089 fc_frame_crc_check(fp))
71090 goto crc_err;
71091 @@ -384,8 +387,8 @@
71092 fc_fcp_complete_locked(fsp);
71093 }
71094
71095 -/**
71096 - * fc_fcp_send_data() - Send SCSI data to target.
71097 +/*
71098 + * fc_fcp_send_data - Send SCSI data to target.
71099 * @fsp: ptr to fc_fcp_pkt
71100 * @sp: ptr to this sequence
71101 * @offset: starting offset for this data request
71102 @@ -607,8 +610,8 @@
71103 }
71104 }
71105
71106 -/**
71107 - * fc_fcp_reduce_can_queue() - drop can_queue
71108 +/*
71109 + * fc_fcp_reduce_can_queue - drop can_queue
71110 * @lp: lport to drop queueing for
71111 *
71112 * If we are getting memory allocation failures, then we may
71113 @@ -639,11 +642,9 @@
71114 spin_unlock_irqrestore(lp->host->host_lock, flags);
71115 }
71116
71117 -/**
71118 - * fc_fcp_recv() - Reveive FCP frames
71119 - * @seq: The sequence the frame is on
71120 - * @fp: The FC frame
71121 - * @arg: The related FCP packet
71122 +/*
71123 + * exch mgr calls this routine to process scsi
71124 + * exchanges.
71125 *
71126 * Return : None
71127 * Context : called from Soft IRQ context
71128 @@ -831,7 +832,7 @@
71129 }
71130
71131 /**
71132 - * fc_fcp_complete_locked() - complete processing of a fcp packet
71133 + * fc_fcp_complete_locked - complete processing of a fcp packet
71134 * @fsp: fcp packet
71135 *
71136 * This function may sleep if a timer is pending. The packet lock must be
71137 @@ -899,7 +900,7 @@
71138 }
71139
71140 /**
71141 - * fc_fcp_cleanup_each_cmd() - Cleanup active commads
71142 + * fc_fcp_cleanup_each_cmd - run fn on each active command
71143 * @lp: logical port
71144 * @id: target id
71145 * @lun: lun
71146 @@ -951,7 +952,7 @@
71147 }
71148
71149 /**
71150 - * fc_fcp_pkt_send() - send a fcp packet to the lower level.
71151 + * fc_fcp_pkt_send - send a fcp packet to the lower level.
71152 * @lp: fc lport
71153 * @fsp: fc packet.
71154 *
71155 @@ -1620,7 +1621,7 @@
71156 static inline int fc_fcp_lport_queue_ready(struct fc_lport *lp)
71157 {
71158 /* lock ? */
71159 - return (lp->state == LPORT_ST_READY) && lp->link_up && !lp->qfull;
71160 + return (lp->state == LPORT_ST_READY) && (lp->link_status & FC_LINK_UP);
71161 }
71162
71163 /**
71164 @@ -1726,7 +1727,7 @@
71165 EXPORT_SYMBOL(fc_queuecommand);
71166
71167 /**
71168 - * fc_io_compl() - Handle responses for completed commands
71169 + * fc_io_compl - Handle responses for completed commands
71170 * @fsp: scsi packet
71171 *
71172 * Translates a error to a Linux SCSI error.
71173 @@ -1809,12 +1810,12 @@
71174 sc_cmd->result = DID_ERROR << 16;
71175 break;
71176 case FC_DATA_UNDRUN:
71177 - if ((fsp->cdb_status == 0) && !(fsp->req_flags & FC_SRB_READ)) {
71178 + if (fsp->cdb_status == 0) {
71179 /*
71180 * scsi status is good but transport level
71181 - * underrun.
71182 + * underrun. for read it should be an error??
71183 */
71184 - sc_cmd->result = DID_OK << 16;
71185 + sc_cmd->result = (DID_OK << 16) | fsp->cdb_status;
71186 } else {
71187 /*
71188 * scsi got underrun, this is an error
71189 @@ -1856,7 +1857,7 @@
71190 }
71191
71192 /**
71193 - * fc_fcp_complete() - complete processing of a fcp packet
71194 + * fc_fcp_complete - complete processing of a fcp packet
71195 * @fsp: fcp packet
71196 *
71197 * This function may sleep if a fsp timer is pending.
71198 @@ -1873,10 +1874,9 @@
71199 EXPORT_SYMBOL(fc_fcp_complete);
71200
71201 /**
71202 - * fc_eh_abort() - Abort a command
71203 + * fc_eh_abort - Abort a command...from scsi host template
71204 * @sc_cmd: scsi command to abort
71205 *
71206 - * From scsi host template.
71207 * send ABTS to the target device and wait for the response
71208 * sc_cmd is the pointer to the command to be aborted.
71209 */
71210 @@ -1890,7 +1890,7 @@
71211 lp = shost_priv(sc_cmd->device->host);
71212 if (lp->state != LPORT_ST_READY)
71213 return rc;
71214 - else if (!lp->link_up)
71215 + else if (!(lp->link_status & FC_LINK_UP))
71216 return rc;
71217
71218 spin_lock_irqsave(lp->host->host_lock, flags);
71219 @@ -1920,7 +1920,7 @@
71220 EXPORT_SYMBOL(fc_eh_abort);
71221
71222 /**
71223 - * fc_eh_device_reset() Reset a single LUN
71224 + * fc_eh_device_reset: Reset a single LUN
71225 * @sc_cmd: scsi command
71226 *
71227 * Set from scsi host template to send tm cmd to the target and wait for the
71228 @@ -1973,7 +1973,7 @@
71229 EXPORT_SYMBOL(fc_eh_device_reset);
71230
71231 /**
71232 - * fc_eh_host_reset() - The reset function will reset the ports on the host.
71233 + * fc_eh_host_reset - The reset function will reset the ports on the host.
71234 * @sc_cmd: scsi command
71235 */
71236 int fc_eh_host_reset(struct scsi_cmnd *sc_cmd)
71237 @@ -1999,7 +1999,7 @@
71238 EXPORT_SYMBOL(fc_eh_host_reset);
71239
71240 /**
71241 - * fc_slave_alloc() - configure queue depth
71242 + * fc_slave_alloc - configure queue depth
71243 * @sdev: scsi device
71244 *
71245 * Configures queue depth based on host's cmd_per_len. If not set
71246 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/libfc/fc_lport.c linux-2.6.29-rc3.owrt/drivers/scsi/libfc/fc_lport.c
71247 --- linux-2.6.29.owrt/drivers/scsi/libfc/fc_lport.c 2009-05-10 22:04:39.000000000 +0200
71248 +++ linux-2.6.29-rc3.owrt/drivers/scsi/libfc/fc_lport.c 2009-05-10 23:48:29.000000000 +0200
71249 @@ -139,7 +139,7 @@
71250 }
71251
71252 /**
71253 - * fc_lport_rport_callback() - Event handler for rport events
71254 + * fc_lport_rport_callback - Event handler for rport events
71255 * @lport: The lport which is receiving the event
71256 * @rport: The rport which the event has occured on
71257 * @event: The event that occured
71258 @@ -195,7 +195,7 @@
71259 }
71260
71261 /**
71262 - * fc_lport_state() - Return a string which represents the lport's state
71263 + * fc_lport_state - Return a string which represents the lport's state
71264 * @lport: The lport whose state is to converted to a string
71265 */
71266 static const char *fc_lport_state(struct fc_lport *lport)
71267 @@ -209,7 +209,7 @@
71268 }
71269
71270 /**
71271 - * fc_lport_ptp_setup() - Create an rport for point-to-point mode
71272 + * fc_lport_ptp_setup - Create an rport for point-to-point mode
71273 * @lport: The lport to attach the ptp rport to
71274 * @fid: The FID of the ptp rport
71275 * @remote_wwpn: The WWPN of the ptp rport
71276 @@ -232,7 +232,7 @@
71277 lport->ptp_rp = NULL;
71278 }
71279
71280 - lport->ptp_rp = lport->tt.rport_create(&dp);
71281 + lport->ptp_rp = fc_rport_rogue_create(&dp);
71282
71283 lport->tt.rport_login(lport->ptp_rp);
71284
71285 @@ -250,7 +250,7 @@
71286 {
71287 struct fc_lport *lp = shost_priv(shost);
71288
71289 - if (lp->link_up)
71290 + if ((lp->link_status & FC_LINK_UP) == FC_LINK_UP)
71291 fc_host_port_state(shost) = FC_PORTSTATE_ONLINE;
71292 else
71293 fc_host_port_state(shost) = FC_PORTSTATE_OFFLINE;
71294 @@ -351,7 +351,7 @@
71295 }
71296
71297 /**
71298 - * fc_lport_recv_rlir_req() - Handle received Registered Link Incident Report.
71299 + * fc_lport_recv_rlir_req - Handle received Registered Link Incident Report.
71300 * @lport: Fibre Channel local port recieving the RLIR
71301 * @sp: current sequence in the RLIR exchange
71302 * @fp: RLIR request frame
71303 @@ -370,7 +370,7 @@
71304 }
71305
71306 /**
71307 - * fc_lport_recv_echo_req() - Handle received ECHO request
71308 + * fc_lport_recv_echo_req - Handle received ECHO request
71309 * @lport: Fibre Channel local port recieving the ECHO
71310 * @sp: current sequence in the ECHO exchange
71311 * @fp: ECHO request frame
71312 @@ -412,7 +412,7 @@
71313 }
71314
71315 /**
71316 - * fc_lport_recv_echo_req() - Handle received Request Node ID data request
71317 + * fc_lport_recv_echo_req - Handle received Request Node ID data request
71318 * @lport: Fibre Channel local port recieving the RNID
71319 * @sp: current sequence in the RNID exchange
71320 * @fp: RNID request frame
71321 @@ -479,7 +479,7 @@
71322 }
71323
71324 /**
71325 - * fc_lport_recv_adisc_req() - Handle received Address Discovery Request
71326 + * fc_lport_recv_adisc_req - Handle received Address Discovery Request
71327 * @lport: Fibre Channel local port recieving the ADISC
71328 * @sp: current sequence in the ADISC exchange
71329 * @fp: ADISC request frame
71330 @@ -529,7 +529,7 @@
71331 }
71332
71333 /**
71334 - * fc_lport_recv_logo_req() - Handle received fabric LOGO request
71335 + * fc_lport_recv_logo_req - Handle received fabric LOGO request
71336 * @lport: Fibre Channel local port recieving the LOGO
71337 * @sp: current sequence in the LOGO exchange
71338 * @fp: LOGO request frame
71339 @@ -546,7 +546,7 @@
71340 }
71341
71342 /**
71343 - * fc_fabric_login() - Start the lport state machine
71344 + * fc_fabric_login - Start the lport state machine
71345 * @lport: The lport that should log into the fabric
71346 *
71347 * Locking Note: This function should not be called
71348 @@ -568,7 +568,7 @@
71349 EXPORT_SYMBOL(fc_fabric_login);
71350
71351 /**
71352 - * fc_linkup() - Handler for transport linkup events
71353 + * fc_linkup - Handler for transport linkup events
71354 * @lport: The lport whose link is up
71355 */
71356 void fc_linkup(struct fc_lport *lport)
71357 @@ -577,8 +577,8 @@
71358 fc_host_port_id(lport->host));
71359
71360 mutex_lock(&lport->lp_mutex);
71361 - if (!lport->link_up) {
71362 - lport->link_up = 1;
71363 + if ((lport->link_status & FC_LINK_UP) != FC_LINK_UP) {
71364 + lport->link_status |= FC_LINK_UP;
71365
71366 if (lport->state == LPORT_ST_RESET)
71367 fc_lport_enter_flogi(lport);
71368 @@ -588,7 +588,7 @@
71369 EXPORT_SYMBOL(fc_linkup);
71370
71371 /**
71372 - * fc_linkdown() - Handler for transport linkdown events
71373 + * fc_linkdown - Handler for transport linkdown events
71374 * @lport: The lport whose link is down
71375 */
71376 void fc_linkdown(struct fc_lport *lport)
71377 @@ -597,8 +597,8 @@
71378 FC_DEBUG_LPORT("Link is down for port (%6x)\n",
71379 fc_host_port_id(lport->host));
71380
71381 - if (lport->link_up) {
71382 - lport->link_up = 0;
71383 + if ((lport->link_status & FC_LINK_UP) == FC_LINK_UP) {
71384 + lport->link_status &= ~(FC_LINK_UP);
71385 fc_lport_enter_reset(lport);
71386 lport->tt.fcp_cleanup(lport);
71387 }
71388 @@ -607,25 +607,48 @@
71389 EXPORT_SYMBOL(fc_linkdown);
71390
71391 /**
71392 - * fc_fabric_logoff() - Logout of the fabric
71393 + * fc_pause - Pause the flow of frames
71394 + * @lport: The lport to be paused
71395 + */
71396 +void fc_pause(struct fc_lport *lport)
71397 +{
71398 + mutex_lock(&lport->lp_mutex);
71399 + lport->link_status |= FC_PAUSE;
71400 + mutex_unlock(&lport->lp_mutex);
71401 +}
71402 +EXPORT_SYMBOL(fc_pause);
71403 +
71404 +/**
71405 + * fc_unpause - Unpause the flow of frames
71406 + * @lport: The lport to be unpaused
71407 + */
71408 +void fc_unpause(struct fc_lport *lport)
71409 +{
71410 + mutex_lock(&lport->lp_mutex);
71411 + lport->link_status &= ~(FC_PAUSE);
71412 + mutex_unlock(&lport->lp_mutex);
71413 +}
71414 +EXPORT_SYMBOL(fc_unpause);
71415 +
71416 +/**
71417 + * fc_fabric_logoff - Logout of the fabric
71418 * @lport: fc_lport pointer to logoff the fabric
71419 *
71420 * Return value:
71421 * 0 for success, -1 for failure
71422 - */
71423 + **/
71424 int fc_fabric_logoff(struct fc_lport *lport)
71425 {
71426 lport->tt.disc_stop_final(lport);
71427 mutex_lock(&lport->lp_mutex);
71428 fc_lport_enter_logo(lport);
71429 mutex_unlock(&lport->lp_mutex);
71430 - cancel_delayed_work_sync(&lport->retry_work);
71431 return 0;
71432 }
71433 EXPORT_SYMBOL(fc_fabric_logoff);
71434
71435 /**
71436 - * fc_lport_destroy() - unregister a fc_lport
71437 + * fc_lport_destroy - unregister a fc_lport
71438 * @lport: fc_lport pointer to unregister
71439 *
71440 * Return value:
71441 @@ -635,25 +658,26 @@
71442 * clean-up all the allocated memory
71443 * and free up other system resources.
71444 *
71445 - */
71446 + **/
71447 int fc_lport_destroy(struct fc_lport *lport)
71448 {
71449 lport->tt.frame_send = fc_frame_drop;
71450 lport->tt.fcp_abort_io(lport);
71451 - lport->tt.exch_mgr_reset(lport, 0, 0);
71452 + lport->tt.exch_mgr_reset(lport->emp, 0, 0);
71453 return 0;
71454 }
71455 EXPORT_SYMBOL(fc_lport_destroy);
71456
71457 /**
71458 - * fc_set_mfs() - sets up the mfs for the corresponding fc_lport
71459 + * fc_set_mfs - sets up the mfs for the corresponding fc_lport
71460 * @lport: fc_lport pointer to unregister
71461 * @mfs: the new mfs for fc_lport
71462 *
71463 * Set mfs for the given fc_lport to the new mfs.
71464 *
71465 * Return: 0 for success
71466 - */
71467 + *
71468 + **/
71469 int fc_set_mfs(struct fc_lport *lport, u32 mfs)
71470 {
71471 unsigned int old_mfs;
71472 @@ -682,7 +706,7 @@
71473 EXPORT_SYMBOL(fc_set_mfs);
71474
71475 /**
71476 - * fc_lport_disc_callback() - Callback for discovery events
71477 + * fc_lport_disc_callback - Callback for discovery events
71478 * @lport: FC local port
71479 * @event: The discovery event
71480 */
71481 @@ -707,7 +731,7 @@
71482 }
71483
71484 /**
71485 - * fc_rport_enter_ready() - Enter the ready state and start discovery
71486 + * fc_rport_enter_ready - Enter the ready state and start discovery
71487 * @lport: Fibre Channel local port that is ready
71488 *
71489 * Locking Note: The lport lock is expected to be held before calling
71490 @@ -724,7 +748,7 @@
71491 }
71492
71493 /**
71494 - * fc_lport_recv_flogi_req() - Receive a FLOGI request
71495 + * fc_lport_recv_flogi_req - Receive a FLOGI request
71496 * @sp_in: The sequence the FLOGI is on
71497 * @rx_fp: The frame the FLOGI is in
71498 * @lport: The lport that recieved the request
71499 @@ -814,7 +838,7 @@
71500 }
71501
71502 /**
71503 - * fc_lport_recv_req() - The generic lport request handler
71504 + * fc_lport_recv_req - The generic lport request handler
71505 * @lport: The lport that received the request
71506 * @sp: The sequence the request is on
71507 * @fp: The frame the request is in
71508 @@ -910,7 +934,7 @@
71509 }
71510
71511 /**
71512 - * fc_lport_reset() - Reset an lport
71513 + * fc_lport_reset - Reset an lport
71514 * @lport: The lport which should be reset
71515 *
71516 * Locking Note: This functions should not be called with the
71517 @@ -918,7 +942,6 @@
71518 */
71519 int fc_lport_reset(struct fc_lport *lport)
71520 {
71521 - cancel_delayed_work_sync(&lport->retry_work);
71522 mutex_lock(&lport->lp_mutex);
71523 fc_lport_enter_reset(lport);
71524 mutex_unlock(&lport->lp_mutex);
71525 @@ -927,7 +950,7 @@
71526 EXPORT_SYMBOL(fc_lport_reset);
71527
71528 /**
71529 - * fc_rport_enter_reset() - Reset the local port
71530 + * fc_rport_enter_reset - Reset the local port
71531 * @lport: Fibre Channel local port to be reset
71532 *
71533 * Locking Note: The lport lock is expected to be held before calling
71534 @@ -950,16 +973,16 @@
71535
71536 lport->tt.disc_stop(lport);
71537
71538 - lport->tt.exch_mgr_reset(lport, 0, 0);
71539 + lport->tt.exch_mgr_reset(lport->emp, 0, 0);
71540 fc_host_fabric_name(lport->host) = 0;
71541 fc_host_port_id(lport->host) = 0;
71542
71543 - if (lport->link_up)
71544 + if ((lport->link_status & FC_LINK_UP) == FC_LINK_UP)
71545 fc_lport_enter_flogi(lport);
71546 }
71547
71548 /**
71549 - * fc_lport_error() - Handler for any errors
71550 + * fc_lport_error - Handler for any errors
71551 * @lport: The fc_lport object
71552 * @fp: The frame pointer
71553 *
71554 @@ -1006,8 +1029,8 @@
71555 }
71556
71557 /**
71558 - * fc_lport_rft_id_resp() - Handle response to Register Fibre
71559 - * Channel Types by ID (RPN_ID) request
71560 + * fc_lport_rft_id_resp - Handle response to Register Fibre
71561 + * Channel Types by ID (RPN_ID) request
71562 * @sp: current sequence in RPN_ID exchange
71563 * @fp: response frame
71564 * @lp_arg: Fibre Channel host port instance
71565 @@ -1030,17 +1053,17 @@
71566
71567 FC_DEBUG_LPORT("Received a RFT_ID response\n");
71568
71569 - if (IS_ERR(fp)) {
71570 - fc_lport_error(lport, fp);
71571 - goto err;
71572 - }
71573 -
71574 if (lport->state != LPORT_ST_RFT_ID) {
71575 FC_DBG("Received a RFT_ID response, but in state %s\n",
71576 fc_lport_state(lport));
71577 goto out;
71578 }
71579
71580 + if (IS_ERR(fp)) {
71581 + fc_lport_error(lport, fp);
71582 + goto err;
71583 + }
71584 +
71585 fh = fc_frame_header_get(fp);
71586 ct = fc_frame_payload_get(fp, sizeof(*ct));
71587
71588 @@ -1058,8 +1081,8 @@
71589 }
71590
71591 /**
71592 - * fc_lport_rpn_id_resp() - Handle response to Register Port
71593 - * Name by ID (RPN_ID) request
71594 + * fc_lport_rpn_id_resp - Handle response to Register Port
71595 + * Name by ID (RPN_ID) request
71596 * @sp: current sequence in RPN_ID exchange
71597 * @fp: response frame
71598 * @lp_arg: Fibre Channel host port instance
71599 @@ -1082,17 +1105,17 @@
71600
71601 FC_DEBUG_LPORT("Received a RPN_ID response\n");
71602
71603 - if (IS_ERR(fp)) {
71604 - fc_lport_error(lport, fp);
71605 - goto err;
71606 - }
71607 -
71608 if (lport->state != LPORT_ST_RPN_ID) {
71609 FC_DBG("Received a RPN_ID response, but in state %s\n",
71610 fc_lport_state(lport));
71611 goto out;
71612 }
71613
71614 + if (IS_ERR(fp)) {
71615 + fc_lport_error(lport, fp);
71616 + goto err;
71617 + }
71618 +
71619 fh = fc_frame_header_get(fp);
71620 ct = fc_frame_payload_get(fp, sizeof(*ct));
71621 if (fh && ct && fh->fh_type == FC_TYPE_CT &&
71622 @@ -1110,7 +1133,7 @@
71623 }
71624
71625 /**
71626 - * fc_lport_scr_resp() - Handle response to State Change Register (SCR) request
71627 + * fc_lport_scr_resp - Handle response to State Change Register (SCR) request
71628 * @sp: current sequence in SCR exchange
71629 * @fp: response frame
71630 * @lp_arg: Fibre Channel lport port instance that sent the registration request
71631 @@ -1132,17 +1155,17 @@
71632
71633 FC_DEBUG_LPORT("Received a SCR response\n");
71634
71635 - if (IS_ERR(fp)) {
71636 - fc_lport_error(lport, fp);
71637 - goto err;
71638 - }
71639 -
71640 if (lport->state != LPORT_ST_SCR) {
71641 FC_DBG("Received a SCR response, but in state %s\n",
71642 fc_lport_state(lport));
71643 goto out;
71644 }
71645
71646 + if (IS_ERR(fp)) {
71647 + fc_lport_error(lport, fp);
71648 + goto err;
71649 + }
71650 +
71651 op = fc_frame_payload_op(fp);
71652 if (op == ELS_LS_ACC)
71653 fc_lport_enter_ready(lport);
71654 @@ -1156,7 +1179,7 @@
71655 }
71656
71657 /**
71658 - * fc_lport_enter_scr() - Send a State Change Register (SCR) request
71659 + * fc_lport_enter_scr - Send a State Change Register (SCR) request
71660 * @lport: Fibre Channel local port to register for state changes
71661 *
71662 * Locking Note: The lport lock is expected to be held before calling
71663 @@ -1183,7 +1206,7 @@
71664 }
71665
71666 /**
71667 - * fc_lport_enter_rft_id() - Register FC4-types with the name server
71668 + * fc_lport_enter_rft_id - Register FC4-types with the name server
71669 * @lport: Fibre Channel local port to register
71670 *
71671 * Locking Note: The lport lock is expected to be held before calling
71672 @@ -1225,7 +1248,7 @@
71673 }
71674
71675 /**
71676 - * fc_rport_enter_rft_id() - Register port name with the name server
71677 + * fc_rport_enter_rft_id - Register port name with the name server
71678 * @lport: Fibre Channel local port to register
71679 *
71680 * Locking Note: The lport lock is expected to be held before calling
71681 @@ -1258,7 +1281,7 @@
71682 };
71683
71684 /**
71685 - * fc_rport_enter_dns() - Create a rport to the name server
71686 + * fc_rport_enter_dns - Create a rport to the name server
71687 * @lport: Fibre Channel local port requesting a rport for the name server
71688 *
71689 * Locking Note: The lport lock is expected to be held before calling
71690 @@ -1281,7 +1304,7 @@
71691
71692 fc_lport_state_enter(lport, LPORT_ST_DNS);
71693
71694 - rport = lport->tt.rport_create(&dp);
71695 + rport = fc_rport_rogue_create(&dp);
71696 if (!rport)
71697 goto err;
71698
71699 @@ -1295,7 +1318,7 @@
71700 }
71701
71702 /**
71703 - * fc_lport_timeout() - Handler for the retry_work timer.
71704 + * fc_lport_timeout - Handler for the retry_work timer.
71705 * @work: The work struct of the fc_lport
71706 */
71707 static void fc_lport_timeout(struct work_struct *work)
71708 @@ -1336,7 +1359,7 @@
71709 }
71710
71711 /**
71712 - * fc_lport_logo_resp() - Handle response to LOGO request
71713 + * fc_lport_logo_resp - Handle response to LOGO request
71714 * @sp: current sequence in LOGO exchange
71715 * @fp: response frame
71716 * @lp_arg: Fibre Channel lport port instance that sent the LOGO request
71717 @@ -1358,17 +1381,17 @@
71718
71719 FC_DEBUG_LPORT("Received a LOGO response\n");
71720
71721 - if (IS_ERR(fp)) {
71722 - fc_lport_error(lport, fp);
71723 - goto err;
71724 - }
71725 -
71726 if (lport->state != LPORT_ST_LOGO) {
71727 FC_DBG("Received a LOGO response, but in state %s\n",
71728 fc_lport_state(lport));
71729 goto out;
71730 }
71731
71732 + if (IS_ERR(fp)) {
71733 + fc_lport_error(lport, fp);
71734 + goto err;
71735 + }
71736 +
71737 op = fc_frame_payload_op(fp);
71738 if (op == ELS_LS_ACC)
71739 fc_lport_enter_reset(lport);
71740 @@ -1382,7 +1405,7 @@
71741 }
71742
71743 /**
71744 - * fc_rport_enter_logo() - Logout of the fabric
71745 + * fc_rport_enter_logo - Logout of the fabric
71746 * @lport: Fibre Channel local port to be logged out
71747 *
71748 * Locking Note: The lport lock is expected to be held before calling
71749 @@ -1414,7 +1437,7 @@
71750 }
71751
71752 /**
71753 - * fc_lport_flogi_resp() - Handle response to FLOGI request
71754 + * fc_lport_flogi_resp - Handle response to FLOGI request
71755 * @sp: current sequence in FLOGI exchange
71756 * @fp: response frame
71757 * @lp_arg: Fibre Channel lport port instance that sent the FLOGI request
71758 @@ -1442,17 +1465,17 @@
71759
71760 FC_DEBUG_LPORT("Received a FLOGI response\n");
71761
71762 - if (IS_ERR(fp)) {
71763 - fc_lport_error(lport, fp);
71764 - goto err;
71765 - }
71766 -
71767 if (lport->state != LPORT_ST_FLOGI) {
71768 FC_DBG("Received a FLOGI response, but in state %s\n",
71769 fc_lport_state(lport));
71770 goto out;
71771 }
71772
71773 + if (IS_ERR(fp)) {
71774 + fc_lport_error(lport, fp);
71775 + goto err;
71776 + }
71777 +
71778 fh = fc_frame_header_get(fp);
71779 did = ntoh24(fh->fh_d_id);
71780 if (fc_frame_payload_op(fp) == ELS_LS_ACC && did != 0) {
71781 @@ -1509,7 +1532,7 @@
71782 }
71783
71784 /**
71785 - * fc_rport_enter_flogi() - Send a FLOGI request to the fabric manager
71786 + * fc_rport_enter_flogi - Send a FLOGI request to the fabric manager
71787 * @lport: Fibre Channel local port to be logged in to the fabric
71788 *
71789 * Locking Note: The lport lock is expected to be held before calling
71790 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/libfc/fc_rport.c linux-2.6.29-rc3.owrt/drivers/scsi/libfc/fc_rport.c
71791 --- linux-2.6.29.owrt/drivers/scsi/libfc/fc_rport.c 2009-05-10 22:04:39.000000000 +0200
71792 +++ linux-2.6.29-rc3.owrt/drivers/scsi/libfc/fc_rport.c 2009-05-10 23:48:29.000000000 +0200
71793 @@ -81,7 +81,6 @@
71794 struct fc_seq *, struct fc_frame *);
71795 static void fc_rport_timeout(struct work_struct *);
71796 static void fc_rport_error(struct fc_rport *, struct fc_frame *);
71797 -static void fc_rport_error_retry(struct fc_rport *, struct fc_frame *);
71798 static void fc_rport_work(struct work_struct *);
71799
71800 static const char *fc_rport_state_names[] = {
71801 @@ -146,7 +145,7 @@
71802 }
71803
71804 /**
71805 - * fc_rport_state() - return a string for the state the rport is in
71806 + * fc_rport_state - return a string for the state the rport is in
71807 * @rport: The rport whose state we want to get a string for
71808 */
71809 static const char *fc_rport_state(struct fc_rport *rport)
71810 @@ -161,7 +160,7 @@
71811 }
71812
71813 /**
71814 - * fc_set_rport_loss_tmo() - Set the remote port loss timeout in seconds.
71815 + * fc_set_rport_loss_tmo - Set the remote port loss timeout in seconds.
71816 * @rport: Pointer to Fibre Channel remote port structure
71817 * @timeout: timeout in seconds
71818 */
71819 @@ -175,12 +174,12 @@
71820 EXPORT_SYMBOL(fc_set_rport_loss_tmo);
71821
71822 /**
71823 - * fc_plogi_get_maxframe() - Get max payload from the common service parameters
71824 + * fc_plogi_get_maxframe - Get max payload from the common service parameters
71825 * @flp: FLOGI payload structure
71826 * @maxval: upper limit, may be less than what is in the service parameters
71827 */
71828 -static unsigned int fc_plogi_get_maxframe(struct fc_els_flogi *flp,
71829 - unsigned int maxval)
71830 +static unsigned int
71831 +fc_plogi_get_maxframe(struct fc_els_flogi *flp, unsigned int maxval)
71832 {
71833 unsigned int mfs;
71834
71835 @@ -198,7 +197,7 @@
71836 }
71837
71838 /**
71839 - * fc_rport_state_enter() - Change the rport's state
71840 + * fc_rport_state_enter - Change the rport's state
71841 * @rport: The rport whose state should change
71842 * @new: The new state of the rport
71843 *
71844 @@ -215,7 +214,6 @@
71845
71846 static void fc_rport_work(struct work_struct *work)
71847 {
71848 - u32 port_id;
71849 struct fc_rport_libfc_priv *rdata =
71850 container_of(work, struct fc_rport_libfc_priv, event_work);
71851 enum fc_rport_event event;
71852 @@ -281,18 +279,14 @@
71853 rport_ops->event_callback(lport, rport, event);
71854 if (trans_state == FC_PORTSTATE_ROGUE)
71855 put_device(&rport->dev);
71856 - else {
71857 - port_id = rport->port_id;
71858 + else
71859 fc_remote_port_delete(rport);
71860 - lport->tt.exch_mgr_reset(lport, 0, port_id);
71861 - lport->tt.exch_mgr_reset(lport, port_id, 0);
71862 - }
71863 } else
71864 mutex_unlock(&rdata->rp_mutex);
71865 }
71866
71867 /**
71868 - * fc_rport_login() - Start the remote port login state machine
71869 + * fc_rport_login - Start the remote port login state machine
71870 * @rport: Fibre Channel remote port
71871 *
71872 * Locking Note: Called without the rport lock held. This
71873 @@ -315,7 +309,7 @@
71874 }
71875
71876 /**
71877 - * fc_rport_logoff() - Logoff and remove an rport
71878 + * fc_rport_logoff - Logoff and remove an rport
71879 * @rport: Fibre Channel remote port to be removed
71880 *
71881 * Locking Note: Called without the rport lock held. This
71882 @@ -353,7 +347,7 @@
71883 }
71884
71885 /**
71886 - * fc_rport_enter_ready() - The rport is ready
71887 + * fc_rport_enter_ready - The rport is ready
71888 * @rport: Fibre Channel remote port that is ready
71889 *
71890 * Locking Note: The rport lock is expected to be held before calling
71891 @@ -372,7 +366,7 @@
71892 }
71893
71894 /**
71895 - * fc_rport_timeout() - Handler for the retry_work timer.
71896 + * fc_rport_timeout - Handler for the retry_work timer.
71897 * @work: The work struct of the fc_rport_libfc_priv
71898 *
71899 * Locking Note: Called without the rport lock held. This
71900 @@ -411,75 +405,59 @@
71901 }
71902
71903 /**
71904 - * fc_rport_error() - Error handler, called once retries have been exhausted
71905 + * fc_rport_error - Handler for any errors
71906 * @rport: The fc_rport object
71907 * @fp: The frame pointer
71908 *
71909 + * If the error was caused by a resource allocation failure
71910 + * then wait for half a second and retry, otherwise retry
71911 + * immediately.
71912 + *
71913 * Locking Note: The rport lock is expected to be held before
71914 * calling this routine
71915 */
71916 static void fc_rport_error(struct fc_rport *rport, struct fc_frame *fp)
71917 {
71918 struct fc_rport_libfc_priv *rdata = rport->dd_data;
71919 + unsigned long delay = 0;
71920
71921 FC_DEBUG_RPORT("Error %ld in state %s, retries %d\n",
71922 PTR_ERR(fp), fc_rport_state(rport), rdata->retries);
71923
71924 - switch (rdata->rp_state) {
71925 - case RPORT_ST_PLOGI:
71926 - case RPORT_ST_PRLI:
71927 - case RPORT_ST_LOGO:
71928 - rdata->event = RPORT_EV_FAILED;
71929 - queue_work(rport_event_queue,
71930 - &rdata->event_work);
71931 - break;
71932 - case RPORT_ST_RTV:
71933 - fc_rport_enter_ready(rport);
71934 - break;
71935 - case RPORT_ST_NONE:
71936 - case RPORT_ST_READY:
71937 - case RPORT_ST_INIT:
71938 - break;
71939 - }
71940 -}
71941 -
71942 -/**
71943 - * fc_rport_error_retry() - Error handler when retries are desired
71944 - * @rport: The fc_rport object
71945 - * @fp: The frame pointer
71946 - *
71947 - * If the error was an exchange timeout retry immediately,
71948 - * otherwise wait for E_D_TOV.
71949 - *
71950 - * Locking Note: The rport lock is expected to be held before
71951 - * calling this routine
71952 - */
71953 -static void fc_rport_error_retry(struct fc_rport *rport, struct fc_frame *fp)
71954 -{
71955 - struct fc_rport_libfc_priv *rdata = rport->dd_data;
71956 - unsigned long delay = FC_DEF_E_D_TOV;
71957 -
71958 - /* make sure this isn't an FC_EX_CLOSED error, never retry those */
71959 - if (PTR_ERR(fp) == -FC_EX_CLOSED)
71960 - return fc_rport_error(rport, fp);
71961 -
71962 - if (rdata->retries < rdata->local_port->max_retry_count) {
71963 - FC_DEBUG_RPORT("Error %ld in state %s, retrying\n",
71964 - PTR_ERR(fp), fc_rport_state(rport));
71965 - rdata->retries++;
71966 - /* no additional delay on exchange timeouts */
71967 - if (PTR_ERR(fp) == -FC_EX_TIMEOUT)
71968 - delay = 0;
71969 - get_device(&rport->dev);
71970 - schedule_delayed_work(&rdata->retry_work, delay);
71971 - return;
71972 + if (!fp || PTR_ERR(fp) == -FC_EX_TIMEOUT) {
71973 + /*
71974 + * Memory allocation failure, or the exchange timed out.
71975 + * Retry after delay
71976 + */
71977 + if (rdata->retries < rdata->local_port->max_retry_count) {
71978 + rdata->retries++;
71979 + if (!fp)
71980 + delay = msecs_to_jiffies(500);
71981 + get_device(&rport->dev);
71982 + schedule_delayed_work(&rdata->retry_work, delay);
71983 + } else {
71984 + switch (rdata->rp_state) {
71985 + case RPORT_ST_PLOGI:
71986 + case RPORT_ST_PRLI:
71987 + case RPORT_ST_LOGO:
71988 + rdata->event = RPORT_EV_FAILED;
71989 + queue_work(rport_event_queue,
71990 + &rdata->event_work);
71991 + break;
71992 + case RPORT_ST_RTV:
71993 + fc_rport_enter_ready(rport);
71994 + break;
71995 + case RPORT_ST_NONE:
71996 + case RPORT_ST_READY:
71997 + case RPORT_ST_INIT:
71998 + break;
71999 + }
72000 + }
72001 }
72002 -
72003 - return fc_rport_error(rport, fp);
72004 }
72005
72006 /**
72007 - * fc_rport_plogi_recv_resp() - Handle incoming ELS PLOGI response
72008 + * fc_rport_plogi_recv_resp - Handle incoming ELS PLOGI response
72009 * @sp: current sequence in the PLOGI exchange
72010 * @fp: response frame
72011 * @rp_arg: Fibre Channel remote port
72012 @@ -505,17 +483,17 @@
72013 FC_DEBUG_RPORT("Received a PLOGI response from port (%6x)\n",
72014 rport->port_id);
72015
72016 - if (IS_ERR(fp)) {
72017 - fc_rport_error_retry(rport, fp);
72018 - goto err;
72019 - }
72020 -
72021 if (rdata->rp_state != RPORT_ST_PLOGI) {
72022 FC_DBG("Received a PLOGI response, but in state %s\n",
72023 fc_rport_state(rport));
72024 goto out;
72025 }
72026
72027 + if (IS_ERR(fp)) {
72028 + fc_rport_error(rport, fp);
72029 + goto err;
72030 + }
72031 +
72032 op = fc_frame_payload_op(fp);
72033 if (op == ELS_LS_ACC &&
72034 (plp = fc_frame_payload_get(fp, sizeof(*plp))) != NULL) {
72035 @@ -544,7 +522,7 @@
72036 else
72037 fc_rport_enter_prli(rport);
72038 } else
72039 - fc_rport_error_retry(rport, fp);
72040 + fc_rport_error(rport, fp);
72041
72042 out:
72043 fc_frame_free(fp);
72044 @@ -554,7 +532,7 @@
72045 }
72046
72047 /**
72048 - * fc_rport_enter_plogi() - Send Port Login (PLOGI) request to peer
72049 + * fc_rport_enter_plogi - Send Port Login (PLOGI) request to peer
72050 * @rport: Fibre Channel remote port to send PLOGI to
72051 *
72052 * Locking Note: The rport lock is expected to be held before calling
72053 @@ -574,20 +552,20 @@
72054 rport->maxframe_size = FC_MIN_MAX_PAYLOAD;
72055 fp = fc_frame_alloc(lport, sizeof(struct fc_els_flogi));
72056 if (!fp) {
72057 - fc_rport_error_retry(rport, fp);
72058 + fc_rport_error(rport, fp);
72059 return;
72060 }
72061 rdata->e_d_tov = lport->e_d_tov;
72062
72063 if (!lport->tt.elsct_send(lport, rport, fp, ELS_PLOGI,
72064 fc_rport_plogi_resp, rport, lport->e_d_tov))
72065 - fc_rport_error_retry(rport, fp);
72066 + fc_rport_error(rport, fp);
72067 else
72068 get_device(&rport->dev);
72069 }
72070
72071 /**
72072 - * fc_rport_prli_resp() - Process Login (PRLI) response handler
72073 + * fc_rport_prli_resp - Process Login (PRLI) response handler
72074 * @sp: current sequence in the PRLI exchange
72075 * @fp: response frame
72076 * @rp_arg: Fibre Channel remote port
72077 @@ -614,17 +592,17 @@
72078 FC_DEBUG_RPORT("Received a PRLI response from port (%6x)\n",
72079 rport->port_id);
72080
72081 - if (IS_ERR(fp)) {
72082 - fc_rport_error_retry(rport, fp);
72083 - goto err;
72084 - }
72085 -
72086 if (rdata->rp_state != RPORT_ST_PRLI) {
72087 FC_DBG("Received a PRLI response, but in state %s\n",
72088 fc_rport_state(rport));
72089 goto out;
72090 }
72091
72092 + if (IS_ERR(fp)) {
72093 + fc_rport_error(rport, fp);
72094 + goto err;
72095 + }
72096 +
72097 op = fc_frame_payload_op(fp);
72098 if (op == ELS_LS_ACC) {
72099 pp = fc_frame_payload_get(fp, sizeof(*pp));
72100 @@ -657,7 +635,7 @@
72101 }
72102
72103 /**
72104 - * fc_rport_logo_resp() - Logout (LOGO) response handler
72105 + * fc_rport_logo_resp - Logout (LOGO) response handler
72106 * @sp: current sequence in the LOGO exchange
72107 * @fp: response frame
72108 * @rp_arg: Fibre Channel remote port
72109 @@ -679,7 +657,7 @@
72110 rport->port_id);
72111
72112 if (IS_ERR(fp)) {
72113 - fc_rport_error_retry(rport, fp);
72114 + fc_rport_error(rport, fp);
72115 goto err;
72116 }
72117
72118 @@ -706,7 +684,7 @@
72119 }
72120
72121 /**
72122 - * fc_rport_enter_prli() - Send Process Login (PRLI) request to peer
72123 + * fc_rport_enter_prli - Send Process Login (PRLI) request to peer
72124 * @rport: Fibre Channel remote port to send PRLI to
72125 *
72126 * Locking Note: The rport lock is expected to be held before calling
72127 @@ -729,19 +707,19 @@
72128
72129 fp = fc_frame_alloc(lport, sizeof(*pp));
72130 if (!fp) {
72131 - fc_rport_error_retry(rport, fp);
72132 + fc_rport_error(rport, fp);
72133 return;
72134 }
72135
72136 if (!lport->tt.elsct_send(lport, rport, fp, ELS_PRLI,
72137 fc_rport_prli_resp, rport, lport->e_d_tov))
72138 - fc_rport_error_retry(rport, fp);
72139 + fc_rport_error(rport, fp);
72140 else
72141 get_device(&rport->dev);
72142 }
72143
72144 /**
72145 - * fc_rport_els_rtv_resp() - Request Timeout Value response handler
72146 + * fc_rport_els_rtv_resp - Request Timeout Value response handler
72147 * @sp: current sequence in the RTV exchange
72148 * @fp: response frame
72149 * @rp_arg: Fibre Channel remote port
72150 @@ -764,17 +742,17 @@
72151 FC_DEBUG_RPORT("Received a RTV response from port (%6x)\n",
72152 rport->port_id);
72153
72154 - if (IS_ERR(fp)) {
72155 - fc_rport_error(rport, fp);
72156 - goto err;
72157 - }
72158 -
72159 if (rdata->rp_state != RPORT_ST_RTV) {
72160 FC_DBG("Received a RTV response, but in state %s\n",
72161 fc_rport_state(rport));
72162 goto out;
72163 }
72164
72165 + if (IS_ERR(fp)) {
72166 + fc_rport_error(rport, fp);
72167 + goto err;
72168 + }
72169 +
72170 op = fc_frame_payload_op(fp);
72171 if (op == ELS_LS_ACC) {
72172 struct fc_els_rtv_acc *rtv;
72173 @@ -807,7 +785,7 @@
72174 }
72175
72176 /**
72177 - * fc_rport_enter_rtv() - Send Request Timeout Value (RTV) request to peer
72178 + * fc_rport_enter_rtv - Send Request Timeout Value (RTV) request to peer
72179 * @rport: Fibre Channel remote port to send RTV to
72180 *
72181 * Locking Note: The rport lock is expected to be held before calling
72182 @@ -826,19 +804,19 @@
72183
72184 fp = fc_frame_alloc(lport, sizeof(struct fc_els_rtv));
72185 if (!fp) {
72186 - fc_rport_error_retry(rport, fp);
72187 + fc_rport_error(rport, fp);
72188 return;
72189 }
72190
72191 if (!lport->tt.elsct_send(lport, rport, fp, ELS_RTV,
72192 fc_rport_rtv_resp, rport, lport->e_d_tov))
72193 - fc_rport_error_retry(rport, fp);
72194 + fc_rport_error(rport, fp);
72195 else
72196 get_device(&rport->dev);
72197 }
72198
72199 /**
72200 - * fc_rport_enter_logo() - Send Logout (LOGO) request to peer
72201 + * fc_rport_enter_logo - Send Logout (LOGO) request to peer
72202 * @rport: Fibre Channel remote port to send LOGO to
72203 *
72204 * Locking Note: The rport lock is expected to be held before calling
72205 @@ -857,20 +835,20 @@
72206
72207 fp = fc_frame_alloc(lport, sizeof(struct fc_els_logo));
72208 if (!fp) {
72209 - fc_rport_error_retry(rport, fp);
72210 + fc_rport_error(rport, fp);
72211 return;
72212 }
72213
72214 if (!lport->tt.elsct_send(lport, rport, fp, ELS_LOGO,
72215 fc_rport_logo_resp, rport, lport->e_d_tov))
72216 - fc_rport_error_retry(rport, fp);
72217 + fc_rport_error(rport, fp);
72218 else
72219 get_device(&rport->dev);
72220 }
72221
72222
72223 /**
72224 - * fc_rport_recv_req() - Receive a request from a rport
72225 + * fc_rport_recv_req - Receive a request from a rport
72226 * @sp: current sequence in the PLOGI exchange
72227 * @fp: response frame
72228 * @rp_arg: Fibre Channel remote port
72229 @@ -931,7 +909,7 @@
72230 }
72231
72232 /**
72233 - * fc_rport_recv_plogi_req() - Handle incoming Port Login (PLOGI) request
72234 + * fc_rport_recv_plogi_req - Handle incoming Port Login (PLOGI) request
72235 * @rport: Fibre Channel remote port that initiated PLOGI
72236 * @sp: current sequence in the PLOGI exchange
72237 * @fp: PLOGI request frame
72238 @@ -1053,7 +1031,7 @@
72239 }
72240
72241 /**
72242 - * fc_rport_recv_prli_req() - Handle incoming Process Login (PRLI) request
72243 + * fc_rport_recv_prli_req - Handle incoming Process Login (PRLI) request
72244 * @rport: Fibre Channel remote port that initiated PRLI
72245 * @sp: current sequence in the PRLI exchange
72246 * @fp: PRLI request frame
72247 @@ -1204,7 +1182,7 @@
72248 }
72249
72250 /**
72251 - * fc_rport_recv_prlo_req() - Handle incoming Process Logout (PRLO) request
72252 + * fc_rport_recv_prlo_req - Handle incoming Process Logout (PRLO) request
72253 * @rport: Fibre Channel remote port that initiated PRLO
72254 * @sp: current sequence in the PRLO exchange
72255 * @fp: PRLO request frame
72256 @@ -1235,7 +1213,7 @@
72257 }
72258
72259 /**
72260 - * fc_rport_recv_logo_req() - Handle incoming Logout (LOGO) request
72261 + * fc_rport_recv_logo_req - Handle incoming Logout (LOGO) request
72262 * @rport: Fibre Channel remote port that initiated LOGO
72263 * @sp: current sequence in the LOGO exchange
72264 * @fp: LOGO request frame
72265 @@ -1271,9 +1249,6 @@
72266
72267 int fc_rport_init(struct fc_lport *lport)
72268 {
72269 - if (!lport->tt.rport_create)
72270 - lport->tt.rport_create = fc_rport_rogue_create;
72271 -
72272 if (!lport->tt.rport_login)
72273 lport->tt.rport_login = fc_rport_login;
72274
72275 @@ -1310,7 +1285,7 @@
72276 struct fc_rport_libfc_priv *rdata = rport->dd_data;
72277 struct fc_lport *lport = rdata->local_port;
72278
72279 - lport->tt.exch_mgr_reset(lport, 0, rport->port_id);
72280 - lport->tt.exch_mgr_reset(lport, rport->port_id, 0);
72281 + lport->tt.exch_mgr_reset(lport->emp, 0, rport->port_id);
72282 + lport->tt.exch_mgr_reset(lport->emp, rport->port_id, 0);
72283 }
72284 EXPORT_SYMBOL(fc_rport_terminate_io);
72285 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/libiscsi.c linux-2.6.29-rc3.owrt/drivers/scsi/libiscsi.c
72286 --- linux-2.6.29.owrt/drivers/scsi/libiscsi.c 2009-05-10 22:04:39.000000000 +0200
72287 +++ linux-2.6.29-rc3.owrt/drivers/scsi/libiscsi.c 2009-05-10 23:48:29.000000000 +0200
72288 @@ -1998,8 +1998,6 @@
72289 if (!shost->can_queue)
72290 shost->can_queue = ISCSI_DEF_XMIT_CMDS_MAX;
72291
72292 - if (!shost->transportt->eh_timed_out)
72293 - shost->transportt->eh_timed_out = iscsi_eh_cmd_timed_out;
72294 return scsi_add_host(shost, pdev);
72295 }
72296 EXPORT_SYMBOL_GPL(iscsi_host_add);
72297 @@ -2022,6 +2020,7 @@
72298 shost = scsi_host_alloc(sht, sizeof(struct iscsi_host) + dd_data_size);
72299 if (!shost)
72300 return NULL;
72301 + shost->transportt->eh_timed_out = iscsi_eh_cmd_timed_out;
72302
72303 if (qdepth > ISCSI_MAX_CMD_PER_LUN || qdepth < 1) {
72304 if (qdepth != 0)
72305 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/lpfc/lpfc_els.c linux-2.6.29-rc3.owrt/drivers/scsi/lpfc/lpfc_els.c
72306 --- linux-2.6.29.owrt/drivers/scsi/lpfc/lpfc_els.c 2009-05-10 22:04:39.000000000 +0200
72307 +++ linux-2.6.29-rc3.owrt/drivers/scsi/lpfc/lpfc_els.c 2009-05-10 23:48:29.000000000 +0200
72308 @@ -5258,7 +5258,6 @@
72309 sizeof(struct lpfc_name));
72310 break;
72311 default:
72312 - kfree(els_data);
72313 return;
72314 }
72315 memcpy(els_data->wwpn, &ndlp->nlp_portname, sizeof(struct lpfc_name));
72316 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/qla2xxx/qla_attr.c linux-2.6.29-rc3.owrt/drivers/scsi/qla2xxx/qla_attr.c
72317 --- linux-2.6.29.owrt/drivers/scsi/qla2xxx/qla_attr.c 2009-05-10 22:04:39.000000000 +0200
72318 +++ linux-2.6.29-rc3.owrt/drivers/scsi/qla2xxx/qla_attr.c 2009-05-10 23:48:29.000000000 +0200
72319 @@ -244,6 +244,12 @@
72320 if (ha->optrom_state != QLA_SWAITING)
72321 break;
72322
72323 + if (start & 0xfff) {
72324 + qla_printk(KERN_WARNING, ha,
72325 + "Invalid start region 0x%x/0x%x.\n", start, size);
72326 + return -EINVAL;
72327 + }
72328 +
72329 ha->optrom_region_start = start;
72330 ha->optrom_region_size = start + size > ha->optrom_size ?
72331 ha->optrom_size - start : size;
72332 @@ -297,7 +303,8 @@
72333 else if (start == (ha->flt_region_boot * 4) ||
72334 start == (ha->flt_region_fw * 4))
72335 valid = 1;
72336 - else if (IS_QLA25XX(ha) || IS_QLA81XX(ha))
72337 + else if ((IS_QLA25XX(ha) || IS_QLA81XX(ha)) &&
72338 + start == (ha->flt_region_vpd_nvram * 4))
72339 valid = 1;
72340 if (!valid) {
72341 qla_printk(KERN_WARNING, ha,
72342 @@ -1258,6 +1265,13 @@
72343 test_bit(FCPORT_UPDATE_NEEDED, &vha->dpc_flags))
72344 msleep(1000);
72345
72346 + if (ha->mqenable) {
72347 + if (qla25xx_delete_queues(vha, 0) != QLA_SUCCESS)
72348 + qla_printk(KERN_WARNING, ha,
72349 + "Queue delete failed.\n");
72350 + vha->req_ques[0] = ha->req_q_map[0]->id;
72351 + }
72352 +
72353 qla24xx_disable_vp(vha);
72354
72355 fc_remove_host(vha->host);
72356 @@ -1279,12 +1293,6 @@
72357 vha->host_no, vha->vp_idx, vha));
72358 }
72359
72360 - if (ha->mqenable) {
72361 - if (qla25xx_delete_queues(vha, 0) != QLA_SUCCESS)
72362 - qla_printk(KERN_WARNING, ha,
72363 - "Queue delete failed.\n");
72364 - }
72365 -
72366 scsi_host_put(vha->host);
72367 qla_printk(KERN_INFO, ha, "vport %d deleted\n", id);
72368 return 0;
72369 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/qla2xxx/qla_def.h linux-2.6.29-rc3.owrt/drivers/scsi/qla2xxx/qla_def.h
72370 --- linux-2.6.29.owrt/drivers/scsi/qla2xxx/qla_def.h 2009-05-10 22:04:39.000000000 +0200
72371 +++ linux-2.6.29-rc3.owrt/drivers/scsi/qla2xxx/qla_def.h 2009-05-10 23:48:29.000000000 +0200
72372 @@ -2135,7 +2135,6 @@
72373 /* Work events. */
72374 enum qla_work_type {
72375 QLA_EVT_AEN,
72376 - QLA_EVT_IDC_ACK,
72377 };
72378
72379
72380 @@ -2150,10 +2149,6 @@
72381 enum fc_host_event_code code;
72382 u32 data;
72383 } aen;
72384 - struct {
72385 -#define QLA_IDC_ACK_REGS 7
72386 - uint16_t mb[QLA_IDC_ACK_REGS];
72387 - } idc_ack;
72388 } u;
72389 };
72390
72391 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/qla2xxx/qla_devtbl.h linux-2.6.29-rc3.owrt/drivers/scsi/qla2xxx/qla_devtbl.h
72392 --- linux-2.6.29.owrt/drivers/scsi/qla2xxx/qla_devtbl.h 2009-05-10 22:04:39.000000000 +0200
72393 +++ linux-2.6.29-rc3.owrt/drivers/scsi/qla2xxx/qla_devtbl.h 2009-05-10 23:48:29.000000000 +0200
72394 @@ -72,7 +72,7 @@
72395 "QLA2462", "Sun PCI-X 2.0 to 4Gb FC, Dual Channel", /* 0x141 */
72396 "QLE2460", "Sun PCI-Express to 2Gb FC, Single Channel", /* 0x142 */
72397 "QLE2462", "Sun PCI-Express to 4Gb FC, Single Channel", /* 0x143 */
72398 - "QEM2462", "Server I/O Module 4Gb FC, Dual Channel", /* 0x144 */
72399 + "QEM2462" "Server I/O Module 4Gb FC, Dual Channel", /* 0x144 */
72400 "QLE2440", "PCI-Express to 4Gb FC, Single Channel", /* 0x145 */
72401 "QLE2464", "PCI-Express to 4Gb FC, Quad Channel", /* 0x146 */
72402 "QLA2440", "PCI-X 2.0 to 4Gb FC, Single Channel", /* 0x147 */
72403 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/qla2xxx/qla_fw.h linux-2.6.29-rc3.owrt/drivers/scsi/qla2xxx/qla_fw.h
72404 --- linux-2.6.29.owrt/drivers/scsi/qla2xxx/qla_fw.h 2009-05-10 22:04:39.000000000 +0200
72405 +++ linux-2.6.29-rc3.owrt/drivers/scsi/qla2xxx/qla_fw.h 2009-05-10 23:48:29.000000000 +0200
72406 @@ -1402,8 +1402,6 @@
72407 #define MBA_IDC_NOTIFY 0x8101
72408 #define MBA_IDC_TIME_EXT 0x8102
72409
72410 -#define MBC_IDC_ACK 0x101
72411 -
72412 struct nvram_81xx {
72413 /* NVRAM header. */
72414 uint8_t id[4];
72415 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/qla2xxx/qla_gbl.h linux-2.6.29-rc3.owrt/drivers/scsi/qla2xxx/qla_gbl.h
72416 --- linux-2.6.29.owrt/drivers/scsi/qla2xxx/qla_gbl.h 2009-05-10 22:04:39.000000000 +0200
72417 +++ linux-2.6.29-rc3.owrt/drivers/scsi/qla2xxx/qla_gbl.h 2009-05-10 23:48:29.000000000 +0200
72418 @@ -72,7 +72,6 @@
72419 extern void qla2x00_abort_all_cmds(scsi_qla_host_t *, int);
72420 extern int qla2x00_post_aen_work(struct scsi_qla_host *, enum
72421 fc_host_event_code, u32);
72422 -extern int qla2x00_post_idc_ack_work(struct scsi_qla_host *, uint16_t *);
72423
72424 extern void qla2x00_abort_fcport_cmds(fc_port_t *);
72425 extern struct scsi_qla_host *qla2x00_create_host(struct scsi_host_template *,
72426 @@ -267,8 +266,6 @@
72427
72428 extern int qla84xx_verify_chip(struct scsi_qla_host *, uint16_t *);
72429
72430 -extern int qla81xx_idc_ack(scsi_qla_host_t *, uint16_t *);
72431 -
72432 /*
72433 * Global Function Prototypes in qla_isr.c source file.
72434 */
72435 @@ -379,8 +376,10 @@
72436
72437 /* Globa function prototypes for multi-q */
72438 extern int qla25xx_request_irq(struct rsp_que *);
72439 -extern int qla25xx_init_req_que(struct scsi_qla_host *, struct req_que *);
72440 -extern int qla25xx_init_rsp_que(struct scsi_qla_host *, struct rsp_que *);
72441 +extern int qla25xx_init_req_que(struct scsi_qla_host *, struct req_que *,
72442 + uint8_t);
72443 +extern int qla25xx_init_rsp_que(struct scsi_qla_host *, struct rsp_que *,
72444 + uint8_t);
72445 extern int qla25xx_create_req_que(struct qla_hw_data *, uint16_t, uint8_t,
72446 uint16_t, uint8_t, uint8_t);
72447 extern int qla25xx_create_rsp_que(struct qla_hw_data *, uint16_t, uint8_t,
72448 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/qla2xxx/qla_init.c linux-2.6.29-rc3.owrt/drivers/scsi/qla2xxx/qla_init.c
72449 --- linux-2.6.29.owrt/drivers/scsi/qla2xxx/qla_init.c 2009-05-10 22:04:39.000000000 +0200
72450 +++ linux-2.6.29-rc3.owrt/drivers/scsi/qla2xxx/qla_init.c 2009-05-10 23:48:29.000000000 +0200
72451 @@ -1226,8 +1226,9 @@
72452 icb->firmware_options_2 |=
72453 __constant_cpu_to_le32(BIT_18);
72454
72455 - icb->firmware_options_2 &= __constant_cpu_to_le32(~BIT_22);
72456 + icb->firmware_options_2 |= __constant_cpu_to_le32(BIT_22);
72457 icb->firmware_options_2 |= __constant_cpu_to_le32(BIT_23);
72458 + ha->rsp_q_map[0]->options = icb->firmware_options_2;
72459
72460 WRT_REG_DWORD(&reg->isp25mq.req_q_in, 0);
72461 WRT_REG_DWORD(&reg->isp25mq.req_q_out, 0);
72462 @@ -1308,12 +1309,8 @@
72463
72464 DEBUG(printk("scsi(%ld): Issue init firmware.\n", vha->host_no));
72465
72466 - if (ha->flags.npiv_supported) {
72467 - if (ha->operating_mode == LOOP)
72468 - ha->max_npiv_vports = MIN_MULTI_ID_FABRIC - 1;
72469 + if (ha->flags.npiv_supported)
72470 mid_init_cb->count = cpu_to_le16(ha->max_npiv_vports);
72471 - }
72472 -
72473
72474 mid_init_cb->options = __constant_cpu_to_le16(BIT_1);
72475
72476 @@ -2614,7 +2611,6 @@
72477 port_id_t wrap, nxt_d_id;
72478 struct qla_hw_data *ha = vha->hw;
72479 struct scsi_qla_host *vp, *base_vha = pci_get_drvdata(ha->pdev);
72480 - struct scsi_qla_host *tvp;
72481
72482 rval = QLA_SUCCESS;
72483
72484 @@ -2714,7 +2710,7 @@
72485 /* Bypass virtual ports of the same host. */
72486 found = 0;
72487 if (ha->num_vhosts) {
72488 - list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) {
72489 + list_for_each_entry(vp, &ha->vp_list, list) {
72490 if (new_fcport->d_id.b24 == vp->d_id.b24) {
72491 found = 1;
72492 break;
72493 @@ -2837,7 +2833,6 @@
72494 uint16_t first_loop_id;
72495 struct qla_hw_data *ha = vha->hw;
72496 struct scsi_qla_host *vp;
72497 - struct scsi_qla_host *tvp;
72498
72499 rval = QLA_SUCCESS;
72500
72501 @@ -2862,7 +2857,7 @@
72502 /* Check for loop ID being already in use. */
72503 found = 0;
72504 fcport = NULL;
72505 - list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) {
72506 + list_for_each_entry(vp, &ha->vp_list, list) {
72507 list_for_each_entry(fcport, &vp->vp_fcports, list) {
72508 if (fcport->loop_id == dev->loop_id &&
72509 fcport != dev) {
72510 @@ -3297,7 +3292,6 @@
72511 uint8_t status = 0;
72512 struct qla_hw_data *ha = vha->hw;
72513 struct scsi_qla_host *vp;
72514 - struct scsi_qla_host *tvp;
72515 struct req_que *req = ha->req_q_map[0];
72516
72517 if (vha->flags.online) {
72518 @@ -3313,7 +3307,7 @@
72519 if (atomic_read(&vha->loop_state) != LOOP_DOWN) {
72520 atomic_set(&vha->loop_state, LOOP_DOWN);
72521 qla2x00_mark_all_devices_lost(vha, 0);
72522 - list_for_each_entry_safe(vp, tvp, &ha->vp_list, list)
72523 + list_for_each_entry(vp, &ha->vp_list, list)
72524 qla2x00_mark_all_devices_lost(vp, 0);
72525 } else {
72526 if (!atomic_read(&vha->loop_down_timer))
72527 @@ -3410,7 +3404,7 @@
72528 DEBUG(printk(KERN_INFO
72529 "qla2x00_abort_isp(%ld): succeeded.\n",
72530 vha->host_no));
72531 - list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) {
72532 + list_for_each_entry(vp, &ha->vp_list, list) {
72533 if (vp->vp_idx)
72534 qla2x00_vp_abort_isp(vp);
72535 }
72536 @@ -3435,7 +3429,7 @@
72537 static int
72538 qla2x00_restart_isp(scsi_qla_host_t *vha)
72539 {
72540 - int status = 0;
72541 + uint8_t status = 0;
72542 uint32_t wait_time;
72543 struct qla_hw_data *ha = vha->hw;
72544 struct req_que *req = ha->req_q_map[0];
72545 @@ -3499,7 +3493,7 @@
72546 rsp = ha->rsp_q_map[i];
72547 if (rsp) {
72548 rsp->options &= ~BIT_0;
72549 - ret = qla25xx_init_rsp_que(base_vha, rsp);
72550 + ret = qla25xx_init_rsp_que(base_vha, rsp, rsp->options);
72551 if (ret != QLA_SUCCESS)
72552 DEBUG2_17(printk(KERN_WARNING
72553 "%s Rsp que:%d init failed\n", __func__,
72554 @@ -3513,7 +3507,7 @@
72555 if (req) {
72556 /* Clear outstanding commands array. */
72557 req->options &= ~BIT_0;
72558 - ret = qla25xx_init_req_que(base_vha, req);
72559 + ret = qla25xx_init_req_que(base_vha, req, req->options);
72560 if (ret != QLA_SUCCESS)
72561 DEBUG2_17(printk(KERN_WARNING
72562 "%s Req que:%d init failed\n", __func__,
72563 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/qla2xxx/qla_isr.c linux-2.6.29-rc3.owrt/drivers/scsi/qla2xxx/qla_isr.c
72564 --- linux-2.6.29.owrt/drivers/scsi/qla2xxx/qla_isr.c 2009-05-10 22:04:39.000000000 +0200
72565 +++ linux-2.6.29-rc3.owrt/drivers/scsi/qla2xxx/qla_isr.c 2009-05-10 23:48:29.000000000 +0200
72566 @@ -266,40 +266,6 @@
72567 }
72568 }
72569
72570 -static void
72571 -qla81xx_idc_event(scsi_qla_host_t *vha, uint16_t aen, uint16_t descr)
72572 -{
72573 - static char *event[] =
72574 - { "Complete", "Request Notification", "Time Extension" };
72575 - int rval;
72576 - struct device_reg_24xx __iomem *reg24 = &vha->hw->iobase->isp24;
72577 - uint16_t __iomem *wptr;
72578 - uint16_t cnt, timeout, mb[QLA_IDC_ACK_REGS];
72579 -
72580 - /* Seed data -- mailbox1 -> mailbox7. */
72581 - wptr = (uint16_t __iomem *)&reg24->mailbox1;
72582 - for (cnt = 0; cnt < QLA_IDC_ACK_REGS; cnt++, wptr++)
72583 - mb[cnt] = RD_REG_WORD(wptr);
72584 -
72585 - DEBUG2(printk("scsi(%ld): Inter-Driver Commucation %s -- "
72586 - "%04x %04x %04x %04x %04x %04x %04x.\n", vha->host_no,
72587 - event[aen & 0xff],
72588 - mb[0], mb[1], mb[2], mb[3], mb[4], mb[5], mb[6]));
72589 -
72590 - /* Acknowledgement needed? [Notify && non-zero timeout]. */
72591 - timeout = (descr >> 8) & 0xf;
72592 - if (aen != MBA_IDC_NOTIFY || !timeout)
72593 - return;
72594 -
72595 - DEBUG2(printk("scsi(%ld): Inter-Driver Commucation %s -- "
72596 - "ACK timeout=%d.\n", vha->host_no, event[aen & 0xff], timeout));
72597 -
72598 - rval = qla2x00_post_idc_ack_work(vha, mb);
72599 - if (rval != QLA_SUCCESS)
72600 - qla_printk(KERN_WARNING, vha->hw,
72601 - "IDC failed to post ACK.\n");
72602 -}
72603 -
72604 /**
72605 * qla2x00_async_event() - Process aynchronous events.
72606 * @ha: SCSI driver HA context
72607 @@ -748,9 +714,21 @@
72608 "%04x %04x %04x\n", vha->host_no, mb[1], mb[2], mb[3]));
72609 break;
72610 case MBA_IDC_COMPLETE:
72611 + DEBUG2(printk("scsi(%ld): Inter-Driver Commucation "
72612 + "Complete -- %04x %04x %04x\n", vha->host_no, mb[1], mb[2],
72613 + mb[3]));
72614 + break;
72615 case MBA_IDC_NOTIFY:
72616 + DEBUG2(printk("scsi(%ld): Inter-Driver Commucation "
72617 + "Request Notification -- %04x %04x %04x\n", vha->host_no,
72618 + mb[1], mb[2], mb[3]));
72619 + /**** Mailbox registers 4 - 7 valid!!! */
72620 + break;
72621 case MBA_IDC_TIME_EXT:
72622 - qla81xx_idc_event(vha, mb[0], mb[1]);
72623 + DEBUG2(printk("scsi(%ld): Inter-Driver Commucation "
72624 + "Time Extension -- %04x %04x %04x\n", vha->host_no, mb[1],
72625 + mb[2], mb[3]));
72626 + /**** Mailbox registers 4 - 7 valid!!! */
72627 break;
72628 }
72629
72630 @@ -1729,6 +1707,7 @@
72631 struct qla_hw_data *ha;
72632 struct rsp_que *rsp;
72633 struct device_reg_24xx __iomem *reg;
72634 + uint16_t msix_disabled_hccr = 0;
72635
72636 rsp = (struct rsp_que *) dev_id;
72637 if (!rsp) {
72638 @@ -1741,8 +1720,17 @@
72639
72640 spin_lock_irq(&ha->hardware_lock);
72641
72642 + msix_disabled_hccr = rsp->options;
72643 + if (!rsp->id)
72644 + msix_disabled_hccr &= __constant_cpu_to_le32(BIT_22);
72645 + else
72646 + msix_disabled_hccr &= __constant_cpu_to_le32(BIT_6);
72647 +
72648 qla24xx_process_response_queue(rsp);
72649
72650 + if (!msix_disabled_hccr)
72651 + WRT_REG_DWORD(&reg->hccr, HCCRX_CLR_RISC_INT);
72652 +
72653 spin_unlock_irq(&ha->hardware_lock);
72654
72655 return IRQ_HANDLED;
72656 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/qla2xxx/qla_mbx.c linux-2.6.29-rc3.owrt/drivers/scsi/qla2xxx/qla_mbx.c
72657 --- linux-2.6.29.owrt/drivers/scsi/qla2xxx/qla_mbx.c 2009-05-10 22:04:39.000000000 +0200
72658 +++ linux-2.6.29-rc3.owrt/drivers/scsi/qla2xxx/qla_mbx.c 2009-05-10 23:48:29.000000000 +0200
72659 @@ -2685,7 +2685,6 @@
72660 uint16_t stat = le16_to_cpu(rptid_entry->vp_idx);
72661 struct qla_hw_data *ha = vha->hw;
72662 scsi_qla_host_t *vp;
72663 - scsi_qla_host_t *tvp;
72664
72665 if (rptid_entry->entry_status != 0)
72666 return;
72667 @@ -2711,7 +2710,7 @@
72668 if (MSB(stat) == 1)
72669 return;
72670
72671 - list_for_each_entry_safe(vp, tvp, &ha->vp_list, list)
72672 + list_for_each_entry(vp, &ha->vp_list, list)
72673 if (vp_idx == vp->vp_idx)
72674 break;
72675 if (!vp)
72676 @@ -3091,7 +3090,8 @@
72677 }
72678
72679 int
72680 -qla25xx_init_req_que(struct scsi_qla_host *vha, struct req_que *req)
72681 +qla25xx_init_req_que(struct scsi_qla_host *vha, struct req_que *req,
72682 + uint8_t options)
72683 {
72684 int rval;
72685 unsigned long flags;
72686 @@ -3101,7 +3101,7 @@
72687 struct qla_hw_data *ha = vha->hw;
72688
72689 mcp->mb[0] = MBC_INITIALIZE_MULTIQ;
72690 - mcp->mb[1] = req->options;
72691 + mcp->mb[1] = options;
72692 mcp->mb[2] = MSW(LSD(req->dma));
72693 mcp->mb[3] = LSW(LSD(req->dma));
72694 mcp->mb[6] = MSW(MSD(req->dma));
72695 @@ -3128,7 +3128,7 @@
72696 mcp->tov = 60;
72697
72698 spin_lock_irqsave(&ha->hardware_lock, flags);
72699 - if (!(req->options & BIT_0)) {
72700 + if (!(options & BIT_0)) {
72701 WRT_REG_DWORD(&reg->req_q_in, 0);
72702 WRT_REG_DWORD(&reg->req_q_out, 0);
72703 }
72704 @@ -3142,7 +3142,8 @@
72705 }
72706
72707 int
72708 -qla25xx_init_rsp_que(struct scsi_qla_host *vha, struct rsp_que *rsp)
72709 +qla25xx_init_rsp_que(struct scsi_qla_host *vha, struct rsp_que *rsp,
72710 + uint8_t options)
72711 {
72712 int rval;
72713 unsigned long flags;
72714 @@ -3152,7 +3153,7 @@
72715 struct qla_hw_data *ha = vha->hw;
72716
72717 mcp->mb[0] = MBC_INITIALIZE_MULTIQ;
72718 - mcp->mb[1] = rsp->options;
72719 + mcp->mb[1] = options;
72720 mcp->mb[2] = MSW(LSD(rsp->dma));
72721 mcp->mb[3] = LSW(LSD(rsp->dma));
72722 mcp->mb[6] = MSW(MSD(rsp->dma));
72723 @@ -3177,7 +3178,7 @@
72724 mcp->tov = 60;
72725
72726 spin_lock_irqsave(&ha->hardware_lock, flags);
72727 - if (!(rsp->options & BIT_0)) {
72728 + if (!(options & BIT_0)) {
72729 WRT_REG_DWORD(&reg->rsp_q_out, 0);
72730 WRT_REG_DWORD(&reg->rsp_q_in, 0);
72731 }
72732 @@ -3192,29 +3193,3 @@
72733 return rval;
72734 }
72735
72736 -int
72737 -qla81xx_idc_ack(scsi_qla_host_t *vha, uint16_t *mb)
72738 -{
72739 - int rval;
72740 - mbx_cmd_t mc;
72741 - mbx_cmd_t *mcp = &mc;
72742 -
72743 - DEBUG11(printk("%s(%ld): entered.\n", __func__, vha->host_no));
72744 -
72745 - mcp->mb[0] = MBC_IDC_ACK;
72746 - memcpy(&mcp->mb[1], mb, QLA_IDC_ACK_REGS * sizeof(uint16_t));
72747 - mcp->out_mb = MBX_7|MBX_6|MBX_5|MBX_4|MBX_3|MBX_2|MBX_1|MBX_0;
72748 - mcp->in_mb = MBX_0;
72749 - mcp->tov = MBX_TOV_SECONDS;
72750 - mcp->flags = 0;
72751 - rval = qla2x00_mailbox_command(vha, mcp);
72752 -
72753 - if (rval != QLA_SUCCESS) {
72754 - DEBUG2_3_11(printk("%s(%ld): failed=%x (%x).\n", __func__,
72755 - vha->host_no, rval, mcp->mb[0]));
72756 - } else {
72757 - DEBUG11(printk("%s(%ld): done.\n", __func__, vha->host_no));
72758 - }
72759 -
72760 - return rval;
72761 -}
72762 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/qla2xxx/qla_mid.c linux-2.6.29-rc3.owrt/drivers/scsi/qla2xxx/qla_mid.c
72763 --- linux-2.6.29.owrt/drivers/scsi/qla2xxx/qla_mid.c 2009-05-10 22:04:39.000000000 +0200
72764 +++ linux-2.6.29-rc3.owrt/drivers/scsi/qla2xxx/qla_mid.c 2009-05-10 23:48:29.000000000 +0200
72765 @@ -69,10 +69,9 @@
72766 qla24xx_find_vhost_by_name(struct qla_hw_data *ha, uint8_t *port_name)
72767 {
72768 scsi_qla_host_t *vha;
72769 - struct scsi_qla_host *tvha;
72770
72771 /* Locate matching device in database. */
72772 - list_for_each_entry_safe(vha, tvha, &ha->vp_list, list) {
72773 + list_for_each_entry(vha, &ha->vp_list, list) {
72774 if (!memcmp(port_name, vha->port_name, WWN_SIZE))
72775 return vha;
72776 }
72777 @@ -195,11 +194,11 @@
72778 void
72779 qla2x00_alert_all_vps(struct rsp_que *rsp, uint16_t *mb)
72780 {
72781 - scsi_qla_host_t *vha, *tvha;
72782 + scsi_qla_host_t *vha;
72783 struct qla_hw_data *ha = rsp->hw;
72784 int i = 0;
72785
72786 - list_for_each_entry_safe(vha, tvha, &ha->vp_list, list) {
72787 + list_for_each_entry(vha, &ha->vp_list, list) {
72788 if (vha->vp_idx) {
72789 switch (mb[0]) {
72790 case MBA_LIP_OCCURRED:
72791 @@ -301,7 +300,6 @@
72792 int ret;
72793 struct qla_hw_data *ha = vha->hw;
72794 scsi_qla_host_t *vp;
72795 - struct scsi_qla_host *tvp;
72796
72797 if (vha->vp_idx)
72798 return;
72799 @@ -310,7 +308,7 @@
72800
72801 clear_bit(VP_DPC_NEEDED, &vha->dpc_flags);
72802
72803 - list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) {
72804 + list_for_each_entry(vp, &ha->vp_list, list) {
72805 if (vp->vp_idx)
72806 ret = qla2x00_do_dpc_vp(vp);
72807 }
72808 @@ -398,7 +396,7 @@
72809
72810 qla2x00_start_timer(vha, qla2x00_timer, WATCH_INTERVAL);
72811
72812 - memset(vha->req_ques, 0, sizeof(vha->req_ques));
72813 + memset(vha->req_ques, 0, sizeof(vha->req_ques) * QLA_MAX_HOST_QUES);
72814 vha->req_ques[0] = ha->req_q_map[0]->id;
72815 host->can_queue = ha->req_q_map[0]->length + 128;
72816 host->this_id = 255;
72817 @@ -473,7 +471,7 @@
72818
72819 if (req) {
72820 req->options |= BIT_0;
72821 - ret = qla25xx_init_req_que(vha, req);
72822 + ret = qla25xx_init_req_que(vha, req, req->options);
72823 }
72824 if (ret == QLA_SUCCESS)
72825 qla25xx_free_req_que(vha, req);
72826 @@ -488,7 +486,7 @@
72827
72828 if (rsp) {
72829 rsp->options |= BIT_0;
72830 - ret = qla25xx_init_rsp_que(vha, rsp);
72831 + ret = qla25xx_init_rsp_que(vha, rsp, rsp->options);
72832 }
72833 if (ret == QLA_SUCCESS)
72834 qla25xx_free_rsp_que(vha, rsp);
72835 @@ -504,7 +502,7 @@
72836
72837 req->options |= BIT_3;
72838 req->qos = qos;
72839 - ret = qla25xx_init_req_que(vha, req);
72840 + ret = qla25xx_init_req_que(vha, req, req->options);
72841 if (ret != QLA_SUCCESS)
72842 DEBUG2_17(printk(KERN_WARNING "%s failed\n", __func__));
72843 /* restore options bit */
72844 @@ -634,7 +632,7 @@
72845 req->max_q_depth = ha->req_q_map[0]->max_q_depth;
72846 mutex_unlock(&ha->vport_lock);
72847
72848 - ret = qla25xx_init_req_que(base_vha, req);
72849 + ret = qla25xx_init_req_que(base_vha, req, options);
72850 if (ret != QLA_SUCCESS) {
72851 qla_printk(KERN_WARNING, ha, "%s failed\n", __func__);
72852 mutex_lock(&ha->vport_lock);
72853 @@ -712,7 +710,7 @@
72854 if (ret)
72855 goto que_failed;
72856
72857 - ret = qla25xx_init_rsp_que(base_vha, rsp);
72858 + ret = qla25xx_init_rsp_que(base_vha, rsp, options);
72859 if (ret != QLA_SUCCESS) {
72860 qla_printk(KERN_WARNING, ha, "%s failed\n", __func__);
72861 mutex_lock(&ha->vport_lock);
72862 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/qla2xxx/qla_os.c linux-2.6.29-rc3.owrt/drivers/scsi/qla2xxx/qla_os.c
72863 --- linux-2.6.29.owrt/drivers/scsi/qla2xxx/qla_os.c 2009-05-10 22:04:39.000000000 +0200
72864 +++ linux-2.6.29-rc3.owrt/drivers/scsi/qla2xxx/qla_os.c 2009-05-10 23:48:29.000000000 +0200
72865 @@ -2222,6 +2222,10 @@
72866 {
72867 char name[16];
72868
72869 + ha->init_cb_size = sizeof(init_cb_t);
72870 + if (IS_QLA2XXX_MIDTYPE(ha))
72871 + ha->init_cb_size = sizeof(struct mid_init_cb_24xx);
72872 +
72873 ha->init_cb = dma_alloc_coherent(&ha->pdev->dev, ha->init_cb_size,
72874 &ha->init_cb_dma, GFP_KERNEL);
72875 if (!ha->init_cb)
72876 @@ -2518,19 +2522,6 @@
72877 return qla2x00_post_work(vha, e, 1);
72878 }
72879
72880 -int
72881 -qla2x00_post_idc_ack_work(struct scsi_qla_host *vha, uint16_t *mb)
72882 -{
72883 - struct qla_work_evt *e;
72884 -
72885 - e = qla2x00_alloc_work(vha, QLA_EVT_IDC_ACK, 1);
72886 - if (!e)
72887 - return QLA_FUNCTION_FAILED;
72888 -
72889 - memcpy(e->u.idc_ack.mb, mb, QLA_IDC_ACK_REGS * sizeof(uint16_t));
72890 - return qla2x00_post_work(vha, e, 1);
72891 -}
72892 -
72893 static void
72894 qla2x00_do_work(struct scsi_qla_host *vha)
72895 {
72896 @@ -2548,9 +2539,6 @@
72897 fc_host_post_event(vha->host, fc_get_event_number(),
72898 e->u.aen.code, e->u.aen.data);
72899 break;
72900 - case QLA_EVT_IDC_ACK:
72901 - qla81xx_idc_ack(vha, e->u.idc_ack.mb);
72902 - break;
72903 }
72904 if (e->flags & QLA_EVT_FLAG_FREE)
72905 kfree(e);
72906 @@ -2564,7 +2552,7 @@
72907 void qla2x00_relogin(struct scsi_qla_host *vha)
72908 {
72909 fc_port_t *fcport;
72910 - int status;
72911 + uint8_t status;
72912 uint16_t next_loopid = 0;
72913 struct qla_hw_data *ha = vha->hw;
72914
72915 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/qla2xxx/qla_sup.c linux-2.6.29-rc3.owrt/drivers/scsi/qla2xxx/qla_sup.c
72916 --- linux-2.6.29.owrt/drivers/scsi/qla2xxx/qla_sup.c 2009-05-10 22:04:39.000000000 +0200
72917 +++ linux-2.6.29-rc3.owrt/drivers/scsi/qla2xxx/qla_sup.c 2009-05-10 23:48:29.000000000 +0200
72918 @@ -684,7 +684,7 @@
72919 "end=0x%x size=0x%x.\n", le32_to_cpu(region->code), start,
72920 le32_to_cpu(region->end) >> 2, le32_to_cpu(region->size)));
72921
72922 - switch (le32_to_cpu(region->code) & 0xff) {
72923 + switch (le32_to_cpu(region->code)) {
72924 case FLT_REG_FW:
72925 ha->flt_region_fw = start;
72926 break;
72927 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/qla2xxx/qla_version.h linux-2.6.29-rc3.owrt/drivers/scsi/qla2xxx/qla_version.h
72928 --- linux-2.6.29.owrt/drivers/scsi/qla2xxx/qla_version.h 2009-05-10 22:04:39.000000000 +0200
72929 +++ linux-2.6.29-rc3.owrt/drivers/scsi/qla2xxx/qla_version.h 2009-05-10 23:48:29.000000000 +0200
72930 @@ -7,7 +7,7 @@
72931 /*
72932 * Driver version
72933 */
72934 -#define QLA2XXX_VERSION "8.03.00-k4"
72935 +#define QLA2XXX_VERSION "8.03.00-k2"
72936
72937 #define QLA_DRIVER_MAJOR_VER 8
72938 #define QLA_DRIVER_MINOR_VER 3
72939 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/scsi_lib.c linux-2.6.29-rc3.owrt/drivers/scsi/scsi_lib.c
72940 --- linux-2.6.29.owrt/drivers/scsi/scsi_lib.c 2009-05-10 22:04:39.000000000 +0200
72941 +++ linux-2.6.29-rc3.owrt/drivers/scsi/scsi_lib.c 2009-05-10 23:48:29.000000000 +0200
72942 @@ -1040,11 +1040,12 @@
72943 action = ACTION_FAIL;
72944 break;
72945 case ABORTED_COMMAND:
72946 - action = ACTION_FAIL;
72947 if (sshdr.asc == 0x10) { /* DIF */
72948 description = "Target Data Integrity Failure";
72949 + action = ACTION_FAIL;
72950 error = -EILSEQ;
72951 - }
72952 + } else
72953 + action = ACTION_RETRY;
72954 break;
72955 case NOT_READY:
72956 /* If the device is in the process of becoming
72957 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/scsi_scan.c linux-2.6.29-rc3.owrt/drivers/scsi/scsi_scan.c
72958 --- linux-2.6.29.owrt/drivers/scsi/scsi_scan.c 2009-05-10 22:04:39.000000000 +0200
72959 +++ linux-2.6.29-rc3.owrt/drivers/scsi/scsi_scan.c 2009-05-10 23:48:29.000000000 +0200
72960 @@ -317,7 +317,6 @@
72961 return sdev;
72962
72963 out_device_destroy:
72964 - scsi_device_set_state(sdev, SDEV_DEL);
72965 transport_destroy_device(&sdev->sdev_gendev);
72966 put_device(&sdev->sdev_gendev);
72967 out:
72968 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/sd.c linux-2.6.29-rc3.owrt/drivers/scsi/sd.c
72969 --- linux-2.6.29.owrt/drivers/scsi/sd.c 2009-05-10 22:04:39.000000000 +0200
72970 +++ linux-2.6.29-rc3.owrt/drivers/scsi/sd.c 2009-05-10 23:48:29.000000000 +0200
72971 @@ -107,7 +107,6 @@
72972 static void sd_print_sense_hdr(struct scsi_disk *, struct scsi_sense_hdr *);
72973 static void sd_print_result(struct scsi_disk *, int);
72974
72975 -static DEFINE_SPINLOCK(sd_index_lock);
72976 static DEFINE_IDA(sd_index_ida);
72977
72978 /* This semaphore is used to mediate the 0->1 reference get in the
72979 @@ -1167,19 +1166,23 @@
72980 /*
72981 * The device does not want the automatic start to be issued.
72982 */
72983 - if (sdkp->device->no_start_on_add)
72984 + if (sdkp->device->no_start_on_add) {
72985 break;
72986 + }
72987
72988 - if (sense_valid && sshdr.sense_key == NOT_READY) {
72989 - if (sshdr.asc == 4 && sshdr.ascq == 3)
72990 - break; /* manual intervention required */
72991 - if (sshdr.asc == 4 && sshdr.ascq == 0xb)
72992 - break; /* standby */
72993 - if (sshdr.asc == 4 && sshdr.ascq == 0xc)
72994 - break; /* unavailable */
72995 - /*
72996 - * Issue command to spin up drive when not ready
72997 - */
72998 + /*
72999 + * If manual intervention is required, or this is an
73000 + * absent USB storage device, a spinup is meaningless.
73001 + */
73002 + if (sense_valid &&
73003 + sshdr.sense_key == NOT_READY &&
73004 + sshdr.asc == 4 && sshdr.ascq == 3) {
73005 + break; /* manual intervention required */
73006 +
73007 + /*
73008 + * Issue command to spin up drive when not ready
73009 + */
73010 + } else if (sense_valid && sshdr.sense_key == NOT_READY) {
73011 if (!spintime) {
73012 sd_printk(KERN_NOTICE, sdkp, "Spinning up disk...");
73013 cmd[0] = START_STOP;
73014 @@ -1911,9 +1914,7 @@
73015 if (!ida_pre_get(&sd_index_ida, GFP_KERNEL))
73016 goto out_put;
73017
73018 - spin_lock(&sd_index_lock);
73019 error = ida_get_new(&sd_index_ida, &index);
73020 - spin_unlock(&sd_index_lock);
73021 } while (error == -EAGAIN);
73022
73023 if (error)
73024 @@ -1935,9 +1936,7 @@
73025 return 0;
73026
73027 out_free_index:
73028 - spin_lock(&sd_index_lock);
73029 ida_remove(&sd_index_ida, index);
73030 - spin_unlock(&sd_index_lock);
73031 out_put:
73032 put_disk(gd);
73033 out_free:
73034 @@ -1987,9 +1986,7 @@
73035 struct scsi_disk *sdkp = to_scsi_disk(dev);
73036 struct gendisk *disk = sdkp->disk;
73037
73038 - spin_lock(&sd_index_lock);
73039 ida_remove(&sd_index_ida, sdkp->index);
73040 - spin_unlock(&sd_index_lock);
73041
73042 disk->private_data = NULL;
73043 put_disk(disk);
73044 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/sg.c linux-2.6.29-rc3.owrt/drivers/scsi/sg.c
73045 --- linux-2.6.29.owrt/drivers/scsi/sg.c 2009-05-10 22:04:39.000000000 +0200
73046 +++ linux-2.6.29-rc3.owrt/drivers/scsi/sg.c 2009-05-10 23:48:29.000000000 +0200
73047 @@ -1078,7 +1078,7 @@
73048 case BLKTRACESETUP:
73049 return blk_trace_setup(sdp->device->request_queue,
73050 sdp->disk->disk_name,
73051 - MKDEV(SCSI_GENERIC_MAJOR, sdp->index),
73052 + sdp->device->sdev_gendev.devt,
73053 (char *)arg);
73054 case BLKTRACESTART:
73055 return blk_trace_startstop(sdp->device->request_queue, 1);
73056 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/scsi/zalon.c linux-2.6.29-rc3.owrt/drivers/scsi/zalon.c
73057 --- linux-2.6.29.owrt/drivers/scsi/zalon.c 2009-05-10 22:04:39.000000000 +0200
73058 +++ linux-2.6.29-rc3.owrt/drivers/scsi/zalon.c 2009-05-10 23:48:29.000000000 +0200
73059 @@ -137,7 +137,7 @@
73060 goto fail;
73061
73062 if (request_irq(dev->irq, ncr53c8xx_intr, IRQF_SHARED, "zalon", host)) {
73063 - dev_printk(KERN_ERR, &dev->dev, "irq problem with %d, detaching\n ",
73064 + dev_printk(KERN_ERR, dev, "irq problem with %d, detaching\n ",
73065 dev->irq);
73066 goto fail;
73067 }
73068 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/serial/8250.c linux-2.6.29-rc3.owrt/drivers/serial/8250.c
73069 --- linux-2.6.29.owrt/drivers/serial/8250.c 2009-05-10 22:04:38.000000000 +0200
73070 +++ linux-2.6.29-rc3.owrt/drivers/serial/8250.c 2009-05-10 23:48:29.000000000 +0200
73071 @@ -2083,20 +2083,6 @@
73072
73073 serial8250_set_mctrl(&up->port, up->port.mctrl);
73074
73075 - /* Serial over Lan (SoL) hack:
73076 - Intel 8257x Gigabit ethernet chips have a
73077 - 16550 emulation, to be used for Serial Over Lan.
73078 - Those chips take a longer time than a normal
73079 - serial device to signalize that a transmission
73080 - data was queued. Due to that, the above test generally
73081 - fails. One solution would be to delay the reading of
73082 - iir. However, this is not reliable, since the timeout
73083 - is variable. So, let's just don't test if we receive
73084 - TX irq. This way, we'll never enable UART_BUG_TXEN.
73085 - */
73086 - if (up->port.flags & UPF_NO_TXEN_TEST)
73087 - goto dont_test_tx_en;
73088 -
73089 /*
73090 * Do a quick test to see if we receive an
73091 * interrupt when we enable the TX irq.
73092 @@ -2116,7 +2102,6 @@
73093 up->bugs &= ~UART_BUG_TXEN;
73094 }
73095
73096 -dont_test_tx_en:
73097 spin_unlock_irqrestore(&up->port.lock, flags);
73098
73099 /*
73100 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/serial/8250_pci.c linux-2.6.29-rc3.owrt/drivers/serial/8250_pci.c
73101 --- linux-2.6.29.owrt/drivers/serial/8250_pci.c 2009-05-10 22:04:38.000000000 +0200
73102 +++ linux-2.6.29-rc3.owrt/drivers/serial/8250_pci.c 2009-05-10 23:48:29.000000000 +0200
73103 @@ -798,21 +798,6 @@
73104 return setup_port(priv, port, bar, offset, board->reg_shift);
73105 }
73106
73107 -static int skip_tx_en_setup(struct serial_private *priv,
73108 - const struct pciserial_board *board,
73109 - struct uart_port *port, int idx)
73110 -{
73111 - port->flags |= UPF_NO_TXEN_TEST;
73112 - printk(KERN_DEBUG "serial8250: skipping TxEn test for device "
73113 - "[%04x:%04x] subsystem [%04x:%04x]\n",
73114 - priv->dev->vendor,
73115 - priv->dev->device,
73116 - priv->dev->subsystem_vendor,
73117 - priv->dev->subsystem_device);
73118 -
73119 - return pci_default_setup(priv, board, port, idx);
73120 -}
73121 -
73122 /* This should be in linux/pci_ids.h */
73123 #define PCI_VENDOR_ID_SBSMODULARIO 0x124B
73124 #define PCI_SUBVENDOR_ID_SBSMODULARIO 0x124B
73125 @@ -879,27 +864,6 @@
73126 .init = pci_inteli960ni_init,
73127 .setup = pci_default_setup,
73128 },
73129 - {
73130 - .vendor = PCI_VENDOR_ID_INTEL,
73131 - .device = PCI_DEVICE_ID_INTEL_8257X_SOL,
73132 - .subvendor = PCI_ANY_ID,
73133 - .subdevice = PCI_ANY_ID,
73134 - .setup = skip_tx_en_setup,
73135 - },
73136 - {
73137 - .vendor = PCI_VENDOR_ID_INTEL,
73138 - .device = PCI_DEVICE_ID_INTEL_82573L_SOL,
73139 - .subvendor = PCI_ANY_ID,
73140 - .subdevice = PCI_ANY_ID,
73141 - .setup = skip_tx_en_setup,
73142 - },
73143 - {
73144 - .vendor = PCI_VENDOR_ID_INTEL,
73145 - .device = PCI_DEVICE_ID_INTEL_82573E_SOL,
73146 - .subvendor = PCI_ANY_ID,
73147 - .subdevice = PCI_ANY_ID,
73148 - .setup = skip_tx_en_setup,
73149 - },
73150 /*
73151 * ITE
73152 */
73153 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/serial/atmel_serial.c linux-2.6.29-rc3.owrt/drivers/serial/atmel_serial.c
73154 --- linux-2.6.29.owrt/drivers/serial/atmel_serial.c 2009-05-10 22:04:38.000000000 +0200
73155 +++ linux-2.6.29-rc3.owrt/drivers/serial/atmel_serial.c 2009-05-10 23:48:29.000000000 +0200
73156 @@ -877,10 +877,6 @@
73157 }
73158 }
73159
73160 - /* Save current CSR for comparison in atmel_tasklet_func() */
73161 - atmel_port->irq_status_prev = UART_GET_CSR(port);
73162 - atmel_port->irq_status = atmel_port->irq_status_prev;
73163 -
73164 /*
73165 * Finally, enable the serial port
73166 */
73167 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/serial/jsm/jsm_driver.c linux-2.6.29-rc3.owrt/drivers/serial/jsm/jsm_driver.c
73168 --- linux-2.6.29.owrt/drivers/serial/jsm/jsm_driver.c 2009-05-10 22:04:38.000000000 +0200
73169 +++ linux-2.6.29-rc3.owrt/drivers/serial/jsm/jsm_driver.c 2009-05-10 23:48:29.000000000 +0200
73170 @@ -84,8 +84,6 @@
73171 brd->pci_dev = pdev;
73172 if (pdev->device == PCIE_DEVICE_ID_NEO_4_IBM)
73173 brd->maxports = 4;
73174 - else if (pdev->device == PCI_DEVICE_ID_DIGI_NEO_8)
73175 - brd->maxports = 8;
73176 else
73177 brd->maxports = 2;
73178
73179 @@ -214,7 +212,6 @@
73180 { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_NEO_2RJ45), 0, 0, 2 },
73181 { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_NEO_2RJ45PRI), 0, 0, 3 },
73182 { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCIE_DEVICE_ID_NEO_4_IBM), 0, 0, 4 },
73183 - { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_DIGI_NEO_8), 0, 0, 5 },
73184 { 0, }
73185 };
73186 MODULE_DEVICE_TABLE(pci, jsm_pci_tbl);
73187 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/serial/jsm/jsm_tty.c linux-2.6.29-rc3.owrt/drivers/serial/jsm/jsm_tty.c
73188 --- linux-2.6.29.owrt/drivers/serial/jsm/jsm_tty.c 2009-05-10 22:04:38.000000000 +0200
73189 +++ linux-2.6.29-rc3.owrt/drivers/serial/jsm/jsm_tty.c 2009-05-10 23:48:29.000000000 +0200
73190 @@ -161,11 +161,6 @@
73191 channel->ch_bd->bd_ops->disable_receiver(channel);
73192 }
73193
73194 -static void jsm_tty_enable_ms(struct uart_port *port)
73195 -{
73196 - /* Nothing needed */
73197 -}
73198 -
73199 static void jsm_tty_break(struct uart_port *port, int break_state)
73200 {
73201 unsigned long lock_flags;
73202 @@ -350,7 +345,6 @@
73203 .start_tx = jsm_tty_start_tx,
73204 .send_xchar = jsm_tty_send_xchar,
73205 .stop_rx = jsm_tty_stop_rx,
73206 - .enable_ms = jsm_tty_enable_ms,
73207 .break_ctl = jsm_tty_break,
73208 .startup = jsm_tty_open,
73209 .shutdown = jsm_tty_close,
73210 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/serial/sh-sci.h linux-2.6.29-rc3.owrt/drivers/serial/sh-sci.h
73211 --- linux-2.6.29.owrt/drivers/serial/sh-sci.h 2009-05-10 22:04:38.000000000 +0200
73212 +++ linux-2.6.29-rc3.owrt/drivers/serial/sh-sci.h 2009-05-10 23:48:29.000000000 +0200
73213 @@ -133,7 +133,7 @@
73214 # define SCSPTR3 0xffed0024 /* 16 bit SCIF */
73215 # define SCSPTR4 0xffee0024 /* 16 bit SCIF */
73216 # define SCSPTR5 0xffef0024 /* 16 bit SCIF */
73217 -# define SCIF_ORER 0x0001 /* Overrun error bit */
73218 +# define SCIF_OPER 0x0001 /* Overrun error bit */
73219 # define SCSCR_INIT(port) 0x3a /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */
73220 #elif defined(CONFIG_CPU_SUBTYPE_SH7201) || \
73221 defined(CONFIG_CPU_SUBTYPE_SH7203) || \
73222 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/spi/spi_gpio.c linux-2.6.29-rc3.owrt/drivers/spi/spi_gpio.c
73223 --- linux-2.6.29.owrt/drivers/spi/spi_gpio.c 2009-05-10 22:04:38.000000000 +0200
73224 +++ linux-2.6.29-rc3.owrt/drivers/spi/spi_gpio.c 2009-05-10 23:48:29.000000000 +0200
73225 @@ -117,7 +117,7 @@
73226
73227 static inline int getmiso(const struct spi_device *spi)
73228 {
73229 - return !!gpio_get_value(SPI_MISO_GPIO);
73230 + return gpio_get_value(SPI_MISO_GPIO);
73231 }
73232
73233 #undef pdata
73234 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/agnx/agnx.h linux-2.6.29-rc3.owrt/drivers/staging/agnx/agnx.h
73235 --- linux-2.6.29.owrt/drivers/staging/agnx/agnx.h 2009-05-10 22:04:38.000000000 +0200
73236 +++ linux-2.6.29-rc3.owrt/drivers/staging/agnx/agnx.h 2009-05-10 23:48:29.000000000 +0200
73237 @@ -1,8 +1,6 @@
73238 #ifndef AGNX_H_
73239 #define AGNX_H_
73240
73241 -#include <linux/io.h>
73242 -
73243 #include "xmit.h"
73244
73245 #define PFX KBUILD_MODNAME ": "
73246 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/altpciechdma/altpciechdma.c linux-2.6.29-rc3.owrt/drivers/staging/altpciechdma/altpciechdma.c
73247 --- linux-2.6.29.owrt/drivers/staging/altpciechdma/altpciechdma.c 2009-05-10 22:04:38.000000000 +0200
73248 +++ linux-2.6.29-rc3.owrt/drivers/staging/altpciechdma/altpciechdma.c 2009-05-10 23:48:29.000000000 +0200
73249 @@ -531,7 +531,7 @@
73250 goto fail;
73251
73252 /* allocate and map coherently-cached memory for a DMA-able buffer */
73253 - /* @see Documentation/PCI/PCI-DMA-mapping.txt, near line 318 */
73254 + /* @see 2.6.26.2/Documentation/DMA-mapping.txt line 318 */
73255 buffer_virt = (u8 *)pci_alloc_consistent(dev, PAGE_SIZE * 4, &buffer_bus);
73256 if (!buffer_virt) {
73257 printk(KERN_DEBUG "Could not allocate coherent DMA buffer.\n");
73258 @@ -846,7 +846,7 @@
73259
73260 #if 1 // @todo For now, disable 64-bit, because I do not understand the implications (DAC!)
73261 /* query for DMA transfer */
73262 - /* @see Documentation/PCI/PCI-DMA-mapping.txt */
73263 + /* @see Documentation/DMA-mapping.txt */
73264 if (!pci_set_dma_mask(dev, DMA_64BIT_MASK)) {
73265 pci_set_consistent_dma_mask(dev, DMA_64BIT_MASK);
73266 /* use 64-bit DMA */
73267 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/android/binder.c linux-2.6.29-rc3.owrt/drivers/staging/android/binder.c
73268 --- linux-2.6.29.owrt/drivers/staging/android/binder.c 2009-05-10 22:04:38.000000000 +0200
73269 +++ linux-2.6.29-rc3.owrt/drivers/staging/android/binder.c 2009-05-10 23:48:29.000000000 +0200
73270 @@ -319,7 +319,6 @@
73271 int fd, error;
73272 struct fdtable *fdt;
73273 unsigned long rlim_cur;
73274 - unsigned long irqs;
73275
73276 if (files == NULL)
73277 return -ESRCH;
73278 @@ -336,11 +335,12 @@
73279 * N.B. For clone tasks sharing a files structure, this test
73280 * will limit the total number of files that can be opened.
73281 */
73282 - rlim_cur = 0;
73283 - if (lock_task_sighand(tsk, &irqs)) {
73284 + rcu_read_lock();
73285 + if (tsk->signal)
73286 rlim_cur = tsk->signal->rlim[RLIMIT_NOFILE].rlim_cur;
73287 - unlock_task_sighand(tsk, &irqs);
73288 - }
73289 + else
73290 + rlim_cur = 0;
73291 + rcu_read_unlock();
73292 if (fd >= rlim_cur)
73293 goto out;
73294
73295 @@ -2649,14 +2649,14 @@
73296 {
73297 struct binder_proc *proc = vma->vm_private_data;
73298 if (binder_debug_mask & BINDER_DEBUG_OPEN_CLOSE)
73299 - printk(KERN_INFO "binder: %d open vm area %lx-%lx (%ld K) vma %lx pagep %lx\n", proc->pid, vma->vm_start, vma->vm_end, (vma->vm_end - vma->vm_start) / SZ_1K, vma->vm_flags, pgprot_val(vma->vm_page_prot));
73300 + printk(KERN_INFO "binder: %d open vm area %lx-%lx (%ld K) vma %lx pagep %lx\n", proc->pid, vma->vm_start, vma->vm_end, (vma->vm_end - vma->vm_start) / SZ_1K, vma->vm_flags, vma->vm_page_prot.pgprot);
73301 dump_stack();
73302 }
73303 static void binder_vma_close(struct vm_area_struct *vma)
73304 {
73305 struct binder_proc *proc = vma->vm_private_data;
73306 if (binder_debug_mask & BINDER_DEBUG_OPEN_CLOSE)
73307 - printk(KERN_INFO "binder: %d close vm area %lx-%lx (%ld K) vma %lx pagep %lx\n", proc->pid, vma->vm_start, vma->vm_end, (vma->vm_end - vma->vm_start) / SZ_1K, vma->vm_flags, pgprot_val(vma->vm_page_prot));
73308 + printk(KERN_INFO "binder: %d close vm area %lx-%lx (%ld K) vma %lx pagep %lx\n", proc->pid, vma->vm_start, vma->vm_end, (vma->vm_end - vma->vm_start) / SZ_1K, vma->vm_flags, vma->vm_page_prot.pgprot);
73309 proc->vma = NULL;
73310 }
73311
73312 @@ -2677,7 +2677,7 @@
73313 vma->vm_end = vma->vm_start + SZ_4M;
73314
73315 if (binder_debug_mask & BINDER_DEBUG_OPEN_CLOSE)
73316 - printk(KERN_INFO "binder_mmap: %d %lx-%lx (%ld K) vma %lx pagep %lx\n", proc->pid, vma->vm_start, vma->vm_end, (vma->vm_end - vma->vm_start) / SZ_1K, vma->vm_flags, pgprot_val(vma->vm_page_prot));
73317 + printk(KERN_INFO "binder_mmap: %d %lx-%lx (%ld K) vma %lx pagep %lx\n", proc->pid, vma->vm_start, vma->vm_end, (vma->vm_end - vma->vm_start) / SZ_1K, vma->vm_flags, vma->vm_page_prot.pgprot);
73318
73319 if (vma->vm_flags & FORBIDDEN_MMAP_FLAGS) {
73320 ret = -EPERM;
73321 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/android/Kconfig linux-2.6.29-rc3.owrt/drivers/staging/android/Kconfig
73322 --- linux-2.6.29.owrt/drivers/staging/android/Kconfig 2009-05-10 22:04:38.000000000 +0200
73323 +++ linux-2.6.29-rc3.owrt/drivers/staging/android/Kconfig 2009-05-10 23:48:29.000000000 +0200
73324 @@ -27,7 +27,6 @@
73325 bool "Android RAM Console Enable error correction"
73326 default n
73327 depends on ANDROID_RAM_CONSOLE
73328 - depends on !ANDROID_RAM_CONSOLE_EARLY_INIT
73329 select REED_SOLOMON
73330 select REED_SOLOMON_ENC8
73331 select REED_SOLOMON_DEC8
73332 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/android/lowmemorykiller.txt linux-2.6.29-rc3.owrt/drivers/staging/android/lowmemorykiller.txt
73333 --- linux-2.6.29.owrt/drivers/staging/android/lowmemorykiller.txt 2009-05-10 22:04:38.000000000 +0200
73334 +++ linux-2.6.29-rc3.owrt/drivers/staging/android/lowmemorykiller.txt 1970-01-01 01:00:00.000000000 +0100
73335 @@ -1,16 +0,0 @@
73336 -The lowmemorykiller driver lets user-space specify a set of memory thresholds
73337 -where processes with a range of oom_adj values will get killed. Specify the
73338 -minimum oom_adj values in /sys/module/lowmemorykiller/parameters/adj and the
73339 -number of free pages in /sys/module/lowmemorykiller/parameters/minfree. Both
73340 -files take a comma separated list of numbers in ascending order.
73341 -
73342 -For example, write "0,8" to /sys/module/lowmemorykiller/parameters/adj and
73343 -"1024,4096" to /sys/module/lowmemorykiller/parameters/minfree to kill processes
73344 -with a oom_adj value of 8 or higher when the free memory drops below 4096 pages
73345 -and kill processes with a oom_adj value of 0 or higher when the free memory
73346 -drops below 1024 pages.
73347 -
73348 -The driver considers memory used for caches to be free, but if a large
73349 -percentage of the cached memory is locked this can be very inaccurate
73350 -and processes may not get killed until the normal oom killer is triggered.
73351 -
73352 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/android/ram_console.c linux-2.6.29-rc3.owrt/drivers/staging/android/ram_console.c
73353 --- linux-2.6.29.owrt/drivers/staging/android/ram_console.c 2009-05-10 22:04:38.000000000 +0200
73354 +++ linux-2.6.29-rc3.owrt/drivers/staging/android/ram_console.c 2009-05-10 23:48:29.000000000 +0200
73355 @@ -224,23 +224,9 @@
73356 ram_console_buffer_size =
73357 buffer_size - sizeof(struct ram_console_buffer);
73358
73359 - if (ram_console_buffer_size > buffer_size) {
73360 - pr_err("ram_console: buffer %p, invalid size %d, datasize %d\n",
73361 - buffer, buffer_size, ram_console_buffer_size);
73362 - return 0;
73363 - }
73364 -
73365 #ifdef CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION
73366 ram_console_buffer_size -= (DIV_ROUND_UP(ram_console_buffer_size,
73367 ECC_BLOCK_SIZE) + 1) * ECC_SIZE;
73368 -
73369 - if (ram_console_buffer_size > buffer_size) {
73370 - pr_err("ram_console: buffer %p, invalid size %d, "
73371 - "non-ecc datasize %d\n",
73372 - buffer, buffer_size, ram_console_buffer_size);
73373 - return 0;
73374 - }
73375 -
73376 ram_console_par_buffer = buffer->data + ram_console_buffer_size;
73377
73378
73379 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/android/timed_gpio.c linux-2.6.29-rc3.owrt/drivers/staging/android/timed_gpio.c
73380 --- linux-2.6.29.owrt/drivers/staging/android/timed_gpio.c 2009-05-10 22:04:38.000000000 +0200
73381 +++ linux-2.6.29-rc3.owrt/drivers/staging/android/timed_gpio.c 2009-05-10 23:48:29.000000000 +0200
73382 @@ -18,7 +18,7 @@
73383 #include <linux/platform_device.h>
73384 #include <linux/hrtimer.h>
73385 #include <linux/err.h>
73386 -#include <linux/gpio.h>
73387 +#include <asm/arch/gpio.h>
73388
73389 #include "timed_gpio.h"
73390
73391 @@ -49,8 +49,7 @@
73392
73393 if (hrtimer_active(&gpio_data->timer)) {
73394 ktime_t r = hrtimer_get_remaining(&gpio_data->timer);
73395 - struct timeval t = ktime_to_timeval(r);
73396 - remaining = t.tv_sec * 1000 + t.tv_usec / 1000;
73397 + remaining = r.tv.sec * 1000 + r.tv.nsec / 1000000;
73398 } else
73399 remaining = 0;
73400
73401 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/at76_usb/at76_usb.c linux-2.6.29-rc3.owrt/drivers/staging/at76_usb/at76_usb.c
73402 --- linux-2.6.29.owrt/drivers/staging/at76_usb/at76_usb.c 2009-05-10 22:04:38.000000000 +0200
73403 +++ linux-2.6.29-rc3.owrt/drivers/staging/at76_usb/at76_usb.c 2009-05-10 23:48:29.000000000 +0200
73404 @@ -6,6 +6,7 @@
73405 * Copyright (c) 2004 Nick Jones
73406 * Copyright (c) 2004 Balint Seeber <n0_5p4m_p13453@hotmail.com>
73407 * Copyright (c) 2007 Guido Guenther <agx@sigxcpu.org>
73408 + * Copyright (c) 2007 Kalle Valo <kalle.valo@iki.fi>
73409 *
73410 * This program is free software; you can redistribute it and/or
73411 * modify it under the terms of the GNU General Public License as
73412 @@ -16,6 +17,13 @@
73413 * Atmel AT76C503A/505/505A.
73414 *
73415 * Some iw_handler code was taken from airo.c, (C) 1999 Benjamin Reed
73416 + *
73417 + * TODO for the mac80211 port:
73418 + * o adhoc support
73419 + * o RTS/CTS support
73420 + * o Power Save Mode support
73421 + * o support for short/long preambles
73422 + * o export variables through debugfs/sysfs
73423 */
73424
73425 #include <linux/init.h>
73426 @@ -36,7 +44,7 @@
73427 #include <net/ieee80211_radiotap.h>
73428 #include <linux/firmware.h>
73429 #include <linux/leds.h>
73430 -#include <net/ieee80211.h>
73431 +#include <net/mac80211.h>
73432
73433 #include "at76_usb.h"
73434
73435 @@ -76,31 +84,43 @@
73436 #define DBG_WE_EVENTS 0x08000000 /* dump wireless events */
73437 #define DBG_FW 0x10000000 /* firmware download */
73438 #define DBG_DFU 0x20000000 /* device firmware upgrade */
73439 +#define DBG_CMD 0x40000000
73440 +#define DBG_MAC80211 0x80000000
73441
73442 #define DBG_DEFAULTS 0
73443
73444 /* Use our own dbg macro */
73445 #define at76_dbg(bits, format, arg...) \
73446 - do { \
73447 - if (at76_debug & (bits)) \
73448 +do { \
73449 + if (at76_debug & (bits)) \
73450 + printk(KERN_DEBUG DRIVER_NAME ": " format "\n" , ## arg); \
73451 +} while (0)
73452 +
73453 +#define at76_dbg_dump(bits, buf, len, format, arg...) \
73454 +do { \
73455 + if (at76_debug & (bits)) { \
73456 printk(KERN_DEBUG DRIVER_NAME ": " format "\n" , ## arg); \
73457 - } while (0)
73458 + print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, buf, len); \
73459 + } \
73460 +} while (0)
73461
73462 static int at76_debug = DBG_DEFAULTS;
73463
73464 +#define FIRMWARE_IS_WPA(ver) ((ver.major == 1) && (ver.minor == 103))
73465 +
73466 /* Protect against concurrent firmware loading and parsing */
73467 static struct mutex fw_mutex;
73468
73469 static struct fwentry firmwares[] = {
73470 - [0] = {""},
73471 - [BOARD_503_ISL3861] = {"atmel_at76c503-i3861.bin"},
73472 - [BOARD_503_ISL3863] = {"atmel_at76c503-i3863.bin"},
73473 - [BOARD_503] = {"atmel_at76c503-rfmd.bin"},
73474 - [BOARD_503_ACC] = {"atmel_at76c503-rfmd-acc.bin"},
73475 - [BOARD_505] = {"atmel_at76c505-rfmd.bin"},
73476 - [BOARD_505_2958] = {"atmel_at76c505-rfmd2958.bin"},
73477 - [BOARD_505A] = {"atmel_at76c505a-rfmd2958.bin"},
73478 - [BOARD_505AMX] = {"atmel_at76c505amx-rfmd.bin"},
73479 + [0] = { "" },
73480 + [BOARD_503_ISL3861] = { "atmel_at76c503-i3861.bin" },
73481 + [BOARD_503_ISL3863] = { "atmel_at76c503-i3863.bin" },
73482 + [BOARD_503] = { "atmel_at76c503-rfmd.bin" },
73483 + [BOARD_503_ACC] = { "atmel_at76c503-rfmd-acc.bin" },
73484 + [BOARD_505] = { "atmel_at76c505-rfmd.bin" },
73485 + [BOARD_505_2958] = { "atmel_at76c505-rfmd2958.bin" },
73486 + [BOARD_505A] = { "atmel_at76c505a-rfmd2958.bin" },
73487 + [BOARD_505AMX] = { "atmel_at76c505amx-rfmd.bin" },
73488 };
73489
73490 #define USB_DEVICE_DATA(__ops) .driver_info = (kernel_ulong_t)(__ops)
73491 @@ -110,135 +130,133 @@
73492 * at76c503-i3861
73493 */
73494 /* Generic AT76C503/3861 device */
73495 - {USB_DEVICE(0x03eb, 0x7603), USB_DEVICE_DATA(BOARD_503_ISL3861)},
73496 + { USB_DEVICE(0x03eb, 0x7603), USB_DEVICE_DATA(BOARD_503_ISL3861) },
73497 /* Linksys WUSB11 v2.1/v2.6 */
73498 - {USB_DEVICE(0x066b, 0x2211), USB_DEVICE_DATA(BOARD_503_ISL3861)},
73499 + { USB_DEVICE(0x066b, 0x2211), USB_DEVICE_DATA(BOARD_503_ISL3861) },
73500 /* Netgear MA101 rev. A */
73501 - {USB_DEVICE(0x0864, 0x4100), USB_DEVICE_DATA(BOARD_503_ISL3861)},
73502 + { USB_DEVICE(0x0864, 0x4100), USB_DEVICE_DATA(BOARD_503_ISL3861) },
73503 /* Tekram U300C / Allnet ALL0193 */
73504 - {USB_DEVICE(0x0b3b, 0x1612), USB_DEVICE_DATA(BOARD_503_ISL3861)},
73505 + { USB_DEVICE(0x0b3b, 0x1612), USB_DEVICE_DATA(BOARD_503_ISL3861) },
73506 /* HP HN210W J7801A */
73507 - {USB_DEVICE(0x03f0, 0x011c), USB_DEVICE_DATA(BOARD_503_ISL3861)},
73508 + { USB_DEVICE(0x03f0, 0x011c), USB_DEVICE_DATA(BOARD_503_ISL3861) },
73509 /* Sitecom/Z-Com/Zyxel M4Y-750 */
73510 - {USB_DEVICE(0x0cde, 0x0001), USB_DEVICE_DATA(BOARD_503_ISL3861)},
73511 + { USB_DEVICE(0x0cde, 0x0001), USB_DEVICE_DATA(BOARD_503_ISL3861) },
73512 /* Dynalink/Askey WLL013 (intersil) */
73513 - {USB_DEVICE(0x069a, 0x0320), USB_DEVICE_DATA(BOARD_503_ISL3861)},
73514 + { USB_DEVICE(0x069a, 0x0320), USB_DEVICE_DATA(BOARD_503_ISL3861) },
73515 /* EZ connect 11Mpbs Wireless USB Adapter SMC2662W v1 */
73516 - {USB_DEVICE(0x0d5c, 0xa001), USB_DEVICE_DATA(BOARD_503_ISL3861)},
73517 + { USB_DEVICE(0x0d5c, 0xa001), USB_DEVICE_DATA(BOARD_503_ISL3861) },
73518 /* BenQ AWL300 */
73519 - {USB_DEVICE(0x04a5, 0x9000), USB_DEVICE_DATA(BOARD_503_ISL3861)},
73520 + { USB_DEVICE(0x04a5, 0x9000), USB_DEVICE_DATA(BOARD_503_ISL3861) },
73521 /* Addtron AWU-120, Compex WLU11 */
73522 - {USB_DEVICE(0x05dd, 0xff31), USB_DEVICE_DATA(BOARD_503_ISL3861)},
73523 + { USB_DEVICE(0x05dd, 0xff31), USB_DEVICE_DATA(BOARD_503_ISL3861) },
73524 /* Intel AP310 AnyPoint II USB */
73525 - {USB_DEVICE(0x8086, 0x0200), USB_DEVICE_DATA(BOARD_503_ISL3861)},
73526 + { USB_DEVICE(0x8086, 0x0200), USB_DEVICE_DATA(BOARD_503_ISL3861) },
73527 /* Dynalink L11U */
73528 - {USB_DEVICE(0x0d8e, 0x7100), USB_DEVICE_DATA(BOARD_503_ISL3861)},
73529 + { USB_DEVICE(0x0d8e, 0x7100), USB_DEVICE_DATA(BOARD_503_ISL3861) },
73530 /* Arescom WL-210, FCC id 07J-GL2411USB */
73531 - {USB_DEVICE(0x0d8e, 0x7110), USB_DEVICE_DATA(BOARD_503_ISL3861)},
73532 + { USB_DEVICE(0x0d8e, 0x7110), USB_DEVICE_DATA(BOARD_503_ISL3861) },
73533 /* I-O DATA WN-B11/USB */
73534 - {USB_DEVICE(0x04bb, 0x0919), USB_DEVICE_DATA(BOARD_503_ISL3861)},
73535 + { USB_DEVICE(0x04bb, 0x0919), USB_DEVICE_DATA(BOARD_503_ISL3861) },
73536 /* BT Voyager 1010 */
73537 - {USB_DEVICE(0x069a, 0x0821), USB_DEVICE_DATA(BOARD_503_ISL3861)},
73538 + { USB_DEVICE(0x069a, 0x0821), USB_DEVICE_DATA(BOARD_503_ISL3861) },
73539 /*
73540 * at76c503-i3863
73541 */
73542 /* Generic AT76C503/3863 device */
73543 - {USB_DEVICE(0x03eb, 0x7604), USB_DEVICE_DATA(BOARD_503_ISL3863)},
73544 + { USB_DEVICE(0x03eb, 0x7604), USB_DEVICE_DATA(BOARD_503_ISL3863) },
73545 /* Samsung SWL-2100U */
73546 - {USB_DEVICE(0x055d, 0xa000), USB_DEVICE_DATA(BOARD_503_ISL3863)},
73547 + { USB_DEVICE(0x055d, 0xa000), USB_DEVICE_DATA(BOARD_503_ISL3863) },
73548 /*
73549 * at76c503-rfmd
73550 */
73551 /* Generic AT76C503/RFMD device */
73552 - {USB_DEVICE(0x03eb, 0x7605), USB_DEVICE_DATA(BOARD_503)},
73553 + { USB_DEVICE(0x03eb, 0x7605), USB_DEVICE_DATA(BOARD_503) },
73554 /* Dynalink/Askey WLL013 (rfmd) */
73555 - {USB_DEVICE(0x069a, 0x0321), USB_DEVICE_DATA(BOARD_503)},
73556 + { USB_DEVICE(0x069a, 0x0321), USB_DEVICE_DATA(BOARD_503) },
73557 /* Linksys WUSB11 v2.6 */
73558 - {USB_DEVICE(0x077b, 0x2219), USB_DEVICE_DATA(BOARD_503)},
73559 + { USB_DEVICE(0x077b, 0x2219), USB_DEVICE_DATA(BOARD_503) },
73560 /* Network Everywhere NWU11B */
73561 - {USB_DEVICE(0x077b, 0x2227), USB_DEVICE_DATA(BOARD_503)},
73562 + { USB_DEVICE(0x077b, 0x2227), USB_DEVICE_DATA(BOARD_503) },
73563 /* Netgear MA101 rev. B */
73564 - {USB_DEVICE(0x0864, 0x4102), USB_DEVICE_DATA(BOARD_503)},
73565 + { USB_DEVICE(0x0864, 0x4102), USB_DEVICE_DATA(BOARD_503) },
73566 /* D-Link DWL-120 rev. E */
73567 - {USB_DEVICE(0x2001, 0x3200), USB_DEVICE_DATA(BOARD_503)},
73568 + { USB_DEVICE(0x2001, 0x3200), USB_DEVICE_DATA(BOARD_503) },
73569 /* Actiontec 802UAT1, HWU01150-01UK */
73570 - {USB_DEVICE(0x1668, 0x7605), USB_DEVICE_DATA(BOARD_503)},
73571 + { USB_DEVICE(0x1668, 0x7605), USB_DEVICE_DATA(BOARD_503) },
73572 /* AirVast W-Buddie WN210 */
73573 - {USB_DEVICE(0x03eb, 0x4102), USB_DEVICE_DATA(BOARD_503)},
73574 + { USB_DEVICE(0x03eb, 0x4102), USB_DEVICE_DATA(BOARD_503) },
73575 /* Dick Smith Electronics XH1153 802.11b USB adapter */
73576 - {USB_DEVICE(0x1371, 0x5743), USB_DEVICE_DATA(BOARD_503)},
73577 + { USB_DEVICE(0x1371, 0x5743), USB_DEVICE_DATA(BOARD_503) },
73578 /* CNet CNUSB611 */
73579 - {USB_DEVICE(0x1371, 0x0001), USB_DEVICE_DATA(BOARD_503)},
73580 + { USB_DEVICE(0x1371, 0x0001), USB_DEVICE_DATA(BOARD_503) },
73581 /* FiberLine FL-WL200U */
73582 - {USB_DEVICE(0x1371, 0x0002), USB_DEVICE_DATA(BOARD_503)},
73583 + { USB_DEVICE(0x1371, 0x0002), USB_DEVICE_DATA(BOARD_503) },
73584 /* BenQ AWL400 USB stick */
73585 - {USB_DEVICE(0x04a5, 0x9001), USB_DEVICE_DATA(BOARD_503)},
73586 + { USB_DEVICE(0x04a5, 0x9001), USB_DEVICE_DATA(BOARD_503) },
73587 /* 3Com 3CRSHEW696 */
73588 - {USB_DEVICE(0x0506, 0x0a01), USB_DEVICE_DATA(BOARD_503)},
73589 + { USB_DEVICE(0x0506, 0x0a01), USB_DEVICE_DATA(BOARD_503) },
73590 /* Siemens Santis ADSL WLAN USB adapter WLL 013 */
73591 - {USB_DEVICE(0x0681, 0x001b), USB_DEVICE_DATA(BOARD_503)},
73592 + { USB_DEVICE(0x0681, 0x001b), USB_DEVICE_DATA(BOARD_503) },
73593 /* Belkin F5D6050, version 2 */
73594 - {USB_DEVICE(0x050d, 0x0050), USB_DEVICE_DATA(BOARD_503)},
73595 + { USB_DEVICE(0x050d, 0x0050), USB_DEVICE_DATA(BOARD_503) },
73596 /* iBlitzz, BWU613 (not *B or *SB) */
73597 - {USB_DEVICE(0x07b8, 0xb000), USB_DEVICE_DATA(BOARD_503)},
73598 + { USB_DEVICE(0x07b8, 0xb000), USB_DEVICE_DATA(BOARD_503) },
73599 /* Gigabyte GN-WLBM101 */
73600 - {USB_DEVICE(0x1044, 0x8003), USB_DEVICE_DATA(BOARD_503)},
73601 + { USB_DEVICE(0x1044, 0x8003), USB_DEVICE_DATA(BOARD_503) },
73602 /* Planex GW-US11S */
73603 - {USB_DEVICE(0x2019, 0x3220), USB_DEVICE_DATA(BOARD_503)},
73604 + { USB_DEVICE(0x2019, 0x3220), USB_DEVICE_DATA(BOARD_503) },
73605 /* Internal WLAN adapter in h5[4,5]xx series iPAQs */
73606 - {USB_DEVICE(0x049f, 0x0032), USB_DEVICE_DATA(BOARD_503)},
73607 + { USB_DEVICE(0x049f, 0x0032), USB_DEVICE_DATA(BOARD_503) },
73608 /* Corega Wireless LAN USB-11 mini */
73609 - {USB_DEVICE(0x07aa, 0x0011), USB_DEVICE_DATA(BOARD_503)},
73610 + { USB_DEVICE(0x07aa, 0x0011), USB_DEVICE_DATA(BOARD_503) },
73611 /* Corega Wireless LAN USB-11 mini2 */
73612 - {USB_DEVICE(0x07aa, 0x0018), USB_DEVICE_DATA(BOARD_503)},
73613 + { USB_DEVICE(0x07aa, 0x0018), USB_DEVICE_DATA(BOARD_503) },
73614 /* Uniden PCW100 */
73615 - {USB_DEVICE(0x05dd, 0xff35), USB_DEVICE_DATA(BOARD_503)},
73616 + { USB_DEVICE(0x05dd, 0xff35), USB_DEVICE_DATA(BOARD_503) },
73617 /*
73618 * at76c503-rfmd-acc
73619 */
73620 /* SMC2664W */
73621 - {USB_DEVICE(0x083a, 0x3501), USB_DEVICE_DATA(BOARD_503_ACC)},
73622 + { USB_DEVICE(0x083a, 0x3501), USB_DEVICE_DATA(BOARD_503_ACC) },
73623 /* Belkin F5D6050, SMC2662W v2, SMC2662W-AR */
73624 - {USB_DEVICE(0x0d5c, 0xa002), USB_DEVICE_DATA(BOARD_503_ACC)},
73625 + { USB_DEVICE(0x0d5c, 0xa002), USB_DEVICE_DATA(BOARD_503_ACC) },
73626 /*
73627 * at76c505-rfmd
73628 */
73629 /* Generic AT76C505/RFMD */
73630 - {USB_DEVICE(0x03eb, 0x7606), USB_DEVICE_DATA(BOARD_505)},
73631 + { USB_DEVICE(0x03eb, 0x7606), USB_DEVICE_DATA(BOARD_505) },
73632 /*
73633 * at76c505-rfmd2958
73634 */
73635 /* Generic AT76C505/RFMD, OvisLink WL-1130USB */
73636 - {USB_DEVICE(0x03eb, 0x7613), USB_DEVICE_DATA(BOARD_505_2958)},
73637 + { USB_DEVICE(0x03eb, 0x7613), USB_DEVICE_DATA(BOARD_505_2958) },
73638 /* Fiberline FL-WL240U */
73639 - {USB_DEVICE(0x1371, 0x0014), USB_DEVICE_DATA(BOARD_505_2958)},
73640 + { USB_DEVICE(0x1371, 0x0014), USB_DEVICE_DATA(BOARD_505_2958) },
73641 /* CNet CNUSB-611G */
73642 - {USB_DEVICE(0x1371, 0x0013), USB_DEVICE_DATA(BOARD_505_2958)},
73643 + { USB_DEVICE(0x1371, 0x0013), USB_DEVICE_DATA(BOARD_505_2958) },
73644 /* Linksys WUSB11 v2.8 */
73645 - {USB_DEVICE(0x1915, 0x2233), USB_DEVICE_DATA(BOARD_505_2958)},
73646 + { USB_DEVICE(0x1915, 0x2233), USB_DEVICE_DATA(BOARD_505_2958) },
73647 /* Xterasys XN-2122B, IBlitzz BWU613B/BWU613SB */
73648 - {USB_DEVICE(0x12fd, 0x1001), USB_DEVICE_DATA(BOARD_505_2958)},
73649 + { USB_DEVICE(0x12fd, 0x1001), USB_DEVICE_DATA(BOARD_505_2958) },
73650 /* Corega WLAN USB Stick 11 */
73651 - {USB_DEVICE(0x07aa, 0x7613), USB_DEVICE_DATA(BOARD_505_2958)},
73652 + { USB_DEVICE(0x07aa, 0x7613), USB_DEVICE_DATA(BOARD_505_2958) },
73653 /* Microstar MSI Box MS6978 */
73654 - {USB_DEVICE(0x0db0, 0x1020), USB_DEVICE_DATA(BOARD_505_2958)},
73655 + { USB_DEVICE(0x0db0, 0x1020), USB_DEVICE_DATA(BOARD_505_2958) },
73656 /*
73657 * at76c505a-rfmd2958
73658 */
73659 /* Generic AT76C505A device */
73660 - {USB_DEVICE(0x03eb, 0x7614), USB_DEVICE_DATA(BOARD_505A)},
73661 + { USB_DEVICE(0x03eb, 0x7614), USB_DEVICE_DATA(BOARD_505A) },
73662 /* Generic AT76C505AS device */
73663 - {USB_DEVICE(0x03eb, 0x7617), USB_DEVICE_DATA(BOARD_505A)},
73664 + { USB_DEVICE(0x03eb, 0x7617), USB_DEVICE_DATA(BOARD_505A) },
73665 /* Siemens Gigaset USB WLAN Adapter 11 */
73666 - {USB_DEVICE(0x1690, 0x0701), USB_DEVICE_DATA(BOARD_505A)},
73667 - /* OQO Model 01+ Internal Wi-Fi */
73668 - {USB_DEVICE(0x1557, 0x0002), USB_DEVICE_DATA(BOARD_505A)},
73669 + { USB_DEVICE(0x1690, 0x0701), USB_DEVICE_DATA(BOARD_505A) },
73670 /*
73671 * at76c505amx-rfmd
73672 */
73673 /* Generic AT76C505AMX device */
73674 - {USB_DEVICE(0x03eb, 0x7615), USB_DEVICE_DATA(BOARD_505AMX)},
73675 - {}
73676 + { USB_DEVICE(0x03eb, 0x7615), USB_DEVICE_DATA(BOARD_505AMX) },
73677 + { }
73678 };
73679
73680 MODULE_DEVICE_TABLE(usb, dev_table);
73681 @@ -246,26 +264,8 @@
73682 /* Supported rates of this hardware, bit 7 marks basic rates */
73683 static const u8 hw_rates[] = { 0x82, 0x84, 0x0b, 0x16 };
73684
73685 -/* Frequency of each channel in MHz */
73686 -static const long channel_frequency[] = {
73687 - 2412, 2417, 2422, 2427, 2432, 2437, 2442,
73688 - 2447, 2452, 2457, 2462, 2467, 2472, 2484
73689 -};
73690 -
73691 -#define NUM_CHANNELS ARRAY_SIZE(channel_frequency)
73692 -
73693 static const char *const preambles[] = { "long", "short", "auto" };
73694
73695 -static const char *const mac_states[] = {
73696 - [MAC_INIT] = "INIT",
73697 - [MAC_SCANNING] = "SCANNING",
73698 - [MAC_AUTH] = "AUTH",
73699 - [MAC_ASSOC] = "ASSOC",
73700 - [MAC_JOINING] = "JOINING",
73701 - [MAC_CONNECTED] = "CONNECTED",
73702 - [MAC_OWN_IBSS] = "OWN_IBSS"
73703 -};
73704 -
73705 /* Firmware download */
73706 /* DFU states */
73707 #define STATE_IDLE 0x00
73708 @@ -300,17 +300,30 @@
73709
73710 static inline int at76_is_intersil(enum board_type board)
73711 {
73712 - return (board == BOARD_503_ISL3861 || board == BOARD_503_ISL3863);
73713 + if (board == BOARD_503_ISL3861 || board == BOARD_503_ISL3863)
73714 + return 1;
73715 + return 0;
73716 }
73717
73718 static inline int at76_is_503rfmd(enum board_type board)
73719 {
73720 - return (board == BOARD_503 || board == BOARD_503_ACC);
73721 + if (board == BOARD_503 || board == BOARD_503_ACC)
73722 + return 1;
73723 + return 0;
73724 +}
73725 +
73726 +static inline int at76_is_505(enum board_type board)
73727 +{
73728 + if (board == BOARD_505 || board == BOARD_505_2958)
73729 + return 1;
73730 + return 0;
73731 }
73732
73733 static inline int at76_is_505a(enum board_type board)
73734 {
73735 - return (board == BOARD_505A || board == BOARD_505AMX);
73736 + if (board == BOARD_505A || board == BOARD_505AMX)
73737 + return 1;
73738 + return 0;
73739 }
73740
73741 /* Load a block of the first (internal) part of the firmware */
73742 @@ -491,41 +504,6 @@
73743 return ret;
73744 }
73745
73746 -/* Report that the scan results are ready */
73747 -static inline void at76_iwevent_scan_complete(struct net_device *netdev)
73748 -{
73749 - union iwreq_data wrqu;
73750 - wrqu.data.length = 0;
73751 - wrqu.data.flags = 0;
73752 - wireless_send_event(netdev, SIOCGIWSCAN, &wrqu, NULL);
73753 - at76_dbg(DBG_WE_EVENTS, "%s: SIOCGIWSCAN sent", netdev->name);
73754 -}
73755 -
73756 -static inline void at76_iwevent_bss_connect(struct net_device *netdev,
73757 - u8 *bssid)
73758 -{
73759 - union iwreq_data wrqu;
73760 - wrqu.data.length = 0;
73761 - wrqu.data.flags = 0;
73762 - memcpy(wrqu.ap_addr.sa_data, bssid, ETH_ALEN);
73763 - wrqu.ap_addr.sa_family = ARPHRD_ETHER;
73764 - wireless_send_event(netdev, SIOCGIWAP, &wrqu, NULL);
73765 - at76_dbg(DBG_WE_EVENTS, "%s: %s: SIOCGIWAP sent", netdev->name,
73766 - __func__);
73767 -}
73768 -
73769 -static inline void at76_iwevent_bss_disconnect(struct net_device *netdev)
73770 -{
73771 - union iwreq_data wrqu;
73772 - wrqu.data.length = 0;
73773 - wrqu.data.flags = 0;
73774 - memset(wrqu.ap_addr.sa_data, 0, ETH_ALEN);
73775 - wrqu.ap_addr.sa_family = ARPHRD_ETHER;
73776 - wireless_send_event(netdev, SIOCGIWAP, &wrqu, NULL);
73777 - at76_dbg(DBG_WE_EVENTS, "%s: %s: SIOCGIWAP sent", netdev->name,
73778 - __func__);
73779 -}
73780 -
73781 #define HEX2STR_BUFFERS 4
73782 #define HEX2STR_MAX_LEN 64
73783 #define BIN2HEX(x) ((x) < 10 ? '0' + (x) : (x) + 'A' - 10)
73784 @@ -597,37 +575,6 @@
73785 mod_timer(&ledtrig_tx_timer, jiffies + HZ / 4);
73786 }
73787
73788 -/* Check if the given ssid is hidden */
73789 -static inline int at76_is_hidden_ssid(u8 *ssid, int length)
73790 -{
73791 - static const u8 zeros[32];
73792 -
73793 - if (length == 0)
73794 - return 1;
73795 -
73796 - if (length == 1 && ssid[0] == ' ')
73797 - return 1;
73798 -
73799 - return (memcmp(ssid, zeros, length) == 0);
73800 -}
73801 -
73802 -static inline void at76_free_bss_list(struct at76_priv *priv)
73803 -{
73804 - struct list_head *next, *ptr;
73805 - unsigned long flags;
73806 -
73807 - spin_lock_irqsave(&priv->bss_list_spinlock, flags);
73808 -
73809 - priv->curr_bss = NULL;
73810 -
73811 - list_for_each_safe(ptr, next, &priv->bss_list) {
73812 - list_del(ptr);
73813 - kfree(list_entry(ptr, struct bss_info, list));
73814 - }
73815 -
73816 - spin_unlock_irqrestore(&priv->bss_list_spinlock, flags);
73817 -}
73818 -
73819 static int at76_remap(struct usb_device *udev)
73820 {
73821 int ret;
73822 @@ -651,7 +598,7 @@
73823 return -ENOMEM;
73824 ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 0x33,
73825 USB_TYPE_VENDOR | USB_DIR_IN |
73826 - USB_RECIP_INTERFACE, 0x01, 0, op_mode, 1,
73827 + USB_RECIP_INTERFACE, 0x01, 0, &op_mode, 1,
73828 USB_CTRL_GET_TIMEOUT);
73829 saved = *op_mode;
73830 kfree(op_mode);
73831 @@ -729,7 +676,7 @@
73832 kfree(hwcfg);
73833 if (ret < 0)
73834 printk(KERN_ERR "%s: cannot get HW Config (error %d)\n",
73835 - priv->netdev->name, ret);
73836 + wiphy_name(priv->hw->wiphy), ret);
73837
73838 return ret;
73839 }
73840 @@ -738,15 +685,15 @@
73841 {
73842 int i;
73843 static struct reg_domain const fd_tab[] = {
73844 - {0x10, "FCC (USA)", 0x7ff}, /* ch 1-11 */
73845 - {0x20, "IC (Canada)", 0x7ff}, /* ch 1-11 */
73846 - {0x30, "ETSI (most of Europe)", 0x1fff}, /* ch 1-13 */
73847 - {0x31, "Spain", 0x600}, /* ch 10-11 */
73848 - {0x32, "France", 0x1e00}, /* ch 10-13 */
73849 - {0x40, "MKK (Japan)", 0x2000}, /* ch 14 */
73850 - {0x41, "MKK1 (Japan)", 0x3fff}, /* ch 1-14 */
73851 - {0x50, "Israel", 0x3fc}, /* ch 3-9 */
73852 - {0x00, "<unknown>", 0xffffffff} /* ch 1-32 */
73853 + { 0x10, "FCC (USA)", 0x7ff }, /* ch 1-11 */
73854 + { 0x20, "IC (Canada)", 0x7ff }, /* ch 1-11 */
73855 + { 0x30, "ETSI (most of Europe)", 0x1fff }, /* ch 1-13 */
73856 + { 0x31, "Spain", 0x600 }, /* ch 10-11 */
73857 + { 0x32, "France", 0x1e00 }, /* ch 10-13 */
73858 + { 0x40, "MKK (Japan)", 0x2000 }, /* ch 14 */
73859 + { 0x41, "MKK1 (Japan)", 0x3fff }, /* ch 1-14 */
73860 + { 0x50, "Israel", 0x3fc }, /* ch 3-9 */
73861 + { 0x00, "<unknown>", 0xffffffff } /* ch 1-32 */
73862 };
73863
73864 /* Last entry is fallback for unknown domain code */
73865 @@ -784,7 +731,7 @@
73866 ret = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 0x22,
73867 USB_TYPE_VENDOR | USB_DIR_IN |
73868 USB_RECIP_INTERFACE, cmd, 0, stat_buf,
73869 - 40, USB_CTRL_GET_TIMEOUT);
73870 + sizeof(stat_buf), USB_CTRL_GET_TIMEOUT);
73871 if (ret >= 0)
73872 ret = stat_buf[5];
73873 kfree(stat_buf);
73874 @@ -792,6 +739,24 @@
73875 return ret;
73876 }
73877
73878 +#define MAKE_CMD_CASE(c) case (c): return #c
73879 +
73880 +static const char *at76_get_cmd_string(u8 cmd_status)
73881 +{
73882 + switch (cmd_status) {
73883 + MAKE_CMD_CASE(CMD_SET_MIB);
73884 + MAKE_CMD_CASE(CMD_GET_MIB);
73885 + MAKE_CMD_CASE(CMD_SCAN);
73886 + MAKE_CMD_CASE(CMD_JOIN);
73887 + MAKE_CMD_CASE(CMD_START_IBSS);
73888 + MAKE_CMD_CASE(CMD_RADIO_ON);
73889 + MAKE_CMD_CASE(CMD_RADIO_OFF);
73890 + MAKE_CMD_CASE(CMD_STARTUP);
73891 + }
73892 +
73893 + return "UNKNOWN";
73894 +}
73895 +
73896 static int at76_set_card_command(struct usb_device *udev, u8 cmd, void *buf,
73897 int buf_size)
73898 {
73899 @@ -807,6 +772,10 @@
73900 cmd_buf->size = cpu_to_le16(buf_size);
73901 memcpy(cmd_buf->data, buf, buf_size);
73902
73903 + at76_dbg_dump(DBG_CMD, cmd_buf, sizeof(struct at76_command) + buf_size,
73904 + "issuing command %s (0x%02x)",
73905 + at76_get_cmd_string(cmd), cmd);
73906 +
73907 ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x0e,
73908 USB_TYPE_VENDOR | USB_DIR_OUT | USB_RECIP_DEVICE,
73909 0, 0, cmd_buf,
73910 @@ -844,13 +813,13 @@
73911 status = at76_get_cmd_status(priv->udev, cmd);
73912 if (status < 0) {
73913 printk(KERN_ERR "%s: at76_get_cmd_status failed: %d\n",
73914 - priv->netdev->name, status);
73915 + wiphy_name(priv->hw->wiphy), status);
73916 break;
73917 }
73918
73919 at76_dbg(DBG_WAIT_COMPLETE,
73920 "%s: Waiting on cmd %d, status = %d (%s)",
73921 - priv->netdev->name, cmd, status,
73922 + wiphy_name(priv->hw->wiphy), cmd, status,
73923 at76_get_cmd_status_string(status));
73924
73925 if (status != CMD_STATUS_IN_PROGRESS
73926 @@ -861,7 +830,7 @@
73927 if (time_after(jiffies, timeout)) {
73928 printk(KERN_ERR
73929 "%s: completion timeout for command %d\n",
73930 - priv->netdev->name, cmd);
73931 + wiphy_name(priv->hw->wiphy), cmd);
73932 status = -ETIMEDOUT;
73933 break;
73934 }
73935 @@ -884,7 +853,7 @@
73936 if (ret != CMD_STATUS_COMPLETE) {
73937 printk(KERN_INFO
73938 "%s: set_mib: at76_wait_completion failed "
73939 - "with %d\n", priv->netdev->name, ret);
73940 + "with %d\n", wiphy_name(priv->hw->wiphy), ret);
73941 ret = -EIO;
73942 }
73943
73944 @@ -905,7 +874,7 @@
73945 ret = at76_set_card_command(priv->udev, cmd, NULL, 0);
73946 if (ret < 0)
73947 printk(KERN_ERR "%s: at76_set_card_command(%d) failed: %d\n",
73948 - priv->netdev->name, cmd, ret);
73949 + wiphy_name(priv->hw->wiphy), cmd, ret);
73950 else
73951 ret = 1;
73952
73953 @@ -926,44 +895,7 @@
73954 ret = at76_set_mib(priv, &priv->mib_buf);
73955 if (ret < 0)
73956 printk(KERN_ERR "%s: set_mib (pm_mode) failed: %d\n",
73957 - priv->netdev->name, ret);
73958 -
73959 - return ret;
73960 -}
73961 -
73962 -/* Set the association id for power save mode */
73963 -static int at76_set_associd(struct at76_priv *priv, u16 id)
73964 -{
73965 - int ret = 0;
73966 -
73967 - priv->mib_buf.type = MIB_MAC_MGMT;
73968 - priv->mib_buf.size = 2;
73969 - priv->mib_buf.index = offsetof(struct mib_mac_mgmt, station_id);
73970 - priv->mib_buf.data.word = cpu_to_le16(id);
73971 -
73972 - ret = at76_set_mib(priv, &priv->mib_buf);
73973 - if (ret < 0)
73974 - printk(KERN_ERR "%s: set_mib (associd) failed: %d\n",
73975 - priv->netdev->name, ret);
73976 -
73977 - return ret;
73978 -}
73979 -
73980 -/* Set the listen interval for power save mode */
73981 -static int at76_set_listen_interval(struct at76_priv *priv, u16 interval)
73982 -{
73983 - int ret = 0;
73984 -
73985 - priv->mib_buf.type = MIB_MAC;
73986 - priv->mib_buf.size = 2;
73987 - priv->mib_buf.index = offsetof(struct mib_mac, listen_interval);
73988 - priv->mib_buf.data.word = cpu_to_le16(interval);
73989 -
73990 - ret = at76_set_mib(priv, &priv->mib_buf);
73991 - if (ret < 0)
73992 - printk(KERN_ERR
73993 - "%s: set_mib (listen_interval) failed: %d\n",
73994 - priv->netdev->name, ret);
73995 + wiphy_name(priv->hw->wiphy), ret);
73996
73997 return ret;
73998 }
73999 @@ -980,7 +912,7 @@
74000 ret = at76_set_mib(priv, &priv->mib_buf);
74001 if (ret < 0)
74002 printk(KERN_ERR "%s: set_mib (preamble) failed: %d\n",
74003 - priv->netdev->name, ret);
74004 + wiphy_name(priv->hw->wiphy), ret);
74005
74006 return ret;
74007 }
74008 @@ -997,7 +929,7 @@
74009 ret = at76_set_mib(priv, &priv->mib_buf);
74010 if (ret < 0)
74011 printk(KERN_ERR "%s: set_mib (frag threshold) failed: %d\n",
74012 - priv->netdev->name, ret);
74013 + wiphy_name(priv->hw->wiphy), ret);
74014
74015 return ret;
74016 }
74017 @@ -1014,7 +946,7 @@
74018 ret = at76_set_mib(priv, &priv->mib_buf);
74019 if (ret < 0)
74020 printk(KERN_ERR "%s: set_mib (rts) failed: %d\n",
74021 - priv->netdev->name, ret);
74022 + wiphy_name(priv->hw->wiphy), ret);
74023
74024 return ret;
74025 }
74026 @@ -1031,24 +963,41 @@
74027 ret = at76_set_mib(priv, &priv->mib_buf);
74028 if (ret < 0)
74029 printk(KERN_ERR "%s: set_mib (autorate fallback) failed: %d\n",
74030 - priv->netdev->name, ret);
74031 + wiphy_name(priv->hw->wiphy), ret);
74032
74033 return ret;
74034 }
74035
74036 -static int at76_add_mac_address(struct at76_priv *priv, void *addr)
74037 +static int at76_set_tkip_bssid(struct at76_priv *priv, const void *addr)
74038 {
74039 int ret = 0;
74040
74041 - priv->mib_buf.type = MIB_MAC_ADDR;
74042 + priv->mib_buf.type = MIB_MAC_ENCRYPTION;
74043 priv->mib_buf.size = ETH_ALEN;
74044 - priv->mib_buf.index = offsetof(struct mib_mac_addr, mac_addr);
74045 + priv->mib_buf.index = offsetof(struct mib_mac_encryption, tkip_bssid);
74046 memcpy(priv->mib_buf.data.addr, addr, ETH_ALEN);
74047
74048 ret = at76_set_mib(priv, &priv->mib_buf);
74049 if (ret < 0)
74050 - printk(KERN_ERR "%s: set_mib (MAC_ADDR, mac_addr) failed: %d\n",
74051 - priv->netdev->name, ret);
74052 + printk(KERN_ERR "%s: set_mib (MAC_ENCRYPTION, tkip_bssid) failed: %d\n",
74053 + wiphy_name(priv->hw->wiphy), ret);
74054 +
74055 + return ret;
74056 +}
74057 +
74058 +static int at76_reset_rsc(struct at76_priv *priv)
74059 +{
74060 + int ret = 0;
74061 +
74062 + priv->mib_buf.type = MIB_MAC_ENCRYPTION;
74063 + priv->mib_buf.size = 4 * 8;
74064 + priv->mib_buf.index = offsetof(struct mib_mac_encryption, key_rsc);
74065 + memset(priv->mib_buf.data.data, 0 , priv->mib_buf.size);
74066 +
74067 + ret = at76_set_mib(priv, &priv->mib_buf);
74068 + if (ret < 0)
74069 + printk(KERN_ERR "%s: set_mib (MAC_ENCRYPTION, key_rsc) failed: %d\n",
74070 + wiphy_name(priv->hw->wiphy), ret);
74071
74072 return ret;
74073 }
74074 @@ -1067,16 +1016,16 @@
74075 sizeof(struct mib_mac_addr));
74076 if (ret < 0) {
74077 printk(KERN_ERR "%s: at76_get_mib (MAC_ADDR) failed: %d\n",
74078 - priv->netdev->name, ret);
74079 + wiphy_name(priv->hw->wiphy), ret);
74080 goto exit;
74081 }
74082
74083 at76_dbg(DBG_MIB, "%s: MIB MAC_ADDR: mac_addr %s res 0x%x 0x%x",
74084 - priv->netdev->name,
74085 + wiphy_name(priv->hw->wiphy),
74086 mac2str(m->mac_addr), m->res[0], m->res[1]);
74087 for (i = 0; i < ARRAY_SIZE(m->group_addr); i++)
74088 at76_dbg(DBG_MIB, "%s: MIB MAC_ADDR: group addr %d: %s, "
74089 - "status %d", priv->netdev->name, i,
74090 + "status %d", wiphy_name(priv->hw->wiphy), i,
74091 mac2str(m->group_addr[i]), m->group_addr_status[i]);
74092 exit:
74093 kfree(m);
74094 @@ -1096,13 +1045,13 @@
74095 sizeof(struct mib_mac_wep));
74096 if (ret < 0) {
74097 printk(KERN_ERR "%s: at76_get_mib (MAC_WEP) failed: %d\n",
74098 - priv->netdev->name, ret);
74099 + wiphy_name(priv->hw->wiphy), ret);
74100 goto exit;
74101 }
74102
74103 at76_dbg(DBG_MIB, "%s: MIB MAC_WEP: priv_invoked %u def_key_id %u "
74104 "key_len %u excl_unencr %u wep_icv_err %u wep_excluded %u "
74105 - "encr_level %u key %d", priv->netdev->name,
74106 + "encr_level %u key %d", wiphy_name(priv->hw->wiphy),
74107 m->privacy_invoked, m->wep_default_key_id,
74108 m->wep_key_mapping_len, m->exclude_unencrypted,
74109 le32_to_cpu(m->wep_icv_error_count),
74110 @@ -1114,12 +1063,55 @@
74111
74112 for (i = 0; i < WEP_KEYS; i++)
74113 at76_dbg(DBG_MIB, "%s: MIB MAC_WEP: key %d: %s",
74114 - priv->netdev->name, i,
74115 + wiphy_name(priv->hw->wiphy), i,
74116 hex2str(m->wep_default_keyvalue[i], key_len));
74117 exit:
74118 kfree(m);
74119 }
74120
74121 +static void at76_dump_mib_mac_encryption(struct at76_priv *priv)
74122 +{
74123 + int i;
74124 + int ret;
74125 + /*int key_len;*/
74126 + struct mib_mac_encryption *m;
74127 +
74128 + m = kmalloc(sizeof(struct mib_mac_encryption), GFP_KERNEL);
74129 + if (!m)
74130 + return;
74131 +
74132 + ret = at76_get_mib(priv->udev, MIB_MAC_ENCRYPTION, m,
74133 + sizeof(struct mib_mac_encryption));
74134 + if (ret < 0) {
74135 + dev_err(&priv->udev->dev,
74136 + "%s: at76_get_mib (MAC_ENCRYPTION) failed: %d\n",
74137 + wiphy_name(priv->hw->wiphy), ret);
74138 + goto exit;
74139 + }
74140 +
74141 + at76_dbg(DBG_MIB,
74142 + "%s: MIB MAC_ENCRYPTION: tkip_bssid %s priv_invoked %u "
74143 + "ciph_key_id %u grp_key_id %u excl_unencr %u "
74144 + "ckip_key_perm %u wep_icv_err %u wep_excluded %u",
74145 + wiphy_name(priv->hw->wiphy), mac2str(m->tkip_bssid),
74146 + m->privacy_invoked, m->cipher_default_key_id,
74147 + m->cipher_default_group_key_id, m->exclude_unencrypted,
74148 + m->ckip_key_permutation,
74149 + le32_to_cpu(m->wep_icv_error_count),
74150 + le32_to_cpu(m->wep_excluded_count));
74151 +
74152 + /*key_len = (m->encryption_level == 1) ?
74153 + WEP_SMALL_KEY_LEN : WEP_LARGE_KEY_LEN;*/
74154 +
74155 + for (i = 0; i < CIPHER_KEYS; i++)
74156 + at76_dbg(DBG_MIB, "%s: MIB MAC_ENCRYPTION: key %d: %s",
74157 + wiphy_name(priv->hw->wiphy), i,
74158 + hex2str(m->cipher_default_keyvalue[i],
74159 + CIPHER_KEY_LEN));
74160 +exit:
74161 + kfree(m);
74162 +}
74163 +
74164 static void at76_dump_mib_mac_mgmt(struct at76_priv *priv)
74165 {
74166 int ret;
74167 @@ -1133,7 +1125,7 @@
74168 sizeof(struct mib_mac_mgmt));
74169 if (ret < 0) {
74170 printk(KERN_ERR "%s: at76_get_mib (MAC_MGMT) failed: %d\n",
74171 - priv->netdev->name, ret);
74172 + wiphy_name(priv->hw->wiphy), ret);
74173 goto exit;
74174 }
74175
74176 @@ -1144,7 +1136,7 @@
74177 "pm_mode %d ibss_change %d res %d "
74178 "multi_domain_capability_implemented %d "
74179 "international_roaming %d country_string %.3s",
74180 - priv->netdev->name, le16_to_cpu(m->beacon_period),
74181 + wiphy_name(priv->hw->wiphy), le16_to_cpu(m->beacon_period),
74182 le16_to_cpu(m->CFP_max_duration),
74183 le16_to_cpu(m->medium_occupancy_limit),
74184 le16_to_cpu(m->station_id), le16_to_cpu(m->ATIM_window),
74185 @@ -1169,7 +1161,7 @@
74186 ret = at76_get_mib(priv->udev, MIB_MAC, m, sizeof(struct mib_mac));
74187 if (ret < 0) {
74188 printk(KERN_ERR "%s: at76_get_mib (MAC) failed: %d\n",
74189 - priv->netdev->name, ret);
74190 + wiphy_name(priv->hw->wiphy), ret);
74191 goto exit;
74192 }
74193
74194 @@ -1179,7 +1171,8 @@
74195 "scan_type %d scan_channel %d probe_delay %u "
74196 "min_channel_time %d max_channel_time %d listen_int %d "
74197 "desired_ssid %s desired_bssid %s desired_bsstype %d",
74198 - priv->netdev->name, le32_to_cpu(m->max_tx_msdu_lifetime),
74199 + wiphy_name(priv->hw->wiphy),
74200 + le32_to_cpu(m->max_tx_msdu_lifetime),
74201 le32_to_cpu(m->max_rx_lifetime),
74202 le16_to_cpu(m->frag_threshold), le16_to_cpu(m->rts_threshold),
74203 le16_to_cpu(m->cwmin), le16_to_cpu(m->cwmax),
74204 @@ -1205,7 +1198,7 @@
74205 ret = at76_get_mib(priv->udev, MIB_PHY, m, sizeof(struct mib_phy));
74206 if (ret < 0) {
74207 printk(KERN_ERR "%s: at76_get_mib (PHY) failed: %d\n",
74208 - priv->netdev->name, ret);
74209 + wiphy_name(priv->hw->wiphy), ret);
74210 goto exit;
74211 }
74212
74213 @@ -1214,7 +1207,7 @@
74214 "mpdu_max_length %d cca_mode_supported %d operation_rate_set "
74215 "0x%x 0x%x 0x%x 0x%x channel_id %d current_cca_mode %d "
74216 "phy_type %d current_reg_domain %d",
74217 - priv->netdev->name, le32_to_cpu(m->ed_threshold),
74218 + wiphy_name(priv->hw->wiphy), le32_to_cpu(m->ed_threshold),
74219 le16_to_cpu(m->slot_time), le16_to_cpu(m->sifs_time),
74220 le16_to_cpu(m->preamble_length),
74221 le16_to_cpu(m->plcp_header_length),
74222 @@ -1238,13 +1231,14 @@
74223 ret = at76_get_mib(priv->udev, MIB_LOCAL, m, sizeof(struct mib_local));
74224 if (ret < 0) {
74225 printk(KERN_ERR "%s: at76_get_mib (LOCAL) failed: %d\n",
74226 - priv->netdev->name, ret);
74227 + wiphy_name(priv->hw->wiphy), ret);
74228 goto exit;
74229 }
74230
74231 at76_dbg(DBG_MIB, "%s: MIB LOCAL: beacon_enable %d "
74232 "txautorate_fallback %d ssid_size %d promiscuous_mode %d "
74233 - "preamble_type %d", priv->netdev->name, m->beacon_enable,
74234 + "preamble_type %d", wiphy_name(priv->hw->wiphy),
74235 + m->beacon_enable,
74236 m->txautorate_fallback, m->ssid_size, m->promiscuous_mode,
74237 m->preamble_type);
74238 exit:
74239 @@ -1263,118 +1257,21 @@
74240 sizeof(struct mib_mdomain));
74241 if (ret < 0) {
74242 printk(KERN_ERR "%s: at76_get_mib (MDOMAIN) failed: %d\n",
74243 - priv->netdev->name, ret);
74244 + wiphy_name(priv->hw->wiphy), ret);
74245 goto exit;
74246 }
74247
74248 at76_dbg(DBG_MIB, "%s: MIB MDOMAIN: channel_list %s",
74249 - priv->netdev->name,
74250 + wiphy_name(priv->hw->wiphy),
74251 hex2str(m->channel_list, sizeof(m->channel_list)));
74252
74253 at76_dbg(DBG_MIB, "%s: MIB MDOMAIN: tx_powerlevel %s",
74254 - priv->netdev->name,
74255 + wiphy_name(priv->hw->wiphy),
74256 hex2str(m->tx_powerlevel, sizeof(m->tx_powerlevel)));
74257 exit:
74258 kfree(m);
74259 }
74260
74261 -static int at76_get_current_bssid(struct at76_priv *priv)
74262 -{
74263 - int ret = 0;
74264 - struct mib_mac_mgmt *mac_mgmt =
74265 - kmalloc(sizeof(struct mib_mac_mgmt), GFP_KERNEL);
74266 -
74267 - if (!mac_mgmt) {
74268 - ret = -ENOMEM;
74269 - goto exit;
74270 - }
74271 -
74272 - ret = at76_get_mib(priv->udev, MIB_MAC_MGMT, mac_mgmt,
74273 - sizeof(struct mib_mac_mgmt));
74274 - if (ret < 0) {
74275 - printk(KERN_ERR "%s: at76_get_mib failed: %d\n",
74276 - priv->netdev->name, ret);
74277 - goto error;
74278 - }
74279 - memcpy(priv->bssid, mac_mgmt->current_bssid, ETH_ALEN);
74280 - printk(KERN_INFO "%s: using BSSID %s\n", priv->netdev->name,
74281 - mac2str(priv->bssid));
74282 -error:
74283 - kfree(mac_mgmt);
74284 -exit:
74285 - return ret;
74286 -}
74287 -
74288 -static int at76_get_current_channel(struct at76_priv *priv)
74289 -{
74290 - int ret = 0;
74291 - struct mib_phy *phy = kmalloc(sizeof(struct mib_phy), GFP_KERNEL);
74292 -
74293 - if (!phy) {
74294 - ret = -ENOMEM;
74295 - goto exit;
74296 - }
74297 - ret = at76_get_mib(priv->udev, MIB_PHY, phy, sizeof(struct mib_phy));
74298 - if (ret < 0) {
74299 - printk(KERN_ERR "%s: at76_get_mib(MIB_PHY) failed: %d\n",
74300 - priv->netdev->name, ret);
74301 - goto error;
74302 - }
74303 - priv->channel = phy->channel_id;
74304 -error:
74305 - kfree(phy);
74306 -exit:
74307 - return ret;
74308 -}
74309 -
74310 -/**
74311 - * at76_start_scan - start a scan
74312 - *
74313 - * @use_essid - use the configured ESSID in non passive mode
74314 - */
74315 -static int at76_start_scan(struct at76_priv *priv, int use_essid)
74316 -{
74317 - struct at76_req_scan scan;
74318 -
74319 - memset(&scan, 0, sizeof(struct at76_req_scan));
74320 - memset(scan.bssid, 0xff, ETH_ALEN);
74321 -
74322 - if (use_essid) {
74323 - memcpy(scan.essid, priv->essid, IW_ESSID_MAX_SIZE);
74324 - scan.essid_size = priv->essid_size;
74325 - } else
74326 - scan.essid_size = 0;
74327 -
74328 - /* jal: why should we start at a certain channel? we do scan the whole
74329 - range allowed by reg domain. */
74330 - scan.channel = priv->channel;
74331 -
74332 - /* atmelwlandriver differs between scan type 0 and 1 (active/passive)
74333 - For ad-hoc mode, it uses type 0 only. */
74334 - scan.scan_type = priv->scan_mode;
74335 -
74336 - /* INFO: For probe_delay, not multiplying by 1024 as this will be
74337 - slightly less than min_channel_time
74338 - (per spec: probe delay < min. channel time) */
74339 - scan.min_channel_time = cpu_to_le16(priv->scan_min_time);
74340 - scan.max_channel_time = cpu_to_le16(priv->scan_max_time);
74341 - scan.probe_delay = cpu_to_le16(priv->scan_min_time * 1000);
74342 - scan.international_scan = 0;
74343 -
74344 - /* other values are set to 0 for type 0 */
74345 -
74346 - at76_dbg(DBG_PROGRESS, "%s: start_scan (use_essid = %d, intl = %d, "
74347 - "channel = %d, probe_delay = %d, scan_min_time = %d, "
74348 - "scan_max_time = %d)",
74349 - priv->netdev->name, use_essid,
74350 - scan.international_scan, scan.channel,
74351 - le16_to_cpu(scan.probe_delay),
74352 - le16_to_cpu(scan.min_channel_time),
74353 - le16_to_cpu(scan.max_channel_time));
74354 -
74355 - return at76_set_card_command(priv->udev, CMD_SCAN, &scan, sizeof(scan));
74356 -}
74357 -
74358 /* Enable monitor mode */
74359 static int at76_start_monitor(struct at76_priv *priv)
74360 {
74361 @@ -1395,86 +1292,6 @@
74362 return ret;
74363 }
74364
74365 -static int at76_start_ibss(struct at76_priv *priv)
74366 -{
74367 - struct at76_req_ibss bss;
74368 - int ret;
74369 -
74370 - WARN_ON(priv->mac_state != MAC_OWN_IBSS);
74371 - if (priv->mac_state != MAC_OWN_IBSS)
74372 - return -EBUSY;
74373 -
74374 - memset(&bss, 0, sizeof(struct at76_req_ibss));
74375 - memset(bss.bssid, 0xff, ETH_ALEN);
74376 - memcpy(bss.essid, priv->essid, IW_ESSID_MAX_SIZE);
74377 - bss.essid_size = priv->essid_size;
74378 - bss.bss_type = ADHOC_MODE;
74379 - bss.channel = priv->channel;
74380 -
74381 - ret = at76_set_card_command(priv->udev, CMD_START_IBSS, &bss,
74382 - sizeof(struct at76_req_ibss));
74383 - if (ret < 0) {
74384 - printk(KERN_ERR "%s: start_ibss failed: %d\n",
74385 - priv->netdev->name, ret);
74386 - return ret;
74387 - }
74388 -
74389 - ret = at76_wait_completion(priv, CMD_START_IBSS);
74390 - if (ret != CMD_STATUS_COMPLETE) {
74391 - printk(KERN_ERR "%s: start_ibss failed to complete, %d\n",
74392 - priv->netdev->name, ret);
74393 - return ret;
74394 - }
74395 -
74396 - ret = at76_get_current_bssid(priv);
74397 - if (ret < 0)
74398 - return ret;
74399 -
74400 - ret = at76_get_current_channel(priv);
74401 - if (ret < 0)
74402 - return ret;
74403 -
74404 - /* not sure what this is good for ??? */
74405 - priv->mib_buf.type = MIB_MAC_MGMT;
74406 - priv->mib_buf.size = 1;
74407 - priv->mib_buf.index = offsetof(struct mib_mac_mgmt, ibss_change);
74408 - priv->mib_buf.data.byte = 0;
74409 -
74410 - ret = at76_set_mib(priv, &priv->mib_buf);
74411 - if (ret < 0) {
74412 - printk(KERN_ERR "%s: set_mib (ibss change ok) failed: %d\n",
74413 - priv->netdev->name, ret);
74414 - return ret;
74415 - }
74416 -
74417 - netif_carrier_on(priv->netdev);
74418 - netif_start_queue(priv->netdev);
74419 - return 0;
74420 -}
74421 -
74422 -/* Request card to join BSS in managed or ad-hoc mode */
74423 -static int at76_join_bss(struct at76_priv *priv, struct bss_info *ptr)
74424 -{
74425 - struct at76_req_join join;
74426 -
74427 - BUG_ON(!ptr);
74428 -
74429 - memset(&join, 0, sizeof(struct at76_req_join));
74430 - memcpy(join.bssid, ptr->bssid, ETH_ALEN);
74431 - memcpy(join.essid, ptr->ssid, ptr->ssid_len);
74432 - join.essid_size = ptr->ssid_len;
74433 - join.bss_type = (priv->iw_mode == IW_MODE_ADHOC ? 1 : 2);
74434 - join.channel = ptr->channel;
74435 - join.timeout = cpu_to_le16(2000);
74436 -
74437 - at76_dbg(DBG_PROGRESS,
74438 - "%s join addr %s ssid %s type %d ch %d timeout %d",
74439 - priv->netdev->name, mac2str(join.bssid), join.essid,
74440 - join.bss_type, join.channel, le16_to_cpu(join.timeout));
74441 - return at76_set_card_command(priv->udev, CMD_JOIN, &join,
74442 - sizeof(struct at76_req_join));
74443 -}
74444 -
74445 /* Calculate padding from txbuf->wlength (which excludes the USB TX header),
74446 likely to compensate a flaw in the AT76C503A USB part ... */
74447 static inline int at76_calc_padding(int wlen)
74448 @@ -1493,14 +1310,6 @@
74449 return 0;
74450 }
74451
74452 -/* We are doing a lot of things here in an interrupt. Need
74453 - a bh handler (Watching TV with a TV card is probably
74454 - a good test: if you see flickers, we are doing too much.
74455 - Currently I do see flickers... even with our tasklet :-( )
74456 - Maybe because the bttv driver and usb-uhci use the same interrupt
74457 -*/
74458 -/* Or maybe because our BH handler is preempting bttv's BH handler.. BHs don't
74459 - * solve everything.. (alex) */
74460 static void at76_rx_callback(struct urb *urb)
74461 {
74462 struct at76_priv *priv = urb->context;
74463 @@ -1510,1914 +1319,70 @@
74464 return;
74465 }
74466
74467 -static void at76_tx_callback(struct urb *urb)
74468 +static int at76_submit_rx_urb(struct at76_priv *priv)
74469 {
74470 - struct at76_priv *priv = urb->context;
74471 - struct net_device_stats *stats = &priv->stats;
74472 - unsigned long flags;
74473 - struct at76_tx_buffer *mgmt_buf;
74474 int ret;
74475 + int size;
74476 + struct sk_buff *skb = priv->rx_skb;
74477
74478 - switch (urb->status) {
74479 - case 0:
74480 - stats->tx_packets++;
74481 - break;
74482 - case -ENOENT:
74483 - case -ECONNRESET:
74484 - /* urb has been unlinked */
74485 - return;
74486 - default:
74487 - at76_dbg(DBG_URB, "%s - nonzero tx status received: %d",
74488 - __func__, urb->status);
74489 - stats->tx_errors++;
74490 - break;
74491 + if (!priv->rx_urb) {
74492 + printk(KERN_ERR "%s: %s: priv->rx_urb is NULL\n",
74493 + wiphy_name(priv->hw->wiphy), __func__);
74494 + return -EFAULT;
74495 }
74496
74497 - spin_lock_irqsave(&priv->mgmt_spinlock, flags);
74498 - mgmt_buf = priv->next_mgmt_bulk;
74499 - priv->next_mgmt_bulk = NULL;
74500 - spin_unlock_irqrestore(&priv->mgmt_spinlock, flags);
74501 + if (!skb) {
74502 + skb = dev_alloc_skb(sizeof(struct at76_rx_buffer));
74503 + if (!skb) {
74504 + printk(KERN_ERR "%s: cannot allocate rx skbuff\n",
74505 + wiphy_name(priv->hw->wiphy));
74506 + ret = -ENOMEM;
74507 + goto exit;
74508 + }
74509 + priv->rx_skb = skb;
74510 + } else {
74511 + skb_push(skb, skb_headroom(skb));
74512 + skb_trim(skb, 0);
74513 + }
74514
74515 - if (!mgmt_buf) {
74516 - netif_wake_queue(priv->netdev);
74517 - return;
74518 + size = skb_tailroom(skb);
74519 + usb_fill_bulk_urb(priv->rx_urb, priv->udev, priv->rx_pipe,
74520 + skb_put(skb, size), size, at76_rx_callback, priv);
74521 + ret = usb_submit_urb(priv->rx_urb, GFP_ATOMIC);
74522 + if (ret < 0) {
74523 + if (ret == -ENODEV)
74524 + at76_dbg(DBG_DEVSTART,
74525 + "usb_submit_urb returned -ENODEV");
74526 + else
74527 + printk(KERN_ERR "%s: rx, usb_submit_urb failed: %d\n",
74528 + wiphy_name(priv->hw->wiphy), ret);
74529 }
74530
74531 - /* we don't copy the padding bytes, but add them
74532 - to the length */
74533 - memcpy(priv->bulk_out_buffer, mgmt_buf,
74534 - le16_to_cpu(mgmt_buf->wlength) + AT76_TX_HDRLEN);
74535 - usb_fill_bulk_urb(priv->tx_urb, priv->udev, priv->tx_pipe,
74536 - priv->bulk_out_buffer,
74537 - le16_to_cpu(mgmt_buf->wlength) + mgmt_buf->padding +
74538 - AT76_TX_HDRLEN, at76_tx_callback, priv);
74539 - ret = usb_submit_urb(priv->tx_urb, GFP_ATOMIC);
74540 - if (ret)
74541 - printk(KERN_ERR "%s: error in tx submit urb: %d\n",
74542 - priv->netdev->name, ret);
74543 +exit:
74544 + if (ret < 0 && ret != -ENODEV)
74545 + printk(KERN_ERR "%s: cannot submit rx urb - please unload the "
74546 + "driver and/or power cycle the device\n",
74547 + wiphy_name(priv->hw->wiphy));
74548
74549 - kfree(mgmt_buf);
74550 + return ret;
74551 }
74552
74553 -/* Send a management frame on bulk-out. txbuf->wlength must be set */
74554 -static int at76_tx_mgmt(struct at76_priv *priv, struct at76_tx_buffer *txbuf)
74555 +/* Download external firmware */
74556 +static int at76_load_external_fw(struct usb_device *udev, struct fwentry *fwe)
74557 {
74558 - unsigned long flags;
74559 int ret;
74560 - int urb_status;
74561 - void *oldbuf = NULL;
74562 -
74563 - netif_carrier_off(priv->netdev); /* stop netdev watchdog */
74564 - netif_stop_queue(priv->netdev); /* stop tx data packets */
74565 + int op_mode;
74566 + int blockno = 0;
74567 + int bsize;
74568 + u8 *block;
74569 + u8 *buf = fwe->extfw;
74570 + int size = fwe->extfw_size;
74571
74572 - spin_lock_irqsave(&priv->mgmt_spinlock, flags);
74573 + if (!buf || !size)
74574 + return -ENOENT;
74575
74576 - urb_status = priv->tx_urb->status;
74577 - if (urb_status == -EINPROGRESS) {
74578 - /* cannot transmit now, put in the queue */
74579 - oldbuf = priv->next_mgmt_bulk;
74580 - priv->next_mgmt_bulk = txbuf;
74581 - }
74582 - spin_unlock_irqrestore(&priv->mgmt_spinlock, flags);
74583 -
74584 - if (oldbuf) {
74585 - /* a data/mgmt tx is already pending in the URB -
74586 - if this is no error in some situations we must
74587 - implement a queue or silently modify the old msg */
74588 - printk(KERN_ERR "%s: removed pending mgmt buffer %s\n",
74589 - priv->netdev->name, hex2str(oldbuf, 64));
74590 - kfree(oldbuf);
74591 - return 0;
74592 - }
74593 -
74594 - txbuf->tx_rate = TX_RATE_1MBIT;
74595 - txbuf->padding = at76_calc_padding(le16_to_cpu(txbuf->wlength));
74596 - memset(txbuf->reserved, 0, sizeof(txbuf->reserved));
74597 -
74598 - if (priv->next_mgmt_bulk)
74599 - printk(KERN_ERR "%s: URB status %d, but mgmt is pending\n",
74600 - priv->netdev->name, urb_status);
74601 -
74602 - at76_dbg(DBG_TX_MGMT,
74603 - "%s: tx mgmt: wlen %d tx_rate %d pad %d %s",
74604 - priv->netdev->name, le16_to_cpu(txbuf->wlength),
74605 - txbuf->tx_rate, txbuf->padding,
74606 - hex2str(txbuf->packet, le16_to_cpu(txbuf->wlength)));
74607 -
74608 - /* txbuf was not consumed above -> send mgmt msg immediately */
74609 - memcpy(priv->bulk_out_buffer, txbuf,
74610 - le16_to_cpu(txbuf->wlength) + AT76_TX_HDRLEN);
74611 - usb_fill_bulk_urb(priv->tx_urb, priv->udev, priv->tx_pipe,
74612 - priv->bulk_out_buffer,
74613 - le16_to_cpu(txbuf->wlength) + txbuf->padding +
74614 - AT76_TX_HDRLEN, at76_tx_callback, priv);
74615 - ret = usb_submit_urb(priv->tx_urb, GFP_ATOMIC);
74616 - if (ret)
74617 - printk(KERN_ERR "%s: error in tx submit urb: %d\n",
74618 - priv->netdev->name, ret);
74619 -
74620 - kfree(txbuf);
74621 -
74622 - return ret;
74623 -}
74624 -
74625 -/* Go to the next information element */
74626 -static inline void next_ie(struct ieee80211_info_element **ie)
74627 -{
74628 - *ie = (struct ieee80211_info_element *)(&(*ie)->data[(*ie)->len]);
74629 -}
74630 -
74631 -/* Challenge is the challenge string (in TLV format)
74632 - we got with seq_nr 2 for shared secret authentication only and
74633 - send in seq_nr 3 WEP encrypted to prove we have the correct WEP key;
74634 - otherwise it is NULL */
74635 -static int at76_auth_req(struct at76_priv *priv, struct bss_info *bss,
74636 - int seq_nr, struct ieee80211_info_element *challenge)
74637 -{
74638 - struct at76_tx_buffer *tx_buffer;
74639 - struct ieee80211_hdr_3addr *mgmt;
74640 - struct ieee80211_auth *req;
74641 - int buf_len = (seq_nr != 3 ? AUTH_FRAME_SIZE :
74642 - AUTH_FRAME_SIZE + 1 + 1 + challenge->len);
74643 -
74644 - BUG_ON(!bss);
74645 - BUG_ON(seq_nr == 3 && !challenge);
74646 - tx_buffer = kmalloc(buf_len + MAX_PADDING_SIZE, GFP_ATOMIC);
74647 - if (!tx_buffer)
74648 - return -ENOMEM;
74649 -
74650 - req = (struct ieee80211_auth *)tx_buffer->packet;
74651 - mgmt = &req->header;
74652 -
74653 - /* make wireless header */
74654 - /* first auth msg is not encrypted, only the second (seq_nr == 3) */
74655 - mgmt->frame_ctl =
74656 - cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_AUTH |
74657 - (seq_nr == 3 ? IEEE80211_FCTL_PROTECTED : 0));
74658 -
74659 - mgmt->duration_id = cpu_to_le16(0x8000);
74660 - memcpy(mgmt->addr1, bss->bssid, ETH_ALEN);
74661 - memcpy(mgmt->addr2, priv->netdev->dev_addr, ETH_ALEN);
74662 - memcpy(mgmt->addr3, bss->bssid, ETH_ALEN);
74663 - mgmt->seq_ctl = cpu_to_le16(0);
74664 -
74665 - req->algorithm = cpu_to_le16(priv->auth_mode);
74666 - req->transaction = cpu_to_le16(seq_nr);
74667 - req->status = cpu_to_le16(0);
74668 -
74669 - if (seq_nr == 3)
74670 - memcpy(req->info_element, challenge, 1 + 1 + challenge->len);
74671 -
74672 - /* init. at76_priv tx header */
74673 - tx_buffer->wlength = cpu_to_le16(buf_len - AT76_TX_HDRLEN);
74674 - at76_dbg(DBG_TX_MGMT, "%s: AuthReq bssid %s alg %d seq_nr %d",
74675 - priv->netdev->name, mac2str(mgmt->addr3),
74676 - le16_to_cpu(req->algorithm), le16_to_cpu(req->transaction));
74677 - if (seq_nr == 3)
74678 - at76_dbg(DBG_TX_MGMT, "%s: AuthReq challenge: %s ...",
74679 - priv->netdev->name, hex2str(req->info_element, 18));
74680 -
74681 - /* either send immediately (if no data tx is pending
74682 - or put it in pending list */
74683 - return at76_tx_mgmt(priv, tx_buffer);
74684 -}
74685 -
74686 -static int at76_assoc_req(struct at76_priv *priv, struct bss_info *bss)
74687 -{
74688 - struct at76_tx_buffer *tx_buffer;
74689 - struct ieee80211_hdr_3addr *mgmt;
74690 - struct ieee80211_assoc_request *req;
74691 - struct ieee80211_info_element *ie;
74692 - char *essid;
74693 - int essid_len;
74694 - u16 capa;
74695 -
74696 - BUG_ON(!bss);
74697 -
74698 - tx_buffer = kmalloc(ASSOCREQ_MAX_SIZE + MAX_PADDING_SIZE, GFP_ATOMIC);
74699 - if (!tx_buffer)
74700 - return -ENOMEM;
74701 -
74702 - req = (struct ieee80211_assoc_request *)tx_buffer->packet;
74703 - mgmt = &req->header;
74704 - ie = req->info_element;
74705 -
74706 - /* make wireless header */
74707 - mgmt->frame_ctl = cpu_to_le16(IEEE80211_FTYPE_MGMT |
74708 - IEEE80211_STYPE_ASSOC_REQ);
74709 -
74710 - mgmt->duration_id = cpu_to_le16(0x8000);
74711 - memcpy(mgmt->addr1, bss->bssid, ETH_ALEN);
74712 - memcpy(mgmt->addr2, priv->netdev->dev_addr, ETH_ALEN);
74713 - memcpy(mgmt->addr3, bss->bssid, ETH_ALEN);
74714 - mgmt->seq_ctl = cpu_to_le16(0);
74715 -
74716 - /* we must set the Privacy bit in the capabilities to assure an
74717 - Agere-based AP with optional WEP transmits encrypted frames
74718 - to us. AP only set the Privacy bit in their capabilities
74719 - if WEP is mandatory in the BSS! */
74720 - capa = bss->capa;
74721 - if (priv->wep_enabled)
74722 - capa |= WLAN_CAPABILITY_PRIVACY;
74723 - if (priv->preamble_type != PREAMBLE_TYPE_LONG)
74724 - capa |= WLAN_CAPABILITY_SHORT_PREAMBLE;
74725 - req->capability = cpu_to_le16(capa);
74726 -
74727 - req->listen_interval = cpu_to_le16(2 * bss->beacon_interval);
74728 -
74729 - /* write TLV data elements */
74730 -
74731 - ie->id = MFIE_TYPE_SSID;
74732 - ie->len = bss->ssid_len;
74733 - memcpy(ie->data, bss->ssid, bss->ssid_len);
74734 - next_ie(&ie);
74735 -
74736 - ie->id = MFIE_TYPE_RATES;
74737 - ie->len = sizeof(hw_rates);
74738 - memcpy(ie->data, hw_rates, sizeof(hw_rates));
74739 - next_ie(&ie); /* ie points behind the supp_rates field */
74740 -
74741 - /* init. at76_priv tx header */
74742 - tx_buffer->wlength = cpu_to_le16((u8 *)ie - (u8 *)mgmt);
74743 -
74744 - ie = req->info_element;
74745 - essid = ie->data;
74746 - essid_len = min_t(int, IW_ESSID_MAX_SIZE, ie->len);
74747 -
74748 - next_ie(&ie); /* points to IE of rates now */
74749 - at76_dbg(DBG_TX_MGMT,
74750 - "%s: AssocReq bssid %s capa 0x%04x ssid %.*s rates %s",
74751 - priv->netdev->name, mac2str(mgmt->addr3),
74752 - le16_to_cpu(req->capability), essid_len, essid,
74753 - hex2str(ie->data, ie->len));
74754 -
74755 - /* either send immediately (if no data tx is pending
74756 - or put it in pending list */
74757 - return at76_tx_mgmt(priv, tx_buffer);
74758 -}
74759 -
74760 -/* We got to check the bss_list for old entries */
74761 -static void at76_bss_list_timeout(unsigned long par)
74762 -{
74763 - struct at76_priv *priv = (struct at76_priv *)par;
74764 - unsigned long flags;
74765 - struct list_head *lptr, *nptr;
74766 - struct bss_info *ptr;
74767 -
74768 - spin_lock_irqsave(&priv->bss_list_spinlock, flags);
74769 -
74770 - list_for_each_safe(lptr, nptr, &priv->bss_list) {
74771 -
74772 - ptr = list_entry(lptr, struct bss_info, list);
74773 -
74774 - if (ptr != priv->curr_bss
74775 - && time_after(jiffies, ptr->last_rx + BSS_LIST_TIMEOUT)) {
74776 - at76_dbg(DBG_BSS_TABLE_RM,
74777 - "%s: bss_list: removing old BSS %s ch %d",
74778 - priv->netdev->name, mac2str(ptr->bssid),
74779 - ptr->channel);
74780 - list_del(&ptr->list);
74781 - kfree(ptr);
74782 - }
74783 - }
74784 - spin_unlock_irqrestore(&priv->bss_list_spinlock, flags);
74785 - /* restart the timer */
74786 - mod_timer(&priv->bss_list_timer, jiffies + BSS_LIST_TIMEOUT);
74787 -}
74788 -
74789 -static inline void at76_set_mac_state(struct at76_priv *priv,
74790 - enum mac_state mac_state)
74791 -{
74792 - at76_dbg(DBG_MAC_STATE, "%s state: %s", priv->netdev->name,
74793 - mac_states[mac_state]);
74794 - priv->mac_state = mac_state;
74795 -}
74796 -
74797 -static void at76_dump_bss_table(struct at76_priv *priv)
74798 -{
74799 - struct bss_info *ptr;
74800 - unsigned long flags;
74801 - struct list_head *lptr;
74802 -
74803 - spin_lock_irqsave(&priv->bss_list_spinlock, flags);
74804 -
74805 - at76_dbg(DBG_BSS_TABLE, "%s BSS table (curr=%p):", priv->netdev->name,
74806 - priv->curr_bss);
74807 -
74808 - list_for_each(lptr, &priv->bss_list) {
74809 - ptr = list_entry(lptr, struct bss_info, list);
74810 - at76_dbg(DBG_BSS_TABLE, "0x%p: bssid %s channel %d ssid %.*s "
74811 - "(%s) capa 0x%04x rates %s rssi %d link %d noise %d",
74812 - ptr, mac2str(ptr->bssid), ptr->channel, ptr->ssid_len,
74813 - ptr->ssid, hex2str(ptr->ssid, ptr->ssid_len),
74814 - ptr->capa, hex2str(ptr->rates, ptr->rates_len),
74815 - ptr->rssi, ptr->link_qual, ptr->noise_level);
74816 - }
74817 - spin_unlock_irqrestore(&priv->bss_list_spinlock, flags);
74818 -}
74819 -
74820 -/* Called upon successful association to mark interface as connected */
74821 -static void at76_work_assoc_done(struct work_struct *work)
74822 -{
74823 - struct at76_priv *priv = container_of(work, struct at76_priv,
74824 - work_assoc_done);
74825 -
74826 - mutex_lock(&priv->mtx);
74827 -
74828 - WARN_ON(priv->mac_state != MAC_ASSOC);
74829 - WARN_ON(!priv->curr_bss);
74830 - if (priv->mac_state != MAC_ASSOC || !priv->curr_bss)
74831 - goto exit;
74832 -
74833 - if (priv->iw_mode == IW_MODE_INFRA) {
74834 - if (priv->pm_mode != AT76_PM_OFF) {
74835 - /* calculate the listen interval in units of
74836 - beacon intervals of the curr_bss */
74837 - u32 pm_period_beacon = (priv->pm_period >> 10) /
74838 - priv->curr_bss->beacon_interval;
74839 -
74840 - pm_period_beacon = max(pm_period_beacon, 2u);
74841 - pm_period_beacon = min(pm_period_beacon, 0xffffu);
74842 -
74843 - at76_dbg(DBG_PM,
74844 - "%s: pm_mode %d assoc id 0x%x listen int %d",
74845 - priv->netdev->name, priv->pm_mode,
74846 - priv->assoc_id, pm_period_beacon);
74847 -
74848 - at76_set_associd(priv, priv->assoc_id);
74849 - at76_set_listen_interval(priv, (u16)pm_period_beacon);
74850 - }
74851 - schedule_delayed_work(&priv->dwork_beacon, BEACON_TIMEOUT);
74852 - }
74853 - at76_set_pm_mode(priv);
74854 -
74855 - netif_carrier_on(priv->netdev);
74856 - netif_wake_queue(priv->netdev);
74857 - at76_set_mac_state(priv, MAC_CONNECTED);
74858 - at76_iwevent_bss_connect(priv->netdev, priv->curr_bss->bssid);
74859 - at76_dbg(DBG_PROGRESS, "%s: connected to BSSID %s",
74860 - priv->netdev->name, mac2str(priv->curr_bss->bssid));
74861 -
74862 -exit:
74863 - mutex_unlock(&priv->mtx);
74864 -}
74865 -
74866 -/* We only store the new mac address in netdev struct,
74867 - it gets set when the netdev is opened. */
74868 -static int at76_set_mac_address(struct net_device *netdev, void *addr)
74869 -{
74870 - struct sockaddr *mac = addr;
74871 - memcpy(netdev->dev_addr, mac->sa_data, ETH_ALEN);
74872 - return 1;
74873 -}
74874 -
74875 -static struct net_device_stats *at76_get_stats(struct net_device *netdev)
74876 -{
74877 - struct at76_priv *priv = netdev_priv(netdev);
74878 - return &priv->stats;
74879 -}
74880 -
74881 -static struct iw_statistics *at76_get_wireless_stats(struct net_device *netdev)
74882 -{
74883 - struct at76_priv *priv = netdev_priv(netdev);
74884 -
74885 - at76_dbg(DBG_IOCTL, "RETURN qual %d level %d noise %d updated %d",
74886 - priv->wstats.qual.qual, priv->wstats.qual.level,
74887 - priv->wstats.qual.noise, priv->wstats.qual.updated);
74888 -
74889 - return &priv->wstats;
74890 -}
74891 -
74892 -static void at76_set_multicast(struct net_device *netdev)
74893 -{
74894 - struct at76_priv *priv = netdev_priv(netdev);
74895 - int promisc;
74896 -
74897 - promisc = ((netdev->flags & IFF_PROMISC) != 0);
74898 - if (promisc != priv->promisc) {
74899 - /* This gets called in interrupt, must reschedule */
74900 - priv->promisc = promisc;
74901 - schedule_work(&priv->work_set_promisc);
74902 - }
74903 -}
74904 -
74905 -/* Stop all network activity, flush all pending tasks */
74906 -static void at76_quiesce(struct at76_priv *priv)
74907 -{
74908 - unsigned long flags;
74909 -
74910 - netif_stop_queue(priv->netdev);
74911 - netif_carrier_off(priv->netdev);
74912 -
74913 - at76_set_mac_state(priv, MAC_INIT);
74914 -
74915 - cancel_delayed_work(&priv->dwork_get_scan);
74916 - cancel_delayed_work(&priv->dwork_beacon);
74917 - cancel_delayed_work(&priv->dwork_auth);
74918 - cancel_delayed_work(&priv->dwork_assoc);
74919 - cancel_delayed_work(&priv->dwork_restart);
74920 -
74921 - spin_lock_irqsave(&priv->mgmt_spinlock, flags);
74922 - kfree(priv->next_mgmt_bulk);
74923 - priv->next_mgmt_bulk = NULL;
74924 - spin_unlock_irqrestore(&priv->mgmt_spinlock, flags);
74925 -}
74926 -
74927 -/*******************************************************************************
74928 - * at76_priv implementations of iw_handler functions:
74929 - */
74930 -static int at76_iw_handler_commit(struct net_device *netdev,
74931 - struct iw_request_info *info,
74932 - void *null, char *extra)
74933 -{
74934 - struct at76_priv *priv = netdev_priv(netdev);
74935 -
74936 - at76_dbg(DBG_IOCTL, "%s %s: restarting the device", netdev->name,
74937 - __func__);
74938 -
74939 - if (priv->mac_state != MAC_INIT)
74940 - at76_quiesce(priv);
74941 -
74942 - /* Wait half second before the restart to process subsequent
74943 - * requests from the same iwconfig in a single restart */
74944 - schedule_delayed_work(&priv->dwork_restart, HZ / 2);
74945 -
74946 - return 0;
74947 -}
74948 -
74949 -static int at76_iw_handler_get_name(struct net_device *netdev,
74950 - struct iw_request_info *info,
74951 - char *name, char *extra)
74952 -{
74953 - strcpy(name, "IEEE 802.11b");
74954 - at76_dbg(DBG_IOCTL, "%s: SIOCGIWNAME - name %s", netdev->name, name);
74955 - return 0;
74956 -}
74957 -
74958 -static int at76_iw_handler_set_freq(struct net_device *netdev,
74959 - struct iw_request_info *info,
74960 - struct iw_freq *freq, char *extra)
74961 -{
74962 - struct at76_priv *priv = netdev_priv(netdev);
74963 - int chan = -1;
74964 - int ret = -EIWCOMMIT;
74965 - at76_dbg(DBG_IOCTL, "%s: SIOCSIWFREQ - freq.m %d freq.e %d",
74966 - netdev->name, freq->m, freq->e);
74967 -
74968 - if ((freq->e == 0) && (freq->m <= 1000))
74969 - /* Setting by channel number */
74970 - chan = freq->m;
74971 - else {
74972 - /* Setting by frequency - search the table */
74973 - int mult = 1;
74974 - int i;
74975 -
74976 - for (i = 0; i < (6 - freq->e); i++)
74977 - mult *= 10;
74978 -
74979 - for (i = 0; i < NUM_CHANNELS; i++) {
74980 - if (freq->m == (channel_frequency[i] * mult))
74981 - chan = i + 1;
74982 - }
74983 - }
74984 -
74985 - if (chan < 1 || !priv->domain)
74986 - /* non-positive channels are invalid
74987 - * we need a domain info to set the channel
74988 - * either that or an invalid frequency was
74989 - * provided by the user */
74990 - ret = -EINVAL;
74991 - else if (!(priv->domain->channel_map & (1 << (chan - 1)))) {
74992 - printk(KERN_INFO "%s: channel %d not allowed for domain %s\n",
74993 - priv->netdev->name, chan, priv->domain->name);
74994 - ret = -EINVAL;
74995 - }
74996 -
74997 - if (ret == -EIWCOMMIT) {
74998 - priv->channel = chan;
74999 - at76_dbg(DBG_IOCTL, "%s: SIOCSIWFREQ - ch %d", netdev->name,
75000 - chan);
75001 - }
75002 -
75003 - return ret;
75004 -}
75005 -
75006 -static int at76_iw_handler_get_freq(struct net_device *netdev,
75007 - struct iw_request_info *info,
75008 - struct iw_freq *freq, char *extra)
75009 -{
75010 - struct at76_priv *priv = netdev_priv(netdev);
75011 -
75012 - freq->m = priv->channel;
75013 - freq->e = 0;
75014 -
75015 - if (priv->channel)
75016 - at76_dbg(DBG_IOCTL, "%s: SIOCGIWFREQ - freq %ld x 10e%d",
75017 - netdev->name, channel_frequency[priv->channel - 1], 6);
75018 -
75019 - at76_dbg(DBG_IOCTL, "%s: SIOCGIWFREQ - ch %d", netdev->name,
75020 - priv->channel);
75021 -
75022 - return 0;
75023 -}
75024 -
75025 -static int at76_iw_handler_set_mode(struct net_device *netdev,
75026 - struct iw_request_info *info,
75027 - __u32 *mode, char *extra)
75028 -{
75029 - struct at76_priv *priv = netdev_priv(netdev);
75030 -
75031 - at76_dbg(DBG_IOCTL, "%s: SIOCSIWMODE - %d", netdev->name, *mode);
75032 -
75033 - if ((*mode != IW_MODE_ADHOC) && (*mode != IW_MODE_INFRA) &&
75034 - (*mode != IW_MODE_MONITOR))
75035 - return -EINVAL;
75036 -
75037 - priv->iw_mode = *mode;
75038 - if (priv->iw_mode != IW_MODE_INFRA)
75039 - priv->pm_mode = AT76_PM_OFF;
75040 -
75041 - return -EIWCOMMIT;
75042 -}
75043 -
75044 -static int at76_iw_handler_get_mode(struct net_device *netdev,
75045 - struct iw_request_info *info,
75046 - __u32 *mode, char *extra)
75047 -{
75048 - struct at76_priv *priv = netdev_priv(netdev);
75049 -
75050 - *mode = priv->iw_mode;
75051 -
75052 - at76_dbg(DBG_IOCTL, "%s: SIOCGIWMODE - %d", netdev->name, *mode);
75053 -
75054 - return 0;
75055 -}
75056 -
75057 -static int at76_iw_handler_get_range(struct net_device *netdev,
75058 - struct iw_request_info *info,
75059 - struct iw_point *data, char *extra)
75060 -{
75061 - /* inspired by atmel.c */
75062 - struct at76_priv *priv = netdev_priv(netdev);
75063 - struct iw_range *range = (struct iw_range *)extra;
75064 - int i;
75065 -
75066 - data->length = sizeof(struct iw_range);
75067 - memset(range, 0, sizeof(struct iw_range));
75068 -
75069 - /* TODO: range->throughput = xxxxxx; */
75070 -
75071 - range->min_nwid = 0x0000;
75072 - range->max_nwid = 0x0000;
75073 -
75074 - /* this driver doesn't maintain sensitivity information */
75075 - range->sensitivity = 0;
75076 -
75077 - range->max_qual.qual = 100;
75078 - range->max_qual.level = 100;
75079 - range->max_qual.noise = 0;
75080 - range->max_qual.updated = IW_QUAL_NOISE_INVALID;
75081 -
75082 - range->avg_qual.qual = 50;
75083 - range->avg_qual.level = 50;
75084 - range->avg_qual.noise = 0;
75085 - range->avg_qual.updated = IW_QUAL_NOISE_INVALID;
75086 -
75087 - range->bitrate[0] = 1000000;
75088 - range->bitrate[1] = 2000000;
75089 - range->bitrate[2] = 5500000;
75090 - range->bitrate[3] = 11000000;
75091 - range->num_bitrates = 4;
75092 -
75093 - range->min_rts = 0;
75094 - range->max_rts = MAX_RTS_THRESHOLD;
75095 -
75096 - range->min_frag = MIN_FRAG_THRESHOLD;
75097 - range->max_frag = MAX_FRAG_THRESHOLD;
75098 -
75099 - range->pmp_flags = IW_POWER_PERIOD;
75100 - range->pmt_flags = IW_POWER_ON;
75101 - range->pm_capa = IW_POWER_PERIOD | IW_POWER_ALL_R;
75102 -
75103 - range->encoding_size[0] = WEP_SMALL_KEY_LEN;
75104 - range->encoding_size[1] = WEP_LARGE_KEY_LEN;
75105 - range->num_encoding_sizes = 2;
75106 - range->max_encoding_tokens = WEP_KEYS;
75107 -
75108 - /* both WL-240U and Linksys WUSB11 v2.6 specify 15 dBm as output power
75109 - - take this for all (ignore antenna gains) */
75110 - range->txpower[0] = 15;
75111 - range->num_txpower = 1;
75112 - range->txpower_capa = IW_TXPOW_DBM;
75113 -
75114 - range->we_version_source = WIRELESS_EXT;
75115 - range->we_version_compiled = WIRELESS_EXT;
75116 -
75117 - /* same as the values used in atmel.c */
75118 - range->retry_capa = IW_RETRY_LIMIT;
75119 - range->retry_flags = IW_RETRY_LIMIT;
75120 - range->r_time_flags = 0;
75121 - range->min_retry = 1;
75122 - range->max_retry = 255;
75123 -
75124 - range->num_channels = NUM_CHANNELS;
75125 - range->num_frequency = 0;
75126 -
75127 - for (i = 0; i < NUM_CHANNELS; i++) {
75128 - /* test if channel map bit is raised */
75129 - if (priv->domain->channel_map & (0x1 << i)) {
75130 - range->num_frequency += 1;
75131 -
75132 - range->freq[i].i = i + 1;
75133 - range->freq[i].m = channel_frequency[i] * 100000;
75134 - range->freq[i].e = 1; /* freq * 10^1 */
75135 - }
75136 - }
75137 -
75138 - at76_dbg(DBG_IOCTL, "%s: SIOCGIWRANGE", netdev->name);
75139 -
75140 - return 0;
75141 -}
75142 -
75143 -static int at76_iw_handler_set_spy(struct net_device *netdev,
75144 - struct iw_request_info *info,
75145 - struct iw_point *data, char *extra)
75146 -{
75147 - struct at76_priv *priv = netdev_priv(netdev);
75148 - int ret = 0;
75149 -
75150 - at76_dbg(DBG_IOCTL, "%s: SIOCSIWSPY - number of addresses %d",
75151 - netdev->name, data->length);
75152 -
75153 - spin_lock_bh(&priv->spy_spinlock);
75154 - ret = iw_handler_set_spy(priv->netdev, info, (union iwreq_data *)data,
75155 - extra);
75156 - spin_unlock_bh(&priv->spy_spinlock);
75157 -
75158 - return ret;
75159 -}
75160 -
75161 -static int at76_iw_handler_get_spy(struct net_device *netdev,
75162 - struct iw_request_info *info,
75163 - struct iw_point *data, char *extra)
75164 -{
75165 -
75166 - struct at76_priv *priv = netdev_priv(netdev);
75167 - int ret = 0;
75168 -
75169 - spin_lock_bh(&priv->spy_spinlock);
75170 - ret = iw_handler_get_spy(priv->netdev, info,
75171 - (union iwreq_data *)data, extra);
75172 - spin_unlock_bh(&priv->spy_spinlock);
75173 -
75174 - at76_dbg(DBG_IOCTL, "%s: SIOCGIWSPY - number of addresses %d",
75175 - netdev->name, data->length);
75176 -
75177 - return ret;
75178 -}
75179 -
75180 -static int at76_iw_handler_set_thrspy(struct net_device *netdev,
75181 - struct iw_request_info *info,
75182 - struct iw_point *data, char *extra)
75183 -{
75184 - struct at76_priv *priv = netdev_priv(netdev);
75185 - int ret;
75186 -
75187 - at76_dbg(DBG_IOCTL, "%s: SIOCSIWTHRSPY - number of addresses %d)",
75188 - netdev->name, data->length);
75189 -
75190 - spin_lock_bh(&priv->spy_spinlock);
75191 - ret = iw_handler_set_thrspy(netdev, info, (union iwreq_data *)data,
75192 - extra);
75193 - spin_unlock_bh(&priv->spy_spinlock);
75194 -
75195 - return ret;
75196 -}
75197 -
75198 -static int at76_iw_handler_get_thrspy(struct net_device *netdev,
75199 - struct iw_request_info *info,
75200 - struct iw_point *data, char *extra)
75201 -{
75202 - struct at76_priv *priv = netdev_priv(netdev);
75203 - int ret;
75204 -
75205 - spin_lock_bh(&priv->spy_spinlock);
75206 - ret = iw_handler_get_thrspy(netdev, info, (union iwreq_data *)data,
75207 - extra);
75208 - spin_unlock_bh(&priv->spy_spinlock);
75209 -
75210 - at76_dbg(DBG_IOCTL, "%s: SIOCGIWTHRSPY - number of addresses %d)",
75211 - netdev->name, data->length);
75212 -
75213 - return ret;
75214 -}
75215 -
75216 -static int at76_iw_handler_set_wap(struct net_device *netdev,
75217 - struct iw_request_info *info,
75218 - struct sockaddr *ap_addr, char *extra)
75219 -{
75220 - struct at76_priv *priv = netdev_priv(netdev);
75221 -
75222 - at76_dbg(DBG_IOCTL, "%s: SIOCSIWAP - wap/bssid %s", netdev->name,
75223 - mac2str(ap_addr->sa_data));
75224 -
75225 - /* if the incoming address == ff:ff:ff:ff:ff:ff, the user has
75226 - chosen any or auto AP preference */
75227 - if (is_broadcast_ether_addr(ap_addr->sa_data)
75228 - || is_zero_ether_addr(ap_addr->sa_data))
75229 - priv->wanted_bssid_valid = 0;
75230 - else {
75231 - /* user wants to set a preferred AP address */
75232 - priv->wanted_bssid_valid = 1;
75233 - memcpy(priv->wanted_bssid, ap_addr->sa_data, ETH_ALEN);
75234 - }
75235 -
75236 - return -EIWCOMMIT;
75237 -}
75238 -
75239 -static int at76_iw_handler_get_wap(struct net_device *netdev,
75240 - struct iw_request_info *info,
75241 - struct sockaddr *ap_addr, char *extra)
75242 -{
75243 - struct at76_priv *priv = netdev_priv(netdev);
75244 -
75245 - ap_addr->sa_family = ARPHRD_ETHER;
75246 - memcpy(ap_addr->sa_data, priv->bssid, ETH_ALEN);
75247 -
75248 - at76_dbg(DBG_IOCTL, "%s: SIOCGIWAP - wap/bssid %s", netdev->name,
75249 - mac2str(ap_addr->sa_data));
75250 -
75251 - return 0;
75252 -}
75253 -
75254 -static int at76_iw_handler_set_scan(struct net_device *netdev,
75255 - struct iw_request_info *info,
75256 - union iwreq_data *wrqu, char *extra)
75257 -{
75258 - struct at76_priv *priv = netdev_priv(netdev);
75259 - int ret = 0;
75260 -
75261 - at76_dbg(DBG_IOCTL, "%s: SIOCSIWSCAN", netdev->name);
75262 -
75263 - if (mutex_lock_interruptible(&priv->mtx))
75264 - return -EINTR;
75265 -
75266 - if (!netif_running(netdev)) {
75267 - ret = -ENETDOWN;
75268 - goto exit;
75269 - }
75270 -
75271 - /* jal: we don't allow "iwlist ethX scan" while we are
75272 - in monitor mode */
75273 - if (priv->iw_mode == IW_MODE_MONITOR) {
75274 - ret = -EBUSY;
75275 - goto exit;
75276 - }
75277 -
75278 - /* Discard old scan results */
75279 - if ((jiffies - priv->last_scan) > (20 * HZ))
75280 - priv->scan_state = SCAN_IDLE;
75281 - priv->last_scan = jiffies;
75282 -
75283 - /* Initiate a scan command */
75284 - if (priv->scan_state == SCAN_IN_PROGRESS) {
75285 - ret = -EBUSY;
75286 - goto exit;
75287 - }
75288 -
75289 - priv->scan_state = SCAN_IN_PROGRESS;
75290 -
75291 - at76_quiesce(priv);
75292 -
75293 - /* Try to do passive or active scan if WE asks as. */
75294 - if (wrqu->data.length
75295 - && wrqu->data.length == sizeof(struct iw_scan_req)) {
75296 - struct iw_scan_req *req = (struct iw_scan_req *)extra;
75297 -
75298 - if (req->scan_type == IW_SCAN_TYPE_PASSIVE)
75299 - priv->scan_mode = SCAN_TYPE_PASSIVE;
75300 - else if (req->scan_type == IW_SCAN_TYPE_ACTIVE)
75301 - priv->scan_mode = SCAN_TYPE_ACTIVE;
75302 -
75303 - /* Sanity check values? */
75304 - if (req->min_channel_time > 0)
75305 - priv->scan_min_time = req->min_channel_time;
75306 -
75307 - if (req->max_channel_time > 0)
75308 - priv->scan_max_time = req->max_channel_time;
75309 - }
75310 -
75311 - /* change to scanning state */
75312 - at76_set_mac_state(priv, MAC_SCANNING);
75313 - schedule_work(&priv->work_start_scan);
75314 -
75315 -exit:
75316 - mutex_unlock(&priv->mtx);
75317 - return ret;
75318 -}
75319 -
75320 -static int at76_iw_handler_get_scan(struct net_device *netdev,
75321 - struct iw_request_info *info,
75322 - struct iw_point *data, char *extra)
75323 -{
75324 - struct at76_priv *priv = netdev_priv(netdev);
75325 - unsigned long flags;
75326 - struct list_head *lptr, *nptr;
75327 - struct bss_info *curr_bss;
75328 - struct iw_event *iwe = kmalloc(sizeof(struct iw_event), GFP_KERNEL);
75329 - char *curr_val, *curr_pos = extra;
75330 - int i;
75331 -
75332 - at76_dbg(DBG_IOCTL, "%s: SIOCGIWSCAN", netdev->name);
75333 -
75334 - if (!iwe)
75335 - return -ENOMEM;
75336 -
75337 - if (priv->scan_state != SCAN_COMPLETED) {
75338 - /* scan not yet finished */
75339 - kfree(iwe);
75340 - return -EAGAIN;
75341 - }
75342 -
75343 - spin_lock_irqsave(&priv->bss_list_spinlock, flags);
75344 -
75345 - list_for_each_safe(lptr, nptr, &priv->bss_list) {
75346 - curr_bss = list_entry(lptr, struct bss_info, list);
75347 -
75348 - iwe->cmd = SIOCGIWAP;
75349 - iwe->u.ap_addr.sa_family = ARPHRD_ETHER;
75350 - memcpy(iwe->u.ap_addr.sa_data, curr_bss->bssid, 6);
75351 - curr_pos = iwe_stream_add_event(info, curr_pos,
75352 - extra + IW_SCAN_MAX_DATA, iwe,
75353 - IW_EV_ADDR_LEN);
75354 -
75355 - iwe->u.data.length = curr_bss->ssid_len;
75356 - iwe->cmd = SIOCGIWESSID;
75357 - iwe->u.data.flags = 1;
75358 -
75359 - curr_pos = iwe_stream_add_point(info, curr_pos,
75360 - extra + IW_SCAN_MAX_DATA, iwe,
75361 - curr_bss->ssid);
75362 -
75363 - iwe->cmd = SIOCGIWMODE;
75364 - iwe->u.mode = (curr_bss->capa & WLAN_CAPABILITY_IBSS) ?
75365 - IW_MODE_ADHOC :
75366 - (curr_bss->capa & WLAN_CAPABILITY_ESS) ?
75367 - IW_MODE_MASTER : IW_MODE_AUTO;
75368 - /* IW_MODE_AUTO = 0 which I thought is
75369 - * the most logical value to return in this case */
75370 - curr_pos = iwe_stream_add_event(info, curr_pos,
75371 - extra + IW_SCAN_MAX_DATA, iwe,
75372 - IW_EV_UINT_LEN);
75373 -
75374 - iwe->cmd = SIOCGIWFREQ;
75375 - iwe->u.freq.m = curr_bss->channel;
75376 - iwe->u.freq.e = 0;
75377 - curr_pos = iwe_stream_add_event(info, curr_pos,
75378 - extra + IW_SCAN_MAX_DATA, iwe,
75379 - IW_EV_FREQ_LEN);
75380 -
75381 - iwe->cmd = SIOCGIWENCODE;
75382 - if (curr_bss->capa & WLAN_CAPABILITY_PRIVACY)
75383 - iwe->u.data.flags = IW_ENCODE_ENABLED | IW_ENCODE_NOKEY;
75384 - else
75385 - iwe->u.data.flags = IW_ENCODE_DISABLED;
75386 -
75387 - iwe->u.data.length = 0;
75388 - curr_pos = iwe_stream_add_point(info, curr_pos,
75389 - extra + IW_SCAN_MAX_DATA, iwe,
75390 - NULL);
75391 -
75392 - /* Add quality statistics */
75393 - iwe->cmd = IWEVQUAL;
75394 - iwe->u.qual.noise = 0;
75395 - iwe->u.qual.updated =
75396 - IW_QUAL_NOISE_INVALID | IW_QUAL_LEVEL_UPDATED;
75397 - iwe->u.qual.level = (curr_bss->rssi * 100 / 42);
75398 - if (iwe->u.qual.level > 100)
75399 - iwe->u.qual.level = 100;
75400 - if (at76_is_intersil(priv->board_type))
75401 - iwe->u.qual.qual = curr_bss->link_qual;
75402 - else {
75403 - iwe->u.qual.qual = 0;
75404 - iwe->u.qual.updated |= IW_QUAL_QUAL_INVALID;
75405 - }
75406 - /* Add new value to event */
75407 - curr_pos = iwe_stream_add_event(info, curr_pos,
75408 - extra + IW_SCAN_MAX_DATA, iwe,
75409 - IW_EV_QUAL_LEN);
75410 -
75411 - /* Rate: stuffing multiple values in a single event requires
75412 - * a bit more of magic - Jean II */
75413 - curr_val = curr_pos + IW_EV_LCP_LEN;
75414 -
75415 - iwe->cmd = SIOCGIWRATE;
75416 - /* Those two flags are ignored... */
75417 - iwe->u.bitrate.fixed = 0;
75418 - iwe->u.bitrate.disabled = 0;
75419 - /* Max 8 values */
75420 - for (i = 0; i < curr_bss->rates_len; i++) {
75421 - /* Bit rate given in 500 kb/s units (+ 0x80) */
75422 - iwe->u.bitrate.value =
75423 - ((curr_bss->rates[i] & 0x7f) * 500000);
75424 - /* Add new value to event */
75425 - curr_val = iwe_stream_add_value(info, curr_pos,
75426 - curr_val,
75427 - extra +
75428 - IW_SCAN_MAX_DATA, iwe,
75429 - IW_EV_PARAM_LEN);
75430 - }
75431 -
75432 - /* Check if we added any event */
75433 - if ((curr_val - curr_pos) > IW_EV_LCP_LEN)
75434 - curr_pos = curr_val;
75435 -
75436 - /* more information may be sent back using IWECUSTOM */
75437 -
75438 - }
75439 -
75440 - spin_unlock_irqrestore(&priv->bss_list_spinlock, flags);
75441 -
75442 - data->length = (curr_pos - extra);
75443 - data->flags = 0;
75444 -
75445 - kfree(iwe);
75446 - return 0;
75447 -}
75448 -
75449 -static int at76_iw_handler_set_essid(struct net_device *netdev,
75450 - struct iw_request_info *info,
75451 - struct iw_point *data, char *extra)
75452 -{
75453 - struct at76_priv *priv = netdev_priv(netdev);
75454 -
75455 - at76_dbg(DBG_IOCTL, "%s: SIOCSIWESSID - %s", netdev->name, extra);
75456 -
75457 - if (data->flags) {
75458 - memcpy(priv->essid, extra, data->length);
75459 - priv->essid_size = data->length;
75460 - } else
75461 - priv->essid_size = 0; /* Use any SSID */
75462 -
75463 - return -EIWCOMMIT;
75464 -}
75465 -
75466 -static int at76_iw_handler_get_essid(struct net_device *netdev,
75467 - struct iw_request_info *info,
75468 - struct iw_point *data, char *extra)
75469 -{
75470 - struct at76_priv *priv = netdev_priv(netdev);
75471 -
75472 - if (priv->essid_size) {
75473 - /* not the ANY ssid in priv->essid */
75474 - data->flags = 1;
75475 - data->length = priv->essid_size;
75476 - memcpy(extra, priv->essid, data->length);
75477 - } else {
75478 - /* the ANY ssid was specified */
75479 - if (priv->mac_state == MAC_CONNECTED && priv->curr_bss) {
75480 - /* report the SSID we have found */
75481 - data->flags = 1;
75482 - data->length = priv->curr_bss->ssid_len;
75483 - memcpy(extra, priv->curr_bss->ssid, data->length);
75484 - } else {
75485 - /* report ANY back */
75486 - data->flags = 0;
75487 - data->length = 0;
75488 - }
75489 - }
75490 -
75491 - at76_dbg(DBG_IOCTL, "%s: SIOCGIWESSID - %.*s", netdev->name,
75492 - data->length, extra);
75493 -
75494 - return 0;
75495 -}
75496 -
75497 -static int at76_iw_handler_set_rate(struct net_device *netdev,
75498 - struct iw_request_info *info,
75499 - struct iw_param *bitrate, char *extra)
75500 -{
75501 - struct at76_priv *priv = netdev_priv(netdev);
75502 - int ret = -EIWCOMMIT;
75503 -
75504 - at76_dbg(DBG_IOCTL, "%s: SIOCSIWRATE - %d", netdev->name,
75505 - bitrate->value);
75506 -
75507 - switch (bitrate->value) {
75508 - case -1:
75509 - priv->txrate = TX_RATE_AUTO;
75510 - break; /* auto rate */
75511 - case 1000000:
75512 - priv->txrate = TX_RATE_1MBIT;
75513 - break;
75514 - case 2000000:
75515 - priv->txrate = TX_RATE_2MBIT;
75516 - break;
75517 - case 5500000:
75518 - priv->txrate = TX_RATE_5_5MBIT;
75519 - break;
75520 - case 11000000:
75521 - priv->txrate = TX_RATE_11MBIT;
75522 - break;
75523 - default:
75524 - ret = -EINVAL;
75525 - }
75526 -
75527 - return ret;
75528 -}
75529 -
75530 -static int at76_iw_handler_get_rate(struct net_device *netdev,
75531 - struct iw_request_info *info,
75532 - struct iw_param *bitrate, char *extra)
75533 -{
75534 - struct at76_priv *priv = netdev_priv(netdev);
75535 - int ret = 0;
75536 -
75537 - switch (priv->txrate) {
75538 - /* return max rate if RATE_AUTO */
75539 - case TX_RATE_AUTO:
75540 - bitrate->value = 11000000;
75541 - break;
75542 - case TX_RATE_1MBIT:
75543 - bitrate->value = 1000000;
75544 - break;
75545 - case TX_RATE_2MBIT:
75546 - bitrate->value = 2000000;
75547 - break;
75548 - case TX_RATE_5_5MBIT:
75549 - bitrate->value = 5500000;
75550 - break;
75551 - case TX_RATE_11MBIT:
75552 - bitrate->value = 11000000;
75553 - break;
75554 - default:
75555 - ret = -EINVAL;
75556 - }
75557 -
75558 - bitrate->fixed = (priv->txrate != TX_RATE_AUTO);
75559 - bitrate->disabled = 0;
75560 -
75561 - at76_dbg(DBG_IOCTL, "%s: SIOCGIWRATE - %d", netdev->name,
75562 - bitrate->value);
75563 -
75564 - return ret;
75565 -}
75566 -
75567 -static int at76_iw_handler_set_rts(struct net_device *netdev,
75568 - struct iw_request_info *info,
75569 - struct iw_param *rts, char *extra)
75570 -{
75571 - struct at76_priv *priv = netdev_priv(netdev);
75572 - int ret = -EIWCOMMIT;
75573 - int rthr = rts->value;
75574 -
75575 - at76_dbg(DBG_IOCTL, "%s: SIOCSIWRTS - value %d disabled %s",
75576 - netdev->name, rts->value, (rts->disabled) ? "true" : "false");
75577 -
75578 - if (rts->disabled)
75579 - rthr = MAX_RTS_THRESHOLD;
75580 -
75581 - if ((rthr < 0) || (rthr > MAX_RTS_THRESHOLD))
75582 - ret = -EINVAL;
75583 - else
75584 - priv->rts_threshold = rthr;
75585 -
75586 - return ret;
75587 -}
75588 -
75589 -static int at76_iw_handler_get_rts(struct net_device *netdev,
75590 - struct iw_request_info *info,
75591 - struct iw_param *rts, char *extra)
75592 -{
75593 - struct at76_priv *priv = netdev_priv(netdev);
75594 -
75595 - rts->value = priv->rts_threshold;
75596 - rts->disabled = (rts->value >= MAX_RTS_THRESHOLD);
75597 - rts->fixed = 1;
75598 -
75599 - at76_dbg(DBG_IOCTL, "%s: SIOCGIWRTS - value %d disabled %s",
75600 - netdev->name, rts->value, (rts->disabled) ? "true" : "false");
75601 -
75602 - return 0;
75603 -}
75604 -
75605 -static int at76_iw_handler_set_frag(struct net_device *netdev,
75606 - struct iw_request_info *info,
75607 - struct iw_param *frag, char *extra)
75608 -{
75609 - struct at76_priv *priv = netdev_priv(netdev);
75610 - int ret = -EIWCOMMIT;
75611 - int fthr = frag->value;
75612 -
75613 - at76_dbg(DBG_IOCTL, "%s: SIOCSIWFRAG - value %d, disabled %s",
75614 - netdev->name, frag->value,
75615 - (frag->disabled) ? "true" : "false");
75616 -
75617 - if (frag->disabled)
75618 - fthr = MAX_FRAG_THRESHOLD;
75619 -
75620 - if ((fthr < MIN_FRAG_THRESHOLD) || (fthr > MAX_FRAG_THRESHOLD))
75621 - ret = -EINVAL;
75622 - else
75623 - priv->frag_threshold = fthr & ~0x1; /* get an even value */
75624 -
75625 - return ret;
75626 -}
75627 -
75628 -static int at76_iw_handler_get_frag(struct net_device *netdev,
75629 - struct iw_request_info *info,
75630 - struct iw_param *frag, char *extra)
75631 -{
75632 - struct at76_priv *priv = netdev_priv(netdev);
75633 -
75634 - frag->value = priv->frag_threshold;
75635 - frag->disabled = (frag->value >= MAX_FRAG_THRESHOLD);
75636 - frag->fixed = 1;
75637 -
75638 - at76_dbg(DBG_IOCTL, "%s: SIOCGIWFRAG - value %d, disabled %s",
75639 - netdev->name, frag->value,
75640 - (frag->disabled) ? "true" : "false");
75641 -
75642 - return 0;
75643 -}
75644 -
75645 -static int at76_iw_handler_get_txpow(struct net_device *netdev,
75646 - struct iw_request_info *info,
75647 - struct iw_param *power, char *extra)
75648 -{
75649 - power->value = 15;
75650 - power->fixed = 1; /* No power control */
75651 - power->disabled = 0;
75652 - power->flags = IW_TXPOW_DBM;
75653 -
75654 - at76_dbg(DBG_IOCTL, "%s: SIOCGIWTXPOW - txpow %d dBm", netdev->name,
75655 - power->value);
75656 -
75657 - return 0;
75658 -}
75659 -
75660 -/* jal: short retry is handled by the firmware (at least 0.90.x),
75661 - while long retry is not (?) */
75662 -static int at76_iw_handler_set_retry(struct net_device *netdev,
75663 - struct iw_request_info *info,
75664 - struct iw_param *retry, char *extra)
75665 -{
75666 - struct at76_priv *priv = netdev_priv(netdev);
75667 - int ret = -EIWCOMMIT;
75668 -
75669 - at76_dbg(DBG_IOCTL, "%s: SIOCSIWRETRY disabled %d flags 0x%x val %d",
75670 - netdev->name, retry->disabled, retry->flags, retry->value);
75671 -
75672 - if (!retry->disabled && (retry->flags & IW_RETRY_LIMIT)) {
75673 - if ((retry->flags & IW_RETRY_MIN) ||
75674 - !(retry->flags & IW_RETRY_MAX))
75675 - priv->short_retry_limit = retry->value;
75676 - else
75677 - ret = -EINVAL;
75678 - } else
75679 - ret = -EINVAL;
75680 -
75681 - return ret;
75682 -}
75683 -
75684 -/* Adapted (ripped) from atmel.c */
75685 -static int at76_iw_handler_get_retry(struct net_device *netdev,
75686 - struct iw_request_info *info,
75687 - struct iw_param *retry, char *extra)
75688 -{
75689 - struct at76_priv *priv = netdev_priv(netdev);
75690 -
75691 - at76_dbg(DBG_IOCTL, "%s: SIOCGIWRETRY", netdev->name);
75692 -
75693 - retry->disabled = 0; /* Can't be disabled */
75694 - retry->flags = IW_RETRY_LIMIT;
75695 - retry->value = priv->short_retry_limit;
75696 -
75697 - return 0;
75698 -}
75699 -
75700 -static int at76_iw_handler_set_encode(struct net_device *netdev,
75701 - struct iw_request_info *info,
75702 - struct iw_point *encoding, char *extra)
75703 -{
75704 - struct at76_priv *priv = netdev_priv(netdev);
75705 - int index = (encoding->flags & IW_ENCODE_INDEX) - 1;
75706 - int len = encoding->length;
75707 -
75708 - at76_dbg(DBG_IOCTL, "%s: SIOCSIWENCODE - enc.flags %08x "
75709 - "pointer %p len %d", netdev->name, encoding->flags,
75710 - encoding->pointer, encoding->length);
75711 - at76_dbg(DBG_IOCTL,
75712 - "%s: SIOCSIWENCODE - old wepstate: enabled %s key_id %d "
75713 - "auth_mode %s", netdev->name,
75714 - (priv->wep_enabled) ? "true" : "false", priv->wep_key_id,
75715 - (priv->auth_mode ==
75716 - WLAN_AUTH_SHARED_KEY) ? "restricted" : "open");
75717 -
75718 - /* take the old default key if index is invalid */
75719 - if ((index < 0) || (index >= WEP_KEYS))
75720 - index = priv->wep_key_id;
75721 -
75722 - if (len > 0) {
75723 - if (len > WEP_LARGE_KEY_LEN)
75724 - len = WEP_LARGE_KEY_LEN;
75725 -
75726 - memset(priv->wep_keys[index], 0, WEP_KEY_LEN);
75727 - memcpy(priv->wep_keys[index], extra, len);
75728 - priv->wep_keys_len[index] = (len <= WEP_SMALL_KEY_LEN) ?
75729 - WEP_SMALL_KEY_LEN : WEP_LARGE_KEY_LEN;
75730 - priv->wep_enabled = 1;
75731 - }
75732 -
75733 - priv->wep_key_id = index;
75734 - priv->wep_enabled = ((encoding->flags & IW_ENCODE_DISABLED) == 0);
75735 -
75736 - if (encoding->flags & IW_ENCODE_RESTRICTED)
75737 - priv->auth_mode = WLAN_AUTH_SHARED_KEY;
75738 - if (encoding->flags & IW_ENCODE_OPEN)
75739 - priv->auth_mode = WLAN_AUTH_OPEN;
75740 -
75741 - at76_dbg(DBG_IOCTL,
75742 - "%s: SIOCSIWENCODE - new wepstate: enabled %s key_id %d "
75743 - "key_len %d auth_mode %s", netdev->name,
75744 - (priv->wep_enabled) ? "true" : "false", priv->wep_key_id + 1,
75745 - priv->wep_keys_len[priv->wep_key_id],
75746 - (priv->auth_mode ==
75747 - WLAN_AUTH_SHARED_KEY) ? "restricted" : "open");
75748 -
75749 - return -EIWCOMMIT;
75750 -}
75751 -
75752 -static int at76_iw_handler_get_encode(struct net_device *netdev,
75753 - struct iw_request_info *info,
75754 - struct iw_point *encoding, char *extra)
75755 -{
75756 - struct at76_priv *priv = netdev_priv(netdev);
75757 - int index = (encoding->flags & IW_ENCODE_INDEX) - 1;
75758 -
75759 - if ((index < 0) || (index >= WEP_KEYS))
75760 - index = priv->wep_key_id;
75761 -
75762 - encoding->flags =
75763 - (priv->auth_mode == WLAN_AUTH_SHARED_KEY) ?
75764 - IW_ENCODE_RESTRICTED : IW_ENCODE_OPEN;
75765 -
75766 - if (!priv->wep_enabled)
75767 - encoding->flags |= IW_ENCODE_DISABLED;
75768 -
75769 - if (encoding->pointer) {
75770 - encoding->length = priv->wep_keys_len[index];
75771 -
75772 - memcpy(extra, priv->wep_keys[index], priv->wep_keys_len[index]);
75773 -
75774 - encoding->flags |= (index + 1);
75775 - }
75776 -
75777 - at76_dbg(DBG_IOCTL, "%s: SIOCGIWENCODE - enc.flags %08x "
75778 - "pointer %p len %d", netdev->name, encoding->flags,
75779 - encoding->pointer, encoding->length);
75780 - at76_dbg(DBG_IOCTL,
75781 - "%s: SIOCGIWENCODE - wepstate: enabled %s key_id %d "
75782 - "key_len %d auth_mode %s", netdev->name,
75783 - (priv->wep_enabled) ? "true" : "false", priv->wep_key_id + 1,
75784 - priv->wep_keys_len[priv->wep_key_id],
75785 - (priv->auth_mode ==
75786 - WLAN_AUTH_SHARED_KEY) ? "restricted" : "open");
75787 -
75788 - return 0;
75789 -}
75790 -
75791 -static int at76_iw_handler_set_power(struct net_device *netdev,
75792 - struct iw_request_info *info,
75793 - struct iw_param *prq, char *extra)
75794 -{
75795 - int err = -EIWCOMMIT;
75796 - struct at76_priv *priv = netdev_priv(netdev);
75797 -
75798 - at76_dbg(DBG_IOCTL,
75799 - "%s: SIOCSIWPOWER - disabled %s flags 0x%x value 0x%x",
75800 - netdev->name, (prq->disabled) ? "true" : "false", prq->flags,
75801 - prq->value);
75802 -
75803 - if (prq->disabled)
75804 - priv->pm_mode = AT76_PM_OFF;
75805 - else {
75806 - switch (prq->flags & IW_POWER_MODE) {
75807 - case IW_POWER_ALL_R:
75808 - case IW_POWER_ON:
75809 - break;
75810 - default:
75811 - err = -EINVAL;
75812 - goto exit;
75813 - }
75814 - if (prq->flags & IW_POWER_PERIOD)
75815 - priv->pm_period = prq->value;
75816 -
75817 - if (prq->flags & IW_POWER_TIMEOUT) {
75818 - err = -EINVAL;
75819 - goto exit;
75820 - }
75821 - priv->pm_mode = AT76_PM_ON;
75822 - }
75823 -exit:
75824 - return err;
75825 -}
75826 -
75827 -static int at76_iw_handler_get_power(struct net_device *netdev,
75828 - struct iw_request_info *info,
75829 - struct iw_param *power, char *extra)
75830 -{
75831 - struct at76_priv *priv = netdev_priv(netdev);
75832 -
75833 - power->disabled = (priv->pm_mode == AT76_PM_OFF);
75834 - if (!power->disabled) {
75835 - power->flags = IW_POWER_PERIOD | IW_POWER_ALL_R;
75836 - power->value = priv->pm_period;
75837 - }
75838 -
75839 - at76_dbg(DBG_IOCTL, "%s: SIOCGIWPOWER - %s flags 0x%x value 0x%x",
75840 - netdev->name, power->disabled ? "disabled" : "enabled",
75841 - power->flags, power->value);
75842 -
75843 - return 0;
75844 -}
75845 -
75846 -/*******************************************************************************
75847 - * Private IOCTLS
75848 - */
75849 -static int at76_iw_set_short_preamble(struct net_device *netdev,
75850 - struct iw_request_info *info, char *name,
75851 - char *extra)
75852 -{
75853 - struct at76_priv *priv = netdev_priv(netdev);
75854 - int val = *((int *)name);
75855 - int ret = -EIWCOMMIT;
75856 -
75857 - at76_dbg(DBG_IOCTL, "%s: AT76_SET_SHORT_PREAMBLE, %d",
75858 - netdev->name, val);
75859 -
75860 - if (val < PREAMBLE_TYPE_LONG || val > PREAMBLE_TYPE_AUTO)
75861 - ret = -EINVAL;
75862 - else
75863 - priv->preamble_type = val;
75864 -
75865 - return ret;
75866 -}
75867 -
75868 -static int at76_iw_get_short_preamble(struct net_device *netdev,
75869 - struct iw_request_info *info,
75870 - union iwreq_data *wrqu, char *extra)
75871 -{
75872 - struct at76_priv *priv = netdev_priv(netdev);
75873 -
75874 - snprintf(wrqu->name, sizeof(wrqu->name), "%s (%d)",
75875 - preambles[priv->preamble_type], priv->preamble_type);
75876 - return 0;
75877 -}
75878 -
75879 -static int at76_iw_set_debug(struct net_device *netdev,
75880 - struct iw_request_info *info,
75881 - struct iw_point *data, char *extra)
75882 -{
75883 - char *ptr;
75884 - u32 val;
75885 -
75886 - if (data->length > 0) {
75887 - val = simple_strtol(extra, &ptr, 0);
75888 -
75889 - if (ptr == extra)
75890 - val = DBG_DEFAULTS;
75891 -
75892 - at76_dbg(DBG_IOCTL, "%s: AT76_SET_DEBUG input %d: %s -> 0x%x",
75893 - netdev->name, data->length, extra, val);
75894 - } else
75895 - val = DBG_DEFAULTS;
75896 -
75897 - at76_dbg(DBG_IOCTL, "%s: AT76_SET_DEBUG, old 0x%x, new 0x%x",
75898 - netdev->name, at76_debug, val);
75899 -
75900 - /* jal: some more output to pin down lockups */
75901 - at76_dbg(DBG_IOCTL, "%s: netif running %d queue_stopped %d "
75902 - "carrier_ok %d", netdev->name, netif_running(netdev),
75903 - netif_queue_stopped(netdev), netif_carrier_ok(netdev));
75904 -
75905 - at76_debug = val;
75906 -
75907 - return 0;
75908 -}
75909 -
75910 -static int at76_iw_get_debug(struct net_device *netdev,
75911 - struct iw_request_info *info,
75912 - union iwreq_data *wrqu, char *extra)
75913 -{
75914 - snprintf(wrqu->name, sizeof(wrqu->name), "0x%08x", at76_debug);
75915 - return 0;
75916 -}
75917 -
75918 -static int at76_iw_set_powersave_mode(struct net_device *netdev,
75919 - struct iw_request_info *info, char *name,
75920 - char *extra)
75921 -{
75922 - struct at76_priv *priv = netdev_priv(netdev);
75923 - int val = *((int *)name);
75924 - int ret = -EIWCOMMIT;
75925 -
75926 - at76_dbg(DBG_IOCTL, "%s: AT76_SET_POWERSAVE_MODE, %d (%s)",
75927 - netdev->name, val,
75928 - val == AT76_PM_OFF ? "active" : val == AT76_PM_ON ? "save" :
75929 - val == AT76_PM_SMART ? "smart save" : "<invalid>");
75930 - if (val < AT76_PM_OFF || val > AT76_PM_SMART)
75931 - ret = -EINVAL;
75932 - else
75933 - priv->pm_mode = val;
75934 -
75935 - return ret;
75936 -}
75937 -
75938 -static int at76_iw_get_powersave_mode(struct net_device *netdev,
75939 - struct iw_request_info *info,
75940 - union iwreq_data *wrqu, char *extra)
75941 -{
75942 - struct at76_priv *priv = netdev_priv(netdev);
75943 - int *param = (int *)extra;
75944 -
75945 - param[0] = priv->pm_mode;
75946 - return 0;
75947 -}
75948 -
75949 -static int at76_iw_set_scan_times(struct net_device *netdev,
75950 - struct iw_request_info *info, char *name,
75951 - char *extra)
75952 -{
75953 - struct at76_priv *priv = netdev_priv(netdev);
75954 - int mint = *((int *)name);
75955 - int maxt = *((int *)name + 1);
75956 - int ret = -EIWCOMMIT;
75957 -
75958 - at76_dbg(DBG_IOCTL, "%s: AT76_SET_SCAN_TIMES - min %d max %d",
75959 - netdev->name, mint, maxt);
75960 - if (mint <= 0 || maxt <= 0 || mint > maxt)
75961 - ret = -EINVAL;
75962 - else {
75963 - priv->scan_min_time = mint;
75964 - priv->scan_max_time = maxt;
75965 - }
75966 -
75967 - return ret;
75968 -}
75969 -
75970 -static int at76_iw_get_scan_times(struct net_device *netdev,
75971 - struct iw_request_info *info,
75972 - union iwreq_data *wrqu, char *extra)
75973 -{
75974 - struct at76_priv *priv = netdev_priv(netdev);
75975 - int *param = (int *)extra;
75976 -
75977 - param[0] = priv->scan_min_time;
75978 - param[1] = priv->scan_max_time;
75979 - return 0;
75980 -}
75981 -
75982 -static int at76_iw_set_scan_mode(struct net_device *netdev,
75983 - struct iw_request_info *info, char *name,
75984 - char *extra)
75985 -{
75986 - struct at76_priv *priv = netdev_priv(netdev);
75987 - int val = *((int *)name);
75988 - int ret = -EIWCOMMIT;
75989 -
75990 - at76_dbg(DBG_IOCTL, "%s: AT76_SET_SCAN_MODE - mode %s",
75991 - netdev->name, (val = SCAN_TYPE_ACTIVE) ? "active" :
75992 - (val = SCAN_TYPE_PASSIVE) ? "passive" : "<invalid>");
75993 -
75994 - if (val != SCAN_TYPE_ACTIVE && val != SCAN_TYPE_PASSIVE)
75995 - ret = -EINVAL;
75996 - else
75997 - priv->scan_mode = val;
75998 -
75999 - return ret;
76000 -}
76001 -
76002 -static int at76_iw_get_scan_mode(struct net_device *netdev,
76003 - struct iw_request_info *info,
76004 - union iwreq_data *wrqu, char *extra)
76005 -{
76006 - struct at76_priv *priv = netdev_priv(netdev);
76007 - int *param = (int *)extra;
76008 -
76009 - param[0] = priv->scan_mode;
76010 - return 0;
76011 -}
76012 -
76013 -#define AT76_SET_HANDLER(h, f) [h - SIOCIWFIRST] = (iw_handler) f
76014 -
76015 -/* Standard wireless handlers */
76016 -static const iw_handler at76_handlers[] = {
76017 - AT76_SET_HANDLER(SIOCSIWCOMMIT, at76_iw_handler_commit),
76018 - AT76_SET_HANDLER(SIOCGIWNAME, at76_iw_handler_get_name),
76019 - AT76_SET_HANDLER(SIOCSIWFREQ, at76_iw_handler_set_freq),
76020 - AT76_SET_HANDLER(SIOCGIWFREQ, at76_iw_handler_get_freq),
76021 - AT76_SET_HANDLER(SIOCSIWMODE, at76_iw_handler_set_mode),
76022 - AT76_SET_HANDLER(SIOCGIWMODE, at76_iw_handler_get_mode),
76023 - AT76_SET_HANDLER(SIOCGIWRANGE, at76_iw_handler_get_range),
76024 - AT76_SET_HANDLER(SIOCSIWSPY, at76_iw_handler_set_spy),
76025 - AT76_SET_HANDLER(SIOCGIWSPY, at76_iw_handler_get_spy),
76026 - AT76_SET_HANDLER(SIOCSIWTHRSPY, at76_iw_handler_set_thrspy),
76027 - AT76_SET_HANDLER(SIOCGIWTHRSPY, at76_iw_handler_get_thrspy),
76028 - AT76_SET_HANDLER(SIOCSIWAP, at76_iw_handler_set_wap),
76029 - AT76_SET_HANDLER(SIOCGIWAP, at76_iw_handler_get_wap),
76030 - AT76_SET_HANDLER(SIOCSIWSCAN, at76_iw_handler_set_scan),
76031 - AT76_SET_HANDLER(SIOCGIWSCAN, at76_iw_handler_get_scan),
76032 - AT76_SET_HANDLER(SIOCSIWESSID, at76_iw_handler_set_essid),
76033 - AT76_SET_HANDLER(SIOCGIWESSID, at76_iw_handler_get_essid),
76034 - AT76_SET_HANDLER(SIOCSIWRATE, at76_iw_handler_set_rate),
76035 - AT76_SET_HANDLER(SIOCGIWRATE, at76_iw_handler_get_rate),
76036 - AT76_SET_HANDLER(SIOCSIWRTS, at76_iw_handler_set_rts),
76037 - AT76_SET_HANDLER(SIOCGIWRTS, at76_iw_handler_get_rts),
76038 - AT76_SET_HANDLER(SIOCSIWFRAG, at76_iw_handler_set_frag),
76039 - AT76_SET_HANDLER(SIOCGIWFRAG, at76_iw_handler_get_frag),
76040 - AT76_SET_HANDLER(SIOCGIWTXPOW, at76_iw_handler_get_txpow),
76041 - AT76_SET_HANDLER(SIOCSIWRETRY, at76_iw_handler_set_retry),
76042 - AT76_SET_HANDLER(SIOCGIWRETRY, at76_iw_handler_get_retry),
76043 - AT76_SET_HANDLER(SIOCSIWENCODE, at76_iw_handler_set_encode),
76044 - AT76_SET_HANDLER(SIOCGIWENCODE, at76_iw_handler_get_encode),
76045 - AT76_SET_HANDLER(SIOCSIWPOWER, at76_iw_handler_set_power),
76046 - AT76_SET_HANDLER(SIOCGIWPOWER, at76_iw_handler_get_power)
76047 -};
76048 -
76049 -#define AT76_SET_PRIV(h, f) [h - SIOCIWFIRSTPRIV] = (iw_handler) f
76050 -
76051 -/* Private wireless handlers */
76052 -static const iw_handler at76_priv_handlers[] = {
76053 - AT76_SET_PRIV(AT76_SET_SHORT_PREAMBLE, at76_iw_set_short_preamble),
76054 - AT76_SET_PRIV(AT76_GET_SHORT_PREAMBLE, at76_iw_get_short_preamble),
76055 - AT76_SET_PRIV(AT76_SET_DEBUG, at76_iw_set_debug),
76056 - AT76_SET_PRIV(AT76_GET_DEBUG, at76_iw_get_debug),
76057 - AT76_SET_PRIV(AT76_SET_POWERSAVE_MODE, at76_iw_set_powersave_mode),
76058 - AT76_SET_PRIV(AT76_GET_POWERSAVE_MODE, at76_iw_get_powersave_mode),
76059 - AT76_SET_PRIV(AT76_SET_SCAN_TIMES, at76_iw_set_scan_times),
76060 - AT76_SET_PRIV(AT76_GET_SCAN_TIMES, at76_iw_get_scan_times),
76061 - AT76_SET_PRIV(AT76_SET_SCAN_MODE, at76_iw_set_scan_mode),
76062 - AT76_SET_PRIV(AT76_GET_SCAN_MODE, at76_iw_get_scan_mode),
76063 -};
76064 -
76065 -/* Names and arguments of private wireless handlers */
76066 -static const struct iw_priv_args at76_priv_args[] = {
76067 - /* 0 - long, 1 - short */
76068 - {AT76_SET_SHORT_PREAMBLE,
76069 - IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "set_preamble"},
76070 -
76071 - {AT76_GET_SHORT_PREAMBLE,
76072 - 0, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | 10, "get_preamble"},
76073 -
76074 - /* we must pass the new debug mask as a string, because iwpriv cannot
76075 - * parse hex numbers starting with 0x :-( */
76076 - {AT76_SET_DEBUG,
76077 - IW_PRIV_TYPE_CHAR | 10, 0, "set_debug"},
76078 -
76079 - {AT76_GET_DEBUG,
76080 - 0, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | 10, "get_debug"},
76081 -
76082 - /* 1 - active, 2 - power save, 3 - smart power save */
76083 - {AT76_SET_POWERSAVE_MODE,
76084 - IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "set_powersave"},
76085 -
76086 - {AT76_GET_POWERSAVE_MODE,
76087 - 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_powersave"},
76088 -
76089 - /* min_channel_time, max_channel_time */
76090 - {AT76_SET_SCAN_TIMES,
76091 - IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, 0, "set_scan_times"},
76092 -
76093 - {AT76_GET_SCAN_TIMES,
76094 - 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, "get_scan_times"},
76095 -
76096 - /* 0 - active, 1 - passive scan */
76097 - {AT76_SET_SCAN_MODE,
76098 - IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "set_scan_mode"},
76099 -
76100 - {AT76_GET_SCAN_MODE,
76101 - 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_scan_mode"},
76102 -};
76103 -
76104 -static const struct iw_handler_def at76_handler_def = {
76105 - .num_standard = ARRAY_SIZE(at76_handlers),
76106 - .num_private = ARRAY_SIZE(at76_priv_handlers),
76107 - .num_private_args = ARRAY_SIZE(at76_priv_args),
76108 - .standard = at76_handlers,
76109 - .private = at76_priv_handlers,
76110 - .private_args = at76_priv_args,
76111 - .get_wireless_stats = at76_get_wireless_stats,
76112 -};
76113 -
76114 -static const u8 snapsig[] = { 0xaa, 0xaa, 0x03 };
76115 -
76116 -/* RFC 1042 encapsulates Ethernet frames in 802.2 SNAP (0xaa, 0xaa, 0x03) with
76117 - * a SNAP OID of 0 (0x00, 0x00, 0x00) */
76118 -static const u8 rfc1042sig[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 };
76119 -
76120 -static int at76_tx(struct sk_buff *skb, struct net_device *netdev)
76121 -{
76122 - struct at76_priv *priv = netdev_priv(netdev);
76123 - struct net_device_stats *stats = &priv->stats;
76124 - int ret = 0;
76125 - int wlen;
76126 - int submit_len;
76127 - struct at76_tx_buffer *tx_buffer = priv->bulk_out_buffer;
76128 - struct ieee80211_hdr_3addr *i802_11_hdr =
76129 - (struct ieee80211_hdr_3addr *)tx_buffer->packet;
76130 - u8 *payload = i802_11_hdr->payload;
76131 - struct ethhdr *eh = (struct ethhdr *)skb->data;
76132 -
76133 - if (netif_queue_stopped(netdev)) {
76134 - printk(KERN_ERR "%s: %s called while netdev is stopped\n",
76135 - netdev->name, __func__);
76136 - /* skip this packet */
76137 - dev_kfree_skb(skb);
76138 - return 0;
76139 - }
76140 -
76141 - if (priv->tx_urb->status == -EINPROGRESS) {
76142 - printk(KERN_ERR "%s: %s called while tx urb is pending\n",
76143 - netdev->name, __func__);
76144 - /* skip this packet */
76145 - dev_kfree_skb(skb);
76146 - return 0;
76147 - }
76148 -
76149 - if (skb->len < ETH_HLEN) {
76150 - printk(KERN_ERR "%s: %s: skb too short (%d)\n",
76151 - netdev->name, __func__, skb->len);
76152 - dev_kfree_skb(skb);
76153 - return 0;
76154 - }
76155 -
76156 - at76_ledtrig_tx_activity(); /* tell ledtrigger we send a packet */
76157 -
76158 - /* we can get rid of memcpy if we set netdev->hard_header_len to
76159 - reserve enough space, but we would need to keep the skb around */
76160 -
76161 - if (ntohs(eh->h_proto) <= ETH_DATA_LEN) {
76162 - /* this is a 802.3 packet */
76163 - if (skb->len >= ETH_HLEN + sizeof(rfc1042sig)
76164 - && skb->data[ETH_HLEN] == rfc1042sig[0]
76165 - && skb->data[ETH_HLEN + 1] == rfc1042sig[1]) {
76166 - /* higher layer delivered SNAP header - keep it */
76167 - memcpy(payload, skb->data + ETH_HLEN,
76168 - skb->len - ETH_HLEN);
76169 - wlen = IEEE80211_3ADDR_LEN + skb->len - ETH_HLEN;
76170 - } else {
76171 - printk(KERN_ERR "%s: dropping non-SNAP 802.2 packet "
76172 - "(DSAP 0x%02x SSAP 0x%02x cntrl 0x%02x)\n",
76173 - priv->netdev->name, skb->data[ETH_HLEN],
76174 - skb->data[ETH_HLEN + 1],
76175 - skb->data[ETH_HLEN + 2]);
76176 - dev_kfree_skb(skb);
76177 - return 0;
76178 - }
76179 - } else {
76180 - /* add RFC 1042 header in front */
76181 - memcpy(payload, rfc1042sig, sizeof(rfc1042sig));
76182 - memcpy(payload + sizeof(rfc1042sig), &eh->h_proto,
76183 - skb->len - offsetof(struct ethhdr, h_proto));
76184 - wlen = IEEE80211_3ADDR_LEN + sizeof(rfc1042sig) + skb->len -
76185 - offsetof(struct ethhdr, h_proto);
76186 - }
76187 -
76188 - /* make wireless header */
76189 - i802_11_hdr->frame_ctl =
76190 - cpu_to_le16(IEEE80211_FTYPE_DATA |
76191 - (priv->wep_enabled ? IEEE80211_FCTL_PROTECTED : 0) |
76192 - (priv->iw_mode ==
76193 - IW_MODE_INFRA ? IEEE80211_FCTL_TODS : 0));
76194 -
76195 - if (priv->iw_mode == IW_MODE_ADHOC) {
76196 - memcpy(i802_11_hdr->addr1, eh->h_dest, ETH_ALEN);
76197 - memcpy(i802_11_hdr->addr2, eh->h_source, ETH_ALEN);
76198 - memcpy(i802_11_hdr->addr3, priv->bssid, ETH_ALEN);
76199 - } else if (priv->iw_mode == IW_MODE_INFRA) {
76200 - memcpy(i802_11_hdr->addr1, priv->bssid, ETH_ALEN);
76201 - memcpy(i802_11_hdr->addr2, eh->h_source, ETH_ALEN);
76202 - memcpy(i802_11_hdr->addr3, eh->h_dest, ETH_ALEN);
76203 - }
76204 -
76205 - i802_11_hdr->duration_id = cpu_to_le16(0);
76206 - i802_11_hdr->seq_ctl = cpu_to_le16(0);
76207 -
76208 - /* setup 'Atmel' header */
76209 - tx_buffer->wlength = cpu_to_le16(wlen);
76210 - tx_buffer->tx_rate = priv->txrate;
76211 - /* for broadcast destination addresses, the firmware 0.100.x
76212 - seems to choose the highest rate set with CMD_STARTUP in
76213 - basic_rate_set replacing this value */
76214 -
76215 - memset(tx_buffer->reserved, 0, sizeof(tx_buffer->reserved));
76216 -
76217 - tx_buffer->padding = at76_calc_padding(wlen);
76218 - submit_len = wlen + AT76_TX_HDRLEN + tx_buffer->padding;
76219 -
76220 - at76_dbg(DBG_TX_DATA_CONTENT, "%s skb->data %s", priv->netdev->name,
76221 - hex2str(skb->data, 32));
76222 - at76_dbg(DBG_TX_DATA, "%s tx: wlen 0x%x pad 0x%x rate %d hdr %s",
76223 - priv->netdev->name,
76224 - le16_to_cpu(tx_buffer->wlength),
76225 - tx_buffer->padding, tx_buffer->tx_rate,
76226 - hex2str(i802_11_hdr, sizeof(*i802_11_hdr)));
76227 - at76_dbg(DBG_TX_DATA_CONTENT, "%s payload %s", priv->netdev->name,
76228 - hex2str(payload, 48));
76229 -
76230 - /* send stuff */
76231 - netif_stop_queue(netdev);
76232 - netdev->trans_start = jiffies;
76233 -
76234 - usb_fill_bulk_urb(priv->tx_urb, priv->udev, priv->tx_pipe, tx_buffer,
76235 - submit_len, at76_tx_callback, priv);
76236 - ret = usb_submit_urb(priv->tx_urb, GFP_ATOMIC);
76237 - if (ret) {
76238 - stats->tx_errors++;
76239 - printk(KERN_ERR "%s: error in tx submit urb: %d\n",
76240 - netdev->name, ret);
76241 - if (ret == -EINVAL)
76242 - printk(KERN_ERR
76243 - "%s: -EINVAL: tx urb %p hcpriv %p complete %p\n",
76244 - priv->netdev->name, priv->tx_urb,
76245 - priv->tx_urb->hcpriv, priv->tx_urb->complete);
76246 - } else {
76247 - stats->tx_bytes += skb->len;
76248 - dev_kfree_skb(skb);
76249 - }
76250 -
76251 - return ret;
76252 -}
76253 -
76254 -static void at76_tx_timeout(struct net_device *netdev)
76255 -{
76256 - struct at76_priv *priv = netdev_priv(netdev);
76257 -
76258 - if (!priv)
76259 - return;
76260 - dev_warn(&netdev->dev, "tx timeout.");
76261 -
76262 - usb_unlink_urb(priv->tx_urb);
76263 - priv->stats.tx_errors++;
76264 -}
76265 -
76266 -static int at76_submit_rx_urb(struct at76_priv *priv)
76267 -{
76268 - int ret;
76269 - int size;
76270 - struct sk_buff *skb = priv->rx_skb;
76271 -
76272 - if (!priv->rx_urb) {
76273 - printk(KERN_ERR "%s: %s: priv->rx_urb is NULL\n",
76274 - priv->netdev->name, __func__);
76275 - return -EFAULT;
76276 - }
76277 -
76278 - if (!skb) {
76279 - skb = dev_alloc_skb(sizeof(struct at76_rx_buffer));
76280 - if (!skb) {
76281 - printk(KERN_ERR "%s: cannot allocate rx skbuff\n",
76282 - priv->netdev->name);
76283 - ret = -ENOMEM;
76284 - goto exit;
76285 - }
76286 - priv->rx_skb = skb;
76287 - } else {
76288 - skb_push(skb, skb_headroom(skb));
76289 - skb_trim(skb, 0);
76290 - }
76291 -
76292 - size = skb_tailroom(skb);
76293 - usb_fill_bulk_urb(priv->rx_urb, priv->udev, priv->rx_pipe,
76294 - skb_put(skb, size), size, at76_rx_callback, priv);
76295 - ret = usb_submit_urb(priv->rx_urb, GFP_ATOMIC);
76296 - if (ret < 0) {
76297 - if (ret == -ENODEV)
76298 - at76_dbg(DBG_DEVSTART,
76299 - "usb_submit_urb returned -ENODEV");
76300 - else
76301 - printk(KERN_ERR "%s: rx, usb_submit_urb failed: %d\n",
76302 - priv->netdev->name, ret);
76303 - }
76304 -
76305 -exit:
76306 - if (ret < 0 && ret != -ENODEV)
76307 - printk(KERN_ERR "%s: cannot submit rx urb - please unload the "
76308 - "driver and/or power cycle the device\n",
76309 - priv->netdev->name);
76310 -
76311 - return ret;
76312 -}
76313 -
76314 -static int at76_open(struct net_device *netdev)
76315 -{
76316 - struct at76_priv *priv = netdev_priv(netdev);
76317 - int ret = 0;
76318 -
76319 - at76_dbg(DBG_PROC_ENTRY, "%s(): entry", __func__);
76320 -
76321 - if (mutex_lock_interruptible(&priv->mtx))
76322 - return -EINTR;
76323 -
76324 - /* if netdev->dev_addr != priv->mac_addr we must
76325 - set the mac address in the device ! */
76326 - if (compare_ether_addr(netdev->dev_addr, priv->mac_addr)) {
76327 - if (at76_add_mac_address(priv, netdev->dev_addr) >= 0)
76328 - at76_dbg(DBG_PROGRESS, "%s: set new MAC addr %s",
76329 - netdev->name, mac2str(netdev->dev_addr));
76330 - }
76331 -
76332 - priv->scan_state = SCAN_IDLE;
76333 - priv->last_scan = jiffies;
76334 -
76335 - ret = at76_submit_rx_urb(priv);
76336 - if (ret < 0) {
76337 - printk(KERN_ERR "%s: open: submit_rx_urb failed: %d\n",
76338 - netdev->name, ret);
76339 - goto error;
76340 - }
76341 -
76342 - schedule_delayed_work(&priv->dwork_restart, 0);
76343 -
76344 - at76_dbg(DBG_PROC_ENTRY, "%s(): end", __func__);
76345 -error:
76346 - mutex_unlock(&priv->mtx);
76347 - return ret < 0 ? ret : 0;
76348 -}
76349 -
76350 -static int at76_stop(struct net_device *netdev)
76351 -{
76352 - struct at76_priv *priv = netdev_priv(netdev);
76353 -
76354 - at76_dbg(DBG_DEVSTART, "%s: ENTER", __func__);
76355 -
76356 - if (mutex_lock_interruptible(&priv->mtx))
76357 - return -EINTR;
76358 -
76359 - at76_quiesce(priv);
76360 -
76361 - if (!priv->device_unplugged) {
76362 - /* We are called by "ifconfig ethX down", not because the
76363 - * device is not available anymore. */
76364 - at76_set_radio(priv, 0);
76365 -
76366 - /* We unlink rx_urb because at76_open() re-submits it.
76367 - * If unplugged, at76_delete_device() takes care of it. */
76368 - usb_kill_urb(priv->rx_urb);
76369 - }
76370 -
76371 - /* free the bss_list */
76372 - at76_free_bss_list(priv);
76373 -
76374 - mutex_unlock(&priv->mtx);
76375 - at76_dbg(DBG_DEVSTART, "%s: EXIT", __func__);
76376 -
76377 - return 0;
76378 -}
76379 -
76380 -static void at76_ethtool_get_drvinfo(struct net_device *netdev,
76381 - struct ethtool_drvinfo *info)
76382 -{
76383 - struct at76_priv *priv = netdev_priv(netdev);
76384 -
76385 - strncpy(info->driver, DRIVER_NAME, sizeof(info->driver));
76386 - strncpy(info->version, DRIVER_VERSION, sizeof(info->version));
76387 -
76388 - usb_make_path(priv->udev, info->bus_info, sizeof(info->bus_info));
76389 -
76390 - snprintf(info->fw_version, sizeof(info->fw_version), "%d.%d.%d-%d",
76391 - priv->fw_version.major, priv->fw_version.minor,
76392 - priv->fw_version.patch, priv->fw_version.build);
76393 -}
76394 -
76395 -static u32 at76_ethtool_get_link(struct net_device *netdev)
76396 -{
76397 - struct at76_priv *priv = netdev_priv(netdev);
76398 - return priv->mac_state == MAC_CONNECTED;
76399 -}
76400 -
76401 -static struct ethtool_ops at76_ethtool_ops = {
76402 - .get_drvinfo = at76_ethtool_get_drvinfo,
76403 - .get_link = at76_ethtool_get_link,
76404 -};
76405 -
76406 -/* Download external firmware */
76407 -static int at76_load_external_fw(struct usb_device *udev, struct fwentry *fwe)
76408 -{
76409 - int ret;
76410 - int op_mode;
76411 - int blockno = 0;
76412 - int bsize;
76413 - u8 *block;
76414 - u8 *buf = fwe->extfw;
76415 - int size = fwe->extfw_size;
76416 -
76417 - if (!buf || !size)
76418 - return -ENOENT;
76419 -
76420 - op_mode = at76_get_op_mode(udev);
76421 - at76_dbg(DBG_DEVSTART, "opmode %d", op_mode);
76422 + op_mode = at76_get_op_mode(udev);
76423 + at76_dbg(DBG_DEVSTART, "opmode %d", op_mode);
76424
76425 if (op_mode != OPMODE_NORMAL_NIC_WITHOUT_FLASH) {
76426 dev_printk(KERN_ERR, &udev->dev, "unexpected opmode %d\n",
76427 @@ -3458,444 +1423,44 @@
76428 exit:
76429 kfree(block);
76430 if (ret < 0)
76431 - dev_printk(KERN_ERR, &udev->dev,
76432 - "downloading external firmware failed: %d\n", ret);
76433 - return ret;
76434 -}
76435 -
76436 -/* Download internal firmware */
76437 -static int at76_load_internal_fw(struct usb_device *udev, struct fwentry *fwe)
76438 -{
76439 - int ret;
76440 - int need_remap = !at76_is_505a(fwe->board_type);
76441 -
76442 - ret = at76_usbdfu_download(udev, fwe->intfw, fwe->intfw_size,
76443 - need_remap ? 0 : 2 * HZ);
76444 -
76445 - if (ret < 0) {
76446 - dev_printk(KERN_ERR, &udev->dev,
76447 - "downloading internal fw failed with %d\n", ret);
76448 - goto exit;
76449 - }
76450 -
76451 - at76_dbg(DBG_DEVSTART, "sending REMAP");
76452 -
76453 - /* no REMAP for 505A (see SF driver) */
76454 - if (need_remap) {
76455 - ret = at76_remap(udev);
76456 - if (ret < 0) {
76457 - dev_printk(KERN_ERR, &udev->dev,
76458 - "sending REMAP failed with %d\n", ret);
76459 - goto exit;
76460 - }
76461 - }
76462 -
76463 - at76_dbg(DBG_DEVSTART, "sleeping for 2 seconds");
76464 - schedule_timeout_interruptible(2 * HZ + 1);
76465 - usb_reset_device(udev);
76466 -
76467 -exit:
76468 - return ret;
76469 -}
76470 -
76471 -static int at76_match_essid(struct at76_priv *priv, struct bss_info *ptr)
76472 -{
76473 - /* common criteria for both modi */
76474 -
76475 - int ret = (priv->essid_size == 0 /* ANY ssid */ ||
76476 - (priv->essid_size == ptr->ssid_len &&
76477 - !memcmp(priv->essid, ptr->ssid, ptr->ssid_len)));
76478 - if (!ret)
76479 - at76_dbg(DBG_BSS_MATCH,
76480 - "%s bss table entry %p: essid didn't match",
76481 - priv->netdev->name, ptr);
76482 - return ret;
76483 -}
76484 -
76485 -static inline int at76_match_mode(struct at76_priv *priv, struct bss_info *ptr)
76486 -{
76487 - int ret;
76488 -
76489 - if (priv->iw_mode == IW_MODE_ADHOC)
76490 - ret = ptr->capa & WLAN_CAPABILITY_IBSS;
76491 - else
76492 - ret = ptr->capa & WLAN_CAPABILITY_ESS;
76493 - if (!ret)
76494 - at76_dbg(DBG_BSS_MATCH,
76495 - "%s bss table entry %p: mode didn't match",
76496 - priv->netdev->name, ptr);
76497 - return ret;
76498 -}
76499 -
76500 -static int at76_match_rates(struct at76_priv *priv, struct bss_info *ptr)
76501 -{
76502 - int i;
76503 -
76504 - for (i = 0; i < ptr->rates_len; i++) {
76505 - u8 rate = ptr->rates[i];
76506 -
76507 - if (!(rate & 0x80))
76508 - continue;
76509 -
76510 - /* this is a basic rate we have to support
76511 - (see IEEE802.11, ch. 7.3.2.2) */
76512 - if (rate != (0x80 | hw_rates[0])
76513 - && rate != (0x80 | hw_rates[1])
76514 - && rate != (0x80 | hw_rates[2])
76515 - && rate != (0x80 | hw_rates[3])) {
76516 - at76_dbg(DBG_BSS_MATCH,
76517 - "%s: bss table entry %p: basic rate %02x not "
76518 - "supported", priv->netdev->name, ptr, rate);
76519 - return 0;
76520 - }
76521 - }
76522 -
76523 - /* if we use short preamble, the bss must support it */
76524 - if (priv->preamble_type == PREAMBLE_TYPE_SHORT &&
76525 - !(ptr->capa & WLAN_CAPABILITY_SHORT_PREAMBLE)) {
76526 - at76_dbg(DBG_BSS_MATCH,
76527 - "%s: %p does not support short preamble",
76528 - priv->netdev->name, ptr);
76529 - return 0;
76530 - } else
76531 - return 1;
76532 -}
76533 -
76534 -static inline int at76_match_wep(struct at76_priv *priv, struct bss_info *ptr)
76535 -{
76536 - if (!priv->wep_enabled && ptr->capa & WLAN_CAPABILITY_PRIVACY) {
76537 - /* we have disabled WEP, but the BSS signals privacy */
76538 - at76_dbg(DBG_BSS_MATCH,
76539 - "%s: bss table entry %p: requires encryption",
76540 - priv->netdev->name, ptr);
76541 - return 0;
76542 - }
76543 - /* otherwise if the BSS does not signal privacy it may well
76544 - accept encrypted packets from us ... */
76545 - return 1;
76546 -}
76547 -
76548 -static inline int at76_match_bssid(struct at76_priv *priv, struct bss_info *ptr)
76549 -{
76550 - if (!priv->wanted_bssid_valid ||
76551 - !compare_ether_addr(ptr->bssid, priv->wanted_bssid))
76552 - return 1;
76553 -
76554 - at76_dbg(DBG_BSS_MATCH,
76555 - "%s: requested bssid - %s does not match",
76556 - priv->netdev->name, mac2str(priv->wanted_bssid));
76557 - at76_dbg(DBG_BSS_MATCH,
76558 - " AP bssid - %s of bss table entry %p",
76559 - mac2str(ptr->bssid), ptr);
76560 - return 0;
76561 -}
76562 -
76563 -/**
76564 - * at76_match_bss - try to find a matching bss in priv->bss
76565 - *
76566 - * last - last bss tried
76567 - *
76568 - * last == NULL signals a new round starting with priv->bss_list.next
76569 - * this function must be called inside an acquired priv->bss_list_spinlock
76570 - * otherwise the timeout on bss may remove the newly chosen entry
76571 - */
76572 -static struct bss_info *at76_match_bss(struct at76_priv *priv,
76573 - struct bss_info *last)
76574 -{
76575 - struct bss_info *ptr = NULL;
76576 - struct list_head *curr;
76577 -
76578 - curr = last ? last->list.next : priv->bss_list.next;
76579 - while (curr != &priv->bss_list) {
76580 - ptr = list_entry(curr, struct bss_info, list);
76581 - if (at76_match_essid(priv, ptr) && at76_match_mode(priv, ptr)
76582 - && at76_match_wep(priv, ptr) && at76_match_rates(priv, ptr)
76583 - && at76_match_bssid(priv, ptr))
76584 - break;
76585 - curr = curr->next;
76586 - }
76587 -
76588 - if (curr == &priv->bss_list)
76589 - ptr = NULL;
76590 - /* otherwise ptr points to the struct bss_info we have chosen */
76591 -
76592 - at76_dbg(DBG_BSS_TABLE, "%s %s: returned %p", priv->netdev->name,
76593 - __func__, ptr);
76594 - return ptr;
76595 -}
76596 -
76597 -/* Start joining a matching BSS, or create own IBSS */
76598 -static void at76_work_join(struct work_struct *work)
76599 -{
76600 - struct at76_priv *priv = container_of(work, struct at76_priv,
76601 - work_join);
76602 - int ret;
76603 - unsigned long flags;
76604 -
76605 - mutex_lock(&priv->mtx);
76606 -
76607 - WARN_ON(priv->mac_state != MAC_JOINING);
76608 - if (priv->mac_state != MAC_JOINING)
76609 - goto exit;
76610 -
76611 - /* secure the access to priv->curr_bss ! */
76612 - spin_lock_irqsave(&priv->bss_list_spinlock, flags);
76613 - priv->curr_bss = at76_match_bss(priv, priv->curr_bss);
76614 - spin_unlock_irqrestore(&priv->bss_list_spinlock, flags);
76615 -
76616 - if (!priv->curr_bss) {
76617 - /* here we haven't found a matching (i)bss ... */
76618 - if (priv->iw_mode == IW_MODE_ADHOC) {
76619 - at76_set_mac_state(priv, MAC_OWN_IBSS);
76620 - at76_start_ibss(priv);
76621 - goto exit;
76622 - }
76623 - /* haven't found a matching BSS in infra mode - try again */
76624 - at76_set_mac_state(priv, MAC_SCANNING);
76625 - schedule_work(&priv->work_start_scan);
76626 - goto exit;
76627 - }
76628 -
76629 - ret = at76_join_bss(priv, priv->curr_bss);
76630 - if (ret < 0) {
76631 - printk(KERN_ERR "%s: join_bss failed with %d\n",
76632 - priv->netdev->name, ret);
76633 - goto exit;
76634 - }
76635 -
76636 - ret = at76_wait_completion(priv, CMD_JOIN);
76637 - if (ret != CMD_STATUS_COMPLETE) {
76638 - if (ret != CMD_STATUS_TIME_OUT)
76639 - printk(KERN_ERR "%s: join_bss completed with %d\n",
76640 - priv->netdev->name, ret);
76641 - else
76642 - printk(KERN_INFO "%s: join_bss ssid %s timed out\n",
76643 - priv->netdev->name,
76644 - mac2str(priv->curr_bss->bssid));
76645 -
76646 - /* retry next BSS immediately */
76647 - schedule_work(&priv->work_join);
76648 - goto exit;
76649 - }
76650 -
76651 - /* here we have joined the (I)BSS */
76652 - if (priv->iw_mode == IW_MODE_ADHOC) {
76653 - struct bss_info *bptr = priv->curr_bss;
76654 - at76_set_mac_state(priv, MAC_CONNECTED);
76655 - /* get ESSID, BSSID and channel for priv->curr_bss */
76656 - priv->essid_size = bptr->ssid_len;
76657 - memcpy(priv->essid, bptr->ssid, bptr->ssid_len);
76658 - memcpy(priv->bssid, bptr->bssid, ETH_ALEN);
76659 - priv->channel = bptr->channel;
76660 - at76_iwevent_bss_connect(priv->netdev, bptr->bssid);
76661 - netif_carrier_on(priv->netdev);
76662 - netif_start_queue(priv->netdev);
76663 - /* just to be sure */
76664 - cancel_delayed_work(&priv->dwork_get_scan);
76665 - cancel_delayed_work(&priv->dwork_auth);
76666 - cancel_delayed_work(&priv->dwork_assoc);
76667 - } else {
76668 - /* send auth req */
76669 - priv->retries = AUTH_RETRIES;
76670 - at76_set_mac_state(priv, MAC_AUTH);
76671 - at76_auth_req(priv, priv->curr_bss, 1, NULL);
76672 - at76_dbg(DBG_MGMT_TIMER,
76673 - "%s:%d: starting mgmt_timer + HZ", __func__, __LINE__);
76674 - schedule_delayed_work(&priv->dwork_auth, AUTH_TIMEOUT);
76675 - }
76676 -
76677 -exit:
76678 - mutex_unlock(&priv->mtx);
76679 -}
76680 -
76681 -/* Reap scan results */
76682 -static void at76_dwork_get_scan(struct work_struct *work)
76683 -{
76684 - int status;
76685 - int ret;
76686 - struct at76_priv *priv = container_of(work, struct at76_priv,
76687 - dwork_get_scan.work);
76688 -
76689 - mutex_lock(&priv->mtx);
76690 - WARN_ON(priv->mac_state != MAC_SCANNING);
76691 - if (priv->mac_state != MAC_SCANNING)
76692 - goto exit;
76693 -
76694 - status = at76_get_cmd_status(priv->udev, CMD_SCAN);
76695 - if (status < 0) {
76696 - printk(KERN_ERR "%s: %s: at76_get_cmd_status failed with %d\n",
76697 - priv->netdev->name, __func__, status);
76698 - status = CMD_STATUS_IN_PROGRESS;
76699 - /* INFO: Hope it was a one off error - if not, scanning
76700 - further down the line and stop this cycle */
76701 - }
76702 - at76_dbg(DBG_PROGRESS,
76703 - "%s %s: got cmd_status %d (state %s, need_any %d)",
76704 - priv->netdev->name, __func__, status,
76705 - mac_states[priv->mac_state], priv->scan_need_any);
76706 -
76707 - if (status != CMD_STATUS_COMPLETE) {
76708 - if ((status != CMD_STATUS_IN_PROGRESS) &&
76709 - (status != CMD_STATUS_IDLE))
76710 - printk(KERN_ERR "%s: %s: Bad scan status: %s\n",
76711 - priv->netdev->name, __func__,
76712 - at76_get_cmd_status_string(status));
76713 -
76714 - /* the first cmd status after scan start is always a IDLE ->
76715 - start the timer to poll again until COMPLETED */
76716 - at76_dbg(DBG_MGMT_TIMER,
76717 - "%s:%d: starting mgmt_timer for %d ticks",
76718 - __func__, __LINE__, SCAN_POLL_INTERVAL);
76719 - schedule_delayed_work(&priv->dwork_get_scan,
76720 - SCAN_POLL_INTERVAL);
76721 - goto exit;
76722 - }
76723 -
76724 - if (at76_debug & DBG_BSS_TABLE)
76725 - at76_dump_bss_table(priv);
76726 -
76727 - if (priv->scan_need_any) {
76728 - ret = at76_start_scan(priv, 0);
76729 - if (ret < 0)
76730 - printk(KERN_ERR
76731 - "%s: %s: start_scan (ANY) failed with %d\n",
76732 - priv->netdev->name, __func__, ret);
76733 - at76_dbg(DBG_MGMT_TIMER,
76734 - "%s:%d: starting mgmt_timer for %d ticks", __func__,
76735 - __LINE__, SCAN_POLL_INTERVAL);
76736 - schedule_delayed_work(&priv->dwork_get_scan,
76737 - SCAN_POLL_INTERVAL);
76738 - priv->scan_need_any = 0;
76739 - } else {
76740 - priv->scan_state = SCAN_COMPLETED;
76741 - /* report the end of scan to user space */
76742 - at76_iwevent_scan_complete(priv->netdev);
76743 - at76_set_mac_state(priv, MAC_JOINING);
76744 - schedule_work(&priv->work_join);
76745 - }
76746 -
76747 -exit:
76748 - mutex_unlock(&priv->mtx);
76749 -}
76750 -
76751 -/* Handle loss of beacons from the AP */
76752 -static void at76_dwork_beacon(struct work_struct *work)
76753 -{
76754 - struct at76_priv *priv = container_of(work, struct at76_priv,
76755 - dwork_beacon.work);
76756 -
76757 - mutex_lock(&priv->mtx);
76758 - if (priv->mac_state != MAC_CONNECTED || priv->iw_mode != IW_MODE_INFRA)
76759 - goto exit;
76760 -
76761 - /* We haven't received any beacons from out AP for BEACON_TIMEOUT */
76762 - printk(KERN_INFO "%s: lost beacon bssid %s\n",
76763 - priv->netdev->name, mac2str(priv->curr_bss->bssid));
76764 -
76765 - netif_carrier_off(priv->netdev);
76766 - netif_stop_queue(priv->netdev);
76767 - at76_iwevent_bss_disconnect(priv->netdev);
76768 - at76_set_mac_state(priv, MAC_SCANNING);
76769 - schedule_work(&priv->work_start_scan);
76770 -
76771 -exit:
76772 - mutex_unlock(&priv->mtx);
76773 -}
76774 -
76775 -/* Handle authentication response timeout */
76776 -static void at76_dwork_auth(struct work_struct *work)
76777 -{
76778 - struct at76_priv *priv = container_of(work, struct at76_priv,
76779 - dwork_auth.work);
76780 -
76781 - mutex_lock(&priv->mtx);
76782 - WARN_ON(priv->mac_state != MAC_AUTH);
76783 - if (priv->mac_state != MAC_AUTH)
76784 - goto exit;
76785 -
76786 - at76_dbg(DBG_PROGRESS, "%s: authentication response timeout",
76787 - priv->netdev->name);
76788 -
76789 - if (priv->retries-- >= 0) {
76790 - at76_auth_req(priv, priv->curr_bss, 1, NULL);
76791 - at76_dbg(DBG_MGMT_TIMER, "%s:%d: starting mgmt_timer + HZ",
76792 - __func__, __LINE__);
76793 - schedule_delayed_work(&priv->dwork_auth, AUTH_TIMEOUT);
76794 - } else {
76795 - /* try to get next matching BSS */
76796 - at76_set_mac_state(priv, MAC_JOINING);
76797 - schedule_work(&priv->work_join);
76798 - }
76799 -
76800 -exit:
76801 - mutex_unlock(&priv->mtx);
76802 -}
76803 -
76804 -/* Handle association response timeout */
76805 -static void at76_dwork_assoc(struct work_struct *work)
76806 -{
76807 - struct at76_priv *priv = container_of(work, struct at76_priv,
76808 - dwork_assoc.work);
76809 -
76810 - mutex_lock(&priv->mtx);
76811 - WARN_ON(priv->mac_state != MAC_ASSOC);
76812 - if (priv->mac_state != MAC_ASSOC)
76813 - goto exit;
76814 -
76815 - at76_dbg(DBG_PROGRESS, "%s: association response timeout",
76816 - priv->netdev->name);
76817 -
76818 - if (priv->retries-- >= 0) {
76819 - at76_assoc_req(priv, priv->curr_bss);
76820 - at76_dbg(DBG_MGMT_TIMER, "%s:%d: starting mgmt_timer + HZ",
76821 - __func__, __LINE__);
76822 - schedule_delayed_work(&priv->dwork_assoc, ASSOC_TIMEOUT);
76823 - } else {
76824 - /* try to get next matching BSS */
76825 - at76_set_mac_state(priv, MAC_JOINING);
76826 - schedule_work(&priv->work_join);
76827 - }
76828 -
76829 -exit:
76830 - mutex_unlock(&priv->mtx);
76831 + dev_printk(KERN_ERR, &udev->dev,
76832 + "downloading external firmware failed: %d\n", ret);
76833 + return ret;
76834 }
76835
76836 -/* Read new bssid in ad-hoc mode */
76837 -static void at76_work_new_bss(struct work_struct *work)
76838 +/* Download internal firmware */
76839 +static int at76_load_internal_fw(struct usb_device *udev, struct fwentry *fwe)
76840 {
76841 - struct at76_priv *priv = container_of(work, struct at76_priv,
76842 - work_new_bss);
76843 int ret;
76844 - struct mib_mac_mgmt mac_mgmt;
76845 + int need_remap = !at76_is_505a(fwe->board_type);
76846
76847 - mutex_lock(&priv->mtx);
76848 + ret = at76_usbdfu_download(udev, fwe->intfw, fwe->intfw_size,
76849 + need_remap ? 0 : 2 * HZ);
76850
76851 - ret = at76_get_mib(priv->udev, MIB_MAC_MGMT, &mac_mgmt,
76852 - sizeof(struct mib_mac_mgmt));
76853 if (ret < 0) {
76854 - printk(KERN_ERR "%s: at76_get_mib failed: %d\n",
76855 - priv->netdev->name, ret);
76856 + dev_printk(KERN_ERR, &udev->dev,
76857 + "downloading internal fw failed with %d\n", ret);
76858 goto exit;
76859 }
76860
76861 - at76_dbg(DBG_PROGRESS, "ibss_change = 0x%2x", mac_mgmt.ibss_change);
76862 - memcpy(priv->bssid, mac_mgmt.current_bssid, ETH_ALEN);
76863 - at76_dbg(DBG_PROGRESS, "using BSSID %s", mac2str(priv->bssid));
76864 -
76865 - at76_iwevent_bss_connect(priv->netdev, priv->bssid);
76866 + at76_dbg(DBG_DEVSTART, "sending REMAP");
76867
76868 - priv->mib_buf.type = MIB_MAC_MGMT;
76869 - priv->mib_buf.size = 1;
76870 - priv->mib_buf.index = offsetof(struct mib_mac_mgmt, ibss_change);
76871 - priv->mib_buf.data.byte = 0;
76872 + /* no REMAP for 505A (see SF driver) */
76873 + if (need_remap) {
76874 + ret = at76_remap(udev);
76875 + if (ret < 0) {
76876 + dev_printk(KERN_ERR, &udev->dev,
76877 + "sending REMAP failed with %d\n", ret);
76878 + goto exit;
76879 + }
76880 + }
76881
76882 - ret = at76_set_mib(priv, &priv->mib_buf);
76883 - if (ret < 0)
76884 - printk(KERN_ERR "%s: set_mib (ibss change ok) failed: %d\n",
76885 - priv->netdev->name, ret);
76886 + at76_dbg(DBG_DEVSTART, "sleeping for 2 seconds");
76887 + schedule_timeout_interruptible(2 * HZ + 1);
76888 + usb_reset_device(udev);
76889
76890 exit:
76891 - mutex_unlock(&priv->mtx);
76892 + return ret;
76893 }
76894
76895 static int at76_startup_device(struct at76_priv *priv)
76896 @@ -3905,14 +1470,14 @@
76897
76898 at76_dbg(DBG_PARAMS,
76899 "%s param: ssid %.*s (%s) mode %s ch %d wep %s key %d "
76900 - "keylen %d", priv->netdev->name, priv->essid_size, priv->essid,
76901 - hex2str(priv->essid, IW_ESSID_MAX_SIZE),
76902 + "keylen %d", wiphy_name(priv->hw->wiphy), priv->essid_size,
76903 + priv->essid, hex2str(priv->essid, IW_ESSID_MAX_SIZE),
76904 priv->iw_mode == IW_MODE_ADHOC ? "adhoc" : "infra",
76905 priv->channel, priv->wep_enabled ? "enabled" : "disabled",
76906 priv->wep_key_id, priv->wep_keys_len[priv->wep_key_id]);
76907 at76_dbg(DBG_PARAMS,
76908 "%s param: preamble %s rts %d retry %d frag %d "
76909 - "txrate %s auth_mode %d", priv->netdev->name,
76910 + "txrate %s auth_mode %d", wiphy_name(priv->hw->wiphy),
76911 preambles[priv->preamble_type], priv->rts_threshold,
76912 priv->short_retry_limit, priv->frag_threshold,
76913 priv->txrate == TX_RATE_1MBIT ? "1MBit" : priv->txrate ==
76914 @@ -3923,7 +1488,7 @@
76915 at76_dbg(DBG_PARAMS,
76916 "%s param: pm_mode %d pm_period %d auth_mode %s "
76917 "scan_times %d %d scan_mode %s",
76918 - priv->netdev->name, priv->pm_mode, priv->pm_period,
76919 + wiphy_name(priv->hw->wiphy), priv->pm_mode, priv->pm_period,
76920 priv->auth_mode == WLAN_AUTH_OPEN ? "open" : "shared_secret",
76921 priv->scan_min_time, priv->scan_max_time,
76922 priv->scan_mode == SCAN_TYPE_ACTIVE ? "active" : "passive");
76923 @@ -3957,7 +1522,8 @@
76924 ccfg->ssid_len = priv->essid_size;
76925
76926 ccfg->wep_default_key_id = priv->wep_key_id;
76927 - memcpy(ccfg->wep_default_key_value, priv->wep_keys, 4 * WEP_KEY_LEN);
76928 + memcpy(ccfg->wep_default_key_value, priv->wep_keys,
76929 + sizeof(priv->wep_keys));
76930
76931 ccfg->short_preamble = priv->preamble_type;
76932 ccfg->beacon_period = cpu_to_le16(priv->beacon_period);
76933 @@ -3966,7 +1532,7 @@
76934 sizeof(struct at76_card_config));
76935 if (ret < 0) {
76936 printk(KERN_ERR "%s: at76_set_card_command failed: %d\n",
76937 - priv->netdev->name, ret);
76938 + wiphy_name(priv->hw->wiphy), ret);
76939 return ret;
76940 }
76941
76942 @@ -4012,69 +1578,6 @@
76943 return 0;
76944 }
76945
76946 -/* Restart the interface */
76947 -static void at76_dwork_restart(struct work_struct *work)
76948 -{
76949 - struct at76_priv *priv = container_of(work, struct at76_priv,
76950 - dwork_restart.work);
76951 -
76952 - mutex_lock(&priv->mtx);
76953 -
76954 - netif_carrier_off(priv->netdev); /* stop netdev watchdog */
76955 - netif_stop_queue(priv->netdev); /* stop tx data packets */
76956 -
76957 - at76_startup_device(priv);
76958 -
76959 - if (priv->iw_mode != IW_MODE_MONITOR) {
76960 - priv->netdev->type = ARPHRD_ETHER;
76961 - at76_set_mac_state(priv, MAC_SCANNING);
76962 - schedule_work(&priv->work_start_scan);
76963 - } else {
76964 - priv->netdev->type = ARPHRD_IEEE80211_RADIOTAP;
76965 - at76_start_monitor(priv);
76966 - }
76967 -
76968 - mutex_unlock(&priv->mtx);
76969 -}
76970 -
76971 -/* Initiate scanning */
76972 -static void at76_work_start_scan(struct work_struct *work)
76973 -{
76974 - struct at76_priv *priv = container_of(work, struct at76_priv,
76975 - work_start_scan);
76976 - int ret;
76977 -
76978 - mutex_lock(&priv->mtx);
76979 -
76980 - WARN_ON(priv->mac_state != MAC_SCANNING);
76981 - if (priv->mac_state != MAC_SCANNING)
76982 - goto exit;
76983 -
76984 - /* only clear the bss list when a scan is actively initiated,
76985 - * otherwise simply rely on at76_bss_list_timeout */
76986 - if (priv->scan_state == SCAN_IN_PROGRESS) {
76987 - at76_free_bss_list(priv);
76988 - priv->scan_need_any = 1;
76989 - } else
76990 - priv->scan_need_any = 0;
76991 -
76992 - ret = at76_start_scan(priv, 1);
76993 -
76994 - if (ret < 0)
76995 - printk(KERN_ERR "%s: %s: start_scan failed with %d\n",
76996 - priv->netdev->name, __func__, ret);
76997 - else {
76998 - at76_dbg(DBG_MGMT_TIMER,
76999 - "%s:%d: starting mgmt_timer for %d ticks",
77000 - __func__, __LINE__, SCAN_POLL_INTERVAL);
77001 - schedule_delayed_work(&priv->dwork_get_scan,
77002 - SCAN_POLL_INTERVAL);
77003 - }
77004 -
77005 -exit:
77006 - mutex_unlock(&priv->mtx);
77007 -}
77008 -
77009 /* Enable or disable promiscuous mode */
77010 static void at76_work_set_promisc(struct work_struct *work)
77011 {
77012 @@ -4092,7 +1595,7 @@
77013 ret = at76_set_mib(priv, &priv->mib_buf);
77014 if (ret < 0)
77015 printk(KERN_ERR "%s: set_mib (promiscuous_mode) failed: %d\n",
77016 - priv->netdev->name, ret);
77017 + wiphy_name(priv->hw->wiphy), ret);
77018
77019 mutex_unlock(&priv->mtx);
77020 }
77021 @@ -4108,1088 +1611,759 @@
77022 mutex_unlock(&priv->mtx);
77023 }
77024
77025 -/* We got an association response */
77026 -static void at76_rx_mgmt_assoc(struct at76_priv *priv,
77027 - struct at76_rx_buffer *buf)
77028 -{
77029 - struct ieee80211_assoc_response *resp =
77030 - (struct ieee80211_assoc_response *)buf->packet;
77031 - u16 assoc_id = le16_to_cpu(resp->aid);
77032 - u16 status = le16_to_cpu(resp->status);
77033 -
77034 - at76_dbg(DBG_RX_MGMT, "%s: rx AssocResp bssid %s capa 0x%04x status "
77035 - "0x%04x assoc_id 0x%04x rates %s", priv->netdev->name,
77036 - mac2str(resp->header.addr3), le16_to_cpu(resp->capability),
77037 - status, assoc_id, hex2str(resp->info_element->data,
77038 - resp->info_element->len));
77039 -
77040 - if (priv->mac_state != MAC_ASSOC) {
77041 - printk(KERN_INFO "%s: AssocResp in state %s ignored\n",
77042 - priv->netdev->name, mac_states[priv->mac_state]);
77043 +static void at76_rx_tasklet(unsigned long param)
77044 +{
77045 + struct urb *urb = (struct urb *)param;
77046 + struct at76_priv *priv = urb->context;
77047 + struct at76_rx_buffer *buf;
77048 + struct ieee80211_rx_status rx_status = { 0 };
77049 +
77050 + if (priv->device_unplugged) {
77051 + at76_dbg(DBG_DEVSTART, "device unplugged");
77052 + if (urb)
77053 + at76_dbg(DBG_DEVSTART, "urb status %d", urb->status);
77054 return;
77055 }
77056
77057 - BUG_ON(!priv->curr_bss);
77058 + if (!priv->rx_skb || !priv->rx_skb->data)
77059 + return;
77060
77061 - cancel_delayed_work(&priv->dwork_assoc);
77062 - if (status == WLAN_STATUS_SUCCESS) {
77063 - struct bss_info *ptr = priv->curr_bss;
77064 - priv->assoc_id = assoc_id & 0x3fff;
77065 - /* update iwconfig params */
77066 - memcpy(priv->bssid, ptr->bssid, ETH_ALEN);
77067 - memcpy(priv->essid, ptr->ssid, ptr->ssid_len);
77068 - priv->essid_size = ptr->ssid_len;
77069 - priv->channel = ptr->channel;
77070 - schedule_work(&priv->work_assoc_done);
77071 - } else {
77072 - at76_set_mac_state(priv, MAC_JOINING);
77073 - schedule_work(&priv->work_join);
77074 + buf = (struct at76_rx_buffer *)priv->rx_skb->data;
77075 +
77076 + if (urb->status != 0) {
77077 + if (urb->status != -ENOENT && urb->status != -ECONNRESET)
77078 + at76_dbg(DBG_URB,
77079 + "%s %s: - nonzero Rx bulk status received: %d",
77080 + __func__, wiphy_name(priv->hw->wiphy),
77081 + urb->status);
77082 + return;
77083 }
77084 +
77085 + at76_dbg(DBG_RX_ATMEL_HDR,
77086 + "%s: rx frame: rate %d rssi %d noise %d link %d",
77087 + wiphy_name(priv->hw->wiphy), buf->rx_rate, buf->rssi,
77088 + buf->noise_level, buf->link_quality);
77089 +
77090 + skb_trim(priv->rx_skb, le16_to_cpu(buf->wlength) + AT76_RX_HDRLEN);
77091 + at76_dbg_dump(DBG_RX_DATA, &priv->rx_skb->data[AT76_RX_HDRLEN],
77092 + priv->rx_skb->len, "RX: len=%d",
77093 + (int)(priv->rx_skb->len - AT76_RX_HDRLEN));
77094 +
77095 + rx_status.signal = buf->rssi;
77096 + /* FIXME: is rate_idx still present in structure? */
77097 + rx_status.rate_idx = buf->rx_rate;
77098 + rx_status.flag |= RX_FLAG_DECRYPTED;
77099 + rx_status.flag |= RX_FLAG_IV_STRIPPED;
77100 +
77101 + skb_pull(priv->rx_skb, AT76_RX_HDRLEN);
77102 + at76_dbg(DBG_MAC80211, "calling ieee80211_rx_irqsafe(): %d/%d",
77103 + priv->rx_skb->len, priv->rx_skb->data_len);
77104 + ieee80211_rx_irqsafe(priv->hw, priv->rx_skb, &rx_status);
77105 +
77106 + /* Use a new skb for the next receive */
77107 + priv->rx_skb = NULL;
77108 +
77109 + at76_submit_rx_urb(priv);
77110 }
77111
77112 -/* Process disassociation request from the AP */
77113 -static void at76_rx_mgmt_disassoc(struct at76_priv *priv,
77114 - struct at76_rx_buffer *buf)
77115 +/* Load firmware into kernel memory and parse it */
77116 +static struct fwentry *at76_load_firmware(struct usb_device *udev,
77117 + enum board_type board_type)
77118 {
77119 - struct ieee80211_disassoc *resp =
77120 - (struct ieee80211_disassoc *)buf->packet;
77121 - struct ieee80211_hdr_3addr *mgmt = &resp->header;
77122 + int ret;
77123 + char *str;
77124 + struct at76_fw_header *fwh;
77125 + struct fwentry *fwe = &firmwares[board_type];
77126
77127 - at76_dbg(DBG_RX_MGMT,
77128 - "%s: rx DisAssoc bssid %s reason 0x%04x destination %s",
77129 - priv->netdev->name, mac2str(mgmt->addr3),
77130 - le16_to_cpu(resp->reason), mac2str(mgmt->addr1));
77131 + mutex_lock(&fw_mutex);
77132
77133 - /* We are not connected, ignore */
77134 - if (priv->mac_state == MAC_SCANNING || priv->mac_state == MAC_INIT
77135 - || !priv->curr_bss)
77136 - return;
77137 + if (fwe->loaded) {
77138 + at76_dbg(DBG_FW, "re-using previously loaded fw");
77139 + goto exit;
77140 + }
77141
77142 - /* Not our BSSID, ignore */
77143 - if (compare_ether_addr(mgmt->addr3, priv->curr_bss->bssid))
77144 - return;
77145 + at76_dbg(DBG_FW, "downloading firmware %s", fwe->fwname);
77146 + ret = request_firmware(&fwe->fw, fwe->fwname, &udev->dev);
77147 + if (ret < 0) {
77148 + dev_printk(KERN_ERR, &udev->dev, "firmware %s not found!\n",
77149 + fwe->fwname);
77150 + dev_printk(KERN_ERR, &udev->dev,
77151 + "you may need to download the firmware from "
77152 + "http://developer.berlios.de/projects/at76c503a/\n");
77153 + goto exit;
77154 + }
77155
77156 - /* Not for our STA and not broadcast, ignore */
77157 - if (compare_ether_addr(priv->netdev->dev_addr, mgmt->addr1)
77158 - && !is_broadcast_ether_addr(mgmt->addr1))
77159 - return;
77160 + at76_dbg(DBG_FW, "got it.");
77161 + fwh = (struct at76_fw_header *)(fwe->fw->data);
77162
77163 - if (priv->mac_state != MAC_ASSOC && priv->mac_state != MAC_CONNECTED
77164 - && priv->mac_state != MAC_JOINING) {
77165 - printk(KERN_INFO "%s: DisAssoc in state %s ignored\n",
77166 - priv->netdev->name, mac_states[priv->mac_state]);
77167 - return;
77168 + if (fwe->fw->size <= sizeof(*fwh)) {
77169 + dev_printk(KERN_ERR, &udev->dev,
77170 + "firmware is too short (0x%zx)\n", fwe->fw->size);
77171 + goto exit;
77172 }
77173
77174 - if (priv->mac_state == MAC_CONNECTED) {
77175 - netif_carrier_off(priv->netdev);
77176 - netif_stop_queue(priv->netdev);
77177 - at76_iwevent_bss_disconnect(priv->netdev);
77178 - }
77179 - cancel_delayed_work(&priv->dwork_get_scan);
77180 - cancel_delayed_work(&priv->dwork_beacon);
77181 - cancel_delayed_work(&priv->dwork_auth);
77182 - cancel_delayed_work(&priv->dwork_assoc);
77183 - at76_set_mac_state(priv, MAC_JOINING);
77184 - schedule_work(&priv->work_join);
77185 -}
77186 -
77187 -static void at76_rx_mgmt_auth(struct at76_priv *priv,
77188 - struct at76_rx_buffer *buf)
77189 -{
77190 - struct ieee80211_auth *resp = (struct ieee80211_auth *)buf->packet;
77191 - struct ieee80211_hdr_3addr *mgmt = &resp->header;
77192 - int seq_nr = le16_to_cpu(resp->transaction);
77193 - int alg = le16_to_cpu(resp->algorithm);
77194 - int status = le16_to_cpu(resp->status);
77195 -
77196 - at76_dbg(DBG_RX_MGMT,
77197 - "%s: rx AuthFrame bssid %s alg %d seq_nr %d status %d "
77198 - "destination %s", priv->netdev->name, mac2str(mgmt->addr3),
77199 - alg, seq_nr, status, mac2str(mgmt->addr1));
77200 -
77201 - if (alg == WLAN_AUTH_SHARED_KEY && seq_nr == 2)
77202 - at76_dbg(DBG_RX_MGMT, "%s: AuthFrame challenge %s ...",
77203 - priv->netdev->name, hex2str(resp->info_element, 18));
77204 -
77205 - if (priv->mac_state != MAC_AUTH) {
77206 - printk(KERN_INFO "%s: ignored AuthFrame in state %s\n",
77207 - priv->netdev->name, mac_states[priv->mac_state]);
77208 - return;
77209 - }
77210 - if (priv->auth_mode != alg) {
77211 - printk(KERN_INFO "%s: ignored AuthFrame for alg %d\n",
77212 - priv->netdev->name, alg);
77213 - return;
77214 + /* CRC currently not checked */
77215 + fwe->board_type = le32_to_cpu(fwh->board_type);
77216 + if (fwe->board_type != board_type) {
77217 + dev_printk(KERN_ERR, &udev->dev,
77218 + "board type mismatch, requested %u, got %u\n",
77219 + board_type, fwe->board_type);
77220 + goto exit;
77221 }
77222
77223 - BUG_ON(!priv->curr_bss);
77224 + fwe->fw_version.major = fwh->major;
77225 + fwe->fw_version.minor = fwh->minor;
77226 + fwe->fw_version.patch = fwh->patch;
77227 + fwe->fw_version.build = fwh->build;
77228
77229 - /* Not our BSSID or not for our STA, ignore */
77230 - if (compare_ether_addr(mgmt->addr3, priv->curr_bss->bssid)
77231 - || compare_ether_addr(priv->netdev->dev_addr, mgmt->addr1))
77232 - return;
77233 + str = (char *)fwh + le32_to_cpu(fwh->str_offset);
77234 + fwe->intfw = (u8 *)fwh + le32_to_cpu(fwh->int_fw_offset);
77235 + fwe->intfw_size = le32_to_cpu(fwh->int_fw_len);
77236 + fwe->extfw = (u8 *)fwh + le32_to_cpu(fwh->ext_fw_offset);
77237 + fwe->extfw_size = le32_to_cpu(fwh->ext_fw_len);
77238
77239 - cancel_delayed_work(&priv->dwork_auth);
77240 - if (status != WLAN_STATUS_SUCCESS) {
77241 - /* try to join next bss */
77242 - at76_set_mac_state(priv, MAC_JOINING);
77243 - schedule_work(&priv->work_join);
77244 - return;
77245 - }
77246 + fwe->loaded = 1;
77247
77248 - if (priv->auth_mode == WLAN_AUTH_OPEN || seq_nr == 4) {
77249 - priv->retries = ASSOC_RETRIES;
77250 - at76_set_mac_state(priv, MAC_ASSOC);
77251 - at76_assoc_req(priv, priv->curr_bss);
77252 - at76_dbg(DBG_MGMT_TIMER,
77253 - "%s:%d: starting mgmt_timer + HZ", __func__, __LINE__);
77254 - schedule_delayed_work(&priv->dwork_assoc, ASSOC_TIMEOUT);
77255 - return;
77256 - }
77257 + dev_printk(KERN_DEBUG, &udev->dev,
77258 + "using firmware %s (version %d.%d.%d-%d)\n",
77259 + fwe->fwname, fwh->major, fwh->minor, fwh->patch, fwh->build);
77260
77261 - WARN_ON(seq_nr != 2);
77262 - at76_auth_req(priv, priv->curr_bss, seq_nr + 1, resp->info_element);
77263 - at76_dbg(DBG_MGMT_TIMER, "%s:%d: starting mgmt_timer + HZ", __func__,
77264 - __LINE__);
77265 - schedule_delayed_work(&priv->dwork_auth, AUTH_TIMEOUT);
77266 -}
77267 -
77268 -static void at76_rx_mgmt_deauth(struct at76_priv *priv,
77269 - struct at76_rx_buffer *buf)
77270 -{
77271 - struct ieee80211_disassoc *resp =
77272 - (struct ieee80211_disassoc *)buf->packet;
77273 - struct ieee80211_hdr_3addr *mgmt = &resp->header;
77274 -
77275 - at76_dbg(DBG_RX_MGMT | DBG_PROGRESS,
77276 - "%s: rx DeAuth bssid %s reason 0x%04x destination %s",
77277 - priv->netdev->name, mac2str(mgmt->addr3),
77278 - le16_to_cpu(resp->reason), mac2str(mgmt->addr1));
77279 -
77280 - if (priv->mac_state != MAC_AUTH && priv->mac_state != MAC_ASSOC
77281 - && priv->mac_state != MAC_CONNECTED) {
77282 - printk(KERN_INFO "%s: DeAuth in state %s ignored\n",
77283 - priv->netdev->name, mac_states[priv->mac_state]);
77284 - return;
77285 - }
77286 + at76_dbg(DBG_DEVSTART, "board %u, int %d:%d, ext %d:%d", board_type,
77287 + le32_to_cpu(fwh->int_fw_offset), le32_to_cpu(fwh->int_fw_len),
77288 + le32_to_cpu(fwh->ext_fw_offset), le32_to_cpu(fwh->ext_fw_len));
77289 + at76_dbg(DBG_DEVSTART, "firmware id %s", str);
77290
77291 - BUG_ON(!priv->curr_bss);
77292 +exit:
77293 + mutex_unlock(&fw_mutex);
77294
77295 - /* Not our BSSID, ignore */
77296 - if (compare_ether_addr(mgmt->addr3, priv->curr_bss->bssid))
77297 - return;
77298 + if (fwe->loaded)
77299 + return fwe;
77300 + else
77301 + return NULL;
77302 +}
77303
77304 - /* Not for our STA and not broadcast, ignore */
77305 - if (compare_ether_addr(priv->netdev->dev_addr, mgmt->addr1)
77306 - && !is_broadcast_ether_addr(mgmt->addr1))
77307 - return;
77308 +static void at76_mac80211_tx_callback(struct urb *urb)
77309 +{
77310 + struct at76_priv *priv = urb->context;
77311 + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(priv->tx_skb);
77312
77313 - if (priv->mac_state == MAC_CONNECTED)
77314 - at76_iwevent_bss_disconnect(priv->netdev);
77315 + at76_dbg(DBG_MAC80211, "%s()", __func__);
77316
77317 - at76_set_mac_state(priv, MAC_JOINING);
77318 - schedule_work(&priv->work_join);
77319 - cancel_delayed_work(&priv->dwork_get_scan);
77320 - cancel_delayed_work(&priv->dwork_beacon);
77321 - cancel_delayed_work(&priv->dwork_auth);
77322 - cancel_delayed_work(&priv->dwork_assoc);
77323 -}
77324 -
77325 -static void at76_rx_mgmt_beacon(struct at76_priv *priv,
77326 - struct at76_rx_buffer *buf)
77327 -{
77328 - int varpar_len;
77329 - /* beacon content */
77330 - struct ieee80211_beacon *bdata = (struct ieee80211_beacon *)buf->packet;
77331 - struct ieee80211_hdr_3addr *mgmt = &bdata->header;
77332 -
77333 - struct list_head *lptr;
77334 - struct bss_info *match; /* entry matching addr3 with its bssid */
77335 - int new_entry = 0;
77336 - int len;
77337 - struct ieee80211_info_element *ie;
77338 - int have_ssid = 0;
77339 - int have_rates = 0;
77340 - int have_channel = 0;
77341 - int keep_going = 1;
77342 - unsigned long flags;
77343 -
77344 - spin_lock_irqsave(&priv->bss_list_spinlock, flags);
77345 - if (priv->mac_state == MAC_CONNECTED) {
77346 - /* in state MAC_CONNECTED we use the mgmt_timer to control
77347 - the beacon of the BSS */
77348 - BUG_ON(!priv->curr_bss);
77349 -
77350 - if (!compare_ether_addr(priv->curr_bss->bssid, mgmt->addr3)) {
77351 - /* We got our AP's beacon, defer the timeout handler.
77352 - Kill pending work first, as schedule_delayed_work()
77353 - won't do it. */
77354 - cancel_delayed_work(&priv->dwork_beacon);
77355 - schedule_delayed_work(&priv->dwork_beacon,
77356 - BEACON_TIMEOUT);
77357 - priv->curr_bss->rssi = buf->rssi;
77358 - priv->beacons_received++;
77359 - goto exit;
77360 - }
77361 + switch (urb->status) {
77362 + case 0:
77363 + /* success */
77364 + /* FIXME:
77365 + * is the frame really ACKed when tx_callback is called ? */
77366 + info->flags |= IEEE80211_TX_STAT_ACK;
77367 + break;
77368 + case -ENOENT:
77369 + case -ECONNRESET:
77370 + /* fail, urb has been unlinked */
77371 + /* FIXME: add error message */
77372 + break;
77373 + default:
77374 + at76_dbg(DBG_URB, "%s - nonzero tx status received: %d",
77375 + __func__, urb->status);
77376 + break;
77377 }
77378
77379 - /* look if we have this BSS already in the list */
77380 - match = NULL;
77381 + memset(&info->status, 0, sizeof(info->status));
77382
77383 - if (!list_empty(&priv->bss_list)) {
77384 - list_for_each(lptr, &priv->bss_list) {
77385 - struct bss_info *bss_ptr =
77386 - list_entry(lptr, struct bss_info, list);
77387 - if (!compare_ether_addr(bss_ptr->bssid, mgmt->addr3)) {
77388 - match = bss_ptr;
77389 - break;
77390 - }
77391 - }
77392 + ieee80211_tx_status_irqsafe(priv->hw, priv->tx_skb);
77393 +
77394 + priv->tx_skb = NULL;
77395 +
77396 + ieee80211_wake_queues(priv->hw);
77397 +}
77398 +
77399 +static int at76_mac80211_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
77400 +{
77401 + struct at76_priv *priv = hw->priv;
77402 + struct at76_tx_buffer *tx_buffer = priv->bulk_out_buffer;
77403 + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
77404 + int padding, submit_len, ret;
77405 +
77406 + at76_dbg(DBG_MAC80211, "%s()", __func__);
77407 +
77408 + if (priv->tx_urb->status == -EINPROGRESS) {
77409 + printk(KERN_ERR "%s: %s called while tx urb is pending\n",
77410 + wiphy_name(priv->hw->wiphy), __func__);
77411 + return NETDEV_TX_BUSY;
77412 }
77413
77414 - if (!match) {
77415 - /* BSS not in the list - append it */
77416 - match = kzalloc(sizeof(struct bss_info), GFP_ATOMIC);
77417 - if (!match) {
77418 - at76_dbg(DBG_BSS_TABLE,
77419 - "%s: cannot kmalloc new bss info (%zd byte)",
77420 - priv->netdev->name, sizeof(struct bss_info));
77421 - goto exit;
77422 - }
77423 - new_entry = 1;
77424 - list_add_tail(&match->list, &priv->bss_list);
77425 + ieee80211_stop_queues(hw);
77426 +
77427 + at76_ledtrig_tx_activity(); /* tell ledtrigger we send a packet */
77428 +
77429 + WARN_ON(priv->tx_skb != NULL);
77430 +
77431 + priv->tx_skb = skb;
77432 + padding = at76_calc_padding(skb->len);
77433 + submit_len = AT76_TX_HDRLEN + skb->len + padding;
77434 +
77435 + /* setup 'Atmel' header */
77436 + memset(tx_buffer, 0, sizeof(*tx_buffer));
77437 + tx_buffer->padding = padding;
77438 + tx_buffer->wlength = cpu_to_le16(skb->len);
77439 + tx_buffer->tx_rate = ieee80211_get_tx_rate(hw, info)->hw_value;
77440 + if (FIRMWARE_IS_WPA(priv->fw_version) && info->control.hw_key) {
77441 + tx_buffer->key_id = (info->control.hw_key->keyidx);
77442 + tx_buffer->cipher_type =
77443 + priv->keys[info->control.hw_key->keyidx].cipher;
77444 + tx_buffer->cipher_length =
77445 + priv->keys[info->control.hw_key->keyidx].keylen;
77446 + tx_buffer->reserved = 0;
77447 + } else {
77448 + tx_buffer->key_id = 0;
77449 + tx_buffer->cipher_type = 0;
77450 + tx_buffer->cipher_length = 0;
77451 + tx_buffer->reserved = 0;
77452 + };
77453 + /* memset(tx_buffer->reserved, 0, sizeof(tx_buffer->reserved)); */
77454 + memcpy(tx_buffer->packet, skb->data, skb->len);
77455 +
77456 + at76_dbg(DBG_TX_DATA, "%s tx: wlen 0x%x pad 0x%x rate %d hdr",
77457 + wiphy_name(priv->hw->wiphy), le16_to_cpu(tx_buffer->wlength),
77458 + tx_buffer->padding, tx_buffer->tx_rate);
77459 +
77460 + /* send stuff */
77461 + at76_dbg_dump(DBG_TX_DATA_CONTENT, tx_buffer, submit_len,
77462 + "%s(): tx_buffer %d bytes:", __func__, submit_len);
77463 + usb_fill_bulk_urb(priv->tx_urb, priv->udev, priv->tx_pipe, tx_buffer,
77464 + submit_len, at76_mac80211_tx_callback, priv);
77465 + ret = usb_submit_urb(priv->tx_urb, GFP_ATOMIC);
77466 + if (ret) {
77467 + printk(KERN_ERR "%s: error in tx submit urb: %d\n",
77468 + wiphy_name(priv->hw->wiphy), ret);
77469 + if (ret == -EINVAL)
77470 + printk(KERN_ERR
77471 + "%s: -EINVAL: tx urb %p hcpriv %p complete %p\n",
77472 + wiphy_name(priv->hw->wiphy), priv->tx_urb,
77473 + priv->tx_urb->hcpriv, priv->tx_urb->complete);
77474 }
77475
77476 - match->capa = le16_to_cpu(bdata->capability);
77477 - match->beacon_interval = le16_to_cpu(bdata->beacon_interval);
77478 - match->rssi = buf->rssi;
77479 - match->link_qual = buf->link_quality;
77480 - match->noise_level = buf->noise_level;
77481 - memcpy(match->bssid, mgmt->addr3, ETH_ALEN);
77482 - at76_dbg(DBG_RX_BEACON, "%s: bssid %s", priv->netdev->name,
77483 - mac2str(match->bssid));
77484 -
77485 - ie = bdata->info_element;
77486 -
77487 - /* length of var length beacon parameters */
77488 - varpar_len = min_t(int, le16_to_cpu(buf->wlength) -
77489 - sizeof(struct ieee80211_beacon),
77490 - BEACON_MAX_DATA_LENGTH);
77491 -
77492 - /* This routine steps through the bdata->data array to get
77493 - * some useful information about the access point.
77494 - * Currently, this implementation supports receipt of: SSID,
77495 - * supported transfer rates and channel, in any order, with some
77496 - * tolerance for intermittent unknown codes (although this
77497 - * functionality may not be necessary as the useful information will
77498 - * usually arrive in consecutively, but there have been some
77499 - * reports of some of the useful information fields arriving in a
77500 - * different order).
77501 - * It does not support any more IE types although MFIE_TYPE_TIM may
77502 - * be supported (on my AP at least).
77503 - * The bdata->data array is about 1500 bytes long but only ~36 of those
77504 - * bytes are useful, hence the have_ssid etc optimizations. */
77505 -
77506 - while (keep_going &&
77507 - ((&ie->data[ie->len] - (u8 *)bdata->info_element) <=
77508 - varpar_len)) {
77509 + return 0;
77510 +}
77511
77512 - switch (ie->id) {
77513 +static int at76_mac80211_start(struct ieee80211_hw *hw)
77514 +{
77515 + struct at76_priv *priv = hw->priv;
77516 + int ret;
77517
77518 - case MFIE_TYPE_SSID:
77519 - if (have_ssid)
77520 - break;
77521 + at76_dbg(DBG_MAC80211, "%s()", __func__);
77522
77523 - len = min_t(int, IW_ESSID_MAX_SIZE, ie->len);
77524 + mutex_lock(&priv->mtx);
77525
77526 - /* we copy only if this is a new entry,
77527 - or the incoming SSID is not a hidden SSID. This
77528 - will protect us from overwriting a real SSID read
77529 - in a ProbeResponse with a hidden one from a
77530 - following beacon. */
77531 - if (!new_entry && at76_is_hidden_ssid(ie->data, len)) {
77532 - have_ssid = 1;
77533 - break;
77534 - }
77535 + ret = at76_submit_rx_urb(priv);
77536 + if (ret < 0) {
77537 + printk(KERN_ERR "%s: open: submit_rx_urb failed: %d\n",
77538 + wiphy_name(priv->hw->wiphy), ret);
77539 + goto error;
77540 + }
77541
77542 - match->ssid_len = len;
77543 - memcpy(match->ssid, ie->data, len);
77544 - at76_dbg(DBG_RX_BEACON, "%s: SSID - %.*s",
77545 - priv->netdev->name, len, match->ssid);
77546 - have_ssid = 1;
77547 - break;
77548 + at76_startup_device(priv);
77549
77550 - case MFIE_TYPE_RATES:
77551 - if (have_rates)
77552 - break;
77553 + at76_start_monitor(priv);
77554
77555 - match->rates_len =
77556 - min_t(int, sizeof(match->rates), ie->len);
77557 - memcpy(match->rates, ie->data, match->rates_len);
77558 - have_rates = 1;
77559 - at76_dbg(DBG_RX_BEACON, "%s: SUPPORTED RATES %s",
77560 - priv->netdev->name,
77561 - hex2str(ie->data, ie->len));
77562 - break;
77563 +error:
77564 + mutex_unlock(&priv->mtx);
77565
77566 - case MFIE_TYPE_DS_SET:
77567 - if (have_channel)
77568 - break;
77569 + return 0;
77570 +}
77571
77572 - match->channel = ie->data[0];
77573 - have_channel = 1;
77574 - at76_dbg(DBG_RX_BEACON, "%s: CHANNEL - %d",
77575 - priv->netdev->name, match->channel);
77576 - break;
77577 +static void at76_mac80211_stop(struct ieee80211_hw *hw)
77578 +{
77579 + struct at76_priv *priv = hw->priv;
77580
77581 - case MFIE_TYPE_CF_SET:
77582 - case MFIE_TYPE_TIM:
77583 - case MFIE_TYPE_IBSS_SET:
77584 - default:
77585 - at76_dbg(DBG_RX_BEACON, "%s: beacon IE id %d len %d %s",
77586 - priv->netdev->name, ie->id, ie->len,
77587 - hex2str(ie->data, ie->len));
77588 - break;
77589 - }
77590 + at76_dbg(DBG_MAC80211, "%s()", __func__);
77591
77592 - /* advance to the next informational element */
77593 - next_ie(&ie);
77594 + mutex_lock(&priv->mtx);
77595 +
77596 + if (!priv->device_unplugged) {
77597 + /* We are called by "ifconfig ethX down", not because the
77598 + * device is not available anymore. */
77599 + if (at76_set_radio(priv, 0) == 1)
77600 + at76_wait_completion(priv, CMD_RADIO_ON);
77601 +
77602 + /* We unlink rx_urb because at76_open() re-submits it.
77603 + * If unplugged, at76_delete_device() takes care of it. */
77604 + usb_kill_urb(priv->rx_urb);
77605 + }
77606 +
77607 + mutex_unlock(&priv->mtx);
77608 +}
77609 +
77610 +static int at76_add_interface(struct ieee80211_hw *hw,
77611 + struct ieee80211_if_init_conf *conf)
77612 +{
77613 + struct at76_priv *priv = hw->priv;
77614 + int ret = 0;
77615
77616 - /* Optimization: after all, the bdata->data array is
77617 - * varpar_len bytes long, whereas we get all of the useful
77618 - * information after only ~36 bytes, this saves us a lot of
77619 - * time (and trouble as the remaining portion of the array
77620 - * could be full of junk)
77621 - * Comment this out if you want to see what other information
77622 - * comes from the AP - although little of it may be useful */
77623 - }
77624 + at76_dbg(DBG_MAC80211, "%s()", __func__);
77625
77626 - at76_dbg(DBG_RX_BEACON, "%s: Finished processing beacon data",
77627 - priv->netdev->name);
77628 + mutex_lock(&priv->mtx);
77629
77630 - match->last_rx = jiffies; /* record last rx of beacon */
77631 + switch (conf->type) {
77632 + case NL80211_IFTYPE_STATION:
77633 + priv->iw_mode = IW_MODE_INFRA;
77634 + break;
77635 + default:
77636 + ret = -EOPNOTSUPP;
77637 + goto exit;
77638 + }
77639
77640 exit:
77641 - spin_unlock_irqrestore(&priv->bss_list_spinlock, flags);
77642 + mutex_unlock(&priv->mtx);
77643 +
77644 + return ret;
77645 }
77646
77647 -/* Calculate the link level from a given rx_buffer */
77648 -static void at76_calc_level(struct at76_priv *priv, struct at76_rx_buffer *buf,
77649 - struct iw_quality *qual)
77650 +static void at76_remove_interface(struct ieee80211_hw *hw,
77651 + struct ieee80211_if_init_conf *conf)
77652 {
77653 - /* just a guess for now, might be different for other chips */
77654 - int max_rssi = 42;
77655 -
77656 - qual->level = (buf->rssi * 100 / max_rssi);
77657 - if (qual->level > 100)
77658 - qual->level = 100;
77659 - qual->updated |= IW_QUAL_LEVEL_UPDATED;
77660 + at76_dbg(DBG_MAC80211, "%s()", __func__);
77661 }
77662
77663 -/* Calculate the link quality from a given rx_buffer */
77664 -static void at76_calc_qual(struct at76_priv *priv, struct at76_rx_buffer *buf,
77665 - struct iw_quality *qual)
77666 +static int at76_join(struct at76_priv *priv)
77667 {
77668 - if (at76_is_intersil(priv->board_type))
77669 - qual->qual = buf->link_quality;
77670 - else {
77671 - unsigned long elapsed;
77672 + struct at76_req_join join;
77673 + int ret;
77674
77675 - /* Update qual at most once a second */
77676 - elapsed = jiffies - priv->beacons_last_qual;
77677 - if (elapsed < 1 * HZ)
77678 - return;
77679 + memset(&join, 0, sizeof(struct at76_req_join));
77680 + memcpy(join.essid, priv->essid, priv->essid_size);
77681 + join.essid_size = priv->essid_size;
77682 + memcpy(join.bssid, priv->bssid, ETH_ALEN);
77683 + join.bss_type = INFRASTRUCTURE_MODE;
77684 + join.channel = priv->channel;
77685 + join.timeout = cpu_to_le16(2000);
77686
77687 - qual->qual = qual->level * priv->beacons_received *
77688 - msecs_to_jiffies(priv->beacon_period) / elapsed;
77689 + at76_dbg(DBG_MAC80211, "%s: sending CMD_JOIN", __func__);
77690 + ret = at76_set_card_command(priv->udev, CMD_JOIN, &join,
77691 + sizeof(struct at76_req_join));
77692
77693 - priv->beacons_last_qual = jiffies;
77694 - priv->beacons_received = 0;
77695 + if (ret < 0) {
77696 + printk(KERN_ERR "%s: at76_set_card_command failed: %d\n",
77697 + wiphy_name(priv->hw->wiphy), ret);
77698 + return 0;
77699 }
77700 - qual->qual = (qual->qual > 100) ? 100 : qual->qual;
77701 - qual->updated |= IW_QUAL_QUAL_UPDATED;
77702 -}
77703
77704 -/* Calculate the noise quality from a given rx_buffer */
77705 -static void at76_calc_noise(struct at76_priv *priv, struct at76_rx_buffer *buf,
77706 - struct iw_quality *qual)
77707 -{
77708 - qual->noise = 0;
77709 - qual->updated |= IW_QUAL_NOISE_INVALID;
77710 -}
77711 + ret = at76_wait_completion(priv, CMD_JOIN);
77712 + at76_dbg(DBG_MAC80211, "%s: CMD_JOIN returned: 0x%02x", __func__, ret);
77713 + if (ret != CMD_STATUS_COMPLETE) {
77714 + printk(KERN_ERR "%s: at76_wait_completion failed: %d\n",
77715 + wiphy_name(priv->hw->wiphy), ret);
77716 + return 0;
77717 + }
77718
77719 -static void at76_update_wstats(struct at76_priv *priv,
77720 - struct at76_rx_buffer *buf)
77721 -{
77722 - struct iw_quality *qual = &priv->wstats.qual;
77723 + at76_set_tkip_bssid(priv, priv->bssid);
77724 + at76_set_pm_mode(priv);
77725
77726 - if (buf->rssi && priv->mac_state == MAC_CONNECTED) {
77727 - qual->updated = 0;
77728 - at76_calc_level(priv, buf, qual);
77729 - at76_calc_qual(priv, buf, qual);
77730 - at76_calc_noise(priv, buf, qual);
77731 - } else {
77732 - qual->qual = 0;
77733 - qual->level = 0;
77734 - qual->noise = 0;
77735 - qual->updated = IW_QUAL_ALL_INVALID;
77736 - }
77737 + return 0;
77738 }
77739
77740 -static void at76_rx_mgmt(struct at76_priv *priv, struct at76_rx_buffer *buf)
77741 -{
77742 - struct ieee80211_hdr_3addr *mgmt =
77743 - (struct ieee80211_hdr_3addr *)buf->packet;
77744 - u16 framectl = le16_to_cpu(mgmt->frame_ctl);
77745 -
77746 - /* update wstats */
77747 - if (priv->mac_state != MAC_INIT && priv->mac_state != MAC_SCANNING) {
77748 - /* jal: this is a dirty hack needed by Tim in ad-hoc mode */
77749 - /* Data packets always seem to have a 0 link level, so we
77750 - only read link quality info from management packets.
77751 - Atmel driver actually averages the present, and previous
77752 - values, we just present the raw value at the moment - TJS */
77753 - if (priv->iw_mode == IW_MODE_ADHOC
77754 - || (priv->curr_bss
77755 - && !compare_ether_addr(mgmt->addr3,
77756 - priv->curr_bss->bssid)))
77757 - at76_update_wstats(priv, buf);
77758 - }
77759 -
77760 - at76_dbg(DBG_RX_MGMT_CONTENT, "%s rx mgmt framectl 0x%x %s",
77761 - priv->netdev->name, framectl,
77762 - hex2str(mgmt, le16_to_cpu(buf->wlength)));
77763 -
77764 - switch (framectl & IEEE80211_FCTL_STYPE) {
77765 - case IEEE80211_STYPE_BEACON:
77766 - case IEEE80211_STYPE_PROBE_RESP:
77767 - at76_rx_mgmt_beacon(priv, buf);
77768 - break;
77769 +static void at76_dwork_hw_scan(struct work_struct *work)
77770 +{
77771 + struct at76_priv *priv = container_of(work, struct at76_priv,
77772 + dwork_hw_scan.work);
77773 + int ret;
77774
77775 - case IEEE80211_STYPE_ASSOC_RESP:
77776 - at76_rx_mgmt_assoc(priv, buf);
77777 - break;
77778 + ret = at76_get_cmd_status(priv->udev, CMD_SCAN);
77779 + at76_dbg(DBG_MAC80211, "%s: CMD_SCAN status 0x%02x", __func__, ret);
77780
77781 - case IEEE80211_STYPE_DISASSOC:
77782 - at76_rx_mgmt_disassoc(priv, buf);
77783 - break;
77784 + /* FIXME: add maximum time for scan to complete */
77785
77786 - case IEEE80211_STYPE_AUTH:
77787 - at76_rx_mgmt_auth(priv, buf);
77788 - break;
77789 + if (ret != CMD_STATUS_COMPLETE) {
77790 + queue_delayed_work(priv->hw->workqueue, &priv->dwork_hw_scan,
77791 + SCAN_POLL_INTERVAL);
77792 + goto exit;
77793 + }
77794
77795 - case IEEE80211_STYPE_DEAUTH:
77796 - at76_rx_mgmt_deauth(priv, buf);
77797 - break;
77798 + ieee80211_scan_completed(priv->hw);
77799
77800 - default:
77801 - printk(KERN_DEBUG "%s: ignoring frame with framectl 0x%04x\n",
77802 - priv->netdev->name, framectl);
77803 + if (is_valid_ether_addr(priv->bssid)) {
77804 + ieee80211_wake_queues(priv->hw);
77805 + at76_join(priv);
77806 }
77807
77808 + ieee80211_wake_queues(priv->hw);
77809 +
77810 +exit:
77811 return;
77812 }
77813
77814 -/* Convert the 802.11 header into an ethernet-style header, make skb
77815 - * ready for consumption by netif_rx() */
77816 -static void at76_ieee80211_to_eth(struct sk_buff *skb, int iw_mode)
77817 -{
77818 - struct ieee80211_hdr_3addr *i802_11_hdr;
77819 - struct ethhdr *eth_hdr_p;
77820 - u8 *src_addr;
77821 - u8 *dest_addr;
77822 -
77823 - i802_11_hdr = (struct ieee80211_hdr_3addr *)skb->data;
77824 -
77825 - /* That would be the ethernet header if the hardware converted
77826 - * the frame for us. Make sure the source and the destination
77827 - * match the 802.11 header. Which hardware does it? */
77828 - eth_hdr_p = (struct ethhdr *)skb_pull(skb, IEEE80211_3ADDR_LEN);
77829 -
77830 - dest_addr = i802_11_hdr->addr1;
77831 - if (iw_mode == IW_MODE_ADHOC)
77832 - src_addr = i802_11_hdr->addr2;
77833 - else
77834 - src_addr = i802_11_hdr->addr3;
77835 -
77836 - if (!compare_ether_addr(eth_hdr_p->h_source, src_addr) &&
77837 - !compare_ether_addr(eth_hdr_p->h_dest, dest_addr))
77838 - /* Yes, we already have an ethernet header */
77839 - skb_reset_mac_header(skb);
77840 - else {
77841 - u16 len;
77842 -
77843 - /* Need to build an ethernet header */
77844 - if (!memcmp(skb->data, snapsig, sizeof(snapsig))) {
77845 - /* SNAP frame - decapsulate, keep proto */
77846 - skb_push(skb, offsetof(struct ethhdr, h_proto) -
77847 - sizeof(rfc1042sig));
77848 - len = 0;
77849 - } else {
77850 - /* 802.3 frame, proto is length */
77851 - len = skb->len;
77852 - skb_push(skb, ETH_HLEN);
77853 - }
77854 -
77855 - skb_reset_mac_header(skb);
77856 - eth_hdr_p = eth_hdr(skb);
77857 - /* This needs to be done in this order (eth_hdr_p->h_dest may
77858 - * overlap src_addr) */
77859 - memcpy(eth_hdr_p->h_source, src_addr, ETH_ALEN);
77860 - memcpy(eth_hdr_p->h_dest, dest_addr, ETH_ALEN);
77861 - if (len)
77862 - eth_hdr_p->h_proto = htons(len);
77863 - }
77864 -
77865 - skb->protocol = eth_type_trans(skb, skb->dev);
77866 -}
77867 -
77868 -/* Check for fragmented data in priv->rx_skb. If the packet was no fragment
77869 - or it was the last of a fragment set a skb containing the whole packet
77870 - is returned for further processing. Otherwise we get NULL and are
77871 - done and the packet is either stored inside the fragment buffer
77872 - or thrown away. Every returned skb starts with the ieee802_11 header
77873 - and contains _no_ FCS at the end */
77874 -static struct sk_buff *at76_check_for_rx_frags(struct at76_priv *priv)
77875 +static int at76_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len)
77876 {
77877 - struct sk_buff *skb = priv->rx_skb;
77878 - struct at76_rx_buffer *buf = (struct at76_rx_buffer *)skb->data;
77879 - struct ieee80211_hdr_3addr *i802_11_hdr =
77880 - (struct ieee80211_hdr_3addr *)buf->packet;
77881 - /* seq_ctrl, fragment_number, sequence number of new packet */
77882 - u16 sctl = le16_to_cpu(i802_11_hdr->seq_ctl);
77883 - u16 fragnr = sctl & 0xf;
77884 - u16 seqnr = sctl >> 4;
77885 - u16 frame_ctl = le16_to_cpu(i802_11_hdr->frame_ctl);
77886 -
77887 - /* Length including the IEEE802.11 header, but without the trailing
77888 - * FCS and without the Atmel Rx header */
77889 - int length = le16_to_cpu(buf->wlength) - IEEE80211_FCS_LEN;
77890 -
77891 - /* where does the data payload start in skb->data ? */
77892 - u8 *data = i802_11_hdr->payload;
77893 -
77894 - /* length of payload, excl. the trailing FCS */
77895 - int data_len = length - IEEE80211_3ADDR_LEN;
77896 -
77897 - int i;
77898 - struct rx_data_buf *bptr, *optr;
77899 - unsigned long oldest = ~0UL;
77900 -
77901 - at76_dbg(DBG_RX_FRAGS,
77902 - "%s: rx data frame_ctl %04x addr2 %s seq/frag %d/%d "
77903 - "length %d data %d: %s ...", priv->netdev->name, frame_ctl,
77904 - mac2str(i802_11_hdr->addr2), seqnr, fragnr, length, data_len,
77905 - hex2str(data, 32));
77906 -
77907 - at76_dbg(DBG_RX_FRAGS_SKB, "%s: incoming skb: head %p data %p "
77908 - "tail %p end %p len %d", priv->netdev->name, skb->head,
77909 - skb->data, skb_tail_pointer(skb), skb_end_pointer(skb),
77910 - skb->len);
77911 -
77912 - if (data_len < 0) {
77913 - /* make sure data starts in the buffer */
77914 - printk(KERN_INFO "%s: data frame too short\n",
77915 - priv->netdev->name);
77916 - return NULL;
77917 - }
77918 -
77919 - WARN_ON(length <= AT76_RX_HDRLEN);
77920 - if (length <= AT76_RX_HDRLEN)
77921 - return NULL;
77922 + struct at76_priv *priv = hw->priv;
77923 + struct at76_req_scan scan;
77924 + int ret;
77925
77926 - /* remove the at76_rx_buffer header - we don't need it anymore */
77927 - /* we need the IEEE802.11 header (for the addresses) if this packet
77928 - is the first of a chain */
77929 - skb_pull(skb, AT76_RX_HDRLEN);
77930 -
77931 - /* remove FCS at end */
77932 - skb_trim(skb, length);
77933 -
77934 - at76_dbg(DBG_RX_FRAGS_SKB, "%s: trimmed skb: head %p data %p tail %p "
77935 - "end %p len %d data %p data_len %d", priv->netdev->name,
77936 - skb->head, skb->data, skb_tail_pointer(skb),
77937 - skb_end_pointer(skb), skb->len, data, data_len);
77938 -
77939 - if (fragnr == 0 && !(frame_ctl & IEEE80211_FCTL_MOREFRAGS)) {
77940 - /* unfragmented packet received */
77941 - /* Use a new skb for the next receive */
77942 - priv->rx_skb = NULL;
77943 - at76_dbg(DBG_RX_FRAGS, "%s: unfragmented", priv->netdev->name);
77944 - return skb;
77945 - }
77946 -
77947 - /* look if we've got a chain for the sender address.
77948 - afterwards optr points to first free or the oldest entry,
77949 - or, if i < NR_RX_DATA_BUF, bptr points to the entry for the
77950 - sender address */
77951 - /* determining the oldest entry doesn't cope with jiffies wrapping
77952 - but I don't care to delete a young entry at these rare moments ... */
77953 -
77954 - bptr = priv->rx_data;
77955 - optr = NULL;
77956 - for (i = 0; i < NR_RX_DATA_BUF; i++, bptr++) {
77957 - if (!bptr->skb) {
77958 - optr = bptr;
77959 - oldest = 0UL;
77960 - continue;
77961 - }
77962 + at76_dbg(DBG_MAC80211, "%s():", __func__);
77963 + at76_dbg_dump(DBG_MAC80211, ssid, len, "ssid %zd bytes:", len);
77964
77965 - if (!compare_ether_addr(i802_11_hdr->addr2, bptr->sender))
77966 - break;
77967 + mutex_lock(&priv->mtx);
77968
77969 - if (!optr) {
77970 - optr = bptr;
77971 - oldest = bptr->last_rx;
77972 - } else if (bptr->last_rx < oldest)
77973 - optr = bptr;
77974 - }
77975 -
77976 - if (i < NR_RX_DATA_BUF) {
77977 -
77978 - at76_dbg(DBG_RX_FRAGS, "%s: %d. cacheentry (seq/frag = %d/%d) "
77979 - "matched sender addr",
77980 - priv->netdev->name, i, bptr->seqnr, bptr->fragnr);
77981 -
77982 - /* bptr points to an entry for the sender address */
77983 - if (bptr->seqnr == seqnr) {
77984 - int left;
77985 - /* the fragment has the current sequence number */
77986 - if (((bptr->fragnr + 1) & 0xf) != fragnr) {
77987 - /* wrong fragment number -> ignore it */
77988 - /* is & 0xf necessary above ??? */
77989 - at76_dbg(DBG_RX_FRAGS,
77990 - "%s: frag nr mismatch: %d + 1 != %d",
77991 - priv->netdev->name, bptr->fragnr,
77992 - fragnr);
77993 - return NULL;
77994 - }
77995 - bptr->last_rx = jiffies;
77996 - /* the next following fragment number ->
77997 - add the data at the end */
77998 -
77999 - /* for test only ??? */
78000 - left = skb_tailroom(bptr->skb);
78001 - if (left < data_len)
78002 - printk(KERN_INFO
78003 - "%s: only %d byte free (need %d)\n",
78004 - priv->netdev->name, left, data_len);
78005 - else
78006 - memcpy(skb_put(bptr->skb, data_len), data,
78007 - data_len);
78008 -
78009 - bptr->fragnr = fragnr;
78010 - if (frame_ctl & IEEE80211_FCTL_MOREFRAGS)
78011 - return NULL;
78012 -
78013 - /* this was the last fragment - send it */
78014 - skb = bptr->skb;
78015 - bptr->skb = NULL; /* free the entry */
78016 - at76_dbg(DBG_RX_FRAGS, "%s: last frag of seq %d",
78017 - priv->netdev->name, seqnr);
78018 - return skb;
78019 - }
78020 + ieee80211_stop_queues(hw);
78021
78022 - /* got another sequence number */
78023 - if (fragnr == 0) {
78024 - /* it's the start of a new chain - replace the
78025 - old one by this */
78026 - /* bptr->sender has the correct value already */
78027 - at76_dbg(DBG_RX_FRAGS,
78028 - "%s: start of new seq %d, removing old seq %d",
78029 - priv->netdev->name, seqnr, bptr->seqnr);
78030 - bptr->seqnr = seqnr;
78031 - bptr->fragnr = 0;
78032 - bptr->last_rx = jiffies;
78033 - /* swap bptr->skb and priv->rx_skb */
78034 - skb = bptr->skb;
78035 - bptr->skb = priv->rx_skb;
78036 - priv->rx_skb = skb;
78037 - } else {
78038 - /* it from the middle of a new chain ->
78039 - delete the old entry and skip the new one */
78040 - at76_dbg(DBG_RX_FRAGS,
78041 - "%s: middle of new seq %d (%d) "
78042 - "removing old seq %d",
78043 - priv->netdev->name, seqnr, fragnr,
78044 - bptr->seqnr);
78045 - dev_kfree_skb(bptr->skb);
78046 - bptr->skb = NULL;
78047 - }
78048 - return NULL;
78049 + memset(&scan, 0, sizeof(struct at76_req_scan));
78050 + memset(scan.bssid, 0xFF, ETH_ALEN);
78051 + scan.scan_type = SCAN_TYPE_ACTIVE;
78052 + if (priv->essid_size > 0) {
78053 + memcpy(scan.essid, ssid, len);
78054 + scan.essid_size = len;
78055 }
78056 + scan.min_channel_time = cpu_to_le16(priv->scan_min_time);
78057 + scan.max_channel_time = cpu_to_le16(priv->scan_max_time);
78058 + scan.probe_delay = cpu_to_le16(priv->scan_min_time * 1000);
78059 + scan.international_scan = 0;
78060
78061 - /* if we didn't find a chain for the sender address, optr
78062 - points either to the first free or the oldest entry */
78063 + at76_dbg(DBG_MAC80211, "%s: sending CMD_SCAN", __func__);
78064 + ret = at76_set_card_command(priv->udev, CMD_SCAN, &scan, sizeof(scan));
78065
78066 - if (fragnr != 0) {
78067 - /* this is not the begin of a fragment chain ... */
78068 - at76_dbg(DBG_RX_FRAGS,
78069 - "%s: no chain for non-first fragment (%d)",
78070 - priv->netdev->name, fragnr);
78071 - return NULL;
78072 + if (ret < 0) {
78073 + err("CMD_SCAN failed: %d", ret);
78074 + goto exit;
78075 }
78076
78077 - BUG_ON(!optr);
78078 - if (optr->skb) {
78079 - /* swap the skb's */
78080 - skb = optr->skb;
78081 - optr->skb = priv->rx_skb;
78082 - priv->rx_skb = skb;
78083 -
78084 - at76_dbg(DBG_RX_FRAGS,
78085 - "%s: free old contents: sender %s seq/frag %d/%d",
78086 - priv->netdev->name, mac2str(optr->sender),
78087 - optr->seqnr, optr->fragnr);
78088 + queue_delayed_work(priv->hw->workqueue, &priv->dwork_hw_scan,
78089 + SCAN_POLL_INTERVAL);
78090
78091 - } else {
78092 - /* take the skb from priv->rx_skb */
78093 - optr->skb = priv->rx_skb;
78094 - /* let at76_submit_rx_urb() allocate a new skb */
78095 - priv->rx_skb = NULL;
78096 -
78097 - at76_dbg(DBG_RX_FRAGS, "%s: use a free entry",
78098 - priv->netdev->name);
78099 - }
78100 - memcpy(optr->sender, i802_11_hdr->addr2, ETH_ALEN);
78101 - optr->seqnr = seqnr;
78102 - optr->fragnr = 0;
78103 - optr->last_rx = jiffies;
78104 +exit:
78105 + mutex_unlock(&priv->mtx);
78106
78107 - return NULL;
78108 + return 0;
78109 }
78110
78111 -/* Rx interrupt: we expect the complete data buffer in priv->rx_skb */
78112 -static void at76_rx_data(struct at76_priv *priv)
78113 +static int at76_config(struct ieee80211_hw *hw, u32 changed)
78114 {
78115 - struct net_device *netdev = priv->netdev;
78116 - struct net_device_stats *stats = &priv->stats;
78117 - struct sk_buff *skb = priv->rx_skb;
78118 - struct at76_rx_buffer *buf = (struct at76_rx_buffer *)skb->data;
78119 - struct ieee80211_hdr_3addr *i802_11_hdr;
78120 - int length = le16_to_cpu(buf->wlength);
78121 -
78122 - at76_dbg(DBG_RX_DATA, "%s received data packet: %s", netdev->name,
78123 - hex2str(skb->data, AT76_RX_HDRLEN));
78124 + struct at76_priv *priv = hw->priv;
78125 + struct ieee80211_conf *conf = &hw->conf;
78126
78127 - at76_dbg(DBG_RX_DATA_CONTENT, "rx packet: %s",
78128 - hex2str(skb->data + AT76_RX_HDRLEN, length));
78129 + at76_dbg(DBG_MAC80211, "%s(): channel %d radio %d",
78130 + __func__, conf->channel->hw_value, conf->radio_enabled);
78131 + at76_dbg_dump(DBG_MAC80211, priv->essid, priv->essid_size, "ssid:");
78132 + at76_dbg_dump(DBG_MAC80211, priv->bssid, ETH_ALEN, "bssid:");
78133
78134 - skb = at76_check_for_rx_frags(priv);
78135 - if (!skb)
78136 - return;
78137 + mutex_lock(&priv->mtx);
78138
78139 - /* Atmel header and the FCS are already removed */
78140 - i802_11_hdr = (struct ieee80211_hdr_3addr *)skb->data;
78141 + priv->channel = conf->channel->hw_value;
78142
78143 - skb->dev = netdev;
78144 - skb->ip_summed = CHECKSUM_NONE; /* TODO: should check CRC */
78145 + if (is_valid_ether_addr(priv->bssid)) {
78146 + at76_join(priv);
78147 + ieee80211_wake_queues(priv->hw);
78148 + } else {
78149 + ieee80211_stop_queues(priv->hw);
78150 + at76_start_monitor(priv);
78151 + };
78152
78153 - if (is_broadcast_ether_addr(i802_11_hdr->addr1)) {
78154 - if (!compare_ether_addr(i802_11_hdr->addr1, netdev->broadcast))
78155 - skb->pkt_type = PACKET_BROADCAST;
78156 - else
78157 - skb->pkt_type = PACKET_MULTICAST;
78158 - } else if (compare_ether_addr(i802_11_hdr->addr1, netdev->dev_addr))
78159 - skb->pkt_type = PACKET_OTHERHOST;
78160 -
78161 - at76_ieee80211_to_eth(skb, priv->iw_mode);
78162 -
78163 - netdev->last_rx = jiffies;
78164 - netif_rx(skb);
78165 - stats->rx_packets++;
78166 - stats->rx_bytes += length;
78167 + mutex_unlock(&priv->mtx);
78168
78169 - return;
78170 + return 0;
78171 }
78172
78173 -static void at76_rx_monitor_mode(struct at76_priv *priv)
78174 +static int at76_config_interface(struct ieee80211_hw *hw,
78175 + struct ieee80211_vif *vif,
78176 + struct ieee80211_if_conf *conf)
78177 {
78178 - struct at76_rx_radiotap *rt;
78179 - u8 *payload;
78180 - int skblen;
78181 - struct net_device *netdev = priv->netdev;
78182 - struct at76_rx_buffer *buf =
78183 - (struct at76_rx_buffer *)priv->rx_skb->data;
78184 - /* length including the IEEE802.11 header and the trailing FCS,
78185 - but not at76_rx_buffer */
78186 - int length = le16_to_cpu(buf->wlength);
78187 - struct sk_buff *skb = priv->rx_skb;
78188 - struct net_device_stats *stats = &priv->stats;
78189 -
78190 - if (length < IEEE80211_FCS_LEN) {
78191 - /* buffer contains no data */
78192 - at76_dbg(DBG_MONITOR_MODE,
78193 - "%s: MONITOR MODE: rx skb without data",
78194 - priv->netdev->name);
78195 - return;
78196 - }
78197 -
78198 - skblen = sizeof(struct at76_rx_radiotap) + length;
78199 + struct at76_priv *priv = hw->priv;
78200
78201 - skb = dev_alloc_skb(skblen);
78202 - if (!skb) {
78203 - printk(KERN_ERR "%s: MONITOR MODE: dev_alloc_skb for radiotap "
78204 - "header returned NULL\n", priv->netdev->name);
78205 - return;
78206 - }
78207 + at76_dbg_dump(DBG_MAC80211, conf->bssid, ETH_ALEN, "bssid:");
78208
78209 - skb_put(skb, skblen);
78210 + mutex_lock(&priv->mtx);
78211
78212 - rt = (struct at76_rx_radiotap *)skb->data;
78213 - payload = skb->data + sizeof(struct at76_rx_radiotap);
78214 + memcpy(priv->bssid, conf->bssid, ETH_ALEN);
78215 +// memcpy(priv->essid, conf->ssid, conf->ssid_len);
78216 +// priv->essid_size = conf->ssid_len;
78217 +
78218 + if (is_valid_ether_addr(priv->bssid)) {
78219 + /* mac80211 is joining a bss */
78220 + ieee80211_wake_queues(priv->hw);
78221 + at76_join(priv);
78222 + } else
78223 + ieee80211_stop_queues(priv->hw);
78224
78225 - rt->rt_hdr.it_version = 0;
78226 - rt->rt_hdr.it_pad = 0;
78227 - rt->rt_hdr.it_len = cpu_to_le16(sizeof(struct at76_rx_radiotap));
78228 - rt->rt_hdr.it_present = cpu_to_le32(AT76_RX_RADIOTAP_PRESENT);
78229 -
78230 - rt->rt_tsft = cpu_to_le64(le32_to_cpu(buf->rx_time));
78231 - rt->rt_rate = hw_rates[buf->rx_rate] & (~0x80);
78232 - rt->rt_signal = buf->rssi;
78233 - rt->rt_noise = buf->noise_level;
78234 - rt->rt_flags = IEEE80211_RADIOTAP_F_FCS;
78235 - if (buf->fragmentation)
78236 - rt->rt_flags |= IEEE80211_RADIOTAP_F_FRAG;
78237 -
78238 - memcpy(payload, buf->packet, length);
78239 - skb->dev = netdev;
78240 - skb->ip_summed = CHECKSUM_NONE;
78241 - skb_reset_mac_header(skb);
78242 - skb->pkt_type = PACKET_OTHERHOST;
78243 - skb->protocol = htons(ETH_P_802_2);
78244 -
78245 - netdev->last_rx = jiffies;
78246 - netif_rx(skb);
78247 - stats->rx_packets++;
78248 - stats->rx_bytes += length;
78249 -}
78250 -
78251 -/* Check if we spy on the sender address in buf and update stats */
78252 -static void at76_iwspy_update(struct at76_priv *priv,
78253 - struct at76_rx_buffer *buf)
78254 -{
78255 - struct ieee80211_hdr_3addr *hdr =
78256 - (struct ieee80211_hdr_3addr *)buf->packet;
78257 - struct iw_quality qual;
78258 -
78259 - /* We can only set the level here */
78260 - qual.updated = IW_QUAL_QUAL_INVALID | IW_QUAL_NOISE_INVALID;
78261 - qual.level = 0;
78262 - qual.noise = 0;
78263 - at76_calc_level(priv, buf, &qual);
78264 + mutex_unlock(&priv->mtx);
78265
78266 - spin_lock_bh(&priv->spy_spinlock);
78267 + return 0;
78268 +}
78269
78270 - if (priv->spy_data.spy_number > 0)
78271 - wireless_spy_update(priv->netdev, hdr->addr2, &qual);
78272 +/* must be atomic */
78273 +static void at76_configure_filter(struct ieee80211_hw *hw,
78274 + unsigned int changed_flags,
78275 + unsigned int *total_flags, int mc_count,
78276 + struct dev_addr_list *mc_list)
78277 +{
78278 + struct at76_priv *priv = hw->priv;
78279 + int flags;
78280 +
78281 + at76_dbg(DBG_MAC80211, "%s(): changed_flags=0x%08x "
78282 + "total_flags=0x%08x mc_count=%d",
78283 + __func__, changed_flags, *total_flags, mc_count);
78284 +
78285 + flags = changed_flags & AT76_SUPPORTED_FILTERS;
78286 + *total_flags = AT76_SUPPORTED_FILTERS;
78287 +
78288 + /* FIXME: access to priv->promisc should be protected with
78289 + * priv->mtx, but it's impossible because this function needs to be
78290 + * atomic */
78291 +
78292 + if (flags && !priv->promisc) {
78293 + /* mac80211 wants us to enable promiscuous mode */
78294 + priv->promisc = 1;
78295 + } else if (!flags && priv->promisc) {
78296 + /* we need to disable promiscuous mode */
78297 + priv->promisc = 0;
78298 + } else
78299 + return;
78300
78301 - spin_unlock_bh(&priv->spy_spinlock);
78302 + queue_work(hw->workqueue, &priv->work_set_promisc);
78303 }
78304
78305 -static void at76_rx_tasklet(unsigned long param)
78306 +static int at76_set_key_oldfw(struct ieee80211_hw *hw, enum set_key_cmd cmd,
78307 + const u8 *local_address, const u8 *address,
78308 + struct ieee80211_key_conf *key)
78309 {
78310 - struct urb *urb = (struct urb *)param;
78311 - struct at76_priv *priv = urb->context;
78312 - struct net_device *netdev = priv->netdev;
78313 - struct at76_rx_buffer *buf;
78314 - struct ieee80211_hdr_3addr *i802_11_hdr;
78315 - u16 frame_ctl;
78316 -
78317 - if (priv->device_unplugged) {
78318 - at76_dbg(DBG_DEVSTART, "device unplugged");
78319 - if (urb)
78320 - at76_dbg(DBG_DEVSTART, "urb status %d", urb->status);
78321 - return;
78322 - }
78323 + struct at76_priv *priv = hw->priv;
78324
78325 - if (!priv->rx_skb || !netdev || !priv->rx_skb->data)
78326 - return;
78327 + int i;
78328
78329 - buf = (struct at76_rx_buffer *)priv->rx_skb->data;
78330 + at76_dbg(DBG_MAC80211, "%s(): cmd %d key->alg %d key->keyidx %d "
78331 + "key->keylen %d",
78332 + __func__, cmd, key->alg, key->keyidx, key->keylen);
78333
78334 - i802_11_hdr = (struct ieee80211_hdr_3addr *)buf->packet;
78335 + if (key->alg != ALG_WEP)
78336 + return -EOPNOTSUPP;
78337
78338 - frame_ctl = le16_to_cpu(i802_11_hdr->frame_ctl);
78339 + key->hw_key_idx = key->keyidx;
78340
78341 - if (urb->status != 0) {
78342 - if (urb->status != -ENOENT && urb->status != -ECONNRESET)
78343 - at76_dbg(DBG_URB,
78344 - "%s %s: - nonzero Rx bulk status received: %d",
78345 - __func__, netdev->name, urb->status);
78346 - return;
78347 - }
78348 + mutex_lock(&priv->mtx);
78349
78350 - at76_dbg(DBG_RX_ATMEL_HDR,
78351 - "%s: rx frame: rate %d rssi %d noise %d link %d %s",
78352 - priv->netdev->name, buf->rx_rate, buf->rssi, buf->noise_level,
78353 - buf->link_quality, hex2str(i802_11_hdr, 48));
78354 - if (priv->iw_mode == IW_MODE_MONITOR) {
78355 - at76_rx_monitor_mode(priv);
78356 - goto exit;
78357 - }
78358 + switch (cmd) {
78359 + case SET_KEY:
78360 + memcpy(priv->wep_keys[key->keyidx], key->key, key->keylen);
78361 + priv->wep_keys_len[key->keyidx] = key->keylen;
78362
78363 - /* there is a new bssid around, accept it: */
78364 - if (buf->newbss && priv->iw_mode == IW_MODE_ADHOC) {
78365 - at76_dbg(DBG_PROGRESS, "%s: rx newbss", netdev->name);
78366 - schedule_work(&priv->work_new_bss);
78367 - }
78368 + /* FIXME: find out how to do this properly */
78369 + priv->wep_key_id = key->keyidx;
78370
78371 - switch (frame_ctl & IEEE80211_FCTL_FTYPE) {
78372 - case IEEE80211_FTYPE_DATA:
78373 - at76_rx_data(priv);
78374 break;
78375 + case DISABLE_KEY:
78376 + default:
78377 + priv->wep_keys_len[key->keyidx] = 0;
78378 + break;
78379 + }
78380
78381 - case IEEE80211_FTYPE_MGMT:
78382 - /* jal: TODO: find out if we can update iwspy also on
78383 - other frames than management (might depend on the
78384 - radio chip / firmware version !) */
78385 + priv->wep_enabled = 0;
78386
78387 - at76_iwspy_update(priv, buf);
78388 + for (i = 0; i < WEP_KEYS; i++) {
78389 + if (priv->wep_keys_len[i] != 0)
78390 + priv->wep_enabled = 1;
78391 + }
78392
78393 - at76_rx_mgmt(priv, buf);
78394 - break;
78395 + at76_startup_device(priv);
78396
78397 - case IEEE80211_FTYPE_CTL:
78398 - at76_dbg(DBG_RX_CTRL, "%s: ignored ctrl frame: %04x",
78399 - priv->netdev->name, frame_ctl);
78400 - break;
78401 + mutex_unlock(&priv->mtx);
78402
78403 - default:
78404 - printk(KERN_DEBUG "%s: ignoring frame with framectl 0x%04x\n",
78405 - priv->netdev->name, frame_ctl);
78406 - }
78407 -exit:
78408 - at76_submit_rx_urb(priv);
78409 + return 0;
78410 }
78411
78412 -/* Load firmware into kernel memory and parse it */
78413 -static struct fwentry *at76_load_firmware(struct usb_device *udev,
78414 - enum board_type board_type)
78415 -{
78416 - int ret;
78417 - char *str;
78418 - struct at76_fw_header *fwh;
78419 - struct fwentry *fwe = &firmwares[board_type];
78420 +static int at76_set_key_newfw(struct ieee80211_hw *hw, enum set_key_cmd cmd,
78421 + const u8 *local_address, const u8 *address,
78422 + struct ieee80211_key_conf *key)
78423 +{
78424 + struct at76_priv *priv = hw->priv;
78425 + int ret = -EOPNOTSUPP;
78426 +
78427 + at76_dbg(DBG_MAC80211, "%s(): cmd %d key->alg %d key->keyidx %d "
78428 + "key->keylen %d",
78429 + __func__, cmd, key->alg, key->keyidx, key->keylen);
78430
78431 - mutex_lock(&fw_mutex);
78432 + mutex_lock(&priv->mtx);
78433
78434 - if (fwe->loaded) {
78435 - at76_dbg(DBG_FW, "re-using previously loaded fw");
78436 - goto exit;
78437 - }
78438 + priv->mib_buf.type = MIB_MAC_ENCRYPTION;
78439
78440 - at76_dbg(DBG_FW, "downloading firmware %s", fwe->fwname);
78441 - ret = request_firmware(&fwe->fw, fwe->fwname, &udev->dev);
78442 - if (ret < 0) {
78443 - dev_printk(KERN_ERR, &udev->dev, "firmware %s not found!\n",
78444 - fwe->fwname);
78445 - dev_printk(KERN_ERR, &udev->dev,
78446 - "you may need to download the firmware from "
78447 - "http://developer.berlios.de/projects/at76c503a/");
78448 + if (cmd == DISABLE_KEY) {
78449 + priv->mib_buf.size = CIPHER_KEY_LEN;
78450 + priv->mib_buf.index = offsetof(struct mib_mac_encryption,
78451 + cipher_default_keyvalue[key->keyidx]);
78452 + memset(priv->mib_buf.data.data, 0, CIPHER_KEY_LEN);
78453 + if (at76_set_mib(priv, &priv->mib_buf) != CMD_STATUS_COMPLETE)
78454 + ret = -EOPNOTSUPP; /* -EIO would be probably better */
78455 + else {
78456 +
78457 + priv->keys[key->keyidx].cipher = CIPHER_NONE;
78458 + priv->keys[key->keyidx].keylen = 0;
78459 + };
78460 + if (priv->default_group_key == key->keyidx)
78461 + priv->default_group_key = 0xff;
78462 +
78463 + if (priv->default_pairwise_key == key->keyidx)
78464 + priv->default_pairwise_key = 0xff;
78465 + /* If default pairwise key is removed, fall back to
78466 + * group key? */
78467 + ret = 0;
78468 goto exit;
78469 - }
78470 + };
78471
78472 - at76_dbg(DBG_FW, "got it.");
78473 - fwh = (struct at76_fw_header *)(fwe->fw->data);
78474 + if (cmd == SET_KEY) {
78475 + /* store key into MIB */
78476 + priv->mib_buf.size = CIPHER_KEY_LEN;
78477 + priv->mib_buf.index = offsetof(struct mib_mac_encryption,
78478 + cipher_default_keyvalue[key->keyidx]);
78479 + memset(priv->mib_buf.data.data, 0, CIPHER_KEY_LEN);
78480 + memcpy(priv->mib_buf.data.data, key->key, key->keylen);
78481 +
78482 + switch (key->alg) {
78483 + case ALG_WEP:
78484 + if (key->keylen == 5) {
78485 + priv->keys[key->keyidx].cipher =
78486 + CIPHER_WEP64;
78487 + priv->keys[key->keyidx].keylen = 8;
78488 + } else if (key->keylen == 13) {
78489 + priv->keys[key->keyidx].cipher =
78490 + CIPHER_WEP128;
78491 + /* Firmware needs this */
78492 + priv->keys[key->keyidx].keylen = 8;
78493 + } else {
78494 + ret = -EOPNOTSUPP;
78495 + goto exit;
78496 + };
78497 + break;
78498 + case ALG_TKIP:
78499 + key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC;
78500 + priv->keys[key->keyidx].cipher = CIPHER_TKIP;
78501 + priv->keys[key->keyidx].keylen = 12;
78502 + break;
78503
78504 - if (fwe->fw->size <= sizeof(*fwh)) {
78505 - dev_printk(KERN_ERR, &udev->dev,
78506 - "firmware is too short (0x%zx)\n", fwe->fw->size);
78507 - goto exit;
78508 - }
78509 + case ALG_CCMP:
78510 + if (!at76_is_505a(priv->board_type)) {
78511 + ret = -EOPNOTSUPP;
78512 + goto exit;
78513 + };
78514 + key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC;
78515 + priv->keys[key->keyidx].cipher = CIPHER_CCMP;
78516 + priv->keys[key->keyidx].keylen = 16;
78517 + break;
78518
78519 - /* CRC currently not checked */
78520 - fwe->board_type = le32_to_cpu(fwh->board_type);
78521 - if (fwe->board_type != board_type) {
78522 - dev_printk(KERN_ERR, &udev->dev,
78523 - "board type mismatch, requested %u, got %u\n",
78524 - board_type, fwe->board_type);
78525 - goto exit;
78526 - }
78527 + default:
78528 + ret = -EOPNOTSUPP;
78529 + goto exit;
78530 + };
78531
78532 - fwe->fw_version.major = fwh->major;
78533 - fwe->fw_version.minor = fwh->minor;
78534 - fwe->fw_version.patch = fwh->patch;
78535 - fwe->fw_version.build = fwh->build;
78536 + priv->mib_buf.data.data[38] = priv->keys[key->keyidx].cipher;
78537 + priv->mib_buf.data.data[39] = 1; /* Taken from atmelwlandriver,
78538 + not documented */
78539 +
78540 + if (is_valid_ether_addr(address))
78541 + /* Pairwise key */
78542 + priv->mib_buf.data.data[39] |= (KEY_PAIRWISE | KEY_TX);
78543 + else if (is_broadcast_ether_addr(address))
78544 + /* Group key */
78545 + priv->mib_buf.data.data[39] |= (KEY_TX);
78546 + else /* Key used only for transmission ??? */
78547 + priv->mib_buf.data.data[39] |= (KEY_TX);
78548 +
78549 + if (at76_set_mib(priv, &priv->mib_buf) !=
78550 + CMD_STATUS_COMPLETE) {
78551 + ret = -EOPNOTSUPP; /* -EIO would be probably better */
78552 + goto exit;
78553 + };
78554
78555 - str = (char *)fwh + le32_to_cpu(fwh->str_offset);
78556 - fwe->intfw = (u8 *)fwh + le32_to_cpu(fwh->int_fw_offset);
78557 - fwe->intfw_size = le32_to_cpu(fwh->int_fw_len);
78558 - fwe->extfw = (u8 *)fwh + le32_to_cpu(fwh->ext_fw_offset);
78559 - fwe->extfw_size = le32_to_cpu(fwh->ext_fw_len);
78560 + if ((key->alg == ALG_TKIP) || (key->alg == ALG_CCMP))
78561 + at76_reset_rsc(priv);
78562
78563 - fwe->loaded = 1;
78564 + key->hw_key_idx = key->keyidx;
78565
78566 - dev_printk(KERN_DEBUG, &udev->dev,
78567 - "using firmware %s (version %d.%d.%d-%d)\n",
78568 - fwe->fwname, fwh->major, fwh->minor, fwh->patch, fwh->build);
78569 + /* Set up default keys */
78570 + if (is_broadcast_ether_addr(address))
78571 + priv->default_group_key = key->keyidx;
78572 + if (is_valid_ether_addr(address))
78573 + priv->default_pairwise_key = key->keyidx;
78574 +
78575 + /* Set up encryption MIBs */
78576 +
78577 + /* first block of settings */
78578 + priv->mib_buf.size = 3;
78579 + priv->mib_buf.index = offsetof(struct mib_mac_encryption,
78580 + privacy_invoked);
78581 + priv->mib_buf.data.data[0] = 1; /* privacy_invoked */
78582 + priv->mib_buf.data.data[1] = priv->default_pairwise_key;
78583 + priv->mib_buf.data.data[2] = priv->default_group_key;
78584
78585 - at76_dbg(DBG_DEVSTART, "board %u, int %d:%d, ext %d:%d", board_type,
78586 - le32_to_cpu(fwh->int_fw_offset), le32_to_cpu(fwh->int_fw_len),
78587 - le32_to_cpu(fwh->ext_fw_offset), le32_to_cpu(fwh->ext_fw_len));
78588 - at76_dbg(DBG_DEVSTART, "firmware id %s", str);
78589 + ret = at76_set_mib(priv, &priv->mib_buf);
78590 + if (ret != CMD_STATUS_COMPLETE)
78591 + goto exit;
78592 +
78593 + /* second block of settings */
78594 + priv->mib_buf.size = 3;
78595 + priv->mib_buf.index = offsetof(struct mib_mac_encryption,
78596 + exclude_unencrypted);
78597 + priv->mib_buf.data.data[0] = 1; /* exclude_unencrypted */
78598 + priv->mib_buf.data.data[1] = 0; /* wep_encryption_type */
78599 + priv->mib_buf.data.data[2] = 0; /* ckip_key_permutation */
78600
78601 + ret = at76_set_mib(priv, &priv->mib_buf);
78602 + if (ret != CMD_STATUS_COMPLETE)
78603 + goto exit;
78604 + ret = 0;
78605 + };
78606 exit:
78607 - mutex_unlock(&fw_mutex);
78608 + at76_dump_mib_mac_encryption(priv);
78609 + mutex_unlock(&priv->mtx);
78610 + return ret;
78611 +}
78612
78613 - if (fwe->loaded)
78614 - return fwe;
78615 +static int at76_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
78616 + const u8 *local_address, const u8 *address,
78617 + struct ieee80211_key_conf *key)
78618 +{
78619 + struct at76_priv *priv = hw->priv;
78620 +
78621 + at76_dbg(DBG_MAC80211, "%s(): cmd %d key->alg %d key->keyidx %d "
78622 + "key->keylen %d",
78623 + __func__, cmd, key->alg, key->keyidx, key->keylen);
78624 +
78625 + if (FIRMWARE_IS_WPA(priv->fw_version))
78626 + return at76_set_key_newfw(hw, cmd, local_address, address, key);
78627 else
78628 - return NULL;
78629 + return at76_set_key_oldfw(hw, cmd, local_address, address, key);
78630 +
78631 }
78632
78633 +static const struct ieee80211_ops at76_ops = {
78634 + .tx = at76_mac80211_tx,
78635 + .add_interface = at76_add_interface,
78636 + .remove_interface = at76_remove_interface,
78637 + .config = at76_config,
78638 + .config_interface = at76_config_interface,
78639 + .configure_filter = at76_configure_filter,
78640 + .start = at76_mac80211_start,
78641 + .stop = at76_mac80211_stop,
78642 + .hw_scan = at76_hw_scan,
78643 + .set_key = at76_set_key,
78644 +};
78645 +
78646 /* Allocate network device and initialize private data */
78647 static struct at76_priv *at76_alloc_new_device(struct usb_device *udev)
78648 {
78649 - struct net_device *netdev;
78650 + struct ieee80211_hw *hw;
78651 struct at76_priv *priv;
78652 - int i;
78653
78654 - /* allocate memory for our device state and initialize it */
78655 - netdev = alloc_etherdev(sizeof(struct at76_priv));
78656 - if (!netdev) {
78657 - dev_printk(KERN_ERR, &udev->dev, "out of memory\n");
78658 + hw = ieee80211_alloc_hw(sizeof(struct at76_priv), &at76_ops);
78659 + if (!hw) {
78660 + printk(KERN_ERR DRIVER_NAME ": could not register"
78661 + " ieee80211_hw\n");
78662 return NULL;
78663 }
78664
78665 - priv = netdev_priv(netdev);
78666 + priv = hw->priv;
78667 + priv->hw = hw;
78668
78669 priv->udev = udev;
78670 - priv->netdev = netdev;
78671
78672 mutex_init(&priv->mtx);
78673 - INIT_WORK(&priv->work_assoc_done, at76_work_assoc_done);
78674 - INIT_WORK(&priv->work_join, at76_work_join);
78675 - INIT_WORK(&priv->work_new_bss, at76_work_new_bss);
78676 - INIT_WORK(&priv->work_start_scan, at76_work_start_scan);
78677 INIT_WORK(&priv->work_set_promisc, at76_work_set_promisc);
78678 INIT_WORK(&priv->work_submit_rx, at76_work_submit_rx);
78679 - INIT_DELAYED_WORK(&priv->dwork_restart, at76_dwork_restart);
78680 - INIT_DELAYED_WORK(&priv->dwork_get_scan, at76_dwork_get_scan);
78681 - INIT_DELAYED_WORK(&priv->dwork_beacon, at76_dwork_beacon);
78682 - INIT_DELAYED_WORK(&priv->dwork_auth, at76_dwork_auth);
78683 - INIT_DELAYED_WORK(&priv->dwork_assoc, at76_dwork_assoc);
78684 -
78685 - spin_lock_init(&priv->mgmt_spinlock);
78686 - priv->next_mgmt_bulk = NULL;
78687 - priv->mac_state = MAC_INIT;
78688 -
78689 - /* initialize empty BSS list */
78690 - priv->curr_bss = NULL;
78691 - INIT_LIST_HEAD(&priv->bss_list);
78692 - spin_lock_init(&priv->bss_list_spinlock);
78693 -
78694 - init_timer(&priv->bss_list_timer);
78695 - priv->bss_list_timer.data = (unsigned long)priv;
78696 - priv->bss_list_timer.function = at76_bss_list_timeout;
78697 -
78698 - spin_lock_init(&priv->spy_spinlock);
78699 -
78700 - /* mark all rx data entries as unused */
78701 - for (i = 0; i < NR_RX_DATA_BUF; i++)
78702 - priv->rx_data[i].skb = NULL;
78703 + INIT_DELAYED_WORK(&priv->dwork_hw_scan, at76_dwork_hw_scan);
78704
78705 priv->rx_tasklet.func = at76_rx_tasklet;
78706 priv->rx_tasklet.data = 0;
78707 @@ -5197,6 +2371,9 @@
78708 priv->pm_mode = AT76_PM_OFF;
78709 priv->pm_period = 0;
78710
78711 + /* unit us */
78712 + priv->hw->channel_change_time = 100000;
78713 +
78714 return priv;
78715 }
78716
78717 @@ -5259,11 +2436,42 @@
78718 return 0;
78719 }
78720
78721 +static struct ieee80211_rate at76_rates[] = {
78722 + { .bitrate = 10, .hw_value = TX_RATE_1MBIT, },
78723 + { .bitrate = 20, .hw_value = TX_RATE_2MBIT, },
78724 + { .bitrate = 55, .hw_value = TX_RATE_5_5MBIT, },
78725 + { .bitrate = 110, .hw_value = TX_RATE_11MBIT, },
78726 +};
78727 +
78728 +static struct ieee80211_channel at76_channels[] = {
78729 + { .center_freq = 2412, .hw_value = 1 },
78730 + { .center_freq = 2417, .hw_value = 2 },
78731 + { .center_freq = 2422, .hw_value = 3 },
78732 + { .center_freq = 2427, .hw_value = 4 },
78733 + { .center_freq = 2432, .hw_value = 5 },
78734 + { .center_freq = 2437, .hw_value = 6 },
78735 + { .center_freq = 2442, .hw_value = 7 },
78736 + { .center_freq = 2447, .hw_value = 8 },
78737 + { .center_freq = 2452, .hw_value = 9 },
78738 + { .center_freq = 2457, .hw_value = 10 },
78739 + { .center_freq = 2462, .hw_value = 11 },
78740 + { .center_freq = 2467, .hw_value = 12 },
78741 + { .center_freq = 2472, .hw_value = 13 },
78742 + { .center_freq = 2484, .hw_value = 14 }
78743 +};
78744 +
78745 +static struct ieee80211_supported_band at76_supported_band = {
78746 + .channels = at76_channels,
78747 + .n_channels = ARRAY_SIZE(at76_channels),
78748 + .bitrates = at76_rates,
78749 + .n_bitrates = ARRAY_SIZE(at76_rates),
78750 +};
78751 +
78752 /* Register network device and initialize the hardware */
78753 static int at76_init_new_device(struct at76_priv *priv,
78754 struct usb_interface *interface)
78755 {
78756 - struct net_device *netdev = priv->netdev;
78757 + struct device *dev = &interface->dev;
78758 int ret;
78759
78760 /* set up the endpoint information */
78761 @@ -5279,14 +2487,11 @@
78762 /* MAC address */
78763 ret = at76_get_hw_config(priv);
78764 if (ret < 0) {
78765 - dev_printk(KERN_ERR, &interface->dev,
78766 - "cannot get MAC address\n");
78767 + dev_err(dev, "cannot get MAC address\n");
78768 goto exit;
78769 }
78770
78771 priv->domain = at76_get_reg_domain(priv->regulatory_domain);
78772 - /* init. netdev->dev_addr */
78773 - memcpy(netdev->dev_addr, priv->mac_addr, ETH_ALEN);
78774
78775 priv->channel = DEF_CHANNEL;
78776 priv->iw_mode = IW_MODE_INFRA;
78777 @@ -5296,47 +2501,54 @@
78778 priv->txrate = TX_RATE_AUTO;
78779 priv->preamble_type = PREAMBLE_TYPE_LONG;
78780 priv->beacon_period = 100;
78781 - priv->beacons_last_qual = jiffies;
78782 priv->auth_mode = WLAN_AUTH_OPEN;
78783 priv->scan_min_time = DEF_SCAN_MIN_TIME;
78784 priv->scan_max_time = DEF_SCAN_MAX_TIME;
78785 priv->scan_mode = SCAN_TYPE_ACTIVE;
78786 + priv->default_pairwise_key = 0xff;
78787 + priv->default_group_key = 0xff;
78788 +
78789 + /* mac80211 initialisation */
78790 + priv->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &at76_supported_band;
78791 +
78792 + if (FIRMWARE_IS_WPA(priv->fw_version) &&
78793 + (at76_is_503rfmd(priv->board_type) ||
78794 + at76_is_505(priv->board_type)))
78795 + priv->hw->flags = IEEE80211_HW_SIGNAL_UNSPEC;
78796 + else
78797 + priv->hw->flags = IEEE80211_HW_RX_INCLUDES_FCS |
78798 + IEEE80211_HW_SIGNAL_UNSPEC;
78799
78800 - netdev->flags &= ~IFF_MULTICAST; /* not yet or never */
78801 - netdev->open = at76_open;
78802 - netdev->stop = at76_stop;
78803 - netdev->get_stats = at76_get_stats;
78804 - netdev->ethtool_ops = &at76_ethtool_ops;
78805 -
78806 - /* Add pointers to enable iwspy support. */
78807 - priv->wireless_data.spy_data = &priv->spy_data;
78808 - netdev->wireless_data = &priv->wireless_data;
78809 -
78810 - netdev->hard_start_xmit = at76_tx;
78811 - netdev->tx_timeout = at76_tx_timeout;
78812 - netdev->watchdog_timeo = 2 * HZ;
78813 - netdev->wireless_handlers = &at76_handler_def;
78814 - netdev->set_multicast_list = at76_set_multicast;
78815 - netdev->set_mac_address = at76_set_mac_address;
78816 - dev_alloc_name(netdev, "wlan%d");
78817 + priv->hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION);
78818
78819 - ret = register_netdev(priv->netdev);
78820 + SET_IEEE80211_DEV(priv->hw, &interface->dev);
78821 + SET_IEEE80211_PERM_ADDR(priv->hw, priv->mac_addr);
78822 +
78823 + ret = ieee80211_register_hw(priv->hw);
78824 if (ret) {
78825 - dev_printk(KERN_ERR, &interface->dev,
78826 - "cannot register netdevice (status %d)!\n", ret);
78827 + dev_err(dev, "cannot register mac80211 hw (status %d)!\n", ret);
78828 goto exit;
78829 }
78830 - priv->netdev_registered = 1;
78831
78832 - printk(KERN_INFO "%s: USB %s, MAC %s, firmware %d.%d.%d-%d\n",
78833 - netdev->name, dev_name(&interface->dev), mac2str(priv->mac_addr),
78834 - priv->fw_version.major, priv->fw_version.minor,
78835 - priv->fw_version.patch, priv->fw_version.build);
78836 - printk(KERN_INFO "%s: regulatory domain 0x%02x: %s\n", netdev->name,
78837 - priv->regulatory_domain, priv->domain->name);
78838 + priv->mac80211_registered = 1;
78839
78840 - /* we let this timer run the whole time this driver instance lives */
78841 - mod_timer(&priv->bss_list_timer, jiffies + BSS_LIST_TIMEOUT);
78842 + dev_info(dev, "%s: USB %s, MAC %s, firmware %d.%d.%d-%d\n",
78843 + wiphy_name(priv->hw->wiphy),
78844 + dev_name(&interface->dev), mac2str(priv->mac_addr),
78845 + priv->fw_version.major, priv->fw_version.minor,
78846 + priv->fw_version.patch, priv->fw_version.build);
78847 + dev_info(dev, "%s: regulatory domain 0x%02x: %s\n",
78848 + wiphy_name(priv->hw->wiphy),
78849 + priv->regulatory_domain, priv->domain->name);
78850 + dev_info(dev, "%s: WPA support: ", wiphy_name(priv->hw->wiphy));
78851 + if (!FIRMWARE_IS_WPA(priv->fw_version))
78852 + printk("none\n");
78853 + else {
78854 + if (!at76_is_505a(priv->board_type))
78855 + printk("TKIP\n");
78856 + else
78857 + printk("TKIP, AES/CCMP\n");
78858 + };
78859
78860 exit:
78861 return ret;
78862 @@ -5344,15 +2556,13 @@
78863
78864 static void at76_delete_device(struct at76_priv *priv)
78865 {
78866 - int i;
78867 -
78868 at76_dbg(DBG_PROC_ENTRY, "%s: ENTER", __func__);
78869
78870 /* The device is gone, don't bother turning it off */
78871 priv->device_unplugged = 1;
78872
78873 - if (priv->netdev_registered)
78874 - unregister_netdev(priv->netdev);
78875 + if (priv->mac80211_registered)
78876 + ieee80211_unregister_hw(priv->hw);
78877
78878 /* assuming we used keventd, it must quiesce too */
78879 flush_scheduled_work();
78880 @@ -5373,25 +2583,11 @@
78881 if (priv->rx_skb)
78882 kfree_skb(priv->rx_skb);
78883
78884 - at76_free_bss_list(priv);
78885 - del_timer_sync(&priv->bss_list_timer);
78886 - cancel_delayed_work(&priv->dwork_get_scan);
78887 - cancel_delayed_work(&priv->dwork_beacon);
78888 - cancel_delayed_work(&priv->dwork_auth);
78889 - cancel_delayed_work(&priv->dwork_assoc);
78890 -
78891 - if (priv->mac_state == MAC_CONNECTED)
78892 - at76_iwevent_bss_disconnect(priv->netdev);
78893 -
78894 - for (i = 0; i < NR_RX_DATA_BUF; i++)
78895 - if (priv->rx_data[i].skb) {
78896 - dev_kfree_skb(priv->rx_data[i].skb);
78897 - priv->rx_data[i].skb = NULL;
78898 - }
78899 usb_put_dev(priv->udev);
78900
78901 - at76_dbg(DBG_PROC_ENTRY, "%s: before freeing priv/netdev", __func__);
78902 - free_netdev(priv->netdev); /* priv is in netdev */
78903 + at76_dbg(DBG_PROC_ENTRY, "%s: before freeing priv/ieee80211_hw",
78904 + __func__);
78905 + ieee80211_free_hw(priv->hw);
78906
78907 at76_dbg(DBG_PROC_ENTRY, "%s: EXIT", __func__);
78908 }
78909 @@ -5425,8 +2621,8 @@
78910 we get 204 with 2.4.23, Fiberline FL-WL240u (505A+RFMD2958) ??? */
78911
78912 if (op_mode == OPMODE_HW_CONFIG_MODE) {
78913 - dev_printk(KERN_ERR, &interface->dev,
78914 - "cannot handle a device in HW_CONFIG_MODE\n");
78915 + dev_err(&interface->dev,
78916 + "cannot handle a device in HW_CONFIG_MODE\n");
78917 ret = -EBUSY;
78918 goto error;
78919 }
78920 @@ -5434,13 +2630,12 @@
78921 if (op_mode != OPMODE_NORMAL_NIC_WITH_FLASH
78922 && op_mode != OPMODE_NORMAL_NIC_WITHOUT_FLASH) {
78923 /* download internal firmware part */
78924 - dev_printk(KERN_DEBUG, &interface->dev,
78925 - "downloading internal firmware\n");
78926 + dev_dbg(&interface->dev, "downloading internal firmware\n");
78927 ret = at76_load_internal_fw(udev, fwe);
78928 if (ret < 0) {
78929 - dev_printk(KERN_ERR, &interface->dev,
78930 - "error %d downloading internal firmware\n",
78931 - ret);
78932 + dev_err(&interface->dev,
78933 + "error %d downloading internal firmware\n",
78934 + ret);
78935 goto error;
78936 }
78937 usb_put_dev(udev);
78938 @@ -5465,8 +2660,7 @@
78939 need_ext_fw = 1;
78940
78941 if (need_ext_fw) {
78942 - dev_printk(KERN_DEBUG, &interface->dev,
78943 - "downloading external firmware\n");
78944 + dev_dbg(&interface->dev, "downloading external firmware\n");
78945
78946 ret = at76_load_external_fw(udev, fwe);
78947 if (ret)
78948 @@ -5475,8 +2669,8 @@
78949 /* Re-check firmware version */
78950 ret = at76_get_mib(udev, MIB_FW_VERSION, &fwv, sizeof(fwv));
78951 if (ret < 0) {
78952 - dev_printk(KERN_ERR, &interface->dev,
78953 - "error %d getting firmware version\n", ret);
78954 + dev_err(&interface->dev,
78955 + "error %d getting firmware version\n", ret);
78956 goto error;
78957 }
78958 }
78959 @@ -5487,7 +2681,6 @@
78960 goto error;
78961 }
78962
78963 - SET_NETDEV_DEV(priv->netdev, &interface->dev);
78964 usb_set_intfdata(interface, priv);
78965
78966 memcpy(&priv->fw_version, &fwv, sizeof(struct mib_fw_version));
78967 @@ -5515,7 +2708,7 @@
78968 if (!priv)
78969 return;
78970
78971 - printk(KERN_INFO "%s: disconnecting\n", priv->netdev->name);
78972 + printk(KERN_INFO "%s: disconnecting\n", wiphy_name(priv->hw->wiphy));
78973 at76_delete_device(priv);
78974 dev_printk(KERN_INFO, &interface->dev, "disconnected\n");
78975 }
78976 @@ -5571,5 +2764,8 @@
78977 MODULE_AUTHOR("Nick Jones");
78978 MODULE_AUTHOR("Balint Seeber <n0_5p4m_p13453@hotmail.com>");
78979 MODULE_AUTHOR("Pavel Roskin <proski@gnu.org>");
78980 +MODULE_AUTHOR("Guido Guenther <agx@sigxcpu.org>");
78981 +MODULE_AUTHOR("Kalle Valo <kalle.valo@iki.fi>");
78982 +MODULE_AUTHOR("Milan Plzik <milan.plzik@gmail.com>");
78983 MODULE_DESCRIPTION(DRIVER_DESC);
78984 MODULE_LICENSE("GPL");
78985 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/at76_usb/at76_usb.h linux-2.6.29-rc3.owrt/drivers/staging/at76_usb/at76_usb.h
78986 --- linux-2.6.29.owrt/drivers/staging/at76_usb/at76_usb.h 2009-05-10 22:04:38.000000000 +0200
78987 +++ linux-2.6.29-rc3.owrt/drivers/staging/at76_usb/at76_usb.h 2009-05-10 23:48:29.000000000 +0200
78988 @@ -34,23 +34,6 @@
78989 BOARD_505AMX = 8
78990 };
78991
78992 -/* our private ioctl's */
78993 -/* preamble length (0 - long, 1 - short, 2 - auto) */
78994 -#define AT76_SET_SHORT_PREAMBLE (SIOCIWFIRSTPRIV + 0)
78995 -#define AT76_GET_SHORT_PREAMBLE (SIOCIWFIRSTPRIV + 1)
78996 -/* which debug channels are enabled */
78997 -#define AT76_SET_DEBUG (SIOCIWFIRSTPRIV + 2)
78998 -#define AT76_GET_DEBUG (SIOCIWFIRSTPRIV + 3)
78999 -/* power save mode (incl. the Atmel proprietary smart save mode) */
79000 -#define AT76_SET_POWERSAVE_MODE (SIOCIWFIRSTPRIV + 4)
79001 -#define AT76_GET_POWERSAVE_MODE (SIOCIWFIRSTPRIV + 5)
79002 -/* min and max channel times for scan */
79003 -#define AT76_SET_SCAN_TIMES (SIOCIWFIRSTPRIV + 6)
79004 -#define AT76_GET_SCAN_TIMES (SIOCIWFIRSTPRIV + 7)
79005 -/* scan mode (0 - active, 1 - passive) */
79006 -#define AT76_SET_SCAN_MODE (SIOCIWFIRSTPRIV + 8)
79007 -#define AT76_GET_SCAN_MODE (SIOCIWFIRSTPRIV + 9)
79008 -
79009 #define CMD_STATUS_IDLE 0x00
79010 #define CMD_STATUS_COMPLETE 0x01
79011 #define CMD_STATUS_UNKNOWN 0x02
79012 @@ -82,6 +65,7 @@
79013 #define MIB_MAC 0x03
79014 #define MIB_MAC_MGMT 0x05
79015 #define MIB_MAC_WEP 0x06
79016 +#define MIB_MAC_ENCRYPTION 0x06
79017 #define MIB_PHY 0x07
79018 #define MIB_FW_VERSION 0x08
79019 #define MIB_MDOMAIN 0x09
79020 @@ -106,6 +90,26 @@
79021 #define AT76_PM_ON 2
79022 #define AT76_PM_SMART 3
79023
79024 +/* cipher values for encryption keys */
79025 +#define CIPHER_NONE 0 /* this value is only guessed */
79026 +#define CIPHER_WEP64 1
79027 +#define CIPHER_TKIP 2
79028 +#define CIPHER_CCMP 3
79029 +#define CIPHER_CCX 4 /* for consistency sake only */
79030 +#define CIPHER_WEP128 5
79031 +
79032 +/* bit flags key types for encryption keys */
79033 +#define KEY_PAIRWISE 2
79034 +#define KEY_TX 4
79035 +
79036 +#define CIPHER_KEYS (4)
79037 +#define CIPHER_KEY_LEN (40)
79038 +
79039 +struct key_config {
79040 + u8 cipher;
79041 + u8 keylen;
79042 +};
79043 +
79044 struct hwcfg_r505 {
79045 u8 cr39_values[14];
79046 u8 reserved1[14];
79047 @@ -147,6 +151,9 @@
79048
79049 #define WEP_SMALL_KEY_LEN (40 / 8)
79050 #define WEP_LARGE_KEY_LEN (104 / 8)
79051 +#define WEP_KEYS (4)
79052 +
79053 +
79054
79055 struct at76_card_config {
79056 u8 exclude_unencrypted;
79057 @@ -161,7 +168,7 @@
79058 u8 privacy_invoked;
79059 u8 wep_default_key_id; /* 0..3 */
79060 u8 current_ssid[32];
79061 - u8 wep_default_key_value[4][WEP_KEY_LEN];
79062 + u8 wep_default_key_value[4][WEP_LARGE_KEY_LEN];
79063 u8 ssid_len;
79064 u8 short_preamble;
79065 __le16 beacon_period;
79066 @@ -186,7 +193,7 @@
79067 u8 link_quality;
79068 u8 noise_level;
79069 __le32 rx_time;
79070 - u8 packet[IEEE80211_FRAME_LEN + IEEE80211_FCS_LEN];
79071 + u8 packet[IEEE80211_MAX_FRAG_THRESHOLD];
79072 } __attribute__((packed));
79073
79074 /* Length of Atmel-specific Tx header before 802.11 frame */
79075 @@ -196,8 +203,11 @@
79076 __le16 wlength;
79077 u8 tx_rate;
79078 u8 padding;
79079 - u8 reserved[4];
79080 - u8 packet[IEEE80211_FRAME_LEN + IEEE80211_FCS_LEN];
79081 + u8 key_id;
79082 + u8 cipher_type;
79083 + u8 cipher_length;
79084 + u8 reserved;
79085 + u8 packet[IEEE80211_MAX_FRAG_THRESHOLD];
79086 } __attribute__((packed));
79087
79088 /* defines for scan_type below */
79089 @@ -244,6 +254,7 @@
79090 u8 byte;
79091 __le16 word;
79092 u8 addr[ETH_ALEN];
79093 + u8 data[256]; /* we need more space for mib_mac_encryption */
79094 } data;
79095 } __attribute__((packed));
79096
79097 @@ -317,10 +328,24 @@
79098 u8 exclude_unencrypted;
79099 __le32 wep_icv_error_count;
79100 __le32 wep_excluded_count;
79101 - u8 wep_default_keyvalue[WEP_KEYS][WEP_KEY_LEN];
79102 + u8 wep_default_keyvalue[WEP_KEYS][WEP_LARGE_KEY_LEN];
79103 u8 encryption_level; /* 1 for 40bit, 2 for 104bit encryption */
79104 } __attribute__((packed));
79105
79106 +struct mib_mac_encryption {
79107 + u8 cipher_default_keyvalue[CIPHER_KEYS][CIPHER_KEY_LEN];
79108 + u8 tkip_bssid[6];
79109 + u8 privacy_invoked;
79110 + u8 cipher_default_key_id;
79111 + u8 cipher_default_group_key_id;
79112 + u8 exclude_unencrypted;
79113 + u8 wep_encryption_type;
79114 + u8 ckip_key_permutation; /* bool */
79115 + __le32 wep_icv_error_count;
79116 + __le32 wep_excluded_count;
79117 + u8 key_rsc[CIPHER_KEYS][8];
79118 +} __attribute__((packed));
79119 +
79120 struct mib_phy {
79121 __le32 ed_threshold;
79122
79123 @@ -364,16 +389,6 @@
79124 __le32 ext_fw_len; /* external firmware image length */
79125 } __attribute__((packed));
79126
79127 -enum mac_state {
79128 - MAC_INIT,
79129 - MAC_SCANNING,
79130 - MAC_AUTH,
79131 - MAC_ASSOC,
79132 - MAC_JOINING,
79133 - MAC_CONNECTED,
79134 - MAC_OWN_IBSS
79135 -};
79136 -
79137 /* a description of a regulatory domain and the allowed channels */
79138 struct reg_domain {
79139 u16 code;
79140 @@ -381,47 +396,6 @@
79141 u32 channel_map; /* if bit N is set, channel (N+1) is allowed */
79142 };
79143
79144 -/* how long do we keep a (I)BSS in the bss_list in jiffies
79145 - this should be long enough for the user to retrieve the table
79146 - (by iwlist ?) after the device started, because all entries from
79147 - other channels than the one the device locks on get removed, too */
79148 -#define BSS_LIST_TIMEOUT (120 * HZ)
79149 -/* struct to store BSS info found during scan */
79150 -#define BSS_LIST_MAX_RATE_LEN 32 /* 32 rates should be enough ... */
79151 -
79152 -struct bss_info {
79153 - struct list_head list;
79154 -
79155 - u8 bssid[ETH_ALEN]; /* bssid */
79156 - u8 ssid[IW_ESSID_MAX_SIZE]; /* essid */
79157 - u8 ssid_len; /* length of ssid above */
79158 - u8 channel;
79159 - u16 capa; /* BSS capabilities */
79160 - u16 beacon_interval; /* beacon interval, Kus (1024 microseconds) */
79161 - u8 rates[BSS_LIST_MAX_RATE_LEN]; /* supported rates in units of
79162 - 500 kbps, ORed with 0x80 for
79163 - basic rates */
79164 - u8 rates_len;
79165 -
79166 - /* quality of received beacon */
79167 - u8 rssi;
79168 - u8 link_qual;
79169 - u8 noise_level;
79170 -
79171 - unsigned long last_rx; /* time (jiffies) of last beacon received */
79172 -};
79173 -
79174 -/* a rx data buffer to collect rx fragments */
79175 -struct rx_data_buf {
79176 - u8 sender[ETH_ALEN]; /* sender address */
79177 - u16 seqnr; /* sequence number */
79178 - u16 fragnr; /* last fragment received */
79179 - unsigned long last_rx; /* jiffies of last rx */
79180 - struct sk_buff *skb; /* == NULL if entry is free */
79181 -};
79182 -
79183 -#define NR_RX_DATA_BUF 8
79184 -
79185 /* Data for one loaded firmware file */
79186 struct fwentry {
79187 const char *const fwname;
79188 @@ -438,11 +412,9 @@
79189
79190 struct at76_priv {
79191 struct usb_device *udev; /* USB device pointer */
79192 - struct net_device *netdev; /* net device pointer */
79193 - struct net_device_stats stats; /* net device stats */
79194 - struct iw_statistics wstats; /* wireless stats */
79195
79196 struct sk_buff *rx_skb; /* skbuff for receiving data */
79197 + struct sk_buff *tx_skb; /* skbuff for transmitting data */
79198 void *bulk_out_buffer; /* buffer for sending data */
79199
79200 struct urb *tx_urb; /* URB for sending data */
79201 @@ -454,26 +426,17 @@
79202 struct mutex mtx; /* locks this structure */
79203
79204 /* work queues */
79205 - struct work_struct work_assoc_done;
79206 - struct work_struct work_join;
79207 - struct work_struct work_new_bss;
79208 - struct work_struct work_start_scan;
79209 struct work_struct work_set_promisc;
79210 struct work_struct work_submit_rx;
79211 - struct delayed_work dwork_restart;
79212 - struct delayed_work dwork_get_scan;
79213 - struct delayed_work dwork_beacon;
79214 - struct delayed_work dwork_auth;
79215 - struct delayed_work dwork_assoc;
79216 + struct delayed_work dwork_hw_scan;
79217
79218 struct tasklet_struct rx_tasklet;
79219
79220 /* the WEP stuff */
79221 int wep_enabled; /* 1 if WEP is enabled */
79222 int wep_key_id; /* key id to be used */
79223 - u8 wep_keys[WEP_KEYS][WEP_KEY_LEN]; /* the four WEP keys,
79224 - 5 or 13 bytes are used */
79225 - u8 wep_keys_len[WEP_KEYS]; /* the length of the above keys */
79226 + u8 wep_keys[WEP_KEYS][WEP_LARGE_KEY_LEN]; /* WEP keys */
79227 + u8 wep_keys_len[WEP_KEYS]; /* length of WEP keys */
79228
79229 int channel;
79230 int iw_mode;
79231 @@ -495,44 +458,13 @@
79232 int scan_mode; /* SCAN_TYPE_ACTIVE, SCAN_TYPE_PASSIVE */
79233 int scan_need_any; /* if set, need to scan for any ESSID */
79234
79235 - /* the list we got from scanning */
79236 - spinlock_t bss_list_spinlock; /* protects bss_list operations */
79237 - struct list_head bss_list; /* list of BSS we got beacons from */
79238 - struct timer_list bss_list_timer; /* timer to purge old entries
79239 - from bss_list */
79240 - struct bss_info *curr_bss; /* current BSS */
79241 u16 assoc_id; /* current association ID, if associated */
79242
79243 - u8 wanted_bssid[ETH_ALEN];
79244 - int wanted_bssid_valid; /* != 0 if wanted_bssid is to be used */
79245 -
79246 - /* some data for infrastructure mode only */
79247 - spinlock_t mgmt_spinlock; /* this spinlock protects access to
79248 - next_mgmt_bulk */
79249 -
79250 - struct at76_tx_buffer *next_mgmt_bulk; /* pending management msg to
79251 - send via bulk out */
79252 - enum mac_state mac_state;
79253 - enum {
79254 - SCAN_IDLE,
79255 - SCAN_IN_PROGRESS,
79256 - SCAN_COMPLETED
79257 - } scan_state;
79258 - time_t last_scan;
79259 -
79260 - int retries; /* remaining retries in case of timeout when
79261 - * sending AuthReq or AssocReq */
79262 u8 pm_mode; /* power management mode */
79263 u32 pm_period; /* power management period in microseconds */
79264
79265 struct reg_domain const *domain; /* reg domain description */
79266
79267 - /* iwspy support */
79268 - spinlock_t spy_spinlock;
79269 - struct iw_spy_data spy_data;
79270 -
79271 - struct iw_public_data wireless_data;
79272 -
79273 /* These fields contain HW config provided by the device (not all of
79274 * these fields are used by all board types) */
79275 u8 mac_addr[ETH_ALEN];
79276 @@ -540,9 +472,6 @@
79277
79278 struct at76_card_config card_config;
79279
79280 - /* store rx fragments until complete */
79281 - struct rx_data_buf rx_data[NR_RX_DATA_BUF];
79282 -
79283 enum board_type board_type;
79284 struct mib_fw_version fw_version;
79285
79286 @@ -550,58 +479,20 @@
79287 unsigned int netdev_registered:1;
79288 struct set_mib_buffer mib_buf; /* global buffer for set_mib calls */
79289
79290 - /* beacon counting */
79291 int beacon_period; /* period of mgmt beacons, Kus */
79292 - int beacons_received;
79293 - unsigned long beacons_last_qual; /* time we restarted counting
79294 - beacons */
79295 -};
79296
79297 -struct at76_rx_radiotap {
79298 - struct ieee80211_radiotap_header rt_hdr;
79299 - __le64 rt_tsft;
79300 - u8 rt_flags;
79301 - u8 rt_rate;
79302 - s8 rt_signal;
79303 - s8 rt_noise;
79304 -};
79305 -
79306 -#define AT76_RX_RADIOTAP_PRESENT \
79307 - ((1 << IEEE80211_RADIOTAP_TSFT) | \
79308 - (1 << IEEE80211_RADIOTAP_FLAGS) | \
79309 - (1 << IEEE80211_RADIOTAP_RATE) | \
79310 - (1 << IEEE80211_RADIOTAP_DB_ANTSIGNAL) | \
79311 - (1 << IEEE80211_RADIOTAP_DB_ANTNOISE))
79312 -
79313 -#define BEACON_MAX_DATA_LENGTH 1500
79314 -
79315 -/* the maximum size of an AssocReq packet */
79316 -#define ASSOCREQ_MAX_SIZE \
79317 - (AT76_TX_HDRLEN + sizeof(struct ieee80211_assoc_request) + \
79318 - 1 + 1 + IW_ESSID_MAX_SIZE + 1 + 1 + 4)
79319 -
79320 -/* for shared secret auth, add the challenge text size */
79321 -#define AUTH_FRAME_SIZE (AT76_TX_HDRLEN + sizeof(struct ieee80211_auth))
79322 + struct ieee80211_hw *hw;
79323 + int mac80211_registered;
79324
79325 -/* Maximal number of AuthReq retries */
79326 -#define AUTH_RETRIES 3
79327 -
79328 -/* Maximal number of AssocReq retries */
79329 -#define ASSOC_RETRIES 3
79330 -
79331 -/* Beacon timeout in managed mode when we are connected */
79332 -#define BEACON_TIMEOUT (10 * HZ)
79333 -
79334 -/* Timeout for authentication response */
79335 -#define AUTH_TIMEOUT (1 * HZ)
79336 + struct key_config keys[4]; /* installed key types */
79337 + u8 default_pairwise_key;
79338 + u8 default_group_key;
79339 +};
79340
79341 -/* Timeout for association response */
79342 -#define ASSOC_TIMEOUT (1 * HZ)
79343 +#define AT76_SUPPORTED_FILTERS FIF_PROMISC_IN_BSS
79344
79345 -/* Polling interval when scan is running */
79346 #define SCAN_POLL_INTERVAL (HZ / 4)
79347
79348 -/* Command completion timeout */
79349 #define CMD_COMPLETION_TIMEOUT (5 * HZ)
79350
79351 #define DEF_RTS_THRESHOLD 1536
79352 @@ -611,8 +502,6 @@
79353 #define DEF_SCAN_MIN_TIME 10
79354 #define DEF_SCAN_MAX_TIME 120
79355
79356 -#define MAX_RTS_THRESHOLD (MAX_FRAG_THRESHOLD + 1)
79357 -
79358 /* the max padding size for tx in bytes (see calc_padding) */
79359 #define MAX_PADDING_SIZE 53
79360
79361 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/at76_usb/Kconfig linux-2.6.29-rc3.owrt/drivers/staging/at76_usb/Kconfig
79362 --- linux-2.6.29.owrt/drivers/staging/at76_usb/Kconfig 2009-05-10 22:04:38.000000000 +0200
79363 +++ linux-2.6.29-rc3.owrt/drivers/staging/at76_usb/Kconfig 2009-05-10 23:48:29.000000000 +0200
79364 @@ -1,6 +1,6 @@
79365 config USB_ATMEL
79366 tristate "Atmel at76c503/at76c505/at76c505a USB cards"
79367 - depends on WLAN_80211 && USB
79368 + depends on MAC80211 && WLAN_80211 && USB
79369 default N
79370 select FW_LOADER
79371 ---help---
79372 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/asyncmesg.h linux-2.6.29-rc3.owrt/drivers/staging/benet/asyncmesg.h
79373 --- linux-2.6.29.owrt/drivers/staging/benet/asyncmesg.h 1970-01-01 01:00:00.000000000 +0100
79374 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/asyncmesg.h 2009-05-10 23:48:29.000000000 +0200
79375 @@ -0,0 +1,82 @@
79376 +/*
79377 + * Copyright (C) 2005 - 2008 ServerEngines
79378 + * All rights reserved.
79379 + *
79380 + * This program is free software; you can redistribute it and/or
79381 + * modify it under the terms of the GNU General Public License version 2
79382 + * as published by the Free Software Foundation. The full GNU General
79383 + * Public License is included in this distribution in the file called COPYING.
79384 + *
79385 + * Contact Information:
79386 + * linux-drivers@serverengines.com
79387 + *
79388 + * ServerEngines
79389 + * 209 N. Fair Oaks Ave
79390 + * Sunnyvale, CA 94085
79391 + */
79392 +/*
79393 + * Autogenerated by srcgen version: 0127
79394 + */
79395 +#ifndef __asyncmesg_amap_h__
79396 +#define __asyncmesg_amap_h__
79397 +#include "fwcmd_common.h"
79398 +
79399 +/* --- ASYNC_EVENT_CODES --- */
79400 +#define ASYNC_EVENT_CODE_LINK_STATE (1)
79401 +#define ASYNC_EVENT_CODE_ISCSI (2)
79402 +
79403 +/* --- ASYNC_LINK_STATES --- */
79404 +#define ASYNC_EVENT_LINK_DOWN (0) /* Link Down on a port */
79405 +#define ASYNC_EVENT_LINK_UP (1) /* Link Up on a port */
79406 +
79407 +/*
79408 + * The last 4 bytes of the async events have this common format. It allows
79409 + * the driver to distinguish [link]MCC_CQ_ENTRY[/link] structs from
79410 + * asynchronous events. Both arrive on the same completion queue. This
79411 + * structure also contains the common fields used to decode the async event.
79412 + */
79413 +struct BE_ASYNC_EVENT_TRAILER_AMAP {
79414 + u8 rsvd0[8]; /* DWORD 0 */
79415 + u8 event_code[8]; /* DWORD 0 */
79416 + u8 event_type[8]; /* DWORD 0 */
79417 + u8 rsvd1[6]; /* DWORD 0 */
79418 + u8 async_event; /* DWORD 0 */
79419 + u8 valid; /* DWORD 0 */
79420 +} __packed;
79421 +struct ASYNC_EVENT_TRAILER_AMAP {
79422 + u32 dw[1];
79423 +};
79424 +
79425 +/*
79426 + * Applicable in Initiator, Target and NIC modes.
79427 + * A link state async event is seen by all device drivers as soon they
79428 + * create an MCC ring. Thereafter, anytime the link status changes the
79429 + * drivers will receive a link state async event. Notifications continue to
79430 + * be sent until a driver destroys its MCC ring. A link down event is
79431 + * reported when either port loses link. A link up event is reported
79432 + * when either port regains link. When BE's failover mechanism is enabled, a
79433 + * link down on the active port causes traffic to be diverted to the standby
79434 + * port by the BE's ARM firmware (assuming the standby port has link). In
79435 + * this case, the standy port assumes the active status. Note: when link is
79436 + * restored on the failed port, traffic continues on the currently active
79437 + * port. The ARM firmware does not attempt to 'fail back' traffic to
79438 + * the restored port.
79439 + */
79440 +struct BE_ASYNC_EVENT_LINK_STATE_AMAP {
79441 + u8 port0_link_status[8];
79442 + u8 port1_link_status[8];
79443 + u8 active_port[8];
79444 + u8 rsvd0[8]; /* DWORD 0 */
79445 + u8 port0_duplex[8];
79446 + u8 port0_speed[8];
79447 + u8 port1_duplex[8];
79448 + u8 port1_speed[8];
79449 + u8 port0_fault[8];
79450 + u8 port1_fault[8];
79451 + u8 rsvd1[2][8]; /* DWORD 2 */
79452 + struct BE_ASYNC_EVENT_TRAILER_AMAP trailer;
79453 +} __packed;
79454 +struct ASYNC_EVENT_LINK_STATE_AMAP {
79455 + u32 dw[4];
79456 +};
79457 +#endif /* __asyncmesg_amap_h__ */
79458 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/be_cm.h linux-2.6.29-rc3.owrt/drivers/staging/benet/be_cm.h
79459 --- linux-2.6.29.owrt/drivers/staging/benet/be_cm.h 1970-01-01 01:00:00.000000000 +0100
79460 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/be_cm.h 2009-05-10 23:48:29.000000000 +0200
79461 @@ -0,0 +1,134 @@
79462 +/*
79463 + * Copyright (C) 2005 - 2008 ServerEngines
79464 + * All rights reserved.
79465 + *
79466 + * This program is free software; you can redistribute it and/or
79467 + * modify it under the terms of the GNU General Public License version 2
79468 + * as published by the Free Software Foundation. The full GNU General
79469 + * Public License is included in this distribution in the file called COPYING.
79470 + *
79471 + * Contact Information:
79472 + * linux-drivers@serverengines.com
79473 + *
79474 + * ServerEngines
79475 + * 209 N. Fair Oaks Ave
79476 + * Sunnyvale, CA 94085
79477 + */
79478 +/*
79479 + * Autogenerated by srcgen version: 0127
79480 + */
79481 +#ifndef __be_cm_amap_h__
79482 +#define __be_cm_amap_h__
79483 +#include "be_common.h"
79484 +#include "etx_context.h"
79485 +#include "mpu_context.h"
79486 +
79487 +/*
79488 + * --- CEV_WATERMARK_ENUM ---
79489 + * CQ/EQ Watermark Encodings. Encoded as number of free entries in
79490 + * Queue when Watermark is reached.
79491 + */
79492 +#define CEV_WMARK_0 (0) /* Watermark when Queue full */
79493 +#define CEV_WMARK_16 (1) /* Watermark at 16 free entries */
79494 +#define CEV_WMARK_32 (2) /* Watermark at 32 free entries */
79495 +#define CEV_WMARK_48 (3) /* Watermark at 48 free entries */
79496 +#define CEV_WMARK_64 (4) /* Watermark at 64 free entries */
79497 +#define CEV_WMARK_80 (5) /* Watermark at 80 free entries */
79498 +#define CEV_WMARK_96 (6) /* Watermark at 96 free entries */
79499 +#define CEV_WMARK_112 (7) /* Watermark at 112 free entries */
79500 +#define CEV_WMARK_128 (8) /* Watermark at 128 free entries */
79501 +#define CEV_WMARK_144 (9) /* Watermark at 144 free entries */
79502 +#define CEV_WMARK_160 (10) /* Watermark at 160 free entries */
79503 +#define CEV_WMARK_176 (11) /* Watermark at 176 free entries */
79504 +#define CEV_WMARK_192 (12) /* Watermark at 192 free entries */
79505 +#define CEV_WMARK_208 (13) /* Watermark at 208 free entries */
79506 +#define CEV_WMARK_224 (14) /* Watermark at 224 free entries */
79507 +#define CEV_WMARK_240 (15) /* Watermark at 240 free entries */
79508 +
79509 +/*
79510 + * --- CQ_CNT_ENUM ---
79511 + * Completion Queue Count Encodings.
79512 + */
79513 +#define CEV_CQ_CNT_256 (0) /* CQ has 256 entries */
79514 +#define CEV_CQ_CNT_512 (1) /* CQ has 512 entries */
79515 +#define CEV_CQ_CNT_1024 (2) /* CQ has 1024 entries */
79516 +
79517 +/*
79518 + * --- EQ_CNT_ENUM ---
79519 + * Event Queue Count Encodings.
79520 + */
79521 +#define CEV_EQ_CNT_256 (0) /* EQ has 256 entries (16-byte EQEs only) */
79522 +#define CEV_EQ_CNT_512 (1) /* EQ has 512 entries (16-byte EQEs only) */
79523 +#define CEV_EQ_CNT_1024 (2) /* EQ has 1024 entries (4-byte or */
79524 + /* 16-byte EQEs only) */
79525 +#define CEV_EQ_CNT_2048 (3) /* EQ has 2048 entries (4-byte or */
79526 + /* 16-byte EQEs only) */
79527 +#define CEV_EQ_CNT_4096 (4) /* EQ has 4096 entries (4-byte EQEs only) */
79528 +
79529 +/*
79530 + * --- EQ_SIZE_ENUM ---
79531 + * Event Queue Entry Size Encoding.
79532 + */
79533 +#define CEV_EQ_SIZE_4 (0) /* EQE is 4 bytes */
79534 +#define CEV_EQ_SIZE_16 (1) /* EQE is 16 bytes */
79535 +
79536 +/*
79537 + * Completion Queue Context Table Entry. Contains the state of a CQ.
79538 + * Located in RAM within the CEV block.
79539 + */
79540 +struct BE_CQ_CONTEXT_AMAP {
79541 + u8 Cidx[11]; /* DWORD 0 */
79542 + u8 Watermark[4]; /* DWORD 0 */
79543 + u8 NoDelay; /* DWORD 0 */
79544 + u8 EPIdx[11]; /* DWORD 0 */
79545 + u8 Count[2]; /* DWORD 0 */
79546 + u8 valid; /* DWORD 0 */
79547 + u8 SolEvent; /* DWORD 0 */
79548 + u8 Eventable; /* DWORD 0 */
79549 + u8 Pidx[11]; /* DWORD 1 */
79550 + u8 PD[10]; /* DWORD 1 */
79551 + u8 EQID[7]; /* DWORD 1 */
79552 + u8 Func; /* DWORD 1 */
79553 + u8 WME; /* DWORD 1 */
79554 + u8 Stalled; /* DWORD 1 */
79555 + u8 Armed; /* DWORD 1 */
79556 +} __packed;
79557 +struct CQ_CONTEXT_AMAP {
79558 + u32 dw[2];
79559 +};
79560 +
79561 +/*
79562 + * Event Queue Context Table Entry. Contains the state of an EQ.
79563 + * Located in RAM in the CEV block.
79564 + */
79565 +struct BE_EQ_CONTEXT_AMAP {
79566 + u8 Cidx[13]; /* DWORD 0 */
79567 + u8 rsvd0[2]; /* DWORD 0 */
79568 + u8 Func; /* DWORD 0 */
79569 + u8 EPIdx[13]; /* DWORD 0 */
79570 + u8 valid; /* DWORD 0 */
79571 + u8 rsvd1; /* DWORD 0 */
79572 + u8 Size; /* DWORD 0 */
79573 + u8 Pidx[13]; /* DWORD 1 */
79574 + u8 rsvd2[3]; /* DWORD 1 */
79575 + u8 PD[10]; /* DWORD 1 */
79576 + u8 Count[3]; /* DWORD 1 */
79577 + u8 SolEvent; /* DWORD 1 */
79578 + u8 Stalled; /* DWORD 1 */
79579 + u8 Armed; /* DWORD 1 */
79580 + u8 Watermark[4]; /* DWORD 2 */
79581 + u8 WME; /* DWORD 2 */
79582 + u8 rsvd3[3]; /* DWORD 2 */
79583 + u8 EventVect[6]; /* DWORD 2 */
79584 + u8 rsvd4[2]; /* DWORD 2 */
79585 + u8 Delay[8]; /* DWORD 2 */
79586 + u8 rsvd5[6]; /* DWORD 2 */
79587 + u8 TMR; /* DWORD 2 */
79588 + u8 rsvd6; /* DWORD 2 */
79589 + u8 rsvd7[32]; /* DWORD 3 */
79590 +} __packed;
79591 +struct EQ_CONTEXT_AMAP {
79592 + u32 dw[4];
79593 +};
79594 +
79595 +#endif /* __be_cm_amap_h__ */
79596 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/be_common.h linux-2.6.29-rc3.owrt/drivers/staging/benet/be_common.h
79597 --- linux-2.6.29.owrt/drivers/staging/benet/be_common.h 1970-01-01 01:00:00.000000000 +0100
79598 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/be_common.h 2009-05-10 23:48:29.000000000 +0200
79599 @@ -0,0 +1,53 @@
79600 +/*
79601 + * Copyright (C) 2005 - 2008 ServerEngines
79602 + * All rights reserved.
79603 + *
79604 + * This program is free software; you can redistribute it and/or
79605 + * modify it under the terms of the GNU General Public License version 2
79606 + * as published by the Free Software Foundation. The full GNU General
79607 + * Public License is included in this distribution in the file called COPYING.
79608 + *
79609 + * Contact Information:
79610 + * linux-drivers@serverengines.com
79611 + *
79612 + * ServerEngines
79613 + * 209 N. Fair Oaks Ave
79614 + * Sunnyvale, CA 94085
79615 + */
79616 +/*
79617 + * Autogenerated by srcgen version: 0127
79618 + */
79619 +#ifndef __be_common_amap_h__
79620 +#define __be_common_amap_h__
79621 +
79622 +/* Physical Address. */
79623 +struct BE_PHYS_ADDR_AMAP {
79624 + u8 lo[32]; /* DWORD 0 */
79625 + u8 hi[32]; /* DWORD 1 */
79626 +} __packed;
79627 +struct PHYS_ADDR_AMAP {
79628 + u32 dw[2];
79629 +};
79630 +
79631 +/* Virtual Address. */
79632 +struct BE_VIRT_ADDR_AMAP {
79633 + u8 lo[32]; /* DWORD 0 */
79634 + u8 hi[32]; /* DWORD 1 */
79635 +} __packed;
79636 +struct VIRT_ADDR_AMAP {
79637 + u32 dw[2];
79638 +};
79639 +
79640 +/* Scatter gather element. */
79641 +struct BE_SGE_AMAP {
79642 + u8 addr_hi[32]; /* DWORD 0 */
79643 + u8 addr_lo[32]; /* DWORD 1 */
79644 + u8 rsvd0[32]; /* DWORD 2 */
79645 + u8 len[16]; /* DWORD 3 */
79646 + u8 rsvd1[16]; /* DWORD 3 */
79647 +} __packed;
79648 +struct SGE_AMAP {
79649 + u32 dw[4];
79650 +};
79651 +
79652 +#endif /* __be_common_amap_h__ */
79653 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/be_ethtool.c linux-2.6.29-rc3.owrt/drivers/staging/benet/be_ethtool.c
79654 --- linux-2.6.29.owrt/drivers/staging/benet/be_ethtool.c 1970-01-01 01:00:00.000000000 +0100
79655 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/be_ethtool.c 2009-05-10 23:48:29.000000000 +0200
79656 @@ -0,0 +1,348 @@
79657 +/*
79658 + * Copyright (C) 2005 - 2008 ServerEngines
79659 + * All rights reserved.
79660 + *
79661 + * This program is free software; you can redistribute it and/or
79662 + * modify it under the terms of the GNU General Public License version 2
79663 + * as published by the Free Software Foundation. The full GNU General
79664 + * Public License is included in this distribution in the file called COPYING.
79665 + *
79666 + * Contact Information:
79667 + * linux-drivers@serverengines.com
79668 + *
79669 + * ServerEngines
79670 + * 209 N. Fair Oaks Ave
79671 + * Sunnyvale, CA 94085
79672 + */
79673 +/*
79674 + * be_ethtool.c
79675 + *
79676 + * This file contains various functions that ethtool can use
79677 + * to talk to the driver and the BE H/W.
79678 + */
79679 +
79680 +#include "benet.h"
79681 +
79682 +#include <linux/ethtool.h>
79683 +
79684 +static const char benet_gstrings_stats[][ETH_GSTRING_LEN] = {
79685 +/* net_device_stats */
79686 + "rx_packets",
79687 + "tx_packets",
79688 + "rx_bytes",
79689 + "tx_bytes",
79690 + "rx_errors",
79691 + "tx_errors",
79692 + "rx_dropped",
79693 + "tx_dropped",
79694 + "multicast",
79695 + "collisions",
79696 + "rx_length_errors",
79697 + "rx_over_errors",
79698 + "rx_crc_errors",
79699 + "rx_frame_errors",
79700 + "rx_fifo_errors",
79701 + "rx_missed_errors",
79702 + "tx_aborted_errors",
79703 + "tx_carrier_errors",
79704 + "tx_fifo_errors",
79705 + "tx_heartbeat_errors",
79706 + "tx_window_errors",
79707 + "rx_compressed",
79708 + "tc_compressed",
79709 +/* BE driver Stats */
79710 + "bes_tx_reqs",
79711 + "bes_tx_fails",
79712 + "bes_fwd_reqs",
79713 + "bes_tx_wrbs",
79714 + "bes_interrupts",
79715 + "bes_events",
79716 + "bes_tx_events",
79717 + "bes_rx_events",
79718 + "bes_tx_compl",
79719 + "bes_rx_compl",
79720 + "bes_ethrx_post_fail",
79721 + "bes_802_3_dropped_frames",
79722 + "bes_802_3_malformed_frames",
79723 + "bes_rx_misc_pkts",
79724 + "bes_eth_tx_rate",
79725 + "bes_eth_rx_rate",
79726 + "Num Packets collected",
79727 + "Num Times Flushed",
79728 +};
79729 +
79730 +#define NET_DEV_STATS_LEN \
79731 + (sizeof(struct net_device_stats)/sizeof(unsigned long))
79732 +
79733 +#define BENET_STATS_LEN ARRAY_SIZE(benet_gstrings_stats)
79734 +
79735 +static void
79736 +be_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo)
79737 +{
79738 + struct be_net_object *pnob = netdev_priv(netdev);
79739 + struct be_adapter *adapter = pnob->adapter;
79740 +
79741 + strncpy(drvinfo->driver, be_driver_name, 32);
79742 + strncpy(drvinfo->version, be_drvr_ver, 32);
79743 + strncpy(drvinfo->fw_version, be_fw_ver, 32);
79744 + strcpy(drvinfo->bus_info, pci_name(adapter->pdev));
79745 + drvinfo->testinfo_len = 0;
79746 + drvinfo->regdump_len = 0;
79747 + drvinfo->eedump_len = 0;
79748 +}
79749 +
79750 +static int
79751 +be_get_coalesce(struct net_device *netdev, struct ethtool_coalesce *coalesce)
79752 +{
79753 + struct be_net_object *pnob = netdev_priv(netdev);
79754 + struct be_adapter *adapter = pnob->adapter;
79755 +
79756 + coalesce->rx_max_coalesced_frames = adapter->max_rx_coal;
79757 +
79758 + coalesce->rx_coalesce_usecs = adapter->cur_eqd;
79759 + coalesce->rx_coalesce_usecs_high = adapter->max_eqd;
79760 + coalesce->rx_coalesce_usecs_low = adapter->min_eqd;
79761 +
79762 + coalesce->tx_coalesce_usecs = adapter->cur_eqd;
79763 + coalesce->tx_coalesce_usecs_high = adapter->max_eqd;
79764 + coalesce->tx_coalesce_usecs_low = adapter->min_eqd;
79765 +
79766 + coalesce->use_adaptive_rx_coalesce = adapter->enable_aic;
79767 + coalesce->use_adaptive_tx_coalesce = adapter->enable_aic;
79768 +
79769 + return 0;
79770 +}
79771 +
79772 +/*
79773 + * This routine is used to set interrup coalescing delay *as well as*
79774 + * the number of pkts to coalesce for LRO.
79775 + */
79776 +static int
79777 +be_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *coalesce)
79778 +{
79779 + struct be_net_object *pnob = netdev_priv(netdev);
79780 + struct be_adapter *adapter = pnob->adapter;
79781 + struct be_eq_object *eq_objectp;
79782 + u32 max, min, cur;
79783 + int status;
79784 +
79785 + adapter->max_rx_coal = coalesce->rx_max_coalesced_frames;
79786 + if (adapter->max_rx_coal >= BE_LRO_MAX_PKTS)
79787 + adapter->max_rx_coal = BE_LRO_MAX_PKTS;
79788 +
79789 + if (adapter->enable_aic == 0 &&
79790 + coalesce->use_adaptive_rx_coalesce == 1) {
79791 + /* if AIC is being turned on now, start with an EQD of 0 */
79792 + adapter->cur_eqd = 0;
79793 + }
79794 + adapter->enable_aic = coalesce->use_adaptive_rx_coalesce;
79795 +
79796 + /* round off to nearest multiple of 8 */
79797 + max = (((coalesce->rx_coalesce_usecs_high + 4) >> 3) << 3);
79798 + min = (((coalesce->rx_coalesce_usecs_low + 4) >> 3) << 3);
79799 + cur = (((coalesce->rx_coalesce_usecs + 4) >> 3) << 3);
79800 +
79801 + if (adapter->enable_aic) {
79802 + /* accept low and high if AIC is enabled */
79803 + if (max > MAX_EQD)
79804 + max = MAX_EQD;
79805 + if (min > max)
79806 + min = max;
79807 + adapter->max_eqd = max;
79808 + adapter->min_eqd = min;
79809 + if (adapter->cur_eqd > max)
79810 + adapter->cur_eqd = max;
79811 + if (adapter->cur_eqd < min)
79812 + adapter->cur_eqd = min;
79813 + } else {
79814 + /* accept specified coalesce_usecs only if AIC is disabled */
79815 + if (cur > MAX_EQD)
79816 + cur = MAX_EQD;
79817 + eq_objectp = &pnob->event_q_obj;
79818 + status =
79819 + be_eq_modify_delay(&pnob->fn_obj, 1, &eq_objectp, &cur,
79820 + NULL, NULL, NULL);
79821 + if (status == BE_SUCCESS)
79822 + adapter->cur_eqd = cur;
79823 + }
79824 + return 0;
79825 +}
79826 +
79827 +static u32 be_get_rx_csum(struct net_device *netdev)
79828 +{
79829 + struct be_net_object *pnob = netdev_priv(netdev);
79830 + struct be_adapter *adapter = pnob->adapter;
79831 + return adapter->rx_csum;
79832 +}
79833 +
79834 +static int be_set_rx_csum(struct net_device *netdev, uint32_t data)
79835 +{
79836 + struct be_net_object *pnob = netdev_priv(netdev);
79837 + struct be_adapter *adapter = pnob->adapter;
79838 +
79839 + if (data)
79840 + adapter->rx_csum = 1;
79841 + else
79842 + adapter->rx_csum = 0;
79843 +
79844 + return 0;
79845 +}
79846 +
79847 +static void
79848 +be_get_strings(struct net_device *netdev, uint32_t stringset, uint8_t *data)
79849 +{
79850 + switch (stringset) {
79851 + case ETH_SS_STATS:
79852 + memcpy(data, *benet_gstrings_stats,
79853 + sizeof(benet_gstrings_stats));
79854 + break;
79855 + }
79856 +}
79857 +
79858 +static int be_get_stats_count(struct net_device *netdev)
79859 +{
79860 + return BENET_STATS_LEN;
79861 +}
79862 +
79863 +static void
79864 +be_get_ethtool_stats(struct net_device *netdev,
79865 + struct ethtool_stats *stats, uint64_t *data)
79866 +{
79867 + struct be_net_object *pnob = netdev_priv(netdev);
79868 + struct be_adapter *adapter = pnob->adapter;
79869 + int i;
79870 +
79871 + benet_get_stats(netdev);
79872 +
79873 + for (i = 0; i <= NET_DEV_STATS_LEN; i++)
79874 + data[i] = ((unsigned long *)&adapter->benet_stats)[i];
79875 +
79876 + data[i] = adapter->be_stat.bes_tx_reqs;
79877 + data[i++] = adapter->be_stat.bes_tx_fails;
79878 + data[i++] = adapter->be_stat.bes_fwd_reqs;
79879 + data[i++] = adapter->be_stat.bes_tx_wrbs;
79880 +
79881 + data[i++] = adapter->be_stat.bes_ints;
79882 + data[i++] = adapter->be_stat.bes_events;
79883 + data[i++] = adapter->be_stat.bes_tx_events;
79884 + data[i++] = adapter->be_stat.bes_rx_events;
79885 + data[i++] = adapter->be_stat.bes_tx_compl;
79886 + data[i++] = adapter->be_stat.bes_rx_compl;
79887 + data[i++] = adapter->be_stat.bes_ethrx_post_fail;
79888 + data[i++] = adapter->be_stat.bes_802_3_dropped_frames;
79889 + data[i++] = adapter->be_stat.bes_802_3_malformed_frames;
79890 + data[i++] = adapter->be_stat.bes_rx_misc_pkts;
79891 + data[i++] = adapter->be_stat.bes_eth_tx_rate;
79892 + data[i++] = adapter->be_stat.bes_eth_rx_rate;
79893 + data[i++] = adapter->be_stat.bes_rx_coal;
79894 + data[i++] = adapter->be_stat.bes_rx_flush;
79895 +
79896 +}
79897 +
79898 +static int be_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
79899 +{
79900 + ecmd->speed = SPEED_10000;
79901 + ecmd->duplex = DUPLEX_FULL;
79902 + ecmd->autoneg = AUTONEG_DISABLE;
79903 + return 0;
79904 +}
79905 +
79906 +/* Get the Ring parameters from the pnob */
79907 +static void
79908 +be_get_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring)
79909 +{
79910 + struct be_net_object *pnob = netdev_priv(netdev);
79911 +
79912 + /* Pre Set Maxims */
79913 + ring->rx_max_pending = pnob->rx_q_len;
79914 + ring->rx_mini_max_pending = ring->rx_mini_max_pending;
79915 + ring->rx_jumbo_max_pending = ring->rx_jumbo_max_pending;
79916 + ring->tx_max_pending = pnob->tx_q_len;
79917 +
79918 + /* Current hardware Settings */
79919 + ring->rx_pending = atomic_read(&pnob->rx_q_posted);
79920 + ring->rx_mini_pending = ring->rx_mini_pending;
79921 + ring->rx_jumbo_pending = ring->rx_jumbo_pending;
79922 + ring->tx_pending = atomic_read(&pnob->tx_q_used);
79923 +
79924 +}
79925 +
79926 +static void
79927 +be_get_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *ecmd)
79928 +{
79929 + struct be_net_object *pnob = netdev_priv(netdev);
79930 + bool rxfc, txfc;
79931 + int status;
79932 +
79933 + status = be_eth_get_flow_control(&pnob->fn_obj, &txfc, &rxfc);
79934 + if (status != BE_SUCCESS) {
79935 + dev_info(&netdev->dev, "Unable to get pause frame settings\n");
79936 + /* return defaults */
79937 + ecmd->rx_pause = 1;
79938 + ecmd->tx_pause = 0;
79939 + ecmd->autoneg = AUTONEG_ENABLE;
79940 + return;
79941 + }
79942 +
79943 + if (txfc == true)
79944 + ecmd->tx_pause = 1;
79945 + else
79946 + ecmd->tx_pause = 0;
79947 +
79948 + if (rxfc == true)
79949 + ecmd->rx_pause = 1;
79950 + else
79951 + ecmd->rx_pause = 0;
79952 +
79953 + ecmd->autoneg = AUTONEG_ENABLE;
79954 +}
79955 +
79956 +static int
79957 +be_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *ecmd)
79958 +{
79959 + struct be_net_object *pnob = netdev_priv(netdev);
79960 + bool txfc, rxfc;
79961 + int status;
79962 +
79963 + if (ecmd->autoneg != AUTONEG_ENABLE)
79964 + return -EINVAL;
79965 +
79966 + if (ecmd->tx_pause)
79967 + txfc = true;
79968 + else
79969 + txfc = false;
79970 +
79971 + if (ecmd->rx_pause)
79972 + rxfc = true;
79973 + else
79974 + rxfc = false;
79975 +
79976 + status = be_eth_set_flow_control(&pnob->fn_obj, txfc, rxfc);
79977 + if (status != BE_SUCCESS) {
79978 + dev_info(&netdev->dev, "Unable to set pause frame settings\n");
79979 + return -1;
79980 + }
79981 + return 0;
79982 +}
79983 +
79984 +struct ethtool_ops be_ethtool_ops = {
79985 + .get_settings = be_get_settings,
79986 + .get_drvinfo = be_get_drvinfo,
79987 + .get_link = ethtool_op_get_link,
79988 + .get_coalesce = be_get_coalesce,
79989 + .set_coalesce = be_set_coalesce,
79990 + .get_ringparam = be_get_ringparam,
79991 + .get_pauseparam = be_get_pauseparam,
79992 + .set_pauseparam = be_set_pauseparam,
79993 + .get_rx_csum = be_get_rx_csum,
79994 + .set_rx_csum = be_set_rx_csum,
79995 + .get_tx_csum = ethtool_op_get_tx_csum,
79996 + .set_tx_csum = ethtool_op_set_tx_csum,
79997 + .get_sg = ethtool_op_get_sg,
79998 + .set_sg = ethtool_op_set_sg,
79999 + .get_tso = ethtool_op_get_tso,
80000 + .set_tso = ethtool_op_set_tso,
80001 + .get_strings = be_get_strings,
80002 + .get_stats_count = be_get_stats_count,
80003 + .get_ethtool_stats = be_get_ethtool_stats,
80004 +};
80005 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/be_init.c linux-2.6.29-rc3.owrt/drivers/staging/benet/be_init.c
80006 --- linux-2.6.29.owrt/drivers/staging/benet/be_init.c 1970-01-01 01:00:00.000000000 +0100
80007 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/be_init.c 2009-05-10 23:48:29.000000000 +0200
80008 @@ -0,0 +1,1382 @@
80009 +/*
80010 + * Copyright (C) 2005 - 2008 ServerEngines
80011 + * All rights reserved.
80012 + *
80013 + * This program is free software; you can redistribute it and/or
80014 + * modify it under the terms of the GNU General Public License version 2
80015 + * as published by the Free Software Foundation. The full GNU General
80016 + * Public License is included in this distribution in the file called COPYING.
80017 + *
80018 + * Contact Information:
80019 + * linux-drivers@serverengines.com
80020 + *
80021 + * ServerEngines
80022 + * 209 N. Fair Oaks Ave
80023 + * Sunnyvale, CA 94085
80024 + */
80025 +#include <linux/etherdevice.h>
80026 +#include "benet.h"
80027 +
80028 +#define DRVR_VERSION "1.0.728"
80029 +
80030 +static const struct pci_device_id be_device_id_table[] = {
80031 + {PCI_DEVICE(0x19a2, 0x0201)},
80032 + {0}
80033 +};
80034 +
80035 +MODULE_DEVICE_TABLE(pci, be_device_id_table);
80036 +
80037 +MODULE_VERSION(DRVR_VERSION);
80038 +
80039 +#define DRV_DESCRIPTION "ServerEngines BladeEngine Network Driver Version "
80040 +
80041 +MODULE_DESCRIPTION(DRV_DESCRIPTION DRVR_VERSION);
80042 +MODULE_AUTHOR("ServerEngines");
80043 +MODULE_LICENSE("GPL");
80044 +
80045 +static unsigned int msix = 1;
80046 +module_param(msix, uint, S_IRUGO);
80047 +MODULE_PARM_DESC(msix, "Use MSI-x interrupts");
80048 +
80049 +static unsigned int rxbuf_size = 2048; /* Default RX frag size */
80050 +module_param(rxbuf_size, uint, S_IRUGO);
80051 +MODULE_PARM_DESC(rxbuf_size, "Size of buffers to hold Rx data");
80052 +
80053 +const char be_drvr_ver[] = DRVR_VERSION;
80054 +char be_fw_ver[32]; /* F/W version filled in by be_probe */
80055 +char be_driver_name[] = "benet";
80056 +
80057 +/*
80058 + * Number of entries in each queue.
80059 + */
80060 +#define EVENT_Q_LEN 1024
80061 +#define ETH_TXQ_LEN 2048
80062 +#define ETH_TXCQ_LEN 1024
80063 +#define ETH_RXQ_LEN 1024 /* Does not support any other value */
80064 +#define ETH_UC_RXCQ_LEN 1024
80065 +#define ETH_BC_RXCQ_LEN 256
80066 +#define MCC_Q_LEN 64 /* total size not to exceed 8 pages */
80067 +#define MCC_CQ_LEN 256
80068 +
80069 +/* Bit mask describing events of interest to be traced */
80070 +unsigned int trace_level;
80071 +
80072 +static int
80073 +init_pci_be_function(struct be_adapter *adapter, struct pci_dev *pdev)
80074 +{
80075 + u64 pa;
80076 +
80077 + /* CSR */
80078 + pa = pci_resource_start(pdev, 2);
80079 + adapter->csr_va = ioremap_nocache(pa, pci_resource_len(pdev, 2));
80080 + if (adapter->csr_va == NULL)
80081 + return -ENOMEM;
80082 +
80083 + /* Door Bell */
80084 + pa = pci_resource_start(pdev, 4);
80085 + adapter->db_va = ioremap_nocache(pa, (128 * 1024));
80086 + if (adapter->db_va == NULL) {
80087 + iounmap(adapter->csr_va);
80088 + return -ENOMEM;
80089 + }
80090 +
80091 + /* PCI */
80092 + pa = pci_resource_start(pdev, 1);
80093 + adapter->pci_va = ioremap_nocache(pa, pci_resource_len(pdev, 1));
80094 + if (adapter->pci_va == NULL) {
80095 + iounmap(adapter->csr_va);
80096 + iounmap(adapter->db_va);
80097 + return -ENOMEM;
80098 + }
80099 + return 0;
80100 +}
80101 +
80102 +/*
80103 + This function enables the interrupt corresponding to the Event
80104 + queue ID for the given NetObject
80105 +*/
80106 +void be_enable_eq_intr(struct be_net_object *pnob)
80107 +{
80108 + struct CQ_DB_AMAP cqdb;
80109 + cqdb.dw[0] = 0;
80110 + AMAP_SET_BITS_PTR(CQ_DB, event, &cqdb, 1);
80111 + AMAP_SET_BITS_PTR(CQ_DB, rearm, &cqdb, 1);
80112 + AMAP_SET_BITS_PTR(CQ_DB, num_popped, &cqdb, 0);
80113 + AMAP_SET_BITS_PTR(CQ_DB, qid, &cqdb, pnob->event_q_id);
80114 + PD_WRITE(&pnob->fn_obj, cq_db, cqdb.dw[0]);
80115 +}
80116 +
80117 +/*
80118 + This function disables the interrupt corresponding to the Event
80119 + queue ID for the given NetObject
80120 +*/
80121 +void be_disable_eq_intr(struct be_net_object *pnob)
80122 +{
80123 + struct CQ_DB_AMAP cqdb;
80124 + cqdb.dw[0] = 0;
80125 + AMAP_SET_BITS_PTR(CQ_DB, event, &cqdb, 1);
80126 + AMAP_SET_BITS_PTR(CQ_DB, rearm, &cqdb, 0);
80127 + AMAP_SET_BITS_PTR(CQ_DB, num_popped, &cqdb, 0);
80128 + AMAP_SET_BITS_PTR(CQ_DB, qid, &cqdb, pnob->event_q_id);
80129 + PD_WRITE(&pnob->fn_obj, cq_db, cqdb.dw[0]);
80130 +}
80131 +
80132 +/*
80133 + This function enables the interrupt from the network function
80134 + of the BladeEngine. Use the function be_disable_eq_intr()
80135 + to enable the interrupt from the event queue of only one specific
80136 + NetObject
80137 +*/
80138 +void be_enable_intr(struct be_net_object *pnob)
80139 +{
80140 + struct PCICFG_HOST_TIMER_INT_CTRL_CSR_AMAP ctrl;
80141 + u32 host_intr;
80142 +
80143 + ctrl.dw[0] = PCICFG1_READ(&pnob->fn_obj, host_timer_int_ctrl);
80144 + host_intr = AMAP_GET_BITS_PTR(PCICFG_HOST_TIMER_INT_CTRL_CSR,
80145 + hostintr, ctrl.dw);
80146 + if (!host_intr) {
80147 + AMAP_SET_BITS_PTR(PCICFG_HOST_TIMER_INT_CTRL_CSR,
80148 + hostintr, ctrl.dw, 1);
80149 + PCICFG1_WRITE(&pnob->fn_obj, host_timer_int_ctrl,
80150 + ctrl.dw[0]);
80151 + }
80152 +}
80153 +
80154 +/*
80155 + This function disables the interrupt from the network function of
80156 + the BladeEngine. Use the function be_disable_eq_intr() to
80157 + disable the interrupt from the event queue of only one specific NetObject
80158 +*/
80159 +void be_disable_intr(struct be_net_object *pnob)
80160 +{
80161 +
80162 + struct PCICFG_HOST_TIMER_INT_CTRL_CSR_AMAP ctrl;
80163 + u32 host_intr;
80164 + ctrl.dw[0] = PCICFG1_READ(&pnob->fn_obj, host_timer_int_ctrl);
80165 + host_intr = AMAP_GET_BITS_PTR(PCICFG_HOST_TIMER_INT_CTRL_CSR,
80166 + hostintr, ctrl.dw);
80167 + if (host_intr) {
80168 + AMAP_SET_BITS_PTR(PCICFG_HOST_TIMER_INT_CTRL_CSR, hostintr,
80169 + ctrl.dw, 0);
80170 + PCICFG1_WRITE(&pnob->fn_obj, host_timer_int_ctrl,
80171 + ctrl.dw[0]);
80172 + }
80173 +}
80174 +
80175 +static int be_enable_msix(struct be_adapter *adapter)
80176 +{
80177 + int i, ret;
80178 +
80179 + if (!msix)
80180 + return -1;
80181 +
80182 + for (i = 0; i < BE_MAX_REQ_MSIX_VECTORS; i++)
80183 + adapter->msix_entries[i].entry = i;
80184 +
80185 + ret = pci_enable_msix(adapter->pdev, adapter->msix_entries,
80186 + BE_MAX_REQ_MSIX_VECTORS);
80187 +
80188 + if (ret == 0)
80189 + adapter->msix_enabled = 1;
80190 + return ret;
80191 +}
80192 +
80193 +static int be_register_isr(struct be_adapter *adapter,
80194 + struct be_net_object *pnob)
80195 +{
80196 + struct net_device *netdev = pnob->netdev;
80197 + int intx = 0, r;
80198 +
80199 + netdev->irq = adapter->pdev->irq;
80200 + r = be_enable_msix(adapter);
80201 +
80202 + if (r == 0) {
80203 + r = request_irq(adapter->msix_entries[0].vector,
80204 + be_int, IRQF_SHARED, netdev->name, netdev);
80205 + if (r) {
80206 + printk(KERN_WARNING
80207 + "MSIX Request IRQ failed - Errno %d\n", r);
80208 + intx = 1;
80209 + pci_disable_msix(adapter->pdev);
80210 + adapter->msix_enabled = 0;
80211 + }
80212 + } else {
80213 + intx = 1;
80214 + }
80215 +
80216 + if (intx) {
80217 + r = request_irq(netdev->irq, be_int, IRQF_SHARED,
80218 + netdev->name, netdev);
80219 + if (r) {
80220 + printk(KERN_WARNING
80221 + "INTx Request IRQ failed - Errno %d\n", r);
80222 + return -1;
80223 + }
80224 + }
80225 + adapter->isr_registered = 1;
80226 + return 0;
80227 +}
80228 +
80229 +static void be_unregister_isr(struct be_adapter *adapter)
80230 +{
80231 + struct net_device *netdev = adapter->netdevp;
80232 + if (adapter->isr_registered) {
80233 + if (adapter->msix_enabled) {
80234 + free_irq(adapter->msix_entries[0].vector, netdev);
80235 + pci_disable_msix(adapter->pdev);
80236 + adapter->msix_enabled = 0;
80237 + } else {
80238 + free_irq(netdev->irq, netdev);
80239 + }
80240 + adapter->isr_registered = 0;
80241 + }
80242 +}
80243 +
80244 +/*
80245 + This function processes the Flush Completions that are issued by the
80246 + ARM F/W, when a Recv Ring is destroyed. A flush completion is
80247 + identified when a Rx COmpl descriptor has the tcpcksum and udpcksum
80248 + set and the pktsize is 32. These completions are received on the
80249 + Rx Completion Queue.
80250 +*/
80251 +static u32 be_process_rx_flush_cmpl(struct be_net_object *pnob)
80252 +{
80253 + struct ETH_RX_COMPL_AMAP *rxcp;
80254 + unsigned int i = 0;
80255 + while ((rxcp = be_get_rx_cmpl(pnob)) != NULL) {
80256 + be_notify_cmpl(pnob, 1, pnob->rx_cq_id, 1);
80257 + i++;
80258 + }
80259 + return i;
80260 +}
80261 +
80262 +static void be_tx_q_clean(struct be_net_object *pnob)
80263 +{
80264 + while (atomic_read(&pnob->tx_q_used))
80265 + process_one_tx_compl(pnob, tx_compl_lastwrb_idx_get(pnob));
80266 +}
80267 +
80268 +static void be_rx_q_clean(struct be_net_object *pnob)
80269 +{
80270 + if (pnob->rx_ctxt) {
80271 + int i;
80272 + struct be_rx_page_info *rx_page_info;
80273 + for (i = 0; i < pnob->rx_q_len; i++) {
80274 + rx_page_info = &(pnob->rx_page_info[i]);
80275 + if (!pnob->rx_pg_shared || rx_page_info->page_offset) {
80276 + pci_unmap_page(pnob->adapter->pdev,
80277 + pci_unmap_addr(rx_page_info, bus),
80278 + pnob->rx_buf_size,
80279 + PCI_DMA_FROMDEVICE);
80280 + }
80281 + if (rx_page_info->page)
80282 + put_page(rx_page_info->page);
80283 + memset(rx_page_info, 0, sizeof(struct be_rx_page_info));
80284 + }
80285 + pnob->rx_pg_info_hd = 0;
80286 + }
80287 +}
80288 +
80289 +static void be_destroy_netobj(struct be_net_object *pnob)
80290 +{
80291 + int status;
80292 +
80293 + if (pnob->tx_q_created) {
80294 + status = be_eth_sq_destroy(&pnob->tx_q_obj);
80295 + pnob->tx_q_created = 0;
80296 + }
80297 +
80298 + if (pnob->rx_q_created) {
80299 + status = be_eth_rq_destroy(&pnob->rx_q_obj);
80300 + if (status != 0) {
80301 + status = be_eth_rq_destroy_options(&pnob->rx_q_obj, 0,
80302 + NULL, NULL);
80303 + BUG_ON(status);
80304 + }
80305 + pnob->rx_q_created = 0;
80306 + }
80307 +
80308 + be_process_rx_flush_cmpl(pnob);
80309 +
80310 + if (pnob->tx_cq_created) {
80311 + status = be_cq_destroy(&pnob->tx_cq_obj);
80312 + pnob->tx_cq_created = 0;
80313 + }
80314 +
80315 + if (pnob->rx_cq_created) {
80316 + status = be_cq_destroy(&pnob->rx_cq_obj);
80317 + pnob->rx_cq_created = 0;
80318 + }
80319 +
80320 + if (pnob->mcc_q_created) {
80321 + status = be_mcc_ring_destroy(&pnob->mcc_q_obj);
80322 + pnob->mcc_q_created = 0;
80323 + }
80324 + if (pnob->mcc_cq_created) {
80325 + status = be_cq_destroy(&pnob->mcc_cq_obj);
80326 + pnob->mcc_cq_created = 0;
80327 + }
80328 +
80329 + if (pnob->event_q_created) {
80330 + status = be_eq_destroy(&pnob->event_q_obj);
80331 + pnob->event_q_created = 0;
80332 + }
80333 + be_function_cleanup(&pnob->fn_obj);
80334 +}
80335 +
80336 +/*
80337 + * free all resources associated with a pnob
80338 + * Called at the time of module cleanup as well a any error during
80339 + * module init. Some resources may be partially allocated in a NetObj.
80340 + */
80341 +static void netobject_cleanup(struct be_adapter *adapter,
80342 + struct be_net_object *pnob)
80343 +{
80344 + struct net_device *netdev = adapter->netdevp;
80345 +
80346 + if (netif_running(netdev)) {
80347 + netif_stop_queue(netdev);
80348 + be_wait_nic_tx_cmplx_cmpl(pnob);
80349 + be_disable_eq_intr(pnob);
80350 + }
80351 +
80352 + be_unregister_isr(adapter);
80353 +
80354 + if (adapter->tasklet_started) {
80355 + tasklet_kill(&(adapter->sts_handler));
80356 + adapter->tasklet_started = 0;
80357 + }
80358 + if (pnob->fn_obj_created)
80359 + be_disable_intr(pnob);
80360 +
80361 + if (adapter->dev_state != BE_DEV_STATE_NONE)
80362 + unregister_netdev(netdev);
80363 +
80364 + if (pnob->fn_obj_created)
80365 + be_destroy_netobj(pnob);
80366 +
80367 + adapter->net_obj = NULL;
80368 + adapter->netdevp = NULL;
80369 +
80370 + be_rx_q_clean(pnob);
80371 + if (pnob->rx_ctxt) {
80372 + kfree(pnob->rx_page_info);
80373 + kfree(pnob->rx_ctxt);
80374 + }
80375 +
80376 + be_tx_q_clean(pnob);
80377 + kfree(pnob->tx_ctxt);
80378 +
80379 + if (pnob->mcc_q)
80380 + pci_free_consistent(adapter->pdev, pnob->mcc_q_size,
80381 + pnob->mcc_q, pnob->mcc_q_bus);
80382 +
80383 + if (pnob->mcc_wrb_ctxt)
80384 + free_pages((unsigned long)pnob->mcc_wrb_ctxt,
80385 + get_order(pnob->mcc_wrb_ctxt_size));
80386 +
80387 + if (pnob->mcc_cq)
80388 + pci_free_consistent(adapter->pdev, pnob->mcc_cq_size,
80389 + pnob->mcc_cq, pnob->mcc_cq_bus);
80390 +
80391 + if (pnob->event_q)
80392 + pci_free_consistent(adapter->pdev, pnob->event_q_size,
80393 + pnob->event_q, pnob->event_q_bus);
80394 +
80395 + if (pnob->tx_cq)
80396 + pci_free_consistent(adapter->pdev, pnob->tx_cq_size,
80397 + pnob->tx_cq, pnob->tx_cq_bus);
80398 +
80399 + if (pnob->tx_q)
80400 + pci_free_consistent(adapter->pdev, pnob->tx_q_size,
80401 + pnob->tx_q, pnob->tx_q_bus);
80402 +
80403 + if (pnob->rx_q)
80404 + pci_free_consistent(adapter->pdev, pnob->rx_q_size,
80405 + pnob->rx_q, pnob->rx_q_bus);
80406 +
80407 + if (pnob->rx_cq)
80408 + pci_free_consistent(adapter->pdev, pnob->rx_cq_size,
80409 + pnob->rx_cq, pnob->rx_cq_bus);
80410 +
80411 +
80412 + if (pnob->mb_ptr)
80413 + pci_free_consistent(adapter->pdev, pnob->mb_size, pnob->mb_ptr,
80414 + pnob->mb_bus);
80415 +
80416 + free_netdev(netdev);
80417 +}
80418 +
80419 +
80420 +static int be_nob_ring_alloc(struct be_adapter *adapter,
80421 + struct be_net_object *pnob)
80422 +{
80423 + u32 size;
80424 +
80425 + /* Mail box rd; mailbox pointer needs to be 16 byte aligned */
80426 + pnob->mb_size = sizeof(struct MCC_MAILBOX_AMAP) + 16;
80427 + pnob->mb_ptr = pci_alloc_consistent(adapter->pdev, pnob->mb_size,
80428 + &pnob->mb_bus);
80429 + if (!pnob->mb_bus)
80430 + return -1;
80431 + memset(pnob->mb_ptr, 0, pnob->mb_size);
80432 + pnob->mb_rd.va = PTR_ALIGN(pnob->mb_ptr, 16);
80433 + pnob->mb_rd.pa = PTR_ALIGN(pnob->mb_bus, 16);
80434 + pnob->mb_rd.length = sizeof(struct MCC_MAILBOX_AMAP);
80435 + /*
80436 + * Event queue
80437 + */
80438 + pnob->event_q_len = EVENT_Q_LEN;
80439 + pnob->event_q_size = pnob->event_q_len * sizeof(struct EQ_ENTRY_AMAP);
80440 + pnob->event_q = pci_alloc_consistent(adapter->pdev, pnob->event_q_size,
80441 + &pnob->event_q_bus);
80442 + if (!pnob->event_q_bus)
80443 + return -1;
80444 + memset(pnob->event_q, 0, pnob->event_q_size);
80445 + /*
80446 + * Eth TX queue
80447 + */
80448 + pnob->tx_q_len = ETH_TXQ_LEN;
80449 + pnob->tx_q_port = 0;
80450 + pnob->tx_q_size = pnob->tx_q_len * sizeof(struct ETH_WRB_AMAP);
80451 + pnob->tx_q = pci_alloc_consistent(adapter->pdev, pnob->tx_q_size,
80452 + &pnob->tx_q_bus);
80453 + if (!pnob->tx_q_bus)
80454 + return -1;
80455 + memset(pnob->tx_q, 0, pnob->tx_q_size);
80456 + /*
80457 + * Eth TX Compl queue
80458 + */
80459 + pnob->txcq_len = ETH_TXCQ_LEN;
80460 + pnob->tx_cq_size = pnob->txcq_len * sizeof(struct ETH_TX_COMPL_AMAP);
80461 + pnob->tx_cq = pci_alloc_consistent(adapter->pdev, pnob->tx_cq_size,
80462 + &pnob->tx_cq_bus);
80463 + if (!pnob->tx_cq_bus)
80464 + return -1;
80465 + memset(pnob->tx_cq, 0, pnob->tx_cq_size);
80466 + /*
80467 + * Eth RX queue
80468 + */
80469 + pnob->rx_q_len = ETH_RXQ_LEN;
80470 + pnob->rx_q_size = pnob->rx_q_len * sizeof(struct ETH_RX_D_AMAP);
80471 + pnob->rx_q = pci_alloc_consistent(adapter->pdev, pnob->rx_q_size,
80472 + &pnob->rx_q_bus);
80473 + if (!pnob->rx_q_bus)
80474 + return -1;
80475 + memset(pnob->rx_q, 0, pnob->rx_q_size);
80476 + /*
80477 + * Eth Unicast RX Compl queue
80478 + */
80479 + pnob->rx_cq_len = ETH_UC_RXCQ_LEN;
80480 + pnob->rx_cq_size = pnob->rx_cq_len *
80481 + sizeof(struct ETH_RX_COMPL_AMAP);
80482 + pnob->rx_cq = pci_alloc_consistent(adapter->pdev, pnob->rx_cq_size,
80483 + &pnob->rx_cq_bus);
80484 + if (!pnob->rx_cq_bus)
80485 + return -1;
80486 + memset(pnob->rx_cq, 0, pnob->rx_cq_size);
80487 +
80488 + /* TX resources */
80489 + size = pnob->tx_q_len * sizeof(void **);
80490 + pnob->tx_ctxt = kzalloc(size, GFP_KERNEL);
80491 + if (pnob->tx_ctxt == NULL)
80492 + return -1;
80493 +
80494 + /* RX resources */
80495 + size = pnob->rx_q_len * sizeof(void *);
80496 + pnob->rx_ctxt = kzalloc(size, GFP_KERNEL);
80497 + if (pnob->rx_ctxt == NULL)
80498 + return -1;
80499 +
80500 + size = (pnob->rx_q_len * sizeof(struct be_rx_page_info));
80501 + pnob->rx_page_info = kzalloc(size, GFP_KERNEL);
80502 + if (pnob->rx_page_info == NULL)
80503 + return -1;
80504 +
80505 + adapter->eth_statsp = kzalloc(sizeof(struct FWCMD_ETH_GET_STATISTICS),
80506 + GFP_KERNEL);
80507 + if (adapter->eth_statsp == NULL)
80508 + return -1;
80509 + pnob->rx_buf_size = rxbuf_size;
80510 + return 0;
80511 +}
80512 +
80513 +/*
80514 + This function initializes the be_net_object for subsequent
80515 + network operations.
80516 +
80517 + Before calling this function, the driver must have allocated
80518 + space for the NetObject structure, initialized the structure,
80519 + allocated DMAable memory for all the network queues that form
80520 + part of the NetObject and populated the start address (virtual)
80521 + and number of entries allocated for each queue in the NetObject structure.
80522 +
80523 + The driver must also have allocated memory to hold the
80524 + mailbox structure (MCC_MAILBOX) and post the physical address,
80525 + virtual addresses and the size of the mailbox memory in the
80526 + NetObj.mb_rd. This structure is used by BECLIB for
80527 + initial communication with the embedded MCC processor. BECLIB
80528 + uses the mailbox until MCC rings are created for more efficient
80529 + communication with the MCC processor.
80530 +
80531 + If the driver wants to create multiple network interface for more
80532 + than one protection domain, it can call be_create_netobj()
80533 + multiple times once for each protection domain. A Maximum of
80534 + 32 protection domains are supported.
80535 +
80536 +*/
80537 +static int
80538 +be_create_netobj(struct be_net_object *pnob, u8 __iomem *csr_va,
80539 + u8 __iomem *db_va, u8 __iomem *pci_va)
80540 +{
80541 + int status = 0;
80542 + bool eventable = false, tx_no_delay = false, rx_no_delay = false;
80543 + struct be_eq_object *eq_objectp = NULL;
80544 + struct be_function_object *pfob = &pnob->fn_obj;
80545 + struct ring_desc rd;
80546 + u32 set_rxbuf_size;
80547 + u32 tx_cmpl_wm = CEV_WMARK_96; /* 0xffffffff to disable */
80548 + u32 rx_cmpl_wm = CEV_WMARK_160; /* 0xffffffff to disable */
80549 + u32 eq_delay = 0; /* delay in 8usec units. 0xffffffff to disable */
80550 +
80551 + memset(&rd, 0, sizeof(struct ring_desc));
80552 +
80553 + status = be_function_object_create(csr_va, db_va, pci_va,
80554 + BE_FUNCTION_TYPE_NETWORK, &pnob->mb_rd, pfob);
80555 + if (status != BE_SUCCESS)
80556 + return status;
80557 + pnob->fn_obj_created = true;
80558 +
80559 + if (tx_cmpl_wm == 0xffffffff)
80560 + tx_no_delay = true;
80561 + if (rx_cmpl_wm == 0xffffffff)
80562 + rx_no_delay = true;
80563 + /*
80564 + * now create the necessary rings
80565 + * Event Queue first.
80566 + */
80567 + if (pnob->event_q_len) {
80568 + rd.va = pnob->event_q;
80569 + rd.pa = pnob->event_q_bus;
80570 + rd.length = pnob->event_q_size;
80571 +
80572 + status = be_eq_create(pfob, &rd, 4, pnob->event_q_len,
80573 + (u32) -1, /* CEV_WMARK_* or -1 */
80574 + eq_delay, /* in 8us units, or -1 */
80575 + &pnob->event_q_obj);
80576 + if (status != BE_SUCCESS)
80577 + goto error_ret;
80578 + pnob->event_q_id = pnob->event_q_obj.eq_id;
80579 + pnob->event_q_created = 1;
80580 + eventable = true;
80581 + eq_objectp = &pnob->event_q_obj;
80582 + }
80583 + /*
80584 + * Now Eth Tx Compl. queue.
80585 + */
80586 + if (pnob->txcq_len) {
80587 + rd.va = pnob->tx_cq;
80588 + rd.pa = pnob->tx_cq_bus;
80589 + rd.length = pnob->tx_cq_size;
80590 +
80591 + status = be_cq_create(pfob, &rd,
80592 + pnob->txcq_len * sizeof(struct ETH_TX_COMPL_AMAP),
80593 + false, /* solicted events, */
80594 + tx_no_delay, /* nodelay */
80595 + tx_cmpl_wm, /* Watermark encodings */
80596 + eq_objectp, &pnob->tx_cq_obj);
80597 + if (status != BE_SUCCESS)
80598 + goto error_ret;
80599 +
80600 + pnob->tx_cq_id = pnob->tx_cq_obj.cq_id;
80601 + pnob->tx_cq_created = 1;
80602 + }
80603 + /*
80604 + * Eth Tx queue
80605 + */
80606 + if (pnob->tx_q_len) {
80607 + struct be_eth_sq_parameters ex_params = { 0 };
80608 + u32 type;
80609 +
80610 + if (pnob->tx_q_port) {
80611 + /* TXQ to be bound to a specific port */
80612 + type = BE_ETH_TX_RING_TYPE_BOUND;
80613 + ex_params.port = pnob->tx_q_port - 1;
80614 + } else
80615 + type = BE_ETH_TX_RING_TYPE_STANDARD;
80616 +
80617 + rd.va = pnob->tx_q;
80618 + rd.pa = pnob->tx_q_bus;
80619 + rd.length = pnob->tx_q_size;
80620 +
80621 + status = be_eth_sq_create_ex(pfob, &rd,
80622 + pnob->tx_q_len * sizeof(struct ETH_WRB_AMAP),
80623 + type, 2, &pnob->tx_cq_obj,
80624 + &ex_params, &pnob->tx_q_obj);
80625 +
80626 + if (status != BE_SUCCESS)
80627 + goto error_ret;
80628 +
80629 + pnob->tx_q_id = pnob->tx_q_obj.bid;
80630 + pnob->tx_q_created = 1;
80631 + }
80632 + /*
80633 + * Now Eth Rx compl. queue. Always needed.
80634 + */
80635 + rd.va = pnob->rx_cq;
80636 + rd.pa = pnob->rx_cq_bus;
80637 + rd.length = pnob->rx_cq_size;
80638 +
80639 + status = be_cq_create(pfob, &rd,
80640 + pnob->rx_cq_len * sizeof(struct ETH_RX_COMPL_AMAP),
80641 + false, /* solicted events, */
80642 + rx_no_delay, /* nodelay */
80643 + rx_cmpl_wm, /* Watermark encodings */
80644 + eq_objectp, &pnob->rx_cq_obj);
80645 + if (status != BE_SUCCESS)
80646 + goto error_ret;
80647 +
80648 + pnob->rx_cq_id = pnob->rx_cq_obj.cq_id;
80649 + pnob->rx_cq_created = 1;
80650 +
80651 + status = be_eth_rq_set_frag_size(pfob, pnob->rx_buf_size,
80652 + (u32 *) &set_rxbuf_size);
80653 + if (status != BE_SUCCESS) {
80654 + be_eth_rq_get_frag_size(pfob, (u32 *) &pnob->rx_buf_size);
80655 + if ((pnob->rx_buf_size != 2048) && (pnob->rx_buf_size != 4096)
80656 + && (pnob->rx_buf_size != 8192))
80657 + goto error_ret;
80658 + } else {
80659 + if (pnob->rx_buf_size != set_rxbuf_size)
80660 + pnob->rx_buf_size = set_rxbuf_size;
80661 + }
80662 + /*
80663 + * Eth RX queue. be_eth_rq_create() always assumes 2 pages size
80664 + */
80665 + rd.va = pnob->rx_q;
80666 + rd.pa = pnob->rx_q_bus;
80667 + rd.length = pnob->rx_q_size;
80668 +
80669 + status = be_eth_rq_create(pfob, &rd, &pnob->rx_cq_obj,
80670 + &pnob->rx_cq_obj, &pnob->rx_q_obj);
80671 +
80672 + if (status != BE_SUCCESS)
80673 + goto error_ret;
80674 +
80675 + pnob->rx_q_id = pnob->rx_q_obj.rid;
80676 + pnob->rx_q_created = 1;
80677 +
80678 + return BE_SUCCESS; /* All required queues created. */
80679 +
80680 +error_ret:
80681 + be_destroy_netobj(pnob);
80682 + return status;
80683 +}
80684 +
80685 +static int be_nob_ring_init(struct be_adapter *adapter,
80686 + struct be_net_object *pnob)
80687 +{
80688 + int status;
80689 +
80690 + pnob->event_q_tl = 0;
80691 +
80692 + pnob->tx_q_hd = 0;
80693 + pnob->tx_q_tl = 0;
80694 +
80695 + pnob->tx_cq_tl = 0;
80696 +
80697 + pnob->rx_cq_tl = 0;
80698 +
80699 + memset(pnob->event_q, 0, pnob->event_q_size);
80700 + memset(pnob->tx_cq, 0, pnob->tx_cq_size);
80701 + memset(pnob->tx_ctxt, 0, pnob->tx_q_len * sizeof(void **));
80702 + memset(pnob->rx_ctxt, 0, pnob->rx_q_len * sizeof(void *));
80703 + pnob->rx_pg_info_hd = 0;
80704 + pnob->rx_q_hd = 0;
80705 + atomic_set(&pnob->rx_q_posted, 0);
80706 +
80707 + status = be_create_netobj(pnob, adapter->csr_va, adapter->db_va,
80708 + adapter->pci_va);
80709 + if (status != BE_SUCCESS)
80710 + return -1;
80711 +
80712 + be_post_eth_rx_buffs(pnob);
80713 + return 0;
80714 +}
80715 +
80716 +/* This function handles async callback for link status */
80717 +static void
80718 +be_link_status_async_callback(void *context, u32 event_code, void *event)
80719 +{
80720 + struct ASYNC_EVENT_LINK_STATE_AMAP *link_status = event;
80721 + struct be_adapter *adapter = context;
80722 + bool link_enable = false;
80723 + struct be_net_object *pnob;
80724 + struct ASYNC_EVENT_TRAILER_AMAP *async_trailer;
80725 + struct net_device *netdev;
80726 + u32 async_event_code, async_event_type, active_port;
80727 + u32 port0_link_status, port1_link_status, port0_duplex, port1_duplex;
80728 + u32 port0_speed, port1_speed;
80729 +
80730 + if (event_code != ASYNC_EVENT_CODE_LINK_STATE) {
80731 + /* Not our event to handle */
80732 + return;
80733 + }
80734 + async_trailer = (struct ASYNC_EVENT_TRAILER_AMAP *)
80735 + ((u8 *) event + sizeof(struct MCC_CQ_ENTRY_AMAP) -
80736 + sizeof(struct ASYNC_EVENT_TRAILER_AMAP));
80737 +
80738 + async_event_code = AMAP_GET_BITS_PTR(ASYNC_EVENT_TRAILER, event_code,
80739 + async_trailer);
80740 + BUG_ON(async_event_code != ASYNC_EVENT_CODE_LINK_STATE);
80741 +
80742 + pnob = adapter->net_obj;
80743 + netdev = pnob->netdev;
80744 +
80745 + /* Determine if this event is a switch VLD or a physical link event */
80746 + async_event_type = AMAP_GET_BITS_PTR(ASYNC_EVENT_TRAILER, event_type,
80747 + async_trailer);
80748 + active_port = AMAP_GET_BITS_PTR(ASYNC_EVENT_LINK_STATE,
80749 + active_port, link_status);
80750 + port0_link_status = AMAP_GET_BITS_PTR(ASYNC_EVENT_LINK_STATE,
80751 + port0_link_status, link_status);
80752 + port1_link_status = AMAP_GET_BITS_PTR(ASYNC_EVENT_LINK_STATE,
80753 + port1_link_status, link_status);
80754 + port0_duplex = AMAP_GET_BITS_PTR(ASYNC_EVENT_LINK_STATE,
80755 + port0_duplex, link_status);
80756 + port1_duplex = AMAP_GET_BITS_PTR(ASYNC_EVENT_LINK_STATE,
80757 + port1_duplex, link_status);
80758 + port0_speed = AMAP_GET_BITS_PTR(ASYNC_EVENT_LINK_STATE,
80759 + port0_speed, link_status);
80760 + port1_speed = AMAP_GET_BITS_PTR(ASYNC_EVENT_LINK_STATE,
80761 + port1_speed, link_status);
80762 + if (async_event_type == NTWK_LINK_TYPE_VIRTUAL) {
80763 + adapter->be_stat.bes_link_change_virtual++;
80764 + if (adapter->be_link_sts->active_port != active_port) {
80765 + dev_notice(&netdev->dev,
80766 + "Active port changed due to VLD on switch\n");
80767 + } else {
80768 + dev_notice(&netdev->dev, "Link status update\n");
80769 + }
80770 +
80771 + } else {
80772 + adapter->be_stat.bes_link_change_physical++;
80773 + if (adapter->be_link_sts->active_port != active_port) {
80774 + dev_notice(&netdev->dev,
80775 + "Active port changed due to port link"
80776 + " status change\n");
80777 + } else {
80778 + dev_notice(&netdev->dev, "Link status update\n");
80779 + }
80780 + }
80781 +
80782 + memset(adapter->be_link_sts, 0, sizeof(adapter->be_link_sts));
80783 +
80784 + if ((port0_link_status == ASYNC_EVENT_LINK_UP) ||
80785 + (port1_link_status == ASYNC_EVENT_LINK_UP)) {
80786 + if ((adapter->port0_link_sts == BE_PORT_LINK_DOWN) &&
80787 + (adapter->port1_link_sts == BE_PORT_LINK_DOWN)) {
80788 + /* Earlier both the ports are down So link is up */
80789 + link_enable = true;
80790 + }
80791 +
80792 + if (port0_link_status == ASYNC_EVENT_LINK_UP) {
80793 + adapter->port0_link_sts = BE_PORT_LINK_UP;
80794 + adapter->be_link_sts->mac0_duplex = port0_duplex;
80795 + adapter->be_link_sts->mac0_speed = port0_speed;
80796 + if (active_port == NTWK_PORT_A)
80797 + adapter->be_link_sts->active_port = 0;
80798 + } else
80799 + adapter->port0_link_sts = BE_PORT_LINK_DOWN;
80800 +
80801 + if (port1_link_status == ASYNC_EVENT_LINK_UP) {
80802 + adapter->port1_link_sts = BE_PORT_LINK_UP;
80803 + adapter->be_link_sts->mac1_duplex = port1_duplex;
80804 + adapter->be_link_sts->mac1_speed = port1_speed;
80805 + if (active_port == NTWK_PORT_B)
80806 + adapter->be_link_sts->active_port = 1;
80807 + } else
80808 + adapter->port1_link_sts = BE_PORT_LINK_DOWN;
80809 +
80810 + printk(KERN_INFO "Link Properties for %s:\n", netdev->name);
80811 + dev_info(&netdev->dev, "Link Properties:\n");
80812 + be_print_link_info(adapter->be_link_sts);
80813 +
80814 + if (!link_enable)
80815 + return;
80816 + /*
80817 + * Both ports were down previously, but atleast one of
80818 + * them has come up if this netdevice's carrier is not up,
80819 + * then indicate to stack
80820 + */
80821 + if (!netif_carrier_ok(netdev)) {
80822 + netif_start_queue(netdev);
80823 + netif_carrier_on(netdev);
80824 + }
80825 + return;
80826 + }
80827 +
80828 + /* Now both the ports are down. Tell the stack about it */
80829 + dev_info(&netdev->dev, "Both ports are down\n");
80830 + adapter->port0_link_sts = BE_PORT_LINK_DOWN;
80831 + adapter->port1_link_sts = BE_PORT_LINK_DOWN;
80832 + if (netif_carrier_ok(netdev)) {
80833 + netif_carrier_off(netdev);
80834 + netif_stop_queue(netdev);
80835 + }
80836 + return;
80837 +}
80838 +
80839 +static int be_mcc_create(struct be_adapter *adapter)
80840 +{
80841 + struct be_net_object *pnob;
80842 +
80843 + pnob = adapter->net_obj;
80844 + /*
80845 + * Create the MCC ring so that all further communication with
80846 + * MCC can go thru the ring. we do this at the end since
80847 + * we do not want to be dealing with interrupts until the
80848 + * initialization is complete.
80849 + */
80850 + pnob->mcc_q_len = MCC_Q_LEN;
80851 + pnob->mcc_q_size = pnob->mcc_q_len * sizeof(struct MCC_WRB_AMAP);
80852 + pnob->mcc_q = pci_alloc_consistent(adapter->pdev, pnob->mcc_q_size,
80853 + &pnob->mcc_q_bus);
80854 + if (!pnob->mcc_q_bus)
80855 + return -1;
80856 + /*
80857 + * space for MCC WRB context
80858 + */
80859 + pnob->mcc_wrb_ctxtLen = MCC_Q_LEN;
80860 + pnob->mcc_wrb_ctxt_size = pnob->mcc_wrb_ctxtLen *
80861 + sizeof(struct be_mcc_wrb_context);
80862 + pnob->mcc_wrb_ctxt = (void *)__get_free_pages(GFP_KERNEL,
80863 + get_order(pnob->mcc_wrb_ctxt_size));
80864 + if (pnob->mcc_wrb_ctxt == NULL)
80865 + return -1;
80866 + /*
80867 + * Space for MCC compl. ring
80868 + */
80869 + pnob->mcc_cq_len = MCC_CQ_LEN;
80870 + pnob->mcc_cq_size = pnob->mcc_cq_len * sizeof(struct MCC_CQ_ENTRY_AMAP);
80871 + pnob->mcc_cq = pci_alloc_consistent(adapter->pdev, pnob->mcc_cq_size,
80872 + &pnob->mcc_cq_bus);
80873 + if (!pnob->mcc_cq_bus)
80874 + return -1;
80875 + return 0;
80876 +}
80877 +
80878 +/*
80879 + This function creates the MCC request and completion ring required
80880 + for communicating with the ARM processor. The caller must have
80881 + allocated required amount of memory for the MCC ring and MCC
80882 + completion ring and posted the virtual address and number of
80883 + entries in the corresponding members (mcc_q and mcc_cq) in the
80884 + NetObject struture.
80885 +
80886 + When this call is completed, all further communication with
80887 + ARM will switch from mailbox to this ring.
80888 +
80889 + pnob - Pointer to the NetObject structure. This NetObject should
80890 + have been created using a previous call to be_create_netobj()
80891 +*/
80892 +int be_create_mcc_rings(struct be_net_object *pnob)
80893 +{
80894 + int status = 0;
80895 + struct ring_desc rd;
80896 + struct be_function_object *pfob = &pnob->fn_obj;
80897 +
80898 + memset(&rd, 0, sizeof(struct ring_desc));
80899 + if (pnob->mcc_cq_len) {
80900 + rd.va = pnob->mcc_cq;
80901 + rd.pa = pnob->mcc_cq_bus;
80902 + rd.length = pnob->mcc_cq_size;
80903 +
80904 + status = be_cq_create(pfob, &rd,
80905 + pnob->mcc_cq_len * sizeof(struct MCC_CQ_ENTRY_AMAP),
80906 + false, /* solicted events, */
80907 + true, /* nodelay */
80908 + 0, /* 0 Watermark since Nodelay is true */
80909 + &pnob->event_q_obj,
80910 + &pnob->mcc_cq_obj);
80911 +
80912 + if (status != BE_SUCCESS)
80913 + return status;
80914 +
80915 + pnob->mcc_cq_id = pnob->mcc_cq_obj.cq_id;
80916 + pnob->mcc_cq_created = 1;
80917 + }
80918 + if (pnob->mcc_q_len) {
80919 + rd.va = pnob->mcc_q;
80920 + rd.pa = pnob->mcc_q_bus;
80921 + rd.length = pnob->mcc_q_size;
80922 +
80923 + status = be_mcc_ring_create(pfob, &rd,
80924 + pnob->mcc_q_len * sizeof(struct MCC_WRB_AMAP),
80925 + pnob->mcc_wrb_ctxt, pnob->mcc_wrb_ctxtLen,
80926 + &pnob->mcc_cq_obj, &pnob->mcc_q_obj);
80927 +
80928 + if (status != BE_SUCCESS)
80929 + return status;
80930 +
80931 + pnob->mcc_q_created = 1;
80932 + }
80933 + return BE_SUCCESS;
80934 +}
80935 +
80936 +static int be_mcc_init(struct be_adapter *adapter)
80937 +{
80938 + u32 r;
80939 + struct be_net_object *pnob;
80940 +
80941 + pnob = adapter->net_obj;
80942 + memset(pnob->mcc_q, 0, pnob->mcc_q_size);
80943 + pnob->mcc_q_hd = 0;
80944 +
80945 + memset(pnob->mcc_wrb_ctxt, 0, pnob->mcc_wrb_ctxt_size);
80946 +
80947 + memset(pnob->mcc_cq, 0, pnob->mcc_cq_size);
80948 + pnob->mcc_cq_tl = 0;
80949 +
80950 + r = be_create_mcc_rings(adapter->net_obj);
80951 + if (r != BE_SUCCESS)
80952 + return -1;
80953 +
80954 + return 0;
80955 +}
80956 +
80957 +static void be_remove(struct pci_dev *pdev)
80958 +{
80959 + struct be_net_object *pnob;
80960 + struct be_adapter *adapter;
80961 +
80962 + adapter = pci_get_drvdata(pdev);
80963 + if (!adapter)
80964 + return;
80965 +
80966 + pci_set_drvdata(pdev, NULL);
80967 + pnob = (struct be_net_object *)adapter->net_obj;
80968 +
80969 + flush_scheduled_work();
80970 +
80971 + if (pnob) {
80972 + /* Unregister async callback function for link status updates */
80973 + if (pnob->mcc_q_created)
80974 + be_mcc_add_async_event_callback(&pnob->mcc_q_obj,
80975 + NULL, NULL);
80976 + netobject_cleanup(adapter, pnob);
80977 + }
80978 +
80979 + if (adapter->csr_va)
80980 + iounmap(adapter->csr_va);
80981 + if (adapter->db_va)
80982 + iounmap(adapter->db_va);
80983 + if (adapter->pci_va)
80984 + iounmap(adapter->pci_va);
80985 +
80986 + pci_release_regions(adapter->pdev);
80987 + pci_disable_device(adapter->pdev);
80988 +
80989 + kfree(adapter->be_link_sts);
80990 + kfree(adapter->eth_statsp);
80991 +
80992 + if (adapter->timer_ctxt.get_stats_timer.function)
80993 + del_timer_sync(&adapter->timer_ctxt.get_stats_timer);
80994 + kfree(adapter);
80995 +}
80996 +
80997 +/*
80998 + * This function is called by the PCI sub-system when it finds a PCI
80999 + * device with dev/vendor IDs that match with one of our devices.
81000 + * All of the driver initialization is done in this function.
81001 + */
81002 +static int be_probe(struct pci_dev *pdev, const struct pci_device_id *pdev_id)
81003 +{
81004 + int status = 0;
81005 + struct be_adapter *adapter;
81006 + struct FWCMD_COMMON_GET_FW_VERSION_RESPONSE_PAYLOAD get_fwv;
81007 + struct be_net_object *pnob;
81008 + struct net_device *netdev;
81009 +
81010 + status = pci_enable_device(pdev);
81011 + if (status)
81012 + goto error;
81013 +
81014 + status = pci_request_regions(pdev, be_driver_name);
81015 + if (status)
81016 + goto error_pci_req;
81017 +
81018 + pci_set_master(pdev);
81019 + adapter = kzalloc(sizeof(struct be_adapter), GFP_KERNEL);
81020 + if (adapter == NULL) {
81021 + status = -ENOMEM;
81022 + goto error_adapter;
81023 + }
81024 + adapter->dev_state = BE_DEV_STATE_NONE;
81025 + adapter->pdev = pdev;
81026 + pci_set_drvdata(pdev, adapter);
81027 +
81028 + adapter->enable_aic = 1;
81029 + adapter->max_eqd = MAX_EQD;
81030 + adapter->min_eqd = 0;
81031 + adapter->cur_eqd = 0;
81032 +
81033 + status = pci_set_dma_mask(pdev, DMA_64BIT_MASK);
81034 + if (!status) {
81035 + adapter->dma_64bit_cap = true;
81036 + } else {
81037 + adapter->dma_64bit_cap = false;
81038 + status = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
81039 + if (status != 0) {
81040 + printk(KERN_ERR "Could not set PCI DMA Mask\n");
81041 + goto cleanup;
81042 + }
81043 + }
81044 +
81045 + status = init_pci_be_function(adapter, pdev);
81046 + if (status != 0) {
81047 + printk(KERN_ERR "Failed to map PCI BARS\n");
81048 + status = -ENOMEM;
81049 + goto cleanup;
81050 + }
81051 +
81052 + be_trace_set_level(DL_ALWAYS | DL_ERR);
81053 +
81054 + adapter->be_link_sts = kmalloc(sizeof(struct BE_LINK_STATUS),
81055 + GFP_KERNEL);
81056 + if (adapter->be_link_sts == NULL) {
81057 + printk(KERN_ERR "Memory allocation for link status "
81058 + "buffer failed\n");
81059 + goto cleanup;
81060 + }
81061 + spin_lock_init(&adapter->txq_lock);
81062 +
81063 + netdev = alloc_etherdev(sizeof(struct be_net_object));
81064 + if (netdev == NULL) {
81065 + status = -ENOMEM;
81066 + goto cleanup;
81067 + }
81068 + pnob = netdev_priv(netdev);
81069 + adapter->net_obj = pnob;
81070 + adapter->netdevp = netdev;
81071 + pnob->adapter = adapter;
81072 + pnob->netdev = netdev;
81073 +
81074 + status = be_nob_ring_alloc(adapter, pnob);
81075 + if (status != 0)
81076 + goto cleanup;
81077 +
81078 + status = be_nob_ring_init(adapter, pnob);
81079 + if (status != 0)
81080 + goto cleanup;
81081 +
81082 + be_rxf_mac_address_read_write(&pnob->fn_obj, false, false, false,
81083 + false, false, netdev->dev_addr, NULL, NULL);
81084 +
81085 + netdev->init = &benet_init;
81086 + netif_carrier_off(netdev);
81087 + netif_stop_queue(netdev);
81088 +
81089 + SET_NETDEV_DEV(netdev, &(adapter->pdev->dev));
81090 +
81091 + netif_napi_add(netdev, &pnob->napi, be_poll, 64);
81092 +
81093 + /* if the rx_frag size if 2K, one page is shared as two RX frags */
81094 + pnob->rx_pg_shared =
81095 + (pnob->rx_buf_size <= PAGE_SIZE / 2) ? true : false;
81096 + if (pnob->rx_buf_size != rxbuf_size) {
81097 + printk(KERN_WARNING
81098 + "Could not set Rx buffer size to %d. Using %d\n",
81099 + rxbuf_size, pnob->rx_buf_size);
81100 + rxbuf_size = pnob->rx_buf_size;
81101 + }
81102 +
81103 + tasklet_init(&(adapter->sts_handler), be_process_intr,
81104 + (unsigned long)adapter);
81105 + adapter->tasklet_started = 1;
81106 + spin_lock_init(&(adapter->int_lock));
81107 +
81108 + status = be_register_isr(adapter, pnob);
81109 + if (status != 0)
81110 + goto cleanup;
81111 +
81112 + adapter->rx_csum = 1;
81113 + adapter->max_rx_coal = BE_LRO_MAX_PKTS;
81114 +
81115 + memset(&get_fwv, 0,
81116 + sizeof(struct FWCMD_COMMON_GET_FW_VERSION_RESPONSE_PAYLOAD));
81117 + printk(KERN_INFO "BladeEngine Driver version:%s. "
81118 + "Copyright ServerEngines, Corporation 2005 - 2008\n",
81119 + be_drvr_ver);
81120 + status = be_function_get_fw_version(&pnob->fn_obj, &get_fwv, NULL,
81121 + NULL);
81122 + if (status == BE_SUCCESS) {
81123 + strncpy(be_fw_ver, get_fwv.firmware_version_string, 32);
81124 + printk(KERN_INFO "BladeEngine Firmware Version:%s\n",
81125 + get_fwv.firmware_version_string);
81126 + } else {
81127 + printk(KERN_WARNING "Unable to get BE Firmware Version\n");
81128 + }
81129 +
81130 + sema_init(&adapter->get_eth_stat_sem, 0);
81131 + init_timer(&adapter->timer_ctxt.get_stats_timer);
81132 + atomic_set(&adapter->timer_ctxt.get_stat_flag, 0);
81133 + adapter->timer_ctxt.get_stats_timer.function =
81134 + &be_get_stats_timer_handler;
81135 +
81136 + status = be_mcc_create(adapter);
81137 + if (status < 0)
81138 + goto cleanup;
81139 + status = be_mcc_init(adapter);
81140 + if (status < 0)
81141 + goto cleanup;
81142 +
81143 +
81144 + status = be_mcc_add_async_event_callback(&adapter->net_obj->mcc_q_obj,
81145 + be_link_status_async_callback, (void *)adapter);
81146 + if (status != BE_SUCCESS) {
81147 + printk(KERN_WARNING "add_async_event_callback failed");
81148 + printk(KERN_WARNING
81149 + "Link status changes may not be reflected\n");
81150 + }
81151 +
81152 + status = register_netdev(netdev);
81153 + if (status != 0)
81154 + goto cleanup;
81155 + be_update_link_status(adapter);
81156 + adapter->dev_state = BE_DEV_STATE_INIT;
81157 + return 0;
81158 +
81159 +cleanup:
81160 + be_remove(pdev);
81161 + return status;
81162 +error_adapter:
81163 + pci_release_regions(pdev);
81164 +error_pci_req:
81165 + pci_disable_device(pdev);
81166 +error:
81167 + printk(KERN_ERR "BladeEngine initalization failed\n");
81168 + return status;
81169 +}
81170 +
81171 +/*
81172 + * Get the current link status and print the status on console
81173 + */
81174 +void be_update_link_status(struct be_adapter *adapter)
81175 +{
81176 + int status;
81177 + struct be_net_object *pnob = adapter->net_obj;
81178 +
81179 + status = be_rxf_link_status(&pnob->fn_obj, adapter->be_link_sts, NULL,
81180 + NULL, NULL);
81181 + if (status == BE_SUCCESS) {
81182 + if (adapter->be_link_sts->mac0_speed &&
81183 + adapter->be_link_sts->mac0_duplex)
81184 + adapter->port0_link_sts = BE_PORT_LINK_UP;
81185 + else
81186 + adapter->port0_link_sts = BE_PORT_LINK_DOWN;
81187 +
81188 + if (adapter->be_link_sts->mac1_speed &&
81189 + adapter->be_link_sts->mac1_duplex)
81190 + adapter->port1_link_sts = BE_PORT_LINK_UP;
81191 + else
81192 + adapter->port1_link_sts = BE_PORT_LINK_DOWN;
81193 +
81194 + dev_info(&pnob->netdev->dev, "Link Properties:\n");
81195 + be_print_link_info(adapter->be_link_sts);
81196 + return;
81197 + }
81198 + dev_info(&pnob->netdev->dev, "Could not get link status\n");
81199 + return;
81200 +}
81201 +
81202 +
81203 +#ifdef CONFIG_PM
81204 +static void
81205 +be_pm_cleanup(struct be_adapter *adapter,
81206 + struct be_net_object *pnob, struct net_device *netdev)
81207 +{
81208 + netif_carrier_off(netdev);
81209 + netif_stop_queue(netdev);
81210 +
81211 + be_wait_nic_tx_cmplx_cmpl(pnob);
81212 + be_disable_eq_intr(pnob);
81213 +
81214 + if (adapter->tasklet_started) {
81215 + tasklet_kill(&adapter->sts_handler);
81216 + adapter->tasklet_started = 0;
81217 + }
81218 +
81219 + be_unregister_isr(adapter);
81220 + be_disable_intr(pnob);
81221 +
81222 + be_tx_q_clean(pnob);
81223 + be_rx_q_clean(pnob);
81224 +
81225 + be_destroy_netobj(pnob);
81226 +}
81227 +
81228 +static int be_suspend(struct pci_dev *pdev, pm_message_t state)
81229 +{
81230 + struct be_adapter *adapter = pci_get_drvdata(pdev);
81231 + struct net_device *netdev = adapter->netdevp;
81232 + struct be_net_object *pnob = netdev_priv(netdev);
81233 +
81234 + adapter->dev_pm_state = adapter->dev_state;
81235 + adapter->dev_state = BE_DEV_STATE_SUSPEND;
81236 +
81237 + netif_device_detach(netdev);
81238 + if (netif_running(netdev))
81239 + be_pm_cleanup(adapter, pnob, netdev);
81240 +
81241 + pci_enable_wake(pdev, 3, 1);
81242 + pci_enable_wake(pdev, 4, 1); /* D3 Cold = 4 */
81243 + pci_save_state(pdev);
81244 + pci_disable_device(pdev);
81245 + pci_set_power_state(pdev, pci_choose_state(pdev, state));
81246 + return 0;
81247 +}
81248 +
81249 +static void be_up(struct be_adapter *adapter)
81250 +{
81251 + struct be_net_object *pnob = adapter->net_obj;
81252 +
81253 + if (pnob->num_vlans != 0)
81254 + be_rxf_vlan_config(&pnob->fn_obj, false, pnob->num_vlans,
81255 + pnob->vlan_tag, NULL, NULL, NULL);
81256 +
81257 +}
81258 +
81259 +static int be_resume(struct pci_dev *pdev)
81260 +{
81261 + int status = 0;
81262 + struct be_adapter *adapter = pci_get_drvdata(pdev);
81263 + struct net_device *netdev = adapter->netdevp;
81264 + struct be_net_object *pnob = netdev_priv(netdev);
81265 +
81266 + netif_device_detach(netdev);
81267 +
81268 + status = pci_enable_device(pdev);
81269 + if (status)
81270 + return status;
81271 +
81272 + pci_set_power_state(pdev, 0);
81273 + pci_restore_state(pdev);
81274 + pci_enable_wake(pdev, 3, 0);
81275 + pci_enable_wake(pdev, 4, 0); /* 4 is D3 cold */
81276 +
81277 + netif_carrier_on(netdev);
81278 + netif_start_queue(netdev);
81279 +
81280 + if (netif_running(netdev)) {
81281 + be_rxf_mac_address_read_write(&pnob->fn_obj, false, false,
81282 + false, true, false, netdev->dev_addr, NULL, NULL);
81283 +
81284 + status = be_nob_ring_init(adapter, pnob);
81285 + if (status < 0)
81286 + return status;
81287 +
81288 + tasklet_init(&(adapter->sts_handler), be_process_intr,
81289 + (unsigned long)adapter);
81290 + adapter->tasklet_started = 1;
81291 +
81292 + if (be_register_isr(adapter, pnob) != 0) {
81293 + printk(KERN_ERR "be_register_isr failed\n");
81294 + return status;
81295 + }
81296 +
81297 +
81298 + status = be_mcc_init(adapter);
81299 + if (status < 0) {
81300 + printk(KERN_ERR "be_mcc_init failed\n");
81301 + return status;
81302 + }
81303 + be_update_link_status(adapter);
81304 + /*
81305 + * Register async call back function to handle link
81306 + * status updates
81307 + */
81308 + status = be_mcc_add_async_event_callback(
81309 + &adapter->net_obj->mcc_q_obj,
81310 + be_link_status_async_callback, (void *)adapter);
81311 + if (status != BE_SUCCESS) {
81312 + printk(KERN_WARNING "add_async_event_callback failed");
81313 + printk(KERN_WARNING
81314 + "Link status changes may not be reflected\n");
81315 + }
81316 + be_enable_intr(pnob);
81317 + be_enable_eq_intr(pnob);
81318 + be_up(adapter);
81319 + }
81320 + netif_device_attach(netdev);
81321 + adapter->dev_state = adapter->dev_pm_state;
81322 + return 0;
81323 +
81324 +}
81325 +
81326 +#endif
81327 +
81328 +/* Wait until no more pending transmits */
81329 +void be_wait_nic_tx_cmplx_cmpl(struct be_net_object *pnob)
81330 +{
81331 + int i;
81332 +
81333 + /* Wait for 20us * 50000 (= 1s) and no more */
81334 + i = 0;
81335 + while ((pnob->tx_q_tl != pnob->tx_q_hd) && (i < 50000)) {
81336 + ++i;
81337 + udelay(20);
81338 + }
81339 +
81340 + /* Check for no more pending transmits */
81341 + if (i >= 50000) {
81342 + printk(KERN_WARNING
81343 + "Did not receive completions for all TX requests\n");
81344 + }
81345 +}
81346 +
81347 +static struct pci_driver be_driver = {
81348 + .name = be_driver_name,
81349 + .id_table = be_device_id_table,
81350 + .probe = be_probe,
81351 +#ifdef CONFIG_PM
81352 + .suspend = be_suspend,
81353 + .resume = be_resume,
81354 +#endif
81355 + .remove = be_remove
81356 +};
81357 +
81358 +/*
81359 + * Module init entry point. Registers our our device and return.
81360 + * Our probe will be called if the device is found.
81361 + */
81362 +static int __init be_init_module(void)
81363 +{
81364 + int ret;
81365 +
81366 + if (rxbuf_size != 8192 && rxbuf_size != 4096 && rxbuf_size != 2048) {
81367 + printk(KERN_WARNING
81368 + "Unsupported receive buffer size (%d) requested\n",
81369 + rxbuf_size);
81370 + printk(KERN_WARNING
81371 + "Must be 2048, 4096 or 8192. Defaulting to 2048\n");
81372 + rxbuf_size = 2048;
81373 + }
81374 +
81375 + ret = pci_register_driver(&be_driver);
81376 +
81377 + return ret;
81378 +}
81379 +
81380 +module_init(be_init_module);
81381 +
81382 +/*
81383 + * be_exit_module - Driver Exit Cleanup Routine
81384 + */
81385 +static void __exit be_exit_module(void)
81386 +{
81387 + pci_unregister_driver(&be_driver);
81388 +}
81389 +
81390 +module_exit(be_exit_module);
81391 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/be_int.c linux-2.6.29-rc3.owrt/drivers/staging/benet/be_int.c
81392 --- linux-2.6.29.owrt/drivers/staging/benet/be_int.c 1970-01-01 01:00:00.000000000 +0100
81393 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/be_int.c 2009-05-10 23:48:29.000000000 +0200
81394 @@ -0,0 +1,863 @@
81395 +/*
81396 + * Copyright (C) 2005 - 2008 ServerEngines
81397 + * All rights reserved.
81398 + *
81399 + * This program is free software; you can redistribute it and/or
81400 + * modify it under the terms of the GNU General Public License version 2
81401 + * as published by the Free Software Foundation. The full GNU General
81402 + * Public License is included in this distribution in the file called COPYING.
81403 + *
81404 + * Contact Information:
81405 + * linux-drivers@serverengines.com
81406 + *
81407 + * ServerEngines
81408 + * 209 N. Fair Oaks Ave
81409 + * Sunnyvale, CA 94085
81410 + */
81411 +#include <linux/if_vlan.h>
81412 +#include <linux/inet_lro.h>
81413 +
81414 +#include "benet.h"
81415 +
81416 +/* number of bytes of RX frame that are copied to skb->data */
81417 +#define BE_HDR_LEN 64
81418 +
81419 +#define NETIF_RX(skb) netif_receive_skb(skb)
81420 +#define VLAN_ACCEL_RX(skb, pnob, vt) \
81421 + vlan_hwaccel_rx(skb, pnob->vlan_grp, vt)
81422 +
81423 +/*
81424 + This function notifies BladeEngine of the number of completion
81425 + entries processed from the specified completion queue by writing
81426 + the number of popped entries to the door bell.
81427 +
81428 + pnob - Pointer to the NetObject structure
81429 + n - Number of completion entries processed
81430 + cq_id - Queue ID of the completion queue for which notification
81431 + is being done.
81432 + re_arm - 1 - rearm the completion ring to generate an event.
81433 + - 0 - dont rearm the completion ring to generate an event
81434 +*/
81435 +void be_notify_cmpl(struct be_net_object *pnob, int n, int cq_id, int re_arm)
81436 +{
81437 + struct CQ_DB_AMAP cqdb;
81438 +
81439 + cqdb.dw[0] = 0;
81440 + AMAP_SET_BITS_PTR(CQ_DB, qid, &cqdb, cq_id);
81441 + AMAP_SET_BITS_PTR(CQ_DB, rearm, &cqdb, re_arm);
81442 + AMAP_SET_BITS_PTR(CQ_DB, num_popped, &cqdb, n);
81443 + PD_WRITE(&pnob->fn_obj, cq_db, cqdb.dw[0]);
81444 +}
81445 +
81446 +/*
81447 + * adds additional receive frags indicated by BE starting from given
81448 + * frag index (fi) to specified skb's frag list
81449 + */
81450 +static void
81451 +add_skb_frags(struct be_net_object *pnob, struct sk_buff *skb,
81452 + u32 nresid, u32 fi)
81453 +{
81454 + struct be_adapter *adapter = pnob->adapter;
81455 + u32 sk_frag_idx, n;
81456 + struct be_rx_page_info *rx_page_info;
81457 + u32 frag_sz = pnob->rx_buf_size;
81458 +
81459 + sk_frag_idx = skb_shinfo(skb)->nr_frags;
81460 + while (nresid) {
81461 + index_inc(&fi, pnob->rx_q_len);
81462 +
81463 + rx_page_info = (struct be_rx_page_info *)pnob->rx_ctxt[fi];
81464 + pnob->rx_ctxt[fi] = NULL;
81465 + if ((rx_page_info->page_offset) ||
81466 + (pnob->rx_pg_shared == false)) {
81467 + pci_unmap_page(adapter->pdev,
81468 + pci_unmap_addr(rx_page_info, bus),
81469 + frag_sz, PCI_DMA_FROMDEVICE);
81470 + }
81471 +
81472 + n = min(nresid, frag_sz);
81473 + skb_shinfo(skb)->frags[sk_frag_idx].page = rx_page_info->page;
81474 + skb_shinfo(skb)->frags[sk_frag_idx].page_offset
81475 + = rx_page_info->page_offset;
81476 + skb_shinfo(skb)->frags[sk_frag_idx].size = n;
81477 +
81478 + sk_frag_idx++;
81479 + skb->len += n;
81480 + skb->data_len += n;
81481 + skb_shinfo(skb)->nr_frags++;
81482 + nresid -= n;
81483 +
81484 + memset(rx_page_info, 0, sizeof(struct be_rx_page_info));
81485 + atomic_dec(&pnob->rx_q_posted);
81486 + }
81487 +}
81488 +
81489 +/*
81490 + * This function processes incoming nic packets over various Rx queues.
81491 + * This function takes the adapter, the current Rx status descriptor
81492 + * entry and the Rx completion queue ID as argument.
81493 + */
81494 +static inline int process_nic_rx_completion(struct be_net_object *pnob,
81495 + struct ETH_RX_COMPL_AMAP *rxcp)
81496 +{
81497 + struct be_adapter *adapter = pnob->adapter;
81498 + struct sk_buff *skb;
81499 + int udpcksm, tcpcksm;
81500 + int n;
81501 + u32 nresid, fi;
81502 + u32 frag_sz = pnob->rx_buf_size;
81503 + u8 *va;
81504 + struct be_rx_page_info *rx_page_info;
81505 + u32 numfrags, vtp, vtm, vlan_tag, pktsize;
81506 +
81507 + fi = AMAP_GET_BITS_PTR(ETH_RX_COMPL, fragndx, rxcp);
81508 + BUG_ON(fi >= (int)pnob->rx_q_len);
81509 + BUG_ON(fi < 0);
81510 +
81511 + rx_page_info = (struct be_rx_page_info *)pnob->rx_ctxt[fi];
81512 + BUG_ON(!rx_page_info->page);
81513 + pnob->rx_ctxt[fi] = NULL;
81514 +
81515 + /*
81516 + * If one page is used per fragment or if this is the second half of
81517 + * of the page, unmap the page here
81518 + */
81519 + if ((rx_page_info->page_offset) || (pnob->rx_pg_shared == false)) {
81520 + pci_unmap_page(adapter->pdev,
81521 + pci_unmap_addr(rx_page_info, bus), frag_sz,
81522 + PCI_DMA_FROMDEVICE);
81523 + }
81524 +
81525 + atomic_dec(&pnob->rx_q_posted);
81526 + udpcksm = AMAP_GET_BITS_PTR(ETH_RX_COMPL, udpcksm, rxcp);
81527 + tcpcksm = AMAP_GET_BITS_PTR(ETH_RX_COMPL, tcpcksm, rxcp);
81528 + pktsize = AMAP_GET_BITS_PTR(ETH_RX_COMPL, pktsize, rxcp);
81529 + /*
81530 + * get rid of RX flush completions first.
81531 + */
81532 + if ((tcpcksm) && (udpcksm) && (pktsize == 32)) {
81533 + put_page(rx_page_info->page);
81534 + memset(rx_page_info, 0, sizeof(struct be_rx_page_info));
81535 + return 0;
81536 + }
81537 + skb = netdev_alloc_skb(pnob->netdev, BE_HDR_LEN + NET_IP_ALIGN);
81538 + if (skb == NULL) {
81539 + dev_info(&pnob->netdev->dev, "alloc_skb() failed\n");
81540 + put_page(rx_page_info->page);
81541 + memset(rx_page_info, 0, sizeof(struct be_rx_page_info));
81542 + goto free_frags;
81543 + }
81544 + skb_reserve(skb, NET_IP_ALIGN);
81545 +
81546 + skb->dev = pnob->netdev;
81547 +
81548 + n = min(pktsize, frag_sz);
81549 +
81550 + va = page_address(rx_page_info->page) + rx_page_info->page_offset;
81551 + prefetch(va);
81552 +
81553 + skb->len = n;
81554 + skb->data_len = n;
81555 + if (n <= BE_HDR_LEN) {
81556 + memcpy(skb->data, va, n);
81557 + put_page(rx_page_info->page);
81558 + skb->data_len -= n;
81559 + skb->tail += n;
81560 + } else {
81561 +
81562 + /* Setup the SKB with page buffer information */
81563 + skb_shinfo(skb)->frags[0].page = rx_page_info->page;
81564 + skb_shinfo(skb)->nr_frags++;
81565 +
81566 + /* Copy the header into the skb_data */
81567 + memcpy(skb->data, va, BE_HDR_LEN);
81568 + skb_shinfo(skb)->frags[0].page_offset =
81569 + rx_page_info->page_offset + BE_HDR_LEN;
81570 + skb_shinfo(skb)->frags[0].size = n - BE_HDR_LEN;
81571 + skb->data_len -= BE_HDR_LEN;
81572 + skb->tail += BE_HDR_LEN;
81573 + }
81574 + memset(rx_page_info, 0, sizeof(struct be_rx_page_info));
81575 + nresid = pktsize - n;
81576 +
81577 + skb->protocol = eth_type_trans(skb, pnob->netdev);
81578 +
81579 + if ((tcpcksm || udpcksm) && adapter->rx_csum)
81580 + skb->ip_summed = CHECKSUM_UNNECESSARY;
81581 + else
81582 + skb->ip_summed = CHECKSUM_NONE;
81583 + /*
81584 + * if we have more bytes left, the frame has been
81585 + * given to us in multiple fragments. This happens
81586 + * with Jumbo frames. Add the remaining fragments to
81587 + * skb->frags[] array.
81588 + */
81589 + if (nresid)
81590 + add_skb_frags(pnob, skb, nresid, fi);
81591 +
81592 + /* update the the true size of the skb. */
81593 + skb->truesize = skb->len + sizeof(struct sk_buff);
81594 +
81595 + /*
81596 + * If a 802.3 frame or 802.2 LLC frame
81597 + * (i.e) contains length field in MAC Hdr
81598 + * and frame len is greater than 64 bytes
81599 + */
81600 + if (((skb->protocol == ntohs(ETH_P_802_2)) ||
81601 + (skb->protocol == ntohs(ETH_P_802_3)))
81602 + && (pktsize > BE_HDR_LEN)) {
81603 + /*
81604 + * If the length given in Mac Hdr is less than frame size
81605 + * Erraneous frame, Drop it
81606 + */
81607 + if ((ntohs(*(u16 *) (va + 12)) + ETH_HLEN) < pktsize) {
81608 + /* Increment Non Ether type II frames dropped */
81609 + adapter->be_stat.bes_802_3_dropped_frames++;
81610 +
81611 + kfree_skb(skb);
81612 + return 0;
81613 + }
81614 + /*
81615 + * else if the length given in Mac Hdr is greater than
81616 + * frame size, should not be seeing this sort of frames
81617 + * dump the pkt and pass to stack
81618 + */
81619 + else if ((ntohs(*(u16 *) (va + 12)) + ETH_HLEN) > pktsize) {
81620 + /* Increment Non Ether type II frames malformed */
81621 + adapter->be_stat.bes_802_3_malformed_frames++;
81622 + }
81623 + }
81624 +
81625 + vtp = AMAP_GET_BITS_PTR(ETH_RX_COMPL, vtp, rxcp);
81626 + vtm = AMAP_GET_BITS_PTR(ETH_RX_COMPL, vtm, rxcp);
81627 + if (vtp && vtm) {
81628 + /* Vlan tag present in pkt and BE found
81629 + * that the tag matched an entry in VLAN table
81630 + */
81631 + if (!pnob->vlan_grp || pnob->num_vlans == 0) {
81632 + /* But we have no VLANs configured.
81633 + * This should never happen. Drop the packet.
81634 + */
81635 + dev_info(&pnob->netdev->dev,
81636 + "BladeEngine: Unexpected vlan tagged packet\n");
81637 + kfree_skb(skb);
81638 + return 0;
81639 + }
81640 + /* pass the VLAN packet to stack */
81641 + vlan_tag = AMAP_GET_BITS_PTR(ETH_RX_COMPL, vlan_tag, rxcp);
81642 + VLAN_ACCEL_RX(skb, pnob, be16_to_cpu(vlan_tag));
81643 +
81644 + } else {
81645 + NETIF_RX(skb);
81646 + }
81647 + return 0;
81648 +
81649 +free_frags:
81650 + /* free all frags associated with the current rxcp */
81651 + numfrags = AMAP_GET_BITS_PTR(ETH_RX_COMPL, numfrags, rxcp);
81652 + while (numfrags-- > 1) {
81653 + index_inc(&fi, pnob->rx_q_len);
81654 +
81655 + rx_page_info = (struct be_rx_page_info *)
81656 + pnob->rx_ctxt[fi];
81657 + pnob->rx_ctxt[fi] = (void *)NULL;
81658 + if (rx_page_info->page_offset || !pnob->rx_pg_shared) {
81659 + pci_unmap_page(adapter->pdev,
81660 + pci_unmap_addr(rx_page_info, bus),
81661 + frag_sz, PCI_DMA_FROMDEVICE);
81662 + }
81663 +
81664 + put_page(rx_page_info->page);
81665 + memset(rx_page_info, 0, sizeof(struct be_rx_page_info));
81666 + atomic_dec(&pnob->rx_q_posted);
81667 + }
81668 + return -ENOMEM;
81669 +}
81670 +
81671 +static void process_nic_rx_completion_lro(struct be_net_object *pnob,
81672 + struct ETH_RX_COMPL_AMAP *rxcp)
81673 +{
81674 + struct be_adapter *adapter = pnob->adapter;
81675 + struct skb_frag_struct rx_frags[BE_MAX_FRAGS_PER_FRAME];
81676 + unsigned int udpcksm, tcpcksm;
81677 + u32 numfrags, vlanf, vtm, vlan_tag, nresid;
81678 + u16 vlant;
81679 + unsigned int fi, idx, n;
81680 + struct be_rx_page_info *rx_page_info;
81681 + u32 frag_sz = pnob->rx_buf_size, pktsize;
81682 + bool rx_coal = (adapter->max_rx_coal <= 1) ? 0 : 1;
81683 + u8 err, *va;
81684 + __wsum csum = 0;
81685 +
81686 + if (AMAP_GET_BITS_PTR(ETH_RX_COMPL, ipsec, rxcp)) {
81687 + /* Drop the pkt and move to the next completion. */
81688 + adapter->be_stat.bes_rx_misc_pkts++;
81689 + return;
81690 + }
81691 + err = AMAP_GET_BITS_PTR(ETH_RX_COMPL, err, rxcp);
81692 + if (err || !rx_coal) {
81693 + /* We won't coalesce Rx pkts if the err bit set.
81694 + * take the path of normal completion processing */
81695 + process_nic_rx_completion(pnob, rxcp);
81696 + return;
81697 + }
81698 +
81699 + fi = AMAP_GET_BITS_PTR(ETH_RX_COMPL, fragndx, rxcp);
81700 + BUG_ON(fi >= (int)pnob->rx_q_len);
81701 + BUG_ON(fi < 0);
81702 + rx_page_info = (struct be_rx_page_info *)pnob->rx_ctxt[fi];
81703 + BUG_ON(!rx_page_info->page);
81704 + pnob->rx_ctxt[fi] = (void *)NULL;
81705 + /* If one page is used per fragment or if this is the
81706 + * second half of the page, unmap the page here
81707 + */
81708 + if (rx_page_info->page_offset || !pnob->rx_pg_shared) {
81709 + pci_unmap_page(adapter->pdev,
81710 + pci_unmap_addr(rx_page_info, bus),
81711 + frag_sz, PCI_DMA_FROMDEVICE);
81712 + }
81713 +
81714 + numfrags = AMAP_GET_BITS_PTR(ETH_RX_COMPL, numfrags, rxcp);
81715 + udpcksm = AMAP_GET_BITS_PTR(ETH_RX_COMPL, udpcksm, rxcp);
81716 + tcpcksm = AMAP_GET_BITS_PTR(ETH_RX_COMPL, tcpcksm, rxcp);
81717 + vlan_tag = AMAP_GET_BITS_PTR(ETH_RX_COMPL, vlan_tag, rxcp);
81718 + vlant = be16_to_cpu(vlan_tag);
81719 + vlanf = AMAP_GET_BITS_PTR(ETH_RX_COMPL, vtp, rxcp);
81720 + vtm = AMAP_GET_BITS_PTR(ETH_RX_COMPL, vtm, rxcp);
81721 + pktsize = AMAP_GET_BITS_PTR(ETH_RX_COMPL, pktsize, rxcp);
81722 +
81723 + atomic_dec(&pnob->rx_q_posted);
81724 +
81725 + if (tcpcksm && udpcksm && pktsize == 32) {
81726 + /* flush completion entries */
81727 + put_page(rx_page_info->page);
81728 + memset(rx_page_info, 0, sizeof(struct be_rx_page_info));
81729 + return;
81730 + }
81731 + /* Only one of udpcksum and tcpcksum can be set */
81732 + BUG_ON(udpcksm && tcpcksm);
81733 +
81734 + /* jumbo frames could come in multiple fragments */
81735 + BUG_ON(numfrags != ((pktsize + (frag_sz - 1)) / frag_sz));
81736 + n = min(pktsize, frag_sz);
81737 + nresid = pktsize - n; /* will be useful for jumbo pkts */
81738 + idx = 0;
81739 +
81740 + va = page_address(rx_page_info->page) + rx_page_info->page_offset;
81741 + prefetch(va);
81742 + rx_frags[idx].page = rx_page_info->page;
81743 + rx_frags[idx].page_offset = (rx_page_info->page_offset);
81744 + rx_frags[idx].size = n;
81745 + memset(rx_page_info, 0, sizeof(struct be_rx_page_info));
81746 +
81747 + /* If we got multiple fragments, we have more data. */
81748 + while (nresid) {
81749 + idx++;
81750 + index_inc(&fi, pnob->rx_q_len);
81751 +
81752 + rx_page_info = (struct be_rx_page_info *)pnob->rx_ctxt[fi];
81753 + pnob->rx_ctxt[fi] = (void *)NULL;
81754 + if (rx_page_info->page_offset || !pnob->rx_pg_shared) {
81755 + pci_unmap_page(adapter->pdev,
81756 + pci_unmap_addr(rx_page_info, bus),
81757 + frag_sz, PCI_DMA_FROMDEVICE);
81758 + }
81759 +
81760 + n = min(nresid, frag_sz);
81761 + rx_frags[idx].page = rx_page_info->page;
81762 + rx_frags[idx].page_offset = (rx_page_info->page_offset);
81763 + rx_frags[idx].size = n;
81764 +
81765 + nresid -= n;
81766 + memset(rx_page_info, 0, sizeof(struct be_rx_page_info));
81767 + atomic_dec(&pnob->rx_q_posted);
81768 + }
81769 +
81770 + if (likely(!(vlanf && vtm))) {
81771 + lro_receive_frags(&pnob->lro_mgr, rx_frags,
81772 + pktsize, pktsize,
81773 + (void *)(unsigned long)csum, csum);
81774 + } else {
81775 + /* Vlan tag present in pkt and BE found
81776 + * that the tag matched an entry in VLAN table
81777 + */
81778 + if (unlikely(!pnob->vlan_grp || pnob->num_vlans == 0)) {
81779 + /* But we have no VLANs configured.
81780 + * This should never happen. Drop the packet.
81781 + */
81782 + dev_info(&pnob->netdev->dev,
81783 + "BladeEngine: Unexpected vlan tagged packet\n");
81784 + return;
81785 + }
81786 + /* pass the VLAN packet to stack */
81787 + lro_vlan_hwaccel_receive_frags(&pnob->lro_mgr,
81788 + rx_frags, pktsize, pktsize,
81789 + pnob->vlan_grp, vlant,
81790 + (void *)(unsigned long)csum,
81791 + csum);
81792 + }
81793 +
81794 + adapter->be_stat.bes_rx_coal++;
81795 +}
81796 +
81797 +struct ETH_RX_COMPL_AMAP *be_get_rx_cmpl(struct be_net_object *pnob)
81798 +{
81799 + struct ETH_RX_COMPL_AMAP *rxcp = &pnob->rx_cq[pnob->rx_cq_tl];
81800 + u32 valid, ct;
81801 +
81802 + valid = AMAP_GET_BITS_PTR(ETH_RX_COMPL, valid, rxcp);
81803 + if (valid == 0)
81804 + return NULL;
81805 +
81806 + ct = AMAP_GET_BITS_PTR(ETH_RX_COMPL, ct, rxcp);
81807 + if (ct != 0) {
81808 + /* Invalid chute #. treat as error */
81809 + AMAP_SET_BITS_PTR(ETH_RX_COMPL, err, rxcp, 1);
81810 + }
81811 +
81812 + be_adv_rxcq_tl(pnob);
81813 + AMAP_SET_BITS_PTR(ETH_RX_COMPL, valid, rxcp, 0);
81814 + return rxcp;
81815 +}
81816 +
81817 +static void update_rx_rate(struct be_adapter *adapter)
81818 +{
81819 + /* update the rate once in two seconds */
81820 + if ((jiffies - adapter->eth_rx_jiffies) > 2 * (HZ)) {
81821 + u32 r;
81822 + r = adapter->eth_rx_bytes /
81823 + ((jiffies - adapter->eth_rx_jiffies) / (HZ));
81824 + r = (r / 1000000); /* MB/Sec */
81825 +
81826 + /* Mega Bits/Sec */
81827 + adapter->be_stat.bes_eth_rx_rate = (r * 8);
81828 + adapter->eth_rx_jiffies = jiffies;
81829 + adapter->eth_rx_bytes = 0;
81830 + }
81831 +}
81832 +
81833 +static int process_rx_completions(struct be_net_object *pnob, int max_work)
81834 +{
81835 + struct be_adapter *adapter = pnob->adapter;
81836 + struct ETH_RX_COMPL_AMAP *rxcp;
81837 + u32 nc = 0;
81838 + unsigned int pktsize;
81839 +
81840 + while (max_work && (rxcp = be_get_rx_cmpl(pnob))) {
81841 + prefetch(rxcp);
81842 + pktsize = AMAP_GET_BITS_PTR(ETH_RX_COMPL, pktsize, rxcp);
81843 + process_nic_rx_completion_lro(pnob, rxcp);
81844 + adapter->eth_rx_bytes += pktsize;
81845 + update_rx_rate(adapter);
81846 + nc++;
81847 + max_work--;
81848 + adapter->be_stat.bes_rx_compl++;
81849 + }
81850 + if (likely(adapter->max_rx_coal > 1)) {
81851 + adapter->be_stat.bes_rx_flush++;
81852 + lro_flush_all(&pnob->lro_mgr);
81853 + }
81854 +
81855 + /* Refill the queue */
81856 + if (atomic_read(&pnob->rx_q_posted) < 900)
81857 + be_post_eth_rx_buffs(pnob);
81858 +
81859 + return nc;
81860 +}
81861 +
81862 +static struct ETH_TX_COMPL_AMAP *be_get_tx_cmpl(struct be_net_object *pnob)
81863 +{
81864 + struct ETH_TX_COMPL_AMAP *txcp = &pnob->tx_cq[pnob->tx_cq_tl];
81865 + u32 valid;
81866 +
81867 + valid = AMAP_GET_BITS_PTR(ETH_TX_COMPL, valid, txcp);
81868 + if (valid == 0)
81869 + return NULL;
81870 +
81871 + AMAP_SET_BITS_PTR(ETH_TX_COMPL, valid, txcp, 0);
81872 + be_adv_txcq_tl(pnob);
81873 + return txcp;
81874 +
81875 +}
81876 +
81877 +void process_one_tx_compl(struct be_net_object *pnob, u32 end_idx)
81878 +{
81879 + struct be_adapter *adapter = pnob->adapter;
81880 + int cur_index, tx_wrbs_completed = 0;
81881 + struct sk_buff *skb;
81882 + u64 busaddr, pa, pa_lo, pa_hi;
81883 + struct ETH_WRB_AMAP *wrb;
81884 + u32 frag_len, last_index, j;
81885 +
81886 + last_index = tx_compl_lastwrb_idx_get(pnob);
81887 + BUG_ON(last_index != end_idx);
81888 + pnob->tx_ctxt[pnob->tx_q_tl] = NULL;
81889 + do {
81890 + cur_index = pnob->tx_q_tl;
81891 + wrb = &pnob->tx_q[cur_index];
81892 + pa_hi = AMAP_GET_BITS_PTR(ETH_WRB, frag_pa_hi, wrb);
81893 + pa_lo = AMAP_GET_BITS_PTR(ETH_WRB, frag_pa_lo, wrb);
81894 + frag_len = AMAP_GET_BITS_PTR(ETH_WRB, frag_len, wrb);
81895 + busaddr = (pa_hi << 32) | pa_lo;
81896 + if (busaddr != 0) {
81897 + pa = le64_to_cpu(busaddr);
81898 + pci_unmap_single(adapter->pdev, pa,
81899 + frag_len, PCI_DMA_TODEVICE);
81900 + }
81901 + if (cur_index == last_index) {
81902 + skb = (struct sk_buff *)pnob->tx_ctxt[cur_index];
81903 + BUG_ON(!skb);
81904 + for (j = 0; j < skb_shinfo(skb)->nr_frags; j++) {
81905 + struct skb_frag_struct *frag;
81906 + frag = &skb_shinfo(skb)->frags[j];
81907 + pci_unmap_page(adapter->pdev,
81908 + (ulong) frag->page, frag->size,
81909 + PCI_DMA_TODEVICE);
81910 + }
81911 + kfree_skb(skb);
81912 + pnob->tx_ctxt[cur_index] = NULL;
81913 + } else {
81914 + BUG_ON(pnob->tx_ctxt[cur_index]);
81915 + }
81916 + tx_wrbs_completed++;
81917 + be_adv_txq_tl(pnob);
81918 + } while (cur_index != last_index);
81919 + atomic_sub(tx_wrbs_completed, &pnob->tx_q_used);
81920 +}
81921 +
81922 +/* there is no need to take an SMP lock here since currently
81923 + * we have only one instance of the tasklet that does completion
81924 + * processing.
81925 + */
81926 +static void process_nic_tx_completions(struct be_net_object *pnob)
81927 +{
81928 + struct be_adapter *adapter = pnob->adapter;
81929 + struct ETH_TX_COMPL_AMAP *txcp;
81930 + struct net_device *netdev = pnob->netdev;
81931 + u32 end_idx, num_processed = 0;
81932 +
81933 + adapter->be_stat.bes_tx_events++;
81934 +
81935 + while ((txcp = be_get_tx_cmpl(pnob))) {
81936 + end_idx = AMAP_GET_BITS_PTR(ETH_TX_COMPL, wrb_index, txcp);
81937 + process_one_tx_compl(pnob, end_idx);
81938 + num_processed++;
81939 + adapter->be_stat.bes_tx_compl++;
81940 + }
81941 + be_notify_cmpl(pnob, num_processed, pnob->tx_cq_id, 1);
81942 + /*
81943 + * We got Tx completions and have usable WRBs.
81944 + * If the netdev's queue has been stopped
81945 + * because we had run out of WRBs, wake it now.
81946 + */
81947 + spin_lock(&adapter->txq_lock);
81948 + if (netif_queue_stopped(netdev)
81949 + && atomic_read(&pnob->tx_q_used) < pnob->tx_q_len / 2) {
81950 + netif_wake_queue(netdev);
81951 + }
81952 + spin_unlock(&adapter->txq_lock);
81953 +}
81954 +
81955 +static u32 post_rx_buffs(struct be_net_object *pnob, struct list_head *rxbl)
81956 +{
81957 + u32 nposted = 0;
81958 + struct ETH_RX_D_AMAP *rxd = NULL;
81959 + struct be_recv_buffer *rxbp;
81960 + void **rx_ctxp;
81961 + struct RQ_DB_AMAP rqdb;
81962 +
81963 + rx_ctxp = pnob->rx_ctxt;
81964 +
81965 + while (!list_empty(rxbl) &&
81966 + (rx_ctxp[pnob->rx_q_hd] == NULL) && nposted < 255) {
81967 +
81968 + rxbp = list_first_entry(rxbl, struct be_recv_buffer, rxb_list);
81969 + list_del(&rxbp->rxb_list);
81970 + rxd = pnob->rx_q + pnob->rx_q_hd;
81971 + AMAP_SET_BITS_PTR(ETH_RX_D, fragpa_lo, rxd, rxbp->rxb_pa_lo);
81972 + AMAP_SET_BITS_PTR(ETH_RX_D, fragpa_hi, rxd, rxbp->rxb_pa_hi);
81973 +
81974 + rx_ctxp[pnob->rx_q_hd] = rxbp->rxb_ctxt;
81975 + be_adv_rxq_hd(pnob);
81976 + nposted++;
81977 + }
81978 +
81979 + if (nposted) {
81980 + /* Now press the door bell to notify BladeEngine. */
81981 + rqdb.dw[0] = 0;
81982 + AMAP_SET_BITS_PTR(RQ_DB, numPosted, &rqdb, nposted);
81983 + AMAP_SET_BITS_PTR(RQ_DB, rq, &rqdb, pnob->rx_q_id);
81984 + PD_WRITE(&pnob->fn_obj, erx_rq_db, rqdb.dw[0]);
81985 + }
81986 + atomic_add(nposted, &pnob->rx_q_posted);
81987 + return nposted;
81988 +}
81989 +
81990 +void be_post_eth_rx_buffs(struct be_net_object *pnob)
81991 +{
81992 + struct be_adapter *adapter = pnob->adapter;
81993 + u32 num_bufs, r;
81994 + u64 busaddr = 0, tmp_pa;
81995 + u32 max_bufs, pg_hd;
81996 + u32 frag_size;
81997 + struct be_recv_buffer *rxbp;
81998 + struct list_head rxbl;
81999 + struct be_rx_page_info *rx_page_info;
82000 + struct page *page = NULL;
82001 + u32 page_order = 0;
82002 + gfp_t alloc_flags = GFP_ATOMIC;
82003 +
82004 + BUG_ON(!adapter);
82005 +
82006 + max_bufs = 64; /* should be even # <= 255. */
82007 +
82008 + frag_size = pnob->rx_buf_size;
82009 + page_order = get_order(frag_size);
82010 +
82011 + if (frag_size == 8192)
82012 + alloc_flags |= (gfp_t) __GFP_COMP;
82013 + /*
82014 + * Form a linked list of RECV_BUFFFER structure to be be posted.
82015 + * We will post even number of buffer so that pages can be
82016 + * shared.
82017 + */
82018 + INIT_LIST_HEAD(&rxbl);
82019 +
82020 + for (num_bufs = 0; num_bufs < max_bufs &&
82021 + !pnob->rx_page_info[pnob->rx_pg_info_hd].page; ++num_bufs) {
82022 +
82023 + rxbp = &pnob->eth_rx_bufs[num_bufs];
82024 + pg_hd = pnob->rx_pg_info_hd;
82025 + rx_page_info = &pnob->rx_page_info[pg_hd];
82026 +
82027 + if (!page) {
82028 + page = alloc_pages(alloc_flags, page_order);
82029 + if (unlikely(page == NULL)) {
82030 + adapter->be_stat.bes_ethrx_post_fail++;
82031 + pnob->rxbuf_post_fail++;
82032 + break;
82033 + }
82034 + pnob->rxbuf_post_fail = 0;
82035 + busaddr = pci_map_page(adapter->pdev, page, 0,
82036 + frag_size, PCI_DMA_FROMDEVICE);
82037 + rx_page_info->page_offset = 0;
82038 + rx_page_info->page = page;
82039 + /*
82040 + * If we are sharing a page among two skbs,
82041 + * alloc a new one on the next iteration
82042 + */
82043 + if (pnob->rx_pg_shared == false)
82044 + page = NULL;
82045 + } else {
82046 + get_page(page);
82047 + rx_page_info->page_offset += frag_size;
82048 + rx_page_info->page = page;
82049 + /*
82050 + * We are finished with the alloced page,
82051 + * Alloc a new one on the next iteration
82052 + */
82053 + page = NULL;
82054 + }
82055 + rxbp->rxb_ctxt = (void *)rx_page_info;
82056 + index_inc(&pnob->rx_pg_info_hd, pnob->rx_q_len);
82057 +
82058 + pci_unmap_addr_set(rx_page_info, bus, busaddr);
82059 + tmp_pa = busaddr + rx_page_info->page_offset;
82060 + rxbp->rxb_pa_lo = (tmp_pa & 0xFFFFFFFF);
82061 + rxbp->rxb_pa_hi = (tmp_pa >> 32);
82062 + rxbp->rxb_len = frag_size;
82063 + list_add_tail(&rxbp->rxb_list, &rxbl);
82064 + } /* End of for */
82065 +
82066 + r = post_rx_buffs(pnob, &rxbl);
82067 + BUG_ON(r != num_bufs);
82068 + return;
82069 +}
82070 +
82071 +/*
82072 + * Interrupt service for network function. We just schedule the
82073 + * tasklet which does all completion processing.
82074 + */
82075 +irqreturn_t be_int(int irq, void *dev)
82076 +{
82077 + struct net_device *netdev = dev;
82078 + struct be_net_object *pnob = netdev_priv(netdev);
82079 + struct be_adapter *adapter = pnob->adapter;
82080 + u32 isr;
82081 +
82082 + isr = CSR_READ(&pnob->fn_obj, cev.isr1);
82083 + if (unlikely(!isr))
82084 + return IRQ_NONE;
82085 +
82086 + spin_lock(&adapter->int_lock);
82087 + adapter->isr |= isr;
82088 + spin_unlock(&adapter->int_lock);
82089 +
82090 + adapter->be_stat.bes_ints++;
82091 +
82092 + tasklet_schedule(&adapter->sts_handler);
82093 + return IRQ_HANDLED;
82094 +}
82095 +
82096 +/*
82097 + * Poll function called by NAPI with a work budget.
82098 + * We process as many UC. BC and MC receive completions
82099 + * as the budget allows and return the actual number of
82100 + * RX ststutses processed.
82101 + */
82102 +int be_poll(struct napi_struct *napi, int budget)
82103 +{
82104 + struct be_net_object *pnob =
82105 + container_of(napi, struct be_net_object, napi);
82106 + u32 work_done;
82107 +
82108 + pnob->adapter->be_stat.bes_polls++;
82109 + work_done = process_rx_completions(pnob, budget);
82110 + BUG_ON(work_done > budget);
82111 +
82112 + /* All consumed */
82113 + if (work_done < budget) {
82114 + netif_rx_complete(napi);
82115 + /* enable intr */
82116 + be_notify_cmpl(pnob, work_done, pnob->rx_cq_id, 1);
82117 + } else {
82118 + /* More to be consumed; continue with interrupts disabled */
82119 + be_notify_cmpl(pnob, work_done, pnob->rx_cq_id, 0);
82120 + }
82121 + return work_done;
82122 +}
82123 +
82124 +static struct EQ_ENTRY_AMAP *get_event(struct be_net_object *pnob)
82125 +{
82126 + struct EQ_ENTRY_AMAP *eqp = &(pnob->event_q[pnob->event_q_tl]);
82127 + if (!AMAP_GET_BITS_PTR(EQ_ENTRY, Valid, eqp))
82128 + return NULL;
82129 + be_adv_eq_tl(pnob);
82130 + return eqp;
82131 +}
82132 +
82133 +/*
82134 + * Processes all valid events in the event ring associated with given
82135 + * NetObject. Also, notifies BE the number of events processed.
82136 + */
82137 +static inline u32 process_events(struct be_net_object *pnob)
82138 +{
82139 + struct be_adapter *adapter = pnob->adapter;
82140 + struct EQ_ENTRY_AMAP *eqp;
82141 + u32 rid, num_events = 0;
82142 + struct net_device *netdev = pnob->netdev;
82143 +
82144 + while ((eqp = get_event(pnob)) != NULL) {
82145 + adapter->be_stat.bes_events++;
82146 + rid = AMAP_GET_BITS_PTR(EQ_ENTRY, ResourceID, eqp);
82147 + if (rid == pnob->rx_cq_id) {
82148 + adapter->be_stat.bes_rx_events++;
82149 + netif_rx_schedule(&pnob->napi);
82150 + } else if (rid == pnob->tx_cq_id) {
82151 + process_nic_tx_completions(pnob);
82152 + } else if (rid == pnob->mcc_cq_id) {
82153 + be_mcc_process_cq(&pnob->mcc_q_obj, 1);
82154 + } else {
82155 + dev_info(&netdev->dev,
82156 + "Invalid EQ ResourceID %d\n", rid);
82157 + }
82158 + AMAP_SET_BITS_PTR(EQ_ENTRY, Valid, eqp, 0);
82159 + AMAP_SET_BITS_PTR(EQ_ENTRY, ResourceID, eqp, 0);
82160 + num_events++;
82161 + }
82162 + return num_events;
82163 +}
82164 +
82165 +static void update_eqd(struct be_adapter *adapter, struct be_net_object *pnob)
82166 +{
82167 + int status;
82168 + struct be_eq_object *eq_objectp;
82169 +
82170 + /* update once a second */
82171 + if ((jiffies - adapter->ips_jiffies) > 1 * (HZ)) {
82172 + /* One second elapsed since last update */
82173 + u32 r, new_eqd = -1;
82174 + r = adapter->be_stat.bes_ints - adapter->be_stat.bes_prev_ints;
82175 + r = r / ((jiffies - adapter->ips_jiffies) / (HZ));
82176 + adapter->be_stat.bes_ips = r;
82177 + adapter->ips_jiffies = jiffies;
82178 + adapter->be_stat.bes_prev_ints = adapter->be_stat.bes_ints;
82179 + if (r > IPS_HI_WM && adapter->cur_eqd < adapter->max_eqd)
82180 + new_eqd = (adapter->cur_eqd + 8);
82181 + if (r < IPS_LO_WM && adapter->cur_eqd > adapter->min_eqd)
82182 + new_eqd = (adapter->cur_eqd - 8);
82183 + if (adapter->enable_aic && new_eqd != -1) {
82184 + eq_objectp = &pnob->event_q_obj;
82185 + status = be_eq_modify_delay(&pnob->fn_obj, 1,
82186 + &eq_objectp, &new_eqd, NULL,
82187 + NULL, NULL);
82188 + if (status == BE_SUCCESS)
82189 + adapter->cur_eqd = new_eqd;
82190 + }
82191 + }
82192 +}
82193 +
82194 +/*
82195 + This function notifies BladeEngine of how many events were processed
82196 + from the event queue by ringing the corresponding door bell and
82197 + optionally re-arms the event queue.
82198 + n - number of events processed
82199 + re_arm - 1 - re-arm the EQ, 0 - do not re-arm the EQ
82200 +
82201 +*/
82202 +static void be_notify_event(struct be_net_object *pnob, int n, int re_arm)
82203 +{
82204 + struct CQ_DB_AMAP eqdb;
82205 + eqdb.dw[0] = 0;
82206 +
82207 + AMAP_SET_BITS_PTR(CQ_DB, qid, &eqdb, pnob->event_q_id);
82208 + AMAP_SET_BITS_PTR(CQ_DB, rearm, &eqdb, re_arm);
82209 + AMAP_SET_BITS_PTR(CQ_DB, event, &eqdb, 1);
82210 + AMAP_SET_BITS_PTR(CQ_DB, num_popped, &eqdb, n);
82211 + /*
82212 + * Under some situations we see an interrupt and no valid
82213 + * EQ entry. To keep going, we need to ring the DB even if
82214 + * numPOsted is 0.
82215 + */
82216 + PD_WRITE(&pnob->fn_obj, cq_db, eqdb.dw[0]);
82217 + return;
82218 +}
82219 +
82220 +/*
82221 + * Called from the tasklet scheduled by ISR. All real interrupt processing
82222 + * is done here.
82223 + */
82224 +void be_process_intr(unsigned long context)
82225 +{
82226 + struct be_adapter *adapter = (struct be_adapter *)context;
82227 + struct be_net_object *pnob = adapter->net_obj;
82228 + u32 isr, n;
82229 + ulong flags = 0;
82230 +
82231 + isr = adapter->isr;
82232 +
82233 + /*
82234 + * we create only one NIC event queue in Linux. Event is
82235 + * expected only in the first event queue
82236 + */
82237 + BUG_ON(isr & 0xfffffffe);
82238 + if ((isr & 1) == 0)
82239 + return; /* not our interrupt */
82240 + n = process_events(pnob);
82241 + /*
82242 + * Clear the event bit. adapter->isr is set by
82243 + * hard interrupt. Prevent race with lock.
82244 + */
82245 + spin_lock_irqsave(&adapter->int_lock, flags);
82246 + adapter->isr &= ~1;
82247 + spin_unlock_irqrestore(&adapter->int_lock, flags);
82248 + be_notify_event(pnob, n, 1);
82249 + /*
82250 + * If previous allocation attempts had failed and
82251 + * BE has used up all posted buffers, post RX buffers here
82252 + */
82253 + if (pnob->rxbuf_post_fail && atomic_read(&pnob->rx_q_posted) == 0)
82254 + be_post_eth_rx_buffs(pnob);
82255 + update_eqd(adapter, pnob);
82256 + return;
82257 +}
82258 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/benet.h linux-2.6.29-rc3.owrt/drivers/staging/benet/benet.h
82259 --- linux-2.6.29.owrt/drivers/staging/benet/benet.h 1970-01-01 01:00:00.000000000 +0100
82260 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/benet.h 2009-05-10 23:48:29.000000000 +0200
82261 @@ -0,0 +1,429 @@
82262 +/*
82263 + * Copyright (C) 2005 - 2008 ServerEngines
82264 + * All rights reserved.
82265 + *
82266 + * This program is free software; you can redistribute it and/or
82267 + * modify it under the terms of the GNU General Public License version 2
82268 + * as published by the Free Software Foundation. The full GNU General
82269 + * Public License is included in this distribution in the file called COPYING.
82270 + *
82271 + * Contact Information:
82272 + * linux-drivers@serverengines.com
82273 + *
82274 + * ServerEngines
82275 + * 209 N. Fair Oaks Ave
82276 + * Sunnyvale, CA 94085
82277 + */
82278 +#ifndef _BENET_H_
82279 +#define _BENET_H_
82280 +
82281 +#include <linux/pci.h>
82282 +#include <linux/netdevice.h>
82283 +#include <linux/inet_lro.h>
82284 +#include "hwlib.h"
82285 +
82286 +#define _SA_MODULE_NAME "net-driver"
82287 +
82288 +#define VLAN_VALID_BIT 0x8000
82289 +#define BE_NUM_VLAN_SUPPORTED 32
82290 +#define BE_PORT_LINK_DOWN 0000
82291 +#define BE_PORT_LINK_UP 0001
82292 +#define BE_MAX_TX_FRAG_COUNT (30)
82293 +
82294 +/* Flag bits for send operation */
82295 +#define IPCS (1 << 0) /* Enable IP checksum offload */
82296 +#define UDPCS (1 << 1) /* Enable UDP checksum offload */
82297 +#define TCPCS (1 << 2) /* Enable TCP checksum offload */
82298 +#define LSO (1 << 3) /* Enable Large Segment offload */
82299 +#define ETHVLAN (1 << 4) /* Enable VLAN insert */
82300 +#define ETHEVENT (1 << 5) /* Generate event on completion */
82301 +#define ETHCOMPLETE (1 << 6) /* Generate completion when done */
82302 +#define IPSEC (1 << 7) /* Enable IPSEC */
82303 +#define FORWARD (1 << 8) /* Send the packet in forwarding path */
82304 +#define FIN (1 << 9) /* Issue FIN segment */
82305 +
82306 +#define BE_MAX_MTU 8974
82307 +
82308 +#define BE_MAX_LRO_DESCRIPTORS 8
82309 +#define BE_LRO_MAX_PKTS 64
82310 +#define BE_MAX_FRAGS_PER_FRAME 6
82311 +
82312 +extern const char be_drvr_ver[];
82313 +extern char be_fw_ver[];
82314 +extern char be_driver_name[];
82315 +
82316 +extern struct ethtool_ops be_ethtool_ops;
82317 +
82318 +#define BE_DEV_STATE_NONE 0
82319 +#define BE_DEV_STATE_INIT 1
82320 +#define BE_DEV_STATE_OPEN 2
82321 +#define BE_DEV_STATE_SUSPEND 3
82322 +
82323 +/* This structure is used to describe physical fragments to use
82324 + * for DMAing data from NIC.
82325 + */
82326 +struct be_recv_buffer {
82327 + struct list_head rxb_list; /* for maintaining a linked list */
82328 + void *rxb_va; /* buffer virtual address */
82329 + u32 rxb_pa_lo; /* low part of physical address */
82330 + u32 rxb_pa_hi; /* high part of physical address */
82331 + u32 rxb_len; /* length of recv buffer */
82332 + void *rxb_ctxt; /* context for OSM driver to use */
82333 +};
82334 +
82335 +/*
82336 + * fragment list to describe scattered data.
82337 + */
82338 +struct be_tx_frag_list {
82339 + u32 txb_len; /* Size of this fragment */
82340 + u32 txb_pa_lo; /* Lower 32 bits of 64 bit physical addr */
82341 + u32 txb_pa_hi; /* Higher 32 bits of 64 bit physical addr */
82342 +};
82343 +
82344 +struct be_rx_page_info {
82345 + struct page *page;
82346 + dma_addr_t bus;
82347 + u16 page_offset;
82348 +};
82349 +
82350 +/*
82351 + * This structure is the main tracking structure for a NIC interface.
82352 + */
82353 +struct be_net_object {
82354 + /* MCC Ring - used to send fwcmds to embedded ARM processor */
82355 + struct MCC_WRB_AMAP *mcc_q; /* VA of the start of the ring */
82356 + u32 mcc_q_len; /* # of WRB entries in this ring */
82357 + u32 mcc_q_size;
82358 + u32 mcc_q_hd; /* MCC ring head */
82359 + u8 mcc_q_created; /* flag to help cleanup */
82360 + struct be_mcc_object mcc_q_obj; /* BECLIB's MCC ring Object */
82361 + dma_addr_t mcc_q_bus; /* DMA'ble bus address */
82362 +
82363 + /* MCC Completion Ring - FW responses to fwcmds sent from MCC ring */
82364 + struct MCC_CQ_ENTRY_AMAP *mcc_cq; /* VA of the start of the ring */
82365 + u32 mcc_cq_len; /* # of compl. entries in this ring */
82366 + u32 mcc_cq_size;
82367 + u32 mcc_cq_tl; /* compl. ring tail */
82368 + u8 mcc_cq_created; /* flag to help cleanup */
82369 + struct be_cq_object mcc_cq_obj; /* BECLIB's MCC compl. ring object */
82370 + u32 mcc_cq_id; /* MCC ring ID */
82371 + dma_addr_t mcc_cq_bus; /* DMA'ble bus address */
82372 +
82373 + struct ring_desc mb_rd; /* RD for MCC_MAIL_BOX */
82374 + void *mb_ptr; /* mailbox ptr to be freed */
82375 + dma_addr_t mb_bus; /* DMA'ble bus address */
82376 + u32 mb_size;
82377 +
82378 + /* BEClib uses an array of context objects to track outstanding
82379 + * requests to the MCC. We need allocate the same number of
82380 + * conext entries as the number of entries in the MCC WRB ring
82381 + */
82382 + u32 mcc_wrb_ctxt_size;
82383 + void *mcc_wrb_ctxt; /* pointer to the context area */
82384 + u32 mcc_wrb_ctxtLen; /* Number of entries in the context */
82385 + /*
82386 + * NIC send request ring - used for xmitting raw ether frames.
82387 + */
82388 + struct ETH_WRB_AMAP *tx_q; /* VA of the start of the ring */
82389 + u32 tx_q_len; /* # if entries in the send ring */
82390 + u32 tx_q_size;
82391 + u32 tx_q_hd; /* Head index. Next req. goes here */
82392 + u32 tx_q_tl; /* Tail indx. oldest outstanding req. */
82393 + u8 tx_q_created; /* flag to help cleanup */
82394 + struct be_ethsq_object tx_q_obj;/* BECLIB's send Q handle */
82395 + dma_addr_t tx_q_bus; /* DMA'ble bus address */
82396 + u32 tx_q_id; /* send queue ring ID */
82397 + u32 tx_q_port; /* 0 no binding, 1 port A, 2 port B */
82398 + atomic_t tx_q_used; /* # of WRBs used */
82399 + /* ptr to an array in which we store context info for each send req. */
82400 + void **tx_ctxt;
82401 + /*
82402 + * NIC Send compl. ring - completion status for all NIC frames xmitted.
82403 + */
82404 + struct ETH_TX_COMPL_AMAP *tx_cq;/* VA of start of the ring */
82405 + u32 txcq_len; /* # of entries in the ring */
82406 + u32 tx_cq_size;
82407 + /*
82408 + * index into compl ring where the host expects next completion entry
82409 + */
82410 + u32 tx_cq_tl;
82411 + u32 tx_cq_id; /* completion queue id */
82412 + u8 tx_cq_created; /* flag to help cleanup */
82413 + struct be_cq_object tx_cq_obj;
82414 + dma_addr_t tx_cq_bus; /* DMA'ble bus address */
82415 + /*
82416 + * Event Queue - all completion entries post events here.
82417 + */
82418 + struct EQ_ENTRY_AMAP *event_q; /* VA of start of event queue */
82419 + u32 event_q_len; /* # of entries */
82420 + u32 event_q_size;
82421 + u32 event_q_tl; /* Tail of the event queue */
82422 + u32 event_q_id; /* Event queue ID */
82423 + u8 event_q_created; /* flag to help cleanup */
82424 + struct be_eq_object event_q_obj; /* Queue handle */
82425 + dma_addr_t event_q_bus; /* DMA'ble bus address */
82426 + /*
82427 + * NIC receive queue - Data buffers to be used for receiving unicast,
82428 + * broadcast and multi-cast frames are posted here.
82429 + */
82430 + struct ETH_RX_D_AMAP *rx_q; /* VA of start of the queue */
82431 + u32 rx_q_len; /* # of entries */
82432 + u32 rx_q_size;
82433 + u32 rx_q_hd; /* Head of the queue */
82434 + atomic_t rx_q_posted; /* number of posted buffers */
82435 + u32 rx_q_id; /* queue ID */
82436 + u8 rx_q_created; /* flag to help cleanup */
82437 + struct be_ethrq_object rx_q_obj; /* NIC RX queue handle */
82438 + dma_addr_t rx_q_bus; /* DMA'ble bus address */
82439 + /*
82440 + * Pointer to an array of opaque context object for use by OSM driver
82441 + */
82442 + void **rx_ctxt;
82443 + /*
82444 + * NIC unicast RX completion queue - all unicast ether frame completion
82445 + * statuses from BE come here.
82446 + */
82447 + struct ETH_RX_COMPL_AMAP *rx_cq; /* VA of start of the queue */
82448 + u32 rx_cq_len; /* # of entries */
82449 + u32 rx_cq_size;
82450 + u32 rx_cq_tl; /* Tail of the queue */
82451 + u32 rx_cq_id; /* queue ID */
82452 + u8 rx_cq_created; /* flag to help cleanup */
82453 + struct be_cq_object rx_cq_obj; /* queue handle */
82454 + dma_addr_t rx_cq_bus; /* DMA'ble bus address */
82455 + struct be_function_object fn_obj; /* function object */
82456 + bool fn_obj_created;
82457 + u32 rx_buf_size; /* Size of the RX buffers */
82458 +
82459 + struct net_device *netdev;
82460 + struct be_recv_buffer eth_rx_bufs[256]; /* to pass Rx buffer
82461 + addresses */
82462 + struct be_adapter *adapter; /* Pointer to OSM adapter */
82463 + u32 devno; /* OSM, network dev no. */
82464 + u32 use_port; /* Current active port */
82465 + struct be_rx_page_info *rx_page_info; /* Array of Rx buf pages */
82466 + u32 rx_pg_info_hd; /* Head of queue */
82467 + int rxbuf_post_fail; /* RxBuff posting fail count */
82468 + bool rx_pg_shared; /* Is an allocsted page shared as two frags ? */
82469 + struct vlan_group *vlan_grp;
82470 + u32 num_vlans; /* Number of vlans in BE's filter */
82471 + u16 vlan_tag[BE_NUM_VLAN_SUPPORTED]; /* vlans currently configured */
82472 + struct napi_struct napi;
82473 + struct net_lro_mgr lro_mgr;
82474 + struct net_lro_desc lro_desc[BE_MAX_LRO_DESCRIPTORS];
82475 +};
82476 +
82477 +#define NET_FH(np) (&(np)->fn_obj)
82478 +
82479 +/*
82480 + * BE driver statistics.
82481 + */
82482 +struct be_drvr_stat {
82483 + u32 bes_tx_reqs; /* number of TX requests initiated */
82484 + u32 bes_tx_fails; /* number of TX requests that failed */
82485 + u32 bes_fwd_reqs; /* number of send reqs through forwarding i/f */
82486 + u32 bes_tx_wrbs; /* number of tx WRBs used */
82487 +
82488 + u32 bes_ints; /* number of interrupts */
82489 + u32 bes_polls; /* number of times NAPI called poll function */
82490 + u32 bes_events; /* total evet entries processed */
82491 + u32 bes_tx_events; /* number of tx completion events */
82492 + u32 bes_rx_events; /* number of ucast rx completion events */
82493 + u32 bes_tx_compl; /* number of tx completion entries processed */
82494 + u32 bes_rx_compl; /* number of rx completion entries
82495 + processed */
82496 + u32 bes_ethrx_post_fail; /* number of ethrx buffer alloc
82497 + failures */
82498 + /*
82499 + * number of non ether type II frames dropped where
82500 + * frame len > length field of Mac Hdr
82501 + */
82502 + u32 bes_802_3_dropped_frames;
82503 + /*
82504 + * number of non ether type II frames malformed where
82505 + * in frame len < length field of Mac Hdr
82506 + */
82507 + u32 bes_802_3_malformed_frames;
82508 + u32 bes_ips; /* interrupts / sec */
82509 + u32 bes_prev_ints; /* bes_ints at last IPS calculation */
82510 + u16 bes_eth_tx_rate; /* ETH TX rate - Mb/sec */
82511 + u16 bes_eth_rx_rate; /* ETH RX rate - Mb/sec */
82512 + u32 bes_rx_coal; /* Num pkts coalasced */
82513 + u32 bes_rx_flush; /* Num times coalasced */
82514 + u32 bes_link_change_physical; /*Num of times physical link changed */
82515 + u32 bes_link_change_virtual; /*Num of times virtual link changed */
82516 + u32 bes_rx_misc_pkts; /* Misc pkts received */
82517 +};
82518 +
82519 +/* Maximum interrupt delay (in microseconds) allowed */
82520 +#define MAX_EQD 120
82521 +
82522 +/*
82523 + * timer to prevent system shutdown hang for ever if h/w stops responding
82524 + */
82525 +struct be_timer_ctxt {
82526 + atomic_t get_stat_flag;
82527 + struct timer_list get_stats_timer;
82528 + unsigned long get_stat_sem_addr;
82529 +} ;
82530 +
82531 +/* This structure is the main BladeEngine driver context. */
82532 +struct be_adapter {
82533 + struct net_device *netdevp;
82534 + struct be_drvr_stat be_stat;
82535 + struct net_device_stats benet_stats;
82536 +
82537 + /* PCI BAR mapped addresses */
82538 + u8 __iomem *csr_va; /* CSR */
82539 + u8 __iomem *db_va; /* Door Bell */
82540 + u8 __iomem *pci_va; /* PCI Config */
82541 +
82542 + struct tasklet_struct sts_handler;
82543 + struct timer_list cq_timer;
82544 + spinlock_t int_lock; /* to protect the isr field in adapter */
82545 +
82546 + struct FWCMD_ETH_GET_STATISTICS *eth_statsp;
82547 + /*
82548 + * This will enable the use of ethtool to enable or disable
82549 + * Checksum on Rx pkts to be obeyed or disobeyed.
82550 + * If this is true = 1, then whatever is the checksum on the
82551 + * Received pkt as per BE, it will be given to the stack.
82552 + * Else the stack will re calculate it.
82553 + */
82554 + bool rx_csum;
82555 + /*
82556 + * This will enable the use of ethtool to enable or disable
82557 + * Coalese on Rx pkts to be obeyed or disobeyed.
82558 + * If this is grater than 0 and less than 16 then coalascing
82559 + * is enabled else it is disabled
82560 + */
82561 + u32 max_rx_coal;
82562 + struct pci_dev *pdev; /* Pointer to OS's PCI dvice */
82563 +
82564 + spinlock_t txq_lock; /* to stop/wake queue based on tx_q_used */
82565 +
82566 + u32 isr; /* copy of Intr status reg. */
82567 +
82568 + u32 port0_link_sts; /* Port 0 link status */
82569 + u32 port1_link_sts; /* port 1 list status */
82570 + struct BE_LINK_STATUS *be_link_sts;
82571 +
82572 + /* pointer to the first netobject of this adapter */
82573 + struct be_net_object *net_obj;
82574 +
82575 + /* Flags to indicate what to clean up */
82576 + bool tasklet_started;
82577 + bool isr_registered;
82578 + /*
82579 + * adaptive interrupt coalescing (AIC) related
82580 + */
82581 + bool enable_aic; /* 1 if AIC is enabled */
82582 + u16 min_eqd; /* minimum EQ delay in usec */
82583 + u16 max_eqd; /* minimum EQ delay in usec */
82584 + u16 cur_eqd; /* current EQ delay in usec */
82585 + /*
82586 + * book keeping for interrupt / sec and TX/RX rate calculation
82587 + */
82588 + ulong ips_jiffies; /* jiffies at last IPS calc */
82589 + u32 eth_tx_bytes;
82590 + ulong eth_tx_jiffies;
82591 + u32 eth_rx_bytes;
82592 + ulong eth_rx_jiffies;
82593 +
82594 + struct semaphore get_eth_stat_sem;
82595 +
82596 + /* timer ctxt to prevent shutdown hanging due to un-responsive BE */
82597 + struct be_timer_ctxt timer_ctxt;
82598 +
82599 +#define BE_MAX_MSIX_VECTORS 32
82600 +#define BE_MAX_REQ_MSIX_VECTORS 1 /* only one EQ in Linux driver */
82601 + struct msix_entry msix_entries[BE_MAX_MSIX_VECTORS];
82602 + bool msix_enabled;
82603 + bool dma_64bit_cap; /* the Device DAC capable or not */
82604 + u8 dev_state; /* The current state of the device */
82605 + u8 dev_pm_state; /* The State of device before going to suspend */
82606 +};
82607 +
82608 +/*
82609 + * Every second we look at the ints/sec and adjust eq_delay
82610 + * between adapter->min_eqd and adapter->max_eqd to keep the ints/sec between
82611 + * IPS_HI_WM and IPS_LO_WM.
82612 + */
82613 +#define IPS_HI_WM 18000
82614 +#define IPS_LO_WM 8000
82615 +
82616 +
82617 +static inline void index_adv(u32 *index, u32 val, u32 limit)
82618 +{
82619 + BUG_ON(limit & (limit-1));
82620 + *index = (*index + val) & (limit - 1);
82621 +}
82622 +
82623 +static inline void index_inc(u32 *index, u32 limit)
82624 +{
82625 + BUG_ON(limit & (limit-1));
82626 + *index = (*index + 1) & (limit - 1);
82627 +}
82628 +
82629 +static inline void be_adv_eq_tl(struct be_net_object *pnob)
82630 +{
82631 + index_inc(&pnob->event_q_tl, pnob->event_q_len);
82632 +}
82633 +
82634 +static inline void be_adv_txq_hd(struct be_net_object *pnob)
82635 +{
82636 + index_inc(&pnob->tx_q_hd, pnob->tx_q_len);
82637 +}
82638 +
82639 +static inline void be_adv_txq_tl(struct be_net_object *pnob)
82640 +{
82641 + index_inc(&pnob->tx_q_tl, pnob->tx_q_len);
82642 +}
82643 +
82644 +static inline void be_adv_txcq_tl(struct be_net_object *pnob)
82645 +{
82646 + index_inc(&pnob->tx_cq_tl, pnob->txcq_len);
82647 +}
82648 +
82649 +static inline void be_adv_rxq_hd(struct be_net_object *pnob)
82650 +{
82651 + index_inc(&pnob->rx_q_hd, pnob->rx_q_len);
82652 +}
82653 +
82654 +static inline void be_adv_rxcq_tl(struct be_net_object *pnob)
82655 +{
82656 + index_inc(&pnob->rx_cq_tl, pnob->rx_cq_len);
82657 +}
82658 +
82659 +static inline u32 tx_compl_lastwrb_idx_get(struct be_net_object *pnob)
82660 +{
82661 + return (pnob->tx_q_tl + *(u32 *)&pnob->tx_ctxt[pnob->tx_q_tl] - 1)
82662 + & (pnob->tx_q_len - 1);
82663 +}
82664 +
82665 +int benet_init(struct net_device *);
82666 +int be_ethtool_ioctl(struct net_device *, struct ifreq *);
82667 +struct net_device_stats *benet_get_stats(struct net_device *);
82668 +void be_process_intr(unsigned long context);
82669 +irqreturn_t be_int(int irq, void *dev);
82670 +void be_post_eth_rx_buffs(struct be_net_object *);
82671 +void be_get_stat_cb(void *, int, struct MCC_WRB_AMAP *);
82672 +void be_get_stats_timer_handler(unsigned long);
82673 +void be_wait_nic_tx_cmplx_cmpl(struct be_net_object *);
82674 +void be_print_link_info(struct BE_LINK_STATUS *);
82675 +void be_update_link_status(struct be_adapter *);
82676 +void be_init_procfs(struct be_adapter *);
82677 +void be_cleanup_procfs(struct be_adapter *);
82678 +int be_poll(struct napi_struct *, int);
82679 +struct ETH_RX_COMPL_AMAP *be_get_rx_cmpl(struct be_net_object *);
82680 +void be_notify_cmpl(struct be_net_object *, int, int, int);
82681 +void be_enable_intr(struct be_net_object *);
82682 +void be_enable_eq_intr(struct be_net_object *);
82683 +void be_disable_intr(struct be_net_object *);
82684 +void be_disable_eq_intr(struct be_net_object *);
82685 +int be_set_uc_mac_adr(struct be_net_object *, u8, u8, u8,
82686 + u8 *, mcc_wrb_cqe_callback, void *);
82687 +int be_get_flow_ctl(struct be_function_object *pFnObj, bool *, bool *);
82688 +void process_one_tx_compl(struct be_net_object *pnob, u32 end_idx);
82689 +
82690 +#endif /* _BENET_H_ */
82691 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/be_netif.c linux-2.6.29-rc3.owrt/drivers/staging/benet/be_netif.c
82692 --- linux-2.6.29.owrt/drivers/staging/benet/be_netif.c 1970-01-01 01:00:00.000000000 +0100
82693 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/be_netif.c 2009-05-10 23:48:29.000000000 +0200
82694 @@ -0,0 +1,705 @@
82695 +/*
82696 + * Copyright (C) 2005 - 2008 ServerEngines
82697 + * All rights reserved.
82698 + *
82699 + * This program is free software; you can redistribute it and/or
82700 + * modify it under the terms of the GNU General Public License version 2
82701 + * as published by the Free Software Foundation. The full GNU General
82702 + * Public License is included in this distribution in the file called COPYING.
82703 + *
82704 + * Contact Information:
82705 + * linux-drivers@serverengines.com
82706 + *
82707 + * ServerEngines
82708 + * 209 N. Fair Oaks Ave
82709 + * Sunnyvale, CA 94085
82710 + */
82711 +/*
82712 + * be_netif.c
82713 + *
82714 + * This file contains various entry points of drivers seen by tcp/ip stack.
82715 + */
82716 +
82717 +#include <linux/if_vlan.h>
82718 +#include <linux/in.h>
82719 +#include "benet.h"
82720 +#include <linux/ip.h>
82721 +#include <linux/inet_lro.h>
82722 +
82723 +/* Strings to print Link properties */
82724 +static const char *link_speed[] = {
82725 + "Invalid link Speed Value",
82726 + "10 Mbps",
82727 + "100 Mbps",
82728 + "1 Gbps",
82729 + "10 Gbps"
82730 +};
82731 +
82732 +static const char *link_duplex[] = {
82733 + "Invalid Duplex Value",
82734 + "Half Duplex",
82735 + "Full Duplex"
82736 +};
82737 +
82738 +static const char *link_state[] = {
82739 + "",
82740 + "(active)"
82741 +};
82742 +
82743 +void be_print_link_info(struct BE_LINK_STATUS *lnk_status)
82744 +{
82745 + u16 si, di, ai;
82746 +
82747 + /* Port 0 */
82748 + if (lnk_status->mac0_speed && lnk_status->mac0_duplex) {
82749 + /* Port is up and running */
82750 + si = (lnk_status->mac0_speed < 5) ? lnk_status->mac0_speed : 0;
82751 + di = (lnk_status->mac0_duplex < 3) ?
82752 + lnk_status->mac0_duplex : 0;
82753 + ai = (lnk_status->active_port == 0) ? 1 : 0;
82754 + printk(KERN_INFO "PortNo. 0: Speed - %s %s %s\n",
82755 + link_speed[si], link_duplex[di], link_state[ai]);
82756 + } else
82757 + printk(KERN_INFO "PortNo. 0: Down\n");
82758 +
82759 + /* Port 1 */
82760 + if (lnk_status->mac1_speed && lnk_status->mac1_duplex) {
82761 + /* Port is up and running */
82762 + si = (lnk_status->mac1_speed < 5) ? lnk_status->mac1_speed : 0;
82763 + di = (lnk_status->mac1_duplex < 3) ?
82764 + lnk_status->mac1_duplex : 0;
82765 + ai = (lnk_status->active_port == 0) ? 1 : 0;
82766 + printk(KERN_INFO "PortNo. 1: Speed - %s %s %s\n",
82767 + link_speed[si], link_duplex[di], link_state[ai]);
82768 + } else
82769 + printk(KERN_INFO "PortNo. 1: Down\n");
82770 +
82771 + return;
82772 +}
82773 +
82774 +static int
82775 +be_get_frag_header(struct skb_frag_struct *frag, void **mac_hdr,
82776 + void **ip_hdr, void **tcpudp_hdr,
82777 + u64 *hdr_flags, void *priv)
82778 +{
82779 + struct ethhdr *eh;
82780 + struct vlan_ethhdr *veh;
82781 + struct iphdr *iph;
82782 + u8 *va = page_address(frag->page) + frag->page_offset;
82783 + unsigned long ll_hlen;
82784 +
82785 + /* find the mac header, abort if not IPv4 */
82786 +
82787 + prefetch(va);
82788 + eh = (struct ethhdr *)va;
82789 + *mac_hdr = eh;
82790 + ll_hlen = ETH_HLEN;
82791 + if (eh->h_proto != htons(ETH_P_IP)) {
82792 + if (eh->h_proto == htons(ETH_P_8021Q)) {
82793 + veh = (struct vlan_ethhdr *)va;
82794 + if (veh->h_vlan_encapsulated_proto != htons(ETH_P_IP))
82795 + return -1;
82796 +
82797 + ll_hlen += VLAN_HLEN;
82798 +
82799 + } else {
82800 + return -1;
82801 + }
82802 + }
82803 + *hdr_flags = LRO_IPV4;
82804 +
82805 + iph = (struct iphdr *)(va + ll_hlen);
82806 + *ip_hdr = iph;
82807 + if (iph->protocol != IPPROTO_TCP)
82808 + return -1;
82809 + *hdr_flags |= LRO_TCP;
82810 + *tcpudp_hdr = (u8 *) (*ip_hdr) + (iph->ihl << 2);
82811 +
82812 + return 0;
82813 +}
82814 +
82815 +static int benet_open(struct net_device *netdev)
82816 +{
82817 + struct be_net_object *pnob = netdev_priv(netdev);
82818 + struct be_adapter *adapter = pnob->adapter;
82819 + struct net_lro_mgr *lro_mgr;
82820 +
82821 + if (adapter->dev_state < BE_DEV_STATE_INIT)
82822 + return -EAGAIN;
82823 +
82824 + lro_mgr = &pnob->lro_mgr;
82825 + lro_mgr->dev = netdev;
82826 +
82827 + lro_mgr->features = LRO_F_NAPI;
82828 + lro_mgr->ip_summed = CHECKSUM_UNNECESSARY;
82829 + lro_mgr->ip_summed_aggr = CHECKSUM_UNNECESSARY;
82830 + lro_mgr->max_desc = BE_MAX_LRO_DESCRIPTORS;
82831 + lro_mgr->lro_arr = pnob->lro_desc;
82832 + lro_mgr->get_frag_header = be_get_frag_header;
82833 + lro_mgr->max_aggr = adapter->max_rx_coal;
82834 + lro_mgr->frag_align_pad = 2;
82835 + if (lro_mgr->max_aggr > MAX_SKB_FRAGS)
82836 + lro_mgr->max_aggr = MAX_SKB_FRAGS;
82837 +
82838 + adapter->max_rx_coal = BE_LRO_MAX_PKTS;
82839 +
82840 + be_update_link_status(adapter);
82841 +
82842 + /*
82843 + * Set carrier on only if Physical Link up
82844 + * Either of the port link status up signifies this
82845 + */
82846 + if ((adapter->port0_link_sts == BE_PORT_LINK_UP) ||
82847 + (adapter->port1_link_sts == BE_PORT_LINK_UP)) {
82848 + netif_start_queue(netdev);
82849 + netif_carrier_on(netdev);
82850 + }
82851 +
82852 + adapter->dev_state = BE_DEV_STATE_OPEN;
82853 + napi_enable(&pnob->napi);
82854 + be_enable_intr(pnob);
82855 + be_enable_eq_intr(pnob);
82856 + /*
82857 + * RX completion queue may be in dis-armed state. Arm it.
82858 + */
82859 + be_notify_cmpl(pnob, 0, pnob->rx_cq_id, 1);
82860 +
82861 + return 0;
82862 +}
82863 +
82864 +static int benet_close(struct net_device *netdev)
82865 +{
82866 + struct be_net_object *pnob = netdev_priv(netdev);
82867 + struct be_adapter *adapter = pnob->adapter;
82868 +
82869 + netif_stop_queue(netdev);
82870 + synchronize_irq(netdev->irq);
82871 +
82872 + be_wait_nic_tx_cmplx_cmpl(pnob);
82873 + adapter->dev_state = BE_DEV_STATE_INIT;
82874 + netif_carrier_off(netdev);
82875 +
82876 + adapter->port0_link_sts = BE_PORT_LINK_DOWN;
82877 + adapter->port1_link_sts = BE_PORT_LINK_DOWN;
82878 + be_disable_intr(pnob);
82879 + be_disable_eq_intr(pnob);
82880 + napi_disable(&pnob->napi);
82881 +
82882 + return 0;
82883 +}
82884 +
82885 +/*
82886 + * Setting a Mac Address for BE
82887 + * Takes netdev and a void pointer as arguments.
82888 + * The pointer holds the new addres to be used.
82889 + */
82890 +static int benet_set_mac_addr(struct net_device *netdev, void *p)
82891 +{
82892 + struct sockaddr *addr = p;
82893 + struct be_net_object *pnob = netdev_priv(netdev);
82894 +
82895 + memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
82896 + be_rxf_mac_address_read_write(&pnob->fn_obj, 0, 0, false, true, false,
82897 + netdev->dev_addr, NULL, NULL);
82898 + /*
82899 + * Since we are doing Active-Passive failover, both
82900 + * ports should have matching MAC addresses everytime.
82901 + */
82902 + be_rxf_mac_address_read_write(&pnob->fn_obj, 1, 0, false, true, false,
82903 + netdev->dev_addr, NULL, NULL);
82904 +
82905 + return 0;
82906 +}
82907 +
82908 +void be_get_stats_timer_handler(unsigned long context)
82909 +{
82910 + struct be_timer_ctxt *ctxt = (struct be_timer_ctxt *)context;
82911 +
82912 + if (atomic_read(&ctxt->get_stat_flag)) {
82913 + atomic_dec(&ctxt->get_stat_flag);
82914 + up((void *)ctxt->get_stat_sem_addr);
82915 + }
82916 + del_timer(&ctxt->get_stats_timer);
82917 + return;
82918 +}
82919 +
82920 +void be_get_stat_cb(void *context, int status,
82921 + struct MCC_WRB_AMAP *optional_wrb)
82922 +{
82923 + struct be_timer_ctxt *ctxt = (struct be_timer_ctxt *)context;
82924 + /*
82925 + * just up the semaphore if the get_stat_flag
82926 + * reads 1. so that the waiter can continue.
82927 + * If it is 0, then it was handled by the timer handler.
82928 + */
82929 + del_timer(&ctxt->get_stats_timer);
82930 + if (atomic_read(&ctxt->get_stat_flag)) {
82931 + atomic_dec(&ctxt->get_stat_flag);
82932 + up((void *)ctxt->get_stat_sem_addr);
82933 + }
82934 +}
82935 +
82936 +struct net_device_stats *benet_get_stats(struct net_device *dev)
82937 +{
82938 + struct be_net_object *pnob = netdev_priv(dev);
82939 + struct be_adapter *adapter = pnob->adapter;
82940 + u64 pa;
82941 + struct be_timer_ctxt *ctxt = &adapter->timer_ctxt;
82942 +
82943 + if (adapter->dev_state != BE_DEV_STATE_OPEN) {
82944 + /* Return previously read stats */
82945 + return &(adapter->benet_stats);
82946 + }
82947 + /* Get Physical Addr */
82948 + pa = pci_map_single(adapter->pdev, adapter->eth_statsp,
82949 + sizeof(struct FWCMD_ETH_GET_STATISTICS),
82950 + PCI_DMA_FROMDEVICE);
82951 + ctxt->get_stat_sem_addr = (unsigned long)&adapter->get_eth_stat_sem;
82952 + atomic_inc(&ctxt->get_stat_flag);
82953 +
82954 + be_rxf_query_eth_statistics(&pnob->fn_obj, adapter->eth_statsp,
82955 + cpu_to_le64(pa), be_get_stat_cb, ctxt,
82956 + NULL);
82957 +
82958 + ctxt->get_stats_timer.data = (unsigned long)ctxt;
82959 + mod_timer(&ctxt->get_stats_timer, (jiffies + (HZ * 2)));
82960 + down((void *)ctxt->get_stat_sem_addr); /* callback will unblock us */
82961 +
82962 + /* Adding port0 and port1 stats. */
82963 + adapter->benet_stats.rx_packets =
82964 + adapter->eth_statsp->params.response.p0recvdtotalframes +
82965 + adapter->eth_statsp->params.response.p1recvdtotalframes;
82966 + adapter->benet_stats.tx_packets =
82967 + adapter->eth_statsp->params.response.p0xmitunicastframes +
82968 + adapter->eth_statsp->params.response.p1xmitunicastframes;
82969 + adapter->benet_stats.tx_bytes =
82970 + adapter->eth_statsp->params.response.p0xmitbyteslsd +
82971 + adapter->eth_statsp->params.response.p1xmitbyteslsd;
82972 + adapter->benet_stats.rx_errors =
82973 + adapter->eth_statsp->params.response.p0crcerrors +
82974 + adapter->eth_statsp->params.response.p1crcerrors;
82975 + adapter->benet_stats.rx_errors +=
82976 + adapter->eth_statsp->params.response.p0alignmentsymerrs +
82977 + adapter->eth_statsp->params.response.p1alignmentsymerrs;
82978 + adapter->benet_stats.rx_errors +=
82979 + adapter->eth_statsp->params.response.p0inrangelenerrors +
82980 + adapter->eth_statsp->params.response.p1inrangelenerrors;
82981 + adapter->benet_stats.rx_bytes =
82982 + adapter->eth_statsp->params.response.p0recvdtotalbytesLSD +
82983 + adapter->eth_statsp->params.response.p1recvdtotalbytesLSD;
82984 + adapter->benet_stats.rx_crc_errors =
82985 + adapter->eth_statsp->params.response.p0crcerrors +
82986 + adapter->eth_statsp->params.response.p1crcerrors;
82987 +
82988 + adapter->benet_stats.tx_packets +=
82989 + adapter->eth_statsp->params.response.p0xmitmulticastframes +
82990 + adapter->eth_statsp->params.response.p1xmitmulticastframes;
82991 + adapter->benet_stats.tx_packets +=
82992 + adapter->eth_statsp->params.response.p0xmitbroadcastframes +
82993 + adapter->eth_statsp->params.response.p1xmitbroadcastframes;
82994 + adapter->benet_stats.tx_errors = 0;
82995 +
82996 + adapter->benet_stats.multicast =
82997 + adapter->eth_statsp->params.response.p0xmitmulticastframes +
82998 + adapter->eth_statsp->params.response.p1xmitmulticastframes;
82999 +
83000 + adapter->benet_stats.rx_fifo_errors =
83001 + adapter->eth_statsp->params.response.p0rxfifooverflowdropped +
83002 + adapter->eth_statsp->params.response.p1rxfifooverflowdropped;
83003 + adapter->benet_stats.rx_frame_errors =
83004 + adapter->eth_statsp->params.response.p0alignmentsymerrs +
83005 + adapter->eth_statsp->params.response.p1alignmentsymerrs;
83006 + adapter->benet_stats.rx_length_errors =
83007 + adapter->eth_statsp->params.response.p0inrangelenerrors +
83008 + adapter->eth_statsp->params.response.p1inrangelenerrors;
83009 + adapter->benet_stats.rx_length_errors +=
83010 + adapter->eth_statsp->params.response.p0outrangeerrors +
83011 + adapter->eth_statsp->params.response.p1outrangeerrors;
83012 + adapter->benet_stats.rx_length_errors +=
83013 + adapter->eth_statsp->params.response.p0frametoolongerrors +
83014 + adapter->eth_statsp->params.response.p1frametoolongerrors;
83015 +
83016 + pci_unmap_single(adapter->pdev, (ulong) adapter->eth_statsp,
83017 + sizeof(struct FWCMD_ETH_GET_STATISTICS),
83018 + PCI_DMA_FROMDEVICE);
83019 + return &(adapter->benet_stats);
83020 +
83021 +}
83022 +
83023 +static void be_start_tx(struct be_net_object *pnob, u32 nposted)
83024 +{
83025 +#define CSR_ETH_MAX_SQPOSTS 255
83026 + struct SQ_DB_AMAP sqdb;
83027 +
83028 + sqdb.dw[0] = 0;
83029 +
83030 + AMAP_SET_BITS_PTR(SQ_DB, cid, &sqdb, pnob->tx_q_id);
83031 + while (nposted) {
83032 + if (nposted > CSR_ETH_MAX_SQPOSTS) {
83033 + AMAP_SET_BITS_PTR(SQ_DB, numPosted, &sqdb,
83034 + CSR_ETH_MAX_SQPOSTS);
83035 + nposted -= CSR_ETH_MAX_SQPOSTS;
83036 + } else {
83037 + AMAP_SET_BITS_PTR(SQ_DB, numPosted, &sqdb, nposted);
83038 + nposted = 0;
83039 + }
83040 + PD_WRITE(&pnob->fn_obj, etx_sq_db, sqdb.dw[0]);
83041 + }
83042 +
83043 + return;
83044 +}
83045 +
83046 +static void update_tx_rate(struct be_adapter *adapter)
83047 +{
83048 + /* update the rate once in two seconds */
83049 + if ((jiffies - adapter->eth_tx_jiffies) > 2 * (HZ)) {
83050 + u32 r;
83051 + r = adapter->eth_tx_bytes /
83052 + ((jiffies - adapter->eth_tx_jiffies) / (HZ));
83053 + r = (r / 1000000); /* M bytes/s */
83054 + adapter->be_stat.bes_eth_tx_rate = (r * 8); /* M bits/s */
83055 + adapter->eth_tx_jiffies = jiffies;
83056 + adapter->eth_tx_bytes = 0;
83057 + }
83058 +}
83059 +
83060 +static int wrb_cnt_in_skb(struct sk_buff *skb)
83061 +{
83062 + int cnt = 0;
83063 + while (skb) {
83064 + if (skb->len > skb->data_len)
83065 + cnt++;
83066 + cnt += skb_shinfo(skb)->nr_frags;
83067 + skb = skb_shinfo(skb)->frag_list;
83068 + }
83069 + BUG_ON(cnt > BE_MAX_TX_FRAG_COUNT);
83070 + return cnt;
83071 +}
83072 +
83073 +static void wrb_fill(struct ETH_WRB_AMAP *wrb, u64 addr, int len)
83074 +{
83075 + AMAP_SET_BITS_PTR(ETH_WRB, frag_pa_hi, wrb, addr >> 32);
83076 + AMAP_SET_BITS_PTR(ETH_WRB, frag_pa_lo, wrb, addr & 0xFFFFFFFF);
83077 + AMAP_SET_BITS_PTR(ETH_WRB, frag_len, wrb, len);
83078 +}
83079 +
83080 +static void wrb_fill_extra(struct ETH_WRB_AMAP *wrb, struct sk_buff *skb,
83081 + struct be_net_object *pnob)
83082 +{
83083 + wrb->dw[2] = 0;
83084 + wrb->dw[3] = 0;
83085 + AMAP_SET_BITS_PTR(ETH_WRB, crc, wrb, 1);
83086 + if (skb_shinfo(skb)->gso_segs > 1 && skb_shinfo(skb)->gso_size) {
83087 + AMAP_SET_BITS_PTR(ETH_WRB, lso, wrb, 1);
83088 + AMAP_SET_BITS_PTR(ETH_WRB, lso_mss, wrb,
83089 + skb_shinfo(skb)->gso_size);
83090 + } else if (skb->ip_summed == CHECKSUM_PARTIAL) {
83091 + u8 proto = ((struct iphdr *)ip_hdr(skb))->protocol;
83092 + if (proto == IPPROTO_TCP)
83093 + AMAP_SET_BITS_PTR(ETH_WRB, tcpcs, wrb, 1);
83094 + else if (proto == IPPROTO_UDP)
83095 + AMAP_SET_BITS_PTR(ETH_WRB, udpcs, wrb, 1);
83096 + }
83097 + if (pnob->vlan_grp && vlan_tx_tag_present(skb)) {
83098 + AMAP_SET_BITS_PTR(ETH_WRB, vlan, wrb, 1);
83099 + AMAP_SET_BITS_PTR(ETH_WRB, vlan_tag, wrb, vlan_tx_tag_get(skb));
83100 + }
83101 +}
83102 +
83103 +static inline void wrb_copy_extra(struct ETH_WRB_AMAP *to,
83104 + struct ETH_WRB_AMAP *from)
83105 +{
83106 +
83107 + to->dw[2] = from->dw[2];
83108 + to->dw[3] = from->dw[3];
83109 +}
83110 +
83111 +/* Returns the actual count of wrbs used including a possible dummy */
83112 +static int copy_skb_to_txq(struct be_net_object *pnob, struct sk_buff *skb,
83113 + u32 wrb_cnt, u32 *copied)
83114 +{
83115 + u64 busaddr;
83116 + struct ETH_WRB_AMAP *wrb = NULL, *first = NULL;
83117 + u32 i;
83118 + bool dummy = true;
83119 + struct pci_dev *pdev = pnob->adapter->pdev;
83120 +
83121 + if (wrb_cnt & 1)
83122 + wrb_cnt++;
83123 + else
83124 + dummy = false;
83125 +
83126 + atomic_add(wrb_cnt, &pnob->tx_q_used);
83127 +
83128 + while (skb) {
83129 + if (skb->len > skb->data_len) {
83130 + int len = skb->len - skb->data_len;
83131 + busaddr = pci_map_single(pdev, skb->data, len,
83132 + PCI_DMA_TODEVICE);
83133 + busaddr = cpu_to_le64(busaddr);
83134 + wrb = &pnob->tx_q[pnob->tx_q_hd];
83135 + if (first == NULL) {
83136 + wrb_fill_extra(wrb, skb, pnob);
83137 + first = wrb;
83138 + } else {
83139 + wrb_copy_extra(wrb, first);
83140 + }
83141 + wrb_fill(wrb, busaddr, len);
83142 + be_adv_txq_hd(pnob);
83143 + *copied += len;
83144 + }
83145 +
83146 + for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
83147 + struct skb_frag_struct *frag =
83148 + &skb_shinfo(skb)->frags[i];
83149 + busaddr = pci_map_page(pdev, frag->page,
83150 + frag->page_offset, frag->size,
83151 + PCI_DMA_TODEVICE);
83152 + busaddr = cpu_to_le64(busaddr);
83153 + wrb = &pnob->tx_q[pnob->tx_q_hd];
83154 + if (first == NULL) {
83155 + wrb_fill_extra(wrb, skb, pnob);
83156 + first = wrb;
83157 + } else {
83158 + wrb_copy_extra(wrb, first);
83159 + }
83160 + wrb_fill(wrb, busaddr, frag->size);
83161 + be_adv_txq_hd(pnob);
83162 + *copied += frag->size;
83163 + }
83164 + skb = skb_shinfo(skb)->frag_list;
83165 + }
83166 +
83167 + if (dummy) {
83168 + wrb = &pnob->tx_q[pnob->tx_q_hd];
83169 + BUG_ON(first == NULL);
83170 + wrb_copy_extra(wrb, first);
83171 + wrb_fill(wrb, 0, 0);
83172 + be_adv_txq_hd(pnob);
83173 + }
83174 + AMAP_SET_BITS_PTR(ETH_WRB, complete, wrb, 1);
83175 + AMAP_SET_BITS_PTR(ETH_WRB, last, wrb, 1);
83176 + return wrb_cnt;
83177 +}
83178 +
83179 +/* For each skb transmitted, tx_ctxt stores the num of wrbs in the
83180 + * start index and skb pointer in the end index
83181 + */
83182 +static inline void be_tx_wrb_info_remember(struct be_net_object *pnob,
83183 + struct sk_buff *skb, int wrb_cnt,
83184 + u32 start)
83185 +{
83186 + *(u32 *) (&pnob->tx_ctxt[start]) = wrb_cnt;
83187 + index_adv(&start, wrb_cnt - 1, pnob->tx_q_len);
83188 + pnob->tx_ctxt[start] = skb;
83189 +}
83190 +
83191 +static int benet_xmit(struct sk_buff *skb, struct net_device *netdev)
83192 +{
83193 + struct be_net_object *pnob = netdev_priv(netdev);
83194 + struct be_adapter *adapter = pnob->adapter;
83195 + u32 wrb_cnt, copied = 0;
83196 + u32 start = pnob->tx_q_hd;
83197 +
83198 + adapter->be_stat.bes_tx_reqs++;
83199 +
83200 + wrb_cnt = wrb_cnt_in_skb(skb);
83201 + spin_lock_bh(&adapter->txq_lock);
83202 + if ((pnob->tx_q_len - 2 - atomic_read(&pnob->tx_q_used)) <= wrb_cnt) {
83203 + netif_stop_queue(pnob->netdev);
83204 + spin_unlock_bh(&adapter->txq_lock);
83205 + adapter->be_stat.bes_tx_fails++;
83206 + return NETDEV_TX_BUSY;
83207 + }
83208 + spin_unlock_bh(&adapter->txq_lock);
83209 +
83210 + wrb_cnt = copy_skb_to_txq(pnob, skb, wrb_cnt, &copied);
83211 + be_tx_wrb_info_remember(pnob, skb, wrb_cnt, start);
83212 +
83213 + be_start_tx(pnob, wrb_cnt);
83214 +
83215 + adapter->eth_tx_bytes += copied;
83216 + adapter->be_stat.bes_tx_wrbs += wrb_cnt;
83217 + update_tx_rate(adapter);
83218 + netdev->trans_start = jiffies;
83219 +
83220 + return NETDEV_TX_OK;
83221 +}
83222 +
83223 +/*
83224 + * This is the driver entry point to change the mtu of the device
83225 + * Returns 0 for success and errno for failure.
83226 + */
83227 +static int benet_change_mtu(struct net_device *netdev, int new_mtu)
83228 +{
83229 + /*
83230 + * BE supports jumbo frame size upto 9000 bytes including the link layer
83231 + * header. Considering the different variants of frame formats possible
83232 + * like VLAN, SNAP/LLC, the maximum possible value for MTU is 8974 bytes
83233 + */
83234 +
83235 + if (new_mtu < (ETH_ZLEN + ETH_FCS_LEN) || (new_mtu > BE_MAX_MTU)) {
83236 + dev_info(&netdev->dev, "Invalid MTU requested. "
83237 + "Must be between %d and %d bytes\n",
83238 + (ETH_ZLEN + ETH_FCS_LEN), BE_MAX_MTU);
83239 + return -EINVAL;
83240 + }
83241 + dev_info(&netdev->dev, "MTU changed from %d to %d\n",
83242 + netdev->mtu, new_mtu);
83243 + netdev->mtu = new_mtu;
83244 + return 0;
83245 +}
83246 +
83247 +/*
83248 + * This is the driver entry point to register a vlan with the device
83249 + */
83250 +static void benet_vlan_register(struct net_device *netdev,
83251 + struct vlan_group *grp)
83252 +{
83253 + struct be_net_object *pnob = netdev_priv(netdev);
83254 +
83255 + be_disable_eq_intr(pnob);
83256 + pnob->vlan_grp = grp;
83257 + pnob->num_vlans = 0;
83258 + be_enable_eq_intr(pnob);
83259 +}
83260 +
83261 +/*
83262 + * This is the driver entry point to add a vlan vlan_id
83263 + * with the device netdev
83264 + */
83265 +static void benet_vlan_add_vid(struct net_device *netdev, u16 vlan_id)
83266 +{
83267 + struct be_net_object *pnob = netdev_priv(netdev);
83268 +
83269 + if (pnob->num_vlans == (BE_NUM_VLAN_SUPPORTED - 1)) {
83270 + /* no way to return an error */
83271 + dev_info(&netdev->dev,
83272 + "BladeEngine: Cannot configure more than %d Vlans\n",
83273 + BE_NUM_VLAN_SUPPORTED);
83274 + return;
83275 + }
83276 + /* The new vlan tag will be in the slot indicated by num_vlans. */
83277 + pnob->vlan_tag[pnob->num_vlans++] = vlan_id;
83278 + be_rxf_vlan_config(&pnob->fn_obj, false, pnob->num_vlans,
83279 + pnob->vlan_tag, NULL, NULL, NULL);
83280 +}
83281 +
83282 +/*
83283 + * This is the driver entry point to remove a vlan vlan_id
83284 + * with the device netdev
83285 + */
83286 +static void benet_vlan_rem_vid(struct net_device *netdev, u16 vlan_id)
83287 +{
83288 + struct be_net_object *pnob = netdev_priv(netdev);
83289 +
83290 + u32 i, value;
83291 +
83292 + /*
83293 + * In Blade Engine, we support 32 vlan tag filters across both ports.
83294 + * To program a vlan tag, the RXF_RTPR_CSR register is used.
83295 + * Each 32-bit value of RXF_RTDR_CSR can address 2 vlan tag entries.
83296 + * The Vlan table is of depth 16. thus we support 32 tags.
83297 + */
83298 +
83299 + value = vlan_id | VLAN_VALID_BIT;
83300 + for (i = 0; i < BE_NUM_VLAN_SUPPORTED; i++) {
83301 + if (pnob->vlan_tag[i] == vlan_id)
83302 + break;
83303 + }
83304 +
83305 + if (i == BE_NUM_VLAN_SUPPORTED)
83306 + return;
83307 + /* Now compact the vlan tag array by removing hole created. */
83308 + while ((i + 1) < BE_NUM_VLAN_SUPPORTED) {
83309 + pnob->vlan_tag[i] = pnob->vlan_tag[i + 1];
83310 + i++;
83311 + }
83312 + if ((i + 1) == BE_NUM_VLAN_SUPPORTED)
83313 + pnob->vlan_tag[i] = (u16) 0x0;
83314 + pnob->num_vlans--;
83315 + be_rxf_vlan_config(&pnob->fn_obj, false, pnob->num_vlans,
83316 + pnob->vlan_tag, NULL, NULL, NULL);
83317 +}
83318 +
83319 +/*
83320 + * This function is called to program multicast
83321 + * address in the multicast filter of the ASIC.
83322 + */
83323 +static void be_set_multicast_filter(struct net_device *netdev)
83324 +{
83325 + struct be_net_object *pnob = netdev_priv(netdev);
83326 + struct dev_mc_list *mc_ptr;
83327 + u8 mac_addr[32][ETH_ALEN];
83328 + int i;
83329 +
83330 + if (netdev->flags & IFF_ALLMULTI) {
83331 + /* set BE in Multicast promiscuous */
83332 + be_rxf_multicast_config(&pnob->fn_obj, true, 0, NULL, NULL,
83333 + NULL, NULL);
83334 + return;
83335 + }
83336 +
83337 + for (mc_ptr = netdev->mc_list, i = 0; mc_ptr;
83338 + mc_ptr = mc_ptr->next, i++) {
83339 + memcpy(&mac_addr[i][0], mc_ptr->dmi_addr, ETH_ALEN);
83340 + }
83341 +
83342 + /* reset the promiscuous mode also. */
83343 + be_rxf_multicast_config(&pnob->fn_obj, false, i,
83344 + &mac_addr[0][0], NULL, NULL, NULL);
83345 +}
83346 +
83347 +/*
83348 + * This is the driver entry point to set multicast list
83349 + * with the device netdev. This function will be used to
83350 + * set promiscuous mode or multicast promiscuous mode
83351 + * or multicast mode....
83352 + */
83353 +static void benet_set_multicast_list(struct net_device *netdev)
83354 +{
83355 + struct be_net_object *pnob = netdev_priv(netdev);
83356 +
83357 + if (netdev->flags & IFF_PROMISC) {
83358 + be_rxf_promiscuous(&pnob->fn_obj, 1, 1, NULL, NULL, NULL);
83359 + } else {
83360 + be_rxf_promiscuous(&pnob->fn_obj, 0, 0, NULL, NULL, NULL);
83361 + be_set_multicast_filter(netdev);
83362 + }
83363 +}
83364 +
83365 +int benet_init(struct net_device *netdev)
83366 +{
83367 + struct be_net_object *pnob = netdev_priv(netdev);
83368 + struct be_adapter *adapter = pnob->adapter;
83369 +
83370 + ether_setup(netdev);
83371 +
83372 + netdev->open = &benet_open;
83373 + netdev->stop = &benet_close;
83374 + netdev->hard_start_xmit = &benet_xmit;
83375 +
83376 + netdev->get_stats = &benet_get_stats;
83377 +
83378 + netdev->set_multicast_list = &benet_set_multicast_list;
83379 +
83380 + netdev->change_mtu = &benet_change_mtu;
83381 + netdev->set_mac_address = &benet_set_mac_addr;
83382 +
83383 + netdev->vlan_rx_register = benet_vlan_register;
83384 + netdev->vlan_rx_add_vid = benet_vlan_add_vid;
83385 + netdev->vlan_rx_kill_vid = benet_vlan_rem_vid;
83386 +
83387 + netdev->features =
83388 + NETIF_F_SG | NETIF_F_HIGHDMA | NETIF_F_HW_VLAN_RX | NETIF_F_TSO |
83389 + NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_FILTER | NETIF_F_IP_CSUM;
83390 +
83391 + netdev->flags |= IFF_MULTICAST;
83392 +
83393 + /* If device is DAC Capable, set the HIGHDMA flag for netdevice. */
83394 + if (adapter->dma_64bit_cap)
83395 + netdev->features |= NETIF_F_HIGHDMA;
83396 +
83397 + SET_ETHTOOL_OPS(netdev, &be_ethtool_ops);
83398 + return 0;
83399 +}
83400 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/bestatus.h linux-2.6.29-rc3.owrt/drivers/staging/benet/bestatus.h
83401 --- linux-2.6.29.owrt/drivers/staging/benet/bestatus.h 1970-01-01 01:00:00.000000000 +0100
83402 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/bestatus.h 2009-05-10 23:48:29.000000000 +0200
83403 @@ -0,0 +1,103 @@
83404 +/*
83405 + * Copyright (C) 2005 - 2008 ServerEngines
83406 + * All rights reserved.
83407 + *
83408 + * This program is free software; you can redistribute it and/or
83409 + * modify it under the terms of the GNU General Public License version 2
83410 + * as published by the Free Software Foundation. The full GNU General
83411 + * Public License is included in this distribution in the file called COPYING.
83412 + *
83413 + * Contact Information:
83414 + * linux-drivers@serverengines.com
83415 + *
83416 + * ServerEngines
83417 + * 209 N. Fair Oaks Ave
83418 + * Sunnyvale, CA 94085
83419 + */
83420 +#ifndef _BESTATUS_H_
83421 +#define _BESTATUS_H_
83422 +
83423 +#define BE_SUCCESS (0x00000000L)
83424 +/*
83425 + * MessageId: BE_PENDING
83426 + * The BladeEngine Driver call succeeded, and pended operation.
83427 + */
83428 +#define BE_PENDING (0x20070001L)
83429 +#define BE_STATUS_PENDING (BE_PENDING)
83430 +/*
83431 + * MessageId: BE_NOT_OK
83432 + * An error occurred.
83433 + */
83434 +#define BE_NOT_OK (0xE0070002L)
83435 +/*
83436 + * MessageId: BE_STATUS_SYSTEM_RESOURCES
83437 + * Insufficient host system resources exist to complete the API.
83438 + */
83439 +#define BE_STATUS_SYSTEM_RESOURCES (0xE0070003L)
83440 +/*
83441 + * MessageId: BE_STATUS_CHIP_RESOURCES
83442 + * Insufficient chip resources exist to complete the API.
83443 + */
83444 +#define BE_STATUS_CHIP_RESOURCES (0xE0070004L)
83445 +/*
83446 + * MessageId: BE_STATUS_NO_RESOURCE
83447 + * Insufficient resources to complete request.
83448 + */
83449 +#define BE_STATUS_NO_RESOURCE (0xE0070005L)
83450 +/*
83451 + * MessageId: BE_STATUS_BUSY
83452 + * Resource is currently busy.
83453 + */
83454 +#define BE_STATUS_BUSY (0xE0070006L)
83455 +/*
83456 + * MessageId: BE_STATUS_INVALID_PARAMETER
83457 + * Invalid Parameter in request.
83458 + */
83459 +#define BE_STATUS_INVALID_PARAMETER (0xE0000007L)
83460 +/*
83461 + * MessageId: BE_STATUS_NOT_SUPPORTED
83462 + * Requested operation is not supported.
83463 + */
83464 +#define BE_STATUS_NOT_SUPPORTED (0xE000000DL)
83465 +
83466 +/*
83467 + * ***************************************************************************
83468 + * E T H E R N E T S T A T U S
83469 + * ***************************************************************************
83470 + */
83471 +
83472 +/*
83473 + * MessageId: BE_ETH_TX_ERROR
83474 + * The Ethernet device driver failed to transmit a packet.
83475 + */
83476 +#define BE_ETH_TX_ERROR (0xE0070101L)
83477 +
83478 +/*
83479 + * ***************************************************************************
83480 + * S H A R E D S T A T U S
83481 + * ***************************************************************************
83482 + */
83483 +
83484 +/*
83485 + * MessageId: BE_STATUS_VBD_INVALID_VERSION
83486 + * The device driver is not compatible with this version of the VBD.
83487 + */
83488 +#define BE_STATUS_INVALID_VERSION (0xE0070402L)
83489 +/*
83490 + * MessageId: BE_STATUS_DOMAIN_DENIED
83491 + * The operation failed to complete due to insufficient access
83492 + * rights for the requesting domain.
83493 + */
83494 +#define BE_STATUS_DOMAIN_DENIED (0xE0070403L)
83495 +/*
83496 + * MessageId: BE_STATUS_TCP_NOT_STARTED
83497 + * The embedded TCP/IP stack has not been started.
83498 + */
83499 +#define BE_STATUS_TCP_NOT_STARTED (0xE0070409L)
83500 +/*
83501 + * MessageId: BE_STATUS_NO_MCC_WRB
83502 + * No free MCC WRB are available for posting the request.
83503 + */
83504 +#define BE_STATUS_NO_MCC_WRB (0xE0070414L)
83505 +
83506 +#endif /* _BESTATUS_ */
83507 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/cev.h linux-2.6.29-rc3.owrt/drivers/staging/benet/cev.h
83508 --- linux-2.6.29.owrt/drivers/staging/benet/cev.h 1970-01-01 01:00:00.000000000 +0100
83509 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/cev.h 2009-05-10 23:48:29.000000000 +0200
83510 @@ -0,0 +1,243 @@
83511 +/*
83512 + * Copyright (C) 2005 - 2008 ServerEngines
83513 + * All rights reserved.
83514 + *
83515 + * This program is free software; you can redistribute it and/or
83516 + * modify it under the terms of the GNU General Public License version 2
83517 + * as published by the Free Software Foundation. The full GNU General
83518 + * Public License is included in this distribution in the file called COPYING.
83519 + *
83520 + * Contact Information:
83521 + * linux-drivers@serverengines.com
83522 + *
83523 + * ServerEngines
83524 + * 209 N. Fair Oaks Ave
83525 + * Sunnyvale, CA 94085
83526 + */
83527 +/*
83528 + * Autogenerated by srcgen version: 0127
83529 + */
83530 +#ifndef __cev_amap_h__
83531 +#define __cev_amap_h__
83532 +#include "ep.h"
83533 +
83534 +/*
83535 + * Host Interrupt Status Register 0. The first of four application
83536 + * interrupt status registers. This register contains the interrupts
83537 + * for Event Queues EQ0 through EQ31.
83538 + */
83539 +struct BE_CEV_ISR0_CSR_AMAP {
83540 + u8 interrupt0; /* DWORD 0 */
83541 + u8 interrupt1; /* DWORD 0 */
83542 + u8 interrupt2; /* DWORD 0 */
83543 + u8 interrupt3; /* DWORD 0 */
83544 + u8 interrupt4; /* DWORD 0 */
83545 + u8 interrupt5; /* DWORD 0 */
83546 + u8 interrupt6; /* DWORD 0 */
83547 + u8 interrupt7; /* DWORD 0 */
83548 + u8 interrupt8; /* DWORD 0 */
83549 + u8 interrupt9; /* DWORD 0 */
83550 + u8 interrupt10; /* DWORD 0 */
83551 + u8 interrupt11; /* DWORD 0 */
83552 + u8 interrupt12; /* DWORD 0 */
83553 + u8 interrupt13; /* DWORD 0 */
83554 + u8 interrupt14; /* DWORD 0 */
83555 + u8 interrupt15; /* DWORD 0 */
83556 + u8 interrupt16; /* DWORD 0 */
83557 + u8 interrupt17; /* DWORD 0 */
83558 + u8 interrupt18; /* DWORD 0 */
83559 + u8 interrupt19; /* DWORD 0 */
83560 + u8 interrupt20; /* DWORD 0 */
83561 + u8 interrupt21; /* DWORD 0 */
83562 + u8 interrupt22; /* DWORD 0 */
83563 + u8 interrupt23; /* DWORD 0 */
83564 + u8 interrupt24; /* DWORD 0 */
83565 + u8 interrupt25; /* DWORD 0 */
83566 + u8 interrupt26; /* DWORD 0 */
83567 + u8 interrupt27; /* DWORD 0 */
83568 + u8 interrupt28; /* DWORD 0 */
83569 + u8 interrupt29; /* DWORD 0 */
83570 + u8 interrupt30; /* DWORD 0 */
83571 + u8 interrupt31; /* DWORD 0 */
83572 +} __packed;
83573 +struct CEV_ISR0_CSR_AMAP {
83574 + u32 dw[1];
83575 +};
83576 +
83577 +/*
83578 + * Host Interrupt Status Register 1. The second of four application
83579 + * interrupt status registers. This register contains the interrupts
83580 + * for Event Queues EQ32 through EQ63.
83581 + */
83582 +struct BE_CEV_ISR1_CSR_AMAP {
83583 + u8 interrupt32; /* DWORD 0 */
83584 + u8 interrupt33; /* DWORD 0 */
83585 + u8 interrupt34; /* DWORD 0 */
83586 + u8 interrupt35; /* DWORD 0 */
83587 + u8 interrupt36; /* DWORD 0 */
83588 + u8 interrupt37; /* DWORD 0 */
83589 + u8 interrupt38; /* DWORD 0 */
83590 + u8 interrupt39; /* DWORD 0 */
83591 + u8 interrupt40; /* DWORD 0 */
83592 + u8 interrupt41; /* DWORD 0 */
83593 + u8 interrupt42; /* DWORD 0 */
83594 + u8 interrupt43; /* DWORD 0 */
83595 + u8 interrupt44; /* DWORD 0 */
83596 + u8 interrupt45; /* DWORD 0 */
83597 + u8 interrupt46; /* DWORD 0 */
83598 + u8 interrupt47; /* DWORD 0 */
83599 + u8 interrupt48; /* DWORD 0 */
83600 + u8 interrupt49; /* DWORD 0 */
83601 + u8 interrupt50; /* DWORD 0 */
83602 + u8 interrupt51; /* DWORD 0 */
83603 + u8 interrupt52; /* DWORD 0 */
83604 + u8 interrupt53; /* DWORD 0 */
83605 + u8 interrupt54; /* DWORD 0 */
83606 + u8 interrupt55; /* DWORD 0 */
83607 + u8 interrupt56; /* DWORD 0 */
83608 + u8 interrupt57; /* DWORD 0 */
83609 + u8 interrupt58; /* DWORD 0 */
83610 + u8 interrupt59; /* DWORD 0 */
83611 + u8 interrupt60; /* DWORD 0 */
83612 + u8 interrupt61; /* DWORD 0 */
83613 + u8 interrupt62; /* DWORD 0 */
83614 + u8 interrupt63; /* DWORD 0 */
83615 +} __packed;
83616 +struct CEV_ISR1_CSR_AMAP {
83617 + u32 dw[1];
83618 +};
83619 +/*
83620 + * Host Interrupt Status Register 2. The third of four application
83621 + * interrupt status registers. This register contains the interrupts
83622 + * for Event Queues EQ64 through EQ95.
83623 + */
83624 +struct BE_CEV_ISR2_CSR_AMAP {
83625 + u8 interrupt64; /* DWORD 0 */
83626 + u8 interrupt65; /* DWORD 0 */
83627 + u8 interrupt66; /* DWORD 0 */
83628 + u8 interrupt67; /* DWORD 0 */
83629 + u8 interrupt68; /* DWORD 0 */
83630 + u8 interrupt69; /* DWORD 0 */
83631 + u8 interrupt70; /* DWORD 0 */
83632 + u8 interrupt71; /* DWORD 0 */
83633 + u8 interrupt72; /* DWORD 0 */
83634 + u8 interrupt73; /* DWORD 0 */
83635 + u8 interrupt74; /* DWORD 0 */
83636 + u8 interrupt75; /* DWORD 0 */
83637 + u8 interrupt76; /* DWORD 0 */
83638 + u8 interrupt77; /* DWORD 0 */
83639 + u8 interrupt78; /* DWORD 0 */
83640 + u8 interrupt79; /* DWORD 0 */
83641 + u8 interrupt80; /* DWORD 0 */
83642 + u8 interrupt81; /* DWORD 0 */
83643 + u8 interrupt82; /* DWORD 0 */
83644 + u8 interrupt83; /* DWORD 0 */
83645 + u8 interrupt84; /* DWORD 0 */
83646 + u8 interrupt85; /* DWORD 0 */
83647 + u8 interrupt86; /* DWORD 0 */
83648 + u8 interrupt87; /* DWORD 0 */
83649 + u8 interrupt88; /* DWORD 0 */
83650 + u8 interrupt89; /* DWORD 0 */
83651 + u8 interrupt90; /* DWORD 0 */
83652 + u8 interrupt91; /* DWORD 0 */
83653 + u8 interrupt92; /* DWORD 0 */
83654 + u8 interrupt93; /* DWORD 0 */
83655 + u8 interrupt94; /* DWORD 0 */
83656 + u8 interrupt95; /* DWORD 0 */
83657 +} __packed;
83658 +struct CEV_ISR2_CSR_AMAP {
83659 + u32 dw[1];
83660 +};
83661 +
83662 +/*
83663 + * Host Interrupt Status Register 3. The fourth of four application
83664 + * interrupt status registers. This register contains the interrupts
83665 + * for Event Queues EQ96 through EQ127.
83666 + */
83667 +struct BE_CEV_ISR3_CSR_AMAP {
83668 + u8 interrupt96; /* DWORD 0 */
83669 + u8 interrupt97; /* DWORD 0 */
83670 + u8 interrupt98; /* DWORD 0 */
83671 + u8 interrupt99; /* DWORD 0 */
83672 + u8 interrupt100; /* DWORD 0 */
83673 + u8 interrupt101; /* DWORD 0 */
83674 + u8 interrupt102; /* DWORD 0 */
83675 + u8 interrupt103; /* DWORD 0 */
83676 + u8 interrupt104; /* DWORD 0 */
83677 + u8 interrupt105; /* DWORD 0 */
83678 + u8 interrupt106; /* DWORD 0 */
83679 + u8 interrupt107; /* DWORD 0 */
83680 + u8 interrupt108; /* DWORD 0 */
83681 + u8 interrupt109; /* DWORD 0 */
83682 + u8 interrupt110; /* DWORD 0 */
83683 + u8 interrupt111; /* DWORD 0 */
83684 + u8 interrupt112; /* DWORD 0 */
83685 + u8 interrupt113; /* DWORD 0 */
83686 + u8 interrupt114; /* DWORD 0 */
83687 + u8 interrupt115; /* DWORD 0 */
83688 + u8 interrupt116; /* DWORD 0 */
83689 + u8 interrupt117; /* DWORD 0 */
83690 + u8 interrupt118; /* DWORD 0 */
83691 + u8 interrupt119; /* DWORD 0 */
83692 + u8 interrupt120; /* DWORD 0 */
83693 + u8 interrupt121; /* DWORD 0 */
83694 + u8 interrupt122; /* DWORD 0 */
83695 + u8 interrupt123; /* DWORD 0 */
83696 + u8 interrupt124; /* DWORD 0 */
83697 + u8 interrupt125; /* DWORD 0 */
83698 + u8 interrupt126; /* DWORD 0 */
83699 + u8 interrupt127; /* DWORD 0 */
83700 +} __packed;
83701 +struct CEV_ISR3_CSR_AMAP {
83702 + u32 dw[1];
83703 +};
83704 +
83705 +/* Completions and Events block Registers. */
83706 +struct BE_CEV_CSRMAP_AMAP {
83707 + u8 rsvd0[32]; /* DWORD 0 */
83708 + u8 rsvd1[32]; /* DWORD 1 */
83709 + u8 rsvd2[32]; /* DWORD 2 */
83710 + u8 rsvd3[32]; /* DWORD 3 */
83711 + struct BE_CEV_ISR0_CSR_AMAP isr0;
83712 + struct BE_CEV_ISR1_CSR_AMAP isr1;
83713 + struct BE_CEV_ISR2_CSR_AMAP isr2;
83714 + struct BE_CEV_ISR3_CSR_AMAP isr3;
83715 + u8 rsvd4[32]; /* DWORD 8 */
83716 + u8 rsvd5[32]; /* DWORD 9 */
83717 + u8 rsvd6[32]; /* DWORD 10 */
83718 + u8 rsvd7[32]; /* DWORD 11 */
83719 + u8 rsvd8[32]; /* DWORD 12 */
83720 + u8 rsvd9[32]; /* DWORD 13 */
83721 + u8 rsvd10[32]; /* DWORD 14 */
83722 + u8 rsvd11[32]; /* DWORD 15 */
83723 + u8 rsvd12[32]; /* DWORD 16 */
83724 + u8 rsvd13[32]; /* DWORD 17 */
83725 + u8 rsvd14[32]; /* DWORD 18 */
83726 + u8 rsvd15[32]; /* DWORD 19 */
83727 + u8 rsvd16[32]; /* DWORD 20 */
83728 + u8 rsvd17[32]; /* DWORD 21 */
83729 + u8 rsvd18[32]; /* DWORD 22 */
83730 + u8 rsvd19[32]; /* DWORD 23 */
83731 + u8 rsvd20[32]; /* DWORD 24 */
83732 + u8 rsvd21[32]; /* DWORD 25 */
83733 + u8 rsvd22[32]; /* DWORD 26 */
83734 + u8 rsvd23[32]; /* DWORD 27 */
83735 + u8 rsvd24[32]; /* DWORD 28 */
83736 + u8 rsvd25[32]; /* DWORD 29 */
83737 + u8 rsvd26[32]; /* DWORD 30 */
83738 + u8 rsvd27[32]; /* DWORD 31 */
83739 + u8 rsvd28[32]; /* DWORD 32 */
83740 + u8 rsvd29[32]; /* DWORD 33 */
83741 + u8 rsvd30[192]; /* DWORD 34 */
83742 + u8 rsvd31[192]; /* DWORD 40 */
83743 + u8 rsvd32[160]; /* DWORD 46 */
83744 + u8 rsvd33[160]; /* DWORD 51 */
83745 + u8 rsvd34[160]; /* DWORD 56 */
83746 + u8 rsvd35[96]; /* DWORD 61 */
83747 + u8 rsvd36[192][32]; /* DWORD 64 */
83748 +} __packed;
83749 +struct CEV_CSRMAP_AMAP {
83750 + u32 dw[256];
83751 +};
83752 +
83753 +#endif /* __cev_amap_h__ */
83754 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/cq.c linux-2.6.29-rc3.owrt/drivers/staging/benet/cq.c
83755 --- linux-2.6.29.owrt/drivers/staging/benet/cq.c 1970-01-01 01:00:00.000000000 +0100
83756 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/cq.c 2009-05-10 23:48:29.000000000 +0200
83757 @@ -0,0 +1,211 @@
83758 +/*
83759 + * Copyright (C) 2005 - 2008 ServerEngines
83760 + * All rights reserved.
83761 + *
83762 + * This program is free software; you can redistribute it and/or
83763 + * modify it under the terms of the GNU General Public License version 2
83764 + * as published by the Free Software Foundation. The full GNU General
83765 + * Public License is included in this distribution in the file called COPYING.
83766 + *
83767 + * Contact Information:
83768 + * linux-drivers@serverengines.com
83769 + *
83770 + * ServerEngines
83771 + * 209 N. Fair Oaks Ave
83772 + * Sunnyvale, CA 94085
83773 + */
83774 +#include "hwlib.h"
83775 +#include "bestatus.h"
83776 +
83777 +/*
83778 + * Completion Queue Objects
83779 + */
83780 +/*
83781 + *============================================================================
83782 + * P U B L I C R O U T I N E S
83783 + *============================================================================
83784 + */
83785 +
83786 +/*
83787 + This routine creates a completion queue based on the client completion
83788 + queue configuration information.
83789 +
83790 +
83791 + FunctionObject - Handle to a function object
83792 + CqBaseVa - Base VA for a the CQ ring
83793 + NumEntries - CEV_CQ_CNT_* values
83794 + solEventEnable - 0 = All CQEs can generate Events if CQ is eventable
83795 + 1 = only CQEs with solicited bit set are eventable
83796 + eventable - Eventable CQ, generates interrupts.
83797 + nodelay - 1 = Force interrupt, relevent if CQ eventable.
83798 + Interrupt is asserted immediately after EQE
83799 + write is confirmed, regardless of EQ Timer
83800 + or watermark settings.
83801 + wme - Enable watermark based coalescing
83802 + wmThresh - High watermark(CQ fullness at which event
83803 + or interrupt should be asserted). These are the
83804 + CEV_WATERMARK encoded values.
83805 + EqObject - EQ Handle to assign to this CQ
83806 + ppCqObject - Internal CQ Handle returned.
83807 +
83808 + Returns BE_SUCCESS if successfull, otherwise a useful error code is
83809 + returned.
83810 +
83811 + IRQL < DISPATCH_LEVEL
83812 +
83813 +*/
83814 +int be_cq_create(struct be_function_object *pfob,
83815 + struct ring_desc *rd, u32 length, bool solicited_eventable,
83816 + bool no_delay, u32 wm_thresh,
83817 + struct be_eq_object *eq_object, struct be_cq_object *cq_object)
83818 +{
83819 + int status = BE_SUCCESS;
83820 + u32 num_entries_encoding;
83821 + u32 num_entries = length / sizeof(struct MCC_CQ_ENTRY_AMAP);
83822 + struct FWCMD_COMMON_CQ_CREATE *fwcmd = NULL;
83823 + struct MCC_WRB_AMAP *wrb = NULL;
83824 + u32 n;
83825 + unsigned long irql;
83826 +
83827 + ASSERT(rd);
83828 + ASSERT(cq_object);
83829 + ASSERT(length % sizeof(struct MCC_CQ_ENTRY_AMAP) == 0);
83830 +
83831 + switch (num_entries) {
83832 + case 256:
83833 + num_entries_encoding = CEV_CQ_CNT_256;
83834 + break;
83835 + case 512:
83836 + num_entries_encoding = CEV_CQ_CNT_512;
83837 + break;
83838 + case 1024:
83839 + num_entries_encoding = CEV_CQ_CNT_1024;
83840 + break;
83841 + default:
83842 + ASSERT(0);
83843 + return BE_STATUS_INVALID_PARAMETER;
83844 + }
83845 +
83846 + /*
83847 + * All cq entries all the same size. Use iSCSI version
83848 + * as a test for the proper rd length.
83849 + */
83850 + memset(cq_object, 0, sizeof(*cq_object));
83851 +
83852 + atomic_set(&cq_object->ref_count, 0);
83853 + cq_object->parent_function = pfob;
83854 + cq_object->eq_object = eq_object;
83855 + cq_object->num_entries = num_entries;
83856 + /* save for MCC cq processing */
83857 + cq_object->va = rd->va;
83858 +
83859 + /* map into UT. */
83860 + length = num_entries * sizeof(struct MCC_CQ_ENTRY_AMAP);
83861 +
83862 + spin_lock_irqsave(&pfob->post_lock, irql);
83863 +
83864 + wrb = be_function_peek_mcc_wrb(pfob);
83865 + if (!wrb) {
83866 + ASSERT(wrb);
83867 + TRACE(DL_ERR, "No free MCC WRBs in create EQ.");
83868 + status = BE_STATUS_NO_MCC_WRB;
83869 + goto Error;
83870 + }
83871 + /* Prepares an embedded fwcmd, including request/response sizes. */
83872 + fwcmd = BE_PREPARE_EMBEDDED_FWCMD(pfob, wrb, COMMON_CQ_CREATE);
83873 +
83874 + fwcmd->params.request.num_pages = PAGES_SPANNED(OFFSET_IN_PAGE(rd->va),
83875 + length);
83876 +
83877 + AMAP_SET_BITS_PTR(CQ_CONTEXT, valid, &fwcmd->params.request.context, 1);
83878 + n = pfob->pci_function_number;
83879 + AMAP_SET_BITS_PTR(CQ_CONTEXT, Func, &fwcmd->params.request.context, n);
83880 +
83881 + n = (eq_object != NULL);
83882 + AMAP_SET_BITS_PTR(CQ_CONTEXT, Eventable,
83883 + &fwcmd->params.request.context, n);
83884 + AMAP_SET_BITS_PTR(CQ_CONTEXT, Armed, &fwcmd->params.request.context, 1);
83885 +
83886 + n = eq_object ? eq_object->eq_id : 0;
83887 + AMAP_SET_BITS_PTR(CQ_CONTEXT, EQID, &fwcmd->params.request.context, n);
83888 + AMAP_SET_BITS_PTR(CQ_CONTEXT, Count,
83889 + &fwcmd->params.request.context, num_entries_encoding);
83890 +
83891 + n = 0; /* Protection Domain is always 0 in Linux driver */
83892 + AMAP_SET_BITS_PTR(CQ_CONTEXT, PD, &fwcmd->params.request.context, n);
83893 + AMAP_SET_BITS_PTR(CQ_CONTEXT, NoDelay,
83894 + &fwcmd->params.request.context, no_delay);
83895 + AMAP_SET_BITS_PTR(CQ_CONTEXT, SolEvent,
83896 + &fwcmd->params.request.context, solicited_eventable);
83897 +
83898 + n = (wm_thresh != 0xFFFFFFFF);
83899 + AMAP_SET_BITS_PTR(CQ_CONTEXT, WME, &fwcmd->params.request.context, n);
83900 +
83901 + n = (n ? wm_thresh : 0);
83902 + AMAP_SET_BITS_PTR(CQ_CONTEXT, Watermark,
83903 + &fwcmd->params.request.context, n);
83904 + /* Create a page list for the FWCMD. */
83905 + be_rd_to_pa_list(rd, fwcmd->params.request.pages,
83906 + ARRAY_SIZE(fwcmd->params.request.pages));
83907 +
83908 + /* Post the f/w command */
83909 + status = be_function_post_mcc_wrb(pfob, wrb, NULL, NULL, NULL,
83910 + NULL, NULL, fwcmd, NULL);
83911 + if (status != BE_SUCCESS) {
83912 + TRACE(DL_ERR, "MCC to create CQ failed.");
83913 + goto Error;
83914 + }
83915 + /* Remember the CQ id. */
83916 + cq_object->cq_id = fwcmd->params.response.cq_id;
83917 +
83918 + /* insert this cq into eq_object reference */
83919 + if (eq_object) {
83920 + atomic_inc(&eq_object->ref_count);
83921 + list_add_tail(&cq_object->cqlist_for_eq,
83922 + &eq_object->cq_list_head);
83923 + }
83924 +
83925 +Error:
83926 + spin_unlock_irqrestore(&pfob->post_lock, irql);
83927 +
83928 + if (pfob->pend_queue_driving && pfob->mcc) {
83929 + pfob->pend_queue_driving = 0;
83930 + be_drive_mcc_wrb_queue(pfob->mcc);
83931 + }
83932 + return status;
83933 +}
83934 +
83935 +/*
83936 +
83937 + Deferences the given object. Once the object's reference count drops to
83938 + zero, the object is destroyed and all resources that are held by this object
83939 + are released. The on-chip context is also destroyed along with the queue
83940 + ID, and any mappings made into the UT.
83941 +
83942 + cq_object - CQ handle returned from cq_object_create.
83943 +
83944 + returns the current reference count on the object
83945 +
83946 + IRQL: IRQL < DISPATCH_LEVEL
83947 +*/
83948 +int be_cq_destroy(struct be_cq_object *cq_object)
83949 +{
83950 + int status = 0;
83951 +
83952 + /* Nothing should reference this CQ at this point. */
83953 + ASSERT(atomic_read(&cq_object->ref_count) == 0);
83954 +
83955 + /* Send fwcmd to destroy the CQ. */
83956 + status = be_function_ring_destroy(cq_object->parent_function,
83957 + cq_object->cq_id, FWCMD_RING_TYPE_CQ,
83958 + NULL, NULL, NULL, NULL);
83959 + ASSERT(status == 0);
83960 +
83961 + /* Remove reference if this is an eventable CQ. */
83962 + if (cq_object->eq_object) {
83963 + atomic_dec(&cq_object->eq_object->ref_count);
83964 + list_del(&cq_object->cqlist_for_eq);
83965 + }
83966 + return BE_SUCCESS;
83967 +}
83968 +
83969 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/descriptors.h linux-2.6.29-rc3.owrt/drivers/staging/benet/descriptors.h
83970 --- linux-2.6.29.owrt/drivers/staging/benet/descriptors.h 1970-01-01 01:00:00.000000000 +0100
83971 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/descriptors.h 2009-05-10 23:48:29.000000000 +0200
83972 @@ -0,0 +1,71 @@
83973 +/*
83974 + * Copyright (C) 2005 - 2008 ServerEngines
83975 + * All rights reserved.
83976 + *
83977 + * This program is free software; you can redistribute it and/or
83978 + * modify it under the terms of the GNU General Public License version 2
83979 + * as published by the Free Software Foundation. The full GNU General
83980 + * Public License is included in this distribution in the file called COPYING.
83981 + *
83982 + * Contact Information:
83983 + * linux-drivers@serverengines.com
83984 + *
83985 + * ServerEngines
83986 + * 209 N. Fair Oaks Ave
83987 + * Sunnyvale, CA 94085
83988 + */
83989 +/*
83990 + * Autogenerated by srcgen version: 0127
83991 + */
83992 +#ifndef __descriptors_amap_h__
83993 +#define __descriptors_amap_h__
83994 +
83995 +/*
83996 + * --- IPC_NODE_ID_ENUM ---
83997 + * IPC processor id values
83998 + */
83999 +#define TPOST_NODE_ID (0) /* TPOST ID */
84000 +#define TPRE_NODE_ID (1) /* TPRE ID */
84001 +#define TXULP0_NODE_ID (2) /* TXULP0 ID */
84002 +#define TXULP1_NODE_ID (3) /* TXULP1 ID */
84003 +#define TXULP2_NODE_ID (4) /* TXULP2 ID */
84004 +#define RXULP0_NODE_ID (5) /* RXULP0 ID */
84005 +#define RXULP1_NODE_ID (6) /* RXULP1 ID */
84006 +#define RXULP2_NODE_ID (7) /* RXULP2 ID */
84007 +#define MPU_NODE_ID (15) /* MPU ID */
84008 +
84009 +/*
84010 + * --- MAC_ID_ENUM ---
84011 + * Meaning of the mac_id field in rxpp_eth_d
84012 + */
84013 +#define PORT0_HOST_MAC0 (0) /* PD 0, Port 0, host networking, MAC 0. */
84014 +#define PORT0_HOST_MAC1 (1) /* PD 0, Port 0, host networking, MAC 1. */
84015 +#define PORT0_STORAGE_MAC0 (2) /* PD 0, Port 0, host storage, MAC 0. */
84016 +#define PORT0_STORAGE_MAC1 (3) /* PD 0, Port 0, host storage, MAC 1. */
84017 +#define PORT1_HOST_MAC0 (4) /* PD 0, Port 1 host networking, MAC 0. */
84018 +#define PORT1_HOST_MAC1 (5) /* PD 0, Port 1 host networking, MAC 1. */
84019 +#define PORT1_STORAGE_MAC0 (6) /* PD 0, Port 1 host storage, MAC 0. */
84020 +#define PORT1_STORAGE_MAC1 (7) /* PD 0, Port 1 host storage, MAC 1. */
84021 +#define FIRST_VM_MAC (8) /* PD 1 MAC. Protection domains have IDs */
84022 + /* from 0x8-0x26, one per PD. */
84023 +#define LAST_VM_MAC (38) /* PD 31 MAC. */
84024 +#define MGMT_MAC (39) /* Management port MAC. */
84025 +#define MARBLE_MAC0 (59) /* Used for flushing function 0 receive */
84026 + /*
84027 + * queues before re-using a torn-down
84028 + * receive ring. the DA =
84029 + * 00-00-00-00-00-00, and the MSB of the
84030 + * SA = 00
84031 + */
84032 +#define MARBLE_MAC1 (60) /* Used for flushing function 1 receive */
84033 + /*
84034 + * queues before re-using a torn-down
84035 + * receive ring. the DA =
84036 + * 00-00-00-00-00-00, and the MSB of the
84037 + * SA != 00
84038 + */
84039 +#define NULL_MAC (61) /* Promiscuous mode, indicates no match */
84040 +#define MCAST_MAC (62) /* Multicast match. */
84041 +#define BCAST_MATCH (63) /* Broadcast match. */
84042 +
84043 +#endif /* __descriptors_amap_h__ */
84044 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/doorbells.h linux-2.6.29-rc3.owrt/drivers/staging/benet/doorbells.h
84045 --- linux-2.6.29.owrt/drivers/staging/benet/doorbells.h 1970-01-01 01:00:00.000000000 +0100
84046 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/doorbells.h 2009-05-10 23:48:29.000000000 +0200
84047 @@ -0,0 +1,179 @@
84048 +/*
84049 + * Copyright (C) 2005 - 2008 ServerEngines
84050 + * All rights reserved.
84051 + *
84052 + * This program is free software; you can redistribute it and/or
84053 + * modify it under the terms of the GNU General Public License version 2
84054 + * as published by the Free Software Foundation. The full GNU General
84055 + * Public License is included in this distribution in the file called COPYING.
84056 + *
84057 + * Contact Information:
84058 + * linux-drivers@serverengines.com
84059 + *
84060 + * ServerEngines
84061 + * 209 N. Fair Oaks Ave
84062 + * Sunnyvale, CA 94085
84063 + */
84064 +/*
84065 + * Autogenerated by srcgen version: 0127
84066 + */
84067 +#ifndef __doorbells_amap_h__
84068 +#define __doorbells_amap_h__
84069 +
84070 +/* The TX/RDMA send queue doorbell. */
84071 +struct BE_SQ_DB_AMAP {
84072 + u8 cid[11]; /* DWORD 0 */
84073 + u8 rsvd0[5]; /* DWORD 0 */
84074 + u8 numPosted[14]; /* DWORD 0 */
84075 + u8 rsvd1[2]; /* DWORD 0 */
84076 +} __packed;
84077 +struct SQ_DB_AMAP {
84078 + u32 dw[1];
84079 +};
84080 +
84081 +/* The receive queue doorbell. */
84082 +struct BE_RQ_DB_AMAP {
84083 + u8 rq[10]; /* DWORD 0 */
84084 + u8 rsvd0[13]; /* DWORD 0 */
84085 + u8 Invalidate; /* DWORD 0 */
84086 + u8 numPosted[8]; /* DWORD 0 */
84087 +} __packed;
84088 +struct RQ_DB_AMAP {
84089 + u32 dw[1];
84090 +};
84091 +
84092 +/*
84093 + * The CQ/EQ doorbell. Software MUST set reserved fields in this
84094 + * descriptor to zero, otherwise (CEV) hardware will not execute the
84095 + * doorbell (flagging a bad_db_qid error instead).
84096 + */
84097 +struct BE_CQ_DB_AMAP {
84098 + u8 qid[10]; /* DWORD 0 */
84099 + u8 rsvd0[4]; /* DWORD 0 */
84100 + u8 rearm; /* DWORD 0 */
84101 + u8 event; /* DWORD 0 */
84102 + u8 num_popped[13]; /* DWORD 0 */
84103 + u8 rsvd1[3]; /* DWORD 0 */
84104 +} __packed;
84105 +struct CQ_DB_AMAP {
84106 + u32 dw[1];
84107 +};
84108 +
84109 +struct BE_TPM_RQ_DB_AMAP {
84110 + u8 qid[10]; /* DWORD 0 */
84111 + u8 rsvd0[6]; /* DWORD 0 */
84112 + u8 numPosted[11]; /* DWORD 0 */
84113 + u8 mss_cnt[5]; /* DWORD 0 */
84114 +} __packed;
84115 +struct TPM_RQ_DB_AMAP {
84116 + u32 dw[1];
84117 +};
84118 +
84119 +/*
84120 + * Post WRB Queue Doorbell Register used by the host Storage stack
84121 + * to notify the controller of a posted Work Request Block
84122 + */
84123 +struct BE_WRB_POST_DB_AMAP {
84124 + u8 wrb_cid[10]; /* DWORD 0 */
84125 + u8 rsvd0[6]; /* DWORD 0 */
84126 + u8 wrb_index[8]; /* DWORD 0 */
84127 + u8 numberPosted[8]; /* DWORD 0 */
84128 +} __packed;
84129 +struct WRB_POST_DB_AMAP {
84130 + u32 dw[1];
84131 +};
84132 +
84133 +/*
84134 + * Update Default PDU Queue Doorbell Register used to communicate
84135 + * to the controller that the driver has stopped processing the queue
84136 + * and where in the queue it stopped, this is
84137 + * a CQ Entry Type. Used by storage driver.
84138 + */
84139 +struct BE_DEFAULT_PDU_DB_AMAP {
84140 + u8 qid[10]; /* DWORD 0 */
84141 + u8 rsvd0[4]; /* DWORD 0 */
84142 + u8 rearm; /* DWORD 0 */
84143 + u8 event; /* DWORD 0 */
84144 + u8 cqproc[14]; /* DWORD 0 */
84145 + u8 rsvd1[2]; /* DWORD 0 */
84146 +} __packed;
84147 +struct DEFAULT_PDU_DB_AMAP {
84148 + u32 dw[1];
84149 +};
84150 +
84151 +/* Management Command and Controller default fragment ring */
84152 +struct BE_MCC_DB_AMAP {
84153 + u8 rid[11]; /* DWORD 0 */
84154 + u8 rsvd0[5]; /* DWORD 0 */
84155 + u8 numPosted[14]; /* DWORD 0 */
84156 + u8 rsvd1[2]; /* DWORD 0 */
84157 +} __packed;
84158 +struct MCC_DB_AMAP {
84159 + u32 dw[1];
84160 +};
84161 +
84162 +/*
84163 + * Used for bootstrapping the Host interface. This register is
84164 + * used for driver communication with the MPU when no MCC Rings exist.
84165 + * The software must write this register twice to post any MCC
84166 + * command. First, it writes the register with hi=1 and the upper bits of
84167 + * the physical address for the MCC_MAILBOX structure. Software must poll
84168 + * the ready bit until this is acknowledged. Then, sotware writes the
84169 + * register with hi=0 with the lower bits in the address. It must
84170 + * poll the ready bit until the MCC command is complete. Upon completion,
84171 + * the MCC_MAILBOX will contain a valid completion queue entry.
84172 + */
84173 +struct BE_MPU_MAILBOX_DB_AMAP {
84174 + u8 ready; /* DWORD 0 */
84175 + u8 hi; /* DWORD 0 */
84176 + u8 address[30]; /* DWORD 0 */
84177 +} __packed;
84178 +struct MPU_MAILBOX_DB_AMAP {
84179 + u32 dw[1];
84180 +};
84181 +
84182 +/*
84183 + * This is the protection domain doorbell register map. Note that
84184 + * while this map shows doorbells for all Blade Engine supported
84185 + * protocols, not all of these may be valid in a given function or
84186 + * protection domain. It is the responsibility of the application
84187 + * accessing the doorbells to know which are valid. Each doorbell
84188 + * occupies 32 bytes of space, but unless otherwise specified,
84189 + * only the first 4 bytes should be written. There are 32 instances
84190 + * of these doorbells for the host and 31 virtual machines respectively.
84191 + * The host and VMs will only map the doorbell pages belonging to its
84192 + * protection domain. It will not be able to touch the doorbells for
84193 + * another VM. The doorbells are the only registers directly accessible
84194 + * by a virtual machine. Similarly, there are 511 additional
84195 + * doorbells for RDMA protection domains. PD 0 for RDMA shares
84196 + * the same physical protection domain doorbell page as ETH/iSCSI.
84197 + *
84198 + */
84199 +struct BE_PROTECTION_DOMAIN_DBMAP_AMAP {
84200 + u8 rsvd0[512]; /* DWORD 0 */
84201 + struct BE_SQ_DB_AMAP rdma_sq_db;
84202 + u8 rsvd1[7][32]; /* DWORD 17 */
84203 + struct BE_WRB_POST_DB_AMAP iscsi_wrb_post_db;
84204 + u8 rsvd2[7][32]; /* DWORD 25 */
84205 + struct BE_SQ_DB_AMAP etx_sq_db;
84206 + u8 rsvd3[7][32]; /* DWORD 33 */
84207 + struct BE_RQ_DB_AMAP rdma_rq_db;
84208 + u8 rsvd4[7][32]; /* DWORD 41 */
84209 + struct BE_DEFAULT_PDU_DB_AMAP iscsi_default_pdu_db;
84210 + u8 rsvd5[7][32]; /* DWORD 49 */
84211 + struct BE_TPM_RQ_DB_AMAP tpm_rq_db;
84212 + u8 rsvd6[7][32]; /* DWORD 57 */
84213 + struct BE_RQ_DB_AMAP erx_rq_db;
84214 + u8 rsvd7[7][32]; /* DWORD 65 */
84215 + struct BE_CQ_DB_AMAP cq_db;
84216 + u8 rsvd8[7][32]; /* DWORD 73 */
84217 + struct BE_MCC_DB_AMAP mpu_mcc_db;
84218 + u8 rsvd9[7][32]; /* DWORD 81 */
84219 + struct BE_MPU_MAILBOX_DB_AMAP mcc_bootstrap_db;
84220 + u8 rsvd10[935][32]; /* DWORD 89 */
84221 +} __packed;
84222 +struct PROTECTION_DOMAIN_DBMAP_AMAP {
84223 + u32 dw[1024];
84224 +};
84225 +
84226 +#endif /* __doorbells_amap_h__ */
84227 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/ep.h linux-2.6.29-rc3.owrt/drivers/staging/benet/ep.h
84228 --- linux-2.6.29.owrt/drivers/staging/benet/ep.h 1970-01-01 01:00:00.000000000 +0100
84229 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/ep.h 2009-05-10 23:48:29.000000000 +0200
84230 @@ -0,0 +1,66 @@
84231 +/*
84232 + * Copyright (C) 2005 - 2008 ServerEngines
84233 + * All rights reserved.
84234 + *
84235 + * This program is free software; you can redistribute it and/or
84236 + * modify it under the terms of the GNU General Public License version 2
84237 + * as published by the Free Software Foundation. The full GNU General
84238 + * Public License is included in this distribution in the file called COPYING.
84239 + *
84240 + * Contact Information:
84241 + * linux-drivers@serverengines.com
84242 + *
84243 + * ServerEngines
84244 + * 209 N. Fair Oaks Ave
84245 + * Sunnyvale, CA 94085
84246 + */
84247 +/*
84248 + * Autogenerated by srcgen version: 0127
84249 + */
84250 +#ifndef __ep_amap_h__
84251 +#define __ep_amap_h__
84252 +
84253 +/* General Control and Status Register. */
84254 +struct BE_EP_CONTROL_CSR_AMAP {
84255 + u8 m0_RxPbuf; /* DWORD 0 */
84256 + u8 m1_RxPbuf; /* DWORD 0 */
84257 + u8 m2_RxPbuf; /* DWORD 0 */
84258 + u8 ff_en; /* DWORD 0 */
84259 + u8 rsvd0[27]; /* DWORD 0 */
84260 + u8 CPU_reset; /* DWORD 0 */
84261 +} __packed;
84262 +struct EP_CONTROL_CSR_AMAP {
84263 + u32 dw[1];
84264 +};
84265 +
84266 +/* Semaphore Register. */
84267 +struct BE_EP_SEMAPHORE_CSR_AMAP {
84268 + u8 value[32]; /* DWORD 0 */
84269 +} __packed;
84270 +struct EP_SEMAPHORE_CSR_AMAP {
84271 + u32 dw[1];
84272 +};
84273 +
84274 +/* Embedded Processor Specific Registers. */
84275 +struct BE_EP_CSRMAP_AMAP {
84276 + struct BE_EP_CONTROL_CSR_AMAP ep_control;
84277 + u8 rsvd0[32]; /* DWORD 1 */
84278 + u8 rsvd1[32]; /* DWORD 2 */
84279 + u8 rsvd2[32]; /* DWORD 3 */
84280 + u8 rsvd3[32]; /* DWORD 4 */
84281 + u8 rsvd4[32]; /* DWORD 5 */
84282 + u8 rsvd5[8][128]; /* DWORD 6 */
84283 + u8 rsvd6[32]; /* DWORD 38 */
84284 + u8 rsvd7[32]; /* DWORD 39 */
84285 + u8 rsvd8[32]; /* DWORD 40 */
84286 + u8 rsvd9[32]; /* DWORD 41 */
84287 + u8 rsvd10[32]; /* DWORD 42 */
84288 + struct BE_EP_SEMAPHORE_CSR_AMAP ep_semaphore;
84289 + u8 rsvd11[32]; /* DWORD 44 */
84290 + u8 rsvd12[19][32]; /* DWORD 45 */
84291 +} __packed;
84292 +struct EP_CSRMAP_AMAP {
84293 + u32 dw[64];
84294 +};
84295 +
84296 +#endif /* __ep_amap_h__ */
84297 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/eq.c linux-2.6.29-rc3.owrt/drivers/staging/benet/eq.c
84298 --- linux-2.6.29.owrt/drivers/staging/benet/eq.c 1970-01-01 01:00:00.000000000 +0100
84299 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/eq.c 2009-05-10 23:48:29.000000000 +0200
84300 @@ -0,0 +1,299 @@
84301 +/*
84302 + * Copyright (C) 2005 - 2008 ServerEngines
84303 + * All rights reserved.
84304 + *
84305 + * This program is free software; you can redistribute it and/or
84306 + * modify it under the terms of the GNU General Public License version 2
84307 + * as published by the Free Software Foundation. The full GNU General
84308 + * Public License is included in this distribution in the file called COPYING.
84309 + *
84310 + * Contact Information:
84311 + * linux-drivers@serverengines.com
84312 + *
84313 + * ServerEngines
84314 + * 209 N. Fair Oaks Ave
84315 + * Sunnyvale, CA 94085
84316 + */
84317 +#include "hwlib.h"
84318 +#include "bestatus.h"
84319 +/*
84320 + This routine creates an event queue based on the client completion
84321 + queue configuration information.
84322 +
84323 + FunctionObject - Handle to a function object
84324 + EqBaseVa - Base VA for a the EQ ring
84325 + SizeEncoding - The encoded size for the EQ entries. This value is
84326 + either CEV_EQ_SIZE_4 or CEV_EQ_SIZE_16
84327 + NumEntries - CEV_CQ_CNT_* values.
84328 + Watermark - Enables watermark based coalescing. This parameter
84329 + must be of the type CEV_WMARK_* if watermarks
84330 + are enabled. If watermarks to to be disabled
84331 + this value should be-1.
84332 + TimerDelay - If a timer delay is enabled this value should be the
84333 + time of the delay in 8 microsecond units. If
84334 + delays are not used this parameter should be
84335 + set to -1.
84336 + ppEqObject - Internal EQ Handle returned.
84337 +
84338 + Returns BE_SUCCESS if successfull,, otherwise a useful error code
84339 + is returned.
84340 +
84341 + IRQL < DISPATCH_LEVEL
84342 +*/
84343 +int
84344 +be_eq_create(struct be_function_object *pfob,
84345 + struct ring_desc *rd, u32 eqe_size, u32 num_entries,
84346 + u32 watermark, /* CEV_WMARK_* or -1 */
84347 + u32 timer_delay, /* in 8us units, or -1 */
84348 + struct be_eq_object *eq_object)
84349 +{
84350 + int status = BE_SUCCESS;
84351 + u32 num_entries_encoding, eqe_size_encoding, length;
84352 + struct FWCMD_COMMON_EQ_CREATE *fwcmd = NULL;
84353 + struct MCC_WRB_AMAP *wrb = NULL;
84354 + u32 n;
84355 + unsigned long irql;
84356 +
84357 + ASSERT(rd);
84358 + ASSERT(eq_object);
84359 +
84360 + switch (num_entries) {
84361 + case 256:
84362 + num_entries_encoding = CEV_EQ_CNT_256;
84363 + break;
84364 + case 512:
84365 + num_entries_encoding = CEV_EQ_CNT_512;
84366 + break;
84367 + case 1024:
84368 + num_entries_encoding = CEV_EQ_CNT_1024;
84369 + break;
84370 + case 2048:
84371 + num_entries_encoding = CEV_EQ_CNT_2048;
84372 + break;
84373 + case 4096:
84374 + num_entries_encoding = CEV_EQ_CNT_4096;
84375 + break;
84376 + default:
84377 + ASSERT(0);
84378 + return BE_STATUS_INVALID_PARAMETER;
84379 + }
84380 +
84381 + switch (eqe_size) {
84382 + case 4:
84383 + eqe_size_encoding = CEV_EQ_SIZE_4;
84384 + break;
84385 + case 16:
84386 + eqe_size_encoding = CEV_EQ_SIZE_16;
84387 + break;
84388 + default:
84389 + ASSERT(0);
84390 + return BE_STATUS_INVALID_PARAMETER;
84391 + }
84392 +
84393 + if ((eqe_size == 4 && num_entries < 1024) ||
84394 + (eqe_size == 16 && num_entries == 4096)) {
84395 + TRACE(DL_ERR, "Bad EQ size. eqe_size:%d num_entries:%d",
84396 + eqe_size, num_entries);
84397 + ASSERT(0);
84398 + return BE_STATUS_INVALID_PARAMETER;
84399 + }
84400 +
84401 + memset(eq_object, 0, sizeof(*eq_object));
84402 +
84403 + atomic_set(&eq_object->ref_count, 0);
84404 + eq_object->parent_function = pfob;
84405 + eq_object->eq_id = 0xFFFFFFFF;
84406 +
84407 + INIT_LIST_HEAD(&eq_object->cq_list_head);
84408 +
84409 + length = num_entries * eqe_size;
84410 +
84411 + spin_lock_irqsave(&pfob->post_lock, irql);
84412 +
84413 + wrb = be_function_peek_mcc_wrb(pfob);
84414 + if (!wrb) {
84415 + ASSERT(wrb);
84416 + TRACE(DL_ERR, "No free MCC WRBs in create EQ.");
84417 + status = BE_STATUS_NO_MCC_WRB;
84418 + goto Error;
84419 + }
84420 + /* Prepares an embedded fwcmd, including request/response sizes. */
84421 + fwcmd = BE_PREPARE_EMBEDDED_FWCMD(pfob, wrb, COMMON_EQ_CREATE);
84422 +
84423 + fwcmd->params.request.num_pages = PAGES_SPANNED(OFFSET_IN_PAGE(rd->va),
84424 + length);
84425 + n = pfob->pci_function_number;
84426 + AMAP_SET_BITS_PTR(EQ_CONTEXT, Func, &fwcmd->params.request.context, n);
84427 +
84428 + AMAP_SET_BITS_PTR(EQ_CONTEXT, valid, &fwcmd->params.request.context, 1);
84429 +
84430 + AMAP_SET_BITS_PTR(EQ_CONTEXT, Size,
84431 + &fwcmd->params.request.context, eqe_size_encoding);
84432 +
84433 + n = 0; /* Protection Domain is always 0 in Linux driver */
84434 + AMAP_SET_BITS_PTR(EQ_CONTEXT, PD, &fwcmd->params.request.context, n);
84435 +
84436 + /* Let the caller ARM the EQ with the doorbell. */
84437 + AMAP_SET_BITS_PTR(EQ_CONTEXT, Armed, &fwcmd->params.request.context, 0);
84438 +
84439 + AMAP_SET_BITS_PTR(EQ_CONTEXT, Count, &fwcmd->params.request.context,
84440 + num_entries_encoding);
84441 +
84442 + n = pfob->pci_function_number * 32;
84443 + AMAP_SET_BITS_PTR(EQ_CONTEXT, EventVect,
84444 + &fwcmd->params.request.context, n);
84445 + if (watermark != -1) {
84446 + AMAP_SET_BITS_PTR(EQ_CONTEXT, WME,
84447 + &fwcmd->params.request.context, 1);
84448 + AMAP_SET_BITS_PTR(EQ_CONTEXT, Watermark,
84449 + &fwcmd->params.request.context, watermark);
84450 + ASSERT(watermark <= CEV_WMARK_240);
84451 + } else
84452 + AMAP_SET_BITS_PTR(EQ_CONTEXT, WME,
84453 + &fwcmd->params.request.context, 0);
84454 + if (timer_delay != -1) {
84455 + AMAP_SET_BITS_PTR(EQ_CONTEXT, TMR,
84456 + &fwcmd->params.request.context, 1);
84457 +
84458 + ASSERT(timer_delay <= 250); /* max value according to EAS */
84459 + timer_delay = min(timer_delay, (u32)250);
84460 +
84461 + AMAP_SET_BITS_PTR(EQ_CONTEXT, Delay,
84462 + &fwcmd->params.request.context, timer_delay);
84463 + } else {
84464 + AMAP_SET_BITS_PTR(EQ_CONTEXT, TMR,
84465 + &fwcmd->params.request.context, 0);
84466 + }
84467 + /* Create a page list for the FWCMD. */
84468 + be_rd_to_pa_list(rd, fwcmd->params.request.pages,
84469 + ARRAY_SIZE(fwcmd->params.request.pages));
84470 +
84471 + status = be_function_post_mcc_wrb(pfob, wrb, NULL, NULL, NULL,
84472 + NULL, NULL, fwcmd, NULL);
84473 + if (status != BE_SUCCESS) {
84474 + TRACE(DL_ERR, "MCC to create EQ failed.");
84475 + goto Error;
84476 + }
84477 + /* Get the EQ id. The MPU allocates the IDs. */
84478 + eq_object->eq_id = fwcmd->params.response.eq_id;
84479 +
84480 +Error:
84481 + spin_unlock_irqrestore(&pfob->post_lock, irql);
84482 +
84483 + if (pfob->pend_queue_driving && pfob->mcc) {
84484 + pfob->pend_queue_driving = 0;
84485 + be_drive_mcc_wrb_queue(pfob->mcc);
84486 + }
84487 + return status;
84488 +}
84489 +
84490 +/*
84491 + Deferences the given object. Once the object's reference count drops to
84492 + zero, the object is destroyed and all resources that are held by this
84493 + object are released. The on-chip context is also destroyed along with
84494 + the queue ID, and any mappings made into the UT.
84495 +
84496 + eq_object - EQ handle returned from eq_object_create.
84497 +
84498 + Returns BE_SUCCESS if successfull, otherwise a useful error code
84499 + is returned.
84500 +
84501 + IRQL: IRQL < DISPATCH_LEVEL
84502 +*/
84503 +int be_eq_destroy(struct be_eq_object *eq_object)
84504 +{
84505 + int status = 0;
84506 +
84507 + ASSERT(atomic_read(&eq_object->ref_count) == 0);
84508 + /* no CQs should reference this EQ now */
84509 + ASSERT(list_empty(&eq_object->cq_list_head));
84510 +
84511 + /* Send fwcmd to destroy the EQ. */
84512 + status = be_function_ring_destroy(eq_object->parent_function,
84513 + eq_object->eq_id, FWCMD_RING_TYPE_EQ,
84514 + NULL, NULL, NULL, NULL);
84515 + ASSERT(status == 0);
84516 +
84517 + return BE_SUCCESS;
84518 +}
84519 +/*
84520 + *---------------------------------------------------------------------------
84521 + * Function: be_eq_modify_delay
84522 + * Changes the EQ delay for a group of EQs.
84523 + * num_eq - The number of EQs in the eq_array to adjust.
84524 + * This also is the number of delay values in
84525 + * the eq_delay_array.
84526 + * eq_array - Array of struct be_eq_object pointers to adjust.
84527 + * eq_delay_array - Array of "num_eq" timer delays in units
84528 + * of microseconds. The be_eq_query_delay_range
84529 + * fwcmd returns the resolution and range of
84530 + * legal EQ delays.
84531 + * cb -
84532 + * cb_context -
84533 + * q_ctxt - Optional. Pointer to a previously allocated
84534 + * struct. If the MCC WRB ring is full, this
84535 + * structure is used to queue the operation. It
84536 + * will be posted to the MCC ring when space
84537 + * becomes available. All queued commands will
84538 + * be posted to the ring in the order they are
84539 + * received. It is always valid to pass a pointer to
84540 + * a generic be_generic_q_cntxt. However,
84541 + * the specific context structs
84542 + * are generally smaller than the generic struct.
84543 + * return pend_status - BE_SUCCESS (0) on success.
84544 + * BE_PENDING (postive value) if the FWCMD
84545 + * completion is pending. Negative error code on failure.
84546 + *-------------------------------------------------------------------------
84547 + */
84548 +int
84549 +be_eq_modify_delay(struct be_function_object *pfob,
84550 + u32 num_eq, struct be_eq_object **eq_array,
84551 + u32 *eq_delay_array, mcc_wrb_cqe_callback cb,
84552 + void *cb_context, struct be_eq_modify_delay_q_ctxt *q_ctxt)
84553 +{
84554 + struct FWCMD_COMMON_MODIFY_EQ_DELAY *fwcmd = NULL;
84555 + struct MCC_WRB_AMAP *wrb = NULL;
84556 + int status = 0;
84557 + struct be_generic_q_ctxt *gen_ctxt = NULL;
84558 + u32 i;
84559 + unsigned long irql;
84560 +
84561 + spin_lock_irqsave(&pfob->post_lock, irql);
84562 +
84563 + wrb = be_function_peek_mcc_wrb(pfob);
84564 + if (!wrb) {
84565 + if (q_ctxt && cb) {
84566 + wrb = (struct MCC_WRB_AMAP *) &q_ctxt->wrb_header;
84567 + gen_ctxt = (struct be_generic_q_ctxt *) q_ctxt;
84568 + gen_ctxt->context.bytes = sizeof(*q_ctxt);
84569 + } else {
84570 + status = BE_STATUS_NO_MCC_WRB;
84571 + goto Error;
84572 + }
84573 + }
84574 + /* Prepares an embedded fwcmd, including request/response sizes. */
84575 + fwcmd = BE_PREPARE_EMBEDDED_FWCMD(pfob, wrb, COMMON_MODIFY_EQ_DELAY);
84576 +
84577 + ASSERT(num_eq > 0);
84578 + ASSERT(num_eq <= ARRAY_SIZE(fwcmd->params.request.delay));
84579 + fwcmd->params.request.num_eq = num_eq;
84580 + for (i = 0; i < num_eq; i++) {
84581 + fwcmd->params.request.delay[i].eq_id = eq_array[i]->eq_id;
84582 + fwcmd->params.request.delay[i].delay_in_microseconds =
84583 + eq_delay_array[i];
84584 + }
84585 +
84586 + /* Post the f/w command */
84587 + status = be_function_post_mcc_wrb(pfob, wrb, gen_ctxt,
84588 + cb, cb_context, NULL, NULL, fwcmd, NULL);
84589 +
84590 +Error:
84591 + spin_unlock_irqrestore(&pfob->post_lock, irql);
84592 +
84593 + if (pfob->pend_queue_driving && pfob->mcc) {
84594 + pfob->pend_queue_driving = 0;
84595 + be_drive_mcc_wrb_queue(pfob->mcc);
84596 + }
84597 + return status;
84598 +}
84599 +
84600 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/eth.c linux-2.6.29-rc3.owrt/drivers/staging/benet/eth.c
84601 --- linux-2.6.29.owrt/drivers/staging/benet/eth.c 1970-01-01 01:00:00.000000000 +0100
84602 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/eth.c 2009-05-10 23:48:29.000000000 +0200
84603 @@ -0,0 +1,1273 @@
84604 +/*
84605 + * Copyright (C) 2005 - 2008 ServerEngines
84606 + * All rights reserved.
84607 + *
84608 + * This program is free software; you can redistribute it and/or
84609 + * modify it under the terms of the GNU General Public License version 2
84610 + * as published by the Free Software Foundation. The full GNU General
84611 + * Public License is included in this distribution in the file called COPYING.
84612 + *
84613 + * Contact Information:
84614 + * linux-drivers@serverengines.com
84615 + *
84616 + * ServerEngines
84617 + * 209 N. Fair Oaks Ave
84618 + * Sunnyvale, CA 94085
84619 + */
84620 +#include <linux/if_ether.h>
84621 +#include "hwlib.h"
84622 +#include "bestatus.h"
84623 +
84624 +/*
84625 + *---------------------------------------------------------
84626 + * Function: be_eth_sq_create_ex
84627 + * Creates an ethernet send ring - extended version with
84628 + * additional parameters.
84629 + * pfob -
84630 + * rd - ring address
84631 + * length_in_bytes -
84632 + * type - The type of ring to create.
84633 + * ulp - The requested ULP number for the ring.
84634 + * This should be zero based, i.e. 0,1,2. This must
84635 + * be valid NIC ULP based on the firmware config.
84636 + * All doorbells for this ring must be sent to
84637 + * this ULP. The first network ring allocated for
84638 + * each ULP are higher performance than subsequent rings.
84639 + * cq_object - cq object for completions
84640 + * ex_parameters - Additional parameters (that may increase in
84641 + * future revisions). These parameters are only used
84642 + * for certain ring types -- see
84643 + * struct be_eth_sq_parameters for details.
84644 + * eth_sq -
84645 + * return status - BE_SUCCESS (0) on success. Negative error code on failure.
84646 + *---------------------------------------------------------
84647 + */
84648 +int
84649 +be_eth_sq_create_ex(struct be_function_object *pfob, struct ring_desc *rd,
84650 + u32 length, u32 type, u32 ulp, struct be_cq_object *cq_object,
84651 + struct be_eth_sq_parameters *ex_parameters,
84652 + struct be_ethsq_object *eth_sq)
84653 +{
84654 + struct FWCMD_COMMON_ETH_TX_CREATE *fwcmd = NULL;
84655 + struct MCC_WRB_AMAP *wrb = NULL;
84656 + int status = 0;
84657 + u32 n;
84658 + unsigned long irql;
84659 +
84660 + ASSERT(rd);
84661 + ASSERT(eth_sq);
84662 + ASSERT(ex_parameters);
84663 +
84664 + spin_lock_irqsave(&pfob->post_lock, irql);
84665 +
84666 + memset(eth_sq, 0, sizeof(*eth_sq));
84667 +
84668 + eth_sq->parent_function = pfob;
84669 + eth_sq->bid = 0xFFFFFFFF;
84670 + eth_sq->cq_object = cq_object;
84671 +
84672 + /* Translate hwlib interface to arm interface. */
84673 + switch (type) {
84674 + case BE_ETH_TX_RING_TYPE_FORWARDING:
84675 + type = ETH_TX_RING_TYPE_FORWARDING;
84676 + break;
84677 + case BE_ETH_TX_RING_TYPE_STANDARD:
84678 + type = ETH_TX_RING_TYPE_STANDARD;
84679 + break;
84680 + case BE_ETH_TX_RING_TYPE_BOUND:
84681 + ASSERT(ex_parameters->port < 2);
84682 + type = ETH_TX_RING_TYPE_BOUND;
84683 + break;
84684 + default:
84685 + TRACE(DL_ERR, "Invalid eth tx ring type:%d", type);
84686 + return BE_NOT_OK;
84687 + break;
84688 + }
84689 +
84690 + wrb = be_function_peek_mcc_wrb(pfob);
84691 + if (!wrb) {
84692 + ASSERT(wrb);
84693 + TRACE(DL_ERR, "No free MCC WRBs in create EQ.");
84694 + status = BE_STATUS_NO_MCC_WRB;
84695 + goto Error;
84696 + }
84697 + /* NIC must be supported by the current config. */
84698 + ASSERT(pfob->fw_config.nic_ulp_mask);
84699 +
84700 + /*
84701 + * The ulp parameter must select a valid NIC ULP
84702 + * for the current config.
84703 + */
84704 + ASSERT((1 << ulp) & pfob->fw_config.nic_ulp_mask);
84705 +
84706 + /* Prepares an embedded fwcmd, including request/response sizes. */
84707 + fwcmd = BE_PREPARE_EMBEDDED_FWCMD(pfob, wrb, COMMON_ETH_TX_CREATE);
84708 + fwcmd->header.request.port_number = ex_parameters->port;
84709 +
84710 + AMAP_SET_BITS_PTR(ETX_CONTEXT, pd_id,
84711 + &fwcmd->params.request.context, 0);
84712 +
84713 + n = be_ring_length_to_encoding(length, sizeof(struct ETH_WRB_AMAP));
84714 + AMAP_SET_BITS_PTR(ETX_CONTEXT, tx_ring_size,
84715 + &fwcmd->params.request.context, n);
84716 +
84717 + AMAP_SET_BITS_PTR(ETX_CONTEXT, cq_id_send,
84718 + &fwcmd->params.request.context, cq_object->cq_id);
84719 +
84720 + n = pfob->pci_function_number;
84721 + AMAP_SET_BITS_PTR(ETX_CONTEXT, func, &fwcmd->params.request.context, n);
84722 +
84723 + fwcmd->params.request.type = type;
84724 + fwcmd->params.request.ulp_num = (1 << ulp);
84725 + fwcmd->params.request.num_pages = DIV_ROUND_UP(length, PAGE_SIZE);
84726 + ASSERT(PAGES_SPANNED(rd->va, rd->length) >=
84727 + fwcmd->params.request.num_pages);
84728 +
84729 + /* Create a page list for the FWCMD. */
84730 + be_rd_to_pa_list(rd, fwcmd->params.request.pages,
84731 + ARRAY_SIZE(fwcmd->params.request.pages));
84732 +
84733 + status = be_function_post_mcc_wrb(pfob, wrb, NULL, NULL, NULL,
84734 + NULL, NULL, fwcmd, NULL);
84735 + if (status != BE_SUCCESS) {
84736 + TRACE(DL_ERR, "MCC to create etx queue failed.");
84737 + goto Error;
84738 + }
84739 + /* save the butler ID */
84740 + eth_sq->bid = fwcmd->params.response.cid;
84741 +
84742 + /* add a reference to the corresponding CQ */
84743 + atomic_inc(&cq_object->ref_count);
84744 +
84745 +Error:
84746 + spin_unlock_irqrestore(&pfob->post_lock, irql);
84747 +
84748 + if (pfob->pend_queue_driving && pfob->mcc) {
84749 + pfob->pend_queue_driving = 0;
84750 + be_drive_mcc_wrb_queue(pfob->mcc);
84751 + }
84752 + return status;
84753 +}
84754 +
84755 +
84756 +/*
84757 + This routine destroys an ethernet send queue
84758 +
84759 + EthSq - EthSq Handle returned from EthSqCreate
84760 +
84761 + This function always return BE_SUCCESS.
84762 +
84763 + This function frees memory allocated by EthSqCreate for the EthSq Object.
84764 +
84765 +*/
84766 +int be_eth_sq_destroy(struct be_ethsq_object *eth_sq)
84767 +{
84768 + int status = 0;
84769 +
84770 + /* Send fwcmd to destroy the queue. */
84771 + status = be_function_ring_destroy(eth_sq->parent_function, eth_sq->bid,
84772 + FWCMD_RING_TYPE_ETH_TX, NULL, NULL, NULL, NULL);
84773 + ASSERT(status == 0);
84774 +
84775 + /* Derefence any associated CQs. */
84776 + atomic_dec(&eth_sq->cq_object->ref_count);
84777 + return status;
84778 +}
84779 +/*
84780 + This routine attempts to set the transmit flow control parameters.
84781 +
84782 + FunctionObject - Handle to a function object
84783 +
84784 + txfc_enable - transmit flow control enable - true for
84785 + enable, false for disable
84786 +
84787 + rxfc_enable - receive flow control enable - true for
84788 + enable, false for disable
84789 +
84790 + Returns BE_SUCCESS if successfull, otherwise a useful int error
84791 + code is returned.
84792 +
84793 + IRQL: < DISPATCH_LEVEL
84794 +
84795 + This function always fails in non-privileged machine context.
84796 +*/
84797 +int
84798 +be_eth_set_flow_control(struct be_function_object *pfob,
84799 + bool txfc_enable, bool rxfc_enable)
84800 +{
84801 + struct FWCMD_COMMON_SET_FLOW_CONTROL *fwcmd = NULL;
84802 + struct MCC_WRB_AMAP *wrb = NULL;
84803 + int status = 0;
84804 + unsigned long irql;
84805 +
84806 + spin_lock_irqsave(&pfob->post_lock, irql);
84807 +
84808 + wrb = be_function_peek_mcc_wrb(pfob);
84809 + if (!wrb) {
84810 + TRACE(DL_ERR, "MCC wrb peek failed.");
84811 + status = BE_STATUS_NO_MCC_WRB;
84812 + goto error;
84813 + }
84814 + /* Prepares an embedded fwcmd, including request/response sizes. */
84815 + fwcmd = BE_PREPARE_EMBEDDED_FWCMD(pfob, wrb, COMMON_SET_FLOW_CONTROL);
84816 +
84817 + fwcmd->params.request.rx_flow_control = rxfc_enable;
84818 + fwcmd->params.request.tx_flow_control = txfc_enable;
84819 +
84820 + /* Post the f/w command */
84821 + status = be_function_post_mcc_wrb(pfob, wrb, NULL, NULL, NULL,
84822 + NULL, NULL, fwcmd, NULL);
84823 +
84824 + if (status != 0) {
84825 + TRACE(DL_ERR, "set flow control fwcmd failed.");
84826 + goto error;
84827 + }
84828 +
84829 +error:
84830 + spin_unlock_irqrestore(&pfob->post_lock, irql);
84831 +
84832 + if (pfob->pend_queue_driving && pfob->mcc) {
84833 + pfob->pend_queue_driving = 0;
84834 + be_drive_mcc_wrb_queue(pfob->mcc);
84835 + }
84836 + return status;
84837 +}
84838 +
84839 +/*
84840 + This routine attempts to get the transmit flow control parameters.
84841 +
84842 + pfob - Handle to a function object
84843 +
84844 + txfc_enable - transmit flow control enable - true for
84845 + enable, false for disable
84846 +
84847 + rxfc_enable - receive flow control enable - true for enable,
84848 + false for disable
84849 +
84850 + Returns BE_SUCCESS if successfull, otherwise a useful int error code
84851 + is returned.
84852 +
84853 + IRQL: < DISPATCH_LEVEL
84854 +
84855 + This function always fails in non-privileged machine context.
84856 +*/
84857 +int
84858 +be_eth_get_flow_control(struct be_function_object *pfob,
84859 + bool *txfc_enable, bool *rxfc_enable)
84860 +{
84861 + struct FWCMD_COMMON_GET_FLOW_CONTROL *fwcmd = NULL;
84862 + struct MCC_WRB_AMAP *wrb = NULL;
84863 + int status = 0;
84864 + unsigned long irql;
84865 +
84866 + spin_lock_irqsave(&pfob->post_lock, irql);
84867 +
84868 + wrb = be_function_peek_mcc_wrb(pfob);
84869 + if (!wrb) {
84870 + TRACE(DL_ERR, "MCC wrb peek failed.");
84871 + status = BE_STATUS_NO_MCC_WRB;
84872 + goto error;
84873 + }
84874 + /* Prepares an embedded fwcmd, including request/response sizes. */
84875 + fwcmd = BE_PREPARE_EMBEDDED_FWCMD(pfob, wrb, COMMON_GET_FLOW_CONTROL);
84876 +
84877 + /* Post the f/w command */
84878 + status = be_function_post_mcc_wrb(pfob, wrb, NULL, NULL, NULL,
84879 + NULL, NULL, fwcmd, NULL);
84880 +
84881 + if (status != 0) {
84882 + TRACE(DL_ERR, "get flow control fwcmd failed.");
84883 + goto error;
84884 + }
84885 +
84886 + *txfc_enable = fwcmd->params.response.tx_flow_control;
84887 + *rxfc_enable = fwcmd->params.response.rx_flow_control;
84888 +
84889 +error:
84890 + spin_unlock_irqrestore(&pfob->post_lock, irql);
84891 +
84892 + if (pfob->pend_queue_driving && pfob->mcc) {
84893 + pfob->pend_queue_driving = 0;
84894 + be_drive_mcc_wrb_queue(pfob->mcc);
84895 + }
84896 + return status;
84897 +}
84898 +
84899 +/*
84900 + *---------------------------------------------------------
84901 + * Function: be_eth_set_qos
84902 + * This function sets the ethernet transmit Quality of Service (QoS)
84903 + * characteristics of BladeEngine for the domain. All ethernet
84904 + * transmit rings of the domain will evenly share the bandwidth.
84905 + * The exeception to sharing is the host primary (super) ethernet
84906 + * transmit ring as well as the host ethernet forwarding ring
84907 + * for missed offload data.
84908 + * pfob -
84909 + * max_bps - the maximum bits per second in units of
84910 + * 10 Mbps (valid 0-100)
84911 + * max_pps - the maximum packets per second in units
84912 + * of 1 Kpps (0 indicates no limit)
84913 + * return status - BE_SUCCESS (0) on success. Negative error code on failure.
84914 + *---------------------------------------------------------
84915 + */
84916 +int
84917 +be_eth_set_qos(struct be_function_object *pfob, u32 max_bps, u32 max_pps)
84918 +{
84919 + struct FWCMD_COMMON_SET_QOS *fwcmd = NULL;
84920 + struct MCC_WRB_AMAP *wrb = NULL;
84921 + int status = 0;
84922 + unsigned long irql;
84923 +
84924 + spin_lock_irqsave(&pfob->post_lock, irql);
84925 +
84926 + wrb = be_function_peek_mcc_wrb(pfob);
84927 + if (!wrb) {
84928 + TRACE(DL_ERR, "MCC wrb peek failed.");
84929 + status = BE_STATUS_NO_MCC_WRB;
84930 + goto error;
84931 + }
84932 + /* Prepares an embedded fwcmd, including request/response sizes. */
84933 + fwcmd = BE_PREPARE_EMBEDDED_FWCMD(pfob, wrb, COMMON_SET_QOS);
84934 +
84935 + /* Set fields in fwcmd */
84936 + fwcmd->params.request.max_bits_per_second_NIC = max_bps;
84937 + fwcmd->params.request.max_packets_per_second_NIC = max_pps;
84938 + fwcmd->params.request.valid_flags = QOS_BITS_NIC | QOS_PKTS_NIC;
84939 +
84940 + /* Post the f/w command */
84941 + status = be_function_post_mcc_wrb(pfob, wrb, NULL, NULL, NULL,
84942 + NULL, NULL, fwcmd, NULL);
84943 +
84944 + if (status != 0)
84945 + TRACE(DL_ERR, "network set qos fwcmd failed.");
84946 +
84947 +error:
84948 + spin_unlock_irqrestore(&pfob->post_lock, irql);
84949 + if (pfob->pend_queue_driving && pfob->mcc) {
84950 + pfob->pend_queue_driving = 0;
84951 + be_drive_mcc_wrb_queue(pfob->mcc);
84952 + }
84953 + return status;
84954 +}
84955 +
84956 +/*
84957 + *---------------------------------------------------------
84958 + * Function: be_eth_get_qos
84959 + * This function retrieves the ethernet transmit Quality of Service (QoS)
84960 + * characteristics for the domain.
84961 + * max_bps - the maximum bits per second in units of
84962 + * 10 Mbps (valid 0-100)
84963 + * max_pps - the maximum packets per second in units of
84964 + * 1 Kpps (0 indicates no limit)
84965 + * return status - BE_SUCCESS (0) on success. Negative error code on failure.
84966 + *---------------------------------------------------------
84967 + */
84968 +int
84969 +be_eth_get_qos(struct be_function_object *pfob, u32 *max_bps, u32 *max_pps)
84970 +{
84971 + struct FWCMD_COMMON_GET_QOS *fwcmd = NULL;
84972 + struct MCC_WRB_AMAP *wrb = NULL;
84973 + int status = 0;
84974 + unsigned long irql;
84975 +
84976 + spin_lock_irqsave(&pfob->post_lock, irql);
84977 +
84978 + wrb = be_function_peek_mcc_wrb(pfob);
84979 + if (!wrb) {
84980 + TRACE(DL_ERR, "MCC wrb peek failed.");
84981 + status = BE_STATUS_NO_MCC_WRB;
84982 + goto error;
84983 + }
84984 + /* Prepares an embedded fwcmd, including request/response sizes. */
84985 + fwcmd = BE_PREPARE_EMBEDDED_FWCMD(pfob, wrb, COMMON_GET_QOS);
84986 +
84987 + /* Post the f/w command */
84988 + status = be_function_post_mcc_wrb(pfob, wrb, NULL, NULL, NULL,
84989 + NULL, NULL, fwcmd, NULL);
84990 +
84991 + if (status != 0) {
84992 + TRACE(DL_ERR, "network get qos fwcmd failed.");
84993 + goto error;
84994 + }
84995 +
84996 + *max_bps = fwcmd->params.response.max_bits_per_second_NIC;
84997 + *max_pps = fwcmd->params.response.max_packets_per_second_NIC;
84998 +
84999 +error:
85000 + spin_unlock_irqrestore(&pfob->post_lock, irql);
85001 + if (pfob->pend_queue_driving && pfob->mcc) {
85002 + pfob->pend_queue_driving = 0;
85003 + be_drive_mcc_wrb_queue(pfob->mcc);
85004 + }
85005 + return status;
85006 +}
85007 +
85008 +/*
85009 + *---------------------------------------------------------
85010 + * Function: be_eth_set_frame_size
85011 + * This function sets the ethernet maximum frame size. The previous
85012 + * values are returned.
85013 + * pfob -
85014 + * tx_frame_size - maximum transmit frame size in bytes
85015 + * rx_frame_size - maximum receive frame size in bytes
85016 + * return status - BE_SUCCESS (0) on success. Negative error code on failure.
85017 + *---------------------------------------------------------
85018 + */
85019 +int
85020 +be_eth_set_frame_size(struct be_function_object *pfob,
85021 + u32 *tx_frame_size, u32 *rx_frame_size)
85022 +{
85023 + struct FWCMD_COMMON_SET_FRAME_SIZE *fwcmd = NULL;
85024 + struct MCC_WRB_AMAP *wrb = NULL;
85025 + int status = 0;
85026 + unsigned long irql;
85027 +
85028 + spin_lock_irqsave(&pfob->post_lock, irql);
85029 +
85030 + wrb = be_function_peek_mcc_wrb(pfob);
85031 + if (!wrb) {
85032 + TRACE(DL_ERR, "MCC wrb peek failed.");
85033 + status = BE_STATUS_NO_MCC_WRB;
85034 + goto error;
85035 + }
85036 + /* Prepares an embedded fwcmd, including request/response sizes. */
85037 + fwcmd = BE_PREPARE_EMBEDDED_FWCMD(pfob, wrb, COMMON_SET_FRAME_SIZE);
85038 + fwcmd->params.request.max_tx_frame_size = *tx_frame_size;
85039 + fwcmd->params.request.max_rx_frame_size = *rx_frame_size;
85040 +
85041 + /* Post the f/w command */
85042 + status = be_function_post_mcc_wrb(pfob, wrb, NULL, NULL, NULL,
85043 + NULL, NULL, fwcmd, NULL);
85044 +
85045 + if (status != 0) {
85046 + TRACE(DL_ERR, "network set frame size fwcmd failed.");
85047 + goto error;
85048 + }
85049 +
85050 + *tx_frame_size = fwcmd->params.response.chip_max_tx_frame_size;
85051 + *rx_frame_size = fwcmd->params.response.chip_max_rx_frame_size;
85052 +
85053 +error:
85054 + spin_unlock_irqrestore(&pfob->post_lock, irql);
85055 + if (pfob->pend_queue_driving && pfob->mcc) {
85056 + pfob->pend_queue_driving = 0;
85057 + be_drive_mcc_wrb_queue(pfob->mcc);
85058 + }
85059 + return status;
85060 +}
85061 +
85062 +
85063 +/*
85064 + This routine creates a Ethernet receive ring.
85065 +
85066 + pfob - handle to a function object
85067 + rq_base_va - base VA for the default receive ring. this must be
85068 + exactly 8K in length and continguous physical memory.
85069 + cq_object - handle to a previously created CQ to be associated
85070 + with the RQ.
85071 + pp_eth_rq - pointer to an opqaue handle where an eth
85072 + receive object is returned.
85073 + Returns BE_SUCCESS if successfull, , otherwise a useful
85074 + int error code is returned.
85075 +
85076 + IRQL: < DISPATCH_LEVEL
85077 + this function allocates a struct be_ethrq_object *object.
85078 + there must be no more than 1 of these per function object, unless the
85079 + function object supports RSS (is networking and on the host).
85080 + the rq_base_va must point to a buffer of exactly 8K.
85081 + the erx::host_cqid (or host_stor_cqid) register and erx::ring_page registers
85082 + will be updated as appropriate on return
85083 +*/
85084 +int
85085 +be_eth_rq_create(struct be_function_object *pfob,
85086 + struct ring_desc *rd, struct be_cq_object *cq_object,
85087 + struct be_cq_object *bcmc_cq_object,
85088 + struct be_ethrq_object *eth_rq)
85089 +{
85090 + int status = 0;
85091 + struct MCC_WRB_AMAP *wrb = NULL;
85092 + struct FWCMD_COMMON_ETH_RX_CREATE *fwcmd = NULL;
85093 + unsigned long irql;
85094 +
85095 + /* MPU will set the */
85096 + ASSERT(rd);
85097 + ASSERT(eth_rq);
85098 +
85099 + spin_lock_irqsave(&pfob->post_lock, irql);
85100 +
85101 + eth_rq->parent_function = pfob;
85102 + eth_rq->cq_object = cq_object;
85103 +
85104 + wrb = be_function_peek_mcc_wrb(pfob);
85105 + if (!wrb) {
85106 + TRACE(DL_ERR, "MCC wrb peek failed.");
85107 + status = BE_STATUS_NO_MCC_WRB;
85108 + goto Error;
85109 + }
85110 + /* Prepares an embedded fwcmd, including request/response sizes. */
85111 + fwcmd = BE_PREPARE_EMBEDDED_FWCMD(pfob, wrb, COMMON_ETH_RX_CREATE);
85112 +
85113 + fwcmd->params.request.num_pages = 2; /* required length */
85114 + fwcmd->params.request.cq_id = cq_object->cq_id;
85115 +
85116 + if (bcmc_cq_object)
85117 + fwcmd->params.request.bcmc_cq_id = bcmc_cq_object->cq_id;
85118 + else
85119 + fwcmd->params.request.bcmc_cq_id = 0xFFFF;
85120 +
85121 + /* Create a page list for the FWCMD. */
85122 + be_rd_to_pa_list(rd, fwcmd->params.request.pages,
85123 + ARRAY_SIZE(fwcmd->params.request.pages));
85124 +
85125 + /* Post the f/w command */
85126 + status = be_function_post_mcc_wrb(pfob, wrb, NULL, NULL, NULL,
85127 + NULL, NULL, fwcmd, NULL);
85128 + if (status != BE_SUCCESS) {
85129 + TRACE(DL_ERR, "fwcmd to map eth rxq frags failed.");
85130 + goto Error;
85131 + }
85132 + /* Save the ring ID for cleanup. */
85133 + eth_rq->rid = fwcmd->params.response.id;
85134 +
85135 + atomic_inc(&cq_object->ref_count);
85136 +
85137 +Error:
85138 + spin_unlock_irqrestore(&pfob->post_lock, irql);
85139 +
85140 + if (pfob->pend_queue_driving && pfob->mcc) {
85141 + pfob->pend_queue_driving = 0;
85142 + be_drive_mcc_wrb_queue(pfob->mcc);
85143 + }
85144 + return status;
85145 +}
85146 +
85147 +/*
85148 + This routine destroys an Ethernet receive queue
85149 +
85150 + eth_rq - ethernet receive queue handle returned from eth_rq_create
85151 +
85152 + Returns BE_SUCCESS on success and an appropriate int on failure.
85153 +
85154 + This function frees resourcs allocated by EthRqCreate.
85155 + The erx::host_cqid (or host_stor_cqid) register and erx::ring_page
85156 + registers will be updated as appropriate on return
85157 + IRQL: < DISPATCH_LEVEL
85158 +*/
85159 +
85160 +static void be_eth_rq_destroy_internal_cb(void *context, int status,
85161 + struct MCC_WRB_AMAP *wrb)
85162 +{
85163 + struct be_ethrq_object *eth_rq = (struct be_ethrq_object *) context;
85164 +
85165 + if (status != BE_SUCCESS) {
85166 + TRACE(DL_ERR, "Destroy eth rq failed in internal callback.\n");
85167 + } else {
85168 + /* Dereference any CQs associated with this queue. */
85169 + atomic_dec(&eth_rq->cq_object->ref_count);
85170 + }
85171 +
85172 + return;
85173 +}
85174 +
85175 +int be_eth_rq_destroy(struct be_ethrq_object *eth_rq)
85176 +{
85177 + int status = BE_SUCCESS;
85178 +
85179 + /* Send fwcmd to destroy the RQ. */
85180 + status = be_function_ring_destroy(eth_rq->parent_function,
85181 + eth_rq->rid, FWCMD_RING_TYPE_ETH_RX, NULL, NULL,
85182 + be_eth_rq_destroy_internal_cb, eth_rq);
85183 +
85184 + return status;
85185 +}
85186 +
85187 +/*
85188 + *---------------------------------------------------------------------------
85189 + * Function: be_eth_rq_destroy_options
85190 + * Destroys an ethernet receive ring with finer granularity options
85191 + * than the standard be_eth_rq_destroy() API function.
85192 + * eth_rq -
85193 + * flush - Set to 1 to flush the ring, set to 0 to bypass the flush
85194 + * cb - Callback function on completion
85195 + * cb_context - Callback context
85196 + * return status - BE_SUCCESS (0) on success. Negative error code on failure.
85197 + *----------------------------------------------------------------------------
85198 + */
85199 +int
85200 +be_eth_rq_destroy_options(struct be_ethrq_object *eth_rq, bool flush,
85201 + mcc_wrb_cqe_callback cb, void *cb_context)
85202 +{
85203 + struct FWCMD_COMMON_RING_DESTROY *fwcmd = NULL;
85204 + struct MCC_WRB_AMAP *wrb = NULL;
85205 + int status = BE_SUCCESS;
85206 + struct be_function_object *pfob = NULL;
85207 + unsigned long irql;
85208 +
85209 + pfob = eth_rq->parent_function;
85210 +
85211 + spin_lock_irqsave(&pfob->post_lock, irql);
85212 +
85213 + TRACE(DL_INFO, "Destroy eth_rq ring id:%d, flush:%d", eth_rq->rid,
85214 + flush);
85215 +
85216 + wrb = be_function_peek_mcc_wrb(pfob);
85217 + if (!wrb) {
85218 + ASSERT(wrb);
85219 + TRACE(DL_ERR, "No free MCC WRBs in destroy eth_rq ring.");
85220 + status = BE_STATUS_NO_MCC_WRB;
85221 + goto Error;
85222 + }
85223 + /* Prepares an embedded fwcmd, including request/response sizes. */
85224 + fwcmd = BE_PREPARE_EMBEDDED_FWCMD(pfob, wrb, COMMON_RING_DESTROY);
85225 +
85226 + fwcmd->params.request.id = eth_rq->rid;
85227 + fwcmd->params.request.ring_type = FWCMD_RING_TYPE_ETH_RX;
85228 + fwcmd->params.request.bypass_flush = ((0 == flush) ? 1 : 0);
85229 +
85230 + /* Post the f/w command */
85231 + status = be_function_post_mcc_wrb(pfob, wrb, NULL, cb, cb_context,
85232 + be_eth_rq_destroy_internal_cb, eth_rq, fwcmd, NULL);
85233 +
85234 + if (status != BE_SUCCESS && status != BE_PENDING) {
85235 + TRACE(DL_ERR, "eth_rq ring destroy failed. id:%d, flush:%d",
85236 + eth_rq->rid, flush);
85237 + goto Error;
85238 + }
85239 +
85240 +Error:
85241 + spin_unlock_irqrestore(&pfob->post_lock, irql);
85242 +
85243 + if (pfob->pend_queue_driving && pfob->mcc) {
85244 + pfob->pend_queue_driving = 0;
85245 + be_drive_mcc_wrb_queue(pfob->mcc);
85246 + }
85247 + return status;
85248 +}
85249 +
85250 +/*
85251 + This routine queries the frag size for erx.
85252 +
85253 + pfob - handle to a function object
85254 +
85255 + frag_size_bytes - erx frag size in bytes that is/was set.
85256 +
85257 + Returns BE_SUCCESS if successfull, otherwise a useful int error
85258 + code is returned.
85259 +
85260 + IRQL: < DISPATCH_LEVEL
85261 +
85262 +*/
85263 +int
85264 +be_eth_rq_get_frag_size(struct be_function_object *pfob, u32 *frag_size_bytes)
85265 +{
85266 + struct FWCMD_ETH_GET_RX_FRAG_SIZE *fwcmd = NULL;
85267 + struct MCC_WRB_AMAP *wrb = NULL;
85268 + int status = 0;
85269 + unsigned long irql;
85270 +
85271 + ASSERT(frag_size_bytes);
85272 +
85273 + spin_lock_irqsave(&pfob->post_lock, irql);
85274 +
85275 + wrb = be_function_peek_mcc_wrb(pfob);
85276 + if (!wrb) {
85277 + TRACE(DL_ERR, "MCC wrb peek failed.");
85278 + return BE_STATUS_NO_MCC_WRB;
85279 + }
85280 + /* Prepares an embedded fwcmd, including request/response sizes. */
85281 + fwcmd = BE_PREPARE_EMBEDDED_FWCMD(pfob, wrb, ETH_GET_RX_FRAG_SIZE);
85282 +
85283 + /* Post the f/w command */
85284 + status = be_function_post_mcc_wrb(pfob, wrb, NULL, NULL, NULL,
85285 + NULL, NULL, fwcmd, NULL);
85286 +
85287 + if (status != 0) {
85288 + TRACE(DL_ERR, "get frag size fwcmd failed.");
85289 + goto error;
85290 + }
85291 +
85292 + *frag_size_bytes = 1 << fwcmd->params.response.actual_fragsize_log2;
85293 +
85294 +error:
85295 + spin_unlock_irqrestore(&pfob->post_lock, irql);
85296 +
85297 + if (pfob->pend_queue_driving && pfob->mcc) {
85298 + pfob->pend_queue_driving = 0;
85299 + be_drive_mcc_wrb_queue(pfob->mcc);
85300 + }
85301 + return status;
85302 +}
85303 +
85304 +/*
85305 + This routine attempts to set the frag size for erx. If the frag size is
85306 + already set, the attempt fails and the current frag size is returned.
85307 +
85308 + pfob - Handle to a function object
85309 +
85310 + frag_size - Erx frag size in bytes that is/was set.
85311 +
85312 + current_frag_size_bytes - Pointer to location where currrent frag
85313 + is to be rturned
85314 +
85315 + Returns BE_SUCCESS if successfull, otherwise a useful int error
85316 + code is returned.
85317 +
85318 + IRQL: < DISPATCH_LEVEL
85319 +
85320 + This function always fails in non-privileged machine context.
85321 +*/
85322 +int
85323 +be_eth_rq_set_frag_size(struct be_function_object *pfob,
85324 + u32 frag_size, u32 *frag_size_bytes)
85325 +{
85326 + struct FWCMD_ETH_SET_RX_FRAG_SIZE *fwcmd = NULL;
85327 + struct MCC_WRB_AMAP *wrb = NULL;
85328 + int status = 0;
85329 + unsigned long irql;
85330 +
85331 + ASSERT(frag_size_bytes);
85332 +
85333 + spin_lock_irqsave(&pfob->post_lock, irql);
85334 +
85335 + wrb = be_function_peek_mcc_wrb(pfob);
85336 + if (!wrb) {
85337 + TRACE(DL_ERR, "MCC wrb peek failed.");
85338 + status = BE_STATUS_NO_MCC_WRB;
85339 + goto error;
85340 + }
85341 + /* Prepares an embedded fwcmd, including request/response sizes. */
85342 + fwcmd = BE_PREPARE_EMBEDDED_FWCMD(pfob, wrb, ETH_SET_RX_FRAG_SIZE);
85343 +
85344 + ASSERT(frag_size >= 128 && frag_size <= 16 * 1024);
85345 +
85346 + /* This is the log2 of the fragsize. This is not the exact
85347 + * ERX encoding. */
85348 + fwcmd->params.request.new_fragsize_log2 = __ilog2_u32(frag_size);
85349 +
85350 + /* Post the f/w command */
85351 + status = be_function_post_mcc_wrb(pfob, wrb, NULL, NULL, NULL,
85352 + NULL, NULL, fwcmd, NULL);
85353 +
85354 + if (status != 0) {
85355 + TRACE(DL_ERR, "set frag size fwcmd failed.");
85356 + goto error;
85357 + }
85358 +
85359 + *frag_size_bytes = 1 << fwcmd->params.response.actual_fragsize_log2;
85360 +error:
85361 + spin_unlock_irqrestore(&pfob->post_lock, irql);
85362 +
85363 + if (pfob->pend_queue_driving && pfob->mcc) {
85364 + pfob->pend_queue_driving = 0;
85365 + be_drive_mcc_wrb_queue(pfob->mcc);
85366 + }
85367 + return status;
85368 +}
85369 +
85370 +
85371 +/*
85372 + This routine gets or sets a mac address for a domain
85373 + given the port and mac.
85374 +
85375 + FunctionObject - Function object handle.
85376 + port1 - Set to TRUE if this function will set/get the Port 1
85377 + address. Only the host may set this to TRUE.
85378 + mac1 - Set to TRUE if this function will set/get the
85379 + MAC 1 address. Only the host may set this to TRUE.
85380 + write - Set to TRUE if this function should write the mac address.
85381 + mac_address - Buffer of the mac address to read or write.
85382 +
85383 + Returns BE_SUCCESS if successfull, otherwise a useful int is returned.
85384 +
85385 + IRQL: < DISPATCH_LEVEL
85386 +*/
85387 +int be_rxf_mac_address_read_write(struct be_function_object *pfob,
85388 + bool port1, /* VM must always set to false */
85389 + bool mac1, /* VM must always set to false */
85390 + bool mgmt, bool write,
85391 + bool permanent, u8 *mac_address,
85392 + mcc_wrb_cqe_callback cb, /* optional */
85393 + void *cb_context) /* optional */
85394 +{
85395 + int status = BE_SUCCESS;
85396 + union {
85397 + struct FWCMD_COMMON_NTWK_MAC_QUERY *query;
85398 + struct FWCMD_COMMON_NTWK_MAC_SET *set;
85399 + } fwcmd = {NULL};
85400 + struct MCC_WRB_AMAP *wrb = NULL;
85401 + u32 type = 0;
85402 + unsigned long irql;
85403 + struct be_mcc_wrb_response_copy rc;
85404 +
85405 + spin_lock_irqsave(&pfob->post_lock, irql);
85406 +
85407 + ASSERT(mac_address);
85408 +
85409 + ASSERT(port1 == false);
85410 + ASSERT(mac1 == false);
85411 +
85412 + wrb = be_function_peek_mcc_wrb(pfob);
85413 + if (!wrb) {
85414 + TRACE(DL_ERR, "MCC wrb peek failed.");
85415 + status = BE_STATUS_NO_MCC_WRB;
85416 + goto Error;
85417 + }
85418 +
85419 + if (mgmt) {
85420 + type = MAC_ADDRESS_TYPE_MANAGEMENT;
85421 + } else {
85422 + if (pfob->type == BE_FUNCTION_TYPE_NETWORK)
85423 + type = MAC_ADDRESS_TYPE_NETWORK;
85424 + else
85425 + type = MAC_ADDRESS_TYPE_STORAGE;
85426 + }
85427 +
85428 + if (write) {
85429 + /* Prepares an embedded fwcmd, including
85430 + * request/response sizes.
85431 + */
85432 + fwcmd.set = BE_PREPARE_EMBEDDED_FWCMD(pfob,
85433 + wrb, COMMON_NTWK_MAC_SET);
85434 +
85435 + fwcmd.set->params.request.invalidate = 0;
85436 + fwcmd.set->params.request.mac1 = (mac1 ? 1 : 0);
85437 + fwcmd.set->params.request.port = (port1 ? 1 : 0);
85438 + fwcmd.set->params.request.type = type;
85439 +
85440 + /* Copy the mac address to set. */
85441 + fwcmd.set->params.request.mac.SizeOfStructure =
85442 + sizeof(fwcmd.set->params.request.mac);
85443 + memcpy(fwcmd.set->params.request.mac.MACAddress,
85444 + mac_address, ETH_ALEN);
85445 +
85446 + /* Post the f/w command */
85447 + status = be_function_post_mcc_wrb(pfob, wrb, NULL,
85448 + cb, cb_context, NULL, NULL, fwcmd.set, NULL);
85449 +
85450 + } else {
85451 +
85452 + /*
85453 + * Prepares an embedded fwcmd, including
85454 + * request/response sizes.
85455 + */
85456 + fwcmd.query = BE_PREPARE_EMBEDDED_FWCMD(pfob,
85457 + wrb, COMMON_NTWK_MAC_QUERY);
85458 +
85459 + fwcmd.query->params.request.mac1 = (mac1 ? 1 : 0);
85460 + fwcmd.query->params.request.port = (port1 ? 1 : 0);
85461 + fwcmd.query->params.request.type = type;
85462 + fwcmd.query->params.request.permanent = permanent;
85463 +
85464 + rc.length = FIELD_SIZEOF(struct FWCMD_COMMON_NTWK_MAC_QUERY,
85465 + params.response.mac.MACAddress);
85466 + rc.fwcmd_offset = offsetof(struct FWCMD_COMMON_NTWK_MAC_QUERY,
85467 + params.response.mac.MACAddress);
85468 + rc.va = mac_address;
85469 + /* Post the f/w command (with a copy for the response) */
85470 + status = be_function_post_mcc_wrb(pfob, wrb, NULL, cb,
85471 + cb_context, NULL, NULL, fwcmd.query, &rc);
85472 + }
85473 +
85474 + if (status < 0) {
85475 + TRACE(DL_ERR, "mac set/query failed.");
85476 + goto Error;
85477 + }
85478 +
85479 +Error:
85480 + spin_unlock_irqrestore(&pfob->post_lock, irql);
85481 + if (pfob->pend_queue_driving && pfob->mcc) {
85482 + pfob->pend_queue_driving = 0;
85483 + be_drive_mcc_wrb_queue(pfob->mcc);
85484 + }
85485 + return status;
85486 +}
85487 +
85488 +/*
85489 + This routine writes data to context memory.
85490 +
85491 + pfob - Function object handle.
85492 + mac_table - Set to the 128-bit multicast address hash table.
85493 +
85494 + Returns BE_SUCCESS if successfull, otherwise a useful int is returned.
85495 +
85496 + IRQL: < DISPATCH_LEVEL
85497 +*/
85498 +
85499 +int be_rxf_multicast_config(struct be_function_object *pfob,
85500 + bool promiscuous, u32 num, u8 *mac_table,
85501 + mcc_wrb_cqe_callback cb, /* optional */
85502 + void *cb_context,
85503 + struct be_multicast_q_ctxt *q_ctxt)
85504 +{
85505 + int status = BE_SUCCESS;
85506 + struct FWCMD_COMMON_NTWK_MULTICAST_SET *fwcmd = NULL;
85507 + struct MCC_WRB_AMAP *wrb = NULL;
85508 + struct be_generic_q_ctxt *generic_ctxt = NULL;
85509 + unsigned long irql;
85510 +
85511 + ASSERT(num <= ARRAY_SIZE(fwcmd->params.request.mac));
85512 +
85513 + if (num > ARRAY_SIZE(fwcmd->params.request.mac)) {
85514 + TRACE(DL_ERR, "Too many multicast addresses. BE supports %d.",
85515 + (int) ARRAY_SIZE(fwcmd->params.request.mac));
85516 + return BE_NOT_OK;
85517 + }
85518 +
85519 + spin_lock_irqsave(&pfob->post_lock, irql);
85520 +
85521 + wrb = be_function_peek_mcc_wrb(pfob);
85522 + if (!wrb) {
85523 + if (q_ctxt && cb) {
85524 + wrb = (struct MCC_WRB_AMAP *) &q_ctxt->wrb_header;
85525 + generic_ctxt = (struct be_generic_q_ctxt *) q_ctxt;
85526 + generic_ctxt->context.bytes = sizeof(*q_ctxt);
85527 + } else {
85528 + status = BE_STATUS_NO_MCC_WRB;
85529 + goto Error;
85530 + }
85531 + }
85532 + /* Prepares an embedded fwcmd, including request/response sizes. */
85533 + fwcmd = BE_PREPARE_EMBEDDED_FWCMD(pfob, wrb, COMMON_NTWK_MULTICAST_SET);
85534 +
85535 + fwcmd->params.request.promiscuous = promiscuous;
85536 + if (!promiscuous) {
85537 + fwcmd->params.request.num_mac = num;
85538 + if (num > 0) {
85539 + ASSERT(mac_table);
85540 + memcpy(fwcmd->params.request.mac,
85541 + mac_table, ETH_ALEN * num);
85542 + }
85543 + }
85544 +
85545 + /* Post the f/w command */
85546 + status = be_function_post_mcc_wrb(pfob, wrb, generic_ctxt,
85547 + cb, cb_context, NULL, NULL, fwcmd, NULL);
85548 + if (status < 0) {
85549 + TRACE(DL_ERR, "multicast fwcmd failed.");
85550 + goto Error;
85551 + }
85552 +
85553 +Error:
85554 + spin_unlock_irqrestore(&pfob->post_lock, irql);
85555 + if (pfob->pend_queue_driving && pfob->mcc) {
85556 + pfob->pend_queue_driving = 0;
85557 + be_drive_mcc_wrb_queue(pfob->mcc);
85558 + }
85559 + return status;
85560 +}
85561 +
85562 +/*
85563 + This routine adds or removes a vlan tag from the rxf table.
85564 +
85565 + FunctionObject - Function object handle.
85566 + VLanTag - VLan tag to add or remove.
85567 + Add - Set to TRUE if this will add a vlan tag
85568 +
85569 + Returns BE_SUCCESS if successfull, otherwise a useful int is returned.
85570 +
85571 + IRQL: < DISPATCH_LEVEL
85572 +*/
85573 +int be_rxf_vlan_config(struct be_function_object *pfob,
85574 + bool promiscuous, u32 num, u16 *vlan_tag_array,
85575 + mcc_wrb_cqe_callback cb, /* optional */
85576 + void *cb_context,
85577 + struct be_vlan_q_ctxt *q_ctxt) /* optional */
85578 +{
85579 + int status = BE_SUCCESS;
85580 + struct FWCMD_COMMON_NTWK_VLAN_CONFIG *fwcmd = NULL;
85581 + struct MCC_WRB_AMAP *wrb = NULL;
85582 + struct be_generic_q_ctxt *generic_ctxt = NULL;
85583 + unsigned long irql;
85584 +
85585 + if (num > ARRAY_SIZE(fwcmd->params.request.vlan_tag)) {
85586 + TRACE(DL_ERR, "Too many VLAN tags.");
85587 + return BE_NOT_OK;
85588 + }
85589 +
85590 + spin_lock_irqsave(&pfob->post_lock, irql);
85591 +
85592 + wrb = be_function_peek_mcc_wrb(pfob);
85593 + if (!wrb) {
85594 + if (q_ctxt && cb) {
85595 + wrb = (struct MCC_WRB_AMAP *) &q_ctxt->wrb_header;
85596 + generic_ctxt = (struct be_generic_q_ctxt *) q_ctxt;
85597 + generic_ctxt->context.bytes = sizeof(*q_ctxt);
85598 + } else {
85599 + status = BE_STATUS_NO_MCC_WRB;
85600 + goto Error;
85601 + }
85602 + }
85603 + /* Prepares an embedded fwcmd, including request/response sizes. */
85604 + fwcmd = BE_PREPARE_EMBEDDED_FWCMD(pfob, wrb, COMMON_NTWK_VLAN_CONFIG);
85605 +
85606 + fwcmd->params.request.promiscuous = promiscuous;
85607 + if (!promiscuous) {
85608 + fwcmd->params.request.num_vlan = num;
85609 +
85610 + if (num > 0) {
85611 + ASSERT(vlan_tag_array);
85612 + memcpy(fwcmd->params.request.vlan_tag, vlan_tag_array,
85613 + num * sizeof(vlan_tag_array[0]));
85614 + }
85615 + }
85616 +
85617 + /* Post the commadn */
85618 + status = be_function_post_mcc_wrb(pfob, wrb, generic_ctxt,
85619 + cb, cb_context, NULL, NULL, fwcmd, NULL);
85620 + if (status < 0) {
85621 + TRACE(DL_ERR, "vlan fwcmd failed.");
85622 + goto Error;
85623 + }
85624 +
85625 +Error:
85626 + spin_unlock_irqrestore(&pfob->post_lock, irql);
85627 + if (pfob->pend_queue_driving && pfob->mcc) {
85628 + pfob->pend_queue_driving = 0;
85629 + be_drive_mcc_wrb_queue(pfob->mcc);
85630 + }
85631 + return status;
85632 +}
85633 +
85634 +
85635 +int be_rxf_link_status(struct be_function_object *pfob,
85636 + struct BE_LINK_STATUS *link_status,
85637 + mcc_wrb_cqe_callback cb,
85638 + void *cb_context,
85639 + struct be_link_status_q_ctxt *q_ctxt)
85640 +{
85641 + struct FWCMD_COMMON_NTWK_LINK_STATUS_QUERY *fwcmd = NULL;
85642 + struct MCC_WRB_AMAP *wrb = NULL;
85643 + int status = 0;
85644 + struct be_generic_q_ctxt *generic_ctxt = NULL;
85645 + unsigned long irql;
85646 + struct be_mcc_wrb_response_copy rc;
85647 +
85648 + ASSERT(link_status);
85649 +
85650 + spin_lock_irqsave(&pfob->post_lock, irql);
85651 +
85652 + wrb = be_function_peek_mcc_wrb(pfob);
85653 +
85654 + if (!wrb) {
85655 + if (q_ctxt && cb) {
85656 + wrb = (struct MCC_WRB_AMAP *) &q_ctxt->wrb_header;
85657 + generic_ctxt = (struct be_generic_q_ctxt *) q_ctxt;
85658 + generic_ctxt->context.bytes = sizeof(*q_ctxt);
85659 + } else {
85660 + status = BE_STATUS_NO_MCC_WRB;
85661 + goto Error;
85662 + }
85663 + }
85664 + /* Prepares an embedded fwcmd, including request/response sizes. */
85665 + fwcmd = BE_PREPARE_EMBEDDED_FWCMD(pfob, wrb,
85666 + COMMON_NTWK_LINK_STATUS_QUERY);
85667 +
85668 + rc.length = FIELD_SIZEOF(struct FWCMD_COMMON_NTWK_LINK_STATUS_QUERY,
85669 + params.response);
85670 + rc.fwcmd_offset = offsetof(struct FWCMD_COMMON_NTWK_LINK_STATUS_QUERY,
85671 + params.response);
85672 + rc.va = link_status;
85673 + /* Post or queue the f/w command */
85674 + status = be_function_post_mcc_wrb(pfob, wrb, generic_ctxt,
85675 + cb, cb_context, NULL, NULL, fwcmd, &rc);
85676 +
85677 + if (status < 0) {
85678 + TRACE(DL_ERR, "link status fwcmd failed.");
85679 + goto Error;
85680 + }
85681 +
85682 +Error:
85683 + spin_unlock_irqrestore(&pfob->post_lock, irql);
85684 + if (pfob->pend_queue_driving && pfob->mcc) {
85685 + pfob->pend_queue_driving = 0;
85686 + be_drive_mcc_wrb_queue(pfob->mcc);
85687 + }
85688 + return status;
85689 +}
85690 +
85691 +int
85692 +be_rxf_query_eth_statistics(struct be_function_object *pfob,
85693 + struct FWCMD_ETH_GET_STATISTICS *va_for_fwcmd,
85694 + u64 pa_for_fwcmd, mcc_wrb_cqe_callback cb,
85695 + void *cb_context,
85696 + struct be_nonembedded_q_ctxt *q_ctxt)
85697 +{
85698 + struct MCC_WRB_AMAP *wrb = NULL;
85699 + int status = 0;
85700 + struct be_generic_q_ctxt *generic_ctxt = NULL;
85701 + unsigned long irql;
85702 +
85703 + ASSERT(va_for_fwcmd);
85704 + ASSERT(pa_for_fwcmd);
85705 +
85706 + spin_lock_irqsave(&pfob->post_lock, irql);
85707 +
85708 + wrb = be_function_peek_mcc_wrb(pfob);
85709 +
85710 + if (!wrb) {
85711 + if (q_ctxt && cb) {
85712 + wrb = (struct MCC_WRB_AMAP *) &q_ctxt->wrb_header;
85713 + generic_ctxt = (struct be_generic_q_ctxt *) q_ctxt;
85714 + generic_ctxt->context.bytes = sizeof(*q_ctxt);
85715 + } else {
85716 + status = BE_STATUS_NO_MCC_WRB;
85717 + goto Error;
85718 + }
85719 + }
85720 +
85721 + TRACE(DL_INFO, "Query eth stats. fwcmd va:%p pa:0x%08x_%08x",
85722 + va_for_fwcmd, upper_32_bits(pa_for_fwcmd), (u32)pa_for_fwcmd);
85723 +
85724 + /* Prepares an embedded fwcmd, including request/response sizes. */
85725 + va_for_fwcmd = BE_PREPARE_NONEMBEDDED_FWCMD(pfob, wrb,
85726 + va_for_fwcmd, pa_for_fwcmd, ETH_GET_STATISTICS);
85727 +
85728 + /* Post the f/w command */
85729 + status = be_function_post_mcc_wrb(pfob, wrb, generic_ctxt,
85730 + cb, cb_context, NULL, NULL, va_for_fwcmd, NULL);
85731 + if (status < 0) {
85732 + TRACE(DL_ERR, "eth stats fwcmd failed.");
85733 + goto Error;
85734 + }
85735 +
85736 +Error:
85737 + spin_unlock_irqrestore(&pfob->post_lock, irql);
85738 + if (pfob->pend_queue_driving && pfob->mcc) {
85739 + pfob->pend_queue_driving = 0;
85740 + be_drive_mcc_wrb_queue(pfob->mcc);
85741 + }
85742 + return status;
85743 +}
85744 +
85745 +int
85746 +be_rxf_promiscuous(struct be_function_object *pfob,
85747 + bool enable_port0, bool enable_port1,
85748 + mcc_wrb_cqe_callback cb, void *cb_context,
85749 + struct be_promiscuous_q_ctxt *q_ctxt)
85750 +{
85751 + struct FWCMD_ETH_PROMISCUOUS *fwcmd = NULL;
85752 + struct MCC_WRB_AMAP *wrb = NULL;
85753 + int status = 0;
85754 + struct be_generic_q_ctxt *generic_ctxt = NULL;
85755 + unsigned long irql;
85756 +
85757 +
85758 + spin_lock_irqsave(&pfob->post_lock, irql);
85759 +
85760 + wrb = be_function_peek_mcc_wrb(pfob);
85761 +
85762 + if (!wrb) {
85763 + if (q_ctxt && cb) {
85764 + wrb = (struct MCC_WRB_AMAP *) &q_ctxt->wrb_header;
85765 + generic_ctxt = (struct be_generic_q_ctxt *) q_ctxt;
85766 + generic_ctxt->context.bytes = sizeof(*q_ctxt);
85767 + } else {
85768 + status = BE_STATUS_NO_MCC_WRB;
85769 + goto Error;
85770 + }
85771 + }
85772 + /* Prepares an embedded fwcmd, including request/response sizes. */
85773 + fwcmd = BE_PREPARE_EMBEDDED_FWCMD(pfob, wrb, ETH_PROMISCUOUS);
85774 +
85775 + fwcmd->params.request.port0_promiscuous = enable_port0;
85776 + fwcmd->params.request.port1_promiscuous = enable_port1;
85777 +
85778 + /* Post the f/w command */
85779 + status = be_function_post_mcc_wrb(pfob, wrb, generic_ctxt,
85780 + cb, cb_context, NULL, NULL, fwcmd, NULL);
85781 +
85782 + if (status < 0) {
85783 + TRACE(DL_ERR, "promiscuous fwcmd failed.");
85784 + goto Error;
85785 + }
85786 +
85787 +Error:
85788 + spin_unlock_irqrestore(&pfob->post_lock, irql);
85789 + if (pfob->pend_queue_driving && pfob->mcc) {
85790 + pfob->pend_queue_driving = 0;
85791 + be_drive_mcc_wrb_queue(pfob->mcc);
85792 + }
85793 + return status;
85794 +}
85795 +
85796 +
85797 +/*
85798 + *-------------------------------------------------------------------------
85799 + * Function: be_rxf_filter_config
85800 + * Configures BladeEngine ethernet receive filter settings.
85801 + * pfob -
85802 + * settings - Pointer to the requested filter settings.
85803 + * The response from BladeEngine will be placed back
85804 + * in this structure.
85805 + * cb - optional
85806 + * cb_context - optional
85807 + * q_ctxt - Optional. Pointer to a previously allocated struct.
85808 + * If the MCC WRB ring is full, this structure is
85809 + * used to queue the operation. It will be posted
85810 + * to the MCC ring when space becomes available. All
85811 + * queued commands will be posted to the ring in
85812 + * the order they are received. It is always valid
85813 + * to pass a pointer to a generic
85814 + * be_generic_q_ctxt. However, the specific
85815 + * context structs are generally smaller than
85816 + * the generic struct.
85817 + * return pend_status - BE_SUCCESS (0) on success.
85818 + * BE_PENDING (postive value) if the FWCMD
85819 + * completion is pending. Negative error code on failure.
85820 + *---------------------------------------------------------------------------
85821 + */
85822 +int
85823 +be_rxf_filter_config(struct be_function_object *pfob,
85824 + struct NTWK_RX_FILTER_SETTINGS *settings,
85825 + mcc_wrb_cqe_callback cb, void *cb_context,
85826 + struct be_rxf_filter_q_ctxt *q_ctxt)
85827 +{
85828 + struct FWCMD_COMMON_NTWK_RX_FILTER *fwcmd = NULL;
85829 + struct MCC_WRB_AMAP *wrb = NULL;
85830 + int status = 0;
85831 + struct be_generic_q_ctxt *generic_ctxt = NULL;
85832 + unsigned long irql;
85833 + struct be_mcc_wrb_response_copy rc;
85834 +
85835 + ASSERT(settings);
85836 +
85837 + spin_lock_irqsave(&pfob->post_lock, irql);
85838 +
85839 + wrb = be_function_peek_mcc_wrb(pfob);
85840 +
85841 + if (!wrb) {
85842 + if (q_ctxt && cb) {
85843 + wrb = (struct MCC_WRB_AMAP *) &q_ctxt->wrb_header;
85844 + generic_ctxt = (struct be_generic_q_ctxt *) q_ctxt;
85845 + generic_ctxt->context.bytes = sizeof(*q_ctxt);
85846 + } else {
85847 + status = BE_STATUS_NO_MCC_WRB;
85848 + goto Error;
85849 + }
85850 + }
85851 + /* Prepares an embedded fwcmd, including request/response sizes. */
85852 + fwcmd = BE_PREPARE_EMBEDDED_FWCMD(pfob, wrb, COMMON_NTWK_RX_FILTER);
85853 + memcpy(&fwcmd->params.request, settings, sizeof(*settings));
85854 +
85855 + rc.length = FIELD_SIZEOF(struct FWCMD_COMMON_NTWK_RX_FILTER,
85856 + params.response);
85857 + rc.fwcmd_offset = offsetof(struct FWCMD_COMMON_NTWK_RX_FILTER,
85858 + params.response);
85859 + rc.va = settings;
85860 + /* Post or queue the f/w command */
85861 + status = be_function_post_mcc_wrb(pfob, wrb, generic_ctxt,
85862 + cb, cb_context, NULL, NULL, fwcmd, &rc);
85863 +
85864 + if (status < 0) {
85865 + TRACE(DL_ERR, "RXF/ERX filter config fwcmd failed.");
85866 + goto Error;
85867 + }
85868 +
85869 +Error:
85870 + spin_unlock_irqrestore(&pfob->post_lock, irql);
85871 + if (pfob->pend_queue_driving && pfob->mcc) {
85872 + pfob->pend_queue_driving = 0;
85873 + be_drive_mcc_wrb_queue(pfob->mcc);
85874 + }
85875 + return status;
85876 +}
85877 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/etx_context.h linux-2.6.29-rc3.owrt/drivers/staging/benet/etx_context.h
85878 --- linux-2.6.29.owrt/drivers/staging/benet/etx_context.h 1970-01-01 01:00:00.000000000 +0100
85879 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/etx_context.h 2009-05-10 23:48:29.000000000 +0200
85880 @@ -0,0 +1,55 @@
85881 +/*
85882 + * Copyright (C) 2005 - 2008 ServerEngines
85883 + * All rights reserved.
85884 + *
85885 + * This program is free software; you can redistribute it and/or
85886 + * modify it under the terms of the GNU General Public License version 2
85887 + * as published by the Free Software Foundation. The full GNU General
85888 + * Public License is included in this distribution in the file called COPYING.
85889 + *
85890 + * Contact Information:
85891 + * linux-drivers@serverengines.com
85892 + *
85893 + * ServerEngines
85894 + * 209 N. Fair Oaks Ave
85895 + * Sunnyvale, CA 94085
85896 + */
85897 +/*
85898 + * Autogenerated by srcgen version: 0127
85899 + */
85900 +#ifndef __etx_context_amap_h__
85901 +#define __etx_context_amap_h__
85902 +
85903 +/* ETX ring context structure. */
85904 +struct BE_ETX_CONTEXT_AMAP {
85905 + u8 tx_cidx[11]; /* DWORD 0 */
85906 + u8 rsvd0[5]; /* DWORD 0 */
85907 + u8 rsvd1[16]; /* DWORD 0 */
85908 + u8 tx_pidx[11]; /* DWORD 1 */
85909 + u8 rsvd2; /* DWORD 1 */
85910 + u8 tx_ring_size[4]; /* DWORD 1 */
85911 + u8 pd_id[5]; /* DWORD 1 */
85912 + u8 pd_id_not_valid; /* DWORD 1 */
85913 + u8 cq_id_send[10]; /* DWORD 1 */
85914 + u8 rsvd3[32]; /* DWORD 2 */
85915 + u8 rsvd4[32]; /* DWORD 3 */
85916 + u8 cur_bytes[32]; /* DWORD 4 */
85917 + u8 max_bytes[32]; /* DWORD 5 */
85918 + u8 time_stamp[32]; /* DWORD 6 */
85919 + u8 rsvd5[11]; /* DWORD 7 */
85920 + u8 func; /* DWORD 7 */
85921 + u8 rsvd6[20]; /* DWORD 7 */
85922 + u8 cur_txd_count[32]; /* DWORD 8 */
85923 + u8 max_txd_count[32]; /* DWORD 9 */
85924 + u8 rsvd7[32]; /* DWORD 10 */
85925 + u8 rsvd8[32]; /* DWORD 11 */
85926 + u8 rsvd9[32]; /* DWORD 12 */
85927 + u8 rsvd10[32]; /* DWORD 13 */
85928 + u8 rsvd11[32]; /* DWORD 14 */
85929 + u8 rsvd12[32]; /* DWORD 15 */
85930 +} __packed;
85931 +struct ETX_CONTEXT_AMAP {
85932 + u32 dw[16];
85933 +};
85934 +
85935 +#endif /* __etx_context_amap_h__ */
85936 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/funcobj.c linux-2.6.29-rc3.owrt/drivers/staging/benet/funcobj.c
85937 --- linux-2.6.29.owrt/drivers/staging/benet/funcobj.c 1970-01-01 01:00:00.000000000 +0100
85938 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/funcobj.c 2009-05-10 23:48:29.000000000 +0200
85939 @@ -0,0 +1,565 @@
85940 +/*
85941 + * Copyright (C) 2005 - 2008 ServerEngines
85942 + * All rights reserved.
85943 + *
85944 + * This program is free software; you can redistribute it and/or
85945 + * modify it under the terms of the GNU General Public License version 2
85946 + * as published by the Free Software Foundation. The full GNU General
85947 + * Public License is included in this distribution in the file called COPYING.
85948 + *
85949 + * Contact Information:
85950 + * linux-drivers@serverengines.com
85951 + *
85952 + * ServerEngines
85953 + * 209 N. Fair Oaks Ave
85954 + * Sunnyvale, CA 94085
85955 + */
85956 +#include "hwlib.h"
85957 +#include "bestatus.h"
85958 +
85959 +
85960 +int
85961 +be_function_internal_query_firmware_config(struct be_function_object *pfob,
85962 + struct BE_FIRMWARE_CONFIG *config)
85963 +{
85964 + struct FWCMD_COMMON_FIRMWARE_CONFIG *fwcmd = NULL;
85965 + struct MCC_WRB_AMAP *wrb = NULL;
85966 + int status = 0;
85967 + unsigned long irql;
85968 + struct be_mcc_wrb_response_copy rc;
85969 +
85970 + spin_lock_irqsave(&pfob->post_lock, irql);
85971 +
85972 + wrb = be_function_peek_mcc_wrb(pfob);
85973 + if (!wrb) {
85974 + TRACE(DL_ERR, "MCC wrb peek failed.");
85975 + status = BE_STATUS_NO_MCC_WRB;
85976 + goto error;
85977 + }
85978 + /* Prepares an embedded fwcmd, including request/response sizes. */
85979 + fwcmd = BE_PREPARE_EMBEDDED_FWCMD(pfob, wrb, COMMON_FIRMWARE_CONFIG);
85980 +
85981 + rc.length = FIELD_SIZEOF(struct FWCMD_COMMON_FIRMWARE_CONFIG,
85982 + params.response);
85983 + rc.fwcmd_offset = offsetof(struct FWCMD_COMMON_FIRMWARE_CONFIG,
85984 + params.response);
85985 + rc.va = config;
85986 +
85987 + /* Post the f/w command */
85988 + status = be_function_post_mcc_wrb(pfob, wrb, NULL, NULL,
85989 + NULL, NULL, NULL, fwcmd, &rc);
85990 +error:
85991 + spin_unlock_irqrestore(&pfob->post_lock, irql);
85992 + if (pfob->pend_queue_driving && pfob->mcc) {
85993 + pfob->pend_queue_driving = 0;
85994 + be_drive_mcc_wrb_queue(pfob->mcc);
85995 + }
85996 + return status;
85997 +}
85998 +
85999 +/*
86000 + This allocates and initializes a function object based on the information
86001 + provided by upper layer drivers.
86002 +
86003 + Returns BE_SUCCESS on success and an appropriate int on failure.
86004 +
86005 + A function object represents a single BladeEngine (logical) PCI function.
86006 + That is a function object either represents
86007 + the networking side of BladeEngine or the iSCSI side of BladeEngine.
86008 +
86009 + This routine will also detect and create an appropriate PD object for the
86010 + PCI function as needed.
86011 +*/
86012 +int
86013 +be_function_object_create(u8 __iomem *csr_va, u8 __iomem *db_va,
86014 + u8 __iomem *pci_va, u32 function_type,
86015 + struct ring_desc *mailbox, struct be_function_object *pfob)
86016 +{
86017 + int status;
86018 +
86019 + ASSERT(pfob); /* not a magic assert */
86020 + ASSERT(function_type <= 2);
86021 +
86022 + TRACE(DL_INFO, "Create function object. type:%s object:0x%p",
86023 + (function_type == BE_FUNCTION_TYPE_ISCSI ? "iSCSI" :
86024 + (function_type == BE_FUNCTION_TYPE_NETWORK ? "Network" :
86025 + "Arm")), pfob);
86026 +
86027 + memset(pfob, 0, sizeof(*pfob));
86028 +
86029 + pfob->type = function_type;
86030 + pfob->csr_va = csr_va;
86031 + pfob->db_va = db_va;
86032 + pfob->pci_va = pci_va;
86033 +
86034 + spin_lock_init(&pfob->cq_lock);
86035 + spin_lock_init(&pfob->post_lock);
86036 + spin_lock_init(&pfob->mcc_context_lock);
86037 +
86038 +
86039 + pfob->pci_function_number = 1;
86040 +
86041 +
86042 + pfob->emulate = false;
86043 + TRACE(DL_NOTE, "Non-emulation mode");
86044 + status = be_drive_POST(pfob);
86045 + if (status != BE_SUCCESS) {
86046 + TRACE(DL_ERR, "BladeEngine POST failed.");
86047 + goto error;
86048 + }
86049 +
86050 + /* Initialize the mailbox */
86051 + status = be_mpu_init_mailbox(pfob, mailbox);
86052 + if (status != BE_SUCCESS) {
86053 + TRACE(DL_ERR, "Failed to initialize mailbox.");
86054 + goto error;
86055 + }
86056 + /*
86057 + * Cache the firmware config for ASSERTs in hwclib and later
86058 + * driver queries.
86059 + */
86060 + status = be_function_internal_query_firmware_config(pfob,
86061 + &pfob->fw_config);
86062 + if (status != BE_SUCCESS) {
86063 + TRACE(DL_ERR, "Failed to query firmware config.");
86064 + goto error;
86065 + }
86066 +
86067 +error:
86068 + if (status != BE_SUCCESS) {
86069 + /* No cleanup necessary */
86070 + TRACE(DL_ERR, "Failed to create function.");
86071 + memset(pfob, 0, sizeof(*pfob));
86072 + }
86073 + return status;
86074 +}
86075 +
86076 +/*
86077 + This routine drops the reference count on a given function object. Once
86078 + the reference count falls to zero, the function object is destroyed and all
86079 + resources held are freed.
86080 +
86081 + FunctionObject - The function object to drop the reference to.
86082 +*/
86083 +int be_function_object_destroy(struct be_function_object *pfob)
86084 +{
86085 + TRACE(DL_INFO, "Destroy pfob. Object:0x%p",
86086 + pfob);
86087 +
86088 +
86089 + ASSERT(pfob->mcc == NULL);
86090 +
86091 + return BE_SUCCESS;
86092 +}
86093 +
86094 +int be_function_cleanup(struct be_function_object *pfob)
86095 +{
86096 + int status = 0;
86097 + u32 isr;
86098 + u32 host_intr;
86099 + struct PCICFG_HOST_TIMER_INT_CTRL_CSR_AMAP ctrl;
86100 +
86101 +
86102 + if (pfob->type == BE_FUNCTION_TYPE_NETWORK) {
86103 + status = be_rxf_multicast_config(pfob, false, 0,
86104 + NULL, NULL, NULL, NULL);
86105 + ASSERT(status == BE_SUCCESS);
86106 + }
86107 + /* VLAN */
86108 + status = be_rxf_vlan_config(pfob, false, 0, NULL, NULL, NULL, NULL);
86109 + ASSERT(status == BE_SUCCESS);
86110 + /*
86111 + * MCC Queue -- Switches to mailbox mode. May want to destroy
86112 + * all but the MCC CQ before this call if polling CQ is much better
86113 + * performance than polling mailbox register.
86114 + */
86115 + if (pfob->mcc)
86116 + status = be_mcc_ring_destroy(pfob->mcc);
86117 + /*
86118 + * If interrupts are disabled, clear any CEV interrupt assertions that
86119 + * fired after we stopped processing EQs.
86120 + */
86121 + ctrl.dw[0] = PCICFG1_READ(pfob, host_timer_int_ctrl);
86122 + host_intr = AMAP_GET_BITS_PTR(PCICFG_HOST_TIMER_INT_CTRL_CSR,
86123 + hostintr, ctrl.dw);
86124 + if (!host_intr)
86125 + if (pfob->type == BE_FUNCTION_TYPE_NETWORK)
86126 + isr = CSR_READ(pfob, cev.isr1);
86127 + else
86128 + isr = CSR_READ(pfob, cev.isr0);
86129 + else
86130 + /* This should never happen... */
86131 + TRACE(DL_ERR, "function_cleanup called with interrupt enabled");
86132 + /* Function object destroy */
86133 + status = be_function_object_destroy(pfob);
86134 + ASSERT(status == BE_SUCCESS);
86135 +
86136 + return status;
86137 +}
86138 +
86139 +
86140 +void *
86141 +be_function_prepare_embedded_fwcmd(struct be_function_object *pfob,
86142 + struct MCC_WRB_AMAP *wrb, u32 payld_len, u32 request_length,
86143 + u32 response_length, u32 opcode, u32 subsystem)
86144 +{
86145 + struct FWCMD_REQUEST_HEADER *header = NULL;
86146 + u32 n;
86147 +
86148 + ASSERT(wrb);
86149 +
86150 + n = offsetof(struct BE_MCC_WRB_AMAP, payload)/8;
86151 + AMAP_SET_BITS_PTR(MCC_WRB, embedded, wrb, 1);
86152 + AMAP_SET_BITS_PTR(MCC_WRB, payload_length, wrb, min(payld_len, n));
86153 + header = (struct FWCMD_REQUEST_HEADER *)((u8 *)wrb + n);
86154 +
86155 + header->timeout = 0;
86156 + header->domain = 0;
86157 + header->request_length = max(request_length, response_length);
86158 + header->opcode = opcode;
86159 + header->subsystem = subsystem;
86160 +
86161 + return header;
86162 +}
86163 +
86164 +void *
86165 +be_function_prepare_nonembedded_fwcmd(struct be_function_object *pfob,
86166 + struct MCC_WRB_AMAP *wrb,
86167 + void *fwcmd_va, u64 fwcmd_pa,
86168 + u32 payld_len,
86169 + u32 request_length,
86170 + u32 response_length,
86171 + u32 opcode, u32 subsystem)
86172 +{
86173 + struct FWCMD_REQUEST_HEADER *header = NULL;
86174 + u32 n;
86175 + struct MCC_WRB_PAYLOAD_AMAP *plp;
86176 +
86177 + ASSERT(wrb);
86178 + ASSERT(fwcmd_va);
86179 +
86180 + header = (struct FWCMD_REQUEST_HEADER *) fwcmd_va;
86181 +
86182 + AMAP_SET_BITS_PTR(MCC_WRB, embedded, wrb, 0);
86183 + AMAP_SET_BITS_PTR(MCC_WRB, payload_length, wrb, payld_len);
86184 +
86185 + /*
86186 + * Assume one fragment. The caller may override the SGL by
86187 + * rewriting the 0th length and adding more entries. They
86188 + * will also need to update the sge_count.
86189 + */
86190 + AMAP_SET_BITS_PTR(MCC_WRB, sge_count, wrb, 1);
86191 +
86192 + n = offsetof(struct BE_MCC_WRB_AMAP, payload)/8;
86193 + plp = (struct MCC_WRB_PAYLOAD_AMAP *)((u8 *)wrb + n);
86194 + AMAP_SET_BITS_PTR(MCC_WRB_PAYLOAD, sgl[0].length, plp, payld_len);
86195 + AMAP_SET_BITS_PTR(MCC_WRB_PAYLOAD, sgl[0].pa_lo, plp, (u32)fwcmd_pa);
86196 + AMAP_SET_BITS_PTR(MCC_WRB_PAYLOAD, sgl[0].pa_hi, plp,
86197 + upper_32_bits(fwcmd_pa));
86198 +
86199 + header->timeout = 0;
86200 + header->domain = 0;
86201 + header->request_length = max(request_length, response_length);
86202 + header->opcode = opcode;
86203 + header->subsystem = subsystem;
86204 +
86205 + return header;
86206 +}
86207 +
86208 +struct MCC_WRB_AMAP *
86209 +be_function_peek_mcc_wrb(struct be_function_object *pfob)
86210 +{
86211 + struct MCC_WRB_AMAP *wrb = NULL;
86212 + u32 offset;
86213 +
86214 + if (pfob->mcc)
86215 + wrb = _be_mpu_peek_ring_wrb(pfob->mcc, false);
86216 + else {
86217 + offset = offsetof(struct BE_MCC_MAILBOX_AMAP, wrb)/8;
86218 + wrb = (struct MCC_WRB_AMAP *) ((u8 *) pfob->mailbox.va +
86219 + offset);
86220 + }
86221 +
86222 + if (wrb)
86223 + memset(wrb, 0, sizeof(struct MCC_WRB_AMAP));
86224 +
86225 + return wrb;
86226 +}
86227 +
86228 +#if defined(BE_DEBUG)
86229 +void be_function_debug_print_wrb(struct be_function_object *pfob,
86230 + struct MCC_WRB_AMAP *wrb, void *optional_fwcmd_va,
86231 + struct be_mcc_wrb_context *wrb_context)
86232 +{
86233 +
86234 + struct FWCMD_REQUEST_HEADER *header = NULL;
86235 + u8 embedded;
86236 + u32 n;
86237 +
86238 + embedded = AMAP_GET_BITS_PTR(MCC_WRB, embedded, wrb);
86239 +
86240 + if (embedded) {
86241 + n = offsetof(struct BE_MCC_WRB_AMAP, payload)/8;
86242 + header = (struct FWCMD_REQUEST_HEADER *)((u8 *)wrb + n);
86243 + } else {
86244 + header = (struct FWCMD_REQUEST_HEADER *) optional_fwcmd_va;
86245 + }
86246 +
86247 + /* Save the completed count before posting for a debug assert. */
86248 +
86249 + if (header) {
86250 + wrb_context->opcode = header->opcode;
86251 + wrb_context->subsystem = header->subsystem;
86252 +
86253 + } else {
86254 + wrb_context->opcode = 0;
86255 + wrb_context->subsystem = 0;
86256 + }
86257 +}
86258 +#else
86259 +#define be_function_debug_print_wrb(a_, b_, c_, d_)
86260 +#endif
86261 +
86262 +int
86263 +be_function_post_mcc_wrb(struct be_function_object *pfob,
86264 + struct MCC_WRB_AMAP *wrb,
86265 + struct be_generic_q_ctxt *q_ctxt,
86266 + mcc_wrb_cqe_callback cb, void *cb_context,
86267 + mcc_wrb_cqe_callback internal_cb,
86268 + void *internal_cb_context, void *optional_fwcmd_va,
86269 + struct be_mcc_wrb_response_copy *rc)
86270 +{
86271 + int status;
86272 + struct be_mcc_wrb_context *wrb_context = NULL;
86273 + u64 *p;
86274 +
86275 + if (q_ctxt) {
86276 + /* Initialize context. */
86277 + q_ctxt->context.internal_cb = internal_cb;
86278 + q_ctxt->context.internal_cb_context = internal_cb_context;
86279 + q_ctxt->context.cb = cb;
86280 + q_ctxt->context.cb_context = cb_context;
86281 + if (rc) {
86282 + q_ctxt->context.copy.length = rc->length;
86283 + q_ctxt->context.copy.fwcmd_offset = rc->fwcmd_offset;
86284 + q_ctxt->context.copy.va = rc->va;
86285 + } else
86286 + q_ctxt->context.copy.length = 0;
86287 +
86288 + q_ctxt->context.optional_fwcmd_va = optional_fwcmd_va;
86289 +
86290 + /* Queue this request */
86291 + status = be_function_queue_mcc_wrb(pfob, q_ctxt);
86292 +
86293 + goto Error;
86294 + }
86295 + /*
86296 + * Allocate a WRB context struct to hold the callback pointers,
86297 + * status, etc. This is required if commands complete out of order.
86298 + */
86299 + wrb_context = _be_mcc_allocate_wrb_context(pfob);
86300 + if (!wrb_context) {
86301 + TRACE(DL_WARN, "Failed to allocate MCC WRB context.");
86302 + status = BE_STATUS_SYSTEM_RESOURCES;
86303 + goto Error;
86304 + }
86305 + /* Initialize context. */
86306 + memset(wrb_context, 0, sizeof(*wrb_context));
86307 + wrb_context->internal_cb = internal_cb;
86308 + wrb_context->internal_cb_context = internal_cb_context;
86309 + wrb_context->cb = cb;
86310 + wrb_context->cb_context = cb_context;
86311 + if (rc) {
86312 + wrb_context->copy.length = rc->length;
86313 + wrb_context->copy.fwcmd_offset = rc->fwcmd_offset;
86314 + wrb_context->copy.va = rc->va;
86315 + } else
86316 + wrb_context->copy.length = 0;
86317 + wrb_context->wrb = wrb;
86318 +
86319 + /*
86320 + * Copy the context pointer into the WRB opaque tag field.
86321 + * Verify assumption of 64-bit tag with a compile time assert.
86322 + */
86323 + p = (u64 *) ((u8 *)wrb + offsetof(struct BE_MCC_WRB_AMAP, tag)/8);
86324 + *p = (u64)(size_t)wrb_context;
86325 +
86326 + /* Print info about this FWCMD for debug builds. */
86327 + be_function_debug_print_wrb(pfob, wrb, optional_fwcmd_va, wrb_context);
86328 +
86329 + /*
86330 + * issue the WRB to the MPU as appropriate
86331 + */
86332 + if (pfob->mcc) {
86333 + /*
86334 + * we're in WRB mode, pass to the mcc layer
86335 + */
86336 + status = _be_mpu_post_wrb_ring(pfob->mcc, wrb, wrb_context);
86337 + } else {
86338 + /*
86339 + * we're in mailbox mode
86340 + */
86341 + status = _be_mpu_post_wrb_mailbox(pfob, wrb, wrb_context);
86342 +
86343 + /* mailbox mode always completes synchronously */
86344 + ASSERT(status != BE_STATUS_PENDING);
86345 + }
86346 +
86347 +Error:
86348 +
86349 + return status;
86350 +}
86351 +
86352 +int
86353 +be_function_ring_destroy(struct be_function_object *pfob,
86354 + u32 id, u32 ring_type, mcc_wrb_cqe_callback cb,
86355 + void *cb_context, mcc_wrb_cqe_callback internal_cb,
86356 + void *internal_cb_context)
86357 +{
86358 +
86359 + struct FWCMD_COMMON_RING_DESTROY *fwcmd = NULL;
86360 + struct MCC_WRB_AMAP *wrb = NULL;
86361 + int status = 0;
86362 + unsigned long irql;
86363 +
86364 + spin_lock_irqsave(&pfob->post_lock, irql);
86365 +
86366 + TRACE(DL_INFO, "Destroy ring id:%d type:%d", id, ring_type);
86367 +
86368 + wrb = be_function_peek_mcc_wrb(pfob);
86369 + if (!wrb) {
86370 + ASSERT(wrb);
86371 + TRACE(DL_ERR, "No free MCC WRBs in destroy ring.");
86372 + status = BE_STATUS_NO_MCC_WRB;
86373 + goto Error;
86374 + }
86375 + /* Prepares an embedded fwcmd, including request/response sizes. */
86376 + fwcmd = BE_PREPARE_EMBEDDED_FWCMD(pfob, wrb, COMMON_RING_DESTROY);
86377 +
86378 + fwcmd->params.request.id = id;
86379 + fwcmd->params.request.ring_type = ring_type;
86380 +
86381 + /* Post the f/w command */
86382 + status = be_function_post_mcc_wrb(pfob, wrb, NULL, cb, cb_context,
86383 + internal_cb, internal_cb_context, fwcmd, NULL);
86384 + if (status != BE_SUCCESS && status != BE_PENDING) {
86385 + TRACE(DL_ERR, "Ring destroy fwcmd failed. id:%d ring_type:%d",
86386 + id, ring_type);
86387 + goto Error;
86388 + }
86389 +
86390 +Error:
86391 + spin_unlock_irqrestore(&pfob->post_lock, irql);
86392 + if (pfob->pend_queue_driving && pfob->mcc) {
86393 + pfob->pend_queue_driving = 0;
86394 + be_drive_mcc_wrb_queue(pfob->mcc);
86395 + }
86396 + return status;
86397 +}
86398 +
86399 +void
86400 +be_rd_to_pa_list(struct ring_desc *rd, struct PHYS_ADDR *pa_list, u32 max_num)
86401 +{
86402 + u32 num_pages = PAGES_SPANNED(rd->va, rd->length);
86403 + u32 i = 0;
86404 + u64 pa = rd->pa;
86405 + __le64 lepa;
86406 +
86407 + ASSERT(pa_list);
86408 + ASSERT(pa);
86409 +
86410 + for (i = 0; i < min(num_pages, max_num); i++) {
86411 + lepa = cpu_to_le64(pa);
86412 + pa_list[i].lo = (u32)lepa;
86413 + pa_list[i].hi = upper_32_bits(lepa);
86414 + pa += PAGE_SIZE;
86415 + }
86416 +}
86417 +
86418 +
86419 +
86420 +/*-----------------------------------------------------------------------------
86421 + * Function: be_function_get_fw_version
86422 + * Retrieves the firmware version on the adpater. If the callback is
86423 + * NULL this call executes synchronously. If the callback is not NULL,
86424 + * the returned status will be BE_PENDING if the command was issued
86425 + * successfully.
86426 + * pfob -
86427 + * fwv - Pointer to response buffer if callback is NULL.
86428 + * cb - Callback function invoked when the FWCMD completes.
86429 + * cb_context - Passed to the callback function.
86430 + * return pend_status - BE_SUCCESS (0) on success.
86431 + * BE_PENDING (postive value) if the FWCMD
86432 + * completion is pending. Negative error code on failure.
86433 + *---------------------------------------------------------------------------
86434 + */
86435 +int
86436 +be_function_get_fw_version(struct be_function_object *pfob,
86437 + struct FWCMD_COMMON_GET_FW_VERSION_RESPONSE_PAYLOAD *fwv,
86438 + mcc_wrb_cqe_callback cb, void *cb_context)
86439 +{
86440 + int status = BE_SUCCESS;
86441 + struct MCC_WRB_AMAP *wrb = NULL;
86442 + struct FWCMD_COMMON_GET_FW_VERSION *fwcmd = NULL;
86443 + unsigned long irql;
86444 + struct be_mcc_wrb_response_copy rc;
86445 +
86446 + spin_lock_irqsave(&pfob->post_lock, irql);
86447 +
86448 + wrb = be_function_peek_mcc_wrb(pfob);
86449 + if (!wrb) {
86450 + TRACE(DL_ERR, "MCC wrb peek failed.");
86451 + status = BE_STATUS_NO_MCC_WRB;
86452 + goto Error;
86453 + }
86454 +
86455 + if (!cb && !fwv) {
86456 + TRACE(DL_ERR, "callback and response buffer NULL!");
86457 + status = BE_NOT_OK;
86458 + goto Error;
86459 + }
86460 + /* Prepares an embedded fwcmd, including request/response sizes. */
86461 + fwcmd = BE_PREPARE_EMBEDDED_FWCMD(pfob, wrb, COMMON_GET_FW_VERSION);
86462 +
86463 + rc.length = FIELD_SIZEOF(struct FWCMD_COMMON_GET_FW_VERSION,
86464 + params.response);
86465 + rc.fwcmd_offset = offsetof(struct FWCMD_COMMON_GET_FW_VERSION,
86466 + params.response);
86467 + rc.va = fwv;
86468 +
86469 + /* Post the f/w command */
86470 + status = be_function_post_mcc_wrb(pfob, wrb, NULL, cb,
86471 + cb_context, NULL, NULL, fwcmd, &rc);
86472 +
86473 +Error:
86474 + spin_unlock_irqrestore(&pfob->post_lock, irql);
86475 + if (pfob->pend_queue_driving && pfob->mcc) {
86476 + pfob->pend_queue_driving = 0;
86477 + be_drive_mcc_wrb_queue(pfob->mcc);
86478 + }
86479 + return status;
86480 +}
86481 +
86482 +int
86483 +be_function_queue_mcc_wrb(struct be_function_object *pfob,
86484 + struct be_generic_q_ctxt *q_ctxt)
86485 +{
86486 + int status;
86487 +
86488 + ASSERT(q_ctxt);
86489 +
86490 + /*
86491 + * issue the WRB to the MPU as appropriate
86492 + */
86493 + if (pfob->mcc) {
86494 +
86495 + /* We're in ring mode. Queue this item. */
86496 + pfob->mcc->backlog_length++;
86497 + list_add_tail(&q_ctxt->context.list, &pfob->mcc->backlog);
86498 + status = BE_PENDING;
86499 + } else {
86500 + status = BE_NOT_OK;
86501 + }
86502 + return status;
86503 +}
86504 +
86505 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/fwcmd_common_bmap.h linux-2.6.29-rc3.owrt/drivers/staging/benet/fwcmd_common_bmap.h
86506 --- linux-2.6.29.owrt/drivers/staging/benet/fwcmd_common_bmap.h 1970-01-01 01:00:00.000000000 +0100
86507 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/fwcmd_common_bmap.h 2009-05-10 23:48:29.000000000 +0200
86508 @@ -0,0 +1,717 @@
86509 +/*
86510 + * Copyright (C) 2005 - 2008 ServerEngines
86511 + * All rights reserved.
86512 + *
86513 + * This program is free software; you can redistribute it and/or
86514 + * modify it under the terms of the GNU General Public License version 2
86515 + * as published by the Free Software Foundation. The full GNU General
86516 + * Public License is included in this distribution in the file called COPYING.
86517 + *
86518 + * Contact Information:
86519 + * linux-drivers@serverengines.com
86520 + *
86521 + * ServerEngines
86522 + * 209 N. Fair Oaks Ave
86523 + * Sunnyvale, CA 94085
86524 + */
86525 +/*
86526 + * Autogenerated by srcgen version: 0127
86527 + */
86528 +#ifndef __fwcmd_common_bmap_h__
86529 +#define __fwcmd_common_bmap_h__
86530 +#include "fwcmd_types_bmap.h"
86531 +#include "fwcmd_hdr_bmap.h"
86532 +
86533 +#if defined(__BIG_ENDIAN)
86534 + /* Physical Address. */
86535 +struct PHYS_ADDR {
86536 + union {
86537 + struct {
86538 + u32 lo; /* DWORD 0 */
86539 + u32 hi; /* DWORD 1 */
86540 + } __packed; /* unnamed struct */
86541 + u32 dw[2]; /* dword union */
86542 + }; /* unnamed union */
86543 +} __packed ;
86544 +
86545 +
86546 +#else
86547 + /* Physical Address. */
86548 +struct PHYS_ADDR {
86549 + union {
86550 + struct {
86551 + u32 lo; /* DWORD 0 */
86552 + u32 hi; /* DWORD 1 */
86553 + } __packed; /* unnamed struct */
86554 + u32 dw[2]; /* dword union */
86555 + }; /* unnamed union */
86556 +} __packed ;
86557 +
86558 +struct BE_LINK_STATUS {
86559 + u8 mac0_duplex;
86560 + u8 mac0_speed;
86561 + u8 mac1_duplex;
86562 + u8 mac1_speed;
86563 + u8 mgmt_mac_duplex;
86564 + u8 mgmt_mac_speed;
86565 + u8 active_port;
86566 + u8 rsvd0;
86567 + u8 mac0_fault;
86568 + u8 mac1_fault;
86569 + u16 rsvd1;
86570 +} __packed;
86571 +#endif
86572 +
86573 +struct FWCMD_COMMON_ANON_170_REQUEST {
86574 + u32 rsvd0;
86575 +} __packed;
86576 +
86577 +union LINK_STATUS_QUERY_PARAMS {
86578 + struct BE_LINK_STATUS response;
86579 + struct FWCMD_COMMON_ANON_170_REQUEST request;
86580 +} __packed;
86581 +
86582 +/*
86583 + * Queries the the link status for all ports. The valid values below
86584 + * DO NOT indicate that a particular duplex or speed is supported by
86585 + * BladeEngine. These enumerations simply list all possible duplexes
86586 + * and speeds for any port. Consult BladeEngine product documentation
86587 + * for the supported parameters.
86588 + */
86589 +struct FWCMD_COMMON_NTWK_LINK_STATUS_QUERY {
86590 + union FWCMD_HEADER header;
86591 + union LINK_STATUS_QUERY_PARAMS params;
86592 +} __packed;
86593 +
86594 +struct FWCMD_COMMON_ANON_171_REQUEST {
86595 + u8 type;
86596 + u8 port;
86597 + u8 mac1;
86598 + u8 permanent;
86599 +} __packed;
86600 +
86601 +struct FWCMD_COMMON_ANON_172_RESPONSE {
86602 + struct MAC_ADDRESS_FORMAT mac;
86603 +} __packed;
86604 +
86605 +union NTWK_MAC_QUERY_PARAMS {
86606 + struct FWCMD_COMMON_ANON_171_REQUEST request;
86607 + struct FWCMD_COMMON_ANON_172_RESPONSE response;
86608 +} __packed;
86609 +
86610 +/* Queries one MAC address. */
86611 +struct FWCMD_COMMON_NTWK_MAC_QUERY {
86612 + union FWCMD_HEADER header;
86613 + union NTWK_MAC_QUERY_PARAMS params;
86614 +} __packed;
86615 +
86616 +struct MAC_SET_PARAMS_IN {
86617 + u8 type;
86618 + u8 port;
86619 + u8 mac1;
86620 + u8 invalidate;
86621 + struct MAC_ADDRESS_FORMAT mac;
86622 +} __packed;
86623 +
86624 +struct MAC_SET_PARAMS_OUT {
86625 + u32 rsvd0;
86626 +} __packed;
86627 +
86628 +union MAC_SET_PARAMS {
86629 + struct MAC_SET_PARAMS_IN request;
86630 + struct MAC_SET_PARAMS_OUT response;
86631 +} __packed;
86632 +
86633 +/* Sets a MAC address. */
86634 +struct FWCMD_COMMON_NTWK_MAC_SET {
86635 + union FWCMD_HEADER header;
86636 + union MAC_SET_PARAMS params;
86637 +} __packed;
86638 +
86639 +/* MAC address list. */
86640 +struct NTWK_MULTICAST_MAC_LIST {
86641 + u8 byte[6];
86642 +} __packed;
86643 +
86644 +struct FWCMD_COMMON_NTWK_MULTICAST_SET_REQUEST_PAYLOAD {
86645 + u16 num_mac;
86646 + u8 promiscuous;
86647 + u8 rsvd0;
86648 + struct NTWK_MULTICAST_MAC_LIST mac[32];
86649 +} __packed;
86650 +
86651 +struct FWCMD_COMMON_ANON_174_RESPONSE {
86652 + u32 rsvd0;
86653 +} __packed;
86654 +
86655 +union FWCMD_COMMON_ANON_173_PARAMS {
86656 + struct FWCMD_COMMON_NTWK_MULTICAST_SET_REQUEST_PAYLOAD request;
86657 + struct FWCMD_COMMON_ANON_174_RESPONSE response;
86658 +} __packed;
86659 +
86660 +/*
86661 + * Sets multicast address hash. The MPU will merge the MAC address lists
86662 + * from all clients, including the networking and storage functions.
86663 + * This command may fail if the final merged list of MAC addresses exceeds
86664 + * 32 entries.
86665 + */
86666 +struct FWCMD_COMMON_NTWK_MULTICAST_SET {
86667 + union FWCMD_HEADER header;
86668 + union FWCMD_COMMON_ANON_173_PARAMS params;
86669 +} __packed;
86670 +
86671 +struct FWCMD_COMMON_NTWK_VLAN_CONFIG_REQUEST_PAYLOAD {
86672 + u16 num_vlan;
86673 + u8 promiscuous;
86674 + u8 rsvd0;
86675 + u16 vlan_tag[32];
86676 +} __packed;
86677 +
86678 +struct FWCMD_COMMON_ANON_176_RESPONSE {
86679 + u32 rsvd0;
86680 +} __packed;
86681 +
86682 +union FWCMD_COMMON_ANON_175_PARAMS {
86683 + struct FWCMD_COMMON_NTWK_VLAN_CONFIG_REQUEST_PAYLOAD request;
86684 + struct FWCMD_COMMON_ANON_176_RESPONSE response;
86685 +} __packed;
86686 +
86687 +/*
86688 + * Sets VLAN tag filter. The MPU will merge the VLAN tag list from all
86689 + * clients, including the networking and storage functions. This command
86690 + * may fail if the final vlan_tag array (from all functions) is longer
86691 + * than 32 entries.
86692 + */
86693 +struct FWCMD_COMMON_NTWK_VLAN_CONFIG {
86694 + union FWCMD_HEADER header;
86695 + union FWCMD_COMMON_ANON_175_PARAMS params;
86696 +} __packed;
86697 +
86698 +struct RING_DESTROY_REQUEST {
86699 + u16 ring_type;
86700 + u16 id;
86701 + u8 bypass_flush;
86702 + u8 rsvd0;
86703 + u16 rsvd1;
86704 +} __packed;
86705 +
86706 +struct FWCMD_COMMON_ANON_190_RESPONSE {
86707 + u32 rsvd0;
86708 +} __packed;
86709 +
86710 +union FWCMD_COMMON_ANON_189_PARAMS {
86711 + struct RING_DESTROY_REQUEST request;
86712 + struct FWCMD_COMMON_ANON_190_RESPONSE response;
86713 +} __packed;
86714 +/*
86715 + * Command for destroying any ring. The connection(s) using the ring should
86716 + * be quiesced before destroying the ring.
86717 + */
86718 +struct FWCMD_COMMON_RING_DESTROY {
86719 + union FWCMD_HEADER header;
86720 + union FWCMD_COMMON_ANON_189_PARAMS params;
86721 +} __packed;
86722 +
86723 +struct FWCMD_COMMON_ANON_192_REQUEST {
86724 + u16 num_pages;
86725 + u16 rsvd0;
86726 + struct CQ_CONTEXT_AMAP context;
86727 + struct PHYS_ADDR pages[4];
86728 +} __packed ;
86729 +
86730 +struct FWCMD_COMMON_ANON_193_RESPONSE {
86731 + u16 cq_id;
86732 +} __packed ;
86733 +
86734 +union FWCMD_COMMON_ANON_191_PARAMS {
86735 + struct FWCMD_COMMON_ANON_192_REQUEST request;
86736 + struct FWCMD_COMMON_ANON_193_RESPONSE response;
86737 +} __packed ;
86738 +
86739 +/*
86740 + * Command for creating a completion queue. A Completion Queue must span
86741 + * at least 1 page and at most 4 pages. Each completion queue entry
86742 + * is 16 bytes regardless of CQ entry format. Thus the ring must be
86743 + * at least 256 entries deep (corresponding to 1 page) and can be at
86744 + * most 1024 entries deep (corresponding to 4 pages). The number of
86745 + * pages posted must contain the CQ ring size as encoded in the context.
86746 + *
86747 + */
86748 +struct FWCMD_COMMON_CQ_CREATE {
86749 + union FWCMD_HEADER header;
86750 + union FWCMD_COMMON_ANON_191_PARAMS params;
86751 +} __packed ;
86752 +
86753 +struct FWCMD_COMMON_ANON_198_REQUEST {
86754 + u16 num_pages;
86755 + u16 rsvd0;
86756 + struct EQ_CONTEXT_AMAP context;
86757 + struct PHYS_ADDR pages[8];
86758 +} __packed ;
86759 +
86760 +struct FWCMD_COMMON_ANON_199_RESPONSE {
86761 + u16 eq_id;
86762 +} __packed ;
86763 +
86764 +union FWCMD_COMMON_ANON_197_PARAMS {
86765 + struct FWCMD_COMMON_ANON_198_REQUEST request;
86766 + struct FWCMD_COMMON_ANON_199_RESPONSE response;
86767 +} __packed ;
86768 +
86769 +/*
86770 + * Command for creating a event queue. An Event Queue must span at least
86771 + * 1 page and at most 8 pages. The number of pages posted must contain
86772 + * the EQ ring. The ring is defined by the size of the EQ entries (encoded
86773 + * in the context) and the number of EQ entries (also encoded in the
86774 + * context).
86775 + */
86776 +struct FWCMD_COMMON_EQ_CREATE {
86777 + union FWCMD_HEADER header;
86778 + union FWCMD_COMMON_ANON_197_PARAMS params;
86779 +} __packed ;
86780 +
86781 +struct FWCMD_COMMON_ANON_201_REQUEST {
86782 + u16 cq_id;
86783 + u16 bcmc_cq_id;
86784 + u16 num_pages;
86785 + u16 rsvd0;
86786 + struct PHYS_ADDR pages[2];
86787 +} __packed;
86788 +
86789 +struct FWCMD_COMMON_ANON_202_RESPONSE {
86790 + u16 id;
86791 +} __packed;
86792 +
86793 +union FWCMD_COMMON_ANON_200_PARAMS {
86794 + struct FWCMD_COMMON_ANON_201_REQUEST request;
86795 + struct FWCMD_COMMON_ANON_202_RESPONSE response;
86796 +} __packed;
86797 +
86798 +/*
86799 + * Command for creating Ethernet receive ring. An ERX ring contains ETH_RX_D
86800 + * entries (8 bytes each). An ERX ring must be 1024 entries deep
86801 + * (corresponding to 2 pages).
86802 + */
86803 +struct FWCMD_COMMON_ETH_RX_CREATE {
86804 + union FWCMD_HEADER header;
86805 + union FWCMD_COMMON_ANON_200_PARAMS params;
86806 +} __packed;
86807 +
86808 +struct FWCMD_COMMON_ANON_204_REQUEST {
86809 + u16 num_pages;
86810 + u8 ulp_num;
86811 + u8 type;
86812 + struct ETX_CONTEXT_AMAP context;
86813 + struct PHYS_ADDR pages[8];
86814 +} __packed ;
86815 +
86816 +struct FWCMD_COMMON_ANON_205_RESPONSE {
86817 + u16 cid;
86818 + u8 ulp_num;
86819 + u8 rsvd0;
86820 +} __packed ;
86821 +
86822 +union FWCMD_COMMON_ANON_203_PARAMS {
86823 + struct FWCMD_COMMON_ANON_204_REQUEST request;
86824 + struct FWCMD_COMMON_ANON_205_RESPONSE response;
86825 +} __packed ;
86826 +
86827 +/*
86828 + * Command for creating an Ethernet transmit ring. An ETX ring contains
86829 + * ETH_WRB entries (16 bytes each). An ETX ring must be at least 256
86830 + * entries deep (corresponding to 1 page) and at most 2k entries deep
86831 + * (corresponding to 8 pages).
86832 + */
86833 +struct FWCMD_COMMON_ETH_TX_CREATE {
86834 + union FWCMD_HEADER header;
86835 + union FWCMD_COMMON_ANON_203_PARAMS params;
86836 +} __packed ;
86837 +
86838 +struct FWCMD_COMMON_ANON_222_REQUEST {
86839 + u16 num_pages;
86840 + u16 rsvd0;
86841 + struct MCC_RING_CONTEXT_AMAP context;
86842 + struct PHYS_ADDR pages[8];
86843 +} __packed ;
86844 +
86845 +struct FWCMD_COMMON_ANON_223_RESPONSE {
86846 + u16 id;
86847 +} __packed ;
86848 +
86849 +union FWCMD_COMMON_ANON_221_PARAMS {
86850 + struct FWCMD_COMMON_ANON_222_REQUEST request;
86851 + struct FWCMD_COMMON_ANON_223_RESPONSE response;
86852 +} __packed ;
86853 +
86854 +/*
86855 + * Command for creating the MCC ring. An MCC ring must be at least 16
86856 + * entries deep (corresponding to 1 page) and at most 128 entries deep
86857 + * (corresponding to 8 pages).
86858 + */
86859 +struct FWCMD_COMMON_MCC_CREATE {
86860 + union FWCMD_HEADER header;
86861 + union FWCMD_COMMON_ANON_221_PARAMS params;
86862 +} __packed ;
86863 +
86864 +struct GET_QOS_IN {
86865 + u32 qos_params_rsvd;
86866 +} __packed;
86867 +
86868 +struct GET_QOS_OUT {
86869 + u32 max_bits_per_second_NIC;
86870 + u32 max_packets_per_second_NIC;
86871 + u32 max_ios_per_second_iSCSI;
86872 + u32 max_bytes_per_second_iSCSI;
86873 + u16 domain_VLAN_tag;
86874 + u16 fabric_domain_ID;
86875 + u32 qos_params_oem[4];
86876 +} __packed;
86877 +
86878 +union GET_QOS_PARAMS {
86879 + struct GET_QOS_IN request;
86880 + struct GET_QOS_OUT response;
86881 +} __packed;
86882 +
86883 +/* QOS/Bandwidth settings per domain. Applicable only in VMs. */
86884 +struct FWCMD_COMMON_GET_QOS {
86885 + union FWCMD_HEADER header;
86886 + union GET_QOS_PARAMS params;
86887 +} __packed;
86888 +
86889 +struct SET_QOS_IN {
86890 + u32 valid_flags;
86891 + u32 max_bits_per_second_NIC;
86892 + u32 max_packets_per_second_NIC;
86893 + u32 max_ios_per_second_iSCSI;
86894 + u32 max_bytes_per_second_iSCSI;
86895 + u16 domain_VLAN_tag;
86896 + u16 fabric_domain_ID;
86897 + u32 qos_params_oem[4];
86898 +} __packed;
86899 +
86900 +struct SET_QOS_OUT {
86901 + u32 qos_params_rsvd;
86902 +} __packed;
86903 +
86904 +union SET_QOS_PARAMS {
86905 + struct SET_QOS_IN request;
86906 + struct SET_QOS_OUT response;
86907 +} __packed;
86908 +
86909 +/* QOS/Bandwidth settings per domain. Applicable only in VMs. */
86910 +struct FWCMD_COMMON_SET_QOS {
86911 + union FWCMD_HEADER header;
86912 + union SET_QOS_PARAMS params;
86913 +} __packed;
86914 +
86915 +struct SET_FRAME_SIZE_IN {
86916 + u32 max_tx_frame_size;
86917 + u32 max_rx_frame_size;
86918 +} __packed;
86919 +
86920 +struct SET_FRAME_SIZE_OUT {
86921 + u32 chip_max_tx_frame_size;
86922 + u32 chip_max_rx_frame_size;
86923 +} __packed;
86924 +
86925 +union SET_FRAME_SIZE_PARAMS {
86926 + struct SET_FRAME_SIZE_IN request;
86927 + struct SET_FRAME_SIZE_OUT response;
86928 +} __packed;
86929 +
86930 +/* Set frame size command. Only host domain may issue this command. */
86931 +struct FWCMD_COMMON_SET_FRAME_SIZE {
86932 + union FWCMD_HEADER header;
86933 + union SET_FRAME_SIZE_PARAMS params;
86934 +} __packed;
86935 +
86936 +struct FORCE_FAILOVER_IN {
86937 + u32 move_to_port;
86938 + u32 failover_config;
86939 +} __packed;
86940 +
86941 +struct FWCMD_COMMON_ANON_231_RESPONSE {
86942 + u32 rsvd0;
86943 +} __packed;
86944 +
86945 +union FWCMD_COMMON_ANON_230_PARAMS {
86946 + struct FORCE_FAILOVER_IN request;
86947 + struct FWCMD_COMMON_ANON_231_RESPONSE response;
86948 +} __packed;
86949 +
86950 +/*
86951 + * Use this command to control failover in BladeEngine. It may be used
86952 + * to failback to a restored port or to forcibly move traffic from
86953 + * one port to another. It may also be used to enable or disable the
86954 + * automatic failover feature. This command can only be issued by domain
86955 + * 0.
86956 + */
86957 +struct FWCMD_COMMON_FORCE_FAILOVER {
86958 + union FWCMD_HEADER header;
86959 + union FWCMD_COMMON_ANON_230_PARAMS params;
86960 +} __packed;
86961 +
86962 +struct FWCMD_COMMON_ANON_240_REQUEST {
86963 + u64 context;
86964 +} __packed;
86965 +
86966 +struct FWCMD_COMMON_ANON_241_RESPONSE {
86967 + u64 context;
86968 +} __packed;
86969 +
86970 +union FWCMD_COMMON_ANON_239_PARAMS {
86971 + struct FWCMD_COMMON_ANON_240_REQUEST request;
86972 + struct FWCMD_COMMON_ANON_241_RESPONSE response;
86973 +} __packed;
86974 +
86975 +/*
86976 + * This command can be used by clients as a no-operation request. Typical
86977 + * uses for drivers are as a heartbeat mechanism, or deferred processing
86978 + * catalyst. The ARM will always complete this command with a good completion.
86979 + * The 64-bit parameter is not touched by the ARM processor.
86980 + */
86981 +struct FWCMD_COMMON_NOP {
86982 + union FWCMD_HEADER header;
86983 + union FWCMD_COMMON_ANON_239_PARAMS params;
86984 +} __packed;
86985 +
86986 +struct NTWK_RX_FILTER_SETTINGS {
86987 + u8 promiscuous;
86988 + u8 ip_cksum;
86989 + u8 tcp_cksum;
86990 + u8 udp_cksum;
86991 + u8 pass_err;
86992 + u8 pass_ckerr;
86993 + u8 strip_crc;
86994 + u8 mcast_en;
86995 + u8 bcast_en;
86996 + u8 mcast_promiscuous_en;
86997 + u8 unicast_en;
86998 + u8 vlan_promiscuous;
86999 +} __packed;
87000 +
87001 +union FWCMD_COMMON_ANON_242_PARAMS {
87002 + struct NTWK_RX_FILTER_SETTINGS request;
87003 + struct NTWK_RX_FILTER_SETTINGS response;
87004 +} __packed;
87005 +
87006 +/*
87007 + * This command is used to modify the ethernet receive filter configuration.
87008 + * Only domain 0 network function drivers may issue this command. The
87009 + * applied configuration is returned in the response payload. Note:
87010 + * Some receive packet filter settings are global on BladeEngine and
87011 + * can affect both the storage and network function clients that the
87012 + * BladeEngine hardware and firmware serve. Additionaly, depending
87013 + * on the revision of BladeEngine, some ethernet receive filter settings
87014 + * are dependent on others. If a dependency exists between settings
87015 + * for the BladeEngine revision, and the command request settings do
87016 + * not meet the dependency requirement, the invalid settings will not
87017 + * be applied despite the comand succeeding. For example: a driver may
87018 + * request to enable broadcast packets, but not enable multicast packets.
87019 + * On early revisions of BladeEngine, there may be no distinction between
87020 + * broadcast and multicast filters, so broadcast could not be enabled
87021 + * without enabling multicast. In this scenario, the comand would still
87022 + * succeed, but the response payload would indicate the previously
87023 + * configured broadcast and multicast setting.
87024 + */
87025 +struct FWCMD_COMMON_NTWK_RX_FILTER {
87026 + union FWCMD_HEADER header;
87027 + union FWCMD_COMMON_ANON_242_PARAMS params;
87028 +} __packed;
87029 +
87030 +
87031 +struct FWCMD_COMMON_ANON_244_REQUEST {
87032 + u32 rsvd0;
87033 +} __packed;
87034 +
87035 +struct FWCMD_COMMON_GET_FW_VERSION_RESPONSE_PAYLOAD {
87036 + u8 firmware_version_string[32];
87037 + u8 fw_on_flash_version_string[32];
87038 +} __packed;
87039 +
87040 +union FWCMD_COMMON_ANON_243_PARAMS {
87041 + struct FWCMD_COMMON_ANON_244_REQUEST request;
87042 + struct FWCMD_COMMON_GET_FW_VERSION_RESPONSE_PAYLOAD response;
87043 +} __packed;
87044 +
87045 +/* This comand retrieves the firmware version. */
87046 +struct FWCMD_COMMON_GET_FW_VERSION {
87047 + union FWCMD_HEADER header;
87048 + union FWCMD_COMMON_ANON_243_PARAMS params;
87049 +} __packed;
87050 +
87051 +struct FWCMD_COMMON_ANON_246_REQUEST {
87052 + u16 tx_flow_control;
87053 + u16 rx_flow_control;
87054 +} __packed;
87055 +
87056 +struct FWCMD_COMMON_ANON_247_RESPONSE {
87057 + u32 rsvd0;
87058 +} __packed;
87059 +
87060 +union FWCMD_COMMON_ANON_245_PARAMS {
87061 + struct FWCMD_COMMON_ANON_246_REQUEST request;
87062 + struct FWCMD_COMMON_ANON_247_RESPONSE response;
87063 +} __packed;
87064 +
87065 +/*
87066 + * This comand is used to program BladeEngine flow control behavior.
87067 + * Only the host networking driver is allowed to use this comand.
87068 + */
87069 +struct FWCMD_COMMON_SET_FLOW_CONTROL {
87070 + union FWCMD_HEADER header;
87071 + union FWCMD_COMMON_ANON_245_PARAMS params;
87072 +} __packed;
87073 +
87074 +struct FWCMD_COMMON_ANON_249_REQUEST {
87075 + u32 rsvd0;
87076 +} __packed;
87077 +
87078 +struct FWCMD_COMMON_ANON_250_RESPONSE {
87079 + u16 tx_flow_control;
87080 + u16 rx_flow_control;
87081 +} __packed;
87082 +
87083 +union FWCMD_COMMON_ANON_248_PARAMS {
87084 + struct FWCMD_COMMON_ANON_249_REQUEST request;
87085 + struct FWCMD_COMMON_ANON_250_RESPONSE response;
87086 +} __packed;
87087 +
87088 +/* This comand is used to read BladeEngine flow control settings. */
87089 +struct FWCMD_COMMON_GET_FLOW_CONTROL {
87090 + union FWCMD_HEADER header;
87091 + union FWCMD_COMMON_ANON_248_PARAMS params;
87092 +} __packed;
87093 +
87094 +struct EQ_DELAY_PARAMS {
87095 + u32 eq_id;
87096 + u32 delay_in_microseconds;
87097 +} __packed;
87098 +
87099 +struct FWCMD_COMMON_ANON_257_REQUEST {
87100 + u32 num_eq;
87101 + u32 rsvd0;
87102 + struct EQ_DELAY_PARAMS delay[16];
87103 +} __packed;
87104 +
87105 +struct FWCMD_COMMON_ANON_258_RESPONSE {
87106 + u32 delay_resolution_in_microseconds;
87107 + u32 delay_max_in_microseconds;
87108 +} __packed;
87109 +
87110 +union MODIFY_EQ_DELAY_PARAMS {
87111 + struct FWCMD_COMMON_ANON_257_REQUEST request;
87112 + struct FWCMD_COMMON_ANON_258_RESPONSE response;
87113 +} __packed;
87114 +
87115 +/* This comand changes the EQ delay for a given set of EQs. */
87116 +struct FWCMD_COMMON_MODIFY_EQ_DELAY {
87117 + union FWCMD_HEADER header;
87118 + union MODIFY_EQ_DELAY_PARAMS params;
87119 +} __packed;
87120 +
87121 +struct FWCMD_COMMON_ANON_260_REQUEST {
87122 + u32 rsvd0;
87123 +} __packed;
87124 +
87125 +struct BE_FIRMWARE_CONFIG {
87126 + u16 be_config_number;
87127 + u16 asic_revision;
87128 + u32 nic_ulp_mask;
87129 + u32 tulp_mask;
87130 + u32 iscsi_ulp_mask;
87131 + u32 rdma_ulp_mask;
87132 + u32 rsvd0[4];
87133 + u32 eth_tx_id_start;
87134 + u32 eth_tx_id_count;
87135 + u32 eth_rx_id_start;
87136 + u32 eth_rx_id_count;
87137 + u32 tpm_wrbq_id_start;
87138 + u32 tpm_wrbq_id_count;
87139 + u32 tpm_defq_id_start;
87140 + u32 tpm_defq_id_count;
87141 + u32 iscsi_wrbq_id_start;
87142 + u32 iscsi_wrbq_id_count;
87143 + u32 iscsi_defq_id_start;
87144 + u32 iscsi_defq_id_count;
87145 + u32 rdma_qp_id_start;
87146 + u32 rdma_qp_id_count;
87147 + u32 rsvd1[8];
87148 +} __packed;
87149 +
87150 +union FWCMD_COMMON_ANON_259_PARAMS {
87151 + struct FWCMD_COMMON_ANON_260_REQUEST request;
87152 + struct BE_FIRMWARE_CONFIG response;
87153 +} __packed;
87154 +
87155 +/*
87156 + * This comand queries the current firmware configuration parameters.
87157 + * The static configuration type is defined by be_config_number. This
87158 + * differentiates different BladeEngine builds, such as iSCSI Initiator
87159 + * versus iSCSI Target. For a given static configuration, the Upper
87160 + * Layer Protocol (ULP) processors may be reconfigured to support different
87161 + * protocols. Each ULP processor supports one or more protocols. The
87162 + * masks indicate which processors are configured for each protocol.
87163 + * For a given static configuration, the number of TCP connections
87164 + * supported for each protocol may vary. The *_id_start and *_id_count
87165 + * variables define a linear range of IDs that are available for each
87166 + * supported protocol. The *_id_count may be used by the driver to allocate
87167 + * the appropriate number of connection resources. The *_id_start may
87168 + * be used to map the arbitrary range of IDs to a zero-based range
87169 + * of indices.
87170 + */
87171 +struct FWCMD_COMMON_FIRMWARE_CONFIG {
87172 + union FWCMD_HEADER header;
87173 + union FWCMD_COMMON_ANON_259_PARAMS params;
87174 +} __packed;
87175 +
87176 +struct FWCMD_COMMON_PORT_EQUALIZATION_PARAMS {
87177 + u32 emph_lev_sel_port0;
87178 + u32 emph_lev_sel_port1;
87179 + u8 xaui_vo_sel;
87180 + u8 xaui_state;
87181 + u16 rsvd0;
87182 + u32 xaui_eq_vector;
87183 +} __packed;
87184 +
87185 +struct FWCMD_COMMON_ANON_262_REQUEST {
87186 + u32 rsvd0;
87187 +} __packed;
87188 +
87189 +union FWCMD_COMMON_ANON_261_PARAMS {
87190 + struct FWCMD_COMMON_ANON_262_REQUEST request;
87191 + struct FWCMD_COMMON_PORT_EQUALIZATION_PARAMS response;
87192 +} __packed;
87193 +
87194 +/*
87195 + * This comand can be used to read XAUI equalization parameters. The
87196 + * ARM firmware applies default equalization parameters during initialization.
87197 + * These parameters may be customer-specific when derived from the
87198 + * SEEPROM. See SEEPROM_DATA for equalization specific fields.
87199 + */
87200 +struct FWCMD_COMMON_GET_PORT_EQUALIZATION {
87201 + union FWCMD_HEADER header;
87202 + union FWCMD_COMMON_ANON_261_PARAMS params;
87203 +} __packed;
87204 +
87205 +struct FWCMD_COMMON_ANON_264_RESPONSE {
87206 + u32 rsvd0;
87207 +} __packed;
87208 +
87209 +union FWCMD_COMMON_ANON_263_PARAMS {
87210 + struct FWCMD_COMMON_PORT_EQUALIZATION_PARAMS request;
87211 + struct FWCMD_COMMON_ANON_264_RESPONSE response;
87212 +} __packed;
87213 +
87214 +/*
87215 + * This comand can be used to set XAUI equalization parameters. The ARM
87216 + * firmware applies default equalization parameters during initialization.
87217 + * These parameters may be customer-specific when derived from the
87218 + * SEEPROM. See SEEPROM_DATA for equalization specific fields.
87219 + */
87220 +struct FWCMD_COMMON_SET_PORT_EQUALIZATION {
87221 + union FWCMD_HEADER header;
87222 + union FWCMD_COMMON_ANON_263_PARAMS params;
87223 +} __packed;
87224 +
87225 +#endif /* __fwcmd_common_bmap_h__ */
87226 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/fwcmd_common.h linux-2.6.29-rc3.owrt/drivers/staging/benet/fwcmd_common.h
87227 --- linux-2.6.29.owrt/drivers/staging/benet/fwcmd_common.h 1970-01-01 01:00:00.000000000 +0100
87228 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/fwcmd_common.h 2009-05-10 23:48:29.000000000 +0200
87229 @@ -0,0 +1,222 @@
87230 +/*
87231 + * Copyright (C) 2005 - 2008 ServerEngines
87232 + * All rights reserved.
87233 + *
87234 + * This program is free software; you can redistribute it and/or
87235 + * modify it under the terms of the GNU General Public License version 2
87236 + * as published by the Free Software Foundation. The full GNU General
87237 + * Public License is included in this distribution in the file called COPYING.
87238 + *
87239 + * Contact Information:
87240 + * linux-drivers@serverengines.com
87241 + *
87242 + * ServerEngines
87243 + * 209 N. Fair Oaks Ave
87244 + * Sunnyvale, CA 94085
87245 + */
87246 +/*
87247 + * Autogenerated by srcgen version: 0127
87248 + */
87249 +#ifndef __fwcmd_common_amap_h__
87250 +#define __fwcmd_common_amap_h__
87251 +#include "host_struct.h"
87252 +
87253 +/* --- PHY_LINK_DUPLEX_ENUM --- */
87254 +#define PHY_LINK_DUPLEX_NONE (0)
87255 +#define PHY_LINK_DUPLEX_HALF (1)
87256 +#define PHY_LINK_DUPLEX_FULL (2)
87257 +
87258 +/* --- PHY_LINK_SPEED_ENUM --- */
87259 +#define PHY_LINK_SPEED_ZERO (0) /* No link. */
87260 +#define PHY_LINK_SPEED_10MBPS (1) /* 10 Mbps */
87261 +#define PHY_LINK_SPEED_100MBPS (2) /* 100 Mbps */
87262 +#define PHY_LINK_SPEED_1GBPS (3) /* 1 Gbps */
87263 +#define PHY_LINK_SPEED_10GBPS (4) /* 10 Gbps */
87264 +
87265 +/* --- PHY_LINK_FAULT_ENUM --- */
87266 +#define PHY_LINK_FAULT_NONE (0) /* No fault status
87267 + available or detected */
87268 +#define PHY_LINK_FAULT_LOCAL (1) /* Local fault detected */
87269 +#define PHY_LINK_FAULT_REMOTE (2) /* Remote fault detected */
87270 +
87271 +/* --- BE_ULP_MASK --- */
87272 +#define BE_ULP0_MASK (1)
87273 +#define BE_ULP1_MASK (2)
87274 +#define BE_ULP2_MASK (4)
87275 +
87276 +/* --- NTWK_ACTIVE_PORT --- */
87277 +#define NTWK_PORT_A (0) /* Port A is currently active */
87278 +#define NTWK_PORT_B (1) /* Port B is currently active */
87279 +#define NTWK_NO_ACTIVE_PORT (15) /* Both ports have lost link */
87280 +
87281 +/* --- NTWK_LINK_TYPE --- */
87282 +#define NTWK_LINK_TYPE_PHYSICAL (0) /* link up/down event
87283 + applies to BladeEngine's
87284 + Physical Ports
87285 + */
87286 +#define NTWK_LINK_TYPE_VIRTUAL (1) /* Virtual link up/down event
87287 + reported by BladeExchange.
87288 + This applies only when the
87289 + VLD feature is enabled
87290 + */
87291 +
87292 +/*
87293 + * --- FWCMD_MAC_TYPE_ENUM ---
87294 + * This enum defines the types of MAC addresses in the RXF MAC Address Table.
87295 + */
87296 +#define MAC_ADDRESS_TYPE_STORAGE (0) /* Storage MAC Address */
87297 +#define MAC_ADDRESS_TYPE_NETWORK (1) /* Network MAC Address */
87298 +#define MAC_ADDRESS_TYPE_PD (2) /* Protection Domain MAC Addr */
87299 +#define MAC_ADDRESS_TYPE_MANAGEMENT (3) /* Managment MAC Address */
87300 +
87301 +
87302 +/* --- FWCMD_RING_TYPE_ENUM --- */
87303 +#define FWCMD_RING_TYPE_ETH_RX (1) /* Ring created with */
87304 + /* FWCMD_COMMON_ETH_RX_CREATE. */
87305 +#define FWCMD_RING_TYPE_ETH_TX (2) /* Ring created with */
87306 + /* FWCMD_COMMON_ETH_TX_CREATE. */
87307 +#define FWCMD_RING_TYPE_ISCSI_WRBQ (3) /* Ring created with */
87308 + /* FWCMD_COMMON_ISCSI_WRBQ_CREATE. */
87309 +#define FWCMD_RING_TYPE_ISCSI_DEFQ (4) /* Ring created with */
87310 + /* FWCMD_COMMON_ISCSI_DEFQ_CREATE. */
87311 +#define FWCMD_RING_TYPE_TPM_WRBQ (5) /* Ring created with */
87312 + /* FWCMD_COMMON_TPM_WRBQ_CREATE. */
87313 +#define FWCMD_RING_TYPE_TPM_DEFQ (6) /* Ring created with */
87314 + /* FWCMD_COMMONTPM_TDEFQ_CREATE. */
87315 +#define FWCMD_RING_TYPE_TPM_RQ (7) /* Ring created with */
87316 + /* FWCMD_COMMON_TPM_RQ_CREATE. */
87317 +#define FWCMD_RING_TYPE_MCC (8) /* Ring created with */
87318 + /* FWCMD_COMMON_MCC_CREATE. */
87319 +#define FWCMD_RING_TYPE_CQ (9) /* Ring created with */
87320 + /* FWCMD_COMMON_CQ_CREATE. */
87321 +#define FWCMD_RING_TYPE_EQ (10) /* Ring created with */
87322 + /* FWCMD_COMMON_EQ_CREATE. */
87323 +#define FWCMD_RING_TYPE_QP (11) /* Ring created with */
87324 + /* FWCMD_RDMA_QP_CREATE. */
87325 +
87326 +
87327 +/* --- ETH_TX_RING_TYPE_ENUM --- */
87328 +#define ETH_TX_RING_TYPE_FORWARDING (1) /* Ethernet ring for
87329 + forwarding packets */
87330 +#define ETH_TX_RING_TYPE_STANDARD (2) /* Ethernet ring for sending
87331 + network packets. */
87332 +#define ETH_TX_RING_TYPE_BOUND (3) /* Ethernet ring bound to the
87333 + port specified in the command
87334 + header.port_number field.
87335 + Rings of this type are
87336 + NOT subject to the
87337 + failover logic implemented
87338 + in the BladeEngine.
87339 + */
87340 +
87341 +/* --- FWCMD_COMMON_QOS_TYPE_ENUM --- */
87342 +#define QOS_BITS_NIC (1) /* max_bits_per_second_NIC */
87343 + /* field is valid. */
87344 +#define QOS_PKTS_NIC (2) /* max_packets_per_second_NIC */
87345 + /* field is valid. */
87346 +#define QOS_IOPS_ISCSI (4) /* max_ios_per_second_iSCSI */
87347 + /*field is valid. */
87348 +#define QOS_VLAN_TAG (8) /* domain_VLAN_tag field
87349 + is valid. */
87350 +#define QOS_FABRIC_ID (16) /* fabric_domain_ID field
87351 + is valid. */
87352 +#define QOS_OEM_PARAMS (32) /* qos_params_oem field
87353 + is valid. */
87354 +#define QOS_TPUT_ISCSI (64) /* max_bytes_per_second_iSCSI
87355 + field is valid. */
87356 +
87357 +
87358 +/*
87359 + * --- FAILOVER_CONFIG_ENUM ---
87360 + * Failover configuration setting used in FWCMD_COMMON_FORCE_FAILOVER
87361 + */
87362 +#define FAILOVER_CONFIG_NO_CHANGE (0) /* No change to automatic */
87363 + /* port failover setting. */
87364 +#define FAILOVER_CONFIG_ON (1) /* Automatic port failover
87365 + on link down is enabled. */
87366 +#define FAILOVER_CONFIG_OFF (2) /* Automatic port failover
87367 + on link down is disabled. */
87368 +
87369 +/*
87370 + * --- FAILOVER_PORT_ENUM ---
87371 + * Failover port setting used in FWCMD_COMMON_FORCE_FAILOVER
87372 + */
87373 +#define FAILOVER_PORT_A (0) /* Selects port A. */
87374 +#define FAILOVER_PORT_B (1) /* Selects port B. */
87375 +#define FAILOVER_PORT_NONE (15) /* No port change requested. */
87376 +
87377 +
87378 +/*
87379 + * --- MGMT_FLASHROM_OPCODE ---
87380 + * Flash ROM operation code
87381 + */
87382 +#define MGMT_FLASHROM_OPCODE_FLASH (1) /* Commit downloaded data
87383 + to Flash ROM */
87384 +#define MGMT_FLASHROM_OPCODE_SAVE (2) /* Save downloaded data to
87385 + ARM's DDR - do not flash */
87386 +#define MGMT_FLASHROM_OPCODE_CLEAR (3) /* Erase specified component
87387 + from FlashROM */
87388 +#define MGMT_FLASHROM_OPCODE_REPORT (4) /* Read specified component
87389 + from Flash ROM */
87390 +#define MGMT_FLASHROM_OPCODE_IMAGE_INFO (5) /* Returns size of a
87391 + component */
87392 +
87393 +/*
87394 + * --- MGMT_FLASHROM_OPTYPE ---
87395 + * Flash ROM operation type
87396 + */
87397 +#define MGMT_FLASHROM_OPTYPE_CODE_FIRMWARE (0) /* Includes ARM firmware,
87398 + IPSec (optional) and EP
87399 + firmware */
87400 +#define MGMT_FLASHROM_OPTYPE_CODE_REDBOOT (1)
87401 +#define MGMT_FLASHROM_OPTYPE_CODE_BIOS (2)
87402 +#define MGMT_FLASHROM_OPTYPE_CODE_PXE_BIOS (3)
87403 +#define MGMT_FLASHROM_OPTYPE_CODE_CTRLS (4)
87404 +#define MGMT_FLASHROM_OPTYPE_CFG_IPSEC (5)
87405 +#define MGMT_FLASHROM_OPTYPE_CFG_INI (6)
87406 +#define MGMT_FLASHROM_OPTYPE_ROM_OFFSET_SPECIFIED (7)
87407 +
87408 +/*
87409 + * --- FLASHROM_TYPE ---
87410 + * Flash ROM manufacturers supported in the f/w
87411 + */
87412 +#define INTEL (0)
87413 +#define SPANSION (1)
87414 +#define MICRON (2)
87415 +
87416 +/* --- DDR_CAS_TYPE --- */
87417 +#define CAS_3 (0)
87418 +#define CAS_4 (1)
87419 +#define CAS_5 (2)
87420 +
87421 +/* --- DDR_SIZE_TYPE --- */
87422 +#define SIZE_256MB (0)
87423 +#define SIZE_512MB (1)
87424 +
87425 +/* --- DDR_MODE_TYPE --- */
87426 +#define DDR_NO_ECC (0)
87427 +#define DDR_ECC (1)
87428 +
87429 +/* --- INTERFACE_10GB_TYPE --- */
87430 +#define CX4_TYPE (0)
87431 +#define XFP_TYPE (1)
87432 +
87433 +/* --- BE_CHIP_MAX_MTU --- */
87434 +#define CHIP_MAX_MTU (9000)
87435 +
87436 +/* --- XAUI_STATE_ENUM --- */
87437 +#define XAUI_STATE_ENABLE (0) /* This MUST be the default
87438 + value for all requests
87439 + which set/change
87440 + equalization parameter. */
87441 +#define XAUI_STATE_DISABLE (255) /* The XAUI for both ports
87442 + may be disabled for EMI
87443 + tests. There is no
87444 + provision for turning off
87445 + individual ports.
87446 + */
87447 +/* --- BE_ASIC_REVISION --- */
87448 +#define BE_ASIC_REV_A0 (1)
87449 +#define BE_ASIC_REV_A1 (2)
87450 +
87451 +#endif /* __fwcmd_common_amap_h__ */
87452 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/fwcmd_eth_bmap.h linux-2.6.29-rc3.owrt/drivers/staging/benet/fwcmd_eth_bmap.h
87453 --- linux-2.6.29.owrt/drivers/staging/benet/fwcmd_eth_bmap.h 1970-01-01 01:00:00.000000000 +0100
87454 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/fwcmd_eth_bmap.h 2009-05-10 23:48:29.000000000 +0200
87455 @@ -0,0 +1,280 @@
87456 +/*
87457 + * Copyright (C) 2005 - 2008 ServerEngines
87458 + * All rights reserved.
87459 + *
87460 + * This program is free software; you can redistribute it and/or
87461 + * modify it under the terms of the GNU General Public License version 2
87462 + * as published by the Free Software Foundation. The full GNU General
87463 + * Public License is included in this distribution in the file called COPYING.
87464 + *
87465 + * Contact Information:
87466 + * linux-drivers@serverengines.com
87467 + *
87468 + * ServerEngines
87469 + * 209 N. Fair Oaks Ave
87470 + * Sunnyvale, CA 94085
87471 + */
87472 +/*
87473 + * Autogenerated by srcgen version: 0127
87474 + */
87475 +#ifndef __fwcmd_eth_bmap_h__
87476 +#define __fwcmd_eth_bmap_h__
87477 +#include "fwcmd_hdr_bmap.h"
87478 +#include "fwcmd_types_bmap.h"
87479 +
87480 +struct MIB_ETH_STATISTICS_PARAMS_IN {
87481 + u32 rsvd0;
87482 +} __packed;
87483 +
87484 +struct BE_RXF_STATS {
87485 + u32 p0recvdtotalbytesLSD; /* DWORD 0 */
87486 + u32 p0recvdtotalbytesMSD; /* DWORD 1 */
87487 + u32 p0recvdtotalframes; /* DWORD 2 */
87488 + u32 p0recvdunicastframes; /* DWORD 3 */
87489 + u32 p0recvdmulticastframes; /* DWORD 4 */
87490 + u32 p0recvdbroadcastframes; /* DWORD 5 */
87491 + u32 p0crcerrors; /* DWORD 6 */
87492 + u32 p0alignmentsymerrs; /* DWORD 7 */
87493 + u32 p0pauseframesrecvd; /* DWORD 8 */
87494 + u32 p0controlframesrecvd; /* DWORD 9 */
87495 + u32 p0inrangelenerrors; /* DWORD 10 */
87496 + u32 p0outrangeerrors; /* DWORD 11 */
87497 + u32 p0frametoolongerrors; /* DWORD 12 */
87498 + u32 p0droppedaddressmatch; /* DWORD 13 */
87499 + u32 p0droppedvlanmismatch; /* DWORD 14 */
87500 + u32 p0ipdroppedtoosmall; /* DWORD 15 */
87501 + u32 p0ipdroppedtooshort; /* DWORD 16 */
87502 + u32 p0ipdroppedhdrtoosmall; /* DWORD 17 */
87503 + u32 p0tcpdroppedlen; /* DWORD 18 */
87504 + u32 p0droppedrunt; /* DWORD 19 */
87505 + u32 p0recvd64; /* DWORD 20 */
87506 + u32 p0recvd65_127; /* DWORD 21 */
87507 + u32 p0recvd128_256; /* DWORD 22 */
87508 + u32 p0recvd256_511; /* DWORD 23 */
87509 + u32 p0recvd512_1023; /* DWORD 24 */
87510 + u32 p0recvd1518_1522; /* DWORD 25 */
87511 + u32 p0recvd1522_2047; /* DWORD 26 */
87512 + u32 p0recvd2048_4095; /* DWORD 27 */
87513 + u32 p0recvd4096_8191; /* DWORD 28 */
87514 + u32 p0recvd8192_9216; /* DWORD 29 */
87515 + u32 p0rcvdipcksmerrs; /* DWORD 30 */
87516 + u32 p0recvdtcpcksmerrs; /* DWORD 31 */
87517 + u32 p0recvdudpcksmerrs; /* DWORD 32 */
87518 + u32 p0recvdnonrsspackets; /* DWORD 33 */
87519 + u32 p0recvdippackets; /* DWORD 34 */
87520 + u32 p0recvdchute1packets; /* DWORD 35 */
87521 + u32 p0recvdchute2packets; /* DWORD 36 */
87522 + u32 p0recvdchute3packets; /* DWORD 37 */
87523 + u32 p0recvdipsecpackets; /* DWORD 38 */
87524 + u32 p0recvdmanagementpackets; /* DWORD 39 */
87525 + u32 p0xmitbyteslsd; /* DWORD 40 */
87526 + u32 p0xmitbytesmsd; /* DWORD 41 */
87527 + u32 p0xmitunicastframes; /* DWORD 42 */
87528 + u32 p0xmitmulticastframes; /* DWORD 43 */
87529 + u32 p0xmitbroadcastframes; /* DWORD 44 */
87530 + u32 p0xmitpauseframes; /* DWORD 45 */
87531 + u32 p0xmitcontrolframes; /* DWORD 46 */
87532 + u32 p0xmit64; /* DWORD 47 */
87533 + u32 p0xmit65_127; /* DWORD 48 */
87534 + u32 p0xmit128_256; /* DWORD 49 */
87535 + u32 p0xmit256_511; /* DWORD 50 */
87536 + u32 p0xmit512_1023; /* DWORD 51 */
87537 + u32 p0xmit1518_1522; /* DWORD 52 */
87538 + u32 p0xmit1522_2047; /* DWORD 53 */
87539 + u32 p0xmit2048_4095; /* DWORD 54 */
87540 + u32 p0xmit4096_8191; /* DWORD 55 */
87541 + u32 p0xmit8192_9216; /* DWORD 56 */
87542 + u32 p0rxfifooverflowdropped; /* DWORD 57 */
87543 + u32 p0ipseclookupfaileddropped; /* DWORD 58 */
87544 + u32 p1recvdtotalbytesLSD; /* DWORD 59 */
87545 + u32 p1recvdtotalbytesMSD; /* DWORD 60 */
87546 + u32 p1recvdtotalframes; /* DWORD 61 */
87547 + u32 p1recvdunicastframes; /* DWORD 62 */
87548 + u32 p1recvdmulticastframes; /* DWORD 63 */
87549 + u32 p1recvdbroadcastframes; /* DWORD 64 */
87550 + u32 p1crcerrors; /* DWORD 65 */
87551 + u32 p1alignmentsymerrs; /* DWORD 66 */
87552 + u32 p1pauseframesrecvd; /* DWORD 67 */
87553 + u32 p1controlframesrecvd; /* DWORD 68 */
87554 + u32 p1inrangelenerrors; /* DWORD 69 */
87555 + u32 p1outrangeerrors; /* DWORD 70 */
87556 + u32 p1frametoolongerrors; /* DWORD 71 */
87557 + u32 p1droppedaddressmatch; /* DWORD 72 */
87558 + u32 p1droppedvlanmismatch; /* DWORD 73 */
87559 + u32 p1ipdroppedtoosmall; /* DWORD 74 */
87560 + u32 p1ipdroppedtooshort; /* DWORD 75 */
87561 + u32 p1ipdroppedhdrtoosmall; /* DWORD 76 */
87562 + u32 p1tcpdroppedlen; /* DWORD 77 */
87563 + u32 p1droppedrunt; /* DWORD 78 */
87564 + u32 p1recvd64; /* DWORD 79 */
87565 + u32 p1recvd65_127; /* DWORD 80 */
87566 + u32 p1recvd128_256; /* DWORD 81 */
87567 + u32 p1recvd256_511; /* DWORD 82 */
87568 + u32 p1recvd512_1023; /* DWORD 83 */
87569 + u32 p1recvd1518_1522; /* DWORD 84 */
87570 + u32 p1recvd1522_2047; /* DWORD 85 */
87571 + u32 p1recvd2048_4095; /* DWORD 86 */
87572 + u32 p1recvd4096_8191; /* DWORD 87 */
87573 + u32 p1recvd8192_9216; /* DWORD 88 */
87574 + u32 p1rcvdipcksmerrs; /* DWORD 89 */
87575 + u32 p1recvdtcpcksmerrs; /* DWORD 90 */
87576 + u32 p1recvdudpcksmerrs; /* DWORD 91 */
87577 + u32 p1recvdnonrsspackets; /* DWORD 92 */
87578 + u32 p1recvdippackets; /* DWORD 93 */
87579 + u32 p1recvdchute1packets; /* DWORD 94 */
87580 + u32 p1recvdchute2packets; /* DWORD 95 */
87581 + u32 p1recvdchute3packets; /* DWORD 96 */
87582 + u32 p1recvdipsecpackets; /* DWORD 97 */
87583 + u32 p1recvdmanagementpackets; /* DWORD 98 */
87584 + u32 p1xmitbyteslsd; /* DWORD 99 */
87585 + u32 p1xmitbytesmsd; /* DWORD 100 */
87586 + u32 p1xmitunicastframes; /* DWORD 101 */
87587 + u32 p1xmitmulticastframes; /* DWORD 102 */
87588 + u32 p1xmitbroadcastframes; /* DWORD 103 */
87589 + u32 p1xmitpauseframes; /* DWORD 104 */
87590 + u32 p1xmitcontrolframes; /* DWORD 105 */
87591 + u32 p1xmit64; /* DWORD 106 */
87592 + u32 p1xmit65_127; /* DWORD 107 */
87593 + u32 p1xmit128_256; /* DWORD 108 */
87594 + u32 p1xmit256_511; /* DWORD 109 */
87595 + u32 p1xmit512_1023; /* DWORD 110 */
87596 + u32 p1xmit1518_1522; /* DWORD 111 */
87597 + u32 p1xmit1522_2047; /* DWORD 112 */
87598 + u32 p1xmit2048_4095; /* DWORD 113 */
87599 + u32 p1xmit4096_8191; /* DWORD 114 */
87600 + u32 p1xmit8192_9216; /* DWORD 115 */
87601 + u32 p1rxfifooverflowdropped; /* DWORD 116 */
87602 + u32 p1ipseclookupfaileddropped; /* DWORD 117 */
87603 + u32 pxdroppednopbuf; /* DWORD 118 */
87604 + u32 pxdroppednotxpb; /* DWORD 119 */
87605 + u32 pxdroppednoipsecbuf; /* DWORD 120 */
87606 + u32 pxdroppednoerxdescr; /* DWORD 121 */
87607 + u32 pxdroppednotpredescr; /* DWORD 122 */
87608 + u32 pxrecvdmanagementportpackets; /* DWORD 123 */
87609 + u32 pxrecvdmanagementportbytes; /* DWORD 124 */
87610 + u32 pxrecvdmanagementportpauseframes; /* DWORD 125 */
87611 + u32 pxrecvdmanagementporterrors; /* DWORD 126 */
87612 + u32 pxxmitmanagementportpackets; /* DWORD 127 */
87613 + u32 pxxmitmanagementportbytes; /* DWORD 128 */
87614 + u32 pxxmitmanagementportpause; /* DWORD 129 */
87615 + u32 pxxmitmanagementportrxfifooverflow; /* DWORD 130 */
87616 + u32 pxrecvdipsecipcksmerrs; /* DWORD 131 */
87617 + u32 pxrecvdtcpsecipcksmerrs; /* DWORD 132 */
87618 + u32 pxrecvdudpsecipcksmerrs; /* DWORD 133 */
87619 + u32 pxipsecrunt; /* DWORD 134 */
87620 + u32 pxipsecaddressmismatchdropped; /* DWORD 135 */
87621 + u32 pxipsecrxfifooverflowdropped; /* DWORD 136 */
87622 + u32 pxipsecframestoolong; /* DWORD 137 */
87623 + u32 pxipsectotalipframes; /* DWORD 138 */
87624 + u32 pxipseciptoosmall; /* DWORD 139 */
87625 + u32 pxipseciptooshort; /* DWORD 140 */
87626 + u32 pxipseciphdrtoosmall; /* DWORD 141 */
87627 + u32 pxipsectcphdrbad; /* DWORD 142 */
87628 + u32 pxrecvdipsecchute1; /* DWORD 143 */
87629 + u32 pxrecvdipsecchute2; /* DWORD 144 */
87630 + u32 pxrecvdipsecchute3; /* DWORD 145 */
87631 + u32 pxdropped7frags; /* DWORD 146 */
87632 + u32 pxdroppedfrags; /* DWORD 147 */
87633 + u32 pxdroppedinvalidfragring; /* DWORD 148 */
87634 + u32 pxnumforwardedpackets; /* DWORD 149 */
87635 +} __packed;
87636 +
87637 +union MIB_ETH_STATISTICS_PARAMS {
87638 + struct MIB_ETH_STATISTICS_PARAMS_IN request;
87639 + struct BE_RXF_STATS response;
87640 +} __packed;
87641 +
87642 +/*
87643 + * Query ethernet statistics. All domains may issue this command. The
87644 + * host domain drivers may optionally reset internal statistic counters
87645 + * with a query.
87646 + */
87647 +struct FWCMD_ETH_GET_STATISTICS {
87648 + union FWCMD_HEADER header;
87649 + union MIB_ETH_STATISTICS_PARAMS params;
87650 +} __packed;
87651 +
87652 +
87653 +struct FWCMD_ETH_ANON_175_REQUEST {
87654 + u8 port0_promiscuous;
87655 + u8 port1_promiscuous;
87656 + u16 rsvd0;
87657 +} __packed;
87658 +
87659 +struct FWCMD_ETH_ANON_176_RESPONSE {
87660 + u32 rsvd0;
87661 +} __packed;
87662 +
87663 +union FWCMD_ETH_ANON_174_PARAMS {
87664 + struct FWCMD_ETH_ANON_175_REQUEST request;
87665 + struct FWCMD_ETH_ANON_176_RESPONSE response;
87666 +} __packed;
87667 +
87668 +/* Enables/Disables promiscuous ethernet receive mode. */
87669 +struct FWCMD_ETH_PROMISCUOUS {
87670 + union FWCMD_HEADER header;
87671 + union FWCMD_ETH_ANON_174_PARAMS params;
87672 +} __packed;
87673 +
87674 +struct FWCMD_ETH_ANON_178_REQUEST {
87675 + u32 new_fragsize_log2;
87676 +} __packed;
87677 +
87678 +struct FWCMD_ETH_ANON_179_RESPONSE {
87679 + u32 actual_fragsize_log2;
87680 +} __packed;
87681 +
87682 +union FWCMD_ETH_ANON_177_PARAMS {
87683 + struct FWCMD_ETH_ANON_178_REQUEST request;
87684 + struct FWCMD_ETH_ANON_179_RESPONSE response;
87685 +} __packed;
87686 +
87687 +/*
87688 + * Sets the Ethernet RX fragment size. Only host (domain 0) networking
87689 + * drivers may issue this command. This call will fail for non-host
87690 + * protection domains. In this situation the MCC CQ status will indicate
87691 + * a failure due to insufficient priviledges. The response should be
87692 + * ignored, and the driver should use the FWCMD_ETH_GET_FRAG_SIZE to
87693 + * query the existing ethernet receive fragment size. It must use this
87694 + * fragment size for all fragments in the ethernet receive ring. If
87695 + * the command succeeds, the driver must use the frag size indicated
87696 + * in the command response since the requested frag size may not be applied
87697 + * until the next reboot. When the requested fragsize matches the response
87698 + * fragsize, this indicates the request was applied immediately.
87699 + */
87700 +struct FWCMD_ETH_SET_RX_FRAG_SIZE {
87701 + union FWCMD_HEADER header;
87702 + union FWCMD_ETH_ANON_177_PARAMS params;
87703 +} __packed;
87704 +
87705 +struct FWCMD_ETH_ANON_181_REQUEST {
87706 + u32 rsvd0;
87707 +} __packed;
87708 +
87709 +struct FWCMD_ETH_ANON_182_RESPONSE {
87710 + u32 actual_fragsize_log2;
87711 +} __packed;
87712 +
87713 +union FWCMD_ETH_ANON_180_PARAMS {
87714 + struct FWCMD_ETH_ANON_181_REQUEST request;
87715 + struct FWCMD_ETH_ANON_182_RESPONSE response;
87716 +} __packed;
87717 +
87718 +/*
87719 + * Queries the Ethernet RX fragment size. All domains may issue this
87720 + * command. The driver should call this command to determine the minimum
87721 + * required fragment size for the ethernet RX ring buffers. Drivers
87722 + * may choose to use a larger size for each fragment buffer, but BladeEngine
87723 + * will use up to the configured minimum required fragsize in each ethernet
87724 + * receive fragment buffer. For example, if the ethernet receive fragment
87725 + * size is configured to 4kB, and a driver uses 8kB fragments, a 6kB
87726 + * ethernet packet received by BladeEngine will be split accross two
87727 + * of the driver's receive framgents (4kB in one fragment buffer, and
87728 + * 2kB in the subsequent fragment buffer).
87729 + */
87730 +struct FWCMD_ETH_GET_RX_FRAG_SIZE {
87731 + union FWCMD_HEADER header;
87732 + union FWCMD_ETH_ANON_180_PARAMS params;
87733 +} __packed;
87734 +
87735 +#endif /* __fwcmd_eth_bmap_h__ */
87736 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/fwcmd_hdr_bmap.h linux-2.6.29-rc3.owrt/drivers/staging/benet/fwcmd_hdr_bmap.h
87737 --- linux-2.6.29.owrt/drivers/staging/benet/fwcmd_hdr_bmap.h 1970-01-01 01:00:00.000000000 +0100
87738 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/fwcmd_hdr_bmap.h 2009-05-10 23:48:29.000000000 +0200
87739 @@ -0,0 +1,54 @@
87740 +/*
87741 + * Copyright (C) 2005 - 2008 ServerEngines
87742 + * All rights reserved.
87743 + *
87744 + * This program is free software; you can redistribute it and/or
87745 + * modify it under the terms of the GNU General Public License version 2
87746 + * as published by the Free Software Foundation. The full GNU General
87747 + * Public License is included in this distribution in the file called COPYING.
87748 + *
87749 + * Contact Information:
87750 + * linux-drivers@serverengines.com
87751 + *
87752 + * ServerEngines
87753 + * 209 N. Fair Oaks Ave
87754 + * Sunnyvale, CA 94085
87755 + */
87756 +/*
87757 + * Autogenerated by srcgen version: 0127
87758 + */
87759 +#ifndef __fwcmd_hdr_bmap_h__
87760 +#define __fwcmd_hdr_bmap_h__
87761 +
87762 +struct FWCMD_REQUEST_HEADER {
87763 + u8 opcode;
87764 + u8 subsystem;
87765 + u8 port_number;
87766 + u8 domain;
87767 + u32 timeout;
87768 + u32 request_length;
87769 + u32 rsvd0;
87770 +} __packed;
87771 +
87772 +struct FWCMD_RESPONSE_HEADER {
87773 + u8 opcode;
87774 + u8 subsystem;
87775 + u8 rsvd0;
87776 + u8 domain;
87777 + u8 status;
87778 + u8 additional_status;
87779 + u16 rsvd1;
87780 + u32 response_length;
87781 + u32 actual_response_length;
87782 +} __packed;
87783 +
87784 +/*
87785 + * The firmware/driver overwrites the input FWCMD_REQUEST_HEADER with
87786 + * the output FWCMD_RESPONSE_HEADER.
87787 + */
87788 +union FWCMD_HEADER {
87789 + struct FWCMD_REQUEST_HEADER request;
87790 + struct FWCMD_RESPONSE_HEADER response;
87791 +} __packed;
87792 +
87793 +#endif /* __fwcmd_hdr_bmap_h__ */
87794 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/fwcmd_mcc.h linux-2.6.29-rc3.owrt/drivers/staging/benet/fwcmd_mcc.h
87795 --- linux-2.6.29.owrt/drivers/staging/benet/fwcmd_mcc.h 1970-01-01 01:00:00.000000000 +0100
87796 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/fwcmd_mcc.h 2009-05-10 23:48:29.000000000 +0200
87797 @@ -0,0 +1,94 @@
87798 +/*
87799 + * Copyright (C) 2005 - 2008 ServerEngines
87800 + * All rights reserved.
87801 + *
87802 + * This program is free software; you can redistribute it and/or
87803 + * modify it under the terms of the GNU General Public License version 2
87804 + * as published by the Free Software Foundation. The full GNU General
87805 + * Public License is included in this distribution in the file called COPYING.
87806 + *
87807 + * Contact Information:
87808 + * linux-drivers@serverengines.com
87809 + *
87810 + * ServerEngines
87811 + * 209 N. Fair Oaks Ave
87812 + * Sunnyvale, CA 94085
87813 + */
87814 +/*
87815 + * Autogenerated by srcgen version: 0127
87816 + */
87817 +#ifndef __fwcmd_mcc_amap_h__
87818 +#define __fwcmd_mcc_amap_h__
87819 +#include "fwcmd_opcodes.h"
87820 +/*
87821 + * Where applicable, a WRB, may contain a list of Scatter-gather elements.
87822 + * Each element supports a 64 bit address and a 32bit length field.
87823 + */
87824 +struct BE_MCC_SGE_AMAP {
87825 + u8 pa_lo[32]; /* DWORD 0 */
87826 + u8 pa_hi[32]; /* DWORD 1 */
87827 + u8 length[32]; /* DWORD 2 */
87828 +} __packed;
87829 +struct MCC_SGE_AMAP {
87830 + u32 dw[3];
87831 +};
87832 +/*
87833 + * The design of an MCC_SGE allows up to 19 elements to be embedded
87834 + * in a WRB, supporting 64KB data transfers (assuming a 4KB page size).
87835 + */
87836 +struct BE_MCC_WRB_PAYLOAD_AMAP {
87837 + union {
87838 + struct BE_MCC_SGE_AMAP sgl[19];
87839 + u8 embedded[59][32]; /* DWORD 0 */
87840 + };
87841 +} __packed;
87842 +struct MCC_WRB_PAYLOAD_AMAP {
87843 + u32 dw[59];
87844 +};
87845 +
87846 +/*
87847 + * This is the structure of the MCC Command WRB for commands
87848 + * sent to the Management Processing Unit (MPU). See section
87849 + * for usage in embedded and non-embedded modes.
87850 + */
87851 +struct BE_MCC_WRB_AMAP {
87852 + u8 embedded; /* DWORD 0 */
87853 + u8 rsvd0[2]; /* DWORD 0 */
87854 + u8 sge_count[5]; /* DWORD 0 */
87855 + u8 rsvd1[16]; /* DWORD 0 */
87856 + u8 special[8]; /* DWORD 0 */
87857 + u8 payload_length[32]; /* DWORD 1 */
87858 + u8 tag[2][32]; /* DWORD 2 */
87859 + u8 rsvd2[32]; /* DWORD 4 */
87860 + struct BE_MCC_WRB_PAYLOAD_AMAP payload;
87861 +} __packed;
87862 +struct MCC_WRB_AMAP {
87863 + u32 dw[64];
87864 +};
87865 +
87866 +/* This is the structure of the MCC Completion queue entry */
87867 +struct BE_MCC_CQ_ENTRY_AMAP {
87868 + u8 completion_status[16]; /* DWORD 0 */
87869 + u8 extended_status[16]; /* DWORD 0 */
87870 + u8 mcc_tag[2][32]; /* DWORD 1 */
87871 + u8 rsvd0[27]; /* DWORD 3 */
87872 + u8 consumed; /* DWORD 3 */
87873 + u8 completed; /* DWORD 3 */
87874 + u8 hpi_buffer_completion; /* DWORD 3 */
87875 + u8 async_event; /* DWORD 3 */
87876 + u8 valid; /* DWORD 3 */
87877 +} __packed;
87878 +struct MCC_CQ_ENTRY_AMAP {
87879 + u32 dw[4];
87880 +};
87881 +
87882 +/* Mailbox structures used by the MPU during bootstrap */
87883 +struct BE_MCC_MAILBOX_AMAP {
87884 + struct BE_MCC_WRB_AMAP wrb;
87885 + struct BE_MCC_CQ_ENTRY_AMAP cq;
87886 +} __packed;
87887 +struct MCC_MAILBOX_AMAP {
87888 + u32 dw[68];
87889 +};
87890 +
87891 +#endif /* __fwcmd_mcc_amap_h__ */
87892 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/fwcmd_opcodes.h linux-2.6.29-rc3.owrt/drivers/staging/benet/fwcmd_opcodes.h
87893 --- linux-2.6.29.owrt/drivers/staging/benet/fwcmd_opcodes.h 1970-01-01 01:00:00.000000000 +0100
87894 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/fwcmd_opcodes.h 2009-05-10 23:48:29.000000000 +0200
87895 @@ -0,0 +1,244 @@
87896 +/*
87897 + * Copyright (C) 2005 - 2008 ServerEngines
87898 + * All rights reserved.
87899 + *
87900 + * This program is free software; you can redistribute it and/or
87901 + * modify it under the terms of the GNU General Public License version 2
87902 + * as published by the Free Software Foundation. The full GNU General
87903 + * Public License is included in this distribution in the file called COPYING.
87904 + *
87905 + * Contact Information:
87906 + * linux-drivers@serverengines.com
87907 + *
87908 + * ServerEngines
87909 + * 209 N. Fair Oaks Ave
87910 + * Sunnyvale, CA 94085
87911 + */
87912 +/*
87913 + * Autogenerated by srcgen version: 0127
87914 + */
87915 +#ifndef __fwcmd_opcodes_amap_h__
87916 +#define __fwcmd_opcodes_amap_h__
87917 +
87918 +/*
87919 + * --- FWCMD_SUBSYSTEMS ---
87920 + * The commands are grouped into the following subsystems. The subsystem
87921 + * code along with the opcode uniquely identify a particular fwcmd.
87922 + */
87923 +#define FWCMD_SUBSYSTEM_RSVD (0) /* This subsystem is reserved. It is */
87924 + /* never used. */
87925 +#define FWCMD_SUBSYSTEM_COMMON (1) /* CMDs in this group are common to
87926 + * all subsystems. See
87927 + * COMMON_SUBSYSTEM_OPCODES for opcodes
87928 + * and Common Host Configuration CMDs
87929 + * for the FWCMD descriptions.
87930 + */
87931 +#define FWCMD_SUBSYSTEM_COMMON_ISCSI (2) /* CMDs in this group are */
87932 + /*
87933 + * common to Initiator and Target. See
87934 + * COMMON_ISCSI_SUBSYSTEM_OPCODES and
87935 + * Common iSCSI Initiator and Target
87936 + * CMDs for the command descriptions.
87937 + */
87938 +#define FWCMD_SUBSYSTEM_ETH (3) /* This subsystem is used to
87939 + execute Ethernet commands. */
87940 +
87941 +#define FWCMD_SUBSYSTEM_TPM (4) /* This subsystem is used
87942 + to execute TPM commands. */
87943 +#define FWCMD_SUBSYSTEM_PXE_UNDI (5) /* This subsystem is used
87944 + * to execute PXE
87945 + * and UNDI specific commands.
87946 + */
87947 +
87948 +#define FWCMD_SUBSYSTEM_ISCSI_INI (6) /* This subsystem is used to
87949 + execute ISCSI Initiator
87950 + specific commands.
87951 + */
87952 +#define FWCMD_SUBSYSTEM_ISCSI_TGT (7) /* This subsystem is used
87953 + to execute iSCSI Target
87954 + specific commands.between
87955 + PTL and ARM firmware.
87956 + */
87957 +#define FWCMD_SUBSYSTEM_MILI_PTL (8) /* This subsystem is used to
87958 + execute iSCSI Target specific
87959 + commands.between MILI
87960 + and PTL. */
87961 +#define FWCMD_SUBSYSTEM_MILI_TMD (9) /* This subsystem is used to
87962 + execute iSCSI Target specific
87963 + commands between MILI
87964 + and TMD. */
87965 +#define FWCMD_SUBSYSTEM_PROXY (11) /* This subsystem is used
87966 + to execute proxied commands
87967 + within the host at the
87968 + explicit request of a
87969 + non priviledged domain.
87970 + This 'subsystem' is entirely
87971 + virtual from the controller
87972 + and firmware perspective as
87973 + it is implemented in host
87974 + drivers.
87975 + */
87976 +
87977 +/*
87978 + * --- COMMON_SUBSYSTEM_OPCODES ---
87979 + * These opcodes are common to both networking and storage PCI
87980 + * functions. They are used to reserve resources and configure
87981 + * BladeEngine. These opcodes all use the FWCMD_SUBSYSTEM_COMMON
87982 + * subsystem code.
87983 + */
87984 +#define OPCODE_COMMON_NTWK_MAC_QUERY (1)
87985 +#define SUBSYSTEM_COMMON_NTWK_MAC_QUERY (1)
87986 +#define SUBSYSTEM_COMMON_NTWK_MAC_SET (1)
87987 +#define SUBSYSTEM_COMMON_NTWK_MULTICAST_SET (1)
87988 +#define SUBSYSTEM_COMMON_NTWK_VLAN_CONFIG (1)
87989 +#define SUBSYSTEM_COMMON_NTWK_LINK_STATUS_QUERY (1)
87990 +#define SUBSYSTEM_COMMON_READ_FLASHROM (1)
87991 +#define SUBSYSTEM_COMMON_WRITE_FLASHROM (1)
87992 +#define SUBSYSTEM_COMMON_QUERY_MAX_FWCMD_BUFFER_SIZE (1)
87993 +#define SUBSYSTEM_COMMON_ADD_PAGE_TABLES (1)
87994 +#define SUBSYSTEM_COMMON_REMOVE_PAGE_TABLES (1)
87995 +#define SUBSYSTEM_COMMON_RING_DESTROY (1)
87996 +#define SUBSYSTEM_COMMON_CQ_CREATE (1)
87997 +#define SUBSYSTEM_COMMON_EQ_CREATE (1)
87998 +#define SUBSYSTEM_COMMON_ETH_RX_CREATE (1)
87999 +#define SUBSYSTEM_COMMON_ETH_TX_CREATE (1)
88000 +#define SUBSYSTEM_COMMON_ISCSI_DEFQ_CREATE (1)
88001 +#define SUBSYSTEM_COMMON_ISCSI_WRBQ_CREATE (1)
88002 +#define SUBSYSTEM_COMMON_MCC_CREATE (1)
88003 +#define SUBSYSTEM_COMMON_JELL_CONFIG (1)
88004 +#define SUBSYSTEM_COMMON_FORCE_FAILOVER (1)
88005 +#define SUBSYSTEM_COMMON_ADD_TEMPLATE_HEADER_BUFFERS (1)
88006 +#define SUBSYSTEM_COMMON_REMOVE_TEMPLATE_HEADER_BUFFERS (1)
88007 +#define SUBSYSTEM_COMMON_POST_ZERO_BUFFER (1)
88008 +#define SUBSYSTEM_COMMON_GET_QOS (1)
88009 +#define SUBSYSTEM_COMMON_SET_QOS (1)
88010 +#define SUBSYSTEM_COMMON_TCP_GET_STATISTICS (1)
88011 +#define SUBSYSTEM_COMMON_SEEPROM_READ (1)
88012 +#define SUBSYSTEM_COMMON_TCP_STATE_QUERY (1)
88013 +#define SUBSYSTEM_COMMON_GET_CNTL_ATTRIBUTES (1)
88014 +#define SUBSYSTEM_COMMON_NOP (1)
88015 +#define SUBSYSTEM_COMMON_NTWK_RX_FILTER (1)
88016 +#define SUBSYSTEM_COMMON_GET_FW_VERSION (1)
88017 +#define SUBSYSTEM_COMMON_SET_FLOW_CONTROL (1)
88018 +#define SUBSYSTEM_COMMON_GET_FLOW_CONTROL (1)
88019 +#define SUBSYSTEM_COMMON_SET_TCP_PARAMETERS (1)
88020 +#define SUBSYSTEM_COMMON_SET_FRAME_SIZE (1)
88021 +#define SUBSYSTEM_COMMON_GET_FAT (1)
88022 +#define SUBSYSTEM_COMMON_MODIFY_EQ_DELAY (1)
88023 +#define SUBSYSTEM_COMMON_FIRMWARE_CONFIG (1)
88024 +#define SUBSYSTEM_COMMON_ENABLE_DISABLE_DOMAINS (1)
88025 +#define SUBSYSTEM_COMMON_GET_DOMAIN_CONFIG (1)
88026 +#define SUBSYSTEM_COMMON_SET_VLD_CONFIG (1)
88027 +#define SUBSYSTEM_COMMON_GET_VLD_CONFIG (1)
88028 +#define SUBSYSTEM_COMMON_GET_PORT_EQUALIZATION (1)
88029 +#define SUBSYSTEM_COMMON_SET_PORT_EQUALIZATION (1)
88030 +#define SUBSYSTEM_COMMON_RED_CONFIG (1)
88031 +#define OPCODE_COMMON_NTWK_MAC_SET (2)
88032 +#define OPCODE_COMMON_NTWK_MULTICAST_SET (3)
88033 +#define OPCODE_COMMON_NTWK_VLAN_CONFIG (4)
88034 +#define OPCODE_COMMON_NTWK_LINK_STATUS_QUERY (5)
88035 +#define OPCODE_COMMON_READ_FLASHROM (6)
88036 +#define OPCODE_COMMON_WRITE_FLASHROM (7)
88037 +#define OPCODE_COMMON_QUERY_MAX_FWCMD_BUFFER_SIZE (8)
88038 +#define OPCODE_COMMON_ADD_PAGE_TABLES (9)
88039 +#define OPCODE_COMMON_REMOVE_PAGE_TABLES (10)
88040 +#define OPCODE_COMMON_RING_DESTROY (11)
88041 +#define OPCODE_COMMON_CQ_CREATE (12)
88042 +#define OPCODE_COMMON_EQ_CREATE (13)
88043 +#define OPCODE_COMMON_ETH_RX_CREATE (14)
88044 +#define OPCODE_COMMON_ETH_TX_CREATE (15)
88045 +#define OPCODE_COMMON_NET_RESERVED0 (16) /* Reserved */
88046 +#define OPCODE_COMMON_NET_RESERVED1 (17) /* Reserved */
88047 +#define OPCODE_COMMON_NET_RESERVED2 (18) /* Reserved */
88048 +#define OPCODE_COMMON_ISCSI_DEFQ_CREATE (19)
88049 +#define OPCODE_COMMON_ISCSI_WRBQ_CREATE (20)
88050 +#define OPCODE_COMMON_MCC_CREATE (21)
88051 +#define OPCODE_COMMON_JELL_CONFIG (22)
88052 +#define OPCODE_COMMON_FORCE_FAILOVER (23)
88053 +#define OPCODE_COMMON_ADD_TEMPLATE_HEADER_BUFFERS (24)
88054 +#define OPCODE_COMMON_REMOVE_TEMPLATE_HEADER_BUFFERS (25)
88055 +#define OPCODE_COMMON_POST_ZERO_BUFFER (26)
88056 +#define OPCODE_COMMON_GET_QOS (27)
88057 +#define OPCODE_COMMON_SET_QOS (28)
88058 +#define OPCODE_COMMON_TCP_GET_STATISTICS (29)
88059 +#define OPCODE_COMMON_SEEPROM_READ (30)
88060 +#define OPCODE_COMMON_TCP_STATE_QUERY (31)
88061 +#define OPCODE_COMMON_GET_CNTL_ATTRIBUTES (32)
88062 +#define OPCODE_COMMON_NOP (33)
88063 +#define OPCODE_COMMON_NTWK_RX_FILTER (34)
88064 +#define OPCODE_COMMON_GET_FW_VERSION (35)
88065 +#define OPCODE_COMMON_SET_FLOW_CONTROL (36)
88066 +#define OPCODE_COMMON_GET_FLOW_CONTROL (37)
88067 +#define OPCODE_COMMON_SET_TCP_PARAMETERS (38)
88068 +#define OPCODE_COMMON_SET_FRAME_SIZE (39)
88069 +#define OPCODE_COMMON_GET_FAT (40)
88070 +#define OPCODE_COMMON_MODIFY_EQ_DELAY (41)
88071 +#define OPCODE_COMMON_FIRMWARE_CONFIG (42)
88072 +#define OPCODE_COMMON_ENABLE_DISABLE_DOMAINS (43)
88073 +#define OPCODE_COMMON_GET_DOMAIN_CONFIG (44)
88074 +#define OPCODE_COMMON_SET_VLD_CONFIG (45)
88075 +#define OPCODE_COMMON_GET_VLD_CONFIG (46)
88076 +#define OPCODE_COMMON_GET_PORT_EQUALIZATION (47)
88077 +#define OPCODE_COMMON_SET_PORT_EQUALIZATION (48)
88078 +#define OPCODE_COMMON_RED_CONFIG (49)
88079 +
88080 +
88081 +
88082 +/*
88083 + * --- ETH_SUBSYSTEM_OPCODES ---
88084 + * These opcodes are used for configuring the Ethernet interfaces. These
88085 + * opcodes all use the FWCMD_SUBSYSTEM_ETH subsystem code.
88086 + */
88087 +#define OPCODE_ETH_RSS_CONFIG (1)
88088 +#define OPCODE_ETH_ACPI_CONFIG (2)
88089 +#define SUBSYSTEM_ETH_RSS_CONFIG (3)
88090 +#define SUBSYSTEM_ETH_ACPI_CONFIG (3)
88091 +#define OPCODE_ETH_PROMISCUOUS (3)
88092 +#define SUBSYSTEM_ETH_PROMISCUOUS (3)
88093 +#define SUBSYSTEM_ETH_GET_STATISTICS (3)
88094 +#define SUBSYSTEM_ETH_GET_RX_FRAG_SIZE (3)
88095 +#define SUBSYSTEM_ETH_SET_RX_FRAG_SIZE (3)
88096 +#define OPCODE_ETH_GET_STATISTICS (4)
88097 +#define OPCODE_ETH_GET_RX_FRAG_SIZE (5)
88098 +#define OPCODE_ETH_SET_RX_FRAG_SIZE (6)
88099 +
88100 +
88101 +
88102 +
88103 +
88104 +/*
88105 + * --- MCC_STATUS_CODE ---
88106 + * These are the global status codes used by all subsystems
88107 + */
88108 +#define MCC_STATUS_SUCCESS (0) /* Indicates a successful
88109 + completion of the command */
88110 +#define MCC_STATUS_INSUFFICIENT_PRIVILEGES (1) /* The client does not have
88111 + sufficient privileges to
88112 + execute the command */
88113 +#define MCC_STATUS_INVALID_PARAMETER (2) /* A parameter in the command
88114 + was invalid. The extended
88115 + status contains the index
88116 + of the parameter */
88117 +#define MCC_STATUS_INSUFFICIENT_RESOURCES (3) /* There are insufficient
88118 + chip resources to execute
88119 + the command */
88120 +#define MCC_STATUS_QUEUE_FLUSHING (4) /* The command is completing
88121 + because the queue was
88122 + getting flushed */
88123 +#define MCC_STATUS_DMA_FAILED (5) /* The command is completing
88124 + with a DMA error */
88125 +
88126 +/*
88127 + * --- MGMT_ERROR_CODES ---
88128 + * Error Codes returned in the status field of the FWCMD response header
88129 + */
88130 +#define MGMT_STATUS_SUCCESS (0) /* The FWCMD completed
88131 + without errors */
88132 +#define MGMT_STATUS_FAILED (1) /* Error status in the Status
88133 + field of the
88134 + struct FWCMD_RESPONSE_HEADER */
88135 +#define MGMT_STATUS_ILLEGAL_REQUEST (2) /* Invalid FWCMD opcode */
88136 +#define MGMT_STATUS_ILLEGAL_FIELD (3) /* Invalid parameter in
88137 + the FWCMD payload */
88138 +
88139 +#endif /* __fwcmd_opcodes_amap_h__ */
88140 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/fwcmd_types_bmap.h linux-2.6.29-rc3.owrt/drivers/staging/benet/fwcmd_types_bmap.h
88141 --- linux-2.6.29.owrt/drivers/staging/benet/fwcmd_types_bmap.h 1970-01-01 01:00:00.000000000 +0100
88142 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/fwcmd_types_bmap.h 2009-05-10 23:48:29.000000000 +0200
88143 @@ -0,0 +1,29 @@
88144 +/*
88145 + * Copyright (C) 2005 - 2008 ServerEngines
88146 + * All rights reserved.
88147 + *
88148 + * This program is free software; you can redistribute it and/or
88149 + * modify it under the terms of the GNU General Public License version 2
88150 + * as published by the Free Software Foundation. The full GNU General
88151 + * Public License is included in this distribution in the file called COPYING.
88152 + *
88153 + * Contact Information:
88154 + * linux-drivers@serverengines.com
88155 + *
88156 + * ServerEngines
88157 + * 209 N. Fair Oaks Ave
88158 + * Sunnyvale, CA 94085
88159 + */
88160 +/*
88161 + * Autogenerated by srcgen version: 0127
88162 + */
88163 +#ifndef __fwcmd_types_bmap_h__
88164 +#define __fwcmd_types_bmap_h__
88165 +
88166 +/* MAC address format */
88167 +struct MAC_ADDRESS_FORMAT {
88168 + u16 SizeOfStructure;
88169 + u8 MACAddress[6];
88170 +} __packed;
88171 +
88172 +#endif /* __fwcmd_types_bmap_h__ */
88173 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/host_struct.h linux-2.6.29-rc3.owrt/drivers/staging/benet/host_struct.h
88174 --- linux-2.6.29.owrt/drivers/staging/benet/host_struct.h 1970-01-01 01:00:00.000000000 +0100
88175 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/host_struct.h 2009-05-10 23:48:29.000000000 +0200
88176 @@ -0,0 +1,182 @@
88177 +/*
88178 + * Copyright (C) 2005 - 2008 ServerEngines
88179 + * All rights reserved.
88180 + *
88181 + * This program is free software; you can redistribute it and/or
88182 + * modify it under the terms of the GNU General Public License version 2
88183 + * as published by the Free Software Foundation. The full GNU General
88184 + * Public License is included in this distribution in the file called COPYING.
88185 + *
88186 + * Contact Information:
88187 + * linux-drivers@serverengines.com
88188 + *
88189 + * ServerEngines
88190 + * 209 N. Fair Oaks Ave
88191 + * Sunnyvale, CA 94085
88192 + */
88193 +/*
88194 + * Autogenerated by srcgen version: 0127
88195 + */
88196 +#ifndef __host_struct_amap_h__
88197 +#define __host_struct_amap_h__
88198 +#include "be_cm.h"
88199 +#include "be_common.h"
88200 +#include "descriptors.h"
88201 +
88202 +/* --- EQ_COMPLETION_MAJOR_CODE_ENUM --- */
88203 +#define EQ_MAJOR_CODE_COMPLETION (0) /* Completion event on a */
88204 + /* qcompletion ueue. */
88205 +#define EQ_MAJOR_CODE_ETH (1) /* Affiliated Ethernet Event. */
88206 +#define EQ_MAJOR_CODE_RESERVED (2) /* Reserved */
88207 +#define EQ_MAJOR_CODE_RDMA (3) /* Affiliated RDMA Event. */
88208 +#define EQ_MAJOR_CODE_ISCSI (4) /* Affiliated ISCSI Event */
88209 +#define EQ_MAJOR_CODE_UNAFFILIATED (5) /* Unaffiliated Event */
88210 +
88211 +/* --- EQ_COMPLETION_MINOR_CODE_ENUM --- */
88212 +#define EQ_MINOR_CODE_COMPLETION (0) /* Completion event on a */
88213 + /* completion queue. */
88214 +#define EQ_MINOR_CODE_OTHER (1) /* Other Event (TBD). */
88215 +
88216 +/* Queue Entry Definition for all 4 byte event queue types. */
88217 +struct BE_EQ_ENTRY_AMAP {
88218 + u8 Valid; /* DWORD 0 */
88219 + u8 MajorCode[3]; /* DWORD 0 */
88220 + u8 MinorCode[12]; /* DWORD 0 */
88221 + u8 ResourceID[16]; /* DWORD 0 */
88222 +} __packed;
88223 +struct EQ_ENTRY_AMAP {
88224 + u32 dw[1];
88225 +};
88226 +
88227 +/*
88228 + * --- ETH_EVENT_CODE ---
88229 + * These codes are returned by the MPU when one of these events has occurred,
88230 + * and the event is configured to report to an Event Queue when an event
88231 + * is detected.
88232 + */
88233 +#define ETH_EQ_LINK_STATUS (0) /* Link status change event */
88234 + /* detected. */
88235 +#define ETH_EQ_WATERMARK (1) /* watermark event detected. */
88236 +#define ETH_EQ_MAGIC_PKT (2) /* magic pkt event detected. */
88237 +#define ETH_EQ_ACPI_PKT0 (3) /* ACPI interesting packet */
88238 + /* detected. */
88239 +#define ETH_EQ_ACPI_PKT1 (3) /* ACPI interesting packet */
88240 + /* detected. */
88241 +#define ETH_EQ_ACPI_PKT2 (3) /* ACPI interesting packet */
88242 + /* detected. */
88243 +#define ETH_EQ_ACPI_PKT3 (3) /* ACPI interesting packet */
88244 + /* detected. */
88245 +
88246 +/*
88247 + * --- ETH_TX_COMPL_STATUS_ENUM ---
88248 + * Status codes contained in Ethernet TX completion descriptors.
88249 + */
88250 +#define ETH_COMP_VALID (0)
88251 +#define ETH_COMP_ERROR (1)
88252 +#define ETH_COMP_INVALID (15)
88253 +
88254 +/*
88255 + * --- ETH_TX_COMPL_PORT_ENUM ---
88256 + * Port indicator contained in Ethernet TX completion descriptors.
88257 + */
88258 +#define ETH_COMP_PORT0 (0)
88259 +#define ETH_COMP_PORT1 (1)
88260 +#define ETH_COMP_MGMT (2)
88261 +
88262 +/*
88263 + * --- ETH_TX_COMPL_CT_ENUM ---
88264 + * Completion type indicator contained in Ethernet TX completion descriptors.
88265 + */
88266 +#define ETH_COMP_ETH (0)
88267 +
88268 +/*
88269 + * Work request block that the driver issues to the chip for
88270 + * Ethernet transmissions. All control fields must be valid in each WRB for
88271 + * a message. The controller, as specified by the flags, optionally writes
88272 + * an entry to the Completion Ring and generate an event.
88273 + */
88274 +struct BE_ETH_WRB_AMAP {
88275 + u8 frag_pa_hi[32]; /* DWORD 0 */
88276 + u8 frag_pa_lo[32]; /* DWORD 1 */
88277 + u8 complete; /* DWORD 2 */
88278 + u8 event; /* DWORD 2 */
88279 + u8 crc; /* DWORD 2 */
88280 + u8 forward; /* DWORD 2 */
88281 + u8 ipsec; /* DWORD 2 */
88282 + u8 mgmt; /* DWORD 2 */
88283 + u8 ipcs; /* DWORD 2 */
88284 + u8 udpcs; /* DWORD 2 */
88285 + u8 tcpcs; /* DWORD 2 */
88286 + u8 lso; /* DWORD 2 */
88287 + u8 last; /* DWORD 2 */
88288 + u8 vlan; /* DWORD 2 */
88289 + u8 dbg[3]; /* DWORD 2 */
88290 + u8 hash_val[3]; /* DWORD 2 */
88291 + u8 lso_mss[14]; /* DWORD 2 */
88292 + u8 frag_len[16]; /* DWORD 3 */
88293 + u8 vlan_tag[16]; /* DWORD 3 */
88294 +} __packed;
88295 +struct ETH_WRB_AMAP {
88296 + u32 dw[4];
88297 +};
88298 +
88299 +/* This is an Ethernet transmit completion descriptor */
88300 +struct BE_ETH_TX_COMPL_AMAP {
88301 + u8 user_bytes[16]; /* DWORD 0 */
88302 + u8 nwh_bytes[8]; /* DWORD 0 */
88303 + u8 lso; /* DWORD 0 */
88304 + u8 rsvd0[7]; /* DWORD 0 */
88305 + u8 wrb_index[16]; /* DWORD 1 */
88306 + u8 ct[2]; /* DWORD 1 */
88307 + u8 port[2]; /* DWORD 1 */
88308 + u8 rsvd1[8]; /* DWORD 1 */
88309 + u8 status[4]; /* DWORD 1 */
88310 + u8 rsvd2[16]; /* DWORD 2 */
88311 + u8 ringid[11]; /* DWORD 2 */
88312 + u8 hash_val[4]; /* DWORD 2 */
88313 + u8 valid; /* DWORD 2 */
88314 + u8 rsvd3[32]; /* DWORD 3 */
88315 +} __packed;
88316 +struct ETH_TX_COMPL_AMAP {
88317 + u32 dw[4];
88318 +};
88319 +
88320 +/* Ethernet Receive Buffer descriptor */
88321 +struct BE_ETH_RX_D_AMAP {
88322 + u8 fragpa_hi[32]; /* DWORD 0 */
88323 + u8 fragpa_lo[32]; /* DWORD 1 */
88324 +} __packed;
88325 +struct ETH_RX_D_AMAP {
88326 + u32 dw[2];
88327 +};
88328 +
88329 +/* This is an Ethernet Receive Completion Descriptor */
88330 +struct BE_ETH_RX_COMPL_AMAP {
88331 + u8 vlan_tag[16]; /* DWORD 0 */
88332 + u8 pktsize[14]; /* DWORD 0 */
88333 + u8 port; /* DWORD 0 */
88334 + u8 rsvd0; /* DWORD 0 */
88335 + u8 err; /* DWORD 1 */
88336 + u8 rsshp; /* DWORD 1 */
88337 + u8 ipf; /* DWORD 1 */
88338 + u8 tcpf; /* DWORD 1 */
88339 + u8 udpf; /* DWORD 1 */
88340 + u8 ipcksm; /* DWORD 1 */
88341 + u8 tcpcksm; /* DWORD 1 */
88342 + u8 udpcksm; /* DWORD 1 */
88343 + u8 macdst[6]; /* DWORD 1 */
88344 + u8 vtp; /* DWORD 1 */
88345 + u8 vtm; /* DWORD 1 */
88346 + u8 fragndx[10]; /* DWORD 1 */
88347 + u8 ct[2]; /* DWORD 1 */
88348 + u8 ipsec; /* DWORD 1 */
88349 + u8 numfrags[3]; /* DWORD 1 */
88350 + u8 rsvd1[31]; /* DWORD 2 */
88351 + u8 valid; /* DWORD 2 */
88352 + u8 rsshash[32]; /* DWORD 3 */
88353 +} __packed;
88354 +struct ETH_RX_COMPL_AMAP {
88355 + u32 dw[4];
88356 +};
88357 +
88358 +#endif /* __host_struct_amap_h__ */
88359 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/hwlib.h linux-2.6.29-rc3.owrt/drivers/staging/benet/hwlib.h
88360 --- linux-2.6.29.owrt/drivers/staging/benet/hwlib.h 1970-01-01 01:00:00.000000000 +0100
88361 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/hwlib.h 2009-05-10 23:48:29.000000000 +0200
88362 @@ -0,0 +1,830 @@
88363 +/*
88364 + * Copyright (C) 2005 - 2008 ServerEngines
88365 + * All rights reserved.
88366 + *
88367 + * This program is free software; you can redistribute it and/or
88368 + * modify it under the terms of the GNU General Public License version 2
88369 + * as published by the Free Software Foundation. The full GNU General
88370 + * Public License is included in this distribution in the file called COPYING.
88371 + *
88372 + * Contact Information:
88373 + * linux-drivers@serverengines.com
88374 + *
88375 + * ServerEngines
88376 + * 209 N. Fair Oaks Ave
88377 + * Sunnyvale, CA 94085
88378 + */
88379 +#ifndef __hwlib_h__
88380 +#define __hwlib_h__
88381 +
88382 +#include <linux/module.h>
88383 +#include <linux/io.h>
88384 +#include <linux/list.h>
88385 +#include <linux/spinlock.h>
88386 +
88387 +#include "regmap.h" /* srcgen array map output */
88388 +
88389 +#include "asyncmesg.h"
88390 +#include "fwcmd_opcodes.h"
88391 +#include "post_codes.h"
88392 +#include "fwcmd_mcc.h"
88393 +
88394 +#include "fwcmd_types_bmap.h"
88395 +#include "fwcmd_common_bmap.h"
88396 +#include "fwcmd_eth_bmap.h"
88397 +#include "bestatus.h"
88398 +/*
88399 + *
88400 + * Macros for reading/writing a protection domain or CSR registers
88401 + * in BladeEngine.
88402 + */
88403 +#define PD_READ(fo, field) ioread32((fo)->db_va + \
88404 + offsetof(struct BE_PROTECTION_DOMAIN_DBMAP_AMAP, field)/8)
88405 +
88406 +#define PD_WRITE(fo, field, val) iowrite32(val, (fo)->db_va + \
88407 + offsetof(struct BE_PROTECTION_DOMAIN_DBMAP_AMAP, field)/8)
88408 +
88409 +#define CSR_READ(fo, field) ioread32((fo)->csr_va + \
88410 + offsetof(struct BE_BLADE_ENGINE_CSRMAP_AMAP, field)/8)
88411 +
88412 +#define CSR_WRITE(fo, field, val) iowrite32(val, (fo)->csr_va + \
88413 + offsetof(struct BE_BLADE_ENGINE_CSRMAP_AMAP, field)/8)
88414 +
88415 +#define PCICFG0_READ(fo, field) ioread32((fo)->pci_va + \
88416 + offsetof(struct BE_PCICFG0_CSRMAP_AMAP, field)/8)
88417 +
88418 +#define PCICFG0_WRITE(fo, field, val) iowrite32(val, (fo)->pci_va + \
88419 + offsetof(struct BE_PCICFG0_CSRMAP_AMAP, field)/8)
88420 +
88421 +#define PCICFG1_READ(fo, field) ioread32((fo)->pci_va + \
88422 + offsetof(struct BE_PCICFG1_CSRMAP_AMAP, field)/8)
88423 +
88424 +#define PCICFG1_WRITE(fo, field, val) iowrite32(val, (fo)->pci_va + \
88425 + offsetof(struct BE_PCICFG1_CSRMAP_AMAP, field)/8)
88426 +
88427 +#ifdef BE_DEBUG
88428 +#define ASSERT(c) BUG_ON(!(c));
88429 +#else
88430 +#define ASSERT(c)
88431 +#endif
88432 +
88433 +/* debug levels */
88434 +enum BE_DEBUG_LEVELS {
88435 + DL_ALWAYS = 0, /* cannot be masked */
88436 + DL_ERR = 0x1, /* errors that should never happen */
88437 + DL_WARN = 0x2, /* something questionable.
88438 + recoverable errors */
88439 + DL_NOTE = 0x4, /* infrequent, important debug info */
88440 + DL_INFO = 0x8, /* debug information */
88441 + DL_VERBOSE = 0x10, /* detailed info, such as buffer traces */
88442 + BE_DL_MIN_VALUE = 0x1, /* this is the min value used */
88443 + BE_DL_MAX_VALUE = 0x80 /* this is the higheset value used */
88444 +} ;
88445 +
88446 +extern unsigned int trace_level;
88447 +
88448 +#define TRACE(lm, fmt, args...) { \
88449 + if (trace_level & lm) { \
88450 + printk(KERN_NOTICE "BE: %s:%d \n" fmt, \
88451 + __FILE__ , __LINE__ , ## args); \
88452 + } \
88453 + }
88454 +
88455 +static inline unsigned int be_trace_set_level(unsigned int level)
88456 +{
88457 + unsigned int old_level = trace_level;
88458 + trace_level = level;
88459 + return old_level;
88460 +}
88461 +
88462 +#define be_trace_get_level() trace_level
88463 +/*
88464 + * Returns number of pages spanned by the size of data
88465 + * starting at the given address.
88466 + */
88467 +#define PAGES_SPANNED(_address, _size) \
88468 + ((u32)((((size_t)(_address) & (PAGE_SIZE - 1)) + \
88469 + (_size) + (PAGE_SIZE - 1)) >> PAGE_SHIFT))
88470 +/* Byte offset into the page corresponding to given address */
88471 +#define OFFSET_IN_PAGE(_addr_) ((size_t)(_addr_) & (PAGE_SIZE-1))
88472 +
88473 +/*
88474 + * circular subtract.
88475 + * Returns a - b assuming a circular number system, where a and b are
88476 + * in range (0, maxValue-1). If a==b, zero is returned so the
88477 + * highest value possible with this subtraction is maxValue-1.
88478 + */
88479 +static inline u32 be_subc(u32 a, u32 b, u32 max)
88480 +{
88481 + ASSERT(a <= max && b <= max);
88482 + ASSERT(max > 0);
88483 + return a >= b ? (a - b) : (max - b + a);
88484 +}
88485 +
88486 +static inline u32 be_addc(u32 a, u32 b, u32 max)
88487 +{
88488 + ASSERT(a < max);
88489 + ASSERT(max > 0);
88490 + return (max - a > b) ? (a + b) : (b + a - max);
88491 +}
88492 +
88493 +/* descriptor for a physically contiguous memory used for ring */
88494 +struct ring_desc {
88495 + u32 length; /* length in bytes */
88496 + void *va; /* virtual address */
88497 + u64 pa; /* bus address */
88498 +} ;
88499 +
88500 +/*
88501 + * This structure stores information about a ring shared between hardware
88502 + * and software. Each ring is allocated by the driver in the uncached
88503 + * extension and mapped into BladeEngine's unified table.
88504 + */
88505 +struct mp_ring {
88506 + u32 pages; /* queue size in pages */
88507 + u32 id; /* queue id assigned by beklib */
88508 + u32 num; /* number of elements in queue */
88509 + u32 cidx; /* consumer index */
88510 + u32 pidx; /* producer index -- not used by most rings */
88511 + u32 itemSize; /* size in bytes of one object */
88512 +
88513 + void *va; /* The virtual address of the ring.
88514 + This should be last to allow 32 & 64
88515 + bit debugger extensions to work. */
88516 +} ;
88517 +
88518 +/*----------- amap bit filed get / set macros and functions -----*/
88519 +/*
88520 + * Structures defined in the map header files (under fw/amap/) with names
88521 + * in the format BE_<name>_AMAP are pseudo structures with members
88522 + * of type u8. These structures are templates that are used in
88523 + * conjuntion with the structures with names in the format
88524 + * <name>_AMAP to calculate the bit masks and bit offsets to get or set
88525 + * bit fields in structures. The structures <name>_AMAP are arrays
88526 + * of 32 bits words and have the correct size. The following macros
88527 + * provide convenient ways to get and set the various members
88528 + * in the structures without using strucctures with bit fields.
88529 + * Always use the macros AMAP_GET_BITS_PTR and AMAP_SET_BITS_PTR
88530 + * macros to extract and set various members.
88531 + */
88532 +
88533 +/*
88534 + * Returns the a bit mask for the register that is NOT shifted into location.
88535 + * That means return values always look like: 0x1, 0xFF, 0x7FF, etc...
88536 + */
88537 +static inline u32 amap_mask(u32 bit_size)
88538 +{
88539 + return bit_size == 32 ? 0xFFFFFFFF : (1 << bit_size) - 1;
88540 +}
88541 +
88542 +#define AMAP_BIT_MASK(_struct_, field) \
88543 + amap_mask(AMAP_BIT_SIZE(_struct_, field))
88544 +
88545 +/*
88546 + * non-optimized set bits function. First clears the bits and then assigns them.
88547 + * This does not require knowledge of the particular DWORD you are setting.
88548 + * e.g. AMAP_SET_BITS_PTR (struct, field1, &contextMemory, 123);
88549 + */
88550 +static inline void
88551 +amap_set(void *ptr, u32 dw_offset, u32 mask, u32 offset, u32 value)
88552 +{
88553 + u32 *dw = (u32 *)ptr;
88554 + *(dw + dw_offset) &= ~(mask << offset);
88555 + *(dw + dw_offset) |= (mask & value) << offset;
88556 +}
88557 +
88558 +#define AMAP_SET_BITS_PTR(_struct_, field, _structPtr_, val) \
88559 + amap_set(_structPtr_, AMAP_WORD_OFFSET(_struct_, field),\
88560 + AMAP_BIT_MASK(_struct_, field), \
88561 + AMAP_BIT_OFFSET(_struct_, field), val)
88562 +/*
88563 + * Non-optimized routine that gets the bits without knowing the correct DWORD.
88564 + * e.g. fieldValue = AMAP_GET_BITS_PTR (struct, field1, &contextMemory);
88565 + */
88566 +static inline u32
88567 +amap_get(void *ptr, u32 dw_offset, u32 mask, u32 offset)
88568 +{
88569 + u32 *dw = (u32 *)ptr;
88570 + return mask & (*(dw + dw_offset) >> offset);
88571 +}
88572 +#define AMAP_GET_BITS_PTR(_struct_, field, _structPtr_) \
88573 + amap_get(_structPtr_, AMAP_WORD_OFFSET(_struct_, field), \
88574 + AMAP_BIT_MASK(_struct_, field), \
88575 + AMAP_BIT_OFFSET(_struct_, field))
88576 +
88577 +/* Returns 0-31 representing bit offset within a DWORD of a bitfield. */
88578 +#define AMAP_BIT_OFFSET(_struct_, field) \
88579 + (offsetof(struct BE_ ## _struct_ ## _AMAP, field) % 32)
88580 +
88581 +/* Returns 0-n representing DWORD offset of bitfield within the structure. */
88582 +#define AMAP_WORD_OFFSET(_struct_, field) \
88583 + (offsetof(struct BE_ ## _struct_ ## _AMAP, field)/32)
88584 +
88585 +/* Returns size of bitfield in bits. */
88586 +#define AMAP_BIT_SIZE(_struct_, field) \
88587 + sizeof(((struct BE_ ## _struct_ ## _AMAP*)0)->field)
88588 +
88589 +struct be_mcc_wrb_response_copy {
88590 + u16 length; /* bytes in response */
88591 + u16 fwcmd_offset; /* offset within the wrb of the response */
88592 + void *va; /* user's va to copy response into */
88593 +
88594 +} ;
88595 +typedef void (*mcc_wrb_cqe_callback) (void *context, int status,
88596 + struct MCC_WRB_AMAP *optional_wrb);
88597 +struct be_mcc_wrb_context {
88598 +
88599 + mcc_wrb_cqe_callback internal_cb; /* Function to call on
88600 + completion */
88601 + void *internal_cb_context; /* Parameter to pass
88602 + to completion function */
88603 +
88604 + mcc_wrb_cqe_callback cb; /* Function to call on completion */
88605 + void *cb_context; /* Parameter to pass to completion function */
88606 +
88607 + int *users_final_status; /* pointer to a local
88608 + variable for synchronous
88609 + commands */
88610 + struct MCC_WRB_AMAP *wrb; /* pointer to original wrb for embedded
88611 + commands only */
88612 + struct list_head next; /* links context structs together in
88613 + free list */
88614 +
88615 + struct be_mcc_wrb_response_copy copy; /* Optional parameters to copy
88616 + embedded response to user's va */
88617 +
88618 +#if defined(BE_DEBUG)
88619 + u16 subsystem, opcode; /* Track this FWCMD for debug builds. */
88620 + struct MCC_WRB_AMAP *ring_wrb;
88621 + u32 consumed_count;
88622 +#endif
88623 +} ;
88624 +
88625 +/*
88626 + Represents a function object for network or storage. This
88627 + is used to manage per-function resources like MCC CQs, etc.
88628 +*/
88629 +struct be_function_object {
88630 +
88631 + u32 magic; /*!< magic for detecting memory corruption. */
88632 +
88633 + /* PCI BAR mapped addresses */
88634 + u8 __iomem *csr_va; /* CSR */
88635 + u8 __iomem *db_va; /* Door Bell */
88636 + u8 __iomem *pci_va; /* PCI config space */
88637 + u32 emulate; /* if set, MPU is not available.
88638 + Emulate everything. */
88639 + u32 pend_queue_driving; /* if set, drive the queued WRBs
88640 + after releasing the WRB lock */
88641 +
88642 + spinlock_t post_lock; /* lock for verifying one thread posting wrbs */
88643 + spinlock_t cq_lock; /* lock for verifying one thread
88644 + processing cq */
88645 + spinlock_t mcc_context_lock; /* lock for protecting mcc
88646 + context free list */
88647 + unsigned long post_irq;
88648 + unsigned long cq_irq;
88649 +
88650 + u32 type;
88651 + u32 pci_function_number;
88652 +
88653 + struct be_mcc_object *mcc; /* mcc rings. */
88654 +
88655 + struct {
88656 + struct MCC_MAILBOX_AMAP *va; /* VA to the mailbox */
88657 + u64 pa; /* PA to the mailbox */
88658 + u32 length; /* byte length of mailbox */
88659 +
88660 + /* One default context struct used for posting at
88661 + * least one MCC_WRB
88662 + */
88663 + struct be_mcc_wrb_context default_context;
88664 + bool default_context_allocated;
88665 + } mailbox;
88666 +
88667 + struct {
88668 +
88669 + /* Wake on lans configured. */
88670 + u32 wol_bitmask; /* bits 0,1,2,3 are set if
88671 + corresponding index is enabled */
88672 + } config;
88673 +
88674 +
88675 + struct BE_FIRMWARE_CONFIG fw_config;
88676 +} ;
88677 +
88678 +/*
88679 + Represents an Event Queue
88680 +*/
88681 +struct be_eq_object {
88682 + u32 magic;
88683 + atomic_t ref_count;
88684 +
88685 + struct be_function_object *parent_function;
88686 +
88687 + struct list_head eq_list;
88688 + struct list_head cq_list_head;
88689 +
88690 + u32 eq_id;
88691 + void *cb_context;
88692 +
88693 +} ;
88694 +
88695 +/*
88696 + Manages a completion queue
88697 +*/
88698 +struct be_cq_object {
88699 + u32 magic;
88700 + atomic_t ref_count;
88701 +
88702 + struct be_function_object *parent_function;
88703 + struct be_eq_object *eq_object;
88704 +
88705 + struct list_head cq_list;
88706 + struct list_head cqlist_for_eq;
88707 +
88708 + void *va;
88709 + u32 num_entries;
88710 +
88711 + void *cb_context;
88712 +
88713 + u32 cq_id;
88714 +
88715 +} ;
88716 +
88717 +/*
88718 + Manages an ethernet send queue
88719 +*/
88720 +struct be_ethsq_object {
88721 + u32 magic;
88722 +
88723 + struct list_head list;
88724 +
88725 + struct be_function_object *parent_function;
88726 + struct be_cq_object *cq_object;
88727 + u32 bid;
88728 +
88729 +} ;
88730 +
88731 +/*
88732 +@brief
88733 + Manages an ethernet receive queue
88734 +*/
88735 +struct be_ethrq_object {
88736 + u32 magic;
88737 + struct list_head list;
88738 + struct be_function_object *parent_function;
88739 + u32 rid;
88740 + struct be_cq_object *cq_object;
88741 + struct be_cq_object *rss_cq_object[4];
88742 +
88743 +} ;
88744 +
88745 +/*
88746 + Manages an MCC
88747 +*/
88748 +typedef void (*mcc_async_event_callback) (void *context, u32 event_code,
88749 + void *event);
88750 +struct be_mcc_object {
88751 + u32 magic;
88752 +
88753 + struct be_function_object *parent_function;
88754 + struct list_head mcc_list;
88755 +
88756 + struct be_cq_object *cq_object;
88757 +
88758 + /* Async event callback for MCC CQ. */
88759 + mcc_async_event_callback async_cb;
88760 + void *async_context;
88761 +
88762 + struct {
88763 + struct be_mcc_wrb_context *base;
88764 + u32 num;
88765 + struct list_head list_head;
88766 + } wrb_context;
88767 +
88768 + struct {
88769 + struct ring_desc *rd;
88770 + struct mp_ring ring;
88771 + } sq;
88772 +
88773 + struct {
88774 + struct mp_ring ring;
88775 + } cq;
88776 +
88777 + u32 processing; /* flag indicating that one thread
88778 + is processing CQ */
88779 + u32 rearm; /* doorbell rearm setting to make
88780 + sure the active processing thread */
88781 + /* rearms the CQ if any of the threads requested it. */
88782 +
88783 + struct list_head backlog;
88784 + u32 backlog_length;
88785 + u32 driving_backlog;
88786 + u32 consumed_index;
88787 +
88788 +} ;
88789 +
88790 +
88791 +/* Queue context header -- the required software information for
88792 + * queueing a WRB.
88793 + */
88794 +struct be_queue_driver_context {
88795 + mcc_wrb_cqe_callback internal_cb; /* Function to call on
88796 + completion */
88797 + void *internal_cb_context; /* Parameter to pass
88798 + to completion function */
88799 +
88800 + mcc_wrb_cqe_callback cb; /* Function to call on completion */
88801 + void *cb_context; /* Parameter to pass to completion function */
88802 +
88803 + struct be_mcc_wrb_response_copy copy; /* Optional parameters to copy
88804 + embedded response to user's va */
88805 + void *optional_fwcmd_va;
88806 + struct list_head list;
88807 + u32 bytes;
88808 +} ;
88809 +
88810 +/*
88811 + * Common MCC WRB header that all commands require.
88812 + */
88813 +struct be_mcc_wrb_header {
88814 + u8 rsvd[offsetof(struct BE_MCC_WRB_AMAP, payload)/8];
88815 +} ;
88816 +
88817 +/*
88818 + * All non embedded commands supported by hwlib functions only allow
88819 + * 1 SGE. This queue context handles them all.
88820 + */
88821 +struct be_nonembedded_q_ctxt {
88822 + struct be_queue_driver_context context;
88823 + struct be_mcc_wrb_header wrb_header;
88824 + struct MCC_SGE_AMAP sge[1];
88825 +} ;
88826 +
88827 +/*
88828 + * ------------------------------------------------------------------------
88829 + * This section contains the specific queue struct for each command.
88830 + * The user could always provide a be_generic_q_ctxt but this is a
88831 + * rather large struct. By using the specific struct, memory consumption
88832 + * can be reduced.
88833 + * ------------------------------------------------------------------------
88834 + */
88835 +
88836 +struct be_link_status_q_ctxt {
88837 + struct be_queue_driver_context context;
88838 + struct be_mcc_wrb_header wrb_header;
88839 + struct FWCMD_COMMON_NTWK_LINK_STATUS_QUERY fwcmd;
88840 +} ;
88841 +
88842 +struct be_multicast_q_ctxt {
88843 + struct be_queue_driver_context context;
88844 + struct be_mcc_wrb_header wrb_header;
88845 + struct FWCMD_COMMON_NTWK_MULTICAST_SET fwcmd;
88846 +} ;
88847 +
88848 +
88849 +struct be_vlan_q_ctxt {
88850 + struct be_queue_driver_context context;
88851 + struct be_mcc_wrb_header wrb_header;
88852 + struct FWCMD_COMMON_NTWK_VLAN_CONFIG fwcmd;
88853 +} ;
88854 +
88855 +struct be_promiscuous_q_ctxt {
88856 + struct be_queue_driver_context context;
88857 + struct be_mcc_wrb_header wrb_header;
88858 + struct FWCMD_ETH_PROMISCUOUS fwcmd;
88859 +} ;
88860 +
88861 +struct be_force_failover_q_ctxt {
88862 + struct be_queue_driver_context context;
88863 + struct be_mcc_wrb_header wrb_header;
88864 + struct FWCMD_COMMON_FORCE_FAILOVER fwcmd;
88865 +} ;
88866 +
88867 +
88868 +struct be_rxf_filter_q_ctxt {
88869 + struct be_queue_driver_context context;
88870 + struct be_mcc_wrb_header wrb_header;
88871 + struct FWCMD_COMMON_NTWK_RX_FILTER fwcmd;
88872 +} ;
88873 +
88874 +struct be_eq_modify_delay_q_ctxt {
88875 + struct be_queue_driver_context context;
88876 + struct be_mcc_wrb_header wrb_header;
88877 + struct FWCMD_COMMON_MODIFY_EQ_DELAY fwcmd;
88878 +} ;
88879 +
88880 +/*
88881 + * The generic context is the largest size that would be required.
88882 + * It is the software context plus an entire WRB.
88883 + */
88884 +struct be_generic_q_ctxt {
88885 + struct be_queue_driver_context context;
88886 + struct be_mcc_wrb_header wrb_header;
88887 + struct MCC_WRB_PAYLOAD_AMAP payload;
88888 +} ;
88889 +
88890 +/*
88891 + * Types for the BE_QUEUE_CONTEXT object.
88892 + */
88893 +#define BE_QUEUE_INVALID (0)
88894 +#define BE_QUEUE_LINK_STATUS (0xA006)
88895 +#define BE_QUEUE_ETH_STATS (0xA007)
88896 +#define BE_QUEUE_TPM_STATS (0xA008)
88897 +#define BE_QUEUE_TCP_STATS (0xA009)
88898 +#define BE_QUEUE_MULTICAST (0xA00A)
88899 +#define BE_QUEUE_VLAN (0xA00B)
88900 +#define BE_QUEUE_RSS (0xA00C)
88901 +#define BE_QUEUE_FORCE_FAILOVER (0xA00D)
88902 +#define BE_QUEUE_PROMISCUOUS (0xA00E)
88903 +#define BE_QUEUE_WAKE_ON_LAN (0xA00F)
88904 +#define BE_QUEUE_NOP (0xA010)
88905 +
88906 +/* --- BE_FUNCTION_ENUM --- */
88907 +#define BE_FUNCTION_TYPE_ISCSI (0)
88908 +#define BE_FUNCTION_TYPE_NETWORK (1)
88909 +#define BE_FUNCTION_TYPE_ARM (2)
88910 +
88911 +/* --- BE_ETH_TX_RING_TYPE_ENUM --- */
88912 +#define BE_ETH_TX_RING_TYPE_FORWARDING (1) /* Ether ring for forwarding */
88913 +#define BE_ETH_TX_RING_TYPE_STANDARD (2) /* Ether ring for sending */
88914 + /* network packets. */
88915 +#define BE_ETH_TX_RING_TYPE_BOUND (3) /* Ethernet ring for sending */
88916 + /* network packets, bound */
88917 + /* to a physical port. */
88918 +/*
88919 + * ----------------------------------------------------------------------
88920 + * API MACROS
88921 + * ----------------------------------------------------------------------
88922 + */
88923 +#define BE_FWCMD_NAME(_short_name_) struct FWCMD_##_short_name_
88924 +#define BE_OPCODE_NAME(_short_name_) OPCODE_##_short_name_
88925 +#define BE_SUBSYSTEM_NAME(_short_name_) SUBSYSTEM_##_short_name_
88926 +
88927 +
88928 +#define BE_PREPARE_EMBEDDED_FWCMD(_pfob_, _wrb_, _short_name_) \
88929 + ((BE_FWCMD_NAME(_short_name_) *) \
88930 + be_function_prepare_embedded_fwcmd(_pfob_, _wrb_, \
88931 + sizeof(BE_FWCMD_NAME(_short_name_)), \
88932 + FIELD_SIZEOF(BE_FWCMD_NAME(_short_name_), params.request), \
88933 + FIELD_SIZEOF(BE_FWCMD_NAME(_short_name_), params.response), \
88934 + BE_OPCODE_NAME(_short_name_), \
88935 + BE_SUBSYSTEM_NAME(_short_name_)));
88936 +
88937 +#define BE_PREPARE_NONEMBEDDED_FWCMD(_pfob_, _wrb_, _iva_, _ipa_, _short_name_)\
88938 + ((BE_FWCMD_NAME(_short_name_) *) \
88939 + be_function_prepare_nonembedded_fwcmd(_pfob_, _wrb_, (_iva_), (_ipa_), \
88940 + sizeof(BE_FWCMD_NAME(_short_name_)), \
88941 + FIELD_SIZEOF(BE_FWCMD_NAME(_short_name_), params.request), \
88942 + FIELD_SIZEOF(BE_FWCMD_NAME(_short_name_), params.response), \
88943 + BE_OPCODE_NAME(_short_name_), \
88944 + BE_SUBSYSTEM_NAME(_short_name_)));
88945 +
88946 +int be_function_object_create(u8 __iomem *csr_va, u8 __iomem *db_va,
88947 + u8 __iomem *pci_va, u32 function_type, struct ring_desc *mailbox_rd,
88948 + struct be_function_object *pfob);
88949 +
88950 +int be_function_object_destroy(struct be_function_object *pfob);
88951 +int be_function_cleanup(struct be_function_object *pfob);
88952 +
88953 +
88954 +int be_function_get_fw_version(struct be_function_object *pfob,
88955 + struct FWCMD_COMMON_GET_FW_VERSION_RESPONSE_PAYLOAD *fw_version,
88956 + mcc_wrb_cqe_callback cb, void *cb_context);
88957 +
88958 +
88959 +int be_eq_modify_delay(struct be_function_object *pfob,
88960 + u32 num_eq, struct be_eq_object **eq_array,
88961 + u32 *eq_delay_array, mcc_wrb_cqe_callback cb,
88962 + void *cb_context,
88963 + struct be_eq_modify_delay_q_ctxt *q_ctxt);
88964 +
88965 +
88966 +
88967 +int be_eq_create(struct be_function_object *pfob,
88968 + struct ring_desc *rd, u32 eqe_size, u32 num_entries,
88969 + u32 watermark, u32 timer_delay, struct be_eq_object *eq_object);
88970 +
88971 +int be_eq_destroy(struct be_eq_object *eq);
88972 +
88973 +int be_cq_create(struct be_function_object *pfob,
88974 + struct ring_desc *rd, u32 length,
88975 + bool solicited_eventable, bool no_delay,
88976 + u32 wm_thresh, struct be_eq_object *eq_object,
88977 + struct be_cq_object *cq_object);
88978 +
88979 +int be_cq_destroy(struct be_cq_object *cq);
88980 +
88981 +int be_mcc_ring_create(struct be_function_object *pfob,
88982 + struct ring_desc *rd, u32 length,
88983 + struct be_mcc_wrb_context *context_array,
88984 + u32 num_context_entries,
88985 + struct be_cq_object *cq, struct be_mcc_object *mcc);
88986 +int be_mcc_ring_destroy(struct be_mcc_object *mcc_object);
88987 +
88988 +int be_mcc_process_cq(struct be_mcc_object *mcc_object, bool rearm);
88989 +
88990 +int be_mcc_add_async_event_callback(struct be_mcc_object *mcc_object,
88991 + mcc_async_event_callback cb, void *cb_context);
88992 +
88993 +int be_pci_soft_reset(struct be_function_object *pfob);
88994 +
88995 +
88996 +int be_drive_POST(struct be_function_object *pfob);
88997 +
88998 +
88999 +int be_eth_sq_create(struct be_function_object *pfob,
89000 + struct ring_desc *rd, u32 length_in_bytes,
89001 + u32 type, u32 ulp, struct be_cq_object *cq_object,
89002 + struct be_ethsq_object *eth_sq);
89003 +
89004 +struct be_eth_sq_parameters {
89005 + u32 port;
89006 + u32 rsvd0[2];
89007 +} ;
89008 +
89009 +int be_eth_sq_create_ex(struct be_function_object *pfob,
89010 + struct ring_desc *rd, u32 length_in_bytes,
89011 + u32 type, u32 ulp, struct be_cq_object *cq_object,
89012 + struct be_eth_sq_parameters *ex_parameters,
89013 + struct be_ethsq_object *eth_sq);
89014 +int be_eth_sq_destroy(struct be_ethsq_object *eth_sq);
89015 +
89016 +int be_eth_set_flow_control(struct be_function_object *pfob,
89017 + bool txfc_enable, bool rxfc_enable);
89018 +
89019 +int be_eth_get_flow_control(struct be_function_object *pfob,
89020 + bool *txfc_enable, bool *rxfc_enable);
89021 +int be_eth_set_qos(struct be_function_object *pfob, u32 max_bps, u32 max_pps);
89022 +
89023 +int be_eth_get_qos(struct be_function_object *pfob, u32 *max_bps, u32 *max_pps);
89024 +
89025 +int be_eth_set_frame_size(struct be_function_object *pfob,
89026 + u32 *tx_frame_size, u32 *rx_frame_size);
89027 +
89028 +int be_eth_rq_create(struct be_function_object *pfob,
89029 + struct ring_desc *rd, struct be_cq_object *cq_object,
89030 + struct be_cq_object *bcmc_cq_object,
89031 + struct be_ethrq_object *eth_rq);
89032 +
89033 +int be_eth_rq_destroy(struct be_ethrq_object *eth_rq);
89034 +
89035 +int be_eth_rq_destroy_options(struct be_ethrq_object *eth_rq, bool flush,
89036 + mcc_wrb_cqe_callback cb, void *cb_context);
89037 +int be_eth_rq_set_frag_size(struct be_function_object *pfob,
89038 + u32 new_frag_size_bytes, u32 *actual_frag_size_bytes);
89039 +int be_eth_rq_get_frag_size(struct be_function_object *pfob,
89040 + u32 *frag_size_bytes);
89041 +
89042 +void *be_function_prepare_embedded_fwcmd(struct be_function_object *pfob,
89043 + struct MCC_WRB_AMAP *wrb,
89044 + u32 payload_length, u32 request_length,
89045 + u32 response_length, u32 opcode, u32 subsystem);
89046 +void *be_function_prepare_nonembedded_fwcmd(struct be_function_object *pfob,
89047 + struct MCC_WRB_AMAP *wrb, void *fwcmd_header_va, u64 fwcmd_header_pa,
89048 + u32 payload_length, u32 request_length, u32 response_length,
89049 + u32 opcode, u32 subsystem);
89050 +
89051 +
89052 +struct MCC_WRB_AMAP *
89053 +be_function_peek_mcc_wrb(struct be_function_object *pfob);
89054 +
89055 +int be_rxf_mac_address_read_write(struct be_function_object *pfob,
89056 + bool port1, bool mac1, bool mgmt,
89057 + bool write, bool permanent, u8 *mac_address,
89058 + mcc_wrb_cqe_callback cb,
89059 + void *cb_context);
89060 +
89061 +int be_rxf_multicast_config(struct be_function_object *pfob,
89062 + bool promiscuous, u32 num, u8 *mac_table,
89063 + mcc_wrb_cqe_callback cb,
89064 + void *cb_context,
89065 + struct be_multicast_q_ctxt *q_ctxt);
89066 +
89067 +int be_rxf_vlan_config(struct be_function_object *pfob,
89068 + bool promiscuous, u32 num, u16 *vlan_tag_array,
89069 + mcc_wrb_cqe_callback cb, void *cb_context,
89070 + struct be_vlan_q_ctxt *q_ctxt);
89071 +
89072 +
89073 +int be_rxf_link_status(struct be_function_object *pfob,
89074 + struct BE_LINK_STATUS *link_status,
89075 + mcc_wrb_cqe_callback cb,
89076 + void *cb_context,
89077 + struct be_link_status_q_ctxt *q_ctxt);
89078 +
89079 +
89080 +int be_rxf_query_eth_statistics(struct be_function_object *pfob,
89081 + struct FWCMD_ETH_GET_STATISTICS *va_for_fwcmd,
89082 + u64 pa_for_fwcmd, mcc_wrb_cqe_callback cb,
89083 + void *cb_context,
89084 + struct be_nonembedded_q_ctxt *q_ctxt);
89085 +
89086 +int be_rxf_promiscuous(struct be_function_object *pfob,
89087 + bool enable_port0, bool enable_port1,
89088 + mcc_wrb_cqe_callback cb, void *cb_context,
89089 + struct be_promiscuous_q_ctxt *q_ctxt);
89090 +
89091 +
89092 +int be_rxf_filter_config(struct be_function_object *pfob,
89093 + struct NTWK_RX_FILTER_SETTINGS *settings,
89094 + mcc_wrb_cqe_callback cb,
89095 + void *cb_context,
89096 + struct be_rxf_filter_q_ctxt *q_ctxt);
89097 +
89098 +/*
89099 + * ------------------------------------------------------
89100 + * internal functions used by hwlib
89101 + * ------------------------------------------------------
89102 + */
89103 +
89104 +
89105 +int be_function_ring_destroy(struct be_function_object *pfob,
89106 + u32 id, u32 ring_type, mcc_wrb_cqe_callback cb,
89107 + void *cb_context,
89108 + mcc_wrb_cqe_callback internal_cb,
89109 + void *internal_callback_context);
89110 +
89111 +int be_function_post_mcc_wrb(struct be_function_object *pfob,
89112 + struct MCC_WRB_AMAP *wrb,
89113 + struct be_generic_q_ctxt *q_ctxt,
89114 + mcc_wrb_cqe_callback cb, void *cb_context,
89115 + mcc_wrb_cqe_callback internal_cb,
89116 + void *internal_cb_context, void *optional_fwcmd_va,
89117 + struct be_mcc_wrb_response_copy *response_copy);
89118 +
89119 +int be_function_queue_mcc_wrb(struct be_function_object *pfob,
89120 + struct be_generic_q_ctxt *q_ctxt);
89121 +
89122 +/*
89123 + * ------------------------------------------------------
89124 + * MCC QUEUE
89125 + * ------------------------------------------------------
89126 + */
89127 +
89128 +int be_mpu_init_mailbox(struct be_function_object *pfob, struct ring_desc *rd);
89129 +
89130 +
89131 +struct MCC_WRB_AMAP *
89132 +_be_mpu_peek_ring_wrb(struct be_mcc_object *mcc, bool driving_queue);
89133 +
89134 +struct be_mcc_wrb_context *
89135 +_be_mcc_allocate_wrb_context(struct be_function_object *pfob);
89136 +
89137 +void _be_mcc_free_wrb_context(struct be_function_object *pfob,
89138 + struct be_mcc_wrb_context *context);
89139 +
89140 +int _be_mpu_post_wrb_mailbox(struct be_function_object *pfob,
89141 + struct MCC_WRB_AMAP *wrb, struct be_mcc_wrb_context *wrb_context);
89142 +
89143 +int _be_mpu_post_wrb_ring(struct be_mcc_object *mcc,
89144 + struct MCC_WRB_AMAP *wrb, struct be_mcc_wrb_context *wrb_context);
89145 +
89146 +void be_drive_mcc_wrb_queue(struct be_mcc_object *mcc);
89147 +
89148 +
89149 +/*
89150 + * ------------------------------------------------------
89151 + * Ring Sizes
89152 + * ------------------------------------------------------
89153 + */
89154 +static inline u32 be_ring_encoding_to_length(u32 encoding, u32 object_size)
89155 +{
89156 +
89157 + ASSERT(encoding != 1); /* 1 is rsvd */
89158 + ASSERT(encoding < 16);
89159 + ASSERT(object_size > 0);
89160 +
89161 + if (encoding == 0) /* 32k deep */
89162 + encoding = 16;
89163 +
89164 + return (1 << (encoding - 1)) * object_size;
89165 +}
89166 +
89167 +static inline
89168 +u32 be_ring_length_to_encoding(u32 length_in_bytes, u32 object_size)
89169 +{
89170 +
89171 + u32 count, encoding;
89172 +
89173 + ASSERT(object_size > 0);
89174 + ASSERT(length_in_bytes % object_size == 0);
89175 +
89176 + count = length_in_bytes / object_size;
89177 +
89178 + ASSERT(count > 1);
89179 + ASSERT(count <= 32 * 1024);
89180 + ASSERT(length_in_bytes <= 8 * PAGE_SIZE); /* max ring size in UT */
89181 +
89182 + encoding = __ilog2_u32(count) + 1;
89183 +
89184 + if (encoding == 16)
89185 + encoding = 0; /* 32k deep */
89186 +
89187 + return encoding;
89188 +}
89189 +
89190 +void be_rd_to_pa_list(struct ring_desc *rd, struct PHYS_ADDR *pa_list,
89191 + u32 max_num);
89192 +#endif /* __hwlib_h__ */
89193 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/Kconfig linux-2.6.29-rc3.owrt/drivers/staging/benet/Kconfig
89194 --- linux-2.6.29.owrt/drivers/staging/benet/Kconfig 1970-01-01 01:00:00.000000000 +0100
89195 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/Kconfig 2009-05-10 23:48:29.000000000 +0200
89196 @@ -0,0 +1,7 @@
89197 +config BENET
89198 + tristate "ServerEngines 10Gb NIC - BladeEngine"
89199 + depends on PCI && INET
89200 + select INET_LRO
89201 + help
89202 + This driver implements the NIC functionality for ServerEngines
89203 + 10Gb network adapter BladeEngine (EC 3210).
89204 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/MAINTAINERS linux-2.6.29-rc3.owrt/drivers/staging/benet/MAINTAINERS
89205 --- linux-2.6.29.owrt/drivers/staging/benet/MAINTAINERS 1970-01-01 01:00:00.000000000 +0100
89206 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/MAINTAINERS 2009-05-10 23:48:29.000000000 +0200
89207 @@ -0,0 +1,6 @@
89208 +SERVER ENGINES 10Gbe NIC - BLADE-ENGINE
89209 +P: Subbu Seetharaman
89210 +M: subbus@serverengines.com
89211 +L: netdev@vger.kernel.org
89212 +W: http://www.serverengines.com
89213 +S: Supported
89214 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/Makefile linux-2.6.29-rc3.owrt/drivers/staging/benet/Makefile
89215 --- linux-2.6.29.owrt/drivers/staging/benet/Makefile 1970-01-01 01:00:00.000000000 +0100
89216 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/Makefile 2009-05-10 23:48:29.000000000 +0200
89217 @@ -0,0 +1,14 @@
89218 +#
89219 +# Makefile to build the network driver for ServerEngine's BladeEngine
89220 +#
89221 +obj-$(CONFIG_BENET) += benet.o
89222 +
89223 +benet-y := be_init.o \
89224 + be_int.o \
89225 + be_netif.o \
89226 + be_ethtool.o \
89227 + funcobj.o \
89228 + cq.o \
89229 + eq.o \
89230 + mpu.o \
89231 + eth.o
89232 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/mpu.c linux-2.6.29-rc3.owrt/drivers/staging/benet/mpu.c
89233 --- linux-2.6.29.owrt/drivers/staging/benet/mpu.c 1970-01-01 01:00:00.000000000 +0100
89234 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/mpu.c 2009-05-10 23:48:29.000000000 +0200
89235 @@ -0,0 +1,1364 @@
89236 +/*
89237 + * Copyright (C) 2005 - 2008 ServerEngines
89238 + * All rights reserved.
89239 + *
89240 + * This program is free software; you can redistribute it and/or
89241 + * modify it under the terms of the GNU General Public License version 2
89242 + * as published by the Free Software Foundation. The full GNU General
89243 + * Public License is included in this distribution in the file called COPYING.
89244 + *
89245 + * Contact Information:
89246 + * linux-drivers@serverengines.com
89247 + *
89248 + * ServerEngines
89249 + * 209 N. Fair Oaks Ave
89250 + * Sunnyvale, CA 94085
89251 + */
89252 +#include <linux/delay.h>
89253 +#include "hwlib.h"
89254 +#include "bestatus.h"
89255 +
89256 +static
89257 +inline void mp_ring_create(struct mp_ring *ring, u32 num, u32 size, void *va)
89258 +{
89259 + ASSERT(ring);
89260 + memset(ring, 0, sizeof(struct mp_ring));
89261 + ring->num = num;
89262 + ring->pages = DIV_ROUND_UP(num * size, PAGE_SIZE);
89263 + ring->itemSize = size;
89264 + ring->va = va;
89265 +}
89266 +
89267 +/*
89268 + * -----------------------------------------------------------------------
89269 + * Interface for 2 index rings. i.e. consumer/producer rings
89270 + * --------------------------------------------------------------------------
89271 + */
89272 +
89273 +/* Returns number items pending on ring. */
89274 +static inline u32 mp_ring_num_pending(struct mp_ring *ring)
89275 +{
89276 + ASSERT(ring);
89277 + if (ring->num == 0)
89278 + return 0;
89279 + return be_subc(ring->pidx, ring->cidx, ring->num);
89280 +}
89281 +
89282 +/* Returns number items free on ring. */
89283 +static inline u32 mp_ring_num_empty(struct mp_ring *ring)
89284 +{
89285 + ASSERT(ring);
89286 + return ring->num - 1 - mp_ring_num_pending(ring);
89287 +}
89288 +
89289 +/* Consume 1 item */
89290 +static inline void mp_ring_consume(struct mp_ring *ring)
89291 +{
89292 + ASSERT(ring);
89293 + ASSERT(ring->pidx != ring->cidx);
89294 +
89295 + ring->cidx = be_addc(ring->cidx, 1, ring->num);
89296 +}
89297 +
89298 +/* Produce 1 item */
89299 +static inline void mp_ring_produce(struct mp_ring *ring)
89300 +{
89301 + ASSERT(ring);
89302 + ring->pidx = be_addc(ring->pidx, 1, ring->num);
89303 +}
89304 +
89305 +/* Consume count items */
89306 +static inline void mp_ring_consume_multiple(struct mp_ring *ring, u32 count)
89307 +{
89308 + ASSERT(ring);
89309 + ASSERT(mp_ring_num_pending(ring) >= count);
89310 + ring->cidx = be_addc(ring->cidx, count, ring->num);
89311 +}
89312 +
89313 +static inline void *mp_ring_item(struct mp_ring *ring, u32 index)
89314 +{
89315 + ASSERT(ring);
89316 + ASSERT(index < ring->num);
89317 + ASSERT(ring->itemSize > 0);
89318 + return (u8 *) ring->va + index * ring->itemSize;
89319 +}
89320 +
89321 +/* Ptr to produce item */
89322 +static inline void *mp_ring_producer_ptr(struct mp_ring *ring)
89323 +{
89324 + ASSERT(ring);
89325 + return mp_ring_item(ring, ring->pidx);
89326 +}
89327 +
89328 +/*
89329 + * Returns a pointer to the current location in the ring.
89330 + * This is used for rings with 1 index.
89331 + */
89332 +static inline void *mp_ring_current(struct mp_ring *ring)
89333 +{
89334 + ASSERT(ring);
89335 + ASSERT(ring->pidx == 0); /* not used */
89336 +
89337 + return mp_ring_item(ring, ring->cidx);
89338 +}
89339 +
89340 +/*
89341 + * Increment index for rings with only 1 index.
89342 + * This is used for rings with 1 index.
89343 + */
89344 +static inline void *mp_ring_next(struct mp_ring *ring)
89345 +{
89346 + ASSERT(ring);
89347 + ASSERT(ring->num > 0);
89348 + ASSERT(ring->pidx == 0); /* not used */
89349 +
89350 + ring->cidx = be_addc(ring->cidx, 1, ring->num);
89351 + return mp_ring_current(ring);
89352 +}
89353 +
89354 +/*
89355 + This routine waits for a previously posted mailbox WRB to be completed.
89356 + Specifically it waits for the mailbox to say that it's ready to accept
89357 + more data by setting the LSB of the mailbox pd register to 1.
89358 +
89359 + pcontroller - The function object to post this data to
89360 +
89361 + IRQL < DISPATCH_LEVEL
89362 +*/
89363 +static void be_mcc_mailbox_wait(struct be_function_object *pfob)
89364 +{
89365 + struct MPU_MAILBOX_DB_AMAP mailbox_db;
89366 + u32 i = 0;
89367 + u32 ready;
89368 +
89369 + if (pfob->emulate) {
89370 + /* No waiting for mailbox in emulated mode. */
89371 + return;
89372 + }
89373 +
89374 + mailbox_db.dw[0] = PD_READ(pfob, mcc_bootstrap_db);
89375 + ready = AMAP_GET_BITS_PTR(MPU_MAILBOX_DB, ready, &mailbox_db);
89376 +
89377 + while (ready == false) {
89378 + if ((++i & 0x3FFFF) == 0) {
89379 + TRACE(DL_WARN, "Waiting for mailbox ready - %dk polls",
89380 + i / 1000);
89381 + }
89382 + udelay(1);
89383 + mailbox_db.dw[0] = PD_READ(pfob, mcc_bootstrap_db);
89384 + ready = AMAP_GET_BITS_PTR(MPU_MAILBOX_DB, ready, &mailbox_db);
89385 + }
89386 +}
89387 +
89388 +/*
89389 + This routine tells the MCC mailbox that there is data to processed
89390 + in the mailbox. It does this by setting the physical address for the
89391 + mailbox location and clearing the LSB. This routine returns immediately
89392 + and does not wait for the WRB to be processed.
89393 +
89394 + pcontroller - The function object to post this data to
89395 +
89396 + IRQL < DISPATCH_LEVEL
89397 +
89398 +*/
89399 +static void be_mcc_mailbox_notify(struct be_function_object *pfob)
89400 +{
89401 + struct MPU_MAILBOX_DB_AMAP mailbox_db;
89402 + u32 pa;
89403 +
89404 + ASSERT(pfob->mailbox.pa);
89405 + ASSERT(pfob->mailbox.va);
89406 +
89407 + /* If emulated, do not ring the mailbox */
89408 + if (pfob->emulate) {
89409 + TRACE(DL_WARN, "MPU disabled. Skipping mailbox notify.");
89410 + return;
89411 + }
89412 +
89413 + /* form the higher bits in the address */
89414 + mailbox_db.dw[0] = 0; /* init */
89415 + AMAP_SET_BITS_PTR(MPU_MAILBOX_DB, hi, &mailbox_db, 1);
89416 + AMAP_SET_BITS_PTR(MPU_MAILBOX_DB, ready, &mailbox_db, 0);
89417 +
89418 + /* bits 34 to 63 */
89419 + pa = (u32) (pfob->mailbox.pa >> 34);
89420 + AMAP_SET_BITS_PTR(MPU_MAILBOX_DB, address, &mailbox_db, pa);
89421 +
89422 + /* Wait for the MPU to be ready */
89423 + be_mcc_mailbox_wait(pfob);
89424 +
89425 + /* Ring doorbell 1st time */
89426 + PD_WRITE(pfob, mcc_bootstrap_db, mailbox_db.dw[0]);
89427 +
89428 + /* Wait for 1st write to be acknowledged. */
89429 + be_mcc_mailbox_wait(pfob);
89430 +
89431 + /* lower bits 30 bits from 4th bit (bits 4 to 33)*/
89432 + pa = (u32) (pfob->mailbox.pa >> 4) & 0x3FFFFFFF;
89433 +
89434 + AMAP_SET_BITS_PTR(MPU_MAILBOX_DB, hi, &mailbox_db, 0);
89435 + AMAP_SET_BITS_PTR(MPU_MAILBOX_DB, ready, &mailbox_db, 0);
89436 + AMAP_SET_BITS_PTR(MPU_MAILBOX_DB, address, &mailbox_db, pa);
89437 +
89438 + /* Ring doorbell 2nd time */
89439 + PD_WRITE(pfob, mcc_bootstrap_db, mailbox_db.dw[0]);
89440 +}
89441 +
89442 +/*
89443 + This routine tells the MCC mailbox that there is data to processed
89444 + in the mailbox. It does this by setting the physical address for the
89445 + mailbox location and clearing the LSB. This routine spins until the
89446 + MPU writes a 1 into the LSB indicating that the data has been received
89447 + and is ready to be processed.
89448 +
89449 + pcontroller - The function object to post this data to
89450 +
89451 + IRQL < DISPATCH_LEVEL
89452 +*/
89453 +static void
89454 +be_mcc_mailbox_notify_and_wait(struct be_function_object *pfob)
89455 +{
89456 + /*
89457 + * Notify it
89458 + */
89459 + be_mcc_mailbox_notify(pfob);
89460 + /*
89461 + * Now wait for completion of WRB
89462 + */
89463 + be_mcc_mailbox_wait(pfob);
89464 +}
89465 +
89466 +void
89467 +be_mcc_process_cqe(struct be_function_object *pfob,
89468 + struct MCC_CQ_ENTRY_AMAP *cqe)
89469 +{
89470 + struct be_mcc_wrb_context *wrb_context = NULL;
89471 + u32 offset, status;
89472 + u8 *p;
89473 +
89474 + ASSERT(cqe);
89475 + /*
89476 + * A command completed. Commands complete out-of-order.
89477 + * Determine which command completed from the TAG.
89478 + */
89479 + offset = offsetof(struct BE_MCC_CQ_ENTRY_AMAP, mcc_tag)/8;
89480 + p = (u8 *) cqe + offset;
89481 + wrb_context = (struct be_mcc_wrb_context *)(void *)(size_t)(*(u64 *)p);
89482 + ASSERT(wrb_context);
89483 +
89484 + /*
89485 + * Perform a response copy if requested.
89486 + * Only copy data if the FWCMD is successful.
89487 + */
89488 + status = AMAP_GET_BITS_PTR(MCC_CQ_ENTRY, completion_status, cqe);
89489 + if (status == MGMT_STATUS_SUCCESS && wrb_context->copy.length > 0) {
89490 + ASSERT(wrb_context->wrb);
89491 + ASSERT(wrb_context->copy.va);
89492 + p = (u8 *)wrb_context->wrb +
89493 + offsetof(struct BE_MCC_WRB_AMAP, payload)/8;
89494 + memcpy(wrb_context->copy.va,
89495 + (u8 *)p + wrb_context->copy.fwcmd_offset,
89496 + wrb_context->copy.length);
89497 + }
89498 +
89499 + if (status)
89500 + status = BE_NOT_OK;
89501 + /* internal callback */
89502 + if (wrb_context->internal_cb) {
89503 + wrb_context->internal_cb(wrb_context->internal_cb_context,
89504 + status, wrb_context->wrb);
89505 + }
89506 +
89507 + /* callback */
89508 + if (wrb_context->cb) {
89509 + wrb_context->cb(wrb_context->cb_context,
89510 + status, wrb_context->wrb);
89511 + }
89512 + /* Free the context structure */
89513 + _be_mcc_free_wrb_context(pfob, wrb_context);
89514 +}
89515 +
89516 +void be_drive_mcc_wrb_queue(struct be_mcc_object *mcc)
89517 +{
89518 + struct be_function_object *pfob = NULL;
89519 + int status = BE_PENDING;
89520 + struct be_generic_q_ctxt *q_ctxt;
89521 + struct MCC_WRB_AMAP *wrb;
89522 + struct MCC_WRB_AMAP *queue_wrb;
89523 + u32 length, payload_length, sge_count, embedded;
89524 + unsigned long irql;
89525 +
89526 + BUILD_BUG_ON((sizeof(struct be_generic_q_ctxt) <
89527 + sizeof(struct be_queue_driver_context) +
89528 + sizeof(struct MCC_WRB_AMAP)));
89529 + pfob = mcc->parent_function;
89530 +
89531 + spin_lock_irqsave(&pfob->post_lock, irql);
89532 +
89533 + if (mcc->driving_backlog) {
89534 + spin_unlock_irqrestore(&pfob->post_lock, irql);
89535 + if (pfob->pend_queue_driving && pfob->mcc) {
89536 + pfob->pend_queue_driving = 0;
89537 + be_drive_mcc_wrb_queue(pfob->mcc);
89538 + }
89539 + return;
89540 + }
89541 + /* Acquire the flag to limit 1 thread to redrive posts. */
89542 + mcc->driving_backlog = 1;
89543 +
89544 + while (!list_empty(&mcc->backlog)) {
89545 + wrb = _be_mpu_peek_ring_wrb(mcc, true); /* Driving the queue */
89546 + if (!wrb)
89547 + break; /* No space in the ring yet. */
89548 + /* Get the next queued entry to process. */
89549 + q_ctxt = list_first_entry(&mcc->backlog,
89550 + struct be_generic_q_ctxt, context.list);
89551 + list_del(&q_ctxt->context.list);
89552 + pfob->mcc->backlog_length--;
89553 + /*
89554 + * Compute the required length of the WRB.
89555 + * Since the queue element may be smaller than
89556 + * the complete WRB, copy only the required number of bytes.
89557 + */
89558 + queue_wrb = (struct MCC_WRB_AMAP *) &q_ctxt->wrb_header;
89559 + embedded = AMAP_GET_BITS_PTR(MCC_WRB, embedded, queue_wrb);
89560 + if (embedded) {
89561 + payload_length = AMAP_GET_BITS_PTR(MCC_WRB,
89562 + payload_length, queue_wrb);
89563 + length = sizeof(struct be_mcc_wrb_header) +
89564 + payload_length;
89565 + } else {
89566 + sge_count = AMAP_GET_BITS_PTR(MCC_WRB, sge_count,
89567 + queue_wrb);
89568 + ASSERT(sge_count == 1); /* only 1 frag. */
89569 + length = sizeof(struct be_mcc_wrb_header) +
89570 + sge_count * sizeof(struct MCC_SGE_AMAP);
89571 + }
89572 +
89573 + /*
89574 + * Truncate the length based on the size of the
89575 + * queue element. Some elements that have output parameters
89576 + * can be smaller than the payload_length field would
89577 + * indicate. We really only need to copy the request
89578 + * parameters, not the response.
89579 + */
89580 + length = min(length, (u32) (q_ctxt->context.bytes -
89581 + offsetof(struct be_generic_q_ctxt, wrb_header)));
89582 +
89583 + /* Copy the queue element WRB into the ring. */
89584 + memcpy(wrb, &q_ctxt->wrb_header, length);
89585 +
89586 + /* Post the wrb. This should not fail assuming we have
89587 + * enough context structs. */
89588 + status = be_function_post_mcc_wrb(pfob, wrb, NULL,
89589 + q_ctxt->context.cb, q_ctxt->context.cb_context,
89590 + q_ctxt->context.internal_cb,
89591 + q_ctxt->context.internal_cb_context,
89592 + q_ctxt->context.optional_fwcmd_va,
89593 + &q_ctxt->context.copy);
89594 +
89595 + if (status == BE_SUCCESS) {
89596 + /*
89597 + * Synchronous completion. Since it was queued,
89598 + * we will invoke the callback.
89599 + * To the user, this is an asynchronous request.
89600 + */
89601 + spin_unlock_irqrestore(&pfob->post_lock, irql);
89602 + if (pfob->pend_queue_driving && pfob->mcc) {
89603 + pfob->pend_queue_driving = 0;
89604 + be_drive_mcc_wrb_queue(pfob->mcc);
89605 + }
89606 +
89607 + ASSERT(q_ctxt->context.cb);
89608 +
89609 + q_ctxt->context.cb(
89610 + q_ctxt->context.cb_context,
89611 + BE_SUCCESS, NULL);
89612 +
89613 + spin_lock_irqsave(&pfob->post_lock, irql);
89614 +
89615 + } else if (status != BE_PENDING) {
89616 + /*
89617 + * Another resource failed. Should never happen
89618 + * if we have sufficient MCC_WRB_CONTEXT structs.
89619 + * Return to head of the queue.
89620 + */
89621 + TRACE(DL_WARN, "Failed to post a queued WRB. 0x%x",
89622 + status);
89623 + list_add(&q_ctxt->context.list, &mcc->backlog);
89624 + pfob->mcc->backlog_length++;
89625 + break;
89626 + }
89627 + }
89628 +
89629 + /* Free the flag to limit 1 thread to redrive posts. */
89630 + mcc->driving_backlog = 0;
89631 + spin_unlock_irqrestore(&pfob->post_lock, irql);
89632 +}
89633 +
89634 +/* This function asserts that the WRB was consumed in order. */
89635 +#ifdef BE_DEBUG
89636 +u32 be_mcc_wrb_consumed_in_order(struct be_mcc_object *mcc,
89637 + struct MCC_CQ_ENTRY_AMAP *cqe)
89638 +{
89639 + struct be_mcc_wrb_context *wrb_context = NULL;
89640 + u32 wrb_index;
89641 + u32 wrb_consumed_in_order;
89642 + u32 offset;
89643 + u8 *p;
89644 +
89645 + ASSERT(cqe);
89646 + /*
89647 + * A command completed. Commands complete out-of-order.
89648 + * Determine which command completed from the TAG.
89649 + */
89650 + offset = offsetof(struct BE_MCC_CQ_ENTRY_AMAP, mcc_tag)/8;
89651 + p = (u8 *) cqe + offset;
89652 + wrb_context = (struct be_mcc_wrb_context *)(void *)(size_t)(*(u64 *)p);
89653 +
89654 + ASSERT(wrb_context);
89655 +
89656 + wrb_index = (u32) (((u64)(size_t)wrb_context->ring_wrb -
89657 + (u64)(size_t)mcc->sq.ring.va) / sizeof(struct MCC_WRB_AMAP));
89658 +
89659 + ASSERT(wrb_index < mcc->sq.ring.num);
89660 +
89661 + wrb_consumed_in_order = (u32) (wrb_index == mcc->consumed_index);
89662 + mcc->consumed_index = be_addc(mcc->consumed_index, 1, mcc->sq.ring.num);
89663 + return wrb_consumed_in_order;
89664 +}
89665 +#endif
89666 +
89667 +int be_mcc_process_cq(struct be_mcc_object *mcc, bool rearm)
89668 +{
89669 + struct be_function_object *pfob = NULL;
89670 + struct MCC_CQ_ENTRY_AMAP *cqe;
89671 + struct CQ_DB_AMAP db;
89672 + struct mp_ring *cq_ring = &mcc->cq.ring;
89673 + struct mp_ring *mp_ring = &mcc->sq.ring;
89674 + u32 num_processed = 0;
89675 + u32 consumed = 0, valid, completed, cqe_consumed, async_event;
89676 +
89677 + pfob = mcc->parent_function;
89678 +
89679 + spin_lock_irqsave(&pfob->cq_lock, pfob->cq_irq);
89680 +
89681 + /*
89682 + * Verify that only one thread is processing the CQ at once.
89683 + * We cannot hold the lock while processing the CQ due to
89684 + * the callbacks into the OS. Therefore, this flag is used
89685 + * to control it. If any of the threads want to
89686 + * rearm the CQ, we need to honor that.
89687 + */
89688 + if (mcc->processing != 0) {
89689 + mcc->rearm = mcc->rearm || rearm;
89690 + goto Error;
89691 + } else {
89692 + mcc->processing = 1; /* lock processing for this thread. */
89693 + mcc->rearm = rearm; /* set our rearm setting */
89694 + }
89695 +
89696 + spin_unlock_irqrestore(&pfob->cq_lock, pfob->cq_irq);
89697 +
89698 + cqe = mp_ring_current(cq_ring);
89699 + valid = AMAP_GET_BITS_PTR(MCC_CQ_ENTRY, valid, cqe);
89700 + while (valid) {
89701 +
89702 + if (num_processed >= 8) {
89703 + /* coalesce doorbells, but free space in cq
89704 + * ring while processing. */
89705 + db.dw[0] = 0; /* clear */
89706 + AMAP_SET_BITS_PTR(CQ_DB, qid, &db, cq_ring->id);
89707 + AMAP_SET_BITS_PTR(CQ_DB, rearm, &db, false);
89708 + AMAP_SET_BITS_PTR(CQ_DB, event, &db, false);
89709 + AMAP_SET_BITS_PTR(CQ_DB, num_popped, &db,
89710 + num_processed);
89711 + num_processed = 0;
89712 +
89713 + PD_WRITE(pfob, cq_db, db.dw[0]);
89714 + }
89715 +
89716 + async_event = AMAP_GET_BITS_PTR(MCC_CQ_ENTRY, async_event, cqe);
89717 + if (async_event) {
89718 + /* This is an asynchronous event. */
89719 + struct ASYNC_EVENT_TRAILER_AMAP *async_trailer =
89720 + (struct ASYNC_EVENT_TRAILER_AMAP *)
89721 + ((u8 *) cqe + sizeof(struct MCC_CQ_ENTRY_AMAP) -
89722 + sizeof(struct ASYNC_EVENT_TRAILER_AMAP));
89723 + u32 event_code;
89724 + async_event = AMAP_GET_BITS_PTR(ASYNC_EVENT_TRAILER,
89725 + async_event, async_trailer);
89726 + ASSERT(async_event == 1);
89727 +
89728 +
89729 + valid = AMAP_GET_BITS_PTR(ASYNC_EVENT_TRAILER,
89730 + valid, async_trailer);
89731 + ASSERT(valid == 1);
89732 +
89733 + /* Call the async event handler if it is installed. */
89734 + if (mcc->async_cb) {
89735 + event_code =
89736 + AMAP_GET_BITS_PTR(ASYNC_EVENT_TRAILER,
89737 + event_code, async_trailer);
89738 + mcc->async_cb(mcc->async_context,
89739 + (u32) event_code, (void *) cqe);
89740 + }
89741 +
89742 + } else {
89743 + /* This is a completion entry. */
89744 +
89745 + /* No vm forwarding in this driver. */
89746 +
89747 + cqe_consumed = AMAP_GET_BITS_PTR(MCC_CQ_ENTRY,
89748 + consumed, cqe);
89749 + if (cqe_consumed) {
89750 + /*
89751 + * A command on the MCC ring was consumed.
89752 + * Update the consumer index.
89753 + * These occur in order.
89754 + */
89755 + ASSERT(be_mcc_wrb_consumed_in_order(mcc, cqe));
89756 + consumed++;
89757 + }
89758 +
89759 + completed = AMAP_GET_BITS_PTR(MCC_CQ_ENTRY,
89760 + completed, cqe);
89761 + if (completed) {
89762 + /* A command completed. Use tag to
89763 + * determine which command. */
89764 + be_mcc_process_cqe(pfob, cqe);
89765 + }
89766 + }
89767 +
89768 + /* Reset the CQE */
89769 + AMAP_SET_BITS_PTR(MCC_CQ_ENTRY, valid, cqe, false);
89770 + num_processed++;
89771 +
89772 + /* Update our tracking for the CQ ring. */
89773 + cqe = mp_ring_next(cq_ring);
89774 + valid = AMAP_GET_BITS_PTR(MCC_CQ_ENTRY, valid, cqe);
89775 + }
89776 +
89777 + TRACE(DL_INFO, "num_processed:0x%x, and consumed:0x%x",
89778 + num_processed, consumed);
89779 + /*
89780 + * Grab the CQ lock to synchronize the "rearm" setting for
89781 + * the doorbell, and for clearing the "processing" flag.
89782 + */
89783 + spin_lock_irqsave(&pfob->cq_lock, pfob->cq_irq);
89784 +
89785 + /*
89786 + * Rearm the cq. This is done based on the global mcc->rearm
89787 + * flag which combines the rearm parameter from the current
89788 + * call to process_cq and any other threads
89789 + * that tried to process the CQ while this one was active.
89790 + * This handles the situation where a sync. fwcmd was processing
89791 + * the CQ while the interrupt/dpc tries to process it.
89792 + * The sync process gets to continue -- but it is now
89793 + * responsible for the rearming.
89794 + */
89795 + if (num_processed > 0 || mcc->rearm == true) {
89796 + db.dw[0] = 0; /* clear */
89797 + AMAP_SET_BITS_PTR(CQ_DB, qid, &db, cq_ring->id);
89798 + AMAP_SET_BITS_PTR(CQ_DB, rearm, &db, mcc->rearm);
89799 + AMAP_SET_BITS_PTR(CQ_DB, event, &db, false);
89800 + AMAP_SET_BITS_PTR(CQ_DB, num_popped, &db, num_processed);
89801 +
89802 + PD_WRITE(pfob, cq_db, db.dw[0]);
89803 + }
89804 + /*
89805 + * Update the consumer index after ringing the CQ doorbell.
89806 + * We don't want another thread to post more WRBs before we
89807 + * have CQ space available.
89808 + */
89809 + mp_ring_consume_multiple(mp_ring, consumed);
89810 +
89811 + /* Clear the processing flag. */
89812 + mcc->processing = 0;
89813 +
89814 +Error:
89815 + spin_unlock_irqrestore(&pfob->cq_lock, pfob->cq_irq);
89816 + /*
89817 + * Use the local variable to detect if the current thread
89818 + * holds the WRB post lock. If rearm is false, this is
89819 + * either a synchronous command, or the upper layer driver is polling
89820 + * from a thread. We do not drive the queue from that
89821 + * context since the driver may hold the
89822 + * wrb post lock already.
89823 + */
89824 + if (rearm)
89825 + be_drive_mcc_wrb_queue(mcc);
89826 + else
89827 + pfob->pend_queue_driving = 1;
89828 +
89829 + return BE_SUCCESS;
89830 +}
89831 +
89832 +/*
89833 + *============================================================================
89834 + * P U B L I C R O U T I N E S
89835 + *============================================================================
89836 + */
89837 +
89838 +/*
89839 + This routine creates an MCC object. This object contains an MCC send queue
89840 + and a CQ private to the MCC.
89841 +
89842 + pcontroller - Handle to a function object
89843 +
89844 + EqObject - EQ object that will be used to dispatch this MCC
89845 +
89846 + ppMccObject - Pointer to an internal Mcc Object returned.
89847 +
89848 + Returns BE_SUCCESS if successfull,, otherwise a useful error code
89849 + is returned.
89850 +
89851 + IRQL < DISPATCH_LEVEL
89852 +
89853 +*/
89854 +int
89855 +be_mcc_ring_create(struct be_function_object *pfob,
89856 + struct ring_desc *rd, u32 length,
89857 + struct be_mcc_wrb_context *context_array,
89858 + u32 num_context_entries,
89859 + struct be_cq_object *cq, struct be_mcc_object *mcc)
89860 +{
89861 + int status = 0;
89862 +
89863 + struct FWCMD_COMMON_MCC_CREATE *fwcmd = NULL;
89864 + struct MCC_WRB_AMAP *wrb = NULL;
89865 + u32 num_entries_encoded, n, i;
89866 + void *va = NULL;
89867 + unsigned long irql;
89868 +
89869 + if (length < sizeof(struct MCC_WRB_AMAP) * 2) {
89870 + TRACE(DL_ERR, "Invalid MCC ring length:%d", length);
89871 + return BE_NOT_OK;
89872 + }
89873 + /*
89874 + * Reduce the actual ring size to be less than the number
89875 + * of context entries. This ensures that we run out of
89876 + * ring WRBs first so the queuing works correctly. We never
89877 + * queue based on context structs.
89878 + */
89879 + if (num_context_entries + 1 <
89880 + length / sizeof(struct MCC_WRB_AMAP) - 1) {
89881 +
89882 + u32 max_length =
89883 + (num_context_entries + 2) * sizeof(struct MCC_WRB_AMAP);
89884 +
89885 + if (is_power_of_2(max_length))
89886 + length = __roundup_pow_of_two(max_length+1) / 2;
89887 + else
89888 + length = __roundup_pow_of_two(max_length) / 2;
89889 +
89890 + ASSERT(length <= max_length);
89891 +
89892 + TRACE(DL_WARN,
89893 + "MCC ring length reduced based on context entries."
89894 + " length:%d wrbs:%d context_entries:%d", length,
89895 + (int) (length / sizeof(struct MCC_WRB_AMAP)),
89896 + num_context_entries);
89897 + }
89898 +
89899 + spin_lock_irqsave(&pfob->post_lock, irql);
89900 +
89901 + num_entries_encoded =
89902 + be_ring_length_to_encoding(length, sizeof(struct MCC_WRB_AMAP));
89903 +
89904 + /* Init MCC object. */
89905 + memset(mcc, 0, sizeof(*mcc));
89906 + mcc->parent_function = pfob;
89907 + mcc->cq_object = cq;
89908 +
89909 + INIT_LIST_HEAD(&mcc->backlog);
89910 +
89911 + wrb = be_function_peek_mcc_wrb(pfob);
89912 + if (!wrb) {
89913 + ASSERT(wrb);
89914 + TRACE(DL_ERR, "No free MCC WRBs in create EQ.");
89915 + status = BE_STATUS_NO_MCC_WRB;
89916 + goto error;
89917 + }
89918 + /* Prepares an embedded fwcmd, including request/response sizes. */
89919 + fwcmd = BE_PREPARE_EMBEDDED_FWCMD(pfob, wrb, COMMON_MCC_CREATE);
89920 +
89921 + fwcmd->params.request.num_pages = DIV_ROUND_UP(length, PAGE_SIZE);
89922 + /*
89923 + * Program MCC ring context
89924 + */
89925 + AMAP_SET_BITS_PTR(MCC_RING_CONTEXT, pdid,
89926 + &fwcmd->params.request.context, 0);
89927 + AMAP_SET_BITS_PTR(MCC_RING_CONTEXT, invalid,
89928 + &fwcmd->params.request.context, false);
89929 + AMAP_SET_BITS_PTR(MCC_RING_CONTEXT, ring_size,
89930 + &fwcmd->params.request.context, num_entries_encoded);
89931 +
89932 + n = cq->cq_id;
89933 + AMAP_SET_BITS_PTR(MCC_RING_CONTEXT,
89934 + cq_id, &fwcmd->params.request.context, n);
89935 + be_rd_to_pa_list(rd, fwcmd->params.request.pages,
89936 + ARRAY_SIZE(fwcmd->params.request.pages));
89937 + /* Post the f/w command */
89938 + status = be_function_post_mcc_wrb(pfob, wrb, NULL, NULL, NULL,
89939 + NULL, NULL, fwcmd, NULL);
89940 + if (status != BE_SUCCESS) {
89941 + TRACE(DL_ERR, "MCC to create CQ failed.");
89942 + goto error;
89943 + }
89944 + /*
89945 + * Create a linked list of context structures
89946 + */
89947 + mcc->wrb_context.base = context_array;
89948 + mcc->wrb_context.num = num_context_entries;
89949 + INIT_LIST_HEAD(&mcc->wrb_context.list_head);
89950 + memset(context_array, 0,
89951 + sizeof(struct be_mcc_wrb_context) * num_context_entries);
89952 + for (i = 0; i < mcc->wrb_context.num; i++) {
89953 + list_add_tail(&context_array[i].next,
89954 + &mcc->wrb_context.list_head);
89955 + }
89956 +
89957 + /*
89958 + *
89959 + * Create an mcc_ring for tracking WRB hw ring
89960 + */
89961 + va = rd->va;
89962 + ASSERT(va);
89963 + mp_ring_create(&mcc->sq.ring, length / sizeof(struct MCC_WRB_AMAP),
89964 + sizeof(struct MCC_WRB_AMAP), va);
89965 + mcc->sq.ring.id = fwcmd->params.response.id;
89966 + /*
89967 + * Init a mcc_ring for tracking the MCC CQ.
89968 + */
89969 + ASSERT(cq->va);
89970 + mp_ring_create(&mcc->cq.ring, cq->num_entries,
89971 + sizeof(struct MCC_CQ_ENTRY_AMAP), cq->va);
89972 + mcc->cq.ring.id = cq->cq_id;
89973 +
89974 + /* Force zeroing of CQ. */
89975 + memset(cq->va, 0, cq->num_entries * sizeof(struct MCC_CQ_ENTRY_AMAP));
89976 +
89977 + /* Initialize debug index. */
89978 + mcc->consumed_index = 0;
89979 +
89980 + atomic_inc(&cq->ref_count);
89981 + pfob->mcc = mcc;
89982 +
89983 + TRACE(DL_INFO, "MCC ring created. id:%d bytes:%d cq_id:%d cq_entries:%d"
89984 + " num_context:%d", mcc->sq.ring.id, length,
89985 + cq->cq_id, cq->num_entries, num_context_entries);
89986 +
89987 +error:
89988 + spin_unlock_irqrestore(&pfob->post_lock, irql);
89989 + if (pfob->pend_queue_driving && pfob->mcc) {
89990 + pfob->pend_queue_driving = 0;
89991 + be_drive_mcc_wrb_queue(pfob->mcc);
89992 + }
89993 + return status;
89994 +}
89995 +
89996 +/*
89997 + This routine destroys an MCC send queue
89998 +
89999 + MccObject - Internal Mcc Object to be destroyed.
90000 +
90001 + Returns BE_SUCCESS if successfull, otherwise an error code is returned.
90002 +
90003 + IRQL < DISPATCH_LEVEL
90004 +
90005 + The caller of this routine must ensure that no other WRB may be posted
90006 + until this routine returns.
90007 +
90008 +*/
90009 +int be_mcc_ring_destroy(struct be_mcc_object *mcc)
90010 +{
90011 + int status = 0;
90012 + struct be_function_object *pfob = mcc->parent_function;
90013 +
90014 +
90015 + ASSERT(mcc->processing == 0);
90016 +
90017 + /*
90018 + * Remove the ring from the function object.
90019 + * This transitions back to mailbox mode.
90020 + */
90021 + pfob->mcc = NULL;
90022 +
90023 + /* Send fwcmd to destroy the queue. (Using the mailbox.) */
90024 + status = be_function_ring_destroy(mcc->parent_function, mcc->sq.ring.id,
90025 + FWCMD_RING_TYPE_MCC, NULL, NULL, NULL, NULL);
90026 + ASSERT(status == 0);
90027 +
90028 + /* Release the SQ reference to the CQ */
90029 + atomic_dec(&mcc->cq_object->ref_count);
90030 +
90031 + return status;
90032 +}
90033 +
90034 +static void
90035 +mcc_wrb_sync_cb(void *context, int staus, struct MCC_WRB_AMAP *wrb)
90036 +{
90037 + struct be_mcc_wrb_context *wrb_context =
90038 + (struct be_mcc_wrb_context *) context;
90039 + ASSERT(wrb_context);
90040 + *wrb_context->users_final_status = staus;
90041 +}
90042 +
90043 +/*
90044 + This routine posts a command to the MCC send queue
90045 +
90046 + mcc - Internal Mcc Object to be destroyed.
90047 +
90048 + wrb - wrb to post.
90049 +
90050 + Returns BE_SUCCESS if successfull, otherwise an error code is returned.
90051 +
90052 + IRQL < DISPATCH_LEVEL if CompletionCallback is not NULL
90053 + IRQL <=DISPATCH_LEVEL if CompletionCallback is NULL
90054 +
90055 + If this routine is called with CompletionCallback != NULL the
90056 + call is considered to be asynchronous and will return as soon
90057 + as the WRB is posted to the MCC with BE_PENDING.
90058 +
90059 + If CompletionCallback is NULL, then this routine will not return until
90060 + a completion for this MCC command has been processed.
90061 + If called at DISPATCH_LEVEL the CompletionCallback must be NULL.
90062 +
90063 + This routine should only be called if the MPU has been boostraped past
90064 + mailbox mode.
90065 +
90066 +
90067 +*/
90068 +int
90069 +_be_mpu_post_wrb_ring(struct be_mcc_object *mcc, struct MCC_WRB_AMAP *wrb,
90070 + struct be_mcc_wrb_context *wrb_context)
90071 +{
90072 +
90073 + struct MCC_WRB_AMAP *ring_wrb = NULL;
90074 + int status = BE_PENDING;
90075 + int final_status = BE_PENDING;
90076 + mcc_wrb_cqe_callback cb = NULL;
90077 + struct MCC_DB_AMAP mcc_db;
90078 + u32 embedded;
90079 +
90080 + ASSERT(mp_ring_num_empty(&mcc->sq.ring) > 0);
90081 + /*
90082 + * Input wrb is most likely the next wrb in the ring, since the client
90083 + * can peek at the address.
90084 + */
90085 + ring_wrb = mp_ring_producer_ptr(&mcc->sq.ring);
90086 + if (wrb != ring_wrb) {
90087 + /* If not equal, copy it into the ring. */
90088 + memcpy(ring_wrb, wrb, sizeof(struct MCC_WRB_AMAP));
90089 + }
90090 +#ifdef BE_DEBUG
90091 + wrb_context->ring_wrb = ring_wrb;
90092 +#endif
90093 + embedded = AMAP_GET_BITS_PTR(MCC_WRB, embedded, ring_wrb);
90094 + if (embedded) {
90095 + /* embedded commands will have the response within the WRB. */
90096 + wrb_context->wrb = ring_wrb;
90097 + } else {
90098 + /*
90099 + * non-embedded commands will not have the response
90100 + * within the WRB, and they may complete out-of-order.
90101 + * The WRB will not be valid to inspect
90102 + * during the completion.
90103 + */
90104 + wrb_context->wrb = NULL;
90105 + }
90106 + cb = wrb_context->cb;
90107 +
90108 + if (cb == NULL) {
90109 + /* Assign our internal callback if this is a
90110 + * synchronous call. */
90111 + wrb_context->cb = mcc_wrb_sync_cb;
90112 + wrb_context->cb_context = wrb_context;
90113 + wrb_context->users_final_status = &final_status;
90114 + }
90115 + /* Increment producer index */
90116 +
90117 + mcc_db.dw[0] = 0; /* initialize */
90118 + AMAP_SET_BITS_PTR(MCC_DB, rid, &mcc_db, mcc->sq.ring.id);
90119 + AMAP_SET_BITS_PTR(MCC_DB, numPosted, &mcc_db, 1);
90120 +
90121 + mp_ring_produce(&mcc->sq.ring);
90122 + PD_WRITE(mcc->parent_function, mpu_mcc_db, mcc_db.dw[0]);
90123 + TRACE(DL_INFO, "pidx: %x and cidx: %x.", mcc->sq.ring.pidx,
90124 + mcc->sq.ring.cidx);
90125 +
90126 + if (cb == NULL) {
90127 + int polls = 0; /* At >= 1 us per poll */
90128 + /* Wait until this command completes, polling the CQ. */
90129 + do {
90130 + TRACE(DL_INFO, "FWCMD submitted in the poll mode.");
90131 + /* Do not rearm CQ in this context. */
90132 + be_mcc_process_cq(mcc, false);
90133 +
90134 + if (final_status == BE_PENDING) {
90135 + if ((++polls & 0x7FFFF) == 0) {
90136 + TRACE(DL_WARN,
90137 + "Warning : polling MCC CQ for %d"
90138 + "ms.", polls / 1000);
90139 + }
90140 +
90141 + udelay(1);
90142 + }
90143 +
90144 + /* final_status changed when the command completes */
90145 + } while (final_status == BE_PENDING);
90146 +
90147 + status = final_status;
90148 + }
90149 +
90150 + return status;
90151 +}
90152 +
90153 +struct MCC_WRB_AMAP *
90154 +_be_mpu_peek_ring_wrb(struct be_mcc_object *mcc, bool driving_queue)
90155 +{
90156 + /* If we have queued items, do not allow a post to bypass the queue. */
90157 + if (!driving_queue && !list_empty(&mcc->backlog))
90158 + return NULL;
90159 +
90160 + if (mp_ring_num_empty(&mcc->sq.ring) <= 0)
90161 + return NULL;
90162 + return (struct MCC_WRB_AMAP *) mp_ring_producer_ptr(&mcc->sq.ring);
90163 +}
90164 +
90165 +int
90166 +be_mpu_init_mailbox(struct be_function_object *pfob, struct ring_desc *mailbox)
90167 +{
90168 + ASSERT(mailbox);
90169 + pfob->mailbox.va = mailbox->va;
90170 + pfob->mailbox.pa = cpu_to_le64(mailbox->pa);
90171 + pfob->mailbox.length = mailbox->length;
90172 +
90173 + ASSERT(((u32)(size_t)pfob->mailbox.va & 0xf) == 0);
90174 + ASSERT(((u32)(size_t)pfob->mailbox.pa & 0xf) == 0);
90175 + /*
90176 + * Issue the WRB to set MPU endianness
90177 + */
90178 + {
90179 + u64 *endian_check = (u64 *) (pfob->mailbox.va +
90180 + offsetof(struct BE_MCC_MAILBOX_AMAP, wrb)/8);
90181 + *endian_check = 0xFF1234FFFF5678FFULL;
90182 + }
90183 +
90184 + be_mcc_mailbox_notify_and_wait(pfob);
90185 +
90186 + return BE_SUCCESS;
90187 +}
90188 +
90189 +
90190 +/*
90191 + This routine posts a command to the MCC mailbox.
90192 +
90193 + FuncObj - Function Object to post the WRB on behalf of.
90194 + wrb - wrb to post.
90195 + CompletionCallback - Address of a callback routine to invoke once the WRB
90196 + is completed.
90197 + CompletionCallbackContext - Opaque context to be passed during the call to
90198 + the CompletionCallback.
90199 + Returns BE_SUCCESS if successfull, otherwise an error code is returned.
90200 +
90201 + IRQL <=DISPATCH_LEVEL if CompletionCallback is NULL
90202 +
90203 + This routine will block until a completion for this MCC command has been
90204 + processed. If called at DISPATCH_LEVEL the CompletionCallback must be NULL.
90205 +
90206 + This routine should only be called if the MPU has not been boostraped past
90207 + mailbox mode.
90208 +*/
90209 +int
90210 +_be_mpu_post_wrb_mailbox(struct be_function_object *pfob,
90211 + struct MCC_WRB_AMAP *wrb, struct be_mcc_wrb_context *wrb_context)
90212 +{
90213 + struct MCC_MAILBOX_AMAP *mailbox = NULL;
90214 + struct MCC_WRB_AMAP *mb_wrb;
90215 + struct MCC_CQ_ENTRY_AMAP *mb_cq;
90216 + u32 offset, status;
90217 +
90218 + ASSERT(pfob->mcc == NULL);
90219 + mailbox = pfob->mailbox.va;
90220 + ASSERT(mailbox);
90221 +
90222 + offset = offsetof(struct BE_MCC_MAILBOX_AMAP, wrb)/8;
90223 + mb_wrb = (struct MCC_WRB_AMAP *) (u8 *)mailbox + offset;
90224 + if (mb_wrb != wrb) {
90225 + memset(mailbox, 0, sizeof(*mailbox));
90226 + memcpy(mb_wrb, wrb, sizeof(struct MCC_WRB_AMAP));
90227 + }
90228 + /* The callback can inspect the final WRB to get output parameters. */
90229 + wrb_context->wrb = mb_wrb;
90230 +
90231 + be_mcc_mailbox_notify_and_wait(pfob);
90232 +
90233 + /* A command completed. Use tag to determine which command. */
90234 + offset = offsetof(struct BE_MCC_MAILBOX_AMAP, cq)/8;
90235 + mb_cq = (struct MCC_CQ_ENTRY_AMAP *) ((u8 *)mailbox + offset);
90236 + be_mcc_process_cqe(pfob, mb_cq);
90237 +
90238 + status = AMAP_GET_BITS_PTR(MCC_CQ_ENTRY, completion_status, mb_cq);
90239 + if (status)
90240 + status = BE_NOT_OK;
90241 + return status;
90242 +}
90243 +
90244 +struct be_mcc_wrb_context *
90245 +_be_mcc_allocate_wrb_context(struct be_function_object *pfob)
90246 +{
90247 + struct be_mcc_wrb_context *context = NULL;
90248 + unsigned long irq;
90249 +
90250 + spin_lock_irqsave(&pfob->mcc_context_lock, irq);
90251 +
90252 + if (!pfob->mailbox.default_context_allocated) {
90253 + /* Use the single default context that we
90254 + * always have allocated. */
90255 + pfob->mailbox.default_context_allocated = true;
90256 + context = &pfob->mailbox.default_context;
90257 + } else if (pfob->mcc) {
90258 + /* Get a context from the free list. If any are available. */
90259 + if (!list_empty(&pfob->mcc->wrb_context.list_head)) {
90260 + context = list_first_entry(
90261 + &pfob->mcc->wrb_context.list_head,
90262 + struct be_mcc_wrb_context, next);
90263 + }
90264 + }
90265 +
90266 + spin_unlock_irqrestore(&pfob->mcc_context_lock, irq);
90267 +
90268 + return context;
90269 +}
90270 +
90271 +void
90272 +_be_mcc_free_wrb_context(struct be_function_object *pfob,
90273 + struct be_mcc_wrb_context *context)
90274 +{
90275 + unsigned long irq;
90276 +
90277 + ASSERT(context);
90278 + /*
90279 + * Zero during free to try and catch any bugs where the context
90280 + * is accessed after a free.
90281 + */
90282 + memset(context, 0, sizeof(context));
90283 +
90284 + spin_lock_irqsave(&pfob->mcc_context_lock, irq);
90285 +
90286 + if (context == &pfob->mailbox.default_context) {
90287 + /* Free the default context. */
90288 + ASSERT(pfob->mailbox.default_context_allocated);
90289 + pfob->mailbox.default_context_allocated = false;
90290 + } else {
90291 + /* Add to free list. */
90292 + ASSERT(pfob->mcc);
90293 + list_add_tail(&context->next,
90294 + &pfob->mcc->wrb_context.list_head);
90295 + }
90296 +
90297 + spin_unlock_irqrestore(&pfob->mcc_context_lock, irq);
90298 +}
90299 +
90300 +int
90301 +be_mcc_add_async_event_callback(struct be_mcc_object *mcc_object,
90302 + mcc_async_event_callback cb, void *cb_context)
90303 +{
90304 + /* Lock against anyone trying to change the callback/context pointers
90305 + * while being used. */
90306 + spin_lock_irqsave(&mcc_object->parent_function->cq_lock,
90307 + mcc_object->parent_function->cq_irq);
90308 +
90309 + /* Assign the async callback. */
90310 + mcc_object->async_context = cb_context;
90311 + mcc_object->async_cb = cb;
90312 +
90313 + spin_unlock_irqrestore(&mcc_object->parent_function->cq_lock,
90314 + mcc_object->parent_function->cq_irq);
90315 +
90316 + return BE_SUCCESS;
90317 +}
90318 +
90319 +#define MPU_EP_CONTROL 0
90320 +#define MPU_EP_SEMAPHORE 0xac
90321 +
90322 +/*
90323 + *-------------------------------------------------------------------
90324 + * Function: be_wait_for_POST_complete
90325 + * Waits until the BladeEngine POST completes (either in error or success).
90326 + * pfob -
90327 + * return status - BE_SUCCESS (0) on success. Negative error code on failure.
90328 + *-------------------------------------------------------------------
90329 + */
90330 +static int be_wait_for_POST_complete(struct be_function_object *pfob)
90331 +{
90332 + struct MGMT_HBA_POST_STATUS_STRUCT_AMAP status;
90333 + int s;
90334 + u32 post_error, post_stage;
90335 +
90336 + const u32 us_per_loop = 1000; /* 1000us */
90337 + const u32 print_frequency_loops = 1000000 / us_per_loop;
90338 + const u32 max_loops = 60 * print_frequency_loops;
90339 + u32 loops = 0;
90340 +
90341 + /*
90342 + * Wait for arm fw indicating it is done or a fatal error happened.
90343 + * Note: POST can take some time to complete depending on configuration
90344 + * settings (consider ARM attempts to acquire an IP address
90345 + * over DHCP!!!).
90346 + *
90347 + */
90348 + do {
90349 + status.dw[0] = ioread32(pfob->csr_va + MPU_EP_SEMAPHORE);
90350 + post_error = AMAP_GET_BITS_PTR(MGMT_HBA_POST_STATUS_STRUCT,
90351 + error, &status);
90352 + post_stage = AMAP_GET_BITS_PTR(MGMT_HBA_POST_STATUS_STRUCT,
90353 + stage, &status);
90354 + if (0 == (loops % print_frequency_loops)) {
90355 + /* Print current status */
90356 + TRACE(DL_INFO, "POST status = 0x%x (stage = 0x%x)",
90357 + status.dw[0], post_stage);
90358 + }
90359 + udelay(us_per_loop);
90360 + } while ((post_error != 1) &&
90361 + (post_stage != POST_STAGE_ARMFW_READY) &&
90362 + (++loops < max_loops));
90363 +
90364 + if (post_error == 1) {
90365 + TRACE(DL_ERR, "POST error! Status = 0x%x (stage = 0x%x)",
90366 + status.dw[0], post_stage);
90367 + s = BE_NOT_OK;
90368 + } else if (post_stage != POST_STAGE_ARMFW_READY) {
90369 + TRACE(DL_ERR, "POST time-out! Status = 0x%x (stage = 0x%x)",
90370 + status.dw[0], post_stage);
90371 + s = BE_NOT_OK;
90372 + } else {
90373 + s = BE_SUCCESS;
90374 + }
90375 + return s;
90376 +}
90377 +
90378 +/*
90379 + *-------------------------------------------------------------------
90380 + * Function: be_kickoff_and_wait_for_POST
90381 + * Interacts with the BladeEngine management processor to initiate POST, and
90382 + * subsequently waits until POST completes (either in error or success).
90383 + * The caller must acquire the reset semaphore before initiating POST
90384 + * to prevent multiple drivers interacting with the management processor.
90385 + * Once POST is complete the caller must release the reset semaphore.
90386 + * Callers who only want to wait for POST complete may call
90387 + * be_wait_for_POST_complete.
90388 + * pfob -
90389 + * return status - BE_SUCCESS (0) on success. Negative error code on failure.
90390 + *-------------------------------------------------------------------
90391 + */
90392 +static int
90393 +be_kickoff_and_wait_for_POST(struct be_function_object *pfob)
90394 +{
90395 + struct MGMT_HBA_POST_STATUS_STRUCT_AMAP status;
90396 + int s;
90397 +
90398 + const u32 us_per_loop = 1000; /* 1000us */
90399 + const u32 print_frequency_loops = 1000000 / us_per_loop;
90400 + const u32 max_loops = 5 * print_frequency_loops;
90401 + u32 loops = 0;
90402 + u32 post_error, post_stage;
90403 +
90404 + /* Wait for arm fw awaiting host ready or a fatal error happened. */
90405 + TRACE(DL_INFO, "Wait for BladeEngine ready to POST");
90406 + do {
90407 + status.dw[0] = ioread32(pfob->csr_va + MPU_EP_SEMAPHORE);
90408 + post_error = AMAP_GET_BITS_PTR(MGMT_HBA_POST_STATUS_STRUCT,
90409 + error, &status);
90410 + post_stage = AMAP_GET_BITS_PTR(MGMT_HBA_POST_STATUS_STRUCT,
90411 + stage, &status);
90412 + if (0 == (loops % print_frequency_loops)) {
90413 + /* Print current status */
90414 + TRACE(DL_INFO, "POST status = 0x%x (stage = 0x%x)",
90415 + status.dw[0], post_stage);
90416 + }
90417 + udelay(us_per_loop);
90418 + } while ((post_error != 1) &&
90419 + (post_stage < POST_STAGE_AWAITING_HOST_RDY) &&
90420 + (++loops < max_loops));
90421 +
90422 + if (post_error == 1) {
90423 + TRACE(DL_ERR, "Pre-POST error! Status = 0x%x (stage = 0x%x)",
90424 + status.dw[0], post_stage);
90425 + s = BE_NOT_OK;
90426 + } else if (post_stage == POST_STAGE_AWAITING_HOST_RDY) {
90427 + iowrite32(POST_STAGE_HOST_RDY, pfob->csr_va + MPU_EP_SEMAPHORE);
90428 +
90429 + /* Wait for POST to complete */
90430 + s = be_wait_for_POST_complete(pfob);
90431 + } else {
90432 + /*
90433 + * Either a timeout waiting for host ready signal or POST has
90434 + * moved ahead without requiring a host ready signal.
90435 + * Might as well give POST a chance to complete
90436 + * (or timeout again).
90437 + */
90438 + s = be_wait_for_POST_complete(pfob);
90439 + }
90440 + return s;
90441 +}
90442 +
90443 +/*
90444 + *-------------------------------------------------------------------
90445 + * Function: be_pci_soft_reset
90446 + * This function is called to issue a BladeEngine soft reset.
90447 + * Callers should acquire the soft reset semaphore before calling this
90448 + * function. Additionaly, callers should ensure they cannot be pre-empted
90449 + * while the routine executes. Upon completion of this routine, callers
90450 + * should release the reset semaphore. This routine implicitly waits
90451 + * for BladeEngine POST to complete.
90452 + * pfob -
90453 + * return status - BE_SUCCESS (0) on success. Negative error code on failure.
90454 + *-------------------------------------------------------------------
90455 + */
90456 +int be_pci_soft_reset(struct be_function_object *pfob)
90457 +{
90458 + struct PCICFG_SOFT_RESET_CSR_AMAP soft_reset;
90459 + struct PCICFG_ONLINE0_CSR_AMAP pciOnline0;
90460 + struct PCICFG_ONLINE1_CSR_AMAP pciOnline1;
90461 + struct EP_CONTROL_CSR_AMAP epControlCsr;
90462 + int status = BE_SUCCESS;
90463 + u32 i, soft_reset_bit;
90464 +
90465 + TRACE(DL_NOTE, "PCI reset...");
90466 +
90467 + /* Issue soft reset #1 to get BladeEngine into a known state. */
90468 + soft_reset.dw[0] = PCICFG0_READ(pfob, soft_reset);
90469 + AMAP_SET_BITS_PTR(PCICFG_SOFT_RESET_CSR, softreset, soft_reset.dw, 1);
90470 + PCICFG0_WRITE(pfob, host_timer_int_ctrl, soft_reset.dw[0]);
90471 + /*
90472 + * wait til soft reset is deasserted - hardware
90473 + * deasserts after some time.
90474 + */
90475 + i = 0;
90476 + do {
90477 + udelay(50);
90478 + soft_reset.dw[0] = PCICFG0_READ(pfob, soft_reset);
90479 + soft_reset_bit = AMAP_GET_BITS_PTR(PCICFG_SOFT_RESET_CSR,
90480 + softreset, soft_reset.dw);
90481 + } while (soft_reset_bit && (i++ < 1024));
90482 + if (soft_reset_bit != 0) {
90483 + TRACE(DL_ERR, "Soft-reset #1 did not deassert as expected.");
90484 + status = BE_NOT_OK;
90485 + goto Error_label;
90486 + }
90487 + /* Mask everything */
90488 + PCICFG0_WRITE(pfob, ue_status_low_mask, 0xFFFFFFFF);
90489 + PCICFG0_WRITE(pfob, ue_status_hi_mask, 0xFFFFFFFF);
90490 + /*
90491 + * Set everything offline except MPU IRAM (it is offline with
90492 + * the soft-reset, but soft-reset does not reset the PCICFG registers!)
90493 + */
90494 + pciOnline0.dw[0] = 0;
90495 + pciOnline1.dw[0] = 0;
90496 + AMAP_SET_BITS_PTR(PCICFG_ONLINE1_CSR, mpu_iram_online,
90497 + pciOnline1.dw, 1);
90498 + PCICFG0_WRITE(pfob, online0, pciOnline0.dw[0]);
90499 + PCICFG0_WRITE(pfob, online1, pciOnline1.dw[0]);
90500 +
90501 + udelay(20000);
90502 +
90503 + /* Issue soft reset #2. */
90504 + AMAP_SET_BITS_PTR(PCICFG_SOFT_RESET_CSR, softreset, soft_reset.dw, 1);
90505 + PCICFG0_WRITE(pfob, host_timer_int_ctrl, soft_reset.dw[0]);
90506 + /*
90507 + * wait til soft reset is deasserted - hardware
90508 + * deasserts after some time.
90509 + */
90510 + i = 0;
90511 + do {
90512 + udelay(50);
90513 + soft_reset.dw[0] = PCICFG0_READ(pfob, soft_reset);
90514 + soft_reset_bit = AMAP_GET_BITS_PTR(PCICFG_SOFT_RESET_CSR,
90515 + softreset, soft_reset.dw);
90516 + } while (soft_reset_bit && (i++ < 1024));
90517 + if (soft_reset_bit != 0) {
90518 + TRACE(DL_ERR, "Soft-reset #1 did not deassert as expected.");
90519 + status = BE_NOT_OK;
90520 + goto Error_label;
90521 + }
90522 +
90523 +
90524 + udelay(20000);
90525 +
90526 + /* Take MPU out of reset. */
90527 +
90528 + epControlCsr.dw[0] = ioread32(pfob->csr_va + MPU_EP_CONTROL);
90529 + AMAP_SET_BITS_PTR(EP_CONTROL_CSR, CPU_reset, &epControlCsr, 0);
90530 + iowrite32((u32)epControlCsr.dw[0], pfob->csr_va + MPU_EP_CONTROL);
90531 +
90532 + /* Kickoff BE POST and wait for completion */
90533 + status = be_kickoff_and_wait_for_POST(pfob);
90534 +
90535 +Error_label:
90536 + return status;
90537 +}
90538 +
90539 +
90540 +/*
90541 + *-------------------------------------------------------------------
90542 + * Function: be_pci_reset_required
90543 + * This private function is called to detect if a host entity is
90544 + * required to issue a PCI soft reset and subsequently drive
90545 + * BladeEngine POST. Scenarios where this is required:
90546 + * 1) BIOS-less configuration
90547 + * 2) Hot-swap/plug/power-on
90548 + * pfob -
90549 + * return true if a reset is required, false otherwise
90550 + *-------------------------------------------------------------------
90551 + */
90552 +static bool be_pci_reset_required(struct be_function_object *pfob)
90553 +{
90554 + struct MGMT_HBA_POST_STATUS_STRUCT_AMAP status;
90555 + bool do_reset = false;
90556 + u32 post_error, post_stage;
90557 +
90558 + /*
90559 + * Read the POST status register
90560 + */
90561 + status.dw[0] = ioread32(pfob->csr_va + MPU_EP_SEMAPHORE);
90562 + post_error = AMAP_GET_BITS_PTR(MGMT_HBA_POST_STATUS_STRUCT, error,
90563 + &status);
90564 + post_stage = AMAP_GET_BITS_PTR(MGMT_HBA_POST_STATUS_STRUCT, stage,
90565 + &status);
90566 + if (post_stage <= POST_STAGE_AWAITING_HOST_RDY) {
90567 + /*
90568 + * If BladeEngine is waiting for host ready indication,
90569 + * we want to do a PCI reset.
90570 + */
90571 + do_reset = true;
90572 + }
90573 +
90574 + return do_reset;
90575 +}
90576 +
90577 +/*
90578 + *-------------------------------------------------------------------
90579 + * Function: be_drive_POST
90580 + * This function is called to drive BladeEngine POST. The
90581 + * caller should ensure they cannot be pre-empted while this routine executes.
90582 + * pfob -
90583 + * return status - BE_SUCCESS (0) on success. Negative error code on failure.
90584 + *-------------------------------------------------------------------
90585 + */
90586 +int be_drive_POST(struct be_function_object *pfob)
90587 +{
90588 + int status;
90589 +
90590 + if (false != be_pci_reset_required(pfob)) {
90591 + /* PCI reset is needed (implicitly starts and waits for POST) */
90592 + status = be_pci_soft_reset(pfob);
90593 + } else {
90594 + /* No PCI reset is needed, start POST */
90595 + status = be_kickoff_and_wait_for_POST(pfob);
90596 + }
90597 +
90598 + return status;
90599 +}
90600 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/mpu_context.h linux-2.6.29-rc3.owrt/drivers/staging/benet/mpu_context.h
90601 --- linux-2.6.29.owrt/drivers/staging/benet/mpu_context.h 1970-01-01 01:00:00.000000000 +0100
90602 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/mpu_context.h 2009-05-10 23:48:29.000000000 +0200
90603 @@ -0,0 +1,46 @@
90604 +/*
90605 + * Copyright (C) 2005 - 2008 ServerEngines
90606 + * All rights reserved.
90607 + *
90608 + * This program is free software; you can redistribute it and/or
90609 + * modify it under the terms of the GNU General Public License version 2
90610 + * as published by the Free Software Foundation. The full GNU General
90611 + * Public License is included in this distribution in the file called COPYING.
90612 + *
90613 + * Contact Information:
90614 + * linux-drivers@serverengines.com
90615 + *
90616 + * ServerEngines
90617 + * 209 N. Fair Oaks Ave
90618 + * Sunnyvale, CA 94085
90619 + */
90620 +/*
90621 + * Autogenerated by srcgen version: 0127
90622 + */
90623 +#ifndef __mpu_context_amap_h__
90624 +#define __mpu_context_amap_h__
90625 +
90626 +/*
90627 + * Management command and control ring context. The MPUs BTLR_CTRL1 CSR
90628 + * controls the writeback behavior of the producer and consumer index values.
90629 + */
90630 +struct BE_MCC_RING_CONTEXT_AMAP {
90631 + u8 con_index[16]; /* DWORD 0 */
90632 + u8 ring_size[4]; /* DWORD 0 */
90633 + u8 cq_id[11]; /* DWORD 0 */
90634 + u8 rsvd0; /* DWORD 0 */
90635 + u8 prod_index[16]; /* DWORD 1 */
90636 + u8 pdid[15]; /* DWORD 1 */
90637 + u8 invalid; /* DWORD 1 */
90638 + u8 cmd_pending_current[7]; /* DWORD 2 */
90639 + u8 rsvd1[25]; /* DWORD 2 */
90640 + u8 hpi_port_cq_id[11]; /* DWORD 3 */
90641 + u8 rsvd2[5]; /* DWORD 3 */
90642 + u8 cmd_pending_max[7]; /* DWORD 3 */
90643 + u8 rsvd3[9]; /* DWORD 3 */
90644 +} __packed;
90645 +struct MCC_RING_CONTEXT_AMAP {
90646 + u32 dw[4];
90647 +};
90648 +
90649 +#endif /* __mpu_context_amap_h__ */
90650 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/mpu.h linux-2.6.29-rc3.owrt/drivers/staging/benet/mpu.h
90651 --- linux-2.6.29.owrt/drivers/staging/benet/mpu.h 1970-01-01 01:00:00.000000000 +0100
90652 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/mpu.h 2009-05-10 23:48:29.000000000 +0200
90653 @@ -0,0 +1,74 @@
90654 +/*
90655 + * Copyright (C) 2005 - 2008 ServerEngines
90656 + * All rights reserved.
90657 + *
90658 + * This program is free software; you can redistribute it and/or
90659 + * modify it under the terms of the GNU General Public License version 2
90660 + * as published by the Free Software Foundation. The full GNU General
90661 + * Public License is included in this distribution in the file called COPYING.
90662 + *
90663 + * Contact Information:
90664 + * linux-drivers@serverengines.com
90665 + *
90666 + * ServerEngines
90667 + * 209 N. Fair Oaks Ave
90668 + * Sunnyvale, CA 94085
90669 + */
90670 +/*
90671 + * Autogenerated by srcgen version: 0127
90672 + */
90673 +#ifndef __mpu_amap_h__
90674 +#define __mpu_amap_h__
90675 +#include "ep.h"
90676 +
90677 +/* Provide control parameters for the Managment Processor Unit. */
90678 +struct BE_MPU_CSRMAP_AMAP {
90679 + struct BE_EP_CSRMAP_AMAP ep;
90680 + u8 rsvd0[128]; /* DWORD 64 */
90681 + u8 rsvd1[32]; /* DWORD 68 */
90682 + u8 rsvd2[192]; /* DWORD 69 */
90683 + u8 rsvd3[192]; /* DWORD 75 */
90684 + u8 rsvd4[32]; /* DWORD 81 */
90685 + u8 rsvd5[32]; /* DWORD 82 */
90686 + u8 rsvd6[32]; /* DWORD 83 */
90687 + u8 rsvd7[32]; /* DWORD 84 */
90688 + u8 rsvd8[32]; /* DWORD 85 */
90689 + u8 rsvd9[32]; /* DWORD 86 */
90690 + u8 rsvd10[32]; /* DWORD 87 */
90691 + u8 rsvd11[32]; /* DWORD 88 */
90692 + u8 rsvd12[32]; /* DWORD 89 */
90693 + u8 rsvd13[32]; /* DWORD 90 */
90694 + u8 rsvd14[32]; /* DWORD 91 */
90695 + u8 rsvd15[32]; /* DWORD 92 */
90696 + u8 rsvd16[32]; /* DWORD 93 */
90697 + u8 rsvd17[32]; /* DWORD 94 */
90698 + u8 rsvd18[32]; /* DWORD 95 */
90699 + u8 rsvd19[32]; /* DWORD 96 */
90700 + u8 rsvd20[32]; /* DWORD 97 */
90701 + u8 rsvd21[32]; /* DWORD 98 */
90702 + u8 rsvd22[32]; /* DWORD 99 */
90703 + u8 rsvd23[32]; /* DWORD 100 */
90704 + u8 rsvd24[32]; /* DWORD 101 */
90705 + u8 rsvd25[32]; /* DWORD 102 */
90706 + u8 rsvd26[32]; /* DWORD 103 */
90707 + u8 rsvd27[32]; /* DWORD 104 */
90708 + u8 rsvd28[96]; /* DWORD 105 */
90709 + u8 rsvd29[32]; /* DWORD 108 */
90710 + u8 rsvd30[32]; /* DWORD 109 */
90711 + u8 rsvd31[32]; /* DWORD 110 */
90712 + u8 rsvd32[32]; /* DWORD 111 */
90713 + u8 rsvd33[32]; /* DWORD 112 */
90714 + u8 rsvd34[96]; /* DWORD 113 */
90715 + u8 rsvd35[32]; /* DWORD 116 */
90716 + u8 rsvd36[32]; /* DWORD 117 */
90717 + u8 rsvd37[32]; /* DWORD 118 */
90718 + u8 rsvd38[32]; /* DWORD 119 */
90719 + u8 rsvd39[32]; /* DWORD 120 */
90720 + u8 rsvd40[32]; /* DWORD 121 */
90721 + u8 rsvd41[134][32]; /* DWORD 122 */
90722 +} __packed;
90723 +struct MPU_CSRMAP_AMAP {
90724 + u32 dw[256];
90725 +};
90726 +
90727 +#endif /* __mpu_amap_h__ */
90728 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/pcicfg.h linux-2.6.29-rc3.owrt/drivers/staging/benet/pcicfg.h
90729 --- linux-2.6.29.owrt/drivers/staging/benet/pcicfg.h 1970-01-01 01:00:00.000000000 +0100
90730 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/pcicfg.h 2009-05-10 23:48:29.000000000 +0200
90731 @@ -0,0 +1,825 @@
90732 +/*
90733 + * Copyright (C) 2005 - 2008 ServerEngines
90734 + * All rights reserved.
90735 + *
90736 + * This program is free software; you can redistribute it and/or
90737 + * modify it under the terms of the GNU General Public License version 2
90738 + * as published by the Free Software Foundation. The full GNU General
90739 + * Public License is included in this distribution in the file called COPYING.
90740 + *
90741 + * Contact Information:
90742 + * linux-drivers@serverengines.com
90743 + *
90744 + * ServerEngines
90745 + * 209 N. Fair Oaks Ave
90746 + * Sunnyvale, CA 94085
90747 + */
90748 +/*
90749 + * Autogenerated by srcgen version: 0127
90750 + */
90751 +#ifndef __pcicfg_amap_h__
90752 +#define __pcicfg_amap_h__
90753 +
90754 +/* Vendor and Device ID Register. */
90755 +struct BE_PCICFG_ID_CSR_AMAP {
90756 + u8 vendorid[16]; /* DWORD 0 */
90757 + u8 deviceid[16]; /* DWORD 0 */
90758 +} __packed;
90759 +struct PCICFG_ID_CSR_AMAP {
90760 + u32 dw[1];
90761 +};
90762 +
90763 +/* IO Bar Register. */
90764 +struct BE_PCICFG_IOBAR_CSR_AMAP {
90765 + u8 iospace; /* DWORD 0 */
90766 + u8 rsvd0[7]; /* DWORD 0 */
90767 + u8 iobar[24]; /* DWORD 0 */
90768 +} __packed;
90769 +struct PCICFG_IOBAR_CSR_AMAP {
90770 + u32 dw[1];
90771 +};
90772 +
90773 +/* Memory BAR 0 Register. */
90774 +struct BE_PCICFG_MEMBAR0_CSR_AMAP {
90775 + u8 memspace; /* DWORD 0 */
90776 + u8 type[2]; /* DWORD 0 */
90777 + u8 pf; /* DWORD 0 */
90778 + u8 rsvd0[10]; /* DWORD 0 */
90779 + u8 membar0[18]; /* DWORD 0 */
90780 +} __packed;
90781 +struct PCICFG_MEMBAR0_CSR_AMAP {
90782 + u32 dw[1];
90783 +};
90784 +
90785 +/* Memory BAR 1 - Low Address Register. */
90786 +struct BE_PCICFG_MEMBAR1_LO_CSR_AMAP {
90787 + u8 memspace; /* DWORD 0 */
90788 + u8 type[2]; /* DWORD 0 */
90789 + u8 pf; /* DWORD 0 */
90790 + u8 rsvd0[13]; /* DWORD 0 */
90791 + u8 membar1lo[15]; /* DWORD 0 */
90792 +} __packed;
90793 +struct PCICFG_MEMBAR1_LO_CSR_AMAP {
90794 + u32 dw[1];
90795 +};
90796 +
90797 +/* Memory BAR 1 - High Address Register. */
90798 +struct BE_PCICFG_MEMBAR1_HI_CSR_AMAP {
90799 + u8 membar1hi[32]; /* DWORD 0 */
90800 +} __packed;
90801 +struct PCICFG_MEMBAR1_HI_CSR_AMAP {
90802 + u32 dw[1];
90803 +};
90804 +
90805 +/* Memory BAR 2 - Low Address Register. */
90806 +struct BE_PCICFG_MEMBAR2_LO_CSR_AMAP {
90807 + u8 memspace; /* DWORD 0 */
90808 + u8 type[2]; /* DWORD 0 */
90809 + u8 pf; /* DWORD 0 */
90810 + u8 rsvd0[17]; /* DWORD 0 */
90811 + u8 membar2lo[11]; /* DWORD 0 */
90812 +} __packed;
90813 +struct PCICFG_MEMBAR2_LO_CSR_AMAP {
90814 + u32 dw[1];
90815 +};
90816 +
90817 +/* Memory BAR 2 - High Address Register. */
90818 +struct BE_PCICFG_MEMBAR2_HI_CSR_AMAP {
90819 + u8 membar2hi[32]; /* DWORD 0 */
90820 +} __packed;
90821 +struct PCICFG_MEMBAR2_HI_CSR_AMAP {
90822 + u32 dw[1];
90823 +};
90824 +
90825 +/* Subsystem Vendor and ID (Function 0) Register. */
90826 +struct BE_PCICFG_SUBSYSTEM_ID_F0_CSR_AMAP {
90827 + u8 subsys_vendor_id[16]; /* DWORD 0 */
90828 + u8 subsys_id[16]; /* DWORD 0 */
90829 +} __packed;
90830 +struct PCICFG_SUBSYSTEM_ID_F0_CSR_AMAP {
90831 + u32 dw[1];
90832 +};
90833 +
90834 +/* Subsystem Vendor and ID (Function 1) Register. */
90835 +struct BE_PCICFG_SUBSYSTEM_ID_F1_CSR_AMAP {
90836 + u8 subsys_vendor_id[16]; /* DWORD 0 */
90837 + u8 subsys_id[16]; /* DWORD 0 */
90838 +} __packed;
90839 +struct PCICFG_SUBSYSTEM_ID_F1_CSR_AMAP {
90840 + u32 dw[1];
90841 +};
90842 +
90843 +/* Semaphore Register. */
90844 +struct BE_PCICFG_SEMAPHORE_CSR_AMAP {
90845 + u8 locked; /* DWORD 0 */
90846 + u8 rsvd0[31]; /* DWORD 0 */
90847 +} __packed;
90848 +struct PCICFG_SEMAPHORE_CSR_AMAP {
90849 + u32 dw[1];
90850 +};
90851 +
90852 +/* Soft Reset Register. */
90853 +struct BE_PCICFG_SOFT_RESET_CSR_AMAP {
90854 + u8 rsvd0[7]; /* DWORD 0 */
90855 + u8 softreset; /* DWORD 0 */
90856 + u8 rsvd1[16]; /* DWORD 0 */
90857 + u8 nec_ll_rcvdetect_i[8]; /* DWORD 0 */
90858 +} __packed;
90859 +struct PCICFG_SOFT_RESET_CSR_AMAP {
90860 + u32 dw[1];
90861 +};
90862 +
90863 +/* Unrecoverable Error Status (Low) Register. Each bit corresponds to
90864 + * an internal Unrecoverable Error. These are set by hardware and may be
90865 + * cleared by writing a one to the respective bit(s) to be cleared. Any
90866 + * bit being set that is also unmasked will result in Unrecoverable Error
90867 + * interrupt notification to the host CPU and/or Server Management chip
90868 + * and the transitioning of BladeEngine to an Offline state.
90869 + */
90870 +struct BE_PCICFG_UE_STATUS_LOW_CSR_AMAP {
90871 + u8 cev_ue_status; /* DWORD 0 */
90872 + u8 ctx_ue_status; /* DWORD 0 */
90873 + u8 dbuf_ue_status; /* DWORD 0 */
90874 + u8 erx_ue_status; /* DWORD 0 */
90875 + u8 host_ue_status; /* DWORD 0 */
90876 + u8 mpu_ue_status; /* DWORD 0 */
90877 + u8 ndma_ue_status; /* DWORD 0 */
90878 + u8 ptc_ue_status; /* DWORD 0 */
90879 + u8 rdma_ue_status; /* DWORD 0 */
90880 + u8 rxf_ue_status; /* DWORD 0 */
90881 + u8 rxips_ue_status; /* DWORD 0 */
90882 + u8 rxulp0_ue_status; /* DWORD 0 */
90883 + u8 rxulp1_ue_status; /* DWORD 0 */
90884 + u8 rxulp2_ue_status; /* DWORD 0 */
90885 + u8 tim_ue_status; /* DWORD 0 */
90886 + u8 tpost_ue_status; /* DWORD 0 */
90887 + u8 tpre_ue_status; /* DWORD 0 */
90888 + u8 txips_ue_status; /* DWORD 0 */
90889 + u8 txulp0_ue_status; /* DWORD 0 */
90890 + u8 txulp1_ue_status; /* DWORD 0 */
90891 + u8 uc_ue_status; /* DWORD 0 */
90892 + u8 wdma_ue_status; /* DWORD 0 */
90893 + u8 txulp2_ue_status; /* DWORD 0 */
90894 + u8 host1_ue_status; /* DWORD 0 */
90895 + u8 p0_ob_link_ue_status; /* DWORD 0 */
90896 + u8 p1_ob_link_ue_status; /* DWORD 0 */
90897 + u8 host_gpio_ue_status; /* DWORD 0 */
90898 + u8 mbox_netw_ue_status; /* DWORD 0 */
90899 + u8 mbox_stor_ue_status; /* DWORD 0 */
90900 + u8 axgmac0_ue_status; /* DWORD 0 */
90901 + u8 axgmac1_ue_status; /* DWORD 0 */
90902 + u8 mpu_intpend_ue_status; /* DWORD 0 */
90903 +} __packed;
90904 +struct PCICFG_UE_STATUS_LOW_CSR_AMAP {
90905 + u32 dw[1];
90906 +};
90907 +
90908 +/* Unrecoverable Error Status (High) Register. Each bit corresponds to
90909 + * an internal Unrecoverable Error. These are set by hardware and may be
90910 + * cleared by writing a one to the respective bit(s) to be cleared. Any
90911 + * bit being set that is also unmasked will result in Unrecoverable Error
90912 + * interrupt notification to the host CPU and/or Server Management chip;
90913 + * and the transitioning of BladeEngine to an Offline state.
90914 + */
90915 +struct BE_PCICFG_UE_STATUS_HI_CSR_AMAP {
90916 + u8 jtag_ue_status; /* DWORD 0 */
90917 + u8 lpcmemhost_ue_status; /* DWORD 0 */
90918 + u8 mgmt_mac_ue_status; /* DWORD 0 */
90919 + u8 mpu_iram_ue_status; /* DWORD 0 */
90920 + u8 pcs0online_ue_status; /* DWORD 0 */
90921 + u8 pcs1online_ue_status; /* DWORD 0 */
90922 + u8 pctl0_ue_status; /* DWORD 0 */
90923 + u8 pctl1_ue_status; /* DWORD 0 */
90924 + u8 pmem_ue_status; /* DWORD 0 */
90925 + u8 rr_ue_status; /* DWORD 0 */
90926 + u8 rxpp_ue_status; /* DWORD 0 */
90927 + u8 txpb_ue_status; /* DWORD 0 */
90928 + u8 txp_ue_status; /* DWORD 0 */
90929 + u8 xaui_ue_status; /* DWORD 0 */
90930 + u8 arm_ue_status; /* DWORD 0 */
90931 + u8 ipc_ue_status; /* DWORD 0 */
90932 + u8 rsvd0[16]; /* DWORD 0 */
90933 +} __packed;
90934 +struct PCICFG_UE_STATUS_HI_CSR_AMAP {
90935 + u32 dw[1];
90936 +};
90937 +
90938 +/* Unrecoverable Error Mask (Low) Register. Each bit, when set to one,
90939 + * will mask the associated Unrecoverable Error status bit from notification
90940 + * of Unrecoverable Error to the host CPU and/or Server Managment chip and the
90941 + * transitioning of all BladeEngine units to an Offline state.
90942 + */
90943 +struct BE_PCICFG_UE_STATUS_LOW_MASK_CSR_AMAP {
90944 + u8 cev_ue_mask; /* DWORD 0 */
90945 + u8 ctx_ue_mask; /* DWORD 0 */
90946 + u8 dbuf_ue_mask; /* DWORD 0 */
90947 + u8 erx_ue_mask; /* DWORD 0 */
90948 + u8 host_ue_mask; /* DWORD 0 */
90949 + u8 mpu_ue_mask; /* DWORD 0 */
90950 + u8 ndma_ue_mask; /* DWORD 0 */
90951 + u8 ptc_ue_mask; /* DWORD 0 */
90952 + u8 rdma_ue_mask; /* DWORD 0 */
90953 + u8 rxf_ue_mask; /* DWORD 0 */
90954 + u8 rxips_ue_mask; /* DWORD 0 */
90955 + u8 rxulp0_ue_mask; /* DWORD 0 */
90956 + u8 rxulp1_ue_mask; /* DWORD 0 */
90957 + u8 rxulp2_ue_mask; /* DWORD 0 */
90958 + u8 tim_ue_mask; /* DWORD 0 */
90959 + u8 tpost_ue_mask; /* DWORD 0 */
90960 + u8 tpre_ue_mask; /* DWORD 0 */
90961 + u8 txips_ue_mask; /* DWORD 0 */
90962 + u8 txulp0_ue_mask; /* DWORD 0 */
90963 + u8 txulp1_ue_mask; /* DWORD 0 */
90964 + u8 uc_ue_mask; /* DWORD 0 */
90965 + u8 wdma_ue_mask; /* DWORD 0 */
90966 + u8 txulp2_ue_mask; /* DWORD 0 */
90967 + u8 host1_ue_mask; /* DWORD 0 */
90968 + u8 p0_ob_link_ue_mask; /* DWORD 0 */
90969 + u8 p1_ob_link_ue_mask; /* DWORD 0 */
90970 + u8 host_gpio_ue_mask; /* DWORD 0 */
90971 + u8 mbox_netw_ue_mask; /* DWORD 0 */
90972 + u8 mbox_stor_ue_mask; /* DWORD 0 */
90973 + u8 axgmac0_ue_mask; /* DWORD 0 */
90974 + u8 axgmac1_ue_mask; /* DWORD 0 */
90975 + u8 mpu_intpend_ue_mask; /* DWORD 0 */
90976 +} __packed;
90977 +struct PCICFG_UE_STATUS_LOW_MASK_CSR_AMAP {
90978 + u32 dw[1];
90979 +};
90980 +
90981 +/* Unrecoverable Error Mask (High) Register. Each bit, when set to one,
90982 + * will mask the associated Unrecoverable Error status bit from notification
90983 + * of Unrecoverable Error to the host CPU and/or Server Managment chip and the
90984 + * transitioning of all BladeEngine units to an Offline state.
90985 + */
90986 +struct BE_PCICFG_UE_STATUS_HI_MASK_CSR_AMAP {
90987 + u8 jtag_ue_mask; /* DWORD 0 */
90988 + u8 lpcmemhost_ue_mask; /* DWORD 0 */
90989 + u8 mgmt_mac_ue_mask; /* DWORD 0 */
90990 + u8 mpu_iram_ue_mask; /* DWORD 0 */
90991 + u8 pcs0online_ue_mask; /* DWORD 0 */
90992 + u8 pcs1online_ue_mask; /* DWORD 0 */
90993 + u8 pctl0_ue_mask; /* DWORD 0 */
90994 + u8 pctl1_ue_mask; /* DWORD 0 */
90995 + u8 pmem_ue_mask; /* DWORD 0 */
90996 + u8 rr_ue_mask; /* DWORD 0 */
90997 + u8 rxpp_ue_mask; /* DWORD 0 */
90998 + u8 txpb_ue_mask; /* DWORD 0 */
90999 + u8 txp_ue_mask; /* DWORD 0 */
91000 + u8 xaui_ue_mask; /* DWORD 0 */
91001 + u8 arm_ue_mask; /* DWORD 0 */
91002 + u8 ipc_ue_mask; /* DWORD 0 */
91003 + u8 rsvd0[16]; /* DWORD 0 */
91004 +} __packed;
91005 +struct PCICFG_UE_STATUS_HI_MASK_CSR_AMAP {
91006 + u32 dw[1];
91007 +};
91008 +
91009 +/* Online Control Register 0. This register controls various units within
91010 + * BladeEngine being in an Online or Offline state.
91011 + */
91012 +struct BE_PCICFG_ONLINE0_CSR_AMAP {
91013 + u8 cev_online; /* DWORD 0 */
91014 + u8 ctx_online; /* DWORD 0 */
91015 + u8 dbuf_online; /* DWORD 0 */
91016 + u8 erx_online; /* DWORD 0 */
91017 + u8 host_online; /* DWORD 0 */
91018 + u8 mpu_online; /* DWORD 0 */
91019 + u8 ndma_online; /* DWORD 0 */
91020 + u8 ptc_online; /* DWORD 0 */
91021 + u8 rdma_online; /* DWORD 0 */
91022 + u8 rxf_online; /* DWORD 0 */
91023 + u8 rxips_online; /* DWORD 0 */
91024 + u8 rxulp0_online; /* DWORD 0 */
91025 + u8 rxulp1_online; /* DWORD 0 */
91026 + u8 rxulp2_online; /* DWORD 0 */
91027 + u8 tim_online; /* DWORD 0 */
91028 + u8 tpost_online; /* DWORD 0 */
91029 + u8 tpre_online; /* DWORD 0 */
91030 + u8 txips_online; /* DWORD 0 */
91031 + u8 txulp0_online; /* DWORD 0 */
91032 + u8 txulp1_online; /* DWORD 0 */
91033 + u8 uc_online; /* DWORD 0 */
91034 + u8 wdma_online; /* DWORD 0 */
91035 + u8 txulp2_online; /* DWORD 0 */
91036 + u8 host1_online; /* DWORD 0 */
91037 + u8 p0_ob_link_online; /* DWORD 0 */
91038 + u8 p1_ob_link_online; /* DWORD 0 */
91039 + u8 host_gpio_online; /* DWORD 0 */
91040 + u8 mbox_netw_online; /* DWORD 0 */
91041 + u8 mbox_stor_online; /* DWORD 0 */
91042 + u8 axgmac0_online; /* DWORD 0 */
91043 + u8 axgmac1_online; /* DWORD 0 */
91044 + u8 mpu_intpend_online; /* DWORD 0 */
91045 +} __packed;
91046 +struct PCICFG_ONLINE0_CSR_AMAP {
91047 + u32 dw[1];
91048 +};
91049 +
91050 +/* Online Control Register 1. This register controls various units within
91051 + * BladeEngine being in an Online or Offline state.
91052 + */
91053 +struct BE_PCICFG_ONLINE1_CSR_AMAP {
91054 + u8 jtag_online; /* DWORD 0 */
91055 + u8 lpcmemhost_online; /* DWORD 0 */
91056 + u8 mgmt_mac_online; /* DWORD 0 */
91057 + u8 mpu_iram_online; /* DWORD 0 */
91058 + u8 pcs0online_online; /* DWORD 0 */
91059 + u8 pcs1online_online; /* DWORD 0 */
91060 + u8 pctl0_online; /* DWORD 0 */
91061 + u8 pctl1_online; /* DWORD 0 */
91062 + u8 pmem_online; /* DWORD 0 */
91063 + u8 rr_online; /* DWORD 0 */
91064 + u8 rxpp_online; /* DWORD 0 */
91065 + u8 txpb_online; /* DWORD 0 */
91066 + u8 txp_online; /* DWORD 0 */
91067 + u8 xaui_online; /* DWORD 0 */
91068 + u8 arm_online; /* DWORD 0 */
91069 + u8 ipc_online; /* DWORD 0 */
91070 + u8 rsvd0[16]; /* DWORD 0 */
91071 +} __packed;
91072 +struct PCICFG_ONLINE1_CSR_AMAP {
91073 + u32 dw[1];
91074 +};
91075 +
91076 +/* Host Timer Register. */
91077 +struct BE_PCICFG_HOST_TIMER_INT_CTRL_CSR_AMAP {
91078 + u8 hosttimer[24]; /* DWORD 0 */
91079 + u8 hostintr; /* DWORD 0 */
91080 + u8 rsvd0[7]; /* DWORD 0 */
91081 +} __packed;
91082 +struct PCICFG_HOST_TIMER_INT_CTRL_CSR_AMAP {
91083 + u32 dw[1];
91084 +};
91085 +
91086 +/* Scratchpad Register (for software use). */
91087 +struct BE_PCICFG_SCRATCHPAD_CSR_AMAP {
91088 + u8 scratchpad[32]; /* DWORD 0 */
91089 +} __packed;
91090 +struct PCICFG_SCRATCHPAD_CSR_AMAP {
91091 + u32 dw[1];
91092 +};
91093 +
91094 +/* PCI Express Capabilities Register. */
91095 +struct BE_PCICFG_PCIE_CAP_CSR_AMAP {
91096 + u8 capid[8]; /* DWORD 0 */
91097 + u8 nextcap[8]; /* DWORD 0 */
91098 + u8 capver[4]; /* DWORD 0 */
91099 + u8 devport[4]; /* DWORD 0 */
91100 + u8 rsvd0[6]; /* DWORD 0 */
91101 + u8 rsvd1[2]; /* DWORD 0 */
91102 +} __packed;
91103 +struct PCICFG_PCIE_CAP_CSR_AMAP {
91104 + u32 dw[1];
91105 +};
91106 +
91107 +/* PCI Express Device Capabilities Register. */
91108 +struct BE_PCICFG_PCIE_DEVCAP_CSR_AMAP {
91109 + u8 payload[3]; /* DWORD 0 */
91110 + u8 rsvd0[3]; /* DWORD 0 */
91111 + u8 lo_lat[3]; /* DWORD 0 */
91112 + u8 l1_lat[3]; /* DWORD 0 */
91113 + u8 rsvd1[3]; /* DWORD 0 */
91114 + u8 rsvd2[3]; /* DWORD 0 */
91115 + u8 pwr_value[8]; /* DWORD 0 */
91116 + u8 pwr_scale[2]; /* DWORD 0 */
91117 + u8 rsvd3[4]; /* DWORD 0 */
91118 +} __packed;
91119 +struct PCICFG_PCIE_DEVCAP_CSR_AMAP {
91120 + u32 dw[1];
91121 +};
91122 +
91123 +/* PCI Express Device Control/Status Registers. */
91124 +struct BE_PCICFG_PCIE_CONTROL_STATUS_CSR_AMAP {
91125 + u8 CorrErrReportEn; /* DWORD 0 */
91126 + u8 NonFatalErrReportEn; /* DWORD 0 */
91127 + u8 FatalErrReportEn; /* DWORD 0 */
91128 + u8 UnsuppReqReportEn; /* DWORD 0 */
91129 + u8 EnableRelaxOrder; /* DWORD 0 */
91130 + u8 Max_Payload_Size[3]; /* DWORD 0 */
91131 + u8 ExtendTagFieldEnable; /* DWORD 0 */
91132 + u8 PhantomFnEnable; /* DWORD 0 */
91133 + u8 AuxPwrPMEnable; /* DWORD 0 */
91134 + u8 EnableNoSnoop; /* DWORD 0 */
91135 + u8 Max_Read_Req_Size[3]; /* DWORD 0 */
91136 + u8 rsvd0; /* DWORD 0 */
91137 + u8 CorrErrDetect; /* DWORD 0 */
91138 + u8 NonFatalErrDetect; /* DWORD 0 */
91139 + u8 FatalErrDetect; /* DWORD 0 */
91140 + u8 UnsuppReqDetect; /* DWORD 0 */
91141 + u8 AuxPwrDetect; /* DWORD 0 */
91142 + u8 TransPending; /* DWORD 0 */
91143 + u8 rsvd1[10]; /* DWORD 0 */
91144 +} __packed;
91145 +struct PCICFG_PCIE_CONTROL_STATUS_CSR_AMAP {
91146 + u32 dw[1];
91147 +};
91148 +
91149 +/* PCI Express Link Capabilities Register. */
91150 +struct BE_PCICFG_PCIE_LINK_CAP_CSR_AMAP {
91151 + u8 MaxLinkSpeed[4]; /* DWORD 0 */
91152 + u8 MaxLinkWidth[6]; /* DWORD 0 */
91153 + u8 ASPMSupport[2]; /* DWORD 0 */
91154 + u8 L0sExitLat[3]; /* DWORD 0 */
91155 + u8 L1ExitLat[3]; /* DWORD 0 */
91156 + u8 rsvd0[6]; /* DWORD 0 */
91157 + u8 PortNum[8]; /* DWORD 0 */
91158 +} __packed;
91159 +struct PCICFG_PCIE_LINK_CAP_CSR_AMAP {
91160 + u32 dw[1];
91161 +};
91162 +
91163 +/* PCI Express Link Status Register. */
91164 +struct BE_PCICFG_PCIE_LINK_STATUS_CSR_AMAP {
91165 + u8 ASPMCtl[2]; /* DWORD 0 */
91166 + u8 rsvd0; /* DWORD 0 */
91167 + u8 ReadCmplBndry; /* DWORD 0 */
91168 + u8 LinkDisable; /* DWORD 0 */
91169 + u8 RetrainLink; /* DWORD 0 */
91170 + u8 CommonClkConfig; /* DWORD 0 */
91171 + u8 ExtendSync; /* DWORD 0 */
91172 + u8 rsvd1[8]; /* DWORD 0 */
91173 + u8 LinkSpeed[4]; /* DWORD 0 */
91174 + u8 NegLinkWidth[6]; /* DWORD 0 */
91175 + u8 LinkTrainErr; /* DWORD 0 */
91176 + u8 LinkTrain; /* DWORD 0 */
91177 + u8 SlotClkConfig; /* DWORD 0 */
91178 + u8 rsvd2[3]; /* DWORD 0 */
91179 +} __packed;
91180 +struct PCICFG_PCIE_LINK_STATUS_CSR_AMAP {
91181 + u32 dw[1];
91182 +};
91183 +
91184 +/* PCI Express MSI Configuration Register. */
91185 +struct BE_PCICFG_MSI_CSR_AMAP {
91186 + u8 capid[8]; /* DWORD 0 */
91187 + u8 nextptr[8]; /* DWORD 0 */
91188 + u8 tablesize[11]; /* DWORD 0 */
91189 + u8 rsvd0[3]; /* DWORD 0 */
91190 + u8 funcmask; /* DWORD 0 */
91191 + u8 en; /* DWORD 0 */
91192 +} __packed;
91193 +struct PCICFG_MSI_CSR_AMAP {
91194 + u32 dw[1];
91195 +};
91196 +
91197 +/* MSI-X Table Offset Register. */
91198 +struct BE_PCICFG_MSIX_TABLE_CSR_AMAP {
91199 + u8 tablebir[3]; /* DWORD 0 */
91200 + u8 offset[29]; /* DWORD 0 */
91201 +} __packed;
91202 +struct PCICFG_MSIX_TABLE_CSR_AMAP {
91203 + u32 dw[1];
91204 +};
91205 +
91206 +/* MSI-X PBA Offset Register. */
91207 +struct BE_PCICFG_MSIX_PBA_CSR_AMAP {
91208 + u8 pbabir[3]; /* DWORD 0 */
91209 + u8 offset[29]; /* DWORD 0 */
91210 +} __packed;
91211 +struct PCICFG_MSIX_PBA_CSR_AMAP {
91212 + u32 dw[1];
91213 +};
91214 +
91215 +/* PCI Express MSI-X Message Vector Control Register. */
91216 +struct BE_PCICFG_MSIX_VECTOR_CONTROL_CSR_AMAP {
91217 + u8 vector_control; /* DWORD 0 */
91218 + u8 rsvd0[31]; /* DWORD 0 */
91219 +} __packed;
91220 +struct PCICFG_MSIX_VECTOR_CONTROL_CSR_AMAP {
91221 + u32 dw[1];
91222 +};
91223 +
91224 +/* PCI Express MSI-X Message Data Register. */
91225 +struct BE_PCICFG_MSIX_MSG_DATA_CSR_AMAP {
91226 + u8 data[16]; /* DWORD 0 */
91227 + u8 rsvd0[16]; /* DWORD 0 */
91228 +} __packed;
91229 +struct PCICFG_MSIX_MSG_DATA_CSR_AMAP {
91230 + u32 dw[1];
91231 +};
91232 +
91233 +/* PCI Express MSI-X Message Address Register - High Part. */
91234 +struct BE_PCICFG_MSIX_MSG_ADDR_HI_CSR_AMAP {
91235 + u8 addr[32]; /* DWORD 0 */
91236 +} __packed;
91237 +struct PCICFG_MSIX_MSG_ADDR_HI_CSR_AMAP {
91238 + u32 dw[1];
91239 +};
91240 +
91241 +/* PCI Express MSI-X Message Address Register - Low Part. */
91242 +struct BE_PCICFG_MSIX_MSG_ADDR_LO_CSR_AMAP {
91243 + u8 rsvd0[2]; /* DWORD 0 */
91244 + u8 addr[30]; /* DWORD 0 */
91245 +} __packed;
91246 +struct PCICFG_MSIX_MSG_ADDR_LO_CSR_AMAP {
91247 + u32 dw[1];
91248 +};
91249 +
91250 +struct BE_PCICFG_ANON_18_RSVD_AMAP {
91251 + u8 rsvd0[32]; /* DWORD 0 */
91252 +} __packed;
91253 +struct PCICFG_ANON_18_RSVD_AMAP {
91254 + u32 dw[1];
91255 +};
91256 +
91257 +struct BE_PCICFG_ANON_19_RSVD_AMAP {
91258 + u8 rsvd0[32]; /* DWORD 0 */
91259 +} __packed;
91260 +struct PCICFG_ANON_19_RSVD_AMAP {
91261 + u32 dw[1];
91262 +};
91263 +
91264 +struct BE_PCICFG_ANON_20_RSVD_AMAP {
91265 + u8 rsvd0[32]; /* DWORD 0 */
91266 + u8 rsvd1[25][32]; /* DWORD 1 */
91267 +} __packed;
91268 +struct PCICFG_ANON_20_RSVD_AMAP {
91269 + u32 dw[26];
91270 +};
91271 +
91272 +struct BE_PCICFG_ANON_21_RSVD_AMAP {
91273 + u8 rsvd0[32]; /* DWORD 0 */
91274 + u8 rsvd1[1919][32]; /* DWORD 1 */
91275 +} __packed;
91276 +struct PCICFG_ANON_21_RSVD_AMAP {
91277 + u32 dw[1920];
91278 +};
91279 +
91280 +struct BE_PCICFG_ANON_22_MESSAGE_AMAP {
91281 + struct BE_PCICFG_MSIX_VECTOR_CONTROL_CSR_AMAP vec_ctrl;
91282 + struct BE_PCICFG_MSIX_MSG_DATA_CSR_AMAP msg_data;
91283 + struct BE_PCICFG_MSIX_MSG_ADDR_HI_CSR_AMAP addr_hi;
91284 + struct BE_PCICFG_MSIX_MSG_ADDR_LO_CSR_AMAP addr_low;
91285 +} __packed;
91286 +struct PCICFG_ANON_22_MESSAGE_AMAP {
91287 + u32 dw[4];
91288 +};
91289 +
91290 +struct BE_PCICFG_ANON_23_RSVD_AMAP {
91291 + u8 rsvd0[32]; /* DWORD 0 */
91292 + u8 rsvd1[895][32]; /* DWORD 1 */
91293 +} __packed;
91294 +struct PCICFG_ANON_23_RSVD_AMAP {
91295 + u32 dw[896];
91296 +};
91297 +
91298 +/* These PCI Configuration Space registers are for the Storage Function of
91299 + * BladeEngine (Function 0). In the memory map of the registers below their
91300 + * table,
91301 + */
91302 +struct BE_PCICFG0_CSRMAP_AMAP {
91303 + struct BE_PCICFG_ID_CSR_AMAP id;
91304 + u8 rsvd0[32]; /* DWORD 1 */
91305 + u8 rsvd1[32]; /* DWORD 2 */
91306 + u8 rsvd2[32]; /* DWORD 3 */
91307 + struct BE_PCICFG_IOBAR_CSR_AMAP iobar;
91308 + struct BE_PCICFG_MEMBAR0_CSR_AMAP membar0;
91309 + struct BE_PCICFG_MEMBAR1_LO_CSR_AMAP membar1_lo;
91310 + struct BE_PCICFG_MEMBAR1_HI_CSR_AMAP membar1_hi;
91311 + struct BE_PCICFG_MEMBAR2_LO_CSR_AMAP membar2_lo;
91312 + struct BE_PCICFG_MEMBAR2_HI_CSR_AMAP membar2_hi;
91313 + u8 rsvd3[32]; /* DWORD 10 */
91314 + struct BE_PCICFG_SUBSYSTEM_ID_F0_CSR_AMAP subsystem_id;
91315 + u8 rsvd4[32]; /* DWORD 12 */
91316 + u8 rsvd5[32]; /* DWORD 13 */
91317 + u8 rsvd6[32]; /* DWORD 14 */
91318 + u8 rsvd7[32]; /* DWORD 15 */
91319 + struct BE_PCICFG_SEMAPHORE_CSR_AMAP semaphore[4];
91320 + struct BE_PCICFG_SOFT_RESET_CSR_AMAP soft_reset;
91321 + u8 rsvd8[32]; /* DWORD 21 */
91322 + struct BE_PCICFG_SCRATCHPAD_CSR_AMAP scratchpad;
91323 + u8 rsvd9[32]; /* DWORD 23 */
91324 + u8 rsvd10[32]; /* DWORD 24 */
91325 + u8 rsvd11[32]; /* DWORD 25 */
91326 + u8 rsvd12[32]; /* DWORD 26 */
91327 + u8 rsvd13[32]; /* DWORD 27 */
91328 + u8 rsvd14[2][32]; /* DWORD 28 */
91329 + u8 rsvd15[32]; /* DWORD 30 */
91330 + u8 rsvd16[32]; /* DWORD 31 */
91331 + u8 rsvd17[8][32]; /* DWORD 32 */
91332 + struct BE_PCICFG_UE_STATUS_LOW_CSR_AMAP ue_status_low;
91333 + struct BE_PCICFG_UE_STATUS_HI_CSR_AMAP ue_status_hi;
91334 + struct BE_PCICFG_UE_STATUS_LOW_MASK_CSR_AMAP ue_status_low_mask;
91335 + struct BE_PCICFG_UE_STATUS_HI_MASK_CSR_AMAP ue_status_hi_mask;
91336 + struct BE_PCICFG_ONLINE0_CSR_AMAP online0;
91337 + struct BE_PCICFG_ONLINE1_CSR_AMAP online1;
91338 + u8 rsvd18[32]; /* DWORD 46 */
91339 + u8 rsvd19[32]; /* DWORD 47 */
91340 + u8 rsvd20[32]; /* DWORD 48 */
91341 + u8 rsvd21[32]; /* DWORD 49 */
91342 + struct BE_PCICFG_HOST_TIMER_INT_CTRL_CSR_AMAP host_timer_int_ctrl;
91343 + u8 rsvd22[32]; /* DWORD 51 */
91344 + struct BE_PCICFG_PCIE_CAP_CSR_AMAP pcie_cap;
91345 + struct BE_PCICFG_PCIE_DEVCAP_CSR_AMAP pcie_devcap;
91346 + struct BE_PCICFG_PCIE_CONTROL_STATUS_CSR_AMAP pcie_control_status;
91347 + struct BE_PCICFG_PCIE_LINK_CAP_CSR_AMAP pcie_link_cap;
91348 + struct BE_PCICFG_PCIE_LINK_STATUS_CSR_AMAP pcie_link_status;
91349 + struct BE_PCICFG_MSI_CSR_AMAP msi;
91350 + struct BE_PCICFG_MSIX_TABLE_CSR_AMAP msix_table_offset;
91351 + struct BE_PCICFG_MSIX_PBA_CSR_AMAP msix_pba_offset;
91352 + u8 rsvd23[32]; /* DWORD 60 */
91353 + u8 rsvd24[32]; /* DWORD 61 */
91354 + u8 rsvd25[32]; /* DWORD 62 */
91355 + u8 rsvd26[32]; /* DWORD 63 */
91356 + u8 rsvd27[32]; /* DWORD 64 */
91357 + u8 rsvd28[32]; /* DWORD 65 */
91358 + u8 rsvd29[32]; /* DWORD 66 */
91359 + u8 rsvd30[32]; /* DWORD 67 */
91360 + u8 rsvd31[32]; /* DWORD 68 */
91361 + u8 rsvd32[32]; /* DWORD 69 */
91362 + u8 rsvd33[32]; /* DWORD 70 */
91363 + u8 rsvd34[32]; /* DWORD 71 */
91364 + u8 rsvd35[32]; /* DWORD 72 */
91365 + u8 rsvd36[32]; /* DWORD 73 */
91366 + u8 rsvd37[32]; /* DWORD 74 */
91367 + u8 rsvd38[32]; /* DWORD 75 */
91368 + u8 rsvd39[32]; /* DWORD 76 */
91369 + u8 rsvd40[32]; /* DWORD 77 */
91370 + u8 rsvd41[32]; /* DWORD 78 */
91371 + u8 rsvd42[32]; /* DWORD 79 */
91372 + u8 rsvd43[32]; /* DWORD 80 */
91373 + u8 rsvd44[32]; /* DWORD 81 */
91374 + u8 rsvd45[32]; /* DWORD 82 */
91375 + u8 rsvd46[32]; /* DWORD 83 */
91376 + u8 rsvd47[32]; /* DWORD 84 */
91377 + u8 rsvd48[32]; /* DWORD 85 */
91378 + u8 rsvd49[32]; /* DWORD 86 */
91379 + u8 rsvd50[32]; /* DWORD 87 */
91380 + u8 rsvd51[32]; /* DWORD 88 */
91381 + u8 rsvd52[32]; /* DWORD 89 */
91382 + u8 rsvd53[32]; /* DWORD 90 */
91383 + u8 rsvd54[32]; /* DWORD 91 */
91384 + u8 rsvd55[32]; /* DWORD 92 */
91385 + u8 rsvd56[832]; /* DWORD 93 */
91386 + u8 rsvd57[32]; /* DWORD 119 */
91387 + u8 rsvd58[32]; /* DWORD 120 */
91388 + u8 rsvd59[32]; /* DWORD 121 */
91389 + u8 rsvd60[32]; /* DWORD 122 */
91390 + u8 rsvd61[32]; /* DWORD 123 */
91391 + u8 rsvd62[32]; /* DWORD 124 */
91392 + u8 rsvd63[32]; /* DWORD 125 */
91393 + u8 rsvd64[32]; /* DWORD 126 */
91394 + u8 rsvd65[32]; /* DWORD 127 */
91395 + u8 rsvd66[61440]; /* DWORD 128 */
91396 + struct BE_PCICFG_ANON_22_MESSAGE_AMAP message[32];
91397 + u8 rsvd67[28672]; /* DWORD 2176 */
91398 + u8 rsvd68[32]; /* DWORD 3072 */
91399 + u8 rsvd69[1023][32]; /* DWORD 3073 */
91400 +} __packed;
91401 +struct PCICFG0_CSRMAP_AMAP {
91402 + u32 dw[4096];
91403 +};
91404 +
91405 +struct BE_PCICFG_ANON_24_RSVD_AMAP {
91406 + u8 rsvd0[32]; /* DWORD 0 */
91407 +} __packed;
91408 +struct PCICFG_ANON_24_RSVD_AMAP {
91409 + u32 dw[1];
91410 +};
91411 +
91412 +struct BE_PCICFG_ANON_25_RSVD_AMAP {
91413 + u8 rsvd0[32]; /* DWORD 0 */
91414 +} __packed;
91415 +struct PCICFG_ANON_25_RSVD_AMAP {
91416 + u32 dw[1];
91417 +};
91418 +
91419 +struct BE_PCICFG_ANON_26_RSVD_AMAP {
91420 + u8 rsvd0[32]; /* DWORD 0 */
91421 +} __packed;
91422 +struct PCICFG_ANON_26_RSVD_AMAP {
91423 + u32 dw[1];
91424 +};
91425 +
91426 +struct BE_PCICFG_ANON_27_RSVD_AMAP {
91427 + u8 rsvd0[32]; /* DWORD 0 */
91428 + u8 rsvd1[32]; /* DWORD 1 */
91429 +} __packed;
91430 +struct PCICFG_ANON_27_RSVD_AMAP {
91431 + u32 dw[2];
91432 +};
91433 +
91434 +struct BE_PCICFG_ANON_28_RSVD_AMAP {
91435 + u8 rsvd0[32]; /* DWORD 0 */
91436 + u8 rsvd1[3][32]; /* DWORD 1 */
91437 +} __packed;
91438 +struct PCICFG_ANON_28_RSVD_AMAP {
91439 + u32 dw[4];
91440 +};
91441 +
91442 +struct BE_PCICFG_ANON_29_RSVD_AMAP {
91443 + u8 rsvd0[32]; /* DWORD 0 */
91444 + u8 rsvd1[36][32]; /* DWORD 1 */
91445 +} __packed;
91446 +struct PCICFG_ANON_29_RSVD_AMAP {
91447 + u32 dw[37];
91448 +};
91449 +
91450 +struct BE_PCICFG_ANON_30_RSVD_AMAP {
91451 + u8 rsvd0[32]; /* DWORD 0 */
91452 + u8 rsvd1[1930][32]; /* DWORD 1 */
91453 +} __packed;
91454 +struct PCICFG_ANON_30_RSVD_AMAP {
91455 + u32 dw[1931];
91456 +};
91457 +
91458 +struct BE_PCICFG_ANON_31_MESSAGE_AMAP {
91459 + struct BE_PCICFG_MSIX_VECTOR_CONTROL_CSR_AMAP vec_ctrl;
91460 + struct BE_PCICFG_MSIX_MSG_DATA_CSR_AMAP msg_data;
91461 + struct BE_PCICFG_MSIX_MSG_ADDR_HI_CSR_AMAP addr_hi;
91462 + struct BE_PCICFG_MSIX_MSG_ADDR_LO_CSR_AMAP addr_low;
91463 +} __packed;
91464 +struct PCICFG_ANON_31_MESSAGE_AMAP {
91465 + u32 dw[4];
91466 +};
91467 +
91468 +struct BE_PCICFG_ANON_32_RSVD_AMAP {
91469 + u8 rsvd0[32]; /* DWORD 0 */
91470 + u8 rsvd1[895][32]; /* DWORD 1 */
91471 +} __packed;
91472 +struct PCICFG_ANON_32_RSVD_AMAP {
91473 + u32 dw[896];
91474 +};
91475 +
91476 +/* This PCI configuration space register map is for the Networking Function of
91477 + * BladeEngine (Function 1).
91478 + */
91479 +struct BE_PCICFG1_CSRMAP_AMAP {
91480 + struct BE_PCICFG_ID_CSR_AMAP id;
91481 + u8 rsvd0[32]; /* DWORD 1 */
91482 + u8 rsvd1[32]; /* DWORD 2 */
91483 + u8 rsvd2[32]; /* DWORD 3 */
91484 + struct BE_PCICFG_IOBAR_CSR_AMAP iobar;
91485 + struct BE_PCICFG_MEMBAR0_CSR_AMAP membar0;
91486 + struct BE_PCICFG_MEMBAR1_LO_CSR_AMAP membar1_lo;
91487 + struct BE_PCICFG_MEMBAR1_HI_CSR_AMAP membar1_hi;
91488 + struct BE_PCICFG_MEMBAR2_LO_CSR_AMAP membar2_lo;
91489 + struct BE_PCICFG_MEMBAR2_HI_CSR_AMAP membar2_hi;
91490 + u8 rsvd3[32]; /* DWORD 10 */
91491 + struct BE_PCICFG_SUBSYSTEM_ID_F1_CSR_AMAP subsystem_id;
91492 + u8 rsvd4[32]; /* DWORD 12 */
91493 + u8 rsvd5[32]; /* DWORD 13 */
91494 + u8 rsvd6[32]; /* DWORD 14 */
91495 + u8 rsvd7[32]; /* DWORD 15 */
91496 + struct BE_PCICFG_SEMAPHORE_CSR_AMAP semaphore[4];
91497 + struct BE_PCICFG_SOFT_RESET_CSR_AMAP soft_reset;
91498 + u8 rsvd8[32]; /* DWORD 21 */
91499 + struct BE_PCICFG_SCRATCHPAD_CSR_AMAP scratchpad;
91500 + u8 rsvd9[32]; /* DWORD 23 */
91501 + u8 rsvd10[32]; /* DWORD 24 */
91502 + u8 rsvd11[32]; /* DWORD 25 */
91503 + u8 rsvd12[32]; /* DWORD 26 */
91504 + u8 rsvd13[32]; /* DWORD 27 */
91505 + u8 rsvd14[2][32]; /* DWORD 28 */
91506 + u8 rsvd15[32]; /* DWORD 30 */
91507 + u8 rsvd16[32]; /* DWORD 31 */
91508 + u8 rsvd17[8][32]; /* DWORD 32 */
91509 + struct BE_PCICFG_UE_STATUS_LOW_CSR_AMAP ue_status_low;
91510 + struct BE_PCICFG_UE_STATUS_HI_CSR_AMAP ue_status_hi;
91511 + struct BE_PCICFG_UE_STATUS_LOW_MASK_CSR_AMAP ue_status_low_mask;
91512 + struct BE_PCICFG_UE_STATUS_HI_MASK_CSR_AMAP ue_status_hi_mask;
91513 + struct BE_PCICFG_ONLINE0_CSR_AMAP online0;
91514 + struct BE_PCICFG_ONLINE1_CSR_AMAP online1;
91515 + u8 rsvd18[32]; /* DWORD 46 */
91516 + u8 rsvd19[32]; /* DWORD 47 */
91517 + u8 rsvd20[32]; /* DWORD 48 */
91518 + u8 rsvd21[32]; /* DWORD 49 */
91519 + struct BE_PCICFG_HOST_TIMER_INT_CTRL_CSR_AMAP host_timer_int_ctrl;
91520 + u8 rsvd22[32]; /* DWORD 51 */
91521 + struct BE_PCICFG_PCIE_CAP_CSR_AMAP pcie_cap;
91522 + struct BE_PCICFG_PCIE_DEVCAP_CSR_AMAP pcie_devcap;
91523 + struct BE_PCICFG_PCIE_CONTROL_STATUS_CSR_AMAP pcie_control_status;
91524 + struct BE_PCICFG_PCIE_LINK_CAP_CSR_AMAP pcie_link_cap;
91525 + struct BE_PCICFG_PCIE_LINK_STATUS_CSR_AMAP pcie_link_status;
91526 + struct BE_PCICFG_MSI_CSR_AMAP msi;
91527 + struct BE_PCICFG_MSIX_TABLE_CSR_AMAP msix_table_offset;
91528 + struct BE_PCICFG_MSIX_PBA_CSR_AMAP msix_pba_offset;
91529 + u8 rsvd23[64]; /* DWORD 60 */
91530 + u8 rsvd24[32]; /* DWORD 62 */
91531 + u8 rsvd25[32]; /* DWORD 63 */
91532 + u8 rsvd26[32]; /* DWORD 64 */
91533 + u8 rsvd27[32]; /* DWORD 65 */
91534 + u8 rsvd28[32]; /* DWORD 66 */
91535 + u8 rsvd29[32]; /* DWORD 67 */
91536 + u8 rsvd30[32]; /* DWORD 68 */
91537 + u8 rsvd31[32]; /* DWORD 69 */
91538 + u8 rsvd32[32]; /* DWORD 70 */
91539 + u8 rsvd33[32]; /* DWORD 71 */
91540 + u8 rsvd34[32]; /* DWORD 72 */
91541 + u8 rsvd35[32]; /* DWORD 73 */
91542 + u8 rsvd36[32]; /* DWORD 74 */
91543 + u8 rsvd37[128]; /* DWORD 75 */
91544 + u8 rsvd38[32]; /* DWORD 79 */
91545 + u8 rsvd39[1184]; /* DWORD 80 */
91546 + u8 rsvd40[61792]; /* DWORD 117 */
91547 + struct BE_PCICFG_ANON_31_MESSAGE_AMAP message[32];
91548 + u8 rsvd41[28672]; /* DWORD 2176 */
91549 + u8 rsvd42[32]; /* DWORD 3072 */
91550 + u8 rsvd43[1023][32]; /* DWORD 3073 */
91551 +} __packed;
91552 +struct PCICFG1_CSRMAP_AMAP {
91553 + u32 dw[4096];
91554 +};
91555 +
91556 +#endif /* __pcicfg_amap_h__ */
91557 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/post_codes.h linux-2.6.29-rc3.owrt/drivers/staging/benet/post_codes.h
91558 --- linux-2.6.29.owrt/drivers/staging/benet/post_codes.h 1970-01-01 01:00:00.000000000 +0100
91559 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/post_codes.h 2009-05-10 23:48:29.000000000 +0200
91560 @@ -0,0 +1,111 @@
91561 +/*
91562 + * Copyright (C) 2005 - 2008 ServerEngines
91563 + * All rights reserved.
91564 + *
91565 + * This program is free software; you can redistribute it and/or
91566 + * modify it under the terms of the GNU General Public License version 2
91567 + * as published by the Free Software Foundation. The full GNU General
91568 + * Public License is included in this distribution in the file called COPYING.
91569 + *
91570 + * Contact Information:
91571 + * linux-drivers@serverengines.com
91572 + *
91573 + * ServerEngines
91574 + * 209 N. Fair Oaks Ave
91575 + * Sunnyvale, CA 94085
91576 + */
91577 +/*
91578 + * Autogenerated by srcgen version: 0127
91579 + */
91580 +#ifndef __post_codes_amap_h__
91581 +#define __post_codes_amap_h__
91582 +
91583 +/* --- MGMT_HBA_POST_STAGE_ENUM --- */
91584 +#define POST_STAGE_POWER_ON_RESET (0) /* State after a cold or warm boot. */
91585 +#define POST_STAGE_AWAITING_HOST_RDY (1) /* ARM boot code awaiting a
91586 + go-ahed from the host. */
91587 +#define POST_STAGE_HOST_RDY (2) /* Host has given go-ahed to ARM. */
91588 +#define POST_STAGE_BE_RESET (3) /* Host wants to reset chip, this is a chip
91589 + workaround */
91590 +#define POST_STAGE_SEEPROM_CS_START (256) /* SEEPROM checksum
91591 + test start. */
91592 +#define POST_STAGE_SEEPROM_CS_DONE (257) /* SEEPROM checksum test
91593 + done. */
91594 +#define POST_STAGE_DDR_CONFIG_START (512) /* DDR configuration start. */
91595 +#define POST_STAGE_DDR_CONFIG_DONE (513) /* DDR configuration done. */
91596 +#define POST_STAGE_DDR_CALIBRATE_START (768) /* DDR calibration start. */
91597 +#define POST_STAGE_DDR_CALIBRATE_DONE (769) /* DDR calibration done. */
91598 +#define POST_STAGE_DDR_TEST_START (1024) /* DDR memory test start. */
91599 +#define POST_STAGE_DDR_TEST_DONE (1025) /* DDR memory test done. */
91600 +#define POST_STAGE_REDBOOT_INIT_START (1536) /* Redboot starts execution. */
91601 +#define POST_STAGE_REDBOOT_INIT_DONE (1537) /* Redboot done execution. */
91602 +#define POST_STAGE_FW_IMAGE_LOAD_START (1792) /* Firmware image load to
91603 + DDR start. */
91604 +#define POST_STAGE_FW_IMAGE_LOAD_DONE (1793) /* Firmware image load
91605 + to DDR done. */
91606 +#define POST_STAGE_ARMFW_START (2048) /* ARMfw runtime code
91607 + starts execution. */
91608 +#define POST_STAGE_DHCP_QUERY_START (2304) /* DHCP server query start. */
91609 +#define POST_STAGE_DHCP_QUERY_DONE (2305) /* DHCP server query done. */
91610 +#define POST_STAGE_BOOT_TARGET_DISCOVERY_START (2560) /* Boot Target
91611 + Discovery Start. */
91612 +#define POST_STAGE_BOOT_TARGET_DISCOVERY_DONE (2561) /* Boot Target
91613 + Discovery Done. */
91614 +#define POST_STAGE_RC_OPTION_SET (2816) /* Remote configuration
91615 + option is set in SEEPROM */
91616 +#define POST_STAGE_SWITCH_LINK (2817) /* Wait for link up on switch */
91617 +#define POST_STAGE_SEND_ICDS_MESSAGE (2818) /* Send the ICDS message
91618 + to switch */
91619 +#define POST_STAGE_PERFROM_TFTP (2819) /* Download xml using TFTP */
91620 +#define POST_STAGE_PARSE_XML (2820) /* Parse XML file */
91621 +#define POST_STAGE_DOWNLOAD_IMAGE (2821) /* Download IMAGE from
91622 + TFTP server */
91623 +#define POST_STAGE_FLASH_IMAGE (2822) /* Flash the IMAGE */
91624 +#define POST_STAGE_RC_DONE (2823) /* Remote configuration
91625 + complete */
91626 +#define POST_STAGE_REBOOT_SYSTEM (2824) /* Upgrade IMAGE done,
91627 + reboot required */
91628 +#define POST_STAGE_MAC_ADDRESS (3072) /* MAC Address Check */
91629 +#define POST_STAGE_ARMFW_READY (49152) /* ARMfw is done with POST
91630 + and ready. */
91631 +#define POST_STAGE_ARMFW_UE (61440) /* ARMfw has asserted an
91632 + unrecoverable error. The
91633 + lower 3 hex digits of the
91634 + stage code identify the
91635 + unique error code.
91636 + */
91637 +
91638 +/* This structure defines the format of the MPU semaphore
91639 + * register when used for POST.
91640 + */
91641 +struct BE_MGMT_HBA_POST_STATUS_STRUCT_AMAP {
91642 + u8 stage[16]; /* DWORD 0 */
91643 + u8 rsvd0[10]; /* DWORD 0 */
91644 + u8 iscsi_driver_loaded; /* DWORD 0 */
91645 + u8 option_rom_installed; /* DWORD 0 */
91646 + u8 iscsi_ip_conflict; /* DWORD 0 */
91647 + u8 iscsi_no_ip; /* DWORD 0 */
91648 + u8 backup_fw; /* DWORD 0 */
91649 + u8 error; /* DWORD 0 */
91650 +} __packed;
91651 +struct MGMT_HBA_POST_STATUS_STRUCT_AMAP {
91652 + u32 dw[1];
91653 +};
91654 +
91655 +/* --- MGMT_HBA_POST_DUMMY_BITS_ENUM --- */
91656 +#define POST_BIT_ISCSI_LOADED (26)
91657 +#define POST_BIT_OPTROM_INST (27)
91658 +#define POST_BIT_BAD_IP_ADDR (28)
91659 +#define POST_BIT_NO_IP_ADDR (29)
91660 +#define POST_BIT_BACKUP_FW (30)
91661 +#define POST_BIT_ERROR (31)
91662 +
91663 +/* --- MGMT_HBA_POST_DUMMY_VALUES_ENUM --- */
91664 +#define POST_ISCSI_DRIVER_LOADED (67108864)
91665 +#define POST_OPTROM_INSTALLED (134217728)
91666 +#define POST_ISCSI_IP_ADDRESS_CONFLICT (268435456)
91667 +#define POST_ISCSI_NO_IP_ADDRESS (536870912)
91668 +#define POST_BACKUP_FW_LOADED (1073741824)
91669 +#define POST_FATAL_ERROR (2147483648)
91670 +
91671 +#endif /* __post_codes_amap_h__ */
91672 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/regmap.h linux-2.6.29-rc3.owrt/drivers/staging/benet/regmap.h
91673 --- linux-2.6.29.owrt/drivers/staging/benet/regmap.h 1970-01-01 01:00:00.000000000 +0100
91674 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/regmap.h 2009-05-10 23:48:29.000000000 +0200
91675 @@ -0,0 +1,68 @@
91676 +/*
91677 + * Copyright (C) 2005 - 2008 ServerEngines
91678 + * All rights reserved.
91679 + *
91680 + * This program is free software; you can redistribute it and/or
91681 + * modify it under the terms of the GNU General Public License version 2
91682 + * as published by the Free Software Foundation. The full GNU General
91683 + * Public License is included in this distribution in the file called COPYING.
91684 + *
91685 + * Contact Information:
91686 + * linux-drivers@serverengines.com
91687 + *
91688 + * ServerEngines
91689 + * 209 N. Fair Oaks Ave
91690 + * Sunnyvale, CA 94085
91691 + */
91692 +/*
91693 + * Autogenerated by srcgen version: 0127
91694 + */
91695 +#ifndef __regmap_amap_h__
91696 +#define __regmap_amap_h__
91697 +#include "pcicfg.h"
91698 +#include "ep.h"
91699 +#include "cev.h"
91700 +#include "mpu.h"
91701 +#include "doorbells.h"
91702 +
91703 +/*
91704 + * This is the control and status register map for BladeEngine, showing
91705 + * the relative size and offset of each sub-module. The CSR registers
91706 + * are identical for the network and storage PCI functions. The
91707 + * CSR map is shown below, followed by details of each block,
91708 + * in sub-sections. The sub-sections begin with a description
91709 + * of CSRs that are instantiated in multiple blocks.
91710 + */
91711 +struct BE_BLADE_ENGINE_CSRMAP_AMAP {
91712 + struct BE_MPU_CSRMAP_AMAP mpu;
91713 + u8 rsvd0[8192]; /* DWORD 256 */
91714 + u8 rsvd1[8192]; /* DWORD 512 */
91715 + struct BE_CEV_CSRMAP_AMAP cev;
91716 + u8 rsvd2[8192]; /* DWORD 1024 */
91717 + u8 rsvd3[8192]; /* DWORD 1280 */
91718 + u8 rsvd4[8192]; /* DWORD 1536 */
91719 + u8 rsvd5[8192]; /* DWORD 1792 */
91720 + u8 rsvd6[8192]; /* DWORD 2048 */
91721 + u8 rsvd7[8192]; /* DWORD 2304 */
91722 + u8 rsvd8[8192]; /* DWORD 2560 */
91723 + u8 rsvd9[8192]; /* DWORD 2816 */
91724 + u8 rsvd10[8192]; /* DWORD 3072 */
91725 + u8 rsvd11[8192]; /* DWORD 3328 */
91726 + u8 rsvd12[8192]; /* DWORD 3584 */
91727 + u8 rsvd13[8192]; /* DWORD 3840 */
91728 + u8 rsvd14[8192]; /* DWORD 4096 */
91729 + u8 rsvd15[8192]; /* DWORD 4352 */
91730 + u8 rsvd16[8192]; /* DWORD 4608 */
91731 + u8 rsvd17[8192]; /* DWORD 4864 */
91732 + u8 rsvd18[8192]; /* DWORD 5120 */
91733 + u8 rsvd19[8192]; /* DWORD 5376 */
91734 + u8 rsvd20[8192]; /* DWORD 5632 */
91735 + u8 rsvd21[8192]; /* DWORD 5888 */
91736 + u8 rsvd22[8192]; /* DWORD 6144 */
91737 + u8 rsvd23[17152][32]; /* DWORD 6400 */
91738 +} __packed;
91739 +struct BLADE_ENGINE_CSRMAP_AMAP {
91740 + u32 dw[23552];
91741 +};
91742 +
91743 +#endif /* __regmap_amap_h__ */
91744 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/benet/TODO linux-2.6.29-rc3.owrt/drivers/staging/benet/TODO
91745 --- linux-2.6.29.owrt/drivers/staging/benet/TODO 1970-01-01 01:00:00.000000000 +0100
91746 +++ linux-2.6.29-rc3.owrt/drivers/staging/benet/TODO 2009-05-10 23:48:29.000000000 +0200
91747 @@ -0,0 +1,6 @@
91748 +TODO:
91749 + - remove wrappers around common iowrite functions
91750 + - full netdev audit of common problems/issues
91751 +
91752 +Please send all patches and questions to Subbu Seetharaman
91753 +<subbus@serverengines.com> and Greg Kroah-Hartman <greg@kroah.com>
91754 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/comedi/Kconfig linux-2.6.29-rc3.owrt/drivers/staging/comedi/Kconfig
91755 --- linux-2.6.29.owrt/drivers/staging/comedi/Kconfig 2009-05-10 22:04:38.000000000 +0200
91756 +++ linux-2.6.29-rc3.owrt/drivers/staging/comedi/Kconfig 2009-05-10 23:48:29.000000000 +0200
91757 @@ -1,7 +1,6 @@
91758 config COMEDI
91759 tristate "Data Acquision support (comedi)"
91760 default N
91761 - depends on m
91762 ---help---
91763 Enable support a wide range of data acquision devices
91764 for Linux.
91765 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/Kconfig linux-2.6.29-rc3.owrt/drivers/staging/Kconfig
91766 --- linux-2.6.29.owrt/drivers/staging/Kconfig 2009-05-10 22:04:38.000000000 +0200
91767 +++ linux-2.6.29-rc3.owrt/drivers/staging/Kconfig 2009-05-10 23:48:29.000000000 +0200
91768 @@ -73,6 +73,8 @@
91769
91770 source "drivers/staging/rt2870/Kconfig"
91771
91772 +source "drivers/staging/benet/Kconfig"
91773 +
91774 source "drivers/staging/comedi/Kconfig"
91775
91776 source "drivers/staging/asus_oled/Kconfig"
91777 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/Makefile linux-2.6.29-rc3.owrt/drivers/staging/Makefile
91778 --- linux-2.6.29.owrt/drivers/staging/Makefile 2009-05-10 22:04:38.000000000 +0200
91779 +++ linux-2.6.29-rc3.owrt/drivers/staging/Makefile 2009-05-10 23:48:29.000000000 +0200
91780 @@ -19,6 +19,7 @@
91781 obj-$(CONFIG_OTUS) += otus/
91782 obj-$(CONFIG_RT2860) += rt2860/
91783 obj-$(CONFIG_RT2870) += rt2870/
91784 +obj-$(CONFIG_BENET) += benet/
91785 obj-$(CONFIG_COMEDI) += comedi/
91786 obj-$(CONFIG_ASUS_OLED) += asus_oled/
91787 obj-$(CONFIG_PANEL) += panel/
91788 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/meilhaus/Kconfig linux-2.6.29-rc3.owrt/drivers/staging/meilhaus/Kconfig
91789 --- linux-2.6.29.owrt/drivers/staging/meilhaus/Kconfig 2009-05-10 22:04:38.000000000 +0200
91790 +++ linux-2.6.29-rc3.owrt/drivers/staging/meilhaus/Kconfig 2009-05-10 23:48:29.000000000 +0200
91791 @@ -4,7 +4,6 @@
91792
91793 menuconfig MEILHAUS
91794 tristate "Meilhaus support"
91795 - depends on m
91796 ---help---
91797 If you have a Meilhaus card, say Y (or M) here.
91798
91799 @@ -19,7 +18,7 @@
91800 config ME0600
91801 tristate "Meilhaus ME-600 support"
91802 default n
91803 - depends on PCI && m
91804 + depends on PCI
91805 help
91806 This driver supports the Meilhaus ME-600 family of boards
91807 that do data collection and multipurpose I/O.
91808 @@ -30,7 +29,7 @@
91809 config ME0900
91810 tristate "Meilhaus ME-900 support"
91811 default n
91812 - depends on PCI && m
91813 + depends on PCI
91814 help
91815 This driver supports the Meilhaus ME-900 family of boards
91816 that do data collection and multipurpose I/O.
91817 @@ -41,7 +40,7 @@
91818 config ME1000
91819 tristate "Meilhaus ME-1000 support"
91820 default n
91821 - depends on PCI && m
91822 + depends on PCI
91823 help
91824 This driver supports the Meilhaus ME-1000 family of boards
91825 that do data collection and multipurpose I/O.
91826 @@ -52,7 +51,7 @@
91827 config ME1400
91828 tristate "Meilhaus ME-1400 support"
91829 default n
91830 - depends on PCI && m
91831 + depends on PCI
91832 help
91833 This driver supports the Meilhaus ME-1400 family of boards
91834 that do data collection and multipurpose I/O.
91835 @@ -63,7 +62,7 @@
91836 config ME1600
91837 tristate "Meilhaus ME-1600 support"
91838 default n
91839 - depends on PCI && m
91840 + depends on PCI
91841 help
91842 This driver supports the Meilhaus ME-1600 family of boards
91843 that do data collection and multipurpose I/O.
91844 @@ -74,7 +73,7 @@
91845 config ME4600
91846 tristate "Meilhaus ME-4600 support"
91847 default n
91848 - depends on PCI && m
91849 + depends on PCI
91850 help
91851 This driver supports the Meilhaus ME-4600 family of boards
91852 that do data collection and multipurpose I/O.
91853 @@ -85,7 +84,7 @@
91854 config ME6000
91855 tristate "Meilhaus ME-6000 support"
91856 default n
91857 - depends on PCI && m
91858 + depends on PCI
91859 help
91860 This driver supports the Meilhaus ME-6000 family of boards
91861 that do data collection and multipurpose I/O.
91862 @@ -96,7 +95,7 @@
91863 config ME8100
91864 tristate "Meilhaus ME-8100 support"
91865 default n
91866 - depends on PCI && m
91867 + depends on PCI
91868 help
91869 This driver supports the Meilhaus ME-8100 family of boards
91870 that do data collection and multipurpose I/O.
91871 @@ -107,7 +106,7 @@
91872 config ME8200
91873 tristate "Meilhaus ME-8200 support"
91874 default n
91875 - depends on PCI && m
91876 + depends on PCI
91877 help
91878 This driver supports the Meilhaus ME-8200 family of boards
91879 that do data collection and multipurpose I/O.
91880 @@ -118,7 +117,7 @@
91881 config MEDUMMY
91882 tristate "Meilhaus dummy driver"
91883 default n
91884 - depends on PCI && m
91885 + depends on PCI
91886 help
91887 This provides a dummy driver for the Meilhaus driver package
91888
91889 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/panel/panel.c linux-2.6.29-rc3.owrt/drivers/staging/panel/panel.c
91890 --- linux-2.6.29.owrt/drivers/staging/panel/panel.c 2009-05-10 22:04:38.000000000 +0200
91891 +++ linux-2.6.29-rc3.owrt/drivers/staging/panel/panel.c 2009-05-10 23:48:29.000000000 +0200
91892 @@ -622,7 +622,7 @@
91893 }
91894
91895 /* sets ctrl & data port bits according to current signals values */
91896 -static void panel_set_bits(void)
91897 +static void set_bits(void)
91898 {
91899 set_data_bits();
91900 set_ctrl_bits();
91901 @@ -707,12 +707,12 @@
91902 */
91903 for (bit = 0; bit < 8; bit++) {
91904 bits.cl = BIT_CLR; /* CLK low */
91905 - panel_set_bits();
91906 + set_bits();
91907 bits.da = byte & 1;
91908 - panel_set_bits();
91909 + set_bits();
91910 udelay(2); /* maintain the data during 2 us before CLK up */
91911 bits.cl = BIT_SET; /* CLK high */
91912 - panel_set_bits();
91913 + set_bits();
91914 udelay(1); /* maintain the strobe during 1 us */
91915 byte >>= 1;
91916 }
91917 @@ -727,7 +727,7 @@
91918 /* The backlight is activated by seting the AUTOFEED line to +5V */
91919 spin_lock(&pprt_lock);
91920 bits.bl = on;
91921 - panel_set_bits();
91922 + set_bits();
91923 spin_unlock(&pprt_lock);
91924 }
91925
91926 @@ -2164,20 +2164,19 @@
91927 if (scan_timer.function != NULL)
91928 del_timer(&scan_timer);
91929
91930 - if (pprt != NULL) {
91931 - if (keypad_enabled)
91932 - misc_deregister(&keypad_dev);
91933 -
91934 - if (lcd_enabled) {
91935 - panel_lcd_print("\x0cLCD driver " PANEL_VERSION
91936 - "\nunloaded.\x1b[Lc\x1b[Lb\x1b[L-");
91937 - misc_deregister(&lcd_dev);
91938 - }
91939 + if (keypad_enabled)
91940 + misc_deregister(&keypad_dev);
91941
91942 - /* TODO: free all input signals */
91943 - parport_release(pprt);
91944 - parport_unregister_device(pprt);
91945 + if (lcd_enabled) {
91946 + panel_lcd_print("\x0cLCD driver " PANEL_VERSION
91947 + "\nunloaded.\x1b[Lc\x1b[Lb\x1b[L-");
91948 + misc_deregister(&lcd_dev);
91949 }
91950 +
91951 + /* TODO: free all input signals */
91952 +
91953 + parport_release(pprt);
91954 + parport_unregister_device(pprt);
91955 parport_unregister_driver(&panel_driver);
91956 }
91957
91958 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/poch/poch.c linux-2.6.29-rc3.owrt/drivers/staging/poch/poch.c
91959 --- linux-2.6.29.owrt/drivers/staging/poch/poch.c 2009-05-10 22:04:38.000000000 +0200
91960 +++ linux-2.6.29-rc3.owrt/drivers/staging/poch/poch.c 2009-05-10 23:48:29.000000000 +0200
91961 @@ -1026,7 +1026,7 @@
91962 }
91963 break;
91964 case POCH_IOC_GET_COUNTERS:
91965 - if (!access_ok(VERIFY_WRITE, argp, sizeof(struct poch_counters)))
91966 + if (access_ok(VERIFY_WRITE, argp, sizeof(struct poch_counters)))
91967 return -EFAULT;
91968
91969 spin_lock_irq(&channel->counters_lock);
91970 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c linux-2.6.29-rc3.owrt/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c
91971 --- linux-2.6.29.owrt/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c 2009-05-10 22:04:38.000000000 +0200
91972 +++ linux-2.6.29-rc3.owrt/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c 2009-05-10 23:48:29.000000000 +0200
91973 @@ -234,21 +234,20 @@
91974 void ieee80211_crypto_deinit(void)
91975 {
91976 struct list_head *ptr, *n;
91977 - struct ieee80211_crypto_alg *alg = NULL;
91978
91979 if (hcrypt == NULL)
91980 return;
91981
91982 - list_for_each_safe(ptr, n, &hcrypt->algs) {
91983 - alg = list_entry(ptr, struct ieee80211_crypto_alg, list);
91984 - if (alg) {
91985 - list_del(ptr);
91986 - printk(KERN_DEBUG
91987 - "ieee80211_crypt: unregistered algorithm '%s' (deinit)\n",
91988 - alg->ops->name);
91989 - kfree(alg);
91990 - }
91991 + for (ptr = hcrypt->algs.next, n = ptr->next; ptr != &hcrypt->algs;
91992 + ptr = n, n = ptr->next) {
91993 + struct ieee80211_crypto_alg *alg =
91994 + (struct ieee80211_crypto_alg *) ptr;
91995 + list_del(ptr);
91996 + printk(KERN_DEBUG "ieee80211_crypt: unregistered algorithm "
91997 + "'%s' (deinit)\n", alg->ops->name);
91998 + kfree(alg);
91999 }
92000 +
92001 kfree(hcrypt);
92002 }
92003
92004 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/rtl8187se/Kconfig linux-2.6.29-rc3.owrt/drivers/staging/rtl8187se/Kconfig
92005 --- linux-2.6.29.owrt/drivers/staging/rtl8187se/Kconfig 2009-05-10 22:04:38.000000000 +0200
92006 +++ linux-2.6.29-rc3.owrt/drivers/staging/rtl8187se/Kconfig 2009-05-10 23:48:29.000000000 +0200
92007 @@ -1,6 +1,5 @@
92008 config RTL8187SE
92009 tristate "RealTek RTL8187SE Wireless LAN NIC driver"
92010 depends on PCI
92011 - depends on WIRELESS_EXT && COMPAT_NET_DEV_OPS
92012 default N
92013 ---help---
92014 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/rtl8187se/r8180_core.c linux-2.6.29-rc3.owrt/drivers/staging/rtl8187se/r8180_core.c
92015 --- linux-2.6.29.owrt/drivers/staging/rtl8187se/r8180_core.c 2009-05-10 22:04:38.000000000 +0200
92016 +++ linux-2.6.29-rc3.owrt/drivers/staging/rtl8187se/r8180_core.c 2009-05-10 23:48:29.000000000 +0200
92017 @@ -6161,10 +6161,10 @@
92018 {
92019 pci_unregister_driver (&rtl8180_pci_driver);
92020 rtl8180_proc_module_remove();
92021 + ieee80211_crypto_deinit();
92022 ieee80211_crypto_tkip_exit();
92023 ieee80211_crypto_ccmp_exit();
92024 ieee80211_crypto_wep_exit();
92025 - ieee80211_crypto_deinit();
92026 DMESG("Exiting");
92027 }
92028
92029 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/usbip/usbip_common.c linux-2.6.29-rc3.owrt/drivers/staging/usbip/usbip_common.c
92030 --- linux-2.6.29.owrt/drivers/staging/usbip/usbip_common.c 2009-05-10 22:04:38.000000000 +0200
92031 +++ linux-2.6.29-rc3.owrt/drivers/staging/usbip/usbip_common.c 2009-05-10 23:48:29.000000000 +0200
92032 @@ -406,20 +406,8 @@
92033 /*
92034 * threads are invoked per one device (per one connection).
92035 */
92036 - int retval;
92037 -
92038 - retval = kernel_thread(usbip_thread, (void *)&ud->tcp_rx, 0);
92039 - if (retval < 0) {
92040 - printk(KERN_ERR "Creating tcp_rx thread for ud %p failed.\n",
92041 - ud);
92042 - return;
92043 - }
92044 - retval = kernel_thread(usbip_thread, (void *)&ud->tcp_tx, 0);
92045 - if (retval < 0) {
92046 - printk(KERN_ERR "Creating tcp_tx thread for ud %p failed.\n",
92047 - ud);
92048 - return;
92049 - }
92050 + kernel_thread(usbip_thread, (void *)&ud->tcp_rx, 0);
92051 + kernel_thread(usbip_thread, (void *)&ud->tcp_tx, 0);
92052
92053 /* confirm threads are starting */
92054 wait_for_completion(&ud->tcp_rx.thread_done);
92055 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/staging/winbond/wbusb.c linux-2.6.29-rc3.owrt/drivers/staging/winbond/wbusb.c
92056 --- linux-2.6.29.owrt/drivers/staging/winbond/wbusb.c 2009-05-10 22:04:38.000000000 +0200
92057 +++ linux-2.6.29-rc3.owrt/drivers/staging/winbond/wbusb.c 2009-05-10 23:48:29.000000000 +0200
92058 @@ -319,18 +319,16 @@
92059 struct usb_device *udev = interface_to_usbdev(intf);
92060 struct wbsoft_priv *priv;
92061 struct ieee80211_hw *dev;
92062 - int nr, err;
92063 + int err;
92064
92065 usb_get_dev(udev);
92066
92067 // 20060630.2 Check the device if it already be opened
92068 - nr = usb_control_msg(udev, usb_rcvctrlpipe( udev, 0 ),
92069 - 0x01, USB_TYPE_VENDOR|USB_RECIP_DEVICE|USB_DIR_IN,
92070 - 0x0, 0x400, &ltmp, 4, HZ*100 );
92071 - if (nr < 0) {
92072 - err = nr;
92073 + err = usb_control_msg(udev, usb_rcvctrlpipe( udev, 0 ),
92074 + 0x01, USB_TYPE_VENDOR|USB_RECIP_DEVICE|USB_DIR_IN,
92075 + 0x0, 0x400, &ltmp, 4, HZ*100 );
92076 + if (err)
92077 goto error;
92078 - }
92079
92080 ltmp = cpu_to_le32(ltmp);
92081 if (ltmp) { // Is already initialized?
92082 @@ -339,10 +337,8 @@
92083 }
92084
92085 dev = ieee80211_alloc_hw(sizeof(*priv), &wbsoft_ops);
92086 - if (!dev) {
92087 - err = -ENOMEM;
92088 + if (!dev)
92089 goto error;
92090 - }
92091
92092 priv = dev->priv;
92093
92094 @@ -373,11 +369,9 @@
92095 }
92096
92097 dev->extra_tx_headroom = 12; /* FIXME */
92098 - dev->flags = IEEE80211_HW_SIGNAL_UNSPEC;
92099 - dev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION);
92100 + dev->flags = 0;
92101
92102 dev->channel_change_time = 1000;
92103 - dev->max_signal = 100;
92104 dev->queues = 1;
92105
92106 dev->wiphy->bands[IEEE80211_BAND_2GHZ] = &wbsoft_band_2GHz;
92107 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/atm/cxacru.c linux-2.6.29-rc3.owrt/drivers/usb/atm/cxacru.c
92108 --- linux-2.6.29.owrt/drivers/usb/atm/cxacru.c 2009-05-10 22:04:38.000000000 +0200
92109 +++ linux-2.6.29-rc3.owrt/drivers/usb/atm/cxacru.c 2009-05-10 23:48:29.000000000 +0200
92110 @@ -485,7 +485,7 @@
92111 usb_err(instance->usbatm, "requested transfer size too large (%d, %d)\n",
92112 wbuflen, rbuflen);
92113 ret = -ENOMEM;
92114 - goto err;
92115 + goto fail;
92116 }
92117
92118 mutex_lock(&instance->cm_serialize);
92119 @@ -565,7 +565,6 @@
92120 dbg("cm %#x", cm);
92121 fail:
92122 mutex_unlock(&instance->cm_serialize);
92123 -err:
92124 return ret;
92125 }
92126
92127 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/class/cdc-acm.c linux-2.6.29-rc3.owrt/drivers/usb/class/cdc-acm.c
92128 --- linux-2.6.29.owrt/drivers/usb/class/cdc-acm.c 2009-05-10 22:04:38.000000000 +0200
92129 +++ linux-2.6.29-rc3.owrt/drivers/usb/class/cdc-acm.c 2009-05-10 23:48:29.000000000 +0200
92130 @@ -1349,6 +1349,9 @@
92131 { USB_DEVICE(0x0e8d, 0x0003), /* FIREFLY, MediaTek Inc; andrey.arapov@gmail.com */
92132 .driver_info = NO_UNION_NORMAL, /* has no union descriptor */
92133 },
92134 + { USB_DEVICE(0x0e8d, 0x3329), /* i-blue 747, Qstarz BT-Q1000, Holux M-241 */
92135 + .driver_info = NO_UNION_NORMAL, /* has no union descriptor */
92136 + },
92137 { USB_DEVICE(0x0e8d, 0x3329), /* MediaTek Inc GPS */
92138 .driver_info = NO_UNION_NORMAL, /* has no union descriptor */
92139 },
92140 @@ -1376,15 +1379,6 @@
92141 { USB_DEVICE(0x0572, 0x1324), /* Conexant USB MODEM RD02-D400 */
92142 .driver_info = NO_UNION_NORMAL, /* has no union descriptor */
92143 },
92144 - { USB_DEVICE(0x22b8, 0x6425), /* Motorola MOTOMAGX phones */
92145 - },
92146 - { USB_DEVICE(0x0572, 0x1329), /* Hummingbird huc56s (Conexant) */
92147 - .driver_info = NO_UNION_NORMAL, /* union descriptor misplaced on
92148 - data interface instead of
92149 - communications interface.
92150 - Maybe we should define a new
92151 - quirk for this. */
92152 - },
92153
92154 /* control interfaces with various AT-command sets */
92155 { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM,
92156 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/class/usbtmc.c linux-2.6.29-rc3.owrt/drivers/usb/class/usbtmc.c
92157 --- linux-2.6.29.owrt/drivers/usb/class/usbtmc.c 2009-05-10 22:04:38.000000000 +0200
92158 +++ linux-2.6.29-rc3.owrt/drivers/usb/class/usbtmc.c 2009-05-10 23:48:29.000000000 +0200
92159 @@ -50,7 +50,6 @@
92160
92161 static struct usb_device_id usbtmc_devices[] = {
92162 { USB_INTERFACE_INFO(USB_CLASS_APP_SPEC, 3, 0), },
92163 - { USB_INTERFACE_INFO(USB_CLASS_APP_SPEC, 3, 1), },
92164 { 0, } /* terminating entry */
92165 };
92166 MODULE_DEVICE_TABLE(usb, usbtmc_devices);
92167 @@ -107,13 +106,12 @@
92168 {
92169 struct usb_interface *intf;
92170 struct usbtmc_device_data *data;
92171 - int retval = 0;
92172 + int retval = -ENODEV;
92173
92174 intf = usb_find_interface(&usbtmc_driver, iminor(inode));
92175 if (!intf) {
92176 printk(KERN_ERR KBUILD_MODNAME
92177 ": can not find device for minor %d", iminor(inode));
92178 - retval = -ENODEV;
92179 goto exit;
92180 }
92181
92182 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/core/devio.c linux-2.6.29-rc3.owrt/drivers/usb/core/devio.c
92183 --- linux-2.6.29.owrt/drivers/usb/core/devio.c 2009-05-10 22:04:38.000000000 +0200
92184 +++ linux-2.6.29-rc3.owrt/drivers/usb/core/devio.c 2009-05-10 23:48:29.000000000 +0200
92185 @@ -359,6 +359,11 @@
92186 spin_lock_irqsave(&ps->lock, flags);
92187 }
92188 spin_unlock_irqrestore(&ps->lock, flags);
92189 + as = async_getcompleted(ps);
92190 + while (as) {
92191 + free_async(as);
92192 + as = async_getcompleted(ps);
92193 + }
92194 }
92195
92196 static void destroy_async_on_interface(struct dev_state *ps,
92197 @@ -638,7 +643,6 @@
92198 struct dev_state *ps = file->private_data;
92199 struct usb_device *dev = ps->dev;
92200 unsigned int ifnum;
92201 - struct async *as;
92202
92203 usb_lock_device(dev);
92204
92205 @@ -657,12 +661,6 @@
92206 usb_unlock_device(dev);
92207 usb_put_dev(dev);
92208 put_pid(ps->disc_pid);
92209 -
92210 - as = async_getcompleted(ps);
92211 - while (as) {
92212 - free_async(as);
92213 - as = async_getcompleted(ps);
92214 - }
92215 kfree(ps);
92216 return 0;
92217 }
92218 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/core/hcd.h linux-2.6.29-rc3.owrt/drivers/usb/core/hcd.h
92219 --- linux-2.6.29.owrt/drivers/usb/core/hcd.h 2009-05-10 22:04:38.000000000 +0200
92220 +++ linux-2.6.29-rc3.owrt/drivers/usb/core/hcd.h 2009-05-10 23:48:29.000000000 +0200
92221 @@ -257,6 +257,7 @@
92222
92223 #ifdef CONFIG_PM
92224 extern int usb_hcd_pci_suspend(struct pci_dev *dev, pm_message_t msg);
92225 +extern int usb_hcd_pci_resume_early(struct pci_dev *dev);
92226 extern int usb_hcd_pci_resume(struct pci_dev *dev);
92227 #endif /* CONFIG_PM */
92228
92229 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/core/hcd-pci.c linux-2.6.29-rc3.owrt/drivers/usb/core/hcd-pci.c
92230 --- linux-2.6.29.owrt/drivers/usb/core/hcd-pci.c 2009-05-10 22:04:38.000000000 +0200
92231 +++ linux-2.6.29-rc3.owrt/drivers/usb/core/hcd-pci.c 2009-05-10 23:48:29.000000000 +0200
92232 @@ -298,6 +298,19 @@
92233 EXPORT_SYMBOL_GPL(usb_hcd_pci_suspend);
92234
92235 /**
92236 + * usb_hcd_pci_resume_early - resume a PCI-based HCD before IRQs are enabled
92237 + * @dev: USB Host Controller being resumed
92238 + *
92239 + * Store this function in the HCD's struct pci_driver as .resume_early.
92240 + */
92241 +int usb_hcd_pci_resume_early(struct pci_dev *dev)
92242 +{
92243 + pci_restore_state(dev);
92244 + return 0;
92245 +}
92246 +EXPORT_SYMBOL_GPL(usb_hcd_pci_resume_early);
92247 +
92248 +/**
92249 * usb_hcd_pci_resume - power management resume of a PCI-based HCD
92250 * @dev: USB Host Controller being resumed
92251 *
92252 @@ -320,8 +333,6 @@
92253 }
92254 #endif
92255
92256 - pci_restore_state(dev);
92257 -
92258 hcd = pci_get_drvdata(dev);
92259 if (hcd->state != HC_STATE_SUSPENDED) {
92260 dev_dbg(hcd->self.controller,
92261 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/core/message.c linux-2.6.29-rc3.owrt/drivers/usb/core/message.c
92262 --- linux-2.6.29.owrt/drivers/usb/core/message.c 2009-05-10 22:04:38.000000000 +0200
92263 +++ linux-2.6.29-rc3.owrt/drivers/usb/core/message.c 2009-05-10 23:48:29.000000000 +0200
92264 @@ -653,7 +653,7 @@
92265 if (result <= 0 && result != -ETIMEDOUT)
92266 continue;
92267 if (result > 1 && ((u8 *)buf)[1] != type) {
92268 - result = -ENODATA;
92269 + result = -EPROTO;
92270 continue;
92271 }
92272 break;
92273 @@ -696,13 +696,8 @@
92274 USB_REQ_GET_DESCRIPTOR, USB_DIR_IN,
92275 (USB_DT_STRING << 8) + index, langid, buf, size,
92276 USB_CTRL_GET_TIMEOUT);
92277 - if (result == 0 || result == -EPIPE)
92278 - continue;
92279 - if (result > 1 && ((u8 *) buf)[1] != USB_DT_STRING) {
92280 - result = -ENODATA;
92281 - continue;
92282 - }
92283 - break;
92284 + if (!(result == 0 || result == -EPIPE))
92285 + break;
92286 }
92287 return result;
92288 }
92289 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/gadget/file_storage.c linux-2.6.29-rc3.owrt/drivers/usb/gadget/file_storage.c
92290 --- linux-2.6.29.owrt/drivers/usb/gadget/file_storage.c 2009-05-10 22:04:38.000000000 +0200
92291 +++ linux-2.6.29-rc3.owrt/drivers/usb/gadget/file_storage.c 2009-05-10 23:48:29.000000000 +0200
92292 @@ -3879,11 +3879,7 @@
92293 mod_data.protocol_type = USB_SC_SCSI;
92294 mod_data.protocol_name = "Transparent SCSI";
92295
92296 - /* Some peripheral controllers are known not to be able to
92297 - * halt bulk endpoints correctly. If one of them is present,
92298 - * disable stalls.
92299 - */
92300 - if (gadget_is_sh(fsg->gadget) || gadget_is_at91(fsg->gadget))
92301 + if (gadget_is_sh(fsg->gadget))
92302 mod_data.can_stall = 0;
92303
92304 if (mod_data.release == 0xffff) { // Parameter wasn't set
92305 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/gadget/f_obex.c linux-2.6.29-rc3.owrt/drivers/usb/gadget/f_obex.c
92306 --- linux-2.6.29.owrt/drivers/usb/gadget/f_obex.c 2009-05-10 22:04:38.000000000 +0200
92307 +++ linux-2.6.29-rc3.owrt/drivers/usb/gadget/f_obex.c 2009-05-10 23:48:29.000000000 +0200
92308 @@ -366,9 +366,9 @@
92309 f->hs_descriptors = usb_copy_descriptors(hs_function);
92310
92311 obex->hs.obex_in = usb_find_endpoint(hs_function,
92312 - f->hs_descriptors, &obex_hs_ep_in_desc);
92313 + f->descriptors, &obex_hs_ep_in_desc);
92314 obex->hs.obex_out = usb_find_endpoint(hs_function,
92315 - f->hs_descriptors, &obex_hs_ep_out_desc);
92316 + f->descriptors, &obex_hs_ep_out_desc);
92317 }
92318
92319 /* Avoid letting this gadget enumerate until the userspace
92320 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/gadget/fsl_qe_udc.c linux-2.6.29-rc3.owrt/drivers/usb/gadget/fsl_qe_udc.c
92321 --- linux-2.6.29.owrt/drivers/usb/gadget/fsl_qe_udc.c 2009-05-10 22:04:38.000000000 +0200
92322 +++ linux-2.6.29-rc3.owrt/drivers/usb/gadget/fsl_qe_udc.c 2009-05-10 23:48:29.000000000 +0200
92323 @@ -1622,8 +1622,6 @@
92324 nuke(ep, -ESHUTDOWN);
92325 ep->desc = NULL;
92326 ep->stopped = 1;
92327 - ep->tx_req = NULL;
92328 - qe_ep_reset(udc, ep->epnum);
92329 spin_unlock_irqrestore(&udc->lock, flags);
92330
92331 cpm_muram_free(cpm_muram_offset(ep->rxbase));
92332 @@ -1683,11 +1681,14 @@
92333 kfree(req);
92334 }
92335
92336 -static int __qe_ep_queue(struct usb_ep *_ep, struct usb_request *_req)
92337 +/* queues (submits) an I/O request to an endpoint */
92338 +static int qe_ep_queue(struct usb_ep *_ep, struct usb_request *_req,
92339 + gfp_t gfp_flags)
92340 {
92341 struct qe_ep *ep = container_of(_ep, struct qe_ep, ep);
92342 struct qe_req *req = container_of(_req, struct qe_req, req);
92343 struct qe_udc *udc;
92344 + unsigned long flags;
92345 int reval;
92346
92347 udc = ep->udc;
92348 @@ -1731,7 +1732,7 @@
92349 list_add_tail(&req->queue, &ep->queue);
92350 dev_vdbg(udc->dev, "gadget have request in %s! %d\n",
92351 ep->name, req->req.length);
92352 -
92353 + spin_lock_irqsave(&udc->lock, flags);
92354 /* push the request to device */
92355 if (ep_is_in(ep))
92356 reval = ep_req_send(ep, req);
92357 @@ -1747,22 +1748,9 @@
92358 if (ep->dir == USB_DIR_OUT)
92359 reval = ep_req_receive(ep, req);
92360
92361 - return 0;
92362 -}
92363 -
92364 -/* queues (submits) an I/O request to an endpoint */
92365 -static int qe_ep_queue(struct usb_ep *_ep, struct usb_request *_req,
92366 - gfp_t gfp_flags)
92367 -{
92368 - struct qe_ep *ep = container_of(_ep, struct qe_ep, ep);
92369 - struct qe_udc *udc = ep->udc;
92370 - unsigned long flags;
92371 - int ret;
92372 -
92373 - spin_lock_irqsave(&udc->lock, flags);
92374 - ret = __qe_ep_queue(_ep, _req);
92375 spin_unlock_irqrestore(&udc->lock, flags);
92376 - return ret;
92377 +
92378 + return 0;
92379 }
92380
92381 /* dequeues (cancels, unlinks) an I/O request from an endpoint */
92382 @@ -2020,7 +2008,7 @@
92383 udc->ep0_dir = USB_DIR_IN;
92384
92385 /* data phase */
92386 - status = __qe_ep_queue(&ep->ep, &req->req);
92387 + status = qe_ep_queue(&ep->ep, &req->req, GFP_ATOMIC);
92388
92389 if (status == 0)
92390 return;
92391 @@ -2163,9 +2151,6 @@
92392 {
92393 unsigned char i;
92394
92395 - if (udc->usb_state == USB_STATE_DEFAULT)
92396 - return 0;
92397 -
92398 qe_usb_disable();
92399 out_8(&udc->usb_regs->usb_usadr, 0);
92400
92401 @@ -2457,12 +2442,8 @@
92402 struct usb_ctlr __iomem *qe_usbregs;
92403 qe_usbregs = udc->usb_regs;
92404
92405 - /* Spec says that we must enable the USB controller to change mode. */
92406 + /* Init the usb register */
92407 out_8(&qe_usbregs->usb_usmod, 0x01);
92408 - /* Mode changed, now disable it, since muram isn't initialized yet. */
92409 - out_8(&qe_usbregs->usb_usmod, 0x00);
92410 -
92411 - /* Initialize the rest. */
92412 out_be16(&qe_usbregs->usb_usbmr, 0);
92413 out_8(&qe_usbregs->usb_uscom, 0);
92414 out_be16(&qe_usbregs->usb_usber, USBER_ALL_CLEAR);
92415 @@ -2623,10 +2604,6 @@
92416 (unsigned long)udc_controller);
92417 /* request irq and disable DR */
92418 udc_controller->usb_irq = irq_of_parse_and_map(np, 0);
92419 - if (!udc_controller->usb_irq) {
92420 - ret = -EINVAL;
92421 - goto err_noirq;
92422 - }
92423
92424 ret = request_irq(udc_controller->usb_irq, qe_udc_irq, 0,
92425 driver_name, udc_controller);
92426 @@ -2648,8 +2625,6 @@
92427 err6:
92428 free_irq(udc_controller->usb_irq, udc_controller);
92429 err5:
92430 - irq_dispose_mapping(udc_controller->usb_irq);
92431 -err_noirq:
92432 if (udc_controller->nullmap) {
92433 dma_unmap_single(udc_controller->gadget.dev.parent,
92434 udc_controller->nullp, 256,
92435 @@ -2673,7 +2648,7 @@
92436 iounmap(udc_controller->usb_regs);
92437 err1:
92438 kfree(udc_controller);
92439 - udc_controller = NULL;
92440 +
92441 return ret;
92442 }
92443
92444 @@ -2735,7 +2710,6 @@
92445 kfree(ep->txframe);
92446
92447 free_irq(udc_controller->usb_irq, udc_controller);
92448 - irq_dispose_mapping(udc_controller->usb_irq);
92449
92450 tasklet_kill(&udc_controller->rx_tasklet);
92451
92452 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/gadget/fsl_usb2_udc.c linux-2.6.29-rc3.owrt/drivers/usb/gadget/fsl_usb2_udc.c
92453 --- linux-2.6.29.owrt/drivers/usb/gadget/fsl_usb2_udc.c 2009-05-10 22:04:38.000000000 +0200
92454 +++ linux-2.6.29-rc3.owrt/drivers/usb/gadget/fsl_usb2_udc.c 2009-05-10 23:48:29.000000000 +0200
92455 @@ -404,10 +404,7 @@
92456 }
92457 if (zlt)
92458 tmp |= EP_QUEUE_HEAD_ZLT_SEL;
92459 -
92460 p_QH->max_pkt_length = cpu_to_le32(tmp);
92461 - p_QH->next_dtd_ptr = 1;
92462 - p_QH->size_ioc_int_sts = 0;
92463
92464 return;
92465 }
92466 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/gadget/Kconfig linux-2.6.29-rc3.owrt/drivers/usb/gadget/Kconfig
92467 --- linux-2.6.29.owrt/drivers/usb/gadget/Kconfig 2009-05-10 22:04:38.000000000 +0200
92468 +++ linux-2.6.29-rc3.owrt/drivers/usb/gadget/Kconfig 2009-05-10 23:48:29.000000000 +0200
92469 @@ -191,7 +191,6 @@
92470 boolean "OMAP USB Device Controller"
92471 depends on ARCH_OMAP
92472 select ISP1301_OMAP if MACH_OMAP_H2 || MACH_OMAP_H3 || MACH_OMAP_H4_OTG
92473 - select USB_OTG_UTILS if ARCH_OMAP
92474 help
92475 Many Texas Instruments OMAP processors have flexible full
92476 speed USB device controllers, with support for up to 30
92477 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/gadget/pxa25x_udc.c linux-2.6.29-rc3.owrt/drivers/usb/gadget/pxa25x_udc.c
92478 --- linux-2.6.29.owrt/drivers/usb/gadget/pxa25x_udc.c 2009-05-10 22:04:38.000000000 +0200
92479 +++ linux-2.6.29-rc3.owrt/drivers/usb/gadget/pxa25x_udc.c 2009-05-10 23:48:29.000000000 +0200
92480 @@ -904,8 +904,8 @@
92481
92482 /* most IN status is the same, but ISO can't stall */
92483 *ep->reg_udccs = UDCCS_BI_TPC|UDCCS_BI_FTF|UDCCS_BI_TUR
92484 - | (ep->bmAttributes == USB_ENDPOINT_XFER_ISOC
92485 - ? 0 : UDCCS_BI_SST);
92486 + | (ep->bmAttributes == USB_ENDPOINT_XFER_ISOC)
92487 + ? 0 : UDCCS_BI_SST;
92488 }
92489
92490
92491 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/host/ehci.h linux-2.6.29-rc3.owrt/drivers/usb/host/ehci.h
92492 --- linux-2.6.29.owrt/drivers/usb/host/ehci.h 2009-05-10 22:04:38.000000000 +0200
92493 +++ linux-2.6.29-rc3.owrt/drivers/usb/host/ehci.h 2009-05-10 23:48:29.000000000 +0200
92494 @@ -87,10 +87,6 @@
92495 int next_uframe; /* scan periodic, start here */
92496 unsigned periodic_sched; /* periodic activity count */
92497
92498 - /* list of itds completed while clock_frame was still active */
92499 - struct list_head cached_itd_list;
92500 - unsigned clock_frame;
92501 -
92502 /* per root hub port */
92503 unsigned long reset_done [EHCI_MAX_ROOT_PORTS];
92504
92505 @@ -224,8 +220,6 @@
92506 }
92507 }
92508
92509 -static void free_cached_itd_list(struct ehci_hcd *ehci);
92510 -
92511 /*-------------------------------------------------------------------------*/
92512
92513 #include <linux/usb/ehci_def.h>
92514 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/host/ehci-hcd.c linux-2.6.29-rc3.owrt/drivers/usb/host/ehci-hcd.c
92515 --- linux-2.6.29.owrt/drivers/usb/host/ehci-hcd.c 2009-05-10 22:04:38.000000000 +0200
92516 +++ linux-2.6.29-rc3.owrt/drivers/usb/host/ehci-hcd.c 2009-05-10 23:48:29.000000000 +0200
92517 @@ -485,7 +485,6 @@
92518 * periodic_size can shrink by USBCMD update if hcc_params allows.
92519 */
92520 ehci->periodic_size = DEFAULT_I_TDPS;
92521 - INIT_LIST_HEAD(&ehci->cached_itd_list);
92522 if ((retval = ehci_mem_init(ehci, GFP_KERNEL)) < 0)
92523 return retval;
92524
92525 @@ -498,7 +497,6 @@
92526
92527 ehci->reclaim = NULL;
92528 ehci->next_uframe = -1;
92529 - ehci->clock_frame = -1;
92530
92531 /*
92532 * dedicate a qh for the async ring head, since we couldn't unlink
92533 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/host/ehci-mem.c linux-2.6.29-rc3.owrt/drivers/usb/host/ehci-mem.c
92534 --- linux-2.6.29.owrt/drivers/usb/host/ehci-mem.c 2009-05-10 22:04:38.000000000 +0200
92535 +++ linux-2.6.29-rc3.owrt/drivers/usb/host/ehci-mem.c 2009-05-10 23:48:29.000000000 +0200
92536 @@ -128,7 +128,6 @@
92537
92538 static void ehci_mem_cleanup (struct ehci_hcd *ehci)
92539 {
92540 - free_cached_itd_list(ehci);
92541 if (ehci->async)
92542 qh_put (ehci->async);
92543 ehci->async = NULL;
92544 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/host/ehci-pci.c linux-2.6.29-rc3.owrt/drivers/usb/host/ehci-pci.c
92545 --- linux-2.6.29.owrt/drivers/usb/host/ehci-pci.c 2009-05-10 22:04:38.000000000 +0200
92546 +++ linux-2.6.29-rc3.owrt/drivers/usb/host/ehci-pci.c 2009-05-10 23:48:29.000000000 +0200
92547 @@ -432,6 +432,7 @@
92548
92549 #ifdef CONFIG_PM
92550 .suspend = usb_hcd_pci_suspend,
92551 + .resume_early = usb_hcd_pci_resume_early,
92552 .resume = usb_hcd_pci_resume,
92553 #endif
92554 .shutdown = usb_hcd_pci_shutdown,
92555 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/host/ehci-q.c linux-2.6.29-rc3.owrt/drivers/usb/host/ehci-q.c
92556 --- linux-2.6.29.owrt/drivers/usb/host/ehci-q.c 2009-05-10 22:04:38.000000000 +0200
92557 +++ linux-2.6.29-rc3.owrt/drivers/usb/host/ehci-q.c 2009-05-10 23:48:29.000000000 +0200
92558 @@ -1095,8 +1095,7 @@
92559 prev->qh_next = qh->qh_next;
92560 wmb ();
92561
92562 - /* If the controller isn't running, we don't have to wait for it */
92563 - if (unlikely(!HC_IS_RUNNING(ehci_to_hcd(ehci)->state))) {
92564 + if (unlikely (ehci_to_hcd(ehci)->state == HC_STATE_HALT)) {
92565 /* if (unlikely (qh->reclaim != 0))
92566 * this will recurse, probably not much
92567 */
92568 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/host/ehci-sched.c linux-2.6.29-rc3.owrt/drivers/usb/host/ehci-sched.c
92569 --- linux-2.6.29.owrt/drivers/usb/host/ehci-sched.c 2009-05-10 22:04:38.000000000 +0200
92570 +++ linux-2.6.29-rc3.owrt/drivers/usb/host/ehci-sched.c 2009-05-10 23:48:29.000000000 +0200
92571 @@ -1004,8 +1004,7 @@
92572
92573 is_in = (stream->bEndpointAddress & USB_DIR_IN) ? 0x10 : 0;
92574 stream->bEndpointAddress &= 0x0f;
92575 - if (stream->ep)
92576 - stream->ep->hcpriv = NULL;
92577 + stream->ep->hcpriv = NULL;
92578
92579 if (stream->rescheduled) {
92580 ehci_info (ehci, "ep%d%s-iso rescheduled "
92581 @@ -1536,7 +1535,7 @@
92582 struct ehci_itd, itd_list);
92583 list_move_tail (&itd->itd_list, &stream->td_list);
92584 itd->stream = iso_stream_get (stream);
92585 - itd->urb = urb;
92586 + itd->urb = usb_get_urb (urb);
92587 itd_init (ehci, stream, itd);
92588 }
92589
92590 @@ -1645,7 +1644,7 @@
92591 (void) disable_periodic(ehci);
92592 ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs--;
92593
92594 - if (unlikely(list_is_singular(&stream->td_list))) {
92595 + if (unlikely (list_empty (&stream->td_list))) {
92596 ehci_to_hcd(ehci)->self.bandwidth_allocated
92597 -= stream->bandwidth;
92598 ehci_vdbg (ehci,
92599 @@ -1654,27 +1653,14 @@
92600 (stream->bEndpointAddress & USB_DIR_IN) ? "in" : "out");
92601 }
92602 iso_stream_put (ehci, stream);
92603 -
92604 + /* OK to recycle this ITD now that its completion callback ran. */
92605 done:
92606 + usb_put_urb(urb);
92607 itd->urb = NULL;
92608 - if (ehci->clock_frame != itd->frame || itd->index[7] != -1) {
92609 - /* OK to recycle this ITD now. */
92610 - itd->stream = NULL;
92611 - list_move(&itd->itd_list, &stream->free_list);
92612 - iso_stream_put(ehci, stream);
92613 - } else {
92614 - /* HW might remember this ITD, so we can't recycle it yet.
92615 - * Move it to a safe place until a new frame starts.
92616 - */
92617 - list_move(&itd->itd_list, &ehci->cached_itd_list);
92618 - if (stream->refcount == 2) {
92619 - /* If iso_stream_put() were called here, stream
92620 - * would be freed. Instead, just prevent reuse.
92621 - */
92622 - stream->ep->hcpriv = NULL;
92623 - stream->ep = NULL;
92624 - }
92625 - }
92626 + itd->stream = NULL;
92627 + list_move(&itd->itd_list, &stream->free_list);
92628 + iso_stream_put(ehci, stream);
92629 +
92630 return retval;
92631 }
92632
92633 @@ -1948,7 +1934,7 @@
92634 struct ehci_sitd, sitd_list);
92635 list_move_tail (&sitd->sitd_list, &stream->td_list);
92636 sitd->stream = iso_stream_get (stream);
92637 - sitd->urb = urb;
92638 + sitd->urb = usb_get_urb (urb);
92639
92640 sitd_patch(ehci, stream, sitd, sched, packet);
92641 sitd_link (ehci, (next_uframe >> 3) % ehci->periodic_size,
92642 @@ -2033,7 +2019,7 @@
92643 (void) disable_periodic(ehci);
92644 ehci_to_hcd(ehci)->self.bandwidth_isoc_reqs--;
92645
92646 - if (list_is_singular(&stream->td_list)) {
92647 + if (list_empty (&stream->td_list)) {
92648 ehci_to_hcd(ehci)->self.bandwidth_allocated
92649 -= stream->bandwidth;
92650 ehci_vdbg (ehci,
92651 @@ -2044,6 +2030,7 @@
92652 iso_stream_put (ehci, stream);
92653 /* OK to recycle this SITD now that its completion callback ran. */
92654 done:
92655 + usb_put_urb(urb);
92656 sitd->urb = NULL;
92657 sitd->stream = NULL;
92658 list_move(&sitd->sitd_list, &stream->free_list);
92659 @@ -2114,20 +2101,6 @@
92660
92661 /*-------------------------------------------------------------------------*/
92662
92663 -static void free_cached_itd_list(struct ehci_hcd *ehci)
92664 -{
92665 - struct ehci_itd *itd, *n;
92666 -
92667 - list_for_each_entry_safe(itd, n, &ehci->cached_itd_list, itd_list) {
92668 - struct ehci_iso_stream *stream = itd->stream;
92669 - itd->stream = NULL;
92670 - list_move(&itd->itd_list, &stream->free_list);
92671 - iso_stream_put(ehci, stream);
92672 - }
92673 -}
92674 -
92675 -/*-------------------------------------------------------------------------*/
92676 -
92677 static void
92678 scan_periodic (struct ehci_hcd *ehci)
92679 {
92680 @@ -2142,17 +2115,10 @@
92681 * Touches as few pages as possible: cache-friendly.
92682 */
92683 now_uframe = ehci->next_uframe;
92684 - if (HC_IS_RUNNING(ehci_to_hcd(ehci)->state)) {
92685 + if (HC_IS_RUNNING (ehci_to_hcd(ehci)->state))
92686 clock = ehci_readl(ehci, &ehci->regs->frame_index);
92687 - clock_frame = (clock >> 3) % ehci->periodic_size;
92688 - } else {
92689 + else
92690 clock = now_uframe + mod - 1;
92691 - clock_frame = -1;
92692 - }
92693 - if (ehci->clock_frame != clock_frame) {
92694 - free_cached_itd_list(ehci);
92695 - ehci->clock_frame = clock_frame;
92696 - }
92697 clock %= mod;
92698 clock_frame = clock >> 3;
92699
92700 @@ -2311,10 +2277,6 @@
92701 /* rescan the rest of this frame, then ... */
92702 clock = now;
92703 clock_frame = clock >> 3;
92704 - if (ehci->clock_frame != clock_frame) {
92705 - free_cached_itd_list(ehci);
92706 - ehci->clock_frame = clock_frame;
92707 - }
92708 } else {
92709 now_uframe++;
92710 now_uframe %= mod;
92711 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/host/ohci-pci.c linux-2.6.29-rc3.owrt/drivers/usb/host/ohci-pci.c
92712 --- linux-2.6.29.owrt/drivers/usb/host/ohci-pci.c 2009-05-10 22:04:38.000000000 +0200
92713 +++ linux-2.6.29-rc3.owrt/drivers/usb/host/ohci-pci.c 2009-05-10 23:48:29.000000000 +0200
92714 @@ -487,6 +487,7 @@
92715
92716 #ifdef CONFIG_PM
92717 .suspend = usb_hcd_pci_suspend,
92718 + .resume_early = usb_hcd_pci_resume_early,
92719 .resume = usb_hcd_pci_resume,
92720 #endif
92721
92722 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/host/uhci-hcd.c linux-2.6.29-rc3.owrt/drivers/usb/host/uhci-hcd.c
92723 --- linux-2.6.29.owrt/drivers/usb/host/uhci-hcd.c 2009-05-10 22:04:38.000000000 +0200
92724 +++ linux-2.6.29-rc3.owrt/drivers/usb/host/uhci-hcd.c 2009-05-10 23:48:29.000000000 +0200
92725 @@ -942,6 +942,7 @@
92726
92727 #ifdef CONFIG_PM
92728 .suspend = usb_hcd_pci_suspend,
92729 + .resume_early = usb_hcd_pci_resume_early,
92730 .resume = usb_hcd_pci_resume,
92731 #endif /* PM */
92732 };
92733 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/host/whci/asl.c linux-2.6.29-rc3.owrt/drivers/usb/host/whci/asl.c
92734 --- linux-2.6.29.owrt/drivers/usb/host/whci/asl.c 2009-05-10 22:04:38.000000000 +0200
92735 +++ linux-2.6.29-rc3.owrt/drivers/usb/host/whci/asl.c 2009-05-10 23:48:29.000000000 +0200
92736 @@ -170,17 +170,12 @@
92737 void asl_update(struct whc *whc, uint32_t wusbcmd)
92738 {
92739 struct wusbhc *wusbhc = &whc->wusbhc;
92740 - long t;
92741
92742 mutex_lock(&wusbhc->mutex);
92743 if (wusbhc->active) {
92744 whc_write_wusbcmd(whc, wusbcmd, wusbcmd);
92745 - t = wait_event_timeout(
92746 - whc->async_list_wq,
92747 - (le_readl(whc->base + WUSBCMD) & WUSBCMD_ASYNC_UPDATED) == 0,
92748 - msecs_to_jiffies(1000));
92749 - if (t == 0)
92750 - whc_hw_error(whc, "ASL update timeout");
92751 + wait_event(whc->async_list_wq,
92752 + (le_readl(whc->base + WUSBCMD) & WUSBCMD_ASYNC_UPDATED) == 0);
92753 }
92754 mutex_unlock(&wusbhc->mutex);
92755 }
92756 @@ -227,13 +222,13 @@
92757 * Now that the ASL is updated, complete the removal of any
92758 * removed qsets.
92759 */
92760 - spin_lock_irq(&whc->lock);
92761 + spin_lock(&whc->lock);
92762
92763 list_for_each_entry_safe(qset, t, &whc->async_removed_list, list_node) {
92764 qset_remove_complete(whc, qset);
92765 }
92766
92767 - spin_unlock_irq(&whc->lock);
92768 + spin_unlock(&whc->lock);
92769 }
92770
92771 /**
92772 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/host/whci/hw.c linux-2.6.29-rc3.owrt/drivers/usb/host/whci/hw.c
92773 --- linux-2.6.29.owrt/drivers/usb/host/whci/hw.c 2009-05-10 22:04:38.000000000 +0200
92774 +++ linux-2.6.29-rc3.owrt/drivers/usb/host/whci/hw.c 2009-05-10 23:48:29.000000000 +0200
92775 @@ -87,18 +87,3 @@
92776
92777 return ret;
92778 }
92779 -
92780 -/**
92781 - * whc_hw_error - recover from a hardware error
92782 - * @whc: the WHCI HC that broke.
92783 - * @reason: a description of the failure.
92784 - *
92785 - * Recover from broken hardware with a full reset.
92786 - */
92787 -void whc_hw_error(struct whc *whc, const char *reason)
92788 -{
92789 - struct wusbhc *wusbhc = &whc->wusbhc;
92790 -
92791 - dev_err(&whc->umc->dev, "hardware error: %s\n", reason);
92792 - wusbhc_reset_all(wusbhc);
92793 -}
92794 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/host/whci/pzl.c linux-2.6.29-rc3.owrt/drivers/usb/host/whci/pzl.c
92795 --- linux-2.6.29.owrt/drivers/usb/host/whci/pzl.c 2009-05-10 22:04:38.000000000 +0200
92796 +++ linux-2.6.29-rc3.owrt/drivers/usb/host/whci/pzl.c 2009-05-10 23:48:29.000000000 +0200
92797 @@ -183,17 +183,12 @@
92798 void pzl_update(struct whc *whc, uint32_t wusbcmd)
92799 {
92800 struct wusbhc *wusbhc = &whc->wusbhc;
92801 - long t;
92802
92803 mutex_lock(&wusbhc->mutex);
92804 if (wusbhc->active) {
92805 whc_write_wusbcmd(whc, wusbcmd, wusbcmd);
92806 - t = wait_event_timeout(
92807 - whc->periodic_list_wq,
92808 - (le_readl(whc->base + WUSBCMD) & WUSBCMD_PERIODIC_UPDATED) == 0,
92809 - msecs_to_jiffies(1000));
92810 - if (t == 0)
92811 - whc_hw_error(whc, "PZL update timeout");
92812 + wait_event(whc->periodic_list_wq,
92813 + (le_readl(whc->base + WUSBCMD) & WUSBCMD_PERIODIC_UPDATED) == 0);
92814 }
92815 mutex_unlock(&wusbhc->mutex);
92816 }
92817 @@ -255,13 +250,13 @@
92818 * Now that the PZL is updated, complete the removal of any
92819 * removed qsets.
92820 */
92821 - spin_lock_irq(&whc->lock);
92822 + spin_lock(&whc->lock);
92823
92824 list_for_each_entry_safe(qset, t, &whc->periodic_removed_list, list_node) {
92825 qset_remove_complete(whc, qset);
92826 }
92827
92828 - spin_unlock_irq(&whc->lock);
92829 + spin_unlock(&whc->lock);
92830 }
92831
92832 /**
92833 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/host/whci/whcd.h linux-2.6.29-rc3.owrt/drivers/usb/host/whci/whcd.h
92834 --- linux-2.6.29.owrt/drivers/usb/host/whci/whcd.h 2009-05-10 22:04:38.000000000 +0200
92835 +++ linux-2.6.29-rc3.owrt/drivers/usb/host/whci/whcd.h 2009-05-10 23:48:29.000000000 +0200
92836 @@ -137,7 +137,6 @@
92837 /* hw.c */
92838 void whc_write_wusbcmd(struct whc *whc, u32 mask, u32 val);
92839 int whc_do_gencmd(struct whc *whc, u32 cmd, u32 params, void *addr, size_t len);
92840 -void whc_hw_error(struct whc *whc, const char *reason);
92841
92842 /* wusb.c */
92843 int whc_wusbhc_start(struct wusbhc *wusbhc);
92844 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/image/mdc800.c linux-2.6.29-rc3.owrt/drivers/usb/image/mdc800.c
92845 --- linux-2.6.29.owrt/drivers/usb/image/mdc800.c 2009-05-10 22:04:38.000000000 +0200
92846 +++ linux-2.6.29-rc3.owrt/drivers/usb/image/mdc800.c 2009-05-10 23:48:29.000000000 +0200
92847 @@ -499,7 +499,6 @@
92848 retval = usb_register_dev(intf, &mdc800_class);
92849 if (retval) {
92850 dev_err(&intf->dev, "Not able to get a minor for this device.\n");
92851 - mutex_unlock(&mdc800->io_lock);
92852 return -ENODEV;
92853 }
92854
92855 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/Makefile linux-2.6.29-rc3.owrt/drivers/usb/Makefile
92856 --- linux-2.6.29.owrt/drivers/usb/Makefile 2009-05-10 22:04:38.000000000 +0200
92857 +++ linux-2.6.29-rc3.owrt/drivers/usb/Makefile 2009-05-10 23:48:29.000000000 +0200
92858 @@ -11,7 +11,6 @@
92859 obj-$(CONFIG_PCI) += host/
92860 obj-$(CONFIG_USB_EHCI_HCD) += host/
92861 obj-$(CONFIG_USB_ISP116X_HCD) += host/
92862 -obj-$(CONFIG_USB_ISP1760_HCD) += host/
92863 obj-$(CONFIG_USB_OHCI_HCD) += host/
92864 obj-$(CONFIG_USB_UHCI_HCD) += host/
92865 obj-$(CONFIG_USB_FHCI_HCD) += host/
92866 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/misc/adutux.c linux-2.6.29-rc3.owrt/drivers/usb/misc/adutux.c
92867 --- linux-2.6.29.owrt/drivers/usb/misc/adutux.c 2009-05-10 22:04:38.000000000 +0200
92868 +++ linux-2.6.29-rc3.owrt/drivers/usb/misc/adutux.c 2009-05-10 23:48:29.000000000 +0200
92869 @@ -376,7 +376,7 @@
92870 if (dev->open_count <= 0) {
92871 dbg(1," %s : device not opened", __func__);
92872 retval = -ENODEV;
92873 - goto unlock;
92874 + goto exit;
92875 }
92876
92877 adu_release_internal(dev);
92878 @@ -385,9 +385,9 @@
92879 if (!dev->open_count) /* ... and we're the last user */
92880 adu_delete(dev);
92881 }
92882 -unlock:
92883 - mutex_unlock(&adutux_mutex);
92884 +
92885 exit:
92886 + mutex_unlock(&adutux_mutex);
92887 dbg(2," %s : leave, return value %d", __func__, retval);
92888 return retval;
92889 }
92890 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/misc/vstusb.c linux-2.6.29-rc3.owrt/drivers/usb/misc/vstusb.c
92891 --- linux-2.6.29.owrt/drivers/usb/misc/vstusb.c 2009-05-10 22:04:38.000000000 +0200
92892 +++ linux-2.6.29-rc3.owrt/drivers/usb/misc/vstusb.c 2009-05-10 23:48:29.000000000 +0200
92893 @@ -401,7 +401,6 @@
92894 }
92895
92896 if (copy_from_user(buf, buffer, count)) {
92897 - mutex_unlock(&vstdev->lock);
92898 dev_err(&dev->dev, "%s: can't copy_from_user\n", __func__);
92899 retval = -EFAULT;
92900 goto exit;
92901 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/musb/davinci.c linux-2.6.29-rc3.owrt/drivers/usb/musb/davinci.c
92902 --- linux-2.6.29.owrt/drivers/usb/musb/davinci.c 2009-05-10 22:04:38.000000000 +0200
92903 +++ linux-2.6.29-rc3.owrt/drivers/usb/musb/davinci.c 2009-05-10 23:48:29.000000000 +0200
92904 @@ -377,8 +377,18 @@
92905 u32 revision;
92906
92907 musb->mregs += DAVINCI_BASE_OFFSET;
92908 +#if 0
92909 + /* REVISIT there's something odd about clocking, this
92910 + * didn't appear do the job ...
92911 + */
92912 + musb->clock = clk_get(pDevice, "usb");
92913 + if (IS_ERR(musb->clock))
92914 + return PTR_ERR(musb->clock);
92915
92916 - clk_enable(musb->clock);
92917 + status = clk_enable(musb->clock);
92918 + if (status < 0)
92919 + return -ENODEV;
92920 +#endif
92921
92922 /* returns zero if e.g. not clocked */
92923 revision = musb_readl(tibase, DAVINCI_USB_VERSION_REG);
92924 @@ -443,8 +453,5 @@
92925 }
92926
92927 phy_off();
92928 -
92929 - clk_disable(musb->clock);
92930 -
92931 return 0;
92932 }
92933 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/musb/musb_core.c linux-2.6.29-rc3.owrt/drivers/usb/musb/musb_core.c
92934 --- linux-2.6.29.owrt/drivers/usb/musb/musb_core.c 2009-05-10 22:04:38.000000000 +0200
92935 +++ linux-2.6.29-rc3.owrt/drivers/usb/musb/musb_core.c 2009-05-10 23:48:29.000000000 +0200
92936 @@ -115,7 +115,7 @@
92937
92938
92939 unsigned musb_debug;
92940 -module_param_named(debug, musb_debug, uint, S_IRUGO | S_IWUSR);
92941 +module_param(musb_debug, uint, S_IRUGO | S_IWUSR);
92942 MODULE_PARM_DESC(debug, "Debug message level. Default = 0");
92943
92944 #define DRIVER_AUTHOR "Mentor Graphics, Texas Instruments, Nokia"
92945 @@ -767,7 +767,6 @@
92946 #ifdef CONFIG_USB_MUSB_HDRC_HCD
92947 case OTG_STATE_A_HOST:
92948 case OTG_STATE_A_SUSPEND:
92949 - usb_hcd_resume_root_hub(musb_to_hcd(musb));
92950 musb_root_disconnect(musb);
92951 if (musb->a_wait_bcon != 0)
92952 musb_platform_try_idle(musb, jiffies
92953 @@ -1816,7 +1815,7 @@
92954 #ifdef CONFIG_SYSFS
92955 device_remove_file(musb->controller, &dev_attr_mode);
92956 device_remove_file(musb->controller, &dev_attr_vbus);
92957 -#ifdef CONFIG_USB_GADGET_MUSB_HDRC
92958 +#ifdef CONFIG_USB_MUSB_OTG
92959 device_remove_file(musb->controller, &dev_attr_srp);
92960 #endif
92961 #endif
92962 @@ -2064,7 +2063,7 @@
92963 #ifdef CONFIG_SYSFS
92964 device_remove_file(musb->controller, &dev_attr_mode);
92965 device_remove_file(musb->controller, &dev_attr_vbus);
92966 -#ifdef CONFIG_USB_GADGET_MUSB_HDRC
92967 +#ifdef CONFIG_USB_MUSB_OTG
92968 device_remove_file(musb->controller, &dev_attr_srp);
92969 #endif
92970 #endif
92971 @@ -2244,10 +2243,10 @@
92972 return platform_driver_probe(&musb_driver, musb_probe);
92973 }
92974
92975 -/* make us init after usbcore and i2c (transceivers, regulators, etc)
92976 - * and before usb gadget and host-side drivers start to register
92977 +/* make us init after usbcore and before usb
92978 + * gadget and host-side drivers start to register
92979 */
92980 -fs_initcall(musb_init);
92981 +subsys_initcall(musb_init);
92982
92983 static void __exit musb_cleanup(void)
92984 {
92985 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/musb/musb_gadget.c linux-2.6.29-rc3.owrt/drivers/usb/musb/musb_gadget.c
92986 --- linux-2.6.29.owrt/drivers/usb/musb/musb_gadget.c 2009-05-10 22:04:38.000000000 +0200
92987 +++ linux-2.6.29-rc3.owrt/drivers/usb/musb/musb_gadget.c 2009-05-10 23:48:29.000000000 +0200
92988 @@ -575,7 +575,7 @@
92989 struct usb_request *request = &req->request;
92990 struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_out;
92991 void __iomem *epio = musb->endpoints[epnum].regs;
92992 - unsigned fifo_count = 0;
92993 + u16 fifo_count = 0;
92994 u16 len = musb_ep->packet_sz;
92995
92996 csr = musb_readw(epio, MUSB_RXCSR);
92997 @@ -687,7 +687,7 @@
92998 len, fifo_count,
92999 musb_ep->packet_sz);
93000
93001 - fifo_count = min_t(unsigned, len, fifo_count);
93002 + fifo_count = min(len, fifo_count);
93003
93004 #ifdef CONFIG_USB_TUSB_OMAP_DMA
93005 if (tusb_dma_omap() && musb_ep->dma) {
93006 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/musb/musb_host.c linux-2.6.29-rc3.owrt/drivers/usb/musb/musb_host.c
93007 --- linux-2.6.29.owrt/drivers/usb/musb/musb_host.c 2009-05-10 22:04:38.000000000 +0200
93008 +++ linux-2.6.29-rc3.owrt/drivers/usb/musb/musb_host.c 2009-05-10 23:48:29.000000000 +0200
93009 @@ -335,11 +335,16 @@
93010 static struct musb_qh *
93011 musb_giveback(struct musb_qh *qh, struct urb *urb, int status)
93012 {
93013 + int is_in;
93014 struct musb_hw_ep *ep = qh->hw_ep;
93015 struct musb *musb = ep->musb;
93016 - int is_in = usb_pipein(urb->pipe);
93017 int ready = qh->is_ready;
93018
93019 + if (ep->is_shared_fifo)
93020 + is_in = 1;
93021 + else
93022 + is_in = usb_pipein(urb->pipe);
93023 +
93024 /* save toggle eagerly, for paranoia */
93025 switch (qh->type) {
93026 case USB_ENDPOINT_XFER_BULK:
93027 @@ -427,7 +432,7 @@
93028 else
93029 qh = musb_giveback(qh, urb, urb->status);
93030
93031 - if (qh != NULL && qh->is_ready) {
93032 + if (qh && qh->is_ready && !list_empty(&qh->hep->urb_list)) {
93033 DBG(4, "... next ep%d %cX urb %p\n",
93034 hw_ep->epnum, is_in ? 'R' : 'T',
93035 next_urb(qh));
93036 @@ -937,8 +942,8 @@
93037 switch (musb->ep0_stage) {
93038 case MUSB_EP0_IN:
93039 fifo_dest = urb->transfer_buffer + urb->actual_length;
93040 - fifo_count = min_t(size_t, len, urb->transfer_buffer_length -
93041 - urb->actual_length);
93042 + fifo_count = min(len, ((u16) (urb->transfer_buffer_length
93043 + - urb->actual_length)));
93044 if (fifo_count < len)
93045 urb->status = -EOVERFLOW;
93046
93047 @@ -971,9 +976,10 @@
93048 }
93049 /* FALLTHROUGH */
93050 case MUSB_EP0_OUT:
93051 - fifo_count = min_t(size_t, qh->maxpacket,
93052 - urb->transfer_buffer_length -
93053 - urb->actual_length);
93054 + fifo_count = min(qh->maxpacket, ((u16)
93055 + (urb->transfer_buffer_length
93056 + - urb->actual_length)));
93057 +
93058 if (fifo_count) {
93059 fifo_dest = (u8 *) (urb->transfer_buffer
93060 + urb->actual_length);
93061 @@ -1155,8 +1161,7 @@
93062 struct urb *urb;
93063 struct musb_hw_ep *hw_ep = musb->endpoints + epnum;
93064 void __iomem *epio = hw_ep->regs;
93065 - struct musb_qh *qh = hw_ep->is_shared_fifo ? hw_ep->in_qh
93066 - : hw_ep->out_qh;
93067 + struct musb_qh *qh = hw_ep->out_qh;
93068 u32 status = 0;
93069 void __iomem *mbase = musb->mregs;
93070 struct dma_channel *dma;
93071 @@ -1303,8 +1308,7 @@
93072 * packets before updating TXCSR ... other docs disagree ...
93073 */
93074 /* PIO: start next packet in this URB */
93075 - if (wLength > qh->maxpacket)
93076 - wLength = qh->maxpacket;
93077 + wLength = min(qh->maxpacket, (u16) wLength);
93078 musb_write_fifo(hw_ep, wLength, buf);
93079 qh->segsize = wLength;
93080
93081 @@ -1863,21 +1867,19 @@
93082 }
93083 qh->type_reg = type_reg;
93084
93085 - /* Precompute RXINTERVAL/TXINTERVAL register */
93086 + /* precompute rxinterval/txinterval register */
93087 + interval = min((u8)16, epd->bInterval); /* log encoding */
93088 switch (qh->type) {
93089 case USB_ENDPOINT_XFER_INT:
93090 - /*
93091 - * Full/low speeds use the linear encoding,
93092 - * high speed uses the logarithmic encoding.
93093 - */
93094 - if (urb->dev->speed <= USB_SPEED_FULL) {
93095 - interval = max_t(u8, epd->bInterval, 1);
93096 - break;
93097 + /* fullspeed uses linear encoding */
93098 + if (USB_SPEED_FULL == urb->dev->speed) {
93099 + interval = epd->bInterval;
93100 + if (!interval)
93101 + interval = 1;
93102 }
93103 /* FALLTHROUGH */
93104 case USB_ENDPOINT_XFER_ISOC:
93105 - /* ISO always uses logarithmic encoding */
93106 - interval = min_t(u8, epd->bInterval, 16);
93107 + /* iso always uses log encoding */
93108 break;
93109 default:
93110 /* REVISIT we actually want to use NAK limits, hinting to the
93111 @@ -2035,9 +2037,9 @@
93112 goto done;
93113
93114 /* Any URB not actively programmed into endpoint hardware can be
93115 - * immediately given back; that's any URB not at the head of an
93116 + * immediately given back. Such an URB must be at the head of its
93117 * endpoint queue, unless someday we get real DMA queues. And even
93118 - * if it's at the head, it might not be known to the hardware...
93119 + * then, it might not be known to the hardware...
93120 *
93121 * Otherwise abort current transfer, pending dma, etc.; urb->status
93122 * has already been updated. This is a synchronous abort; it'd be
93123 @@ -2076,15 +2078,6 @@
93124 qh->is_ready = 0;
93125 __musb_giveback(musb, urb, 0);
93126 qh->is_ready = ready;
93127 -
93128 - /* If nothing else (usually musb_giveback) is using it
93129 - * and its URB list has emptied, recycle this qh.
93130 - */
93131 - if (ready && list_empty(&qh->hep->urb_list)) {
93132 - qh->hep->hcpriv = NULL;
93133 - list_del(&qh->ring);
93134 - kfree(qh);
93135 - }
93136 } else
93137 ret = musb_cleanup_urb(urb, qh, urb->pipe & USB_DIR_IN);
93138 done:
93139 @@ -2100,15 +2093,14 @@
93140 unsigned long flags;
93141 struct musb *musb = hcd_to_musb(hcd);
93142 u8 is_in = epnum & USB_DIR_IN;
93143 - struct musb_qh *qh;
93144 - struct urb *urb;
93145 + struct musb_qh *qh = hep->hcpriv;
93146 + struct urb *urb, *tmp;
93147 struct list_head *sched;
93148
93149 - spin_lock_irqsave(&musb->lock, flags);
93150 + if (!qh)
93151 + return;
93152
93153 - qh = hep->hcpriv;
93154 - if (qh == NULL)
93155 - goto exit;
93156 + spin_lock_irqsave(&musb->lock, flags);
93157
93158 switch (qh->type) {
93159 case USB_ENDPOINT_XFER_CONTROL:
93160 @@ -2143,28 +2135,13 @@
93161
93162 /* cleanup */
93163 musb_cleanup_urb(urb, qh, urb->pipe & USB_DIR_IN);
93164 + } else
93165 + urb = NULL;
93166
93167 - /* Then nuke all the others ... and advance the
93168 - * queue on hw_ep (e.g. bulk ring) when we're done.
93169 - */
93170 - while (!list_empty(&hep->urb_list)) {
93171 - urb = next_urb(qh);
93172 - urb->status = -ESHUTDOWN;
93173 - musb_advance_schedule(musb, urb, qh->hw_ep, is_in);
93174 - }
93175 - } else {
93176 - /* Just empty the queue; the hardware is busy with
93177 - * other transfers, and since !qh->is_ready nothing
93178 - * will activate any of these as it advances.
93179 - */
93180 - while (!list_empty(&hep->urb_list))
93181 - __musb_giveback(musb, next_urb(qh), -ESHUTDOWN);
93182 + /* then just nuke all the others */
93183 + list_for_each_entry_safe_from(urb, tmp, &hep->urb_list, urb_list)
93184 + musb_giveback(qh, urb, -ESHUTDOWN);
93185
93186 - hep->hcpriv = NULL;
93187 - list_del(&qh->ring);
93188 - kfree(qh);
93189 - }
93190 -exit:
93191 spin_unlock_irqrestore(&musb->lock, flags);
93192 }
93193
93194 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/serial/aircable.c linux-2.6.29-rc3.owrt/drivers/usb/serial/aircable.c
93195 --- linux-2.6.29.owrt/drivers/usb/serial/aircable.c 2009-05-10 22:04:38.000000000 +0200
93196 +++ linux-2.6.29-rc3.owrt/drivers/usb/serial/aircable.c 2009-05-10 23:48:29.000000000 +0200
93197 @@ -621,9 +621,9 @@
93198 goto failed_usb_register;
93199 return 0;
93200
93201 -failed_usb_register:
93202 - usb_serial_deregister(&aircable_device);
93203 failed_serial_register:
93204 + usb_serial_deregister(&aircable_device);
93205 +failed_usb_register:
93206 return retval;
93207 }
93208
93209 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/serial/cp2101.c linux-2.6.29-rc3.owrt/drivers/usb/serial/cp2101.c
93210 --- linux-2.6.29.owrt/drivers/usb/serial/cp2101.c 2009-05-10 22:04:38.000000000 +0200
93211 +++ linux-2.6.29-rc3.owrt/drivers/usb/serial/cp2101.c 2009-05-10 23:48:29.000000000 +0200
93212 @@ -79,7 +79,6 @@
93213 { USB_DEVICE(0x10C4, 0x814A) }, /* West Mountain Radio RIGblaster P&P */
93214 { USB_DEVICE(0x10C4, 0x814B) }, /* West Mountain Radio RIGtalk */
93215 { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */
93216 - { USB_DEVICE(0x10C4, 0x819F) }, /* MJS USB Toslink Switcher */
93217 { USB_DEVICE(0x10C4, 0x81A6) }, /* ThinkOptics WavIt */
93218 { USB_DEVICE(0x10C4, 0x81AC) }, /* MSD Dash Hawk */
93219 { USB_DEVICE(0x10C4, 0x81C8) }, /* Lipowsky Industrie Elektronik GmbH, Baby-JTAG */
93220 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/serial/ftdi_sio.c linux-2.6.29-rc3.owrt/drivers/usb/serial/ftdi_sio.c
93221 --- linux-2.6.29.owrt/drivers/usb/serial/ftdi_sio.c 2009-05-10 22:04:38.000000000 +0200
93222 +++ linux-2.6.29-rc3.owrt/drivers/usb/serial/ftdi_sio.c 2009-05-10 23:48:29.000000000 +0200
93223 @@ -662,12 +662,6 @@
93224 { USB_DEVICE(FTDI_VID, FTDI_DOMINTELL_DUSB_PID) },
93225 { USB_DEVICE(ALTI2_VID, ALTI2_N3_PID) },
93226 { USB_DEVICE(FTDI_VID, DIEBOLD_BCS_SE923_PID) },
93227 - { USB_DEVICE(FTDI_VID, FTDI_NDI_HUC_PID) },
93228 - { USB_DEVICE(ATMEL_VID, STK541_PID) },
93229 - { USB_DEVICE(DE_VID, STB_PID) },
93230 - { USB_DEVICE(DE_VID, WHT_PID) },
93231 - { USB_DEVICE(ADI_VID, ADI_GNICE_PID),
93232 - .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
93233 { }, /* Optional parameter entry */
93234 { } /* Terminating entry */
93235 };
93236 @@ -1070,10 +1064,8 @@
93237
93238 if (!capable(CAP_SYS_ADMIN)) {
93239 if (((new_serial.flags & ~ASYNC_USR_MASK) !=
93240 - (priv->flags & ~ASYNC_USR_MASK))) {
93241 - unlock_kernel();
93242 + (priv->flags & ~ASYNC_USR_MASK)))
93243 return -EPERM;
93244 - }
93245 priv->flags = ((priv->flags & ~ASYNC_USR_MASK) |
93246 (new_serial.flags & ASYNC_USR_MASK));
93247 priv->custom_divisor = new_serial.custom_divisor;
93248 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/serial/ftdi_sio.h linux-2.6.29-rc3.owrt/drivers/usb/serial/ftdi_sio.h
93249 --- linux-2.6.29.owrt/drivers/usb/serial/ftdi_sio.h 2009-05-10 22:04:38.000000000 +0200
93250 +++ linux-2.6.29-rc3.owrt/drivers/usb/serial/ftdi_sio.h 2009-05-10 23:48:29.000000000 +0200
93251 @@ -844,9 +844,6 @@
93252 #define TML_VID 0x1B91 /* Vendor ID */
93253 #define TML_USB_SERIAL_PID 0x0064 /* USB - Serial Converter */
93254
93255 -/* NDI Polaris System */
93256 -#define FTDI_NDI_HUC_PID 0xDA70
93257 -
93258 /* Propox devices */
93259 #define FTDI_PROPOX_JTAGCABLEII_PID 0xD738
93260
93261 @@ -893,26 +890,6 @@
93262 #define DIEBOLD_BCS_SE923_PID 0xfb99
93263
93264 /*
93265 - * Atmel STK541
93266 - */
93267 -#define ATMEL_VID 0x03eb /* Vendor ID */
93268 -#define STK541_PID 0x2109 /* Zigbee Controller */
93269 -
93270 -/*
93271 - * Dresden Elektronic Sensor Terminal Board
93272 - */
93273 -#define DE_VID 0x1cf1 /* Vendor ID */
93274 -#define STB_PID 0x0001 /* Sensor Terminal Board */
93275 -#define WHT_PID 0x0004 /* Wireless Handheld Terminal */
93276 -
93277 -/*
93278 - * Blackfin gnICE JTAG
93279 - * http://docs.blackfin.uclinux.org/doku.php?id=hw:jtag:gnice
93280 - */
93281 -#define ADI_VID 0x0456
93282 -#define ADI_GNICE_PID 0xF000
93283 -
93284 -/*
93285 * BmRequestType: 1100 0000b
93286 * bRequest: FTDI_E2_READ
93287 * wValue: 0
93288 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/serial/option.c linux-2.6.29-rc3.owrt/drivers/usb/serial/option.c
93289 --- linux-2.6.29.owrt/drivers/usb/serial/option.c 2009-05-10 22:04:38.000000000 +0200
93290 +++ linux-2.6.29-rc3.owrt/drivers/usb/serial/option.c 2009-05-10 23:48:29.000000000 +0200
93291 @@ -89,7 +89,6 @@
93292 #define OPTION_PRODUCT_ETNA_MODEM_GT 0x7041
93293 #define OPTION_PRODUCT_ETNA_MODEM_EX 0x7061
93294 #define OPTION_PRODUCT_ETNA_KOI_MODEM 0x7100
93295 -#define OPTION_PRODUCT_GTM380_MODEM 0x7201
93296
93297 #define HUAWEI_VENDOR_ID 0x12D1
93298 #define HUAWEI_PRODUCT_E600 0x1001
93299 @@ -198,18 +197,16 @@
93300 /* OVATION PRODUCTS */
93301 #define NOVATELWIRELESS_PRODUCT_MC727 0x4100
93302 #define NOVATELWIRELESS_PRODUCT_MC950D 0x4400
93303 -#define NOVATELWIRELESS_PRODUCT_U727 0x5010
93304
93305 /* FUTURE NOVATEL PRODUCTS */
93306 -#define NOVATELWIRELESS_PRODUCT_EVDO_FULLSPEED 0X6000
93307 -#define NOVATELWIRELESS_PRODUCT_EVDO_HIGHSPEED 0X6001
93308 -#define NOVATELWIRELESS_PRODUCT_HSPA_FULLSPEED 0X7000
93309 -#define NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED 0X7001
93310 -#define NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_FULLSPEED 0X8000
93311 -#define NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_HIGHSPEED 0X8001
93312 -#define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED 0X9000
93313 -#define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_HIGHSPEED 0X9001
93314 -#define NOVATELWIRELESS_PRODUCT_GLOBAL 0XA001
93315 +#define NOVATELWIRELESS_PRODUCT_EVDO_1 0x6000
93316 +#define NOVATELWIRELESS_PRODUCT_HSPA_1 0x7000
93317 +#define NOVATELWIRELESS_PRODUCT_EMBEDDED_1 0x8000
93318 +#define NOVATELWIRELESS_PRODUCT_GLOBAL_1 0x9000
93319 +#define NOVATELWIRELESS_PRODUCT_EVDO_2 0x6001
93320 +#define NOVATELWIRELESS_PRODUCT_HSPA_2 0x7001
93321 +#define NOVATELWIRELESS_PRODUCT_EMBEDDED_2 0x8001
93322 +#define NOVATELWIRELESS_PRODUCT_GLOBAL_2 0x9001
93323
93324 /* AMOI PRODUCTS */
93325 #define AMOI_VENDOR_ID 0x1614
93326 @@ -219,27 +216,6 @@
93327
93328 #define DELL_VENDOR_ID 0x413C
93329
93330 -/* Dell modems */
93331 -#define DELL_PRODUCT_5700_MINICARD 0x8114
93332 -#define DELL_PRODUCT_5500_MINICARD 0x8115
93333 -#define DELL_PRODUCT_5505_MINICARD 0x8116
93334 -#define DELL_PRODUCT_5700_EXPRESSCARD 0x8117
93335 -#define DELL_PRODUCT_5510_EXPRESSCARD 0x8118
93336 -
93337 -#define DELL_PRODUCT_5700_MINICARD_SPRINT 0x8128
93338 -#define DELL_PRODUCT_5700_MINICARD_TELUS 0x8129
93339 -
93340 -#define DELL_PRODUCT_5720_MINICARD_VZW 0x8133
93341 -#define DELL_PRODUCT_5720_MINICARD_SPRINT 0x8134
93342 -#define DELL_PRODUCT_5720_MINICARD_TELUS 0x8135
93343 -#define DELL_PRODUCT_5520_MINICARD_CINGULAR 0x8136
93344 -#define DELL_PRODUCT_5520_MINICARD_GENERIC_L 0x8137
93345 -#define DELL_PRODUCT_5520_MINICARD_GENERIC_I 0x8138
93346 -
93347 -#define DELL_PRODUCT_5730_MINICARD_SPRINT 0x8180
93348 -#define DELL_PRODUCT_5730_MINICARD_TELUS 0x8181
93349 -#define DELL_PRODUCT_5730_MINICARD_VZW 0x8182
93350 -
93351 #define KYOCERA_VENDOR_ID 0x0c88
93352 #define KYOCERA_PRODUCT_KPC650 0x17da
93353 #define KYOCERA_PRODUCT_KPC680 0x180a
93354 @@ -290,13 +266,19 @@
93355
93356 /* ZTE PRODUCTS */
93357 #define ZTE_VENDOR_ID 0x19d2
93358 -#define ZTE_PRODUCT_MF622 0x0001
93359 #define ZTE_PRODUCT_MF628 0x0015
93360 #define ZTE_PRODUCT_MF626 0x0031
93361 #define ZTE_PRODUCT_CDMA_TECH 0xfffe
93362
93363 -#define BENQ_VENDOR_ID 0x04a5
93364 -#define BENQ_PRODUCT_H10 0x4068
93365 +/* Ericsson products */
93366 +#define ERICSSON_VENDOR_ID 0x0bdb
93367 +#define ERICSSON_PRODUCT_F3507G 0x1900
93368 +
93369 +/* Pantech products */
93370 +#define PANTECH_VENDOR_ID 0x106c
93371 +#define PANTECH_PRODUCT_PC5740 0x3701
93372 +#define PANTECH_PRODUCT_PC5750 0x3702 /* PX-500 */
93373 +#define PANTECH_PRODUCT_UM150 0x3711
93374
93375 static struct usb_device_id option_ids[] = {
93376 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
93377 @@ -323,7 +305,6 @@
93378 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_MODEM_GT) },
93379 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_MODEM_EX) },
93380 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_KOI_MODEM) },
93381 - { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_GTM380_MODEM) },
93382 { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_Q101) },
93383 { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_Q111) },
93384 { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_GLX) },
93385 @@ -414,37 +395,31 @@
93386 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EU870D) }, /* Novatel EU850D/EU860D/EU870D */
93387 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC950D) }, /* Novatel MC930D/MC950D */
93388 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC727) }, /* Novatel MC727/U727/USB727 */
93389 - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U727) }, /* Novatel MC727/U727/USB727 */
93390 - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_FULLSPEED) }, /* Novatel EVDO product */
93391 - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_FULLSPEED) }, /* Novatel HSPA product */
93392 - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_FULLSPEED) }, /* Novatel EVDO Embedded product */
93393 - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED) }, /* Novatel HSPA Embedded product */
93394 - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_HIGHSPEED) }, /* Novatel EVDO product */
93395 - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED) }, /* Novatel HSPA product */
93396 - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_HIGHSPEED) }, /* Novatel EVDO Embedded product */
93397 - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_HIGHSPEED) }, /* Novatel HSPA Embedded product */
93398 - { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_GLOBAL) }, /* Novatel Global product */
93399 + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_1) }, /* Novatel EVDO product */
93400 + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_1) }, /* Novatel HSPA product */
93401 + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EMBEDDED_1) }, /* Novatel Embedded product */
93402 + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_GLOBAL_1) }, /* Novatel Global product */
93403 + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_2) }, /* Novatel EVDO product */
93404 + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_2) }, /* Novatel HSPA product */
93405 + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EMBEDDED_2) }, /* Novatel Embedded product */
93406 + { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_GLOBAL_2) }, /* Novatel Global product */
93407
93408 { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) },
93409 { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) },
93410 { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H02) },
93411
93412 - { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5700_MINICARD) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite EV620 CDMA/EV-DO */
93413 - { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5500_MINICARD) }, /* Dell Wireless 5500 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */
93414 - { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5505_MINICARD) }, /* Dell Wireless 5505 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */
93415 - { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5700_EXPRESSCARD) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO ExpressCard == Novatel Merlin XV620 CDMA/EV-DO */
93416 - { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5510_EXPRESSCARD) }, /* Dell Wireless 5510 Mobile Broadband HSDPA ExpressCard == Novatel Merlin XU870 HSDPA/3G */
93417 - { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5700_MINICARD_SPRINT) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite E720 CDMA/EV-DO */
93418 - { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5700_MINICARD_TELUS) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite ET620 CDMA/EV-DO */
93419 - { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5720_MINICARD_VZW) }, /* Dell Wireless 5720 == Novatel EV620 CDMA/EV-DO */
93420 - { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5720_MINICARD_SPRINT) }, /* Dell Wireless 5720 == Novatel EV620 CDMA/EV-DO */
93421 - { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5720_MINICARD_TELUS) }, /* Dell Wireless 5720 == Novatel EV620 CDMA/EV-DO */
93422 - { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5520_MINICARD_CINGULAR) }, /* Dell Wireless HSDPA 5520 == Novatel Expedite EU860D */
93423 - { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5520_MINICARD_GENERIC_L) }, /* Dell Wireless HSDPA 5520 */
93424 - { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5520_MINICARD_GENERIC_I) }, /* Dell Wireless 5520 Voda I Mobile Broadband (3G HSDPA) Minicard */
93425 - { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5730_MINICARD_SPRINT) }, /* Dell Wireless 5730 Mobile Broadband EVDO/HSPA Mini-Card */
93426 - { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5730_MINICARD_TELUS) }, /* Dell Wireless 5730 Mobile Broadband EVDO/HSPA Mini-Card */
93427 - { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5730_MINICARD_VZW) }, /* Dell Wireless 5730 Mobile Broadband EVDO/HSPA Mini-Card */
93428 + { USB_DEVICE(DELL_VENDOR_ID, 0x8114) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite EV620 CDMA/EV-DO */
93429 + { USB_DEVICE(DELL_VENDOR_ID, 0x8115) }, /* Dell Wireless 5500 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */
93430 + { USB_DEVICE(DELL_VENDOR_ID, 0x8116) }, /* Dell Wireless 5505 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */
93431 + { USB_DEVICE(DELL_VENDOR_ID, 0x8117) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO ExpressCard == Novatel Merlin XV620 CDMA/EV-DO */
93432 + { USB_DEVICE(DELL_VENDOR_ID, 0x8118) }, /* Dell Wireless 5510 Mobile Broadband HSDPA ExpressCard == Novatel Merlin XU870 HSDPA/3G */
93433 + { USB_DEVICE(DELL_VENDOR_ID, 0x8128) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite E720 CDMA/EV-DO */
93434 + { USB_DEVICE(DELL_VENDOR_ID, 0x8129) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite ET620 CDMA/EV-DO */
93435 + { USB_DEVICE(DELL_VENDOR_ID, 0x8133) }, /* Dell Wireless 5720 == Novatel EV620 CDMA/EV-DO */
93436 + { USB_DEVICE(DELL_VENDOR_ID, 0x8136) }, /* Dell Wireless HSDPA 5520 == Novatel Expedite EU860D */
93437 + { USB_DEVICE(DELL_VENDOR_ID, 0x8137) }, /* Dell Wireless HSDPA 5520 */
93438 + { USB_DEVICE(DELL_VENDOR_ID, 0x8138) }, /* Dell Wireless 5520 Voda I Mobile Broadband (3G HSDPA) Minicard */
93439 + { USB_DEVICE(DELL_VENDOR_ID, 0x8147) }, /* Dell Wireless 5530 Mobile Broadband (3G HSPA) Mini-Card */
93440 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, /* ADU-E100, ADU-310 */
93441 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) },
93442 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_620UW) },
93443 @@ -509,12 +484,13 @@
93444 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */
93445 { USB_DEVICE(MAXON_VENDOR_ID, 0x6280) }, /* BP3-USB & BP3-EXT HSDPA */
93446 { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864E) },
93447 - { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_MF622) },
93448 { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_MF626) },
93449 { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_MF628) },
93450 { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH) },
93451 - { USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) },
93452 - { USB_DEVICE(0x1da5, 0x4515) }, /* BenQ H20 */
93453 + { USB_DEVICE(ERICSSON_VENDOR_ID, ERICSSON_PRODUCT_F3507G) },
93454 + { USB_DEVICE(PANTECH_VENDOR_ID, PANTECH_PRODUCT_PC5740) },
93455 + { USB_DEVICE(PANTECH_VENDOR_ID, PANTECH_PRODUCT_PC5750) },
93456 + { USB_DEVICE(PANTECH_VENDOR_ID, PANTECH_PRODUCT_UM150) },
93457 { } /* Terminating entry */
93458 };
93459 MODULE_DEVICE_TABLE(usb, option_ids);
93460 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/serial/ti_usb_3410_5052.c linux-2.6.29-rc3.owrt/drivers/usb/serial/ti_usb_3410_5052.c
93461 --- linux-2.6.29.owrt/drivers/usb/serial/ti_usb_3410_5052.c 2009-05-10 22:04:38.000000000 +0200
93462 +++ linux-2.6.29-rc3.owrt/drivers/usb/serial/ti_usb_3410_5052.c 2009-05-10 23:48:29.000000000 +0200
93463 @@ -176,7 +176,7 @@
93464 /* the array dimension is the number of default entries plus */
93465 /* TI_EXTRA_VID_PID_COUNT user defined entries plus 1 terminating */
93466 /* null entry */
93467 -static struct usb_device_id ti_id_table_3410[10+TI_EXTRA_VID_PID_COUNT+1] = {
93468 +static struct usb_device_id ti_id_table_3410[7+TI_EXTRA_VID_PID_COUNT+1] = {
93469 { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) },
93470 { USB_DEVICE(TI_VENDOR_ID, TI_3410_EZ430_ID) },
93471 { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_NO_FW_PRODUCT_ID) },
93472 @@ -185,11 +185,9 @@
93473 { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_PRODUCT_ID) },
93474 { USB_DEVICE(MTS_VENDOR_ID, MTS_EDGE_PRODUCT_ID) },
93475 { USB_DEVICE(IBM_VENDOR_ID, IBM_4543_PRODUCT_ID) },
93476 - { USB_DEVICE(IBM_VENDOR_ID, IBM_454B_PRODUCT_ID) },
93477 - { USB_DEVICE(IBM_VENDOR_ID, IBM_454C_PRODUCT_ID) },
93478 };
93479
93480 -static struct usb_device_id ti_id_table_5052[5+TI_EXTRA_VID_PID_COUNT+1] = {
93481 +static struct usb_device_id ti_id_table_5052[4+TI_EXTRA_VID_PID_COUNT+1] = {
93482 { USB_DEVICE(TI_VENDOR_ID, TI_5052_BOOT_PRODUCT_ID) },
93483 { USB_DEVICE(TI_VENDOR_ID, TI_5152_BOOT_PRODUCT_ID) },
93484 { USB_DEVICE(TI_VENDOR_ID, TI_5052_EEPROM_PRODUCT_ID) },
93485 @@ -197,7 +195,7 @@
93486 { USB_DEVICE(IBM_VENDOR_ID, IBM_4543_PRODUCT_ID) },
93487 };
93488
93489 -static struct usb_device_id ti_id_table_combined[14+2*TI_EXTRA_VID_PID_COUNT+1] = {
93490 +static struct usb_device_id ti_id_table_combined[6+2*TI_EXTRA_VID_PID_COUNT+1] = {
93491 { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) },
93492 { USB_DEVICE(TI_VENDOR_ID, TI_3410_EZ430_ID) },
93493 { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_NO_FW_PRODUCT_ID) },
93494 @@ -210,8 +208,6 @@
93495 { USB_DEVICE(TI_VENDOR_ID, TI_5052_EEPROM_PRODUCT_ID) },
93496 { USB_DEVICE(TI_VENDOR_ID, TI_5052_FIRMWARE_PRODUCT_ID) },
93497 { USB_DEVICE(IBM_VENDOR_ID, IBM_4543_PRODUCT_ID) },
93498 - { USB_DEVICE(IBM_VENDOR_ID, IBM_454B_PRODUCT_ID) },
93499 - { USB_DEVICE(IBM_VENDOR_ID, IBM_454C_PRODUCT_ID) },
93500 { }
93501 };
93502
93503 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/serial/ti_usb_3410_5052.h linux-2.6.29-rc3.owrt/drivers/usb/serial/ti_usb_3410_5052.h
93504 --- linux-2.6.29.owrt/drivers/usb/serial/ti_usb_3410_5052.h 2009-05-10 22:04:38.000000000 +0200
93505 +++ linux-2.6.29-rc3.owrt/drivers/usb/serial/ti_usb_3410_5052.h 2009-05-10 23:48:29.000000000 +0200
93506 @@ -30,8 +30,6 @@
93507 #define IBM_VENDOR_ID 0x04b3
93508 #define TI_3410_PRODUCT_ID 0x3410
93509 #define IBM_4543_PRODUCT_ID 0x4543
93510 -#define IBM_454B_PRODUCT_ID 0x454b
93511 -#define IBM_454C_PRODUCT_ID 0x454c
93512 #define TI_3410_EZ430_ID 0xF430 /* TI ez430 development tool */
93513 #define TI_5052_BOOT_PRODUCT_ID 0x5052 /* no EEPROM, no firmware */
93514 #define TI_5152_BOOT_PRODUCT_ID 0x5152 /* no EEPROM, no firmware */
93515 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/storage/scsiglue.c linux-2.6.29-rc3.owrt/drivers/usb/storage/scsiglue.c
93516 --- linux-2.6.29.owrt/drivers/usb/storage/scsiglue.c 2009-05-10 22:04:38.000000000 +0200
93517 +++ linux-2.6.29-rc3.owrt/drivers/usb/storage/scsiglue.c 2009-05-10 23:48:29.000000000 +0200
93518 @@ -64,7 +64,6 @@
93519 */
93520 #define VENDOR_ID_NOKIA 0x0421
93521 #define VENDOR_ID_NIKON 0x04b0
93522 -#define VENDOR_ID_PENTAX 0x0a17
93523 #define VENDOR_ID_MOTOROLA 0x22b8
93524
93525 /***********************************************************************
93526 @@ -159,7 +158,6 @@
93527 switch (le16_to_cpu(us->pusb_dev->descriptor.idVendor)) {
93528 case VENDOR_ID_NOKIA:
93529 case VENDOR_ID_NIKON:
93530 - case VENDOR_ID_PENTAX:
93531 case VENDOR_ID_MOTOROLA:
93532 if (!(us->fflags & (US_FL_FIX_CAPACITY |
93533 US_FL_CAPACITY_OK)))
93534 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/storage/transport.c linux-2.6.29-rc3.owrt/drivers/usb/storage/transport.c
93535 --- linux-2.6.29.owrt/drivers/usb/storage/transport.c 2009-05-10 22:04:38.000000000 +0200
93536 +++ linux-2.6.29-rc3.owrt/drivers/usb/storage/transport.c 2009-05-10 23:48:29.000000000 +0200
93537 @@ -558,10 +558,32 @@
93538
93539 if (srb->result == SAM_STAT_GOOD && scsi_get_resid(srb) == 0) {
93540
93541 - /* The command succeeded. We know this device doesn't
93542 - * have the last-sector bug, so stop checking it.
93543 + /* The command succeeded. If the capacity is odd
93544 + * (i.e., if the sector number is even) then the
93545 + * "always-even" heuristic would be wrong for this
93546 + * device. Issue a WARN() so that the kerneloops.org
93547 + * project will be notified and we will then know to
93548 + * mark the device with a CAPACITY_OK flag. Hopefully
93549 + * this will occur for only a few devices.
93550 + *
93551 + * Use the sign of us->last_sector_hacks to tell whether
93552 + * the warning has already been issued; we don't need
93553 + * more than one warning per device.
93554 */
93555 - us->use_last_sector_hacks = 0;
93556 + if (!(sector & 1) && us->use_last_sector_hacks > 0) {
93557 + unsigned vid = le16_to_cpu(
93558 + us->pusb_dev->descriptor.idVendor);
93559 + unsigned pid = le16_to_cpu(
93560 + us->pusb_dev->descriptor.idProduct);
93561 + unsigned rev = le16_to_cpu(
93562 + us->pusb_dev->descriptor.bcdDevice);
93563 +
93564 + WARN(1, "%s: Successful last sector success at %u, "
93565 + "device %04x:%04x:%04x\n",
93566 + sdkp->disk->disk_name, sector,
93567 + vid, pid, rev);
93568 + us->use_last_sector_hacks = -1;
93569 + }
93570
93571 } else {
93572 /* The command failed. Allow up to 3 retries in case this
93573 @@ -577,6 +599,14 @@
93574 srb->result = SAM_STAT_CHECK_CONDITION;
93575 memcpy(srb->sense_buffer, record_not_found,
93576 sizeof(record_not_found));
93577 +
93578 + /* In theory we might want to issue a WARN() here if the
93579 + * capacity is even, since it could indicate the device
93580 + * has the READ CAPACITY bug _and_ the real capacity is
93581 + * odd. But it could also indicate that the device
93582 + * simply can't access its last sector, a failure mode
93583 + * which is surprisingly common. So no warning.
93584 + */
93585 }
93586
93587 done:
93588 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/storage/unusual_devs.h linux-2.6.29-rc3.owrt/drivers/usb/storage/unusual_devs.h
93589 --- linux-2.6.29.owrt/drivers/usb/storage/unusual_devs.h 2009-05-10 22:04:38.000000000 +0200
93590 +++ linux-2.6.29-rc3.owrt/drivers/usb/storage/unusual_devs.h 2009-05-10 23:48:29.000000000 +0200
93591 @@ -226,7 +226,7 @@
93592 US_FL_MAX_SECTORS_64 ),
93593
93594 /* Reported by Manuel Osdoba <manuel.osdoba@tu-ilmenau.de> */
93595 -UNUSUAL_DEV( 0x0421, 0x0492, 0x0452, 0x9999,
93596 +UNUSUAL_DEV( 0x0421, 0x0492, 0x0452, 0x0452,
93597 "Nokia",
93598 "Nokia 6233",
93599 US_SC_DEVICE, US_PR_DEVICE, NULL,
93600 @@ -907,13 +907,13 @@
93601 "Genesys Logic",
93602 "USB to IDE Optical",
93603 US_SC_DEVICE, US_PR_DEVICE, NULL,
93604 - US_FL_GO_SLOW | US_FL_MAX_SECTORS_64 | US_FL_IGNORE_RESIDUE ),
93605 + US_FL_GO_SLOW | US_FL_MAX_SECTORS_64 ),
93606
93607 UNUSUAL_DEV( 0x05e3, 0x0702, 0x0000, 0xffff,
93608 "Genesys Logic",
93609 "USB to IDE Disk",
93610 US_SC_DEVICE, US_PR_DEVICE, NULL,
93611 - US_FL_GO_SLOW | US_FL_MAX_SECTORS_64 | US_FL_IGNORE_RESIDUE ),
93612 + US_FL_GO_SLOW | US_FL_MAX_SECTORS_64 ),
93613
93614 /* Reported by Ben Efros <ben@pc-doctor.com> */
93615 UNUSUAL_DEV( 0x05e3, 0x0723, 0x9451, 0x9451,
93616 @@ -951,9 +951,7 @@
93617 US_FL_FIX_CAPACITY ),
93618
93619 /* Reported by Richard -=[]=- <micro_flyer@hotmail.com> */
93620 -/* Change to bcdDeviceMin (0x0100 to 0x0001) reported by
93621 - * Thomas Bartosik <tbartdev@gmx-topmail.de> */
93622 -UNUSUAL_DEV( 0x067b, 0x2507, 0x0001, 0x0100,
93623 +UNUSUAL_DEV( 0x067b, 0x2507, 0x0100, 0x0100,
93624 "Prolific Technology Inc.",
93625 "Mass Storage Device",
93626 US_SC_DEVICE, US_PR_DEVICE, NULL,
93627 @@ -1216,7 +1214,7 @@
93628 "Datafab",
93629 "KECF-USB",
93630 US_SC_DEVICE, US_PR_DEVICE, NULL,
93631 - US_FL_FIX_INQUIRY | US_FL_FIX_CAPACITY ),
93632 + US_FL_FIX_INQUIRY ),
93633
93634 /* Reported by Rauch Wolke <rauchwolke@gmx.net> */
93635 UNUSUAL_DEV( 0x07c4, 0xa4a5, 0x0000, 0xffff,
93636 @@ -1356,6 +1354,21 @@
93637 US_SC_DEVICE, US_PR_DEVICE, NULL,
93638 US_FL_FIX_INQUIRY ),
93639
93640 +
93641 +/* Submitted by Per Winkvist <per.winkvist@uk.com> */
93642 +UNUSUAL_DEV( 0x0a17, 0x006, 0x0000, 0xffff,
93643 + "Pentax",
93644 + "Optio S/S4",
93645 + US_SC_DEVICE, US_PR_DEVICE, NULL,
93646 + US_FL_FIX_INQUIRY ),
93647 +
93648 +/* Reported by Jaak Ristioja <Ristioja@gmail.com> */
93649 +UNUSUAL_DEV( 0x0a17, 0x006e, 0x0100, 0x0100,
93650 + "Pentax",
93651 + "K10D",
93652 + US_SC_DEVICE, US_PR_DEVICE, NULL,
93653 + US_FL_FIX_CAPACITY ),
93654 +
93655 /* These are virtual windows driver CDs, which the zd1211rw driver
93656 * automatically converts into WLAN devices. */
93657 UNUSUAL_DEV( 0x0ace, 0x2011, 0x0101, 0x0101,
93658 @@ -1392,16 +1405,6 @@
93659 US_SC_DEVICE, US_PR_DEVICE, NULL,
93660 0 ),
93661
93662 -/* Reported by Jan Dumon <j.dumon@option.com>
93663 - * This device (wrongly) has a vendor-specific device descriptor.
93664 - * The entry is needed so usb-storage can bind to it's mass-storage
93665 - * interface as an interface driver */
93666 -UNUSUAL_DEV( 0x0af0, 0x7501, 0x0000, 0x0000,
93667 - "Option",
93668 - "GI 0431 SD-Card",
93669 - US_SC_DEVICE, US_PR_DEVICE, NULL,
93670 - 0 ),
93671 -
93672 /* Reported by Ben Efros <ben@pc-doctor.com> */
93673 UNUSUAL_DEV( 0x0bc2, 0x3010, 0x0000, 0x0000,
93674 "Seagate",
93675 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/wusbcore/devconnect.c linux-2.6.29-rc3.owrt/drivers/usb/wusbcore/devconnect.c
93676 --- linux-2.6.29.owrt/drivers/usb/wusbcore/devconnect.c 2009-05-10 22:04:38.000000000 +0200
93677 +++ linux-2.6.29-rc3.owrt/drivers/usb/wusbcore/devconnect.c 2009-05-10 23:48:29.000000000 +0200
93678 @@ -386,7 +386,6 @@
93679 | USB_PORT_STAT_LOW_SPEED | USB_PORT_STAT_HIGH_SPEED);
93680 port->change |= USB_PORT_STAT_C_CONNECTION | USB_PORT_STAT_C_ENABLE;
93681 if (wusb_dev) {
93682 - dev_dbg(wusbhc->dev, "disconnecting device from port %d\n", wusb_dev->port_idx);
93683 if (!list_empty(&wusb_dev->cack_node))
93684 list_del_init(&wusb_dev->cack_node);
93685 /* For the one in cack_add() */
93686 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/wusbcore/rh.c linux-2.6.29-rc3.owrt/drivers/usb/wusbcore/rh.c
93687 --- linux-2.6.29.owrt/drivers/usb/wusbcore/rh.c 2009-05-10 22:04:38.000000000 +0200
93688 +++ linux-2.6.29-rc3.owrt/drivers/usb/wusbcore/rh.c 2009-05-10 23:48:29.000000000 +0200
93689 @@ -100,9 +100,6 @@
93690 struct wusb_port *port = wusb_port_by_idx(wusbhc, port_idx);
93691 struct wusb_dev *wusb_dev = port->wusb_dev;
93692
93693 - if (wusb_dev == NULL)
93694 - return -ENOTCONN;
93695 -
93696 port->status |= USB_PORT_STAT_RESET;
93697 port->change |= USB_PORT_STAT_C_RESET;
93698
93699 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/usb/wusbcore/wa-xfer.c linux-2.6.29-rc3.owrt/drivers/usb/wusbcore/wa-xfer.c
93700 --- linux-2.6.29.owrt/drivers/usb/wusbcore/wa-xfer.c 2009-05-10 22:04:38.000000000 +0200
93701 +++ linux-2.6.29-rc3.owrt/drivers/usb/wusbcore/wa-xfer.c 2009-05-10 23:48:29.000000000 +0200
93702 @@ -921,10 +921,8 @@
93703 result = -ENODEV;
93704 /* FIXME: segmentation broken -- kills DWA */
93705 mutex_lock(&wusbhc->mutex); /* get a WUSB dev */
93706 - if (urb->dev == NULL) {
93707 - mutex_unlock(&wusbhc->mutex);
93708 + if (urb->dev == NULL)
93709 goto error_dev_gone;
93710 - }
93711 wusb_dev = __wusb_dev_get_by_usb_dev(wusbhc, urb->dev);
93712 if (wusb_dev == NULL) {
93713 mutex_unlock(&wusbhc->mutex);
93714 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/uwb/allocator.c linux-2.6.29-rc3.owrt/drivers/uwb/allocator.c
93715 --- linux-2.6.29.owrt/drivers/uwb/allocator.c 2009-05-10 22:04:38.000000000 +0200
93716 +++ linux-2.6.29-rc3.owrt/drivers/uwb/allocator.c 2009-05-10 23:48:29.000000000 +0200
93717 @@ -15,6 +15,7 @@
93718 * You should have received a copy of the GNU General Public License
93719 * along with this program. If not, see <http://www.gnu.org/licenses/>.
93720 */
93721 +#include <linux/version.h>
93722 #include <linux/kernel.h>
93723 #include <linux/uwb.h>
93724
93725 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/uwb/drp.c linux-2.6.29-rc3.owrt/drivers/uwb/drp.c
93726 --- linux-2.6.29.owrt/drivers/uwb/drp.c 2009-05-10 22:04:38.000000000 +0200
93727 +++ linux-2.6.29-rc3.owrt/drivers/uwb/drp.c 2009-05-10 23:48:29.000000000 +0200
93728 @@ -66,14 +66,14 @@
93729 } else
93730 dev_err(&rc->uwb_dev.dev, "SET-DRP-IE: timeout\n");
93731
93732 - spin_lock_bh(&rc->rsvs_lock);
93733 + spin_lock(&rc->rsvs_lock);
93734 if (rc->set_drp_ie_pending > 1) {
93735 rc->set_drp_ie_pending = 0;
93736 uwb_rsv_queue_update(rc);
93737 } else {
93738 rc->set_drp_ie_pending = 0;
93739 }
93740 - spin_unlock_bh(&rc->rsvs_lock);
93741 + spin_unlock(&rc->rsvs_lock);
93742 }
93743
93744 /**
93745 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/uwb/rsv.c linux-2.6.29-rc3.owrt/drivers/uwb/rsv.c
93746 --- linux-2.6.29.owrt/drivers/uwb/rsv.c 2009-05-10 22:04:38.000000000 +0200
93747 +++ linux-2.6.29-rc3.owrt/drivers/uwb/rsv.c 2009-05-10 23:48:29.000000000 +0200
93748 @@ -114,8 +114,7 @@
93749 devaddr = rsv->target.devaddr;
93750 uwb_dev_addr_print(target, sizeof(target), &devaddr);
93751
93752 - dev_dbg(dev, "rsv %s %s -> %s: %s\n",
93753 - text, owner, target, uwb_rsv_state_str(rsv->state));
93754 + dev_dbg(dev, "rsv %s -> %s: %s\n", owner, target, uwb_rsv_state_str(rsv->state));
93755 }
93756
93757 static void uwb_rsv_release(struct kref *kref)
93758 @@ -512,7 +511,8 @@
93759
93760 if (uwb_rsv_is_owner(rsv))
93761 uwb_rsv_put_stream(rsv);
93762 -
93763 +
93764 + del_timer_sync(&rsv->timer);
93765 uwb_dev_put(rsv->owner);
93766 if (rsv->target.type == UWB_RSV_TARGET_DEV)
93767 uwb_dev_put(rsv->target.dev);
93768 @@ -870,7 +870,7 @@
93769 */
93770 void uwb_rsv_sched_update(struct uwb_rc *rc)
93771 {
93772 - spin_lock_bh(&rc->rsvs_lock);
93773 + spin_lock(&rc->rsvs_lock);
93774 if (!delayed_work_pending(&rc->rsv_update_work)) {
93775 if (rc->set_drp_ie_pending > 0) {
93776 rc->set_drp_ie_pending++;
93777 @@ -879,7 +879,7 @@
93778 uwb_rsv_queue_update(rc);
93779 }
93780 unlock:
93781 - spin_unlock_bh(&rc->rsvs_lock);
93782 + spin_unlock(&rc->rsvs_lock);
93783 }
93784
93785 /*
93786 @@ -943,22 +943,13 @@
93787
93788 mutex_lock(&rc->rsvs_mutex);
93789 list_for_each_entry_safe(rsv, t, &rc->reservations, rc_node) {
93790 - if (rsv->state != UWB_RSV_STATE_NONE)
93791 - uwb_rsv_set_state(rsv, UWB_RSV_STATE_NONE);
93792 - del_timer_sync(&rsv->timer);
93793 + uwb_rsv_remove(rsv);
93794 }
93795 /* Cancel any postponed update. */
93796 rc->set_drp_ie_pending = 0;
93797 mutex_unlock(&rc->rsvs_mutex);
93798
93799 cancel_delayed_work_sync(&rc->rsv_update_work);
93800 - flush_workqueue(rc->rsv_workq);
93801 -
93802 - mutex_lock(&rc->rsvs_mutex);
93803 - list_for_each_entry_safe(rsv, t, &rc->reservations, rc_node) {
93804 - uwb_rsv_remove(rsv);
93805 - }
93806 - mutex_unlock(&rc->rsvs_mutex);
93807 }
93808
93809 void uwb_rsv_init(struct uwb_rc *rc)
93810 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/video/atafb.c linux-2.6.29-rc3.owrt/drivers/video/atafb.c
93811 --- linux-2.6.29.owrt/drivers/video/atafb.c 2009-05-10 22:04:38.000000000 +0200
93812 +++ linux-2.6.29-rc3.owrt/drivers/video/atafb.c 2009-05-10 23:48:29.000000000 +0200
93813 @@ -841,7 +841,7 @@
93814 tt_dmasnd.ctrl = DMASND_CTRL_OFF;
93815 udelay(20); /* wait a while for things to settle down */
93816 }
93817 - mono_moni = (st_mfp.par_dt_reg & 0x80) == 0;
93818 + mono_moni = (mfp.par_dt_reg & 0x80) == 0;
93819
93820 tt_get_par(&par);
93821 tt_encode_var(&atafb_predefined[0], &par);
93822 @@ -2035,7 +2035,7 @@
93823 tt_dmasnd.ctrl = DMASND_CTRL_OFF;
93824 udelay(20); /* wait a while for things to settle down */
93825 }
93826 - mono_moni = (st_mfp.par_dt_reg & 0x80) == 0;
93827 + mono_moni = (mfp.par_dt_reg & 0x80) == 0;
93828
93829 stste_get_par(&par);
93830 stste_encode_var(&atafb_predefined[0], &par);
93831 @@ -2086,20 +2086,20 @@
93832 return;
93833 local_irq_save(flags);
93834
93835 - st_mfp.tim_ct_b = 0x10;
93836 - st_mfp.active_edge |= 8;
93837 - st_mfp.tim_ct_b = 0;
93838 - st_mfp.tim_dt_b = 0xf0;
93839 - st_mfp.tim_ct_b = 8;
93840 - while (st_mfp.tim_dt_b > 1) /* TOS does it this way, don't ask why */
93841 + mfp.tim_ct_b = 0x10;
93842 + mfp.active_edge |= 8;
93843 + mfp.tim_ct_b = 0;
93844 + mfp.tim_dt_b = 0xf0;
93845 + mfp.tim_ct_b = 8;
93846 + while (mfp.tim_dt_b > 1) /* TOS does it this way, don't ask why */
93847 ;
93848 - new = st_mfp.tim_dt_b;
93849 + new = mfp.tim_dt_b;
93850 do {
93851 udelay(LINE_DELAY);
93852 old = new;
93853 - new = st_mfp.tim_dt_b;
93854 + new = mfp.tim_dt_b;
93855 } while (old != new);
93856 - st_mfp.tim_ct_b = 0x10;
93857 + mfp.tim_ct_b = 0x10;
93858 udelay(SYNC_DELAY);
93859
93860 if (atari_switches & ATARI_SWITCH_OVSC_IKBD)
93861 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/video/aty/aty128fb.c linux-2.6.29-rc3.owrt/drivers/video/aty/aty128fb.c
93862 --- linux-2.6.29.owrt/drivers/video/aty/aty128fb.c 2009-05-10 22:04:38.000000000 +0200
93863 +++ linux-2.6.29-rc3.owrt/drivers/video/aty/aty128fb.c 2009-05-10 23:48:29.000000000 +0200
93864 @@ -1475,7 +1475,7 @@
93865 aty128_set_pll(&par->pll, par);
93866 aty128_set_fifo(&par->fifo_reg, par);
93867
93868 - config = aty_ld_le32(CNFG_CNTL) & ~3;
93869 + config = aty_ld_le32(CONFIG_CNTL) & ~3;
93870
93871 #if defined(__BIG_ENDIAN)
93872 if (par->crtc.bpp == 32)
93873 @@ -1484,7 +1484,7 @@
93874 config |= 1; /* make aperture do 16 bit swapping */
93875 #endif
93876
93877 - aty_st_le32(CNFG_CNTL, config);
93878 + aty_st_le32(CONFIG_CNTL, config);
93879 aty_st_8(CRTC_EXT_CNTL + 1, 0); /* turn the video back on */
93880
93881 info->fix.line_length = (par->crtc.vxres * par->crtc.bpp) >> 3;
93882 @@ -1853,14 +1853,13 @@
93883 * Initialisation
93884 */
93885
93886 -#ifdef CONFIG_PPC_PMAC__disabled
93887 +#ifdef CONFIG_PPC_PMAC
93888 static void aty128_early_resume(void *data)
93889 {
93890 struct aty128fb_par *par = data;
93891
93892 if (try_acquire_console_sem())
93893 return;
93894 - pci_restore_state(par->pdev);
93895 aty128_do_resume(par->pdev);
93896 release_console_sem();
93897 }
93898 @@ -1876,7 +1875,7 @@
93899 u32 dac;
93900
93901 /* Get the chip revision */
93902 - chip_rev = (aty_ld_le32(CNFG_CNTL) >> 16) & 0x1F;
93903 + chip_rev = (aty_ld_le32(CONFIG_CNTL) >> 16) & 0x1F;
93904
93905 strcpy(video_card, "Rage128 XX ");
93906 video_card[8] = ent->device >> 8;
93907 @@ -1908,14 +1907,7 @@
93908 /* Indicate sleep capability */
93909 if (par->chip_gen == rage_M3) {
93910 pmac_call_feature(PMAC_FTR_DEVICE_CAN_WAKE, NULL, 0, 1);
93911 -#if 0 /* Disable the early video resume hack for now as it's causing problems, among
93912 - * others we now rely on the PCI core restoring the config space for us, which
93913 - * isn't the case with that hack, and that code path causes various things to
93914 - * be called with interrupts off while they shouldn't. I'm leaving the code in
93915 - * as it can be useful for debugging purposes
93916 - */
93917 pmac_set_early_video_resume(aty128_early_resume, par);
93918 -#endif
93919 }
93920
93921 /* Find default mode */
93922 @@ -2065,7 +2057,7 @@
93923
93924 /* Grab memory size from the card */
93925 // How does this relate to the resource length from the PCI hardware?
93926 - par->vram_size = aty_ld_le32(CNFG_MEMSIZE) & 0x03FFFFFF;
93927 + par->vram_size = aty_ld_le32(CONFIG_MEMSIZE) & 0x03FFFFFF;
93928
93929 /* Virtualize the framebuffer */
93930 info->screen_base = ioremap(fb_addr, par->vram_size);
93931 @@ -2373,6 +2365,7 @@
93932 static void aty128_set_suspend(struct aty128fb_par *par, int suspend)
93933 {
93934 u32 pmgt;
93935 + u16 pwr_command;
93936 struct pci_dev *pdev = par->pdev;
93937
93938 if (!par->pm_reg)
93939 @@ -2381,8 +2374,6 @@
93940 /* Set the chip into the appropriate suspend mode (we use D2,
93941 * D3 would require a complete re-initialisation of the chip,
93942 * including PCI config registers, clocks, AGP configuration, ...)
93943 - *
93944 - * For resume, the core will have already brought us back to D0
93945 */
93946 if (suspend) {
93947 /* Make sure CRTC2 is reset. Remove that the day we decide to
93948 @@ -2400,9 +2391,17 @@
93949 aty_st_le32(BUS_CNTL1, 0x00000010);
93950 aty_st_le32(MEM_POWER_MISC, 0x0c830000);
93951 mdelay(100);
93952 -
93953 + pci_read_config_word(pdev, par->pm_reg+PCI_PM_CTRL, &pwr_command);
93954 /* Switch PCI power management to D2 */
93955 - pci_set_power_state(pdev, PCI_D2);
93956 + pci_write_config_word(pdev, par->pm_reg+PCI_PM_CTRL,
93957 + (pwr_command & ~PCI_PM_CTRL_STATE_MASK) | 2);
93958 + pci_read_config_word(pdev, par->pm_reg+PCI_PM_CTRL, &pwr_command);
93959 + } else {
93960 + /* Switch back PCI power management to D0 */
93961 + mdelay(100);
93962 + pci_write_config_word(pdev, par->pm_reg+PCI_PM_CTRL, 0);
93963 + pci_read_config_word(pdev, par->pm_reg+PCI_PM_CTRL, &pwr_command);
93964 + mdelay(100);
93965 }
93966 }
93967
93968 @@ -2411,12 +2410,6 @@
93969 struct fb_info *info = pci_get_drvdata(pdev);
93970 struct aty128fb_par *par = info->par;
93971
93972 - /* Because we may change PCI D state ourselves, we need to
93973 - * first save the config space content so the core can
93974 - * restore it properly on resume.
93975 - */
93976 - pci_save_state(pdev);
93977 -
93978 /* We don't do anything but D2, for now we return 0, but
93979 * we may want to change that. How do we know if the BIOS
93980 * can properly take care of D3 ? Also, with swsusp, we
93981 @@ -2483,11 +2476,6 @@
93982 if (pdev->dev.power.power_state.event == PM_EVENT_ON)
93983 return 0;
93984
93985 - /* PCI state will have been restored by the core, so
93986 - * we should be in D0 now with our config space fully
93987 - * restored
93988 - */
93989 -
93990 /* Wakeup chip */
93991 aty128_set_suspend(par, 0);
93992 par->asleep = 0;
93993 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/video/aty/atyfb_base.c linux-2.6.29-rc3.owrt/drivers/video/aty/atyfb_base.c
93994 --- linux-2.6.29.owrt/drivers/video/aty/atyfb_base.c 2009-05-10 22:04:38.000000000 +0200
93995 +++ linux-2.6.29-rc3.owrt/drivers/video/aty/atyfb_base.c 2009-05-10 23:48:29.000000000 +0200
93996 @@ -135,7 +135,7 @@
93997 #if defined(CONFIG_PM) || defined(CONFIG_PMAC_BACKLIGHT) || \
93998 defined (CONFIG_FB_ATY_GENERIC_LCD) || defined(CONFIG_FB_ATY_BACKLIGHT)
93999 static const u32 lt_lcd_regs[] = {
94000 - CNFG_PANEL_LG,
94001 + CONFIG_PANEL_LG,
94002 LCD_GEN_CNTL_LG,
94003 DSTN_CONTROL_LG,
94004 HFB_PITCH_ADDR_LG,
94005 @@ -446,7 +446,7 @@
94006 par->pll_limits.ecp_max = aty_chips[i].ecp_max;
94007 par->features = aty_chips[i].features;
94008
94009 - chip_id = aty_ld_le32(CNFG_CHIP_ID, par);
94010 + chip_id = aty_ld_le32(CONFIG_CHIP_ID, par);
94011 type = chip_id & CFG_CHIP_TYPE;
94012 rev = (chip_id & CFG_CHIP_REV) >> 24;
94013
94014 @@ -629,7 +629,7 @@
94015 crtc->lcd_index = aty_ld_le32(LCD_INDEX, par);
94016 aty_st_le32(LCD_INDEX, crtc->lcd_index, par);
94017 }
94018 - crtc->lcd_config_panel = aty_ld_lcd(CNFG_PANEL, par);
94019 + crtc->lcd_config_panel = aty_ld_lcd(CONFIG_PANEL, par);
94020 crtc->lcd_gen_cntl = aty_ld_lcd(LCD_GEN_CNTL, par);
94021
94022
94023 @@ -676,7 +676,7 @@
94024 aty_st_le32(CRTC_GEN_CNTL, crtc->gen_cntl & ~(CRTC_EXT_DISP_EN | CRTC_EN), par);
94025
94026 /* update non-shadow registers first */
94027 - aty_st_lcd(CNFG_PANEL, crtc->lcd_config_panel, par);
94028 + aty_st_lcd(CONFIG_PANEL, crtc->lcd_config_panel, par);
94029 aty_st_lcd(LCD_GEN_CNTL, crtc->lcd_gen_cntl &
94030 ~(CRTC_RW_SELECT | SHADOW_EN | SHADOW_RW_EN), par);
94031
94032 @@ -858,7 +858,7 @@
94033 if (!M64_HAS(MOBIL_BUS))
94034 crtc->lcd_index |= CRTC2_DISPLAY_DIS;
94035
94036 - crtc->lcd_config_panel = aty_ld_lcd(CNFG_PANEL, par) | 0x4000;
94037 + crtc->lcd_config_panel = aty_ld_lcd(CONFIG_PANEL, par) | 0x4000;
94038 crtc->lcd_gen_cntl = aty_ld_lcd(LCD_GEN_CNTL, par) & ~CRTC_RW_SELECT;
94039
94040 crtc->lcd_gen_cntl &=
94041 @@ -1978,7 +1978,7 @@
94042
94043 return timeout ? 0 : -EIO;
94044 }
94045 -#endif /* CONFIG_PPC_PMAC */
94046 +#endif
94047
94048 static int atyfb_pci_suspend(struct pci_dev *pdev, pm_message_t state)
94049 {
94050 @@ -2002,15 +2002,9 @@
94051 par->asleep = 1;
94052 par->lock_blank = 1;
94053
94054 - /* Because we may change PCI D state ourselves, we need to
94055 - * first save the config space content so the core can
94056 - * restore it properly on resume.
94057 - */
94058 - pci_save_state(pdev);
94059 -
94060 #ifdef CONFIG_PPC_PMAC
94061 /* Set chip to "suspend" mode */
94062 - if (machine_is(powermac) && aty_power_mgmt(1, par)) {
94063 + if (aty_power_mgmt(1, par)) {
94064 par->asleep = 0;
94065 par->lock_blank = 0;
94066 atyfb_blank(FB_BLANK_UNBLANK, info);
94067 @@ -2053,15 +2047,11 @@
94068
94069 acquire_console_sem();
94070
94071 - /* PCI state will have been restored by the core, so
94072 - * we should be in D0 now with our config space fully
94073 - * restored
94074 - */
94075 -
94076 #ifdef CONFIG_PPC_PMAC
94077 - if (machine_is(powermac) &&
94078 - pdev->dev.power.power_state.event == PM_EVENT_SUSPEND)
94079 + if (pdev->dev.power.power_state.event == 2)
94080 aty_power_mgmt(0, par);
94081 +#else
94082 + pci_set_power_state(pdev, PCI_D0);
94083 #endif
94084
94085 aty_resume_chip(info);
94086 @@ -2264,7 +2254,7 @@
94087 if (!M64_HAS(INTEGRATED)) {
94088 u32 stat0;
94089 u8 dac_type, dac_subtype, clk_type;
94090 - stat0 = aty_ld_le32(CNFG_STAT0, par);
94091 + stat0 = aty_ld_le32(CONFIG_STAT0, par);
94092 par->bus_type = (stat0 >> 0) & 0x07;
94093 par->ram_type = (stat0 >> 3) & 0x07;
94094 ramname = aty_gx_ram[par->ram_type];
94095 @@ -2334,7 +2324,7 @@
94096 par->dac_ops = &aty_dac_ct;
94097 par->pll_ops = &aty_pll_ct;
94098 par->bus_type = PCI;
94099 - par->ram_type = (aty_ld_le32(CNFG_STAT0, par) & 0x07);
94100 + par->ram_type = (aty_ld_le32(CONFIG_STAT0, par) & 0x07);
94101 ramname = aty_ct_ram[par->ram_type];
94102 /* for many chips, the mclk is 67 MHz for SDRAM, 63 MHz otherwise */
94103 if (par->pll_limits.mclk == 67 && par->ram_type < SDRAM)
94104 @@ -2443,7 +2433,7 @@
94105 }
94106
94107 if (M64_HAS(MAGIC_VRAM_SIZE)) {
94108 - if (aty_ld_le32(CNFG_STAT1, par) & 0x40000000)
94109 + if (aty_ld_le32(CONFIG_STAT1, par) & 0x40000000)
94110 info->fix.smem_len += 0x400000;
94111 }
94112
94113 @@ -2956,7 +2946,7 @@
94114 * Fix PROMs idea of MEM_CNTL settings...
94115 */
94116 mem = aty_ld_le32(MEM_CNTL, par);
94117 - chip_id = aty_ld_le32(CNFG_CHIP_ID, par);
94118 + chip_id = aty_ld_le32(CONFIG_CHIP_ID, par);
94119 if (((chip_id & CFG_CHIP_TYPE) == VT_CHIP_ID) && !((chip_id >> 24) & 1)) {
94120 switch (mem & 0x0f) {
94121 case 3:
94122 @@ -2974,7 +2964,7 @@
94123 default:
94124 break;
94125 }
94126 - if ((aty_ld_le32(CNFG_STAT0, par) & 7) >= SDRAM)
94127 + if ((aty_ld_le32(CONFIG_STAT0, par) & 7) >= SDRAM)
94128 mem &= ~(0x00700000);
94129 }
94130 mem &= ~(0xcf80e000); /* Turn off all undocumented bits. */
94131 @@ -3582,7 +3572,7 @@
94132 }
94133
94134 /* Fake pci_id for correct_chipset() */
94135 - switch (aty_ld_le32(CNFG_CHIP_ID, par) & CFG_CHIP_TYPE) {
94136 + switch (aty_ld_le32(CONFIG_CHIP_ID, par) & CFG_CHIP_TYPE) {
94137 case 0x00d7:
94138 par->pci_id = PCI_CHIP_MACH64GX;
94139 break;
94140 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/video/aty/mach64_ct.c linux-2.6.29-rc3.owrt/drivers/video/aty/mach64_ct.c
94141 --- linux-2.6.29.owrt/drivers/video/aty/mach64_ct.c 2009-05-10 22:04:38.000000000 +0200
94142 +++ linux-2.6.29-rc3.owrt/drivers/video/aty/mach64_ct.c 2009-05-10 23:48:29.000000000 +0200
94143 @@ -8,9 +8,6 @@
94144 #include <asm/io.h>
94145 #include <video/mach64.h>
94146 #include "atyfb.h"
94147 -#ifdef CONFIG_PPC
94148 -#include <asm/machdep.h>
94149 -#endif
94150
94151 #undef DEBUG
94152
94153 @@ -539,14 +536,6 @@
94154 pll->ct.xclk_post_div_real = postdividers[xpost_div];
94155 pll->ct.mclk_fb_div = q * pll->ct.xclk_post_div_real / 8;
94156
94157 -#ifdef CONFIG_PPC
94158 - if (machine_is(powermac)) {
94159 - /* Override PLL_EXT_CNTL & 0x07. */
94160 - pll->ct.xclk_post_div = xpost_div;
94161 - pll->ct.xclk_ref_div = 1;
94162 - }
94163 -#endif
94164 -
94165 #ifdef DEBUG
94166 pllmclk = (1000000 * pll->ct.mclk_fb_mult * pll->ct.mclk_fb_div) /
94167 (par->ref_clk_per * pll->ct.pll_ref_div);
94168 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/video/aty/radeon_base.c linux-2.6.29-rc3.owrt/drivers/video/aty/radeon_base.c
94169 --- linux-2.6.29.owrt/drivers/video/aty/radeon_base.c 2009-05-10 22:04:38.000000000 +0200
94170 +++ linux-2.6.29-rc3.owrt/drivers/video/aty/radeon_base.c 2009-05-10 23:48:29.000000000 +0200
94171 @@ -1936,8 +1936,8 @@
94172 OUTREG(CRTC_GEN_CNTL, save_crtc_gen_cntl | CRTC_DISP_REQ_EN_B);
94173 mdelay(100);
94174
94175 - aper_base = INREG(CNFG_APER_0_BASE);
94176 - aper_size = INREG(CNFG_APER_SIZE);
94177 + aper_base = INREG(CONFIG_APER_0_BASE);
94178 + aper_size = INREG(CONFIG_APER_SIZE);
94179
94180 #ifdef SET_MC_FB_FROM_APERTURE
94181 /* Set framebuffer to be at the same address as set in PCI BAR */
94182 @@ -2024,11 +2024,11 @@
94183 ~CRTC_H_CUTOFF_ACTIVE_EN);
94184 }
94185 } else {
94186 - tmp = INREG(CNFG_MEMSIZE);
94187 + tmp = INREG(CONFIG_MEMSIZE);
94188 }
94189
94190 /* mem size is bits [28:0], mask off the rest */
94191 - rinfo->video_ram = tmp & CNFG_MEMSIZE_MASK;
94192 + rinfo->video_ram = tmp & CONFIG_MEMSIZE_MASK;
94193
94194 /*
94195 * Hack to get around some busted production M6's
94196 @@ -2228,7 +2228,7 @@
94197 */
94198 rinfo->errata = 0;
94199 if (rinfo->family == CHIP_FAMILY_R300 &&
94200 - (INREG(CNFG_CNTL) & CFG_ATI_REV_ID_MASK)
94201 + (INREG(CONFIG_CNTL) & CFG_ATI_REV_ID_MASK)
94202 == CFG_ATI_REV_A11)
94203 rinfo->errata |= CHIP_ERRATA_R300_CG;
94204
94205 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/video/aty/radeonfb.h linux-2.6.29-rc3.owrt/drivers/video/aty/radeonfb.h
94206 --- linux-2.6.29.owrt/drivers/video/aty/radeonfb.h 2009-05-10 22:04:38.000000000 +0200
94207 +++ linux-2.6.29-rc3.owrt/drivers/video/aty/radeonfb.h 2009-05-10 23:48:29.000000000 +0200
94208 @@ -361,6 +361,8 @@
94209 #ifdef CONFIG_FB_RADEON_I2C
94210 struct radeon_i2c_chan i2c[4];
94211 #endif
94212 +
94213 + u32 cfg_save[64];
94214 };
94215
94216
94217 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/video/aty/radeon_pm.c linux-2.6.29-rc3.owrt/drivers/video/aty/radeon_pm.c
94218 --- linux-2.6.29.owrt/drivers/video/aty/radeon_pm.c 2009-05-10 22:04:38.000000000 +0200
94219 +++ linux-2.6.29-rc3.owrt/drivers/video/aty/radeon_pm.c 2009-05-10 23:48:29.000000000 +0200
94220 @@ -333,7 +333,7 @@
94221 if (!rinfo->has_CRTC2) {
94222 tmp = INPLL(pllSCLK_CNTL);
94223
94224 - if ((INREG(CNFG_CNTL) & CFG_ATI_REV_ID_MASK) > CFG_ATI_REV_A13)
94225 + if ((INREG(CONFIG_CNTL) & CFG_ATI_REV_ID_MASK) > CFG_ATI_REV_A13)
94226 tmp &= ~(SCLK_CNTL__FORCE_CP | SCLK_CNTL__FORCE_RB);
94227 tmp &= ~(SCLK_CNTL__FORCE_HDP | SCLK_CNTL__FORCE_DISP1 |
94228 SCLK_CNTL__FORCE_TOP | SCLK_CNTL__FORCE_SE |
94229 @@ -468,9 +468,9 @@
94230
94231 /*RAGE_6::A11 A12 A12N1 A13, RV250::A11 A12, R300*/
94232 if ((rinfo->family == CHIP_FAMILY_RV250 &&
94233 - ((INREG(CNFG_CNTL) & CFG_ATI_REV_ID_MASK) < CFG_ATI_REV_A13)) ||
94234 + ((INREG(CONFIG_CNTL) & CFG_ATI_REV_ID_MASK) < CFG_ATI_REV_A13)) ||
94235 ((rinfo->family == CHIP_FAMILY_RV100) &&
94236 - ((INREG(CNFG_CNTL) & CFG_ATI_REV_ID_MASK) <= CFG_ATI_REV_A13))) {
94237 + ((INREG(CONFIG_CNTL) & CFG_ATI_REV_ID_MASK) <= CFG_ATI_REV_A13))) {
94238 tmp |= SCLK_CNTL__FORCE_CP;
94239 tmp |= SCLK_CNTL__FORCE_VIP;
94240 }
94241 @@ -486,7 +486,7 @@
94242 /* RV200::A11 A12 RV250::A11 A12 */
94243 if (((rinfo->family == CHIP_FAMILY_RV200) ||
94244 (rinfo->family == CHIP_FAMILY_RV250)) &&
94245 - ((INREG(CNFG_CNTL) & CFG_ATI_REV_ID_MASK) < CFG_ATI_REV_A13))
94246 + ((INREG(CONFIG_CNTL) & CFG_ATI_REV_ID_MASK) < CFG_ATI_REV_A13))
94247 tmp |= SCLK_MORE_CNTL__FORCEON;
94248
94249 OUTPLL(pllSCLK_MORE_CNTL, tmp);
94250 @@ -497,7 +497,7 @@
94251 /* RV200::A11 A12, RV250::A11 A12 */
94252 if (((rinfo->family == CHIP_FAMILY_RV200) ||
94253 (rinfo->family == CHIP_FAMILY_RV250)) &&
94254 - ((INREG(CNFG_CNTL) & CFG_ATI_REV_ID_MASK) < CFG_ATI_REV_A13)) {
94255 + ((INREG(CONFIG_CNTL) & CFG_ATI_REV_ID_MASK) < CFG_ATI_REV_A13)) {
94256 tmp = INPLL(pllPLL_PWRMGT_CNTL);
94257 tmp |= PLL_PWRMGT_CNTL__TCL_BYPASS_DISABLE;
94258 OUTPLL(pllPLL_PWRMGT_CNTL, tmp);
94259 @@ -702,7 +702,7 @@
94260 OUTREG(DISPLAY_BASE_ADDR, rinfo->save_regs[31]);
94261 OUTREG(MC_AGP_LOCATION, rinfo->save_regs[32]);
94262 OUTREG(CRTC2_DISPLAY_BASE_ADDR, rinfo->save_regs[33]);
94263 - OUTREG(CNFG_MEMSIZE, rinfo->video_ram);
94264 + OUTREG(CONFIG_MEMSIZE, rinfo->video_ram);
94265
94266 OUTREG(DISP_MISC_CNTL, rinfo->save_regs[9]);
94267 OUTREG(DISP_PWR_MAN, rinfo->save_regs[10]);
94268 @@ -1723,7 +1723,7 @@
94269 OUTREG(CRTC2_DISPLAY_BASE_ADDR, rinfo->save_regs[33]);
94270 OUTREG(MC_FB_LOCATION, rinfo->save_regs[30]);
94271 OUTREG(OV0_BASE_ADDR, rinfo->save_regs[80]);
94272 - OUTREG(CNFG_MEMSIZE, rinfo->video_ram);
94273 + OUTREG(CONFIG_MEMSIZE, rinfo->video_ram);
94274 OUTREG(BUS_CNTL, rinfo->save_regs[36]);
94275 OUTREG(BUS_CNTL1, rinfo->save_regs[14]);
94276 OUTREG(MPP_TB_CONFIG, rinfo->save_regs[37]);
94277 @@ -1961,7 +1961,7 @@
94278 OUTMC(rinfo, ixMC_CHP_IO_CNTL_B1, rinfo->save_regs[68] /*0x141555ff*/);
94279 OUTMC(rinfo, ixMC_IMP_CNTL_0, rinfo->save_regs[71] /*0x00009249*/);
94280 OUTREG(MC_IND_INDEX, 0);
94281 - OUTREG(CNFG_MEMSIZE, rinfo->video_ram);
94282 + OUTREG(CONFIG_MEMSIZE, rinfo->video_ram);
94283
94284 mdelay(20);
94285 }
94286 @@ -2361,7 +2361,7 @@
94287 OUTMC(rinfo, ixMC_IMP_CNTL_0, 0x00009249);
94288 OUTREG(MC_IND_INDEX, 0);
94289
94290 - OUTREG(CNFG_MEMSIZE, rinfo->video_ram);
94291 + OUTREG(CONFIG_MEMSIZE, rinfo->video_ram);
94292
94293 radeon_pm_full_reset_sdram(rinfo);
94294
94295 @@ -2507,28 +2507,11 @@
94296
94297 #endif /* CONFIG_PPC_OF */
94298
94299 -static void radeonfb_whack_power_state(struct radeonfb_info *rinfo, pci_power_t state)
94300 -{
94301 - u16 pwr_cmd;
94302 -
94303 - for (;;) {
94304 - pci_read_config_word(rinfo->pdev,
94305 - rinfo->pm_reg+PCI_PM_CTRL,
94306 - &pwr_cmd);
94307 - if (pwr_cmd & 2)
94308 - break;
94309 - pwr_cmd = (pwr_cmd & ~PCI_PM_CTRL_STATE_MASK) | 2;
94310 - pci_write_config_word(rinfo->pdev,
94311 - rinfo->pm_reg+PCI_PM_CTRL,
94312 - pwr_cmd);
94313 - msleep(500);
94314 - }
94315 - rinfo->pdev->current_state = state;
94316 -}
94317 -
94318 static void radeon_set_suspend(struct radeonfb_info *rinfo, int suspend)
94319 {
94320 + u16 pwr_cmd;
94321 u32 tmp;
94322 + int i;
94323
94324 if (!rinfo->pm_reg)
94325 return;
94326 @@ -2574,19 +2557,32 @@
94327 }
94328 }
94329
94330 + for (i = 0; i < 64; ++i)
94331 + pci_read_config_dword(rinfo->pdev, i * 4,
94332 + &rinfo->cfg_save[i]);
94333 +
94334 /* Switch PCI power management to D2. */
94335 pci_disable_device(rinfo->pdev);
94336 - pci_save_state(rinfo->pdev);
94337 - /* The chip seems to need us to whack the PM register
94338 - * repeatedly until it sticks. We do that -prior- to
94339 - * calling pci_set_power_state()
94340 - */
94341 - radeonfb_whack_power_state(rinfo, PCI_D2);
94342 - pci_set_power_state(rinfo->pdev, PCI_D2);
94343 + for (;;) {
94344 + pci_read_config_word(
94345 + rinfo->pdev, rinfo->pm_reg+PCI_PM_CTRL,
94346 + &pwr_cmd);
94347 + if (pwr_cmd & 2)
94348 + break;
94349 + pci_write_config_word(
94350 + rinfo->pdev, rinfo->pm_reg+PCI_PM_CTRL,
94351 + (pwr_cmd & ~PCI_PM_CTRL_STATE_MASK) | 2);
94352 + mdelay(500);
94353 + }
94354 } else {
94355 printk(KERN_DEBUG "radeonfb (%s): switching to D0 state...\n",
94356 pci_name(rinfo->pdev));
94357
94358 + /* Switch back PCI powermanagment to D0 */
94359 + mdelay(200);
94360 + pci_write_config_word(rinfo->pdev, rinfo->pm_reg+PCI_PM_CTRL, 0);
94361 + mdelay(500);
94362 +
94363 if (rinfo->family <= CHIP_FAMILY_RV250) {
94364 /* Reset the SDRAM controller */
94365 radeon_pm_full_reset_sdram(rinfo);
94366 @@ -2602,10 +2598,37 @@
94367 }
94368 }
94369
94370 +static int radeon_restore_pci_cfg(struct radeonfb_info *rinfo)
94371 +{
94372 + int i;
94373 + static u32 radeon_cfg_after_resume[64];
94374 +
94375 + for (i = 0; i < 64; ++i)
94376 + pci_read_config_dword(rinfo->pdev, i * 4,
94377 + &radeon_cfg_after_resume[i]);
94378 +
94379 + if (radeon_cfg_after_resume[PCI_BASE_ADDRESS_0/4]
94380 + == rinfo->cfg_save[PCI_BASE_ADDRESS_0/4])
94381 + return 0; /* assume everything is ok */
94382 +
94383 + for (i = PCI_BASE_ADDRESS_0/4; i < 64; ++i) {
94384 + if (radeon_cfg_after_resume[i] != rinfo->cfg_save[i])
94385 + pci_write_config_dword(rinfo->pdev, i * 4,
94386 + rinfo->cfg_save[i]);
94387 + }
94388 + pci_write_config_word(rinfo->pdev, PCI_CACHE_LINE_SIZE,
94389 + rinfo->cfg_save[PCI_CACHE_LINE_SIZE/4]);
94390 + pci_write_config_word(rinfo->pdev, PCI_COMMAND,
94391 + rinfo->cfg_save[PCI_COMMAND/4]);
94392 + return 1;
94393 +}
94394 +
94395 +
94396 int radeonfb_pci_suspend(struct pci_dev *pdev, pm_message_t mesg)
94397 {
94398 struct fb_info *info = pci_get_drvdata(pdev);
94399 struct radeonfb_info *rinfo = info->par;
94400 + int i;
94401
94402 if (mesg.event == pdev->dev.power.power_state.event)
94403 return 0;
94404 @@ -2651,11 +2674,6 @@
94405 pmac_suspend_agp_for_card(pdev);
94406 #endif /* CONFIG_PPC_PMAC */
94407
94408 - /* It's unclear whether or when the generic code will do that, so let's
94409 - * do it ourselves. We save state before we do any power management
94410 - */
94411 - pci_save_state(pdev);
94412 -
94413 /* If we support wakeup from poweroff, we save all regs we can including cfg
94414 * space
94415 */
94416 @@ -2680,6 +2698,9 @@
94417 mdelay(20);
94418 OUTREG(LVDS_GEN_CNTL, INREG(LVDS_GEN_CNTL) & ~(LVDS_DIGON));
94419 }
94420 + // FIXME: Use PCI layer
94421 + for (i = 0; i < 64; ++i)
94422 + pci_read_config_dword(pdev, i * 4, &rinfo->cfg_save[i]);
94423 pci_disable_device(pdev);
94424 }
94425 /* If we support D2, we go to it (should be fixed later with a flag forcing
94426 @@ -2696,13 +2717,6 @@
94427 return 0;
94428 }
94429
94430 -static int radeon_check_power_loss(struct radeonfb_info *rinfo)
94431 -{
94432 - return rinfo->save_regs[4] != INPLL(CLK_PIN_CNTL) ||
94433 - rinfo->save_regs[2] != INPLL(MCLK_CNTL) ||
94434 - rinfo->save_regs[3] != INPLL(SCLK_CNTL);
94435 -}
94436 -
94437 int radeonfb_pci_resume(struct pci_dev *pdev)
94438 {
94439 struct fb_info *info = pci_get_drvdata(pdev);
94440 @@ -2721,13 +2735,20 @@
94441 printk(KERN_DEBUG "radeonfb (%s): resuming from state: %d...\n",
94442 pci_name(pdev), pdev->dev.power.power_state.event);
94443
94444 - /* PCI state will have been restored by the core, so
94445 - * we should be in D0 now with our config space fully
94446 - * restored
94447 - */
94448 +
94449 + if (pci_enable_device(pdev)) {
94450 + rc = -ENODEV;
94451 + printk(KERN_ERR "radeonfb (%s): can't enable PCI device !\n",
94452 + pci_name(pdev));
94453 + goto bail;
94454 + }
94455 + pci_set_master(pdev);
94456 +
94457 if (pdev->dev.power.power_state.event == PM_EVENT_SUSPEND) {
94458 - /* Wakeup chip */
94459 - if ((rinfo->pm_mode & radeon_pm_off) && radeon_check_power_loss(rinfo)) {
94460 + /* Wakeup chip. Check from config space if we were powered off
94461 + * (todo: additionally, check CLK_PIN_CNTL too)
94462 + */
94463 + if ((rinfo->pm_mode & radeon_pm_off) && radeon_restore_pci_cfg(rinfo)) {
94464 if (rinfo->reinit_func != NULL)
94465 rinfo->reinit_func(rinfo);
94466 else {
94467 @@ -2786,13 +2807,12 @@
94468 return rc;
94469 }
94470
94471 -#ifdef CONFIG_PPC_OF__disabled
94472 +#ifdef CONFIG_PPC_OF
94473 static void radeonfb_early_resume(void *data)
94474 {
94475 struct radeonfb_info *rinfo = data;
94476
94477 rinfo->no_schedule = 1;
94478 - pci_restore_state(rinfo->pdev);
94479 radeonfb_pci_resume(rinfo->pdev);
94480 rinfo->no_schedule = 0;
94481 }
94482 @@ -2859,14 +2879,7 @@
94483 */
94484 if (rinfo->pm_mode != radeon_pm_none) {
94485 pmac_call_feature(PMAC_FTR_DEVICE_CAN_WAKE, rinfo->of_node, 0, 1);
94486 -#if 0 /* Disable the early video resume hack for now as it's causing problems, among
94487 - * others we now rely on the PCI core restoring the config space for us, which
94488 - * isn't the case with that hack, and that code path causes various things to
94489 - * be called with interrupts off while they shouldn't. I'm leaving the code in
94490 - * as it can be useful for debugging purposes
94491 - */
94492 pmac_set_early_video_resume(radeonfb_early_resume, rinfo);
94493 -#endif
94494 }
94495
94496 #if 0
94497 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/video/backlight/da903x_bl.c linux-2.6.29-rc3.owrt/drivers/video/backlight/da903x_bl.c
94498 --- linux-2.6.29.owrt/drivers/video/backlight/da903x_bl.c 2009-05-10 22:04:38.000000000 +0200
94499 +++ linux-2.6.29-rc3.owrt/drivers/video/backlight/da903x_bl.c 1970-01-01 01:00:00.000000000 +0100
94500 @@ -1,203 +0,0 @@
94501 -/*
94502 - * Backlight driver for Dialog Semiconductor DA9030/DA9034
94503 - *
94504 - * Copyright (C) 2008 Compulab, Ltd.
94505 - * Mike Rapoport <mike@compulab.co.il>
94506 - *
94507 - * Copyright (C) 2006-2008 Marvell International Ltd.
94508 - * Eric Miao <eric.miao@marvell.com>
94509 - *
94510 - * This program is free software; you can redistribute it and/or modify
94511 - * it under the terms of the GNU General Public License version 2 as
94512 - * published by the Free Software Foundation.
94513 - */
94514 -
94515 -#include <linux/kernel.h>
94516 -#include <linux/init.h>
94517 -#include <linux/platform_device.h>
94518 -#include <linux/fb.h>
94519 -#include <linux/backlight.h>
94520 -#include <linux/mfd/da903x.h>
94521 -
94522 -#define DA9030_WLED_CONTROL 0x25
94523 -#define DA9030_WLED_CP_EN (1 << 6)
94524 -#define DA9030_WLED_TRIM(x) ((x) & 0x7)
94525 -
94526 -#define DA9034_WLED_CONTROL1 0x3C
94527 -#define DA9034_WLED_CONTROL2 0x3D
94528 -
94529 -#define DA9034_WLED_BOOST_EN (1 << 5)
94530 -
94531 -#define DA9030_MAX_BRIGHTNESS 7
94532 -#define DA9034_MAX_BRIGHTNESS 0x7f
94533 -
94534 -struct da903x_backlight_data {
94535 - struct device *da903x_dev;
94536 - int id;
94537 - int current_brightness;
94538 -};
94539 -
94540 -static int da903x_backlight_set(struct backlight_device *bl, int brightness)
94541 -{
94542 - struct da903x_backlight_data *data = bl_get_data(bl);
94543 - struct device *dev = data->da903x_dev;
94544 - uint8_t val;
94545 - int ret = 0;
94546 -
94547 - switch (data->id) {
94548 - case DA9034_ID_WLED:
94549 - ret = da903x_update(dev, DA9034_WLED_CONTROL1,
94550 - brightness, 0x7f);
94551 - if (ret)
94552 - return ret;
94553 -
94554 - if (data->current_brightness && brightness == 0)
94555 - ret = da903x_clr_bits(dev,
94556 - DA9034_WLED_CONTROL2,
94557 - DA9034_WLED_BOOST_EN);
94558 -
94559 - if (data->current_brightness == 0 && brightness)
94560 - ret = da903x_set_bits(dev,
94561 - DA9034_WLED_CONTROL2,
94562 - DA9034_WLED_BOOST_EN);
94563 - break;
94564 - case DA9030_ID_WLED:
94565 - val = DA9030_WLED_TRIM(brightness);
94566 - val |= brightness ? DA9030_WLED_CP_EN : 0;
94567 - ret = da903x_write(dev, DA9030_WLED_CONTROL, val);
94568 - break;
94569 - }
94570 -
94571 - if (ret)
94572 - return ret;
94573 -
94574 - data->current_brightness = brightness;
94575 - return 0;
94576 -}
94577 -
94578 -static int da903x_backlight_update_status(struct backlight_device *bl)
94579 -{
94580 - int brightness = bl->props.brightness;
94581 -
94582 - if (bl->props.power != FB_BLANK_UNBLANK)
94583 - brightness = 0;
94584 -
94585 - if (bl->props.fb_blank != FB_BLANK_UNBLANK)
94586 - brightness = 0;
94587 -
94588 - return da903x_backlight_set(bl, brightness);
94589 -}
94590 -
94591 -static int da903x_backlight_get_brightness(struct backlight_device *bl)
94592 -{
94593 - struct da903x_backlight_data *data = bl_get_data(bl);
94594 - return data->current_brightness;
94595 -}
94596 -
94597 -static struct backlight_ops da903x_backlight_ops = {
94598 - .update_status = da903x_backlight_update_status,
94599 - .get_brightness = da903x_backlight_get_brightness,
94600 -};
94601 -
94602 -static int da903x_backlight_probe(struct platform_device *pdev)
94603 -{
94604 - struct da903x_backlight_data *data;
94605 - struct backlight_device *bl;
94606 - int max_brightness;
94607 -
94608 - data = kzalloc(sizeof(*data), GFP_KERNEL);
94609 - if (data == NULL)
94610 - return -ENOMEM;
94611 -
94612 - switch (pdev->id) {
94613 - case DA9030_ID_WLED:
94614 - max_brightness = DA9030_MAX_BRIGHTNESS;
94615 - break;
94616 - case DA9034_ID_WLED:
94617 - max_brightness = DA9034_MAX_BRIGHTNESS;
94618 - break;
94619 - default:
94620 - dev_err(&pdev->dev, "invalid backlight device ID(%d)\n",
94621 - pdev->id);
94622 - kfree(data);
94623 - return -EINVAL;
94624 - }
94625 -
94626 - data->id = pdev->id;
94627 - data->da903x_dev = pdev->dev.parent;
94628 - data->current_brightness = 0;
94629 -
94630 - bl = backlight_device_register(pdev->name, data->da903x_dev,
94631 - data, &da903x_backlight_ops);
94632 - if (IS_ERR(bl)) {
94633 - dev_err(&pdev->dev, "failed to register backlight\n");
94634 - kfree(data);
94635 - return PTR_ERR(bl);
94636 - }
94637 -
94638 - bl->props.max_brightness = max_brightness;
94639 - bl->props.brightness = max_brightness;
94640 -
94641 - platform_set_drvdata(pdev, bl);
94642 - backlight_update_status(bl);
94643 - return 0;
94644 -}
94645 -
94646 -static int da903x_backlight_remove(struct platform_device *pdev)
94647 -{
94648 - struct backlight_device *bl = platform_get_drvdata(pdev);
94649 - struct da903x_backlight_data *data = bl_get_data(bl);
94650 -
94651 - backlight_device_unregister(bl);
94652 - kfree(data);
94653 - return 0;
94654 -}
94655 -
94656 -#ifdef CONFIG_PM
94657 -static int da903x_backlight_suspend(struct platform_device *pdev,
94658 - pm_message_t state)
94659 -{
94660 - struct backlight_device *bl = platform_get_drvdata(pdev);
94661 - return da903x_backlight_set(bl, 0);
94662 -}
94663 -
94664 -static int da903x_backlight_resume(struct platform_device *pdev)
94665 -{
94666 - struct backlight_device *bl = platform_get_drvdata(pdev);
94667 -
94668 - backlight_update_status(bl);
94669 - return 0;
94670 -}
94671 -#else
94672 -#define da903x_backlight_suspend NULL
94673 -#define da903x_backlight_resume NULL
94674 -#endif
94675 -
94676 -static struct platform_driver da903x_backlight_driver = {
94677 - .driver = {
94678 - .name = "da903x-backlight",
94679 - .owner = THIS_MODULE,
94680 - },
94681 - .probe = da903x_backlight_probe,
94682 - .remove = da903x_backlight_remove,
94683 - .suspend = da903x_backlight_suspend,
94684 - .resume = da903x_backlight_resume,
94685 -};
94686 -
94687 -static int __init da903x_backlight_init(void)
94688 -{
94689 - return platform_driver_register(&da903x_backlight_driver);
94690 -}
94691 -module_init(da903x_backlight_init);
94692 -
94693 -static void __exit da903x_backlight_exit(void)
94694 -{
94695 - platform_driver_unregister(&da903x_backlight_driver);
94696 -}
94697 -module_exit(da903x_backlight_exit);
94698 -
94699 -MODULE_DESCRIPTION("Backlight Driver for Dialog Semiconductor DA9030/DA9034");
94700 -MODULE_AUTHOR("Eric Miao <eric.miao@marvell.com>"
94701 - "Mike Rapoport <mike@compulab.co.il>");
94702 -MODULE_LICENSE("GPL");
94703 -MODULE_ALIAS("platform:da903x-backlight");
94704 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/video/backlight/da903x.c linux-2.6.29-rc3.owrt/drivers/video/backlight/da903x.c
94705 --- linux-2.6.29.owrt/drivers/video/backlight/da903x.c 1970-01-01 01:00:00.000000000 +0100
94706 +++ linux-2.6.29-rc3.owrt/drivers/video/backlight/da903x.c 2009-05-10 23:48:29.000000000 +0200
94707 @@ -0,0 +1,203 @@
94708 +/*
94709 + * Backlight driver for Dialog Semiconductor DA9030/DA9034
94710 + *
94711 + * Copyright (C) 2008 Compulab, Ltd.
94712 + * Mike Rapoport <mike@compulab.co.il>
94713 + *
94714 + * Copyright (C) 2006-2008 Marvell International Ltd.
94715 + * Eric Miao <eric.miao@marvell.com>
94716 + *
94717 + * This program is free software; you can redistribute it and/or modify
94718 + * it under the terms of the GNU General Public License version 2 as
94719 + * published by the Free Software Foundation.
94720 + */
94721 +
94722 +#include <linux/kernel.h>
94723 +#include <linux/init.h>
94724 +#include <linux/platform_device.h>
94725 +#include <linux/fb.h>
94726 +#include <linux/backlight.h>
94727 +#include <linux/mfd/da903x.h>
94728 +
94729 +#define DA9030_WLED_CONTROL 0x25
94730 +#define DA9030_WLED_CP_EN (1 << 6)
94731 +#define DA9030_WLED_TRIM(x) ((x) & 0x7)
94732 +
94733 +#define DA9034_WLED_CONTROL1 0x3C
94734 +#define DA9034_WLED_CONTROL2 0x3D
94735 +
94736 +#define DA9034_WLED_BOOST_EN (1 << 5)
94737 +
94738 +#define DA9030_MAX_BRIGHTNESS 7
94739 +#define DA9034_MAX_BRIGHTNESS 0x7f
94740 +
94741 +struct da903x_backlight_data {
94742 + struct device *da903x_dev;
94743 + int id;
94744 + int current_brightness;
94745 +};
94746 +
94747 +static int da903x_backlight_set(struct backlight_device *bl, int brightness)
94748 +{
94749 + struct da903x_backlight_data *data = bl_get_data(bl);
94750 + struct device *dev = data->da903x_dev;
94751 + uint8_t val;
94752 + int ret = 0;
94753 +
94754 + switch (data->id) {
94755 + case DA9034_ID_WLED:
94756 + ret = da903x_update(dev, DA9034_WLED_CONTROL1,
94757 + brightness, 0x7f);
94758 + if (ret)
94759 + return ret;
94760 +
94761 + if (data->current_brightness && brightness == 0)
94762 + ret = da903x_clr_bits(dev,
94763 + DA9034_WLED_CONTROL2,
94764 + DA9034_WLED_BOOST_EN);
94765 +
94766 + if (data->current_brightness == 0 && brightness)
94767 + ret = da903x_set_bits(dev,
94768 + DA9034_WLED_CONTROL2,
94769 + DA9034_WLED_BOOST_EN);
94770 + break;
94771 + case DA9030_ID_WLED:
94772 + val = DA9030_WLED_TRIM(brightness);
94773 + val |= brightness ? DA9030_WLED_CP_EN : 0;
94774 + ret = da903x_write(dev, DA9030_WLED_CONTROL, val);
94775 + break;
94776 + }
94777 +
94778 + if (ret)
94779 + return ret;
94780 +
94781 + data->current_brightness = brightness;
94782 + return 0;
94783 +}
94784 +
94785 +static int da903x_backlight_update_status(struct backlight_device *bl)
94786 +{
94787 + int brightness = bl->props.brightness;
94788 +
94789 + if (bl->props.power != FB_BLANK_UNBLANK)
94790 + brightness = 0;
94791 +
94792 + if (bl->props.fb_blank != FB_BLANK_UNBLANK)
94793 + brightness = 0;
94794 +
94795 + return da903x_backlight_set(bl, brightness);
94796 +}
94797 +
94798 +static int da903x_backlight_get_brightness(struct backlight_device *bl)
94799 +{
94800 + struct da903x_backlight_data *data = bl_get_data(bl);
94801 + return data->current_brightness;
94802 +}
94803 +
94804 +static struct backlight_ops da903x_backlight_ops = {
94805 + .update_status = da903x_backlight_update_status,
94806 + .get_brightness = da903x_backlight_get_brightness,
94807 +};
94808 +
94809 +static int da903x_backlight_probe(struct platform_device *pdev)
94810 +{
94811 + struct da903x_backlight_data *data;
94812 + struct backlight_device *bl;
94813 + int max_brightness;
94814 +
94815 + data = kzalloc(sizeof(*data), GFP_KERNEL);
94816 + if (data == NULL)
94817 + return -ENOMEM;
94818 +
94819 + switch (pdev->id) {
94820 + case DA9030_ID_WLED:
94821 + max_brightness = DA9030_MAX_BRIGHTNESS;
94822 + break;
94823 + case DA9034_ID_WLED:
94824 + max_brightness = DA9034_MAX_BRIGHTNESS;
94825 + break;
94826 + default:
94827 + dev_err(&pdev->dev, "invalid backlight device ID(%d)\n",
94828 + pdev->id);
94829 + kfree(data);
94830 + return -EINVAL;
94831 + }
94832 +
94833 + data->id = pdev->id;
94834 + data->da903x_dev = pdev->dev.parent;
94835 + data->current_brightness = 0;
94836 +
94837 + bl = backlight_device_register(pdev->name, data->da903x_dev,
94838 + data, &da903x_backlight_ops);
94839 + if (IS_ERR(bl)) {
94840 + dev_err(&pdev->dev, "failed to register backlight\n");
94841 + kfree(data);
94842 + return PTR_ERR(bl);
94843 + }
94844 +
94845 + bl->props.max_brightness = max_brightness;
94846 + bl->props.brightness = max_brightness;
94847 +
94848 + platform_set_drvdata(pdev, bl);
94849 + backlight_update_status(bl);
94850 + return 0;
94851 +}
94852 +
94853 +static int da903x_backlight_remove(struct platform_device *pdev)
94854 +{
94855 + struct backlight_device *bl = platform_get_drvdata(pdev);
94856 + struct da903x_backlight_data *data = bl_get_data(bl);
94857 +
94858 + backlight_device_unregister(bl);
94859 + kfree(data);
94860 + return 0;
94861 +}
94862 +
94863 +#ifdef CONFIG_PM
94864 +static int da903x_backlight_suspend(struct platform_device *pdev,
94865 + pm_message_t state)
94866 +{
94867 + struct backlight_device *bl = platform_get_drvdata(pdev);
94868 + return da903x_backlight_set(bl, 0);
94869 +}
94870 +
94871 +static int da903x_backlight_resume(struct platform_device *pdev)
94872 +{
94873 + struct backlight_device *bl = platform_get_drvdata(pdev);
94874 +
94875 + backlight_update_status(bl);
94876 + return 0;
94877 +}
94878 +#else
94879 +#define da903x_backlight_suspend NULL
94880 +#define da903x_backlight_resume NULL
94881 +#endif
94882 +
94883 +static struct platform_driver da903x_backlight_driver = {
94884 + .driver = {
94885 + .name = "da903x-backlight",
94886 + .owner = THIS_MODULE,
94887 + },
94888 + .probe = da903x_backlight_probe,
94889 + .remove = da903x_backlight_remove,
94890 + .suspend = da903x_backlight_suspend,
94891 + .resume = da903x_backlight_resume,
94892 +};
94893 +
94894 +static int __init da903x_backlight_init(void)
94895 +{
94896 + return platform_driver_register(&da903x_backlight_driver);
94897 +}
94898 +module_init(da903x_backlight_init);
94899 +
94900 +static void __exit da903x_backlight_exit(void)
94901 +{
94902 + platform_driver_unregister(&da903x_backlight_driver);
94903 +}
94904 +module_exit(da903x_backlight_exit);
94905 +
94906 +MODULE_DESCRIPTION("Backlight Driver for Dialog Semiconductor DA9030/DA9034");
94907 +MODULE_AUTHOR("Eric Miao <eric.miao@marvell.com>"
94908 + "Mike Rapoport <mike@compulab.co.il>");
94909 +MODULE_LICENSE("GPL");
94910 +MODULE_ALIAS("platform:da903x-backlight");
94911 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/video/backlight/Makefile linux-2.6.29-rc3.owrt/drivers/video/backlight/Makefile
94912 --- linux-2.6.29.owrt/drivers/video/backlight/Makefile 2009-05-10 22:04:38.000000000 +0200
94913 +++ linux-2.6.29-rc3.owrt/drivers/video/backlight/Makefile 2009-05-10 23:48:29.000000000 +0200
94914 @@ -18,7 +18,7 @@
94915 obj-$(CONFIG_BACKLIGHT_PROGEAR) += progear_bl.o
94916 obj-$(CONFIG_BACKLIGHT_CARILLO_RANCH) += cr_bllcd.o
94917 obj-$(CONFIG_BACKLIGHT_PWM) += pwm_bl.o
94918 -obj-$(CONFIG_BACKLIGHT_DA903X) += da903x_bl.o
94919 +obj-$(CONFIG_BACKLIGHT_DA903X) += da903x.o
94920 obj-$(CONFIG_BACKLIGHT_MBP_NVIDIA) += mbp_nvidia_bl.o
94921 obj-$(CONFIG_BACKLIGHT_TOSA) += tosa_bl.o
94922 obj-$(CONFIG_BACKLIGHT_SAHARA) += kb3886_bl.o
94923 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/video/bfin-t350mcqb-fb.c linux-2.6.29-rc3.owrt/drivers/video/bfin-t350mcqb-fb.c
94924 --- linux-2.6.29.owrt/drivers/video/bfin-t350mcqb-fb.c 2009-05-10 22:04:38.000000000 +0200
94925 +++ linux-2.6.29-rc3.owrt/drivers/video/bfin-t350mcqb-fb.c 2009-05-10 23:48:29.000000000 +0200
94926 @@ -447,7 +447,7 @@
94927 return IRQ_HANDLED;
94928 }
94929
94930 -static int __devinit bfin_t350mcqb_probe(struct platform_device *pdev)
94931 +static int __init bfin_t350mcqb_probe(struct platform_device *pdev)
94932 {
94933 struct bfin_t350mcqbfb_info *info;
94934 struct fb_info *fbinfo;
94935 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/video/fbcmap.c linux-2.6.29-rc3.owrt/drivers/video/fbcmap.c
94936 --- linux-2.6.29.owrt/drivers/video/fbcmap.c 2009-05-10 22:04:38.000000000 +0200
94937 +++ linux-2.6.29-rc3.owrt/drivers/video/fbcmap.c 2009-05-10 23:48:29.000000000 +0200
94938 @@ -250,6 +250,10 @@
94939 int rc, size = cmap->len * sizeof(u16);
94940 struct fb_cmap umap;
94941
94942 + if (cmap->start < 0 || (!info->fbops->fb_setcolreg &&
94943 + !info->fbops->fb_setcmap))
94944 + return -EINVAL;
94945 +
94946 memset(&umap, 0, sizeof(struct fb_cmap));
94947 rc = fb_alloc_cmap(&umap, cmap->len, cmap->transp != NULL);
94948 if (rc)
94949 @@ -258,23 +262,11 @@
94950 copy_from_user(umap.green, cmap->green, size) ||
94951 copy_from_user(umap.blue, cmap->blue, size) ||
94952 (cmap->transp && copy_from_user(umap.transp, cmap->transp, size))) {
94953 - rc = -EFAULT;
94954 - goto out;
94955 + fb_dealloc_cmap(&umap);
94956 + return -EFAULT;
94957 }
94958 umap.start = cmap->start;
94959 - if (!lock_fb_info(info)) {
94960 - rc = -ENODEV;
94961 - goto out;
94962 - }
94963 - if (cmap->start < 0 || (!info->fbops->fb_setcolreg &&
94964 - !info->fbops->fb_setcmap)) {
94965 - rc = -EINVAL;
94966 - goto out1;
94967 - }
94968 rc = fb_set_cmap(&umap, info);
94969 -out1:
94970 - unlock_fb_info(info);
94971 -out:
94972 fb_dealloc_cmap(&umap);
94973 return rc;
94974 }
94975 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/video/fbmem.c linux-2.6.29-rc3.owrt/drivers/video/fbmem.c
94976 --- linux-2.6.29.owrt/drivers/video/fbmem.c 2009-05-10 22:04:38.000000000 +0200
94977 +++ linux-2.6.29-rc3.owrt/drivers/video/fbmem.c 2009-05-10 23:48:29.000000000 +0200
94978 @@ -1013,139 +1013,132 @@
94979 struct fb_var_screeninfo var;
94980 struct fb_fix_screeninfo fix;
94981 struct fb_con2fbmap con2fb;
94982 - struct fb_cmap cmap_from;
94983 struct fb_cmap_user cmap;
94984 struct fb_event event;
94985 void __user *argp = (void __user *)arg;
94986 long ret = 0;
94987
94988 + fb = info->fbops;
94989 + if (!fb)
94990 + return -ENODEV;
94991 +
94992 switch (cmd) {
94993 case FBIOGET_VSCREENINFO:
94994 - if (!lock_fb_info(info))
94995 - return -ENODEV;
94996 - var = info->var;
94997 - unlock_fb_info(info);
94998 -
94999 - ret = copy_to_user(argp, &var, sizeof(var)) ? -EFAULT : 0;
95000 + ret = copy_to_user(argp, &info->var,
95001 + sizeof(var)) ? -EFAULT : 0;
95002 break;
95003 case FBIOPUT_VSCREENINFO:
95004 - if (copy_from_user(&var, argp, sizeof(var)))
95005 - return -EFAULT;
95006 - if (!lock_fb_info(info))
95007 - return -ENODEV;
95008 + if (copy_from_user(&var, argp, sizeof(var))) {
95009 + ret = -EFAULT;
95010 + break;
95011 + }
95012 acquire_console_sem();
95013 info->flags |= FBINFO_MISC_USEREVENT;
95014 ret = fb_set_var(info, &var);
95015 info->flags &= ~FBINFO_MISC_USEREVENT;
95016 release_console_sem();
95017 - unlock_fb_info(info);
95018 - if (!ret && copy_to_user(argp, &var, sizeof(var)))
95019 + if (ret == 0 && copy_to_user(argp, &var, sizeof(var)))
95020 ret = -EFAULT;
95021 break;
95022 case FBIOGET_FSCREENINFO:
95023 - if (!lock_fb_info(info))
95024 - return -ENODEV;
95025 - fix = info->fix;
95026 - unlock_fb_info(info);
95027 -
95028 - ret = copy_to_user(argp, &fix, sizeof(fix)) ? -EFAULT : 0;
95029 + ret = copy_to_user(argp, &info->fix,
95030 + sizeof(fix)) ? -EFAULT : 0;
95031 break;
95032 case FBIOPUTCMAP:
95033 if (copy_from_user(&cmap, argp, sizeof(cmap)))
95034 - return -EFAULT;
95035 - ret = fb_set_user_cmap(&cmap, info);
95036 + ret = -EFAULT;
95037 + else
95038 + ret = fb_set_user_cmap(&cmap, info);
95039 break;
95040 case FBIOGETCMAP:
95041 if (copy_from_user(&cmap, argp, sizeof(cmap)))
95042 - return -EFAULT;
95043 - if (!lock_fb_info(info))
95044 - return -ENODEV;
95045 - cmap_from = info->cmap;
95046 - unlock_fb_info(info);
95047 - ret = fb_cmap_to_user(&cmap_from, &cmap);
95048 + ret = -EFAULT;
95049 + else
95050 + ret = fb_cmap_to_user(&info->cmap, &cmap);
95051 break;
95052 case FBIOPAN_DISPLAY:
95053 - if (copy_from_user(&var, argp, sizeof(var)))
95054 - return -EFAULT;
95055 - if (!lock_fb_info(info))
95056 - return -ENODEV;
95057 + if (copy_from_user(&var, argp, sizeof(var))) {
95058 + ret = -EFAULT;
95059 + break;
95060 + }
95061 acquire_console_sem();
95062 ret = fb_pan_display(info, &var);
95063 release_console_sem();
95064 - unlock_fb_info(info);
95065 if (ret == 0 && copy_to_user(argp, &var, sizeof(var)))
95066 - return -EFAULT;
95067 + ret = -EFAULT;
95068 break;
95069 case FBIO_CURSOR:
95070 ret = -EINVAL;
95071 break;
95072 case FBIOGET_CON2FBMAP:
95073 if (copy_from_user(&con2fb, argp, sizeof(con2fb)))
95074 - return -EFAULT;
95075 - if (con2fb.console < 1 || con2fb.console > MAX_NR_CONSOLES)
95076 - return -EINVAL;
95077 - con2fb.framebuffer = -1;
95078 - event.data = &con2fb;
95079 -
95080 - if (!lock_fb_info(info))
95081 - return -ENODEV;
95082 - event.info = info;
95083 - fb_notifier_call_chain(FB_EVENT_GET_CONSOLE_MAP, &event);
95084 - unlock_fb_info(info);
95085 -
95086 - ret = copy_to_user(argp, &con2fb, sizeof(con2fb)) ? -EFAULT : 0;
95087 + ret = -EFAULT;
95088 + else if (con2fb.console < 1 || con2fb.console > MAX_NR_CONSOLES)
95089 + ret = -EINVAL;
95090 + else {
95091 + con2fb.framebuffer = -1;
95092 + event.info = info;
95093 + event.data = &con2fb;
95094 + fb_notifier_call_chain(FB_EVENT_GET_CONSOLE_MAP,
95095 + &event);
95096 + ret = copy_to_user(argp, &con2fb,
95097 + sizeof(con2fb)) ? -EFAULT : 0;
95098 + }
95099 break;
95100 case FBIOPUT_CON2FBMAP:
95101 - if (copy_from_user(&con2fb, argp, sizeof(con2fb)))
95102 - return -EFAULT;
95103 - if (con2fb.console < 1 || con2fb.console > MAX_NR_CONSOLES)
95104 - return -EINVAL;
95105 - if (con2fb.framebuffer < 0 || con2fb.framebuffer >= FB_MAX)
95106 - return -EINVAL;
95107 + if (copy_from_user(&con2fb, argp, sizeof(con2fb))) {
95108 + ret = -EFAULT;
95109 + break;
95110 + }
95111 + if (con2fb.console < 1 || con2fb.console > MAX_NR_CONSOLES) {
95112 + ret = -EINVAL;
95113 + break;
95114 + }
95115 + if (con2fb.framebuffer < 0 || con2fb.framebuffer >= FB_MAX) {
95116 + ret = -EINVAL;
95117 + break;
95118 + }
95119 if (!registered_fb[con2fb.framebuffer])
95120 request_module("fb%d", con2fb.framebuffer);
95121 if (!registered_fb[con2fb.framebuffer]) {
95122 ret = -EINVAL;
95123 break;
95124 }
95125 - event.data = &con2fb;
95126 - if (!lock_fb_info(info))
95127 - return -ENODEV;
95128 event.info = info;
95129 + event.data = &con2fb;
95130 ret = fb_notifier_call_chain(FB_EVENT_SET_CONSOLE_MAP,
95131 &event);
95132 - unlock_fb_info(info);
95133 break;
95134 case FBIOBLANK:
95135 - if (!lock_fb_info(info))
95136 - return -ENODEV;
95137 acquire_console_sem();
95138 info->flags |= FBINFO_MISC_USEREVENT;
95139 ret = fb_blank(info, arg);
95140 info->flags &= ~FBINFO_MISC_USEREVENT;
95141 release_console_sem();
95142 - unlock_fb_info(info);
95143 - break;
95144 + break;;
95145 default:
95146 - if (!lock_fb_info(info))
95147 - return -ENODEV;
95148 - fb = info->fbops;
95149 - if (fb->fb_ioctl)
95150 - ret = fb->fb_ioctl(info, cmd, arg);
95151 - else
95152 + if (fb->fb_ioctl == NULL)
95153 ret = -ENOTTY;
95154 - unlock_fb_info(info);
95155 + else
95156 + ret = fb->fb_ioctl(info, cmd, arg);
95157 }
95158 return ret;
95159 }
95160
95161 static long fb_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
95162 +__acquires(&info->lock)
95163 +__releases(&info->lock)
95164 {
95165 struct inode *inode = file->f_path.dentry->d_inode;
95166 int fbidx = iminor(inode);
95167 - struct fb_info *info = registered_fb[fbidx];
95168 + struct fb_info *info;
95169 + long ret;
95170
95171 - return do_fb_ioctl(info, cmd, arg);
95172 + info = registered_fb[fbidx];
95173 + mutex_lock(&info->lock);
95174 + ret = do_fb_ioctl(info, cmd, arg);
95175 + mutex_unlock(&info->lock);
95176 + return ret;
95177 }
95178
95179 #ifdef CONFIG_COMPAT
95180 @@ -1264,6 +1257,8 @@
95181
95182 static long fb_compat_ioctl(struct file *file, unsigned int cmd,
95183 unsigned long arg)
95184 +__acquires(&info->lock)
95185 +__releases(&info->lock)
95186 {
95187 struct inode *inode = file->f_path.dentry->d_inode;
95188 int fbidx = iminor(inode);
95189 @@ -1271,6 +1266,7 @@
95190 struct fb_ops *fb = info->fbops;
95191 long ret = -ENOIOCTLCMD;
95192
95193 + mutex_lock(&info->lock);
95194 switch(cmd) {
95195 case FBIOGET_VSCREENINFO:
95196 case FBIOPUT_VSCREENINFO:
95197 @@ -1296,6 +1292,7 @@
95198 ret = fb->fb_compat_ioctl(info, cmd, arg);
95199 break;
95200 }
95201 + mutex_unlock(&info->lock);
95202 return ret;
95203 }
95204 #endif
95205 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/video/geode/gx1fb_core.c linux-2.6.29-rc3.owrt/drivers/video/geode/gx1fb_core.c
95206 --- linux-2.6.29.owrt/drivers/video/geode/gx1fb_core.c 2009-05-10 22:04:38.000000000 +0200
95207 +++ linux-2.6.29-rc3.owrt/drivers/video/geode/gx1fb_core.c 2009-05-10 23:48:29.000000000 +0200
95208 @@ -136,10 +136,13 @@
95209 {
95210 struct geodefb_par *par = info->par;
95211
95212 - if (info->var.bits_per_pixel == 16)
95213 + if (info->var.bits_per_pixel == 16) {
95214 info->fix.visual = FB_VISUAL_TRUECOLOR;
95215 - else
95216 + fb_dealloc_cmap(&info->cmap);
95217 + } else {
95218 info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
95219 + fb_alloc_cmap(&info->cmap, 1<<info->var.bits_per_pixel, 0);
95220 + }
95221
95222 info->fix.line_length = gx1_line_delta(info->var.xres, info->var.bits_per_pixel);
95223
95224 @@ -312,10 +315,6 @@
95225 if (!par->panel_x)
95226 par->enable_crt = 1; /* fall back to CRT if no panel is specified */
95227
95228 - if (fb_alloc_cmap(&info->cmap, 256, 0) < 0) {
95229 - framebuffer_release(info);
95230 - return NULL;
95231 - }
95232 return info;
95233 }
95234
95235 @@ -375,11 +374,8 @@
95236 release_mem_region(gx1_gx_base() + 0x8300, 0x100);
95237 }
95238
95239 - if (info) {
95240 - fb_dealloc_cmap(&info->cmap);
95241 + if (info)
95242 framebuffer_release(info);
95243 - }
95244 -
95245 return ret;
95246 }
95247
95248 @@ -399,7 +395,6 @@
95249 iounmap(par->dc_regs);
95250 release_mem_region(gx1_gx_base() + 0x8300, 0x100);
95251
95252 - fb_dealloc_cmap(&info->cmap);
95253 pci_set_drvdata(pdev, NULL);
95254
95255 framebuffer_release(info);
95256 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/video/geode/gxfb_core.c linux-2.6.29-rc3.owrt/drivers/video/geode/gxfb_core.c
95257 --- linux-2.6.29.owrt/drivers/video/geode/gxfb_core.c 2009-05-10 22:04:38.000000000 +0200
95258 +++ linux-2.6.29-rc3.owrt/drivers/video/geode/gxfb_core.c 2009-05-10 23:48:29.000000000 +0200
95259 @@ -171,10 +171,13 @@
95260
95261 static int gxfb_set_par(struct fb_info *info)
95262 {
95263 - if (info->var.bits_per_pixel > 8)
95264 + if (info->var.bits_per_pixel > 8) {
95265 info->fix.visual = FB_VISUAL_TRUECOLOR;
95266 - else
95267 + fb_dealloc_cmap(&info->cmap);
95268 + } else {
95269 info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
95270 + fb_alloc_cmap(&info->cmap, 1<<info->var.bits_per_pixel, 0);
95271 + }
95272
95273 info->fix.line_length = gx_line_delta(info->var.xres, info->var.bits_per_pixel);
95274
95275 @@ -328,11 +331,6 @@
95276
95277 info->var.grayscale = 0;
95278
95279 - if (fb_alloc_cmap(&info->cmap, 256, 0) < 0) {
95280 - framebuffer_release(info);
95281 - return NULL;
95282 - }
95283 -
95284 return info;
95285 }
95286
95287 @@ -445,10 +443,8 @@
95288 pci_release_region(pdev, 1);
95289 }
95290
95291 - if (info) {
95292 - fb_dealloc_cmap(&info->cmap);
95293 + if (info)
95294 framebuffer_release(info);
95295 - }
95296 return ret;
95297 }
95298
95299 @@ -471,7 +467,6 @@
95300 iounmap(par->gp_regs);
95301 pci_release_region(pdev, 1);
95302
95303 - fb_dealloc_cmap(&info->cmap);
95304 pci_set_drvdata(pdev, NULL);
95305
95306 framebuffer_release(info);
95307 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/video/geode/lxfb_core.c linux-2.6.29-rc3.owrt/drivers/video/geode/lxfb_core.c
95308 --- linux-2.6.29.owrt/drivers/video/geode/lxfb_core.c 2009-05-10 22:04:38.000000000 +0200
95309 +++ linux-2.6.29-rc3.owrt/drivers/video/geode/lxfb_core.c 2009-05-10 23:48:29.000000000 +0200
95310 @@ -278,10 +278,13 @@
95311
95312 static int lxfb_set_par(struct fb_info *info)
95313 {
95314 - if (info->var.bits_per_pixel > 8)
95315 + if (info->var.bits_per_pixel > 8) {
95316 info->fix.visual = FB_VISUAL_TRUECOLOR;
95317 - else
95318 + fb_dealloc_cmap(&info->cmap);
95319 + } else {
95320 info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
95321 + fb_alloc_cmap(&info->cmap, 1<<info->var.bits_per_pixel, 0);
95322 + }
95323
95324 info->fix.line_length = lx_get_pitch(info->var.xres,
95325 info->var.bits_per_pixel);
95326 @@ -448,11 +451,6 @@
95327
95328 info->pseudo_palette = (void *)par + sizeof(struct lxfb_par);
95329
95330 - if (fb_alloc_cmap(&info->cmap, 256, 0) < 0) {
95331 - framebuffer_release(info);
95332 - return NULL;
95333 - }
95334 -
95335 info->var.grayscale = 0;
95336
95337 return info;
95338 @@ -581,10 +579,8 @@
95339 pci_release_region(pdev, 3);
95340 }
95341
95342 - if (info) {
95343 - fb_dealloc_cmap(&info->cmap);
95344 + if (info)
95345 framebuffer_release(info);
95346 - }
95347
95348 return ret;
95349 }
95350 @@ -608,7 +604,6 @@
95351 iounmap(par->vp_regs);
95352 pci_release_region(pdev, 3);
95353
95354 - fb_dealloc_cmap(&info->cmap);
95355 pci_set_drvdata(pdev, NULL);
95356 framebuffer_release(info);
95357 }
95358 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/video/i810/i810_main.c linux-2.6.29-rc3.owrt/drivers/video/i810/i810_main.c
95359 --- linux-2.6.29.owrt/drivers/video/i810/i810_main.c 2009-05-10 22:04:38.000000000 +0200
95360 +++ linux-2.6.29-rc3.owrt/drivers/video/i810/i810_main.c 2009-05-10 23:48:29.000000000 +0200
95361 @@ -993,7 +993,6 @@
95362 struct i810fb_par *par = info->par;
95363 int line_length, vidmem, mode_valid = 0, retval = 0;
95364 u32 vyres = var->yres_virtual, vxres = var->xres_virtual;
95365 -
95366 /*
95367 * Memory limit
95368 */
95369 @@ -1003,12 +1002,12 @@
95370 if (vidmem > par->fb.size) {
95371 vyres = par->fb.size/line_length;
95372 if (vyres < var->yres) {
95373 - vyres = info->var.yres;
95374 + vyres = yres;
95375 vxres = par->fb.size/vyres;
95376 vxres /= var->bits_per_pixel >> 3;
95377 line_length = get_line_length(par, vxres,
95378 var->bits_per_pixel);
95379 - vidmem = line_length * info->var.yres;
95380 + vidmem = line_length * yres;
95381 if (vxres < var->xres) {
95382 printk("i810fb: required video memory, "
95383 "%d bytes, for %dx%d-%d (virtual) "
95384 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/video/Kconfig linux-2.6.29-rc3.owrt/drivers/video/Kconfig
95385 --- linux-2.6.29.owrt/drivers/video/Kconfig 2009-05-10 22:04:38.000000000 +0200
95386 +++ linux-2.6.29-rc3.owrt/drivers/video/Kconfig 2009-05-10 23:48:29.000000000 +0200
95387 @@ -41,7 +41,7 @@
95388 You need an utility program called fbset to make full use of frame
95389 buffer devices. Please read <file:Documentation/fb/framebuffer.txt>
95390 and the Framebuffer-HOWTO at
95391 - <http://www.munted.org.uk/programming/Framebuffer-HOWTO-1.2.html> for more
95392 + <http://www.tahallah.demon.co.uk/programming/prog.html> for more
95393 information.
95394
95395 Say Y here and to the driver for your graphics board below if you
95396 @@ -1054,7 +1054,9 @@
95397
95398 config FB_I810
95399 tristate "Intel 810/815 support (EXPERIMENTAL)"
95400 - depends on EXPERIMENTAL && FB && PCI && X86_32 && AGP_INTEL
95401 + depends on FB && EXPERIMENTAL && PCI && X86_32
95402 + select AGP
95403 + select AGP_INTEL
95404 select FB_MODE_HELPERS
95405 select FB_CFB_FILLRECT
95406 select FB_CFB_COPYAREA
95407 @@ -1117,7 +1119,9 @@
95408
95409 config FB_INTEL
95410 tristate "Intel 830M/845G/852GM/855GM/865G/915G/945G/945GM/965G/965GM support (EXPERIMENTAL)"
95411 - depends on EXPERIMENTAL && FB && PCI && X86 && AGP_INTEL
95412 + depends on FB && EXPERIMENTAL && PCI && X86
95413 + select AGP
95414 + select AGP_INTEL
95415 select FB_MODE_HELPERS
95416 select FB_CFB_FILLRECT
95417 select FB_CFB_COPYAREA
95418 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/video/pxafb.c linux-2.6.29-rc3.owrt/drivers/video/pxafb.c
95419 --- linux-2.6.29.owrt/drivers/video/pxafb.c 2009-05-10 22:04:38.000000000 +0200
95420 +++ linux-2.6.29-rc3.owrt/drivers/video/pxafb.c 2009-05-10 23:48:29.000000000 +0200
95421 @@ -2230,7 +2230,7 @@
95422
95423 static struct platform_driver pxafb_driver = {
95424 .probe = pxafb_probe,
95425 - .remove = __devexit_p(pxafb_remove),
95426 + .remove = pxafb_remove,
95427 .suspend = pxafb_suspend,
95428 .resume = pxafb_resume,
95429 .driver = {
95430 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/video/sh_mobile_lcdcfb.c linux-2.6.29-rc3.owrt/drivers/video/sh_mobile_lcdcfb.c
95431 --- linux-2.6.29.owrt/drivers/video/sh_mobile_lcdcfb.c 2009-05-10 22:04:38.000000000 +0200
95432 +++ linux-2.6.29-rc3.owrt/drivers/video/sh_mobile_lcdcfb.c 2009-05-10 23:48:29.000000000 +0200
95433 @@ -446,6 +446,7 @@
95434 {
95435 struct sh_mobile_lcdc_chan *ch;
95436 struct sh_mobile_lcdc_board_cfg *board_cfg;
95437 + unsigned long tmp;
95438 int k;
95439
95440 /* tell the board code to disable the panel */
95441 @@ -455,8 +456,9 @@
95442 if (board_cfg->display_off)
95443 board_cfg->display_off(board_cfg->board_data);
95444
95445 - /* cleanup deferred io if enabled */
95446 - if (ch->info.fbdefio) {
95447 + /* cleanup deferred io if SYS bus */
95448 + tmp = ch->cfg.sys_bus_cfg.deferred_io_msec;
95449 + if (ch->ldmt1r_value & (1 << 12) && tmp) {
95450 fb_deferred_io_cleanup(&ch->info);
95451 ch->info.fbdefio = NULL;
95452 }
95453 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/virtio/virtio_pci.c linux-2.6.29-rc3.owrt/drivers/virtio/virtio_pci.c
95454 --- linux-2.6.29.owrt/drivers/virtio/virtio_pci.c 2009-05-10 22:04:38.000000000 +0200
95455 +++ linux-2.6.29-rc3.owrt/drivers/virtio/virtio_pci.c 2009-05-10 23:48:29.000000000 +0200
95456 @@ -192,7 +192,7 @@
95457 drv = container_of(vp_dev->vdev.dev.driver,
95458 struct virtio_driver, driver);
95459
95460 - if (drv && drv->config_changed)
95461 + if (drv->config_changed)
95462 drv->config_changed(&vp_dev->vdev);
95463 }
95464
95465 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/w1/masters/w1-gpio.c linux-2.6.29-rc3.owrt/drivers/w1/masters/w1-gpio.c
95466 --- linux-2.6.29.owrt/drivers/w1/masters/w1-gpio.c 2009-05-10 22:04:39.000000000 +0200
95467 +++ linux-2.6.29-rc3.owrt/drivers/w1/masters/w1-gpio.c 2009-05-10 23:48:29.000000000 +0200
95468 @@ -39,7 +39,7 @@
95469 {
95470 struct w1_gpio_platform_data *pdata = data;
95471
95472 - return gpio_get_value(pdata->pin) ? 1 : 0;
95473 + return gpio_get_value(pdata->pin);
95474 }
95475
95476 static int __init w1_gpio_probe(struct platform_device *pdev)
95477 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/w1/slaves/Kconfig linux-2.6.29-rc3.owrt/drivers/w1/slaves/Kconfig
95478 --- linux-2.6.29.owrt/drivers/w1/slaves/Kconfig 2009-05-10 22:04:39.000000000 +0200
95479 +++ linux-2.6.29-rc3.owrt/drivers/w1/slaves/Kconfig 2009-05-10 23:48:29.000000000 +0200
95480 @@ -16,12 +16,6 @@
95481 Say Y here if you want to connect 1-wire
95482 simple 64bit memory rom(ds2401/ds2411/ds1990*) to your wire.
95483
95484 -config W1_SLAVE_DS2431
95485 - tristate "1kb EEPROM family support (DS2431)"
95486 - help
95487 - Say Y here if you want to use a 1-wire
95488 - 1kb EEPROM family device (DS2431)
95489 -
95490 config W1_SLAVE_DS2433
95491 tristate "4kb EEPROM family support (DS2433)"
95492 help
95493 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/w1/slaves/Makefile linux-2.6.29-rc3.owrt/drivers/w1/slaves/Makefile
95494 --- linux-2.6.29.owrt/drivers/w1/slaves/Makefile 2009-05-10 22:04:39.000000000 +0200
95495 +++ linux-2.6.29-rc3.owrt/drivers/w1/slaves/Makefile 2009-05-10 23:48:29.000000000 +0200
95496 @@ -4,7 +4,6 @@
95497
95498 obj-$(CONFIG_W1_SLAVE_THERM) += w1_therm.o
95499 obj-$(CONFIG_W1_SLAVE_SMEM) += w1_smem.o
95500 -obj-$(CONFIG_W1_SLAVE_DS2431) += w1_ds2431.o
95501 obj-$(CONFIG_W1_SLAVE_DS2433) += w1_ds2433.o
95502 obj-$(CONFIG_W1_SLAVE_DS2760) += w1_ds2760.o
95503 obj-$(CONFIG_W1_SLAVE_BQ27000) += w1_bq27000.o
95504 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/w1/slaves/w1_ds2433.c linux-2.6.29-rc3.owrt/drivers/w1/slaves/w1_ds2433.c
95505 --- linux-2.6.29.owrt/drivers/w1/slaves/w1_ds2433.c 2009-05-10 22:04:39.000000000 +0200
95506 +++ linux-2.6.29-rc3.owrt/drivers/w1/slaves/w1_ds2433.c 2009-05-10 23:48:29.000000000 +0200
95507 @@ -156,9 +156,6 @@
95508 */
95509 static int w1_f23_write(struct w1_slave *sl, int addr, int len, const u8 *data)
95510 {
95511 -#ifdef CONFIG_W1_SLAVE_DS2433_CRC
95512 - struct w1_f23_data *f23 = sl->family_data;
95513 -#endif
95514 u8 wrbuf[4];
95515 u8 rdbuf[W1_PAGE_SIZE + 3];
95516 u8 es = (addr + len - 1) & 0x1f;
95517 @@ -199,9 +196,7 @@
95518
95519 /* Reset the bus to wake up the EEPROM (this may not be needed) */
95520 w1_reset_bus(sl->master);
95521 -#ifdef CONFIG_W1_SLAVE_DS2433_CRC
95522 - f23->validcrc &= ~(1 << (addr >> W1_PAGE_BITS));
95523 -#endif
95524 +
95525 return 0;
95526 }
95527
95528 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/w1/slaves/w1_therm.c linux-2.6.29-rc3.owrt/drivers/w1/slaves/w1_therm.c
95529 --- linux-2.6.29.owrt/drivers/w1/slaves/w1_therm.c 2009-05-10 22:04:39.000000000 +0200
95530 +++ linux-2.6.29-rc3.owrt/drivers/w1/slaves/w1_therm.c 2009-05-10 23:48:29.000000000 +0200
95531 @@ -115,7 +115,7 @@
95532
95533 static inline int w1_DS18B20_convert_temp(u8 rom[9])
95534 {
95535 - int t = ((s16)rom[1] << 8) | rom[0];
95536 + s16 t = (rom[1] << 8) | rom[0];
95537 t = t*1000/16;
95538 return t;
95539 }
95540 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/watchdog/at91rm9200_wdt.c linux-2.6.29-rc3.owrt/drivers/watchdog/at91rm9200_wdt.c
95541 --- linux-2.6.29.owrt/drivers/watchdog/at91rm9200_wdt.c 2009-05-10 22:04:38.000000000 +0200
95542 +++ linux-2.6.29-rc3.owrt/drivers/watchdog/at91rm9200_wdt.c 2009-05-10 23:48:29.000000000 +0200
95543 @@ -107,10 +107,10 @@
95544 static int at91_wdt_settimeout(int new_time)
95545 {
95546 /*
95547 - * All counting occurs at SLOW_CLOCK / 128 = 256 Hz
95548 + * All counting occurs at SLOW_CLOCK / 128 = 0.256 Hz
95549 *
95550 * Since WDV is a 16-bit counter, the maximum period is
95551 - * 65536 / 256 = 256 seconds.
95552 + * 65536 / 0.256 = 256 seconds.
95553 */
95554 if ((new_time <= 0) || (new_time > WDT_MAX_TIME))
95555 return -EINVAL;
95556 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/watchdog/at91sam9_wdt.c linux-2.6.29-rc3.owrt/drivers/watchdog/at91sam9_wdt.c
95557 --- linux-2.6.29.owrt/drivers/watchdog/at91sam9_wdt.c 2009-05-10 22:04:38.000000000 +0200
95558 +++ linux-2.6.29-rc3.owrt/drivers/watchdog/at91sam9_wdt.c 2009-05-10 23:48:29.000000000 +0200
95559 @@ -18,7 +18,6 @@
95560 #include <linux/errno.h>
95561 #include <linux/fs.h>
95562 #include <linux/init.h>
95563 -#include <linux/io.h>
95564 #include <linux/kernel.h>
95565 #include <linux/miscdevice.h>
95566 #include <linux/module.h>
95567 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/watchdog/gef_wdt.c linux-2.6.29-rc3.owrt/drivers/watchdog/gef_wdt.c
95568 --- linux-2.6.29.owrt/drivers/watchdog/gef_wdt.c 2009-05-10 22:04:38.000000000 +0200
95569 +++ linux-2.6.29-rc3.owrt/drivers/watchdog/gef_wdt.c 2009-05-10 23:48:29.000000000 +0200
95570 @@ -269,7 +269,7 @@
95571 bus_clk = 133; /* in MHz */
95572
95573 freq = fsl_get_sys_freq();
95574 - if (freq != -1)
95575 + if (freq > 0)
95576 bus_clk = freq;
95577
95578 /* Map devices registers into memory */
95579 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/watchdog/iTCO_vendor_support.c linux-2.6.29-rc3.owrt/drivers/watchdog/iTCO_vendor_support.c
95580 --- linux-2.6.29.owrt/drivers/watchdog/iTCO_vendor_support.c 2009-05-10 22:04:38.000000000 +0200
95581 +++ linux-2.6.29-rc3.owrt/drivers/watchdog/iTCO_vendor_support.c 2009-05-10 23:48:29.000000000 +0200
95582 @@ -1,7 +1,7 @@
95583 /*
95584 * intel TCO vendor specific watchdog driver support
95585 *
95586 - * (c) Copyright 2006-2009 Wim Van Sebroeck <wim@iguana.be>.
95587 + * (c) Copyright 2006-2008 Wim Van Sebroeck <wim@iguana.be>.
95588 *
95589 * This program is free software; you can redistribute it and/or
95590 * modify it under the terms of the GNU General Public License
95591 @@ -19,7 +19,7 @@
95592
95593 /* Module and version information */
95594 #define DRV_NAME "iTCO_vendor_support"
95595 -#define DRV_VERSION "1.03"
95596 +#define DRV_VERSION "1.02"
95597 #define PFX DRV_NAME ": "
95598
95599 /* Includes */
95600 @@ -77,26 +77,6 @@
95601 * 20.6 seconds.
95602 */
95603
95604 -static void supermicro_old_pre_start(unsigned long acpibase)
95605 -{
95606 - unsigned long val32;
95607 -
95608 - /* Bit 13: TCO_EN -> 0 = Disables TCO logic generating an SMI# */
95609 - val32 = inl(SMI_EN);
95610 - val32 &= 0xffffdfff; /* Turn off SMI clearing watchdog */
95611 - outl(val32, SMI_EN); /* Needed to activate watchdog */
95612 -}
95613 -
95614 -static void supermicro_old_pre_stop(unsigned long acpibase)
95615 -{
95616 - unsigned long val32;
95617 -
95618 - /* Bit 13: TCO_EN -> 1 = Enables the TCO logic to generate SMI# */
95619 - val32 = inl(SMI_EN);
95620 - val32 |= 0x00002000; /* Turn on SMI clearing watchdog */
95621 - outl(val32, SMI_EN); /* Needed to deactivate watchdog */
95622 -}
95623 -
95624 static void supermicro_old_pre_keepalive(unsigned long acpibase)
95625 {
95626 /* Reload TCO Timer (done in iTCO_wdt_keepalive) + */
95627 @@ -248,18 +228,14 @@
95628 void iTCO_vendor_pre_start(unsigned long acpibase,
95629 unsigned int heartbeat)
95630 {
95631 - if (vendorsupport == SUPERMICRO_OLD_BOARD)
95632 - supermicro_old_pre_start(acpibase);
95633 - else if (vendorsupport == SUPERMICRO_NEW_BOARD)
95634 + if (vendorsupport == SUPERMICRO_NEW_BOARD)
95635 supermicro_new_pre_start(heartbeat);
95636 }
95637 EXPORT_SYMBOL(iTCO_vendor_pre_start);
95638
95639 void iTCO_vendor_pre_stop(unsigned long acpibase)
95640 {
95641 - if (vendorsupport == SUPERMICRO_OLD_BOARD)
95642 - supermicro_old_pre_stop(acpibase);
95643 - else if (vendorsupport == SUPERMICRO_NEW_BOARD)
95644 + if (vendorsupport == SUPERMICRO_NEW_BOARD)
95645 supermicro_new_pre_stop();
95646 }
95647 EXPORT_SYMBOL(iTCO_vendor_pre_stop);
95648 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/watchdog/iTCO_wdt.c linux-2.6.29-rc3.owrt/drivers/watchdog/iTCO_wdt.c
95649 --- linux-2.6.29.owrt/drivers/watchdog/iTCO_wdt.c 2009-05-10 22:04:38.000000000 +0200
95650 +++ linux-2.6.29-rc3.owrt/drivers/watchdog/iTCO_wdt.c 2009-05-10 23:48:29.000000000 +0200
95651 @@ -1,7 +1,7 @@
95652 /*
95653 - * intel TCO Watchdog Driver (Used in i82801 and i63xxESB chipsets)
95654 + * intel TCO Watchdog Driver (Used in i82801 and i6300ESB chipsets)
95655 *
95656 - * (c) Copyright 2006-2009 Wim Van Sebroeck <wim@iguana.be>.
95657 + * (c) Copyright 2006-2008 Wim Van Sebroeck <wim@iguana.be>.
95658 *
95659 * This program is free software; you can redistribute it and/or
95660 * modify it under the terms of the GNU General Public License
95661 @@ -63,7 +63,7 @@
95662
95663 /* Module and version information */
95664 #define DRV_NAME "iTCO_wdt"
95665 -#define DRV_VERSION "1.05"
95666 +#define DRV_VERSION "1.04"
95667 #define PFX DRV_NAME ": "
95668
95669 /* Includes */
95670 @@ -236,16 +236,16 @@
95671
95672 /* Address definitions for the TCO */
95673 /* TCO base address */
95674 -#define TCOBASE iTCO_wdt_private.ACPIBASE + 0x60
95675 +#define TCOBASE iTCO_wdt_private.ACPIBASE + 0x60
95676 /* SMI Control and Enable Register */
95677 -#define SMI_EN iTCO_wdt_private.ACPIBASE + 0x30
95678 +#define SMI_EN iTCO_wdt_private.ACPIBASE + 0x30
95679
95680 #define TCO_RLD TCOBASE + 0x00 /* TCO Timer Reload and Curr. Value */
95681 #define TCOv1_TMR TCOBASE + 0x01 /* TCOv1 Timer Initial Value */
95682 -#define TCO_DAT_IN TCOBASE + 0x02 /* TCO Data In Register */
95683 -#define TCO_DAT_OUT TCOBASE + 0x03 /* TCO Data Out Register */
95684 -#define TCO1_STS TCOBASE + 0x04 /* TCO1 Status Register */
95685 -#define TCO2_STS TCOBASE + 0x06 /* TCO2 Status Register */
95686 +#define TCO_DAT_IN TCOBASE + 0x02 /* TCO Data In Register */
95687 +#define TCO_DAT_OUT TCOBASE + 0x03 /* TCO Data Out Register */
95688 +#define TCO1_STS TCOBASE + 0x04 /* TCO1 Status Register */
95689 +#define TCO2_STS TCOBASE + 0x06 /* TCO2 Status Register */
95690 #define TCO1_CNT TCOBASE + 0x08 /* TCO1 Control Register */
95691 #define TCO2_CNT TCOBASE + 0x0a /* TCO2 Control Register */
95692 #define TCOv2_TMR TCOBASE + 0x12 /* TCOv2 Timer Initial Value */
95693 @@ -338,6 +338,7 @@
95694 static int iTCO_wdt_start(void)
95695 {
95696 unsigned int val;
95697 + unsigned long val32;
95698
95699 spin_lock(&iTCO_wdt_private.io_lock);
95700
95701 @@ -350,6 +351,11 @@
95702 return -EIO;
95703 }
95704
95705 + /* Bit 13: TCO_EN -> 0 = Disables TCO logic generating an SMI# */
95706 + val32 = inl(SMI_EN);
95707 + val32 &= 0xffffdfff; /* Turn off SMI clearing watchdog */
95708 + outl(val32, SMI_EN);
95709 +
95710 /* Force the timer to its reload value by writing to the TCO_RLD
95711 register */
95712 if (iTCO_wdt_private.iTCO_version == 2)
95713 @@ -372,6 +378,7 @@
95714 static int iTCO_wdt_stop(void)
95715 {
95716 unsigned int val;
95717 + unsigned long val32;
95718
95719 spin_lock(&iTCO_wdt_private.io_lock);
95720
95721 @@ -383,6 +390,11 @@
95722 outw(val, TCO1_CNT);
95723 val = inw(TCO1_CNT);
95724
95725 + /* Bit 13: TCO_EN -> 1 = Enables the TCO logic to generate SMI# */
95726 + val32 = inl(SMI_EN);
95727 + val32 |= 0x00002000;
95728 + outl(val32, SMI_EN);
95729 +
95730 /* Set the NO_REBOOT bit to prevent later reboots, just for sure */
95731 iTCO_wdt_set_NO_REBOOT_bit();
95732
95733 @@ -637,7 +649,6 @@
95734 int ret;
95735 u32 base_address;
95736 unsigned long RCBA;
95737 - unsigned long val32;
95738
95739 /*
95740 * Find the ACPI/PM base I/O address which is the base
95741 @@ -684,10 +695,6 @@
95742 ret = -EIO;
95743 goto out;
95744 }
95745 - /* Bit 13: TCO_EN -> 0 = Disables TCO logic generating an SMI# */
95746 - val32 = inl(SMI_EN);
95747 - val32 &= 0xffffdfff; /* Turn off SMI clearing watchdog */
95748 - outl(val32, SMI_EN);
95749
95750 /* The TCO I/O registers reside in a 32-byte range pointed to
95751 by the TCOBASE value */
95752 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/watchdog/Kconfig linux-2.6.29-rc3.owrt/drivers/watchdog/Kconfig
95753 --- linux-2.6.29.owrt/drivers/watchdog/Kconfig 2009-05-10 22:04:38.000000000 +0200
95754 +++ linux-2.6.29-rc3.owrt/drivers/watchdog/Kconfig 2009-05-10 23:48:29.000000000 +0200
95755 @@ -406,7 +406,7 @@
95756 ---help---
95757 Hardware driver for the intel TCO timer based watchdog devices.
95758 These drivers are included in the Intel 82801 I/O Controller
95759 - Hub family (from ICH0 up to ICH10) and in the Intel 63xxESB
95760 + Hub family (from ICH0 up to ICH8) and in the Intel 6300ESB
95761 controller hub.
95762
95763 The TCO (Total Cost of Ownership) timer is a watchdog timer
95764 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/watchdog/ks8695_wdt.c linux-2.6.29-rc3.owrt/drivers/watchdog/ks8695_wdt.c
95765 --- linux-2.6.29.owrt/drivers/watchdog/ks8695_wdt.c 2009-05-10 22:04:38.000000000 +0200
95766 +++ linux-2.6.29-rc3.owrt/drivers/watchdog/ks8695_wdt.c 2009-05-10 23:48:29.000000000 +0200
95767 @@ -21,7 +21,6 @@
95768 #include <linux/watchdog.h>
95769 #include <linux/io.h>
95770 #include <linux/uaccess.h>
95771 -#include <mach/timex.h>
95772 #include <mach/regs-timer.h>
95773
95774 #define WDT_DEFAULT_TIME 5 /* seconds */
95775 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/watchdog/orion5x_wdt.c linux-2.6.29-rc3.owrt/drivers/watchdog/orion5x_wdt.c
95776 --- linux-2.6.29.owrt/drivers/watchdog/orion5x_wdt.c 2009-05-10 22:04:38.000000000 +0200
95777 +++ linux-2.6.29-rc3.owrt/drivers/watchdog/orion5x_wdt.c 2009-05-10 23:48:29.000000000 +0200
95778 @@ -29,7 +29,6 @@
95779 #define WDT_EN 0x0010
95780 #define WDT_VAL (TIMER_VIRT_BASE + 0x0024)
95781
95782 -#define ORION5X_TCLK 166666667
95783 #define WDT_MAX_DURATION (0xffffffff / ORION5X_TCLK)
95784 #define WDT_IN_USE 0
95785 #define WDT_OK_TO_CLOSE 1
95786 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/watchdog/rc32434_wdt.c linux-2.6.29-rc3.owrt/drivers/watchdog/rc32434_wdt.c
95787 --- linux-2.6.29.owrt/drivers/watchdog/rc32434_wdt.c 2009-05-10 22:04:38.000000000 +0200
95788 +++ linux-2.6.29-rc3.owrt/drivers/watchdog/rc32434_wdt.c 2009-05-10 23:48:29.000000000 +0200
95789 @@ -34,89 +34,104 @@
95790 #include <asm/time.h>
95791 #include <asm/mach-rc32434/integ.h>
95792
95793 -#define VERSION "0.4"
95794 +#define MAX_TIMEOUT 20
95795 +#define RC32434_WDT_INTERVAL (15 * HZ)
95796 +
95797 +#define VERSION "0.2"
95798
95799 static struct {
95800 + struct completion stop;
95801 + int running;
95802 + struct timer_list timer;
95803 + int queue;
95804 + int default_ticks;
95805 unsigned long inuse;
95806 } rc32434_wdt_device;
95807
95808 static struct integ __iomem *wdt_reg;
95809 +static int ticks = 100 * HZ;
95810
95811 static int expect_close;
95812 -
95813 -/* Board internal clock speed in Hz,
95814 - * the watchdog timer ticks at. */
95815 -extern unsigned int idt_cpu_freq;
95816 -
95817 -/* translate wtcompare value to seconds and vice versa */
95818 -#define WTCOMP2SEC(x) (x / idt_cpu_freq)
95819 -#define SEC2WTCOMP(x) (x * idt_cpu_freq)
95820 -
95821 -/* Use a default timeout of 20s. This should be
95822 - * safe for CPU clock speeds up to 400MHz, as
95823 - * ((2 ^ 32) - 1) / (400MHz / 2) = 21s. */
95824 -#define WATCHDOG_TIMEOUT 20
95825 -
95826 -static int timeout = WATCHDOG_TIMEOUT;
95827 +static int timeout;
95828
95829 static int nowayout = WATCHDOG_NOWAYOUT;
95830 module_param(nowayout, int, 0);
95831 MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
95832 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
95833
95834 -/* apply or and nand masks to data read from addr and write back */
95835 -#define SET_BITS(addr, or, nand) \
95836 - writel((readl(&addr) | or) & ~nand, &addr)
95837
95838 static void rc32434_wdt_start(void)
95839 {
95840 - u32 or, nand;
95841 -
95842 - /* zero the counter before enabling */
95843 - writel(0, &wdt_reg->wtcount);
95844 -
95845 - /* don't generate a non-maskable interrupt,
95846 - * do a warm reset instead */
95847 - nand = 1 << RC32434_ERR_WNE;
95848 - or = 1 << RC32434_ERR_WRE;
95849 + u32 val;
95850
95851 - /* reset the ERRCS timeout bit in case it's set */
95852 - nand |= 1 << RC32434_ERR_WTO;
95853 + if (!rc32434_wdt_device.inuse) {
95854 + writel(0, &wdt_reg->wtcount);
95855
95856 - SET_BITS(wdt_reg->errcs, or, nand);
95857 + val = RC32434_ERR_WRE;
95858 + writel(readl(&wdt_reg->errcs) | val, &wdt_reg->errcs);
95859
95860 - /* reset WTC timeout bit and enable WDT */
95861 - nand = 1 << RC32434_WTC_TO;
95862 - or = 1 << RC32434_WTC_EN;
95863 -
95864 - SET_BITS(wdt_reg->wtc, or, nand);
95865 + val = RC32434_WTC_EN;
95866 + writel(readl(&wdt_reg->wtc) | val, &wdt_reg->wtc);
95867 + }
95868 + rc32434_wdt_device.running++;
95869 }
95870
95871 static void rc32434_wdt_stop(void)
95872 {
95873 - /* Disable WDT */
95874 - SET_BITS(wdt_reg->wtc, 0, 1 << RC32434_WTC_EN);
95875 + u32 val;
95876 +
95877 + if (rc32434_wdt_device.running) {
95878 +
95879 + val = ~RC32434_WTC_EN;
95880 + writel(readl(&wdt_reg->wtc) & val, &wdt_reg->wtc);
95881 +
95882 + val = ~RC32434_ERR_WRE;
95883 + writel(readl(&wdt_reg->errcs) & val, &wdt_reg->errcs);
95884 +
95885 + rc32434_wdt_device.running = 0;
95886 + }
95887 }
95888
95889 -static int rc32434_wdt_set(int new_timeout)
95890 +static void rc32434_wdt_set(int new_timeout)
95891 {
95892 - int max_to = WTCOMP2SEC((u32)-1);
95893 + u32 cmp = new_timeout * HZ;
95894 + u32 state, val;
95895
95896 - if (new_timeout < 0 || new_timeout > max_to) {
95897 - printk(KERN_ERR KBUILD_MODNAME
95898 - ": timeout value must be between 0 and %d",
95899 - max_to);
95900 - return -EINVAL;
95901 - }
95902 timeout = new_timeout;
95903 - writel(SEC2WTCOMP(timeout), &wdt_reg->wtcompare);
95904 + /*
95905 + * store and disable WTC
95906 + */
95907 + state = (u32)(readl(&wdt_reg->wtc) & RC32434_WTC_EN);
95908 + val = ~RC32434_WTC_EN;
95909 + writel(readl(&wdt_reg->wtc) & val, &wdt_reg->wtc);
95910
95911 - return 0;
95912 + writel(0, &wdt_reg->wtcount);
95913 + writel(cmp, &wdt_reg->wtcompare);
95914 +
95915 + /*
95916 + * restore WTC
95917 + */
95918 +
95919 + writel(readl(&wdt_reg->wtc) | state, &wdt_reg);
95920 }
95921
95922 -static void rc32434_wdt_ping(void)
95923 +static void rc32434_wdt_reset(void)
95924 {
95925 + ticks = rc32434_wdt_device.default_ticks;
95926 +}
95927 +
95928 +static void rc32434_wdt_update(unsigned long unused)
95929 +{
95930 + if (rc32434_wdt_device.running)
95931 + ticks--;
95932 +
95933 writel(0, &wdt_reg->wtcount);
95934 +
95935 + if (rc32434_wdt_device.queue && ticks)
95936 + mod_timer(&rc32434_wdt_device.timer,
95937 + jiffies + RC32434_WDT_INTERVAL);
95938 + else
95939 + complete(&rc32434_wdt_device.stop);
95940 }
95941
95942 static int rc32434_wdt_open(struct inode *inode, struct file *file)
95943 @@ -127,23 +142,19 @@
95944 if (nowayout)
95945 __module_get(THIS_MODULE);
95946
95947 - rc32434_wdt_start();
95948 - rc32434_wdt_ping();
95949 -
95950 return nonseekable_open(inode, file);
95951 }
95952
95953 static int rc32434_wdt_release(struct inode *inode, struct file *file)
95954 {
95955 - if (expect_close == 42) {
95956 + if (expect_close && nowayout == 0) {
95957 rc32434_wdt_stop();
95958 printk(KERN_INFO KBUILD_MODNAME ": disabling watchdog timer\n");
95959 module_put(THIS_MODULE);
95960 - } else {
95961 + } else
95962 printk(KERN_CRIT KBUILD_MODNAME
95963 ": device closed unexpectedly. WDT will not stop !\n");
95964 - rc32434_wdt_ping();
95965 - }
95966 +
95967 clear_bit(0, &rc32434_wdt_device.inuse);
95968 return 0;
95969 }
95970 @@ -163,10 +174,10 @@
95971 if (get_user(c, data + i))
95972 return -EFAULT;
95973 if (c == 'V')
95974 - expect_close = 42;
95975 + expect_close = 1;
95976 }
95977 }
95978 - rc32434_wdt_ping();
95979 + rc32434_wdt_update(0);
95980 return len;
95981 }
95982 return 0;
95983 @@ -186,11 +197,11 @@
95984 };
95985 switch (cmd) {
95986 case WDIOC_KEEPALIVE:
95987 - rc32434_wdt_ping();
95988 + rc32434_wdt_reset();
95989 break;
95990 case WDIOC_GETSTATUS:
95991 case WDIOC_GETBOOTSTATUS:
95992 - value = 0;
95993 + value = readl(&wdt_reg->wtcount);
95994 if (copy_to_user(argp, &value, sizeof(int)))
95995 return -EFAULT;
95996 break;
95997 @@ -207,7 +218,6 @@
95998 break;
95999 case WDIOS_DISABLECARD:
96000 rc32434_wdt_stop();
96001 - break;
96002 default:
96003 return -EINVAL;
96004 }
96005 @@ -215,9 +225,11 @@
96006 case WDIOC_SETTIMEOUT:
96007 if (copy_from_user(&new_timeout, argp, sizeof(int)))
96008 return -EFAULT;
96009 - if (rc32434_wdt_set(new_timeout))
96010 + if (new_timeout < 1)
96011 return -EINVAL;
96012 - /* Fall through */
96013 + if (new_timeout > MAX_TIMEOUT)
96014 + return -EINVAL;
96015 + rc32434_wdt_set(new_timeout);
96016 case WDIOC_GETTIMEOUT:
96017 return copy_to_user(argp, &timeout, sizeof(int));
96018 default:
96019 @@ -242,15 +254,15 @@
96020 .fops = &rc32434_wdt_fops,
96021 };
96022
96023 -static char banner[] __devinitdata = KERN_INFO KBUILD_MODNAME
96024 +static char banner[] = KERN_INFO KBUILD_MODNAME
96025 ": Watchdog Timer version " VERSION ", timer margin: %d sec\n";
96026
96027 -static int __devinit rc32434_wdt_probe(struct platform_device *pdev)
96028 +static int rc32434_wdt_probe(struct platform_device *pdev)
96029 {
96030 int ret;
96031 struct resource *r;
96032
96033 - r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "rb532_wdt_res");
96034 + r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "rb500_wdt_res");
96035 if (!r) {
96036 printk(KERN_ERR KBUILD_MODNAME
96037 "failed to retrieve resources\n");
96038 @@ -265,12 +277,24 @@
96039 }
96040
96041 ret = misc_register(&rc32434_wdt_miscdev);
96042 +
96043 if (ret < 0) {
96044 printk(KERN_ERR KBUILD_MODNAME
96045 "failed to register watchdog device\n");
96046 goto unmap;
96047 }
96048
96049 + init_completion(&rc32434_wdt_device.stop);
96050 + rc32434_wdt_device.queue = 0;
96051 +
96052 + clear_bit(0, &rc32434_wdt_device.inuse);
96053 +
96054 + setup_timer(&rc32434_wdt_device.timer, rc32434_wdt_update, 0L);
96055 +
96056 + rc32434_wdt_device.default_ticks = ticks;
96057 +
96058 + rc32434_wdt_start();
96059 +
96060 printk(banner, timeout);
96061
96062 return 0;
96063 @@ -280,17 +304,23 @@
96064 return ret;
96065 }
96066
96067 -static int __devexit rc32434_wdt_remove(struct platform_device *pdev)
96068 +static int rc32434_wdt_remove(struct platform_device *pdev)
96069 {
96070 + if (rc32434_wdt_device.queue) {
96071 + rc32434_wdt_device.queue = 0;
96072 + wait_for_completion(&rc32434_wdt_device.stop);
96073 + }
96074 misc_deregister(&rc32434_wdt_miscdev);
96075 +
96076 iounmap(wdt_reg);
96077 +
96078 return 0;
96079 }
96080
96081 static struct platform_driver rc32434_wdt = {
96082 .probe = rc32434_wdt_probe,
96083 - .remove = __devexit_p(rc32434_wdt_remove),
96084 - .driver = {
96085 + .remove = rc32434_wdt_remove,
96086 + .driver = {
96087 .name = "rc32434_wdt",
96088 }
96089 };
96090 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/xen/balloon.c linux-2.6.29-rc3.owrt/drivers/xen/balloon.c
96091 --- linux-2.6.29.owrt/drivers/xen/balloon.c 2009-05-10 22:04:39.000000000 +0200
96092 +++ linux-2.6.29-rc3.owrt/drivers/xen/balloon.c 2009-05-10 23:48:29.000000000 +0200
96093 @@ -498,7 +498,7 @@
96094 if (!capable(CAP_SYS_ADMIN))
96095 return -EPERM;
96096
96097 - target_bytes = simple_strtoull(buf, &endchar, 0) * 1024;
96098 + target_bytes = memparse(buf, &endchar);
96099
96100 balloon_set_new_target(target_bytes >> PAGE_SHIFT);
96101
96102 @@ -508,39 +508,8 @@
96103 static SYSDEV_ATTR(target_kb, S_IRUGO | S_IWUSR,
96104 show_target_kb, store_target_kb);
96105
96106 -
96107 -static ssize_t show_target(struct sys_device *dev, struct sysdev_attribute *attr,
96108 - char *buf)
96109 -{
96110 - return sprintf(buf, "%llu\n",
96111 - (u64)balloon_stats.target_pages << PAGE_SHIFT);
96112 -}
96113 -
96114 -static ssize_t store_target(struct sys_device *dev,
96115 - struct sysdev_attribute *attr,
96116 - const char *buf,
96117 - size_t count)
96118 -{
96119 - char *endchar;
96120 - unsigned long long target_bytes;
96121 -
96122 - if (!capable(CAP_SYS_ADMIN))
96123 - return -EPERM;
96124 -
96125 - target_bytes = memparse(buf, &endchar);
96126 -
96127 - balloon_set_new_target(target_bytes >> PAGE_SHIFT);
96128 -
96129 - return count;
96130 -}
96131 -
96132 -static SYSDEV_ATTR(target, S_IRUGO | S_IWUSR,
96133 - show_target, store_target);
96134 -
96135 -
96136 static struct sysdev_attribute *balloon_attrs[] = {
96137 &attr_target_kb,
96138 - &attr_target,
96139 };
96140
96141 static struct attribute *balloon_info_attrs[] = {
96142 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/drivers/xen/manage.c linux-2.6.29-rc3.owrt/drivers/xen/manage.c
96143 --- linux-2.6.29.owrt/drivers/xen/manage.c 2009-05-10 22:04:39.000000000 +0200
96144 +++ linux-2.6.29-rc3.owrt/drivers/xen/manage.c 2009-05-10 23:48:29.000000000 +0200
96145 @@ -45,13 +45,6 @@
96146 err);
96147 return err;
96148 }
96149 - err = sysdev_suspend(PMSG_SUSPEND);
96150 - if (err) {
96151 - printk(KERN_ERR "xen_suspend: sysdev_suspend failed: %d\n",
96152 - err);
96153 - device_power_up(PMSG_RESUME);
96154 - return err;
96155 - }
96156
96157 xen_mm_pin_all();
96158 gnttab_suspend();
96159 @@ -68,7 +61,6 @@
96160 gnttab_resume();
96161 xen_mm_unpin_all();
96162
96163 - sysdev_resume();
96164 device_power_up(PMSG_RESUME);
96165
96166 if (!*cancelled) {
96167 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/aio.c linux-2.6.29-rc3.owrt/fs/aio.c
96168 --- linux-2.6.29.owrt/fs/aio.c 2009-05-10 22:04:39.000000000 +0200
96169 +++ linux-2.6.29-rc3.owrt/fs/aio.c 2009-05-10 23:48:29.000000000 +0200
96170 @@ -443,7 +443,7 @@
96171 req->private = NULL;
96172 req->ki_iovec = NULL;
96173 INIT_LIST_HEAD(&req->ki_run_list);
96174 - req->ki_eventfd = NULL;
96175 + req->ki_eventfd = ERR_PTR(-EINVAL);
96176
96177 /* Check if the completion queue has enough free space to
96178 * accept an event from this io.
96179 @@ -485,6 +485,8 @@
96180 {
96181 assert_spin_locked(&ctx->ctx_lock);
96182
96183 + if (!IS_ERR(req->ki_eventfd))
96184 + fput(req->ki_eventfd);
96185 if (req->ki_dtor)
96186 req->ki_dtor(req);
96187 if (req->ki_iovec != &req->ki_inline_vec)
96188 @@ -506,11 +508,8 @@
96189 list_del(&req->ki_list);
96190 spin_unlock_irq(&fput_lock);
96191
96192 - /* Complete the fput(s) */
96193 - if (req->ki_filp != NULL)
96194 - __fput(req->ki_filp);
96195 - if (req->ki_eventfd != NULL)
96196 - __fput(req->ki_eventfd);
96197 + /* Complete the fput */
96198 + __fput(req->ki_filp);
96199
96200 /* Link the iocb into the context's free list */
96201 spin_lock_irq(&ctx->ctx_lock);
96202 @@ -528,14 +527,12 @@
96203 */
96204 static int __aio_put_req(struct kioctx *ctx, struct kiocb *req)
96205 {
96206 - int schedule_putreq = 0;
96207 -
96208 dprintk(KERN_DEBUG "aio_put(%p): f_count=%ld\n",
96209 req, atomic_long_read(&req->ki_filp->f_count));
96210
96211 assert_spin_locked(&ctx->ctx_lock);
96212
96213 - req->ki_users--;
96214 + req->ki_users --;
96215 BUG_ON(req->ki_users < 0);
96216 if (likely(req->ki_users))
96217 return 0;
96218 @@ -543,23 +540,10 @@
96219 req->ki_cancel = NULL;
96220 req->ki_retry = NULL;
96221
96222 - /*
96223 - * Try to optimize the aio and eventfd file* puts, by avoiding to
96224 - * schedule work in case it is not __fput() time. In normal cases,
96225 - * we would not be holding the last reference to the file*, so
96226 - * this function will be executed w/out any aio kthread wakeup.
96227 + /* Must be done under the lock to serialise against cancellation.
96228 + * Call this aio_fput as it duplicates fput via the fput_work.
96229 */
96230 - if (unlikely(atomic_long_dec_and_test(&req->ki_filp->f_count)))
96231 - schedule_putreq++;
96232 - else
96233 - req->ki_filp = NULL;
96234 - if (req->ki_eventfd != NULL) {
96235 - if (unlikely(atomic_long_dec_and_test(&req->ki_eventfd->f_count)))
96236 - schedule_putreq++;
96237 - else
96238 - req->ki_eventfd = NULL;
96239 - }
96240 - if (unlikely(schedule_putreq)) {
96241 + if (unlikely(atomic_long_dec_and_test(&req->ki_filp->f_count))) {
96242 get_ioctx(ctx);
96243 spin_lock(&fput_lock);
96244 list_add(&req->ki_list, &fput_head);
96245 @@ -587,7 +571,7 @@
96246 static struct kioctx *lookup_ioctx(unsigned long ctx_id)
96247 {
96248 struct mm_struct *mm = current->mm;
96249 - struct kioctx *ctx, *ret = NULL;
96250 + struct kioctx *ctx = NULL;
96251 struct hlist_node *n;
96252
96253 rcu_read_lock();
96254 @@ -595,13 +579,12 @@
96255 hlist_for_each_entry_rcu(ctx, n, &mm->ioctx_list, list) {
96256 if (ctx->user_id == ctx_id && !ctx->dead) {
96257 get_ioctx(ctx);
96258 - ret = ctx;
96259 break;
96260 }
96261 }
96262
96263 rcu_read_unlock();
96264 - return ret;
96265 + return ctx;
96266 }
96267
96268 /*
96269 @@ -1026,7 +1009,7 @@
96270 * eventfd. The eventfd_signal() function is safe to be called
96271 * from IRQ context.
96272 */
96273 - if (iocb->ki_eventfd != NULL)
96274 + if (!IS_ERR(iocb->ki_eventfd))
96275 eventfd_signal(iocb->ki_eventfd, 1);
96276
96277 put_rq:
96278 @@ -1625,7 +1608,6 @@
96279 req->ki_eventfd = eventfd_fget((int) iocb->aio_resfd);
96280 if (IS_ERR(req->ki_eventfd)) {
96281 ret = PTR_ERR(req->ki_eventfd);
96282 - req->ki_eventfd = NULL;
96283 goto out_put_req;
96284 }
96285 }
96286 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/binfmt_elf.c linux-2.6.29-rc3.owrt/fs/binfmt_elf.c
96287 --- linux-2.6.29.owrt/fs/binfmt_elf.c 2009-05-10 22:04:39.000000000 +0200
96288 +++ linux-2.6.29-rc3.owrt/fs/binfmt_elf.c 2009-05-10 23:48:29.000000000 +0200
96289 @@ -1225,15 +1225,7 @@
96290 magic.elfmag[EI_MAG1] = ELFMAG1;
96291 magic.elfmag[EI_MAG2] = ELFMAG2;
96292 magic.elfmag[EI_MAG3] = ELFMAG3;
96293 - /*
96294 - * Switch to the user "segment" for get_user(),
96295 - * then put back what elf_core_dump() had in place.
96296 - */
96297 - set_fs(USER_DS);
96298 - if (unlikely(get_user(word, header)))
96299 - word = 0;
96300 - set_fs(fs);
96301 - if (word == magic.cmp)
96302 + if (get_user(word, header) == 0 && word == magic.cmp)
96303 return PAGE_SIZE;
96304 }
96305
96306 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/bio.c linux-2.6.29-rc3.owrt/fs/bio.c
96307 --- linux-2.6.29.owrt/fs/bio.c 2009-05-10 22:04:39.000000000 +0200
96308 +++ linux-2.6.29-rc3.owrt/fs/bio.c 2009-05-10 23:48:29.000000000 +0200
96309 @@ -302,10 +302,9 @@
96310 struct bio *bio_alloc_bioset(gfp_t gfp_mask, int nr_iovecs, struct bio_set *bs)
96311 {
96312 struct bio *bio = NULL;
96313 - void *uninitialized_var(p);
96314
96315 if (bs) {
96316 - p = mempool_alloc(bs->bio_pool, gfp_mask);
96317 + void *p = mempool_alloc(bs->bio_pool, gfp_mask);
96318
96319 if (p)
96320 bio = p + bs->front_pad;
96321 @@ -330,7 +329,7 @@
96322 }
96323 if (unlikely(!bvl)) {
96324 if (bs)
96325 - mempool_free(p, bs->bio_pool);
96326 + mempool_free(bio, bs->bio_pool);
96327 else
96328 kfree(bio);
96329 bio = NULL;
96330 @@ -463,12 +462,10 @@
96331 if (bio_integrity(bio)) {
96332 int ret;
96333
96334 - ret = bio_integrity_clone(b, bio, gfp_mask, fs_bio_set);
96335 + ret = bio_integrity_clone(b, bio, fs_bio_set);
96336
96337 - if (ret < 0) {
96338 - bio_put(b);
96339 + if (ret < 0)
96340 return NULL;
96341 - }
96342 }
96343
96344 return b;
96345 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/bio-integrity.c linux-2.6.29-rc3.owrt/fs/bio-integrity.c
96346 --- linux-2.6.29.owrt/fs/bio-integrity.c 2009-05-10 22:04:39.000000000 +0200
96347 +++ linux-2.6.29-rc3.owrt/fs/bio-integrity.c 2009-05-10 23:48:29.000000000 +0200
96348 @@ -140,6 +140,7 @@
96349
96350 iv = bip_vec_idx(bip, bip->bip_vcnt);
96351 BUG_ON(iv == NULL);
96352 + BUG_ON(iv->bv_page != NULL);
96353
96354 iv->bv_page = page;
96355 iv->bv_len = len;
96356 @@ -464,7 +465,7 @@
96357
96358 if (ret) {
96359 kunmap_atomic(kaddr, KM_USER0);
96360 - return ret;
96361 + break;
96362 }
96363
96364 sectors = bv->bv_len / bi->sector_size;
96365 @@ -492,13 +493,18 @@
96366 struct bio_integrity_payload *bip =
96367 container_of(work, struct bio_integrity_payload, bip_work);
96368 struct bio *bio = bip->bip_bio;
96369 - int error;
96370 + int error = bip->bip_error;
96371
96372 - error = bio_integrity_verify(bio);
96373 + if (bio_integrity_verify(bio)) {
96374 + clear_bit(BIO_UPTODATE, &bio->bi_flags);
96375 + error = -EIO;
96376 + }
96377
96378 /* Restore original bio completion handler */
96379 bio->bi_end_io = bip->bip_end_io;
96380 - bio_endio(bio, error);
96381 +
96382 + if (bio->bi_end_io)
96383 + bio->bi_end_io(bio, error);
96384 }
96385
96386 /**
96387 @@ -519,17 +525,7 @@
96388
96389 BUG_ON(bip->bip_bio != bio);
96390
96391 - /* In case of an I/O error there is no point in verifying the
96392 - * integrity metadata. Restore original bio end_io handler
96393 - * and run it.
96394 - */
96395 - if (error) {
96396 - bio->bi_end_io = bip->bip_end_io;
96397 - bio_endio(bio, error);
96398 -
96399 - return;
96400 - }
96401 -
96402 + bip->bip_error = error;
96403 INIT_WORK(&bip->bip_work, bio_integrity_verify_fn);
96404 queue_work(kintegrityd_wq, &bip->bip_work);
96405 }
96406 @@ -685,20 +681,19 @@
96407 * bio_integrity_clone - Callback for cloning bios with integrity metadata
96408 * @bio: New bio
96409 * @bio_src: Original bio
96410 - * @gfp_mask: Memory allocation mask
96411 * @bs: bio_set to allocate bip from
96412 *
96413 * Description: Called to allocate a bip when cloning a bio
96414 */
96415 int bio_integrity_clone(struct bio *bio, struct bio *bio_src,
96416 - gfp_t gfp_mask, struct bio_set *bs)
96417 + struct bio_set *bs)
96418 {
96419 struct bio_integrity_payload *bip_src = bio_src->bi_integrity;
96420 struct bio_integrity_payload *bip;
96421
96422 BUG_ON(bip_src == NULL);
96423
96424 - bip = bio_integrity_alloc_bioset(bio, gfp_mask, bip_src->bip_vcnt, bs);
96425 + bip = bio_integrity_alloc_bioset(bio, GFP_NOIO, bip_src->bip_vcnt, bs);
96426
96427 if (bip == NULL)
96428 return -EIO;
96429 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/btrfs/async-thread.c linux-2.6.29-rc3.owrt/fs/btrfs/async-thread.c
96430 --- linux-2.6.29.owrt/fs/btrfs/async-thread.c 2009-05-10 22:04:39.000000000 +0200
96431 +++ linux-2.6.29-rc3.owrt/fs/btrfs/async-thread.c 2009-05-10 23:48:29.000000000 +0200
96432 @@ -16,11 +16,11 @@
96433 * Boston, MA 021110-1307, USA.
96434 */
96435
96436 +#include <linux/version.h>
96437 #include <linux/kthread.h>
96438 #include <linux/list.h>
96439 #include <linux/spinlock.h>
96440 -#include <linux/freezer.h>
96441 -#include <linux/ftrace.h>
96442 +# include <linux/freezer.h>
96443 #include "async-thread.h"
96444
96445 #define WORK_QUEUED_BIT 0
96446 @@ -143,7 +143,6 @@
96447 struct btrfs_work *work;
96448 do {
96449 spin_lock_irq(&worker->lock);
96450 -again_locked:
96451 while (!list_empty(&worker->pending)) {
96452 cur = worker->pending.next;
96453 work = list_entry(cur, struct btrfs_work, list);
96454 @@ -166,50 +165,14 @@
96455 check_idle_worker(worker);
96456
96457 }
96458 + worker->working = 0;
96459 if (freezing(current)) {
96460 - worker->working = 0;
96461 - spin_unlock_irq(&worker->lock);
96462 refrigerator();
96463 } else {
96464 + set_current_state(TASK_INTERRUPTIBLE);
96465 spin_unlock_irq(&worker->lock);
96466 - if (!kthread_should_stop()) {
96467 - cpu_relax();
96468 - /*
96469 - * we've dropped the lock, did someone else
96470 - * jump_in?
96471 - */
96472 - smp_mb();
96473 - if (!list_empty(&worker->pending))
96474 - continue;
96475 -
96476 - /*
96477 - * this short schedule allows more work to
96478 - * come in without the queue functions
96479 - * needing to go through wake_up_process()
96480 - *
96481 - * worker->working is still 1, so nobody
96482 - * is going to try and wake us up
96483 - */
96484 - schedule_timeout(1);
96485 - smp_mb();
96486 - if (!list_empty(&worker->pending))
96487 - continue;
96488 -
96489 - /* still no more work?, sleep for real */
96490 - spin_lock_irq(&worker->lock);
96491 - set_current_state(TASK_INTERRUPTIBLE);
96492 - if (!list_empty(&worker->pending))
96493 - goto again_locked;
96494 -
96495 - /*
96496 - * this makes sure we get a wakeup when someone
96497 - * adds something new to the queue
96498 - */
96499 - worker->working = 0;
96500 - spin_unlock_irq(&worker->lock);
96501 -
96502 + if (!kthread_should_stop())
96503 schedule();
96504 - }
96505 __set_current_state(TASK_RUNNING);
96506 }
96507 } while (!kthread_should_stop());
96508 @@ -387,14 +350,13 @@
96509 {
96510 struct btrfs_worker_thread *worker = work->worker;
96511 unsigned long flags;
96512 - int wake = 0;
96513
96514 if (test_and_set_bit(WORK_QUEUED_BIT, &work->flags))
96515 goto out;
96516
96517 spin_lock_irqsave(&worker->lock, flags);
96518 - list_add_tail(&work->list, &worker->pending);
96519 atomic_inc(&worker->num_pending);
96520 + list_add_tail(&work->list, &worker->pending);
96521
96522 /* by definition we're busy, take ourselves off the idle
96523 * list
96524 @@ -406,16 +368,10 @@
96525 &worker->workers->worker_list);
96526 spin_unlock_irqrestore(&worker->workers->lock, flags);
96527 }
96528 - if (!worker->working) {
96529 - wake = 1;
96530 - worker->working = 1;
96531 - }
96532
96533 spin_unlock_irqrestore(&worker->lock, flags);
96534 - if (wake)
96535 - wake_up_process(worker->task);
96536 -out:
96537
96538 +out:
96539 return 0;
96540 }
96541
96542 @@ -442,10 +398,9 @@
96543 }
96544
96545 spin_lock_irqsave(&worker->lock, flags);
96546 -
96547 - list_add_tail(&work->list, &worker->pending);
96548 atomic_inc(&worker->num_pending);
96549 check_busy_worker(worker);
96550 + list_add_tail(&work->list, &worker->pending);
96551
96552 /*
96553 * avoid calling into wake_up_process if this thread has already
96554 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/btrfs/btrfs_inode.h linux-2.6.29-rc3.owrt/fs/btrfs/btrfs_inode.h
96555 --- linux-2.6.29.owrt/fs/btrfs/btrfs_inode.h 2009-05-10 22:04:39.000000000 +0200
96556 +++ linux-2.6.29-rc3.owrt/fs/btrfs/btrfs_inode.h 2009-05-10 23:48:29.000000000 +0200
96557 @@ -66,9 +66,6 @@
96558 */
96559 struct list_head delalloc_inodes;
96560
96561 - /* the space_info for where this inode's data allocations are done */
96562 - struct btrfs_space_info *space_info;
96563 -
96564 /* full 64 bit generation number, struct vfs_inode doesn't have a big
96565 * enough field for this.
96566 */
96567 @@ -97,11 +94,6 @@
96568 */
96569 u64 delalloc_bytes;
96570
96571 - /* total number of bytes that may be used for this inode for
96572 - * delalloc
96573 - */
96574 - u64 reserved_bytes;
96575 -
96576 /*
96577 * the size of the file stored in the metadata on disk. data=ordered
96578 * means the in-memory i_size might be larger than the size on disk
96579 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/btrfs/compression.c linux-2.6.29-rc3.owrt/fs/btrfs/compression.c
96580 --- linux-2.6.29.owrt/fs/btrfs/compression.c 2009-05-10 22:04:39.000000000 +0200
96581 +++ linux-2.6.29-rc3.owrt/fs/btrfs/compression.c 2009-05-10 23:48:29.000000000 +0200
96582 @@ -32,6 +32,7 @@
96583 #include <linux/swap.h>
96584 #include <linux/writeback.h>
96585 #include <linux/bit_spinlock.h>
96586 +#include <linux/version.h>
96587 #include <linux/pagevec.h>
96588 #include "compat.h"
96589 #include "ctree.h"
96590 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/btrfs/ctree.c linux-2.6.29-rc3.owrt/fs/btrfs/ctree.c
96591 --- linux-2.6.29.owrt/fs/btrfs/ctree.c 2009-05-10 22:04:39.000000000 +0200
96592 +++ linux-2.6.29-rc3.owrt/fs/btrfs/ctree.c 2009-05-10 23:48:29.000000000 +0200
96593 @@ -38,62 +38,20 @@
96594 static int del_ptr(struct btrfs_trans_handle *trans, struct btrfs_root *root,
96595 struct btrfs_path *path, int level, int slot);
96596
96597 -struct btrfs_path *btrfs_alloc_path(void)
96598 +inline void btrfs_init_path(struct btrfs_path *p)
96599 {
96600 - struct btrfs_path *path;
96601 - path = kmem_cache_zalloc(btrfs_path_cachep, GFP_NOFS);
96602 - if (path)
96603 - path->reada = 1;
96604 - return path;
96605 + memset(p, 0, sizeof(*p));
96606 }
96607
96608 -/*
96609 - * set all locked nodes in the path to blocking locks. This should
96610 - * be done before scheduling
96611 - */
96612 -noinline void btrfs_set_path_blocking(struct btrfs_path *p)
96613 -{
96614 - int i;
96615 - for (i = 0; i < BTRFS_MAX_LEVEL; i++) {
96616 - if (p->nodes[i] && p->locks[i])
96617 - btrfs_set_lock_blocking(p->nodes[i]);
96618 - }
96619 -}
96620 -
96621 -/*
96622 - * reset all the locked nodes in the patch to spinning locks.
96623 - *
96624 - * held is used to keep lockdep happy, when lockdep is enabled
96625 - * we set held to a blocking lock before we go around and
96626 - * retake all the spinlocks in the path. You can safely use NULL
96627 - * for held
96628 - */
96629 -noinline void btrfs_clear_path_blocking(struct btrfs_path *p,
96630 - struct extent_buffer *held)
96631 +struct btrfs_path *btrfs_alloc_path(void)
96632 {
96633 - int i;
96634 -
96635 -#ifdef CONFIG_DEBUG_LOCK_ALLOC
96636 - /* lockdep really cares that we take all of these spinlocks
96637 - * in the right order. If any of the locks in the path are not
96638 - * currently blocking, it is going to complain. So, make really
96639 - * really sure by forcing the path to blocking before we clear
96640 - * the path blocking.
96641 - */
96642 - if (held)
96643 - btrfs_set_lock_blocking(held);
96644 - btrfs_set_path_blocking(p);
96645 -#endif
96646 -
96647 - for (i = BTRFS_MAX_LEVEL - 1; i >= 0; i--) {
96648 - if (p->nodes[i] && p->locks[i])
96649 - btrfs_clear_lock_blocking(p->nodes[i]);
96650 + struct btrfs_path *path;
96651 + path = kmem_cache_alloc(btrfs_path_cachep, GFP_NOFS);
96652 + if (path) {
96653 + btrfs_init_path(path);
96654 + path->reada = 1;
96655 }
96656 -
96657 -#ifdef CONFIG_DEBUG_LOCK_ALLOC
96658 - if (held)
96659 - btrfs_clear_lock_blocking(held);
96660 -#endif
96661 + return path;
96662 }
96663
96664 /* this also releases the path */
96665 @@ -277,7 +235,7 @@
96666 if (*cow_ret == buf)
96667 unlock_orig = 1;
96668
96669 - btrfs_assert_tree_locked(buf);
96670 + WARN_ON(!btrfs_tree_locked(buf));
96671
96672 if (parent)
96673 parent_start = parent->start;
96674 @@ -303,7 +261,7 @@
96675 trans->transid, level, &ins);
96676 BUG_ON(ret);
96677 cow = btrfs_init_new_buffer(trans, root, prealloc_dest,
96678 - buf->len, level);
96679 + buf->len);
96680 } else {
96681 cow = btrfs_alloc_free_block(trans, root, buf->len,
96682 parent_start,
96683 @@ -314,8 +272,6 @@
96684 if (IS_ERR(cow))
96685 return PTR_ERR(cow);
96686
96687 - /* cow is set to blocking by btrfs_init_new_buffer */
96688 -
96689 copy_extent_buffer(cow, buf, 0, 0, cow->len);
96690 btrfs_set_header_bytenr(cow, cow->start);
96691 btrfs_set_header_generation(cow, trans->transid);
96692 @@ -432,20 +388,17 @@
96693 WARN_ON(1);
96694 }
96695
96696 + spin_lock(&root->fs_info->hash_lock);
96697 if (btrfs_header_generation(buf) == trans->transid &&
96698 btrfs_header_owner(buf) == root->root_key.objectid &&
96699 !btrfs_header_flag(buf, BTRFS_HEADER_FLAG_WRITTEN)) {
96700 *cow_ret = buf;
96701 + spin_unlock(&root->fs_info->hash_lock);
96702 WARN_ON(prealloc_dest);
96703 return 0;
96704 }
96705 -
96706 + spin_unlock(&root->fs_info->hash_lock);
96707 search_start = buf->start & ~((u64)(1024 * 1024 * 1024) - 1);
96708 -
96709 - if (parent)
96710 - btrfs_set_lock_blocking(parent);
96711 - btrfs_set_lock_blocking(buf);
96712 -
96713 ret = __btrfs_cow_block(trans, root, buf, parent,
96714 parent_slot, cow_ret, search_start, 0,
96715 prealloc_dest);
96716 @@ -551,8 +504,6 @@
96717 if (parent_nritems == 1)
96718 return 0;
96719
96720 - btrfs_set_lock_blocking(parent);
96721 -
96722 for (i = start_slot; i < end_slot; i++) {
96723 int close = 1;
96724
96725 @@ -613,7 +564,6 @@
96726 search_start = last_block;
96727
96728 btrfs_tree_lock(cur);
96729 - btrfs_set_lock_blocking(cur);
96730 err = __btrfs_cow_block(trans, root, cur, parent, i,
96731 &cur, search_start,
96732 min(16 * blocksize,
96733 @@ -912,7 +862,6 @@
96734 return 0;
96735
96736 mid = path->nodes[level];
96737 -
96738 WARN_ON(!path->locks[level]);
96739 WARN_ON(btrfs_header_generation(mid) != trans->transid);
96740
96741 @@ -934,9 +883,8 @@
96742
96743 /* promote the child to a root */
96744 child = read_node_slot(root, mid, 0);
96745 - BUG_ON(!child);
96746 btrfs_tree_lock(child);
96747 - btrfs_set_lock_blocking(child);
96748 + BUG_ON(!child);
96749 ret = btrfs_cow_block(trans, root, child, mid, 0, &child, 0);
96750 BUG_ON(ret);
96751
96752 @@ -952,7 +900,6 @@
96753
96754 add_root_to_dirty_list(root);
96755 btrfs_tree_unlock(child);
96756 -
96757 path->locks[level] = 0;
96758 path->nodes[level] = NULL;
96759 clean_tree_block(trans, root, mid);
96760 @@ -977,7 +924,6 @@
96761 left = read_node_slot(root, parent, pslot - 1);
96762 if (left) {
96763 btrfs_tree_lock(left);
96764 - btrfs_set_lock_blocking(left);
96765 wret = btrfs_cow_block(trans, root, left,
96766 parent, pslot - 1, &left, 0);
96767 if (wret) {
96768 @@ -988,7 +934,6 @@
96769 right = read_node_slot(root, parent, pslot + 1);
96770 if (right) {
96771 btrfs_tree_lock(right);
96772 - btrfs_set_lock_blocking(right);
96773 wret = btrfs_cow_block(trans, root, right,
96774 parent, pslot + 1, &right, 0);
96775 if (wret) {
96776 @@ -1164,8 +1109,6 @@
96777 u32 left_nr;
96778
96779 btrfs_tree_lock(left);
96780 - btrfs_set_lock_blocking(left);
96781 -
96782 left_nr = btrfs_header_nritems(left);
96783 if (left_nr >= BTRFS_NODEPTRS_PER_BLOCK(root) - 1) {
96784 wret = 1;
96785 @@ -1212,10 +1155,7 @@
96786 */
96787 if (right) {
96788 u32 right_nr;
96789 -
96790 btrfs_tree_lock(right);
96791 - btrfs_set_lock_blocking(right);
96792 -
96793 right_nr = btrfs_header_nritems(right);
96794 if (right_nr >= BTRFS_NODEPTRS_PER_BLOCK(root) - 1) {
96795 wret = 1;
96796 @@ -1270,7 +1210,8 @@
96797 struct btrfs_disk_key disk_key;
96798 u32 nritems;
96799 u64 search;
96800 - u64 target;
96801 + u64 lowest_read;
96802 + u64 highest_read;
96803 u64 nread = 0;
96804 int direction = path->reada;
96805 struct extent_buffer *eb;
96806 @@ -1294,7 +1235,8 @@
96807 return;
96808 }
96809
96810 - target = search;
96811 + highest_read = search;
96812 + lowest_read = search;
96813
96814 nritems = btrfs_header_nritems(node);
96815 nr = slot;
96816 @@ -1314,80 +1256,27 @@
96817 break;
96818 }
96819 search = btrfs_node_blockptr(node, nr);
96820 - if ((search <= target && target - search <= 65536) ||
96821 - (search > target && search - target <= 65536)) {
96822 + if ((search >= lowest_read && search <= highest_read) ||
96823 + (search < lowest_read && lowest_read - search <= 16384) ||
96824 + (search > highest_read && search - highest_read <= 16384)) {
96825 readahead_tree_block(root, search, blocksize,
96826 btrfs_node_ptr_generation(node, nr));
96827 nread += blocksize;
96828 }
96829 nscan++;
96830 - if ((nread > 65536 || nscan > 32))
96831 + if (path->reada < 2 && (nread > (64 * 1024) || nscan > 32))
96832 break;
96833 - }
96834 -}
96835 -
96836 -/*
96837 - * returns -EAGAIN if it had to drop the path, or zero if everything was in
96838 - * cache
96839 - */
96840 -static noinline int reada_for_balance(struct btrfs_root *root,
96841 - struct btrfs_path *path, int level)
96842 -{
96843 - int slot;
96844 - int nritems;
96845 - struct extent_buffer *parent;
96846 - struct extent_buffer *eb;
96847 - u64 gen;
96848 - u64 block1 = 0;
96849 - u64 block2 = 0;
96850 - int ret = 0;
96851 - int blocksize;
96852
96853 - parent = path->nodes[level - 1];
96854 - if (!parent)
96855 - return 0;
96856 -
96857 - nritems = btrfs_header_nritems(parent);
96858 - slot = path->slots[level];
96859 - blocksize = btrfs_level_size(root, level);
96860 -
96861 - if (slot > 0) {
96862 - block1 = btrfs_node_blockptr(parent, slot - 1);
96863 - gen = btrfs_node_ptr_generation(parent, slot - 1);
96864 - eb = btrfs_find_tree_block(root, block1, blocksize);
96865 - if (eb && btrfs_buffer_uptodate(eb, gen))
96866 - block1 = 0;
96867 - free_extent_buffer(eb);
96868 - }
96869 - if (slot < nritems) {
96870 - block2 = btrfs_node_blockptr(parent, slot + 1);
96871 - gen = btrfs_node_ptr_generation(parent, slot + 1);
96872 - eb = btrfs_find_tree_block(root, block2, blocksize);
96873 - if (eb && btrfs_buffer_uptodate(eb, gen))
96874 - block2 = 0;
96875 - free_extent_buffer(eb);
96876 - }
96877 - if (block1 || block2) {
96878 - ret = -EAGAIN;
96879 - btrfs_release_path(root, path);
96880 - if (block1)
96881 - readahead_tree_block(root, block1, blocksize, 0);
96882 - if (block2)
96883 - readahead_tree_block(root, block2, blocksize, 0);
96884 + if (nread > (256 * 1024) || nscan > 128)
96885 + break;
96886
96887 - if (block1) {
96888 - eb = read_tree_block(root, block1, blocksize, 0);
96889 - free_extent_buffer(eb);
96890 - }
96891 - if (block1) {
96892 - eb = read_tree_block(root, block2, blocksize, 0);
96893 - free_extent_buffer(eb);
96894 - }
96895 + if (search < lowest_read)
96896 + lowest_read = search;
96897 + if (search > highest_read)
96898 + highest_read = search;
96899 }
96900 - return ret;
96901 }
96902
96903 -
96904 /*
96905 * when we walk down the tree, it is usually safe to unlock the higher layers
96906 * in the tree. The exceptions are when our path goes through slot 0, because
96907 @@ -1439,32 +1328,6 @@
96908 }
96909
96910 /*
96911 - * This releases any locks held in the path starting at level and
96912 - * going all the way up to the root.
96913 - *
96914 - * btrfs_search_slot will keep the lock held on higher nodes in a few
96915 - * corner cases, such as COW of the block at slot zero in the node. This
96916 - * ignores those rules, and it should only be called when there are no
96917 - * more updates to be done higher up in the tree.
96918 - */
96919 -noinline void btrfs_unlock_up_safe(struct btrfs_path *path, int level)
96920 -{
96921 - int i;
96922 -
96923 - if (path->keep_locks || path->lowest_level)
96924 - return;
96925 -
96926 - for (i = level; i < BTRFS_MAX_LEVEL; i++) {
96927 - if (!path->nodes[i])
96928 - continue;
96929 - if (!path->locks[i])
96930 - continue;
96931 - btrfs_tree_unlock(path->nodes[i]);
96932 - path->locks[i] = 0;
96933 - }
96934 -}
96935 -
96936 -/*
96937 * look for key in the tree. path is filled in with nodes along the way
96938 * if key is found, we return zero and you can find the item in the leaf
96939 * level of the path (level 0)
96940 @@ -1524,30 +1387,32 @@
96941 int wret;
96942
96943 /* is a cow on this block not required */
96944 + spin_lock(&root->fs_info->hash_lock);
96945 if (btrfs_header_generation(b) == trans->transid &&
96946 btrfs_header_owner(b) == root->root_key.objectid &&
96947 !btrfs_header_flag(b, BTRFS_HEADER_FLAG_WRITTEN)) {
96948 + spin_unlock(&root->fs_info->hash_lock);
96949 goto cow_done;
96950 }
96951 + spin_unlock(&root->fs_info->hash_lock);
96952
96953 /* ok, we have to cow, is our old prealloc the right
96954 * size?
96955 */
96956 if (prealloc_block.objectid &&
96957 prealloc_block.offset != b->len) {
96958 - btrfs_release_path(root, p);
96959 btrfs_free_reserved_extent(root,
96960 prealloc_block.objectid,
96961 prealloc_block.offset);
96962 prealloc_block.objectid = 0;
96963 - goto again;
96964 }
96965
96966 /*
96967 * for higher level blocks, try not to allocate blocks
96968 * with the block and the parent locks held.
96969 */
96970 - if (level > 0 && !prealloc_block.objectid) {
96971 + if (level > 1 && !prealloc_block.objectid &&
96972 + btrfs_path_lock_waiting(p, level)) {
96973 u32 size = b->len;
96974 u64 hint = b->start;
96975
96976 @@ -1560,8 +1425,6 @@
96977 goto again;
96978 }
96979
96980 - btrfs_set_path_blocking(p);
96981 -
96982 wret = btrfs_cow_block(trans, root, b,
96983 p->nodes[level + 1],
96984 p->slots[level + 1],
96985 @@ -1583,22 +1446,6 @@
96986 if (!p->skip_locking)
96987 p->locks[level] = 1;
96988
96989 - btrfs_clear_path_blocking(p, NULL);
96990 -
96991 - /*
96992 - * we have a lock on b and as long as we aren't changing
96993 - * the tree, there is no way to for the items in b to change.
96994 - * It is safe to drop the lock on our parent before we
96995 - * go through the expensive btree search on b.
96996 - *
96997 - * If cow is true, then we might be changing slot zero,
96998 - * which may require changing the parent. So, we can't
96999 - * drop the lock until after we know which slot we're
97000 - * operating on.
97001 - */
97002 - if (!cow)
97003 - btrfs_unlock_up_safe(p, level + 1);
97004 -
97005 ret = check_block(root, p, level);
97006 if (ret) {
97007 ret = -1;
97008 @@ -1606,7 +1453,6 @@
97009 }
97010
97011 ret = bin_search(b, key, level, &slot);
97012 -
97013 if (level != 0) {
97014 if (ret && slot > 0)
97015 slot -= 1;
97016 @@ -1614,16 +1460,7 @@
97017 if ((p->search_for_split || ins_len > 0) &&
97018 btrfs_header_nritems(b) >=
97019 BTRFS_NODEPTRS_PER_BLOCK(root) - 3) {
97020 - int sret;
97021 -
97022 - sret = reada_for_balance(root, p, level);
97023 - if (sret)
97024 - goto again;
97025 -
97026 - btrfs_set_path_blocking(p);
97027 - sret = split_node(trans, root, p, level);
97028 - btrfs_clear_path_blocking(p, NULL);
97029 -
97030 + int sret = split_node(trans, root, p, level);
97031 BUG_ON(sret > 0);
97032 if (sret) {
97033 ret = sret;
97034 @@ -1631,19 +1468,9 @@
97035 }
97036 b = p->nodes[level];
97037 slot = p->slots[level];
97038 - } else if (ins_len < 0 &&
97039 - btrfs_header_nritems(b) <
97040 - BTRFS_NODEPTRS_PER_BLOCK(root) / 4) {
97041 - int sret;
97042 -
97043 - sret = reada_for_balance(root, p, level);
97044 - if (sret)
97045 - goto again;
97046 -
97047 - btrfs_set_path_blocking(p);
97048 - sret = balance_level(trans, root, p, level);
97049 - btrfs_clear_path_blocking(p, NULL);
97050 -
97051 + } else if (ins_len < 0) {
97052 + int sret = balance_level(trans, root, p,
97053 + level);
97054 if (sret) {
97055 ret = sret;
97056 goto done;
97057 @@ -1677,7 +1504,7 @@
97058 * of the btree by dropping locks before
97059 * we read.
97060 */
97061 - if (level > 0) {
97062 + if (level > 1) {
97063 btrfs_release_path(NULL, p);
97064 if (tmp)
97065 free_extent_buffer(tmp);
97066 @@ -1692,7 +1519,6 @@
97067 free_extent_buffer(tmp);
97068 goto again;
97069 } else {
97070 - btrfs_set_path_blocking(p);
97071 if (tmp)
97072 free_extent_buffer(tmp);
97073 if (should_reada)
97074 @@ -1702,29 +1528,14 @@
97075 b = read_node_slot(root, b, slot);
97076 }
97077 }
97078 - if (!p->skip_locking) {
97079 - int lret;
97080 -
97081 - btrfs_clear_path_blocking(p, NULL);
97082 - lret = btrfs_try_spin_lock(b);
97083 -
97084 - if (!lret) {
97085 - btrfs_set_path_blocking(p);
97086 - btrfs_tree_lock(b);
97087 - btrfs_clear_path_blocking(p, b);
97088 - }
97089 - }
97090 + if (!p->skip_locking)
97091 + btrfs_tree_lock(b);
97092 } else {
97093 p->slots[level] = slot;
97094 if (ins_len > 0 &&
97095 btrfs_leaf_free_space(root, b) < ins_len) {
97096 - int sret;
97097 -
97098 - btrfs_set_path_blocking(p);
97099 - sret = split_leaf(trans, root, key,
97100 + int sret = split_leaf(trans, root, key,
97101 p, ins_len, ret == 0);
97102 - btrfs_clear_path_blocking(p, NULL);
97103 -
97104 BUG_ON(sret > 0);
97105 if (sret) {
97106 ret = sret;
97107 @@ -1738,16 +1549,12 @@
97108 }
97109 ret = 1;
97110 done:
97111 - /*
97112 - * we don't really know what they plan on doing with the path
97113 - * from here on, so for now just mark it as blocking
97114 - */
97115 - btrfs_set_path_blocking(p);
97116 if (prealloc_block.objectid) {
97117 btrfs_free_reserved_extent(root,
97118 prealloc_block.objectid,
97119 prealloc_block.offset);
97120 }
97121 +
97122 return ret;
97123 }
97124
97125 @@ -1771,8 +1578,6 @@
97126 ret = btrfs_cow_block(trans, root, eb, NULL, 0, &eb, 0);
97127 BUG_ON(ret);
97128
97129 - btrfs_set_lock_blocking(eb);
97130 -
97131 parent = eb;
97132 while (1) {
97133 level = btrfs_header_level(parent);
97134 @@ -1797,7 +1602,6 @@
97135 eb = read_tree_block(root, bytenr, blocksize,
97136 generation);
97137 btrfs_tree_lock(eb);
97138 - btrfs_set_lock_blocking(eb);
97139 }
97140
97141 /*
97142 @@ -1822,7 +1626,6 @@
97143 eb = read_tree_block(root, bytenr, blocksize,
97144 generation);
97145 btrfs_tree_lock(eb);
97146 - btrfs_set_lock_blocking(eb);
97147 }
97148
97149 ret = btrfs_cow_block(trans, root, eb, parent, slot,
97150 @@ -2365,12 +2168,10 @@
97151 if (slot >= btrfs_header_nritems(upper) - 1)
97152 return 1;
97153
97154 - btrfs_assert_tree_locked(path->nodes[1]);
97155 + WARN_ON(!btrfs_tree_locked(path->nodes[1]));
97156
97157 right = read_node_slot(root, upper, slot + 1);
97158 btrfs_tree_lock(right);
97159 - btrfs_set_lock_blocking(right);
97160 -
97161 free_space = btrfs_leaf_free_space(root, right);
97162 if (free_space < data_size)
97163 goto out_unlock;
97164 @@ -2562,12 +2363,10 @@
97165 if (right_nritems == 0)
97166 return 1;
97167
97168 - btrfs_assert_tree_locked(path->nodes[1]);
97169 + WARN_ON(!btrfs_tree_locked(path->nodes[1]));
97170
97171 left = read_node_slot(root, path->nodes[1], slot - 1);
97172 btrfs_tree_lock(left);
97173 - btrfs_set_lock_blocking(left);
97174 -
97175 free_space = btrfs_leaf_free_space(root, left);
97176 if (free_space < data_size) {
97177 ret = 1;
97178 @@ -3026,12 +2825,6 @@
97179 path->keep_locks = 0;
97180 BUG_ON(ret);
97181
97182 - /*
97183 - * make sure any changes to the path from split_leaf leave it
97184 - * in a blocking state
97185 - */
97186 - btrfs_set_path_blocking(path);
97187 -
97188 leaf = path->nodes[0];
97189 BUG_ON(btrfs_leaf_free_space(root, leaf) < sizeof(struct btrfs_item));
97190
97191 @@ -3561,7 +3354,6 @@
97192 BUG();
97193 }
97194 out:
97195 - btrfs_unlock_up_safe(path, 1);
97196 return ret;
97197 }
97198
97199 @@ -3649,22 +3441,15 @@
97200 {
97201 int ret;
97202 u64 root_gen = btrfs_header_generation(path->nodes[1]);
97203 - u64 parent_start = path->nodes[1]->start;
97204 - u64 parent_owner = btrfs_header_owner(path->nodes[1]);
97205
97206 ret = del_ptr(trans, root, path, 1, path->slots[1]);
97207 if (ret)
97208 return ret;
97209
97210 - /*
97211 - * btrfs_free_extent is expensive, we want to make sure we
97212 - * aren't holding any locks when we call it
97213 - */
97214 - btrfs_unlock_up_safe(path, 0);
97215 -
97216 ret = btrfs_free_extent(trans, root, bytenr,
97217 btrfs_level_size(root, 0),
97218 - parent_start, parent_owner,
97219 + path->nodes[1]->start,
97220 + btrfs_header_owner(path->nodes[1]),
97221 root_gen, 0, 1);
97222 return ret;
97223 }
97224 @@ -3936,7 +3721,6 @@
97225 */
97226 if (slot >= nritems) {
97227 path->slots[level] = slot;
97228 - btrfs_set_path_blocking(path);
97229 sret = btrfs_find_next_key(root, path, min_key, level,
97230 cache_only, min_trans);
97231 if (sret == 0) {
97232 @@ -3954,20 +3738,16 @@
97233 unlock_up(path, level, 1);
97234 goto out;
97235 }
97236 - btrfs_set_path_blocking(path);
97237 cur = read_node_slot(root, cur, slot);
97238
97239 btrfs_tree_lock(cur);
97240 -
97241 path->locks[level - 1] = 1;
97242 path->nodes[level - 1] = cur;
97243 unlock_up(path, level, 1);
97244 - btrfs_clear_path_blocking(path, NULL);
97245 }
97246 out:
97247 if (ret == 0)
97248 memcpy(min_key, &found_key, sizeof(found_key));
97249 - btrfs_set_path_blocking(path);
97250 return ret;
97251 }
97252
97253 @@ -4063,7 +3843,6 @@
97254 if (ret < 0)
97255 return ret;
97256
97257 - btrfs_set_path_blocking(path);
97258 nritems = btrfs_header_nritems(path->nodes[0]);
97259 /*
97260 * by releasing the path above we dropped all our locks. A balance
97261 @@ -4094,16 +3873,14 @@
97262 free_extent_buffer(next);
97263 }
97264
97265 - /* the path was set to blocking above */
97266 if (level == 1 && (path->locks[1] || path->skip_locking) &&
97267 path->reada)
97268 reada_for_search(root, path, level, slot, 0);
97269
97270 next = read_node_slot(root, c, slot);
97271 if (!path->skip_locking) {
97272 - btrfs_assert_tree_locked(c);
97273 + WARN_ON(!btrfs_tree_locked(c));
97274 btrfs_tree_lock(next);
97275 - btrfs_set_lock_blocking(next);
97276 }
97277 break;
97278 }
97279 @@ -4120,15 +3897,12 @@
97280 path->locks[level] = 1;
97281 if (!level)
97282 break;
97283 -
97284 - btrfs_set_path_blocking(path);
97285 if (level == 1 && path->locks[1] && path->reada)
97286 reada_for_search(root, path, level, slot, 0);
97287 next = read_node_slot(root, next, 0);
97288 if (!path->skip_locking) {
97289 - btrfs_assert_tree_locked(path->nodes[level]);
97290 + WARN_ON(!btrfs_tree_locked(path->nodes[level]));
97291 btrfs_tree_lock(next);
97292 - btrfs_set_lock_blocking(next);
97293 }
97294 }
97295 done:
97296 @@ -4153,7 +3927,6 @@
97297
97298 while (1) {
97299 if (path->slots[0] == 0) {
97300 - btrfs_set_path_blocking(path);
97301 ret = btrfs_prev_leaf(root, path);
97302 if (ret != 0)
97303 return ret;
97304 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/btrfs/ctree.h linux-2.6.29-rc3.owrt/fs/btrfs/ctree.h
97305 --- linux-2.6.29.owrt/fs/btrfs/ctree.h 2009-05-10 22:04:39.000000000 +0200
97306 +++ linux-2.6.29-rc3.owrt/fs/btrfs/ctree.h 2009-05-10 23:48:29.000000000 +0200
97307 @@ -43,7 +43,11 @@
97308
97309 #define BTRFS_ACL_NOT_CACHED ((void *)-1)
97310
97311 -#define BTRFS_MAX_LEVEL 8
97312 +#ifdef CONFIG_LOCKDEP
97313 +# define BTRFS_MAX_LEVEL 7
97314 +#else
97315 +# define BTRFS_MAX_LEVEL 8
97316 +#endif
97317
97318 /* holds pointers to all of the tree roots */
97319 #define BTRFS_ROOT_TREE_OBJECTID 1ULL
97320 @@ -450,11 +454,17 @@
97321 __le32 nsec;
97322 } __attribute__ ((__packed__));
97323
97324 -enum btrfs_compression_type {
97325 +typedef enum {
97326 BTRFS_COMPRESS_NONE = 0,
97327 BTRFS_COMPRESS_ZLIB = 1,
97328 BTRFS_COMPRESS_LAST = 2,
97329 -};
97330 +} btrfs_compression_type;
97331 +
97332 +/* we don't understand any encryption methods right now */
97333 +typedef enum {
97334 + BTRFS_ENCRYPTION_NONE = 0,
97335 + BTRFS_ENCRYPTION_LAST = 1,
97336 +} btrfs_encryption_type;
97337
97338 struct btrfs_inode_item {
97339 /* nfs style generation number */
97340 @@ -596,27 +606,13 @@
97341
97342 struct btrfs_space_info {
97343 u64 flags;
97344 -
97345 - u64 total_bytes; /* total bytes in the space */
97346 - u64 bytes_used; /* total bytes used on disk */
97347 - u64 bytes_pinned; /* total bytes pinned, will be freed when the
97348 - transaction finishes */
97349 - u64 bytes_reserved; /* total bytes the allocator has reserved for
97350 - current allocations */
97351 - u64 bytes_readonly; /* total bytes that are read only */
97352 -
97353 - /* delalloc accounting */
97354 - u64 bytes_delalloc; /* number of bytes reserved for allocation,
97355 - this space is not necessarily reserved yet
97356 - by the allocator */
97357 - u64 bytes_may_use; /* number of bytes that may be used for
97358 - delalloc */
97359 -
97360 - int full; /* indicates that we cannot allocate any more
97361 - chunks for this space */
97362 - int force_alloc; /* set if we need to force a chunk alloc for
97363 - this space */
97364 -
97365 + u64 total_bytes;
97366 + u64 bytes_used;
97367 + u64 bytes_pinned;
97368 + u64 bytes_reserved;
97369 + u64 bytes_readonly;
97370 + int full;
97371 + int force_alloc;
97372 struct list_head list;
97373
97374 /* for block groups in our same type */
97375 @@ -705,7 +701,9 @@
97376 struct btrfs_transaction *running_transaction;
97377 wait_queue_head_t transaction_throttle;
97378 wait_queue_head_t transaction_wait;
97379 +
97380 wait_queue_head_t async_submit_wait;
97381 + wait_queue_head_t tree_log_wait;
97382
97383 struct btrfs_super_block super_copy;
97384 struct btrfs_super_block super_for_commit;
97385 @@ -713,6 +711,7 @@
97386 struct super_block *sb;
97387 struct inode *btree_inode;
97388 struct backing_dev_info bdi;
97389 + spinlock_t hash_lock;
97390 struct mutex trans_mutex;
97391 struct mutex tree_log_mutex;
97392 struct mutex transaction_kthread_mutex;
97393 @@ -731,6 +730,10 @@
97394 atomic_t async_submit_draining;
97395 atomic_t nr_async_bios;
97396 atomic_t async_delalloc_pages;
97397 + atomic_t tree_log_writers;
97398 + atomic_t tree_log_commit;
97399 + unsigned long tree_log_batch;
97400 + u64 tree_log_transid;
97401
97402 /*
97403 * this is used by the balancing code to wait for all the pending
97404 @@ -784,14 +787,7 @@
97405 struct list_head dirty_cowonly_roots;
97406
97407 struct btrfs_fs_devices *fs_devices;
97408 -
97409 - /*
97410 - * the space_info list is almost entirely read only. It only changes
97411 - * when we add a new raid type to the FS, and that happens
97412 - * very rarely. RCU is used to protect it.
97413 - */
97414 struct list_head space_info;
97415 -
97416 spinlock_t delalloc_lock;
97417 spinlock_t new_trans_lock;
97418 u64 delalloc_bytes;
97419 @@ -837,14 +833,7 @@
97420 struct kobject root_kobj;
97421 struct completion kobj_unregister;
97422 struct mutex objectid_mutex;
97423 -
97424 struct mutex log_mutex;
97425 - wait_queue_head_t log_writer_wait;
97426 - wait_queue_head_t log_commit_wait[2];
97427 - atomic_t log_writers;
97428 - atomic_t log_commit[2];
97429 - unsigned long log_transid;
97430 - unsigned long log_batch;
97431
97432 u64 objectid;
97433 u64 last_trans;
97434 @@ -1732,8 +1721,7 @@
97435 u64 empty_size);
97436 struct extent_buffer *btrfs_init_new_buffer(struct btrfs_trans_handle *trans,
97437 struct btrfs_root *root,
97438 - u64 bytenr, u32 blocksize,
97439 - int level);
97440 + u64 bytenr, u32 blocksize);
97441 int btrfs_alloc_extent(struct btrfs_trans_handle *trans,
97442 struct btrfs_root *root,
97443 u64 num_bytes, u64 parent, u64 min_bytes,
97444 @@ -1803,18 +1791,6 @@
97445 int btrfs_cleanup_reloc_trees(struct btrfs_root *root);
97446 int btrfs_reloc_clone_csums(struct inode *inode, u64 file_pos, u64 len);
97447 u64 btrfs_reduce_alloc_profile(struct btrfs_root *root, u64 flags);
97448 -void btrfs_set_inode_space_info(struct btrfs_root *root, struct inode *ionde);
97449 -void btrfs_clear_space_info_full(struct btrfs_fs_info *info);
97450 -
97451 -int btrfs_check_metadata_free_space(struct btrfs_root *root);
97452 -int btrfs_check_data_free_space(struct btrfs_root *root, struct inode *inode,
97453 - u64 bytes);
97454 -void btrfs_free_reserved_data_space(struct btrfs_root *root,
97455 - struct inode *inode, u64 bytes);
97456 -void btrfs_delalloc_reserve_space(struct btrfs_root *root, struct inode *inode,
97457 - u64 bytes);
97458 -void btrfs_delalloc_free_space(struct btrfs_root *root, struct inode *inode,
97459 - u64 bytes);
97460 /* ctree.c */
97461 int btrfs_previous_item(struct btrfs_root *root,
97462 struct btrfs_path *path, u64 min_objectid,
97463 @@ -1864,9 +1840,7 @@
97464 void btrfs_release_path(struct btrfs_root *root, struct btrfs_path *p);
97465 struct btrfs_path *btrfs_alloc_path(void);
97466 void btrfs_free_path(struct btrfs_path *p);
97467 -void btrfs_set_path_blocking(struct btrfs_path *p);
97468 -void btrfs_unlock_up_safe(struct btrfs_path *p, int level);
97469 -
97470 +void btrfs_init_path(struct btrfs_path *p);
97471 int btrfs_del_items(struct btrfs_trans_handle *trans, struct btrfs_root *root,
97472 struct btrfs_path *path, int slot, int nr);
97473 int btrfs_del_leaf(struct btrfs_trans_handle *trans,
97474 @@ -2060,6 +2034,8 @@
97475 unsigned long btrfs_force_ra(struct address_space *mapping,
97476 struct file_ra_state *ra, struct file *file,
97477 pgoff_t offset, pgoff_t last_index);
97478 +int btrfs_check_free_space(struct btrfs_root *root, u64 num_required,
97479 + int for_del);
97480 int btrfs_page_mkwrite(struct vm_area_struct *vma, struct page *page);
97481 int btrfs_readpage(struct file *file, struct page *page);
97482 void btrfs_delete_inode(struct inode *inode);
97483 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/btrfs/disk-io.c linux-2.6.29-rc3.owrt/fs/btrfs/disk-io.c
97484 --- linux-2.6.29.owrt/fs/btrfs/disk-io.c 2009-05-10 22:04:39.000000000 +0200
97485 +++ linux-2.6.29-rc3.owrt/fs/btrfs/disk-io.c 2009-05-10 23:48:29.000000000 +0200
97486 @@ -16,6 +16,7 @@
97487 * Boston, MA 021110-1307, USA.
97488 */
97489
97490 +#include <linux/version.h>
97491 #include <linux/fs.h>
97492 #include <linux/blkdev.h>
97493 #include <linux/scatterlist.h>
97494 @@ -75,40 +76,6 @@
97495 struct btrfs_work work;
97496 };
97497
97498 -/* These are used to set the lockdep class on the extent buffer locks.
97499 - * The class is set by the readpage_end_io_hook after the buffer has
97500 - * passed csum validation but before the pages are unlocked.
97501 - *
97502 - * The lockdep class is also set by btrfs_init_new_buffer on freshly
97503 - * allocated blocks.
97504 - *
97505 - * The class is based on the level in the tree block, which allows lockdep
97506 - * to know that lower nodes nest inside the locks of higher nodes.
97507 - *
97508 - * We also add a check to make sure the highest level of the tree is
97509 - * the same as our lockdep setup here. If BTRFS_MAX_LEVEL changes, this
97510 - * code needs update as well.
97511 - */
97512 -#ifdef CONFIG_DEBUG_LOCK_ALLOC
97513 -# if BTRFS_MAX_LEVEL != 8
97514 -# error
97515 -# endif
97516 -static struct lock_class_key btrfs_eb_class[BTRFS_MAX_LEVEL + 1];
97517 -static const char *btrfs_eb_name[BTRFS_MAX_LEVEL + 1] = {
97518 - /* leaf */
97519 - "btrfs-extent-00",
97520 - "btrfs-extent-01",
97521 - "btrfs-extent-02",
97522 - "btrfs-extent-03",
97523 - "btrfs-extent-04",
97524 - "btrfs-extent-05",
97525 - "btrfs-extent-06",
97526 - "btrfs-extent-07",
97527 - /* highest possible level */
97528 - "btrfs-extent-08",
97529 -};
97530 -#endif
97531 -
97532 /*
97533 * extents on the btree inode are pretty simple, there's one extent
97534 * that covers the entire device
97535 @@ -381,15 +348,6 @@
97536 return ret;
97537 }
97538
97539 -#ifdef CONFIG_DEBUG_LOCK_ALLOC
97540 -void btrfs_set_buffer_lockdep_class(struct extent_buffer *eb, int level)
97541 -{
97542 - lockdep_set_class_and_name(&eb->lock,
97543 - &btrfs_eb_class[level],
97544 - btrfs_eb_name[level]);
97545 -}
97546 -#endif
97547 -
97548 static int btree_readpage_end_io_hook(struct page *page, u64 start, u64 end,
97549 struct extent_state *state)
97550 {
97551 @@ -435,8 +393,6 @@
97552 }
97553 found_level = btrfs_header_level(eb);
97554
97555 - btrfs_set_buffer_lockdep_class(eb, found_level);
97556 -
97557 ret = csum_tree_block(root, eb, 1);
97558 if (ret)
97559 ret = -EIO;
97560 @@ -844,7 +800,7 @@
97561 ret = btree_read_extent_buffer_pages(root, buf, 0, parent_transid);
97562
97563 if (ret == 0)
97564 - set_bit(EXTENT_BUFFER_UPTODATE, &buf->bflags);
97565 + buf->flags |= EXTENT_UPTODATE;
97566 else
97567 WARN_ON(1);
97568 return buf;
97569 @@ -857,11 +813,7 @@
97570 struct inode *btree_inode = root->fs_info->btree_inode;
97571 if (btrfs_header_generation(buf) ==
97572 root->fs_info->running_transaction->transid) {
97573 - btrfs_assert_tree_locked(buf);
97574 -
97575 - /* ugh, clear_extent_buffer_dirty can be expensive */
97576 - btrfs_set_lock_blocking(buf);
97577 -
97578 + WARN_ON(!btrfs_tree_locked(buf));
97579 clear_extent_buffer_dirty(&BTRFS_I(btree_inode)->io_tree,
97580 buf);
97581 }
97582 @@ -898,14 +850,6 @@
97583 spin_lock_init(&root->list_lock);
97584 mutex_init(&root->objectid_mutex);
97585 mutex_init(&root->log_mutex);
97586 - init_waitqueue_head(&root->log_writer_wait);
97587 - init_waitqueue_head(&root->log_commit_wait[0]);
97588 - init_waitqueue_head(&root->log_commit_wait[1]);
97589 - atomic_set(&root->log_commit[0], 0);
97590 - atomic_set(&root->log_commit[1], 0);
97591 - atomic_set(&root->log_writers, 0);
97592 - root->log_batch = 0;
97593 - root->log_transid = 0;
97594 extent_io_tree_init(&root->dirty_log_pages,
97595 fs_info->btree_inode->i_mapping, GFP_NOFS);
97596
97597 @@ -990,16 +934,15 @@
97598 return 0;
97599 }
97600
97601 -static struct btrfs_root *alloc_log_tree(struct btrfs_trans_handle *trans,
97602 - struct btrfs_fs_info *fs_info)
97603 +int btrfs_init_log_root_tree(struct btrfs_trans_handle *trans,
97604 + struct btrfs_fs_info *fs_info)
97605 {
97606 struct btrfs_root *root;
97607 struct btrfs_root *tree_root = fs_info->tree_root;
97608 - struct extent_buffer *leaf;
97609
97610 root = kzalloc(sizeof(*root), GFP_NOFS);
97611 if (!root)
97612 - return ERR_PTR(-ENOMEM);
97613 + return -ENOMEM;
97614
97615 __setup_root(tree_root->nodesize, tree_root->leafsize,
97616 tree_root->sectorsize, tree_root->stripesize,
97617 @@ -1008,23 +951,12 @@
97618 root->root_key.objectid = BTRFS_TREE_LOG_OBJECTID;
97619 root->root_key.type = BTRFS_ROOT_ITEM_KEY;
97620 root->root_key.offset = BTRFS_TREE_LOG_OBJECTID;
97621 - /*
97622 - * log trees do not get reference counted because they go away
97623 - * before a real commit is actually done. They do store pointers
97624 - * to file data extents, and those reference counts still get
97625 - * updated (along with back refs to the log tree).
97626 - */
97627 root->ref_cows = 0;
97628
97629 - leaf = btrfs_alloc_free_block(trans, root, root->leafsize,
97630 - 0, BTRFS_TREE_LOG_OBJECTID,
97631 - trans->transid, 0, 0, 0);
97632 - if (IS_ERR(leaf)) {
97633 - kfree(root);
97634 - return ERR_CAST(leaf);
97635 - }
97636 + root->node = btrfs_alloc_free_block(trans, root, root->leafsize,
97637 + 0, BTRFS_TREE_LOG_OBJECTID,
97638 + trans->transid, 0, 0, 0);
97639
97640 - root->node = leaf;
97641 btrfs_set_header_nritems(root->node, 0);
97642 btrfs_set_header_level(root->node, 0);
97643 btrfs_set_header_bytenr(root->node, root->node->start);
97644 @@ -1036,48 +968,7 @@
97645 BTRFS_FSID_SIZE);
97646 btrfs_mark_buffer_dirty(root->node);
97647 btrfs_tree_unlock(root->node);
97648 - return root;
97649 -}
97650 -
97651 -int btrfs_init_log_root_tree(struct btrfs_trans_handle *trans,
97652 - struct btrfs_fs_info *fs_info)
97653 -{
97654 - struct btrfs_root *log_root;
97655 -
97656 - log_root = alloc_log_tree(trans, fs_info);
97657 - if (IS_ERR(log_root))
97658 - return PTR_ERR(log_root);
97659 - WARN_ON(fs_info->log_root_tree);
97660 - fs_info->log_root_tree = log_root;
97661 - return 0;
97662 -}
97663 -
97664 -int btrfs_add_log_tree(struct btrfs_trans_handle *trans,
97665 - struct btrfs_root *root)
97666 -{
97667 - struct btrfs_root *log_root;
97668 - struct btrfs_inode_item *inode_item;
97669 -
97670 - log_root = alloc_log_tree(trans, root->fs_info);
97671 - if (IS_ERR(log_root))
97672 - return PTR_ERR(log_root);
97673 -
97674 - log_root->last_trans = trans->transid;
97675 - log_root->root_key.offset = root->root_key.objectid;
97676 -
97677 - inode_item = &log_root->root_item.inode;
97678 - inode_item->generation = cpu_to_le64(1);
97679 - inode_item->size = cpu_to_le64(3);
97680 - inode_item->nlink = cpu_to_le32(1);
97681 - inode_item->nbytes = cpu_to_le64(root->leafsize);
97682 - inode_item->mode = cpu_to_le32(S_IFDIR | 0755);
97683 -
97684 - btrfs_set_root_bytenr(&log_root->root_item, log_root->node->start);
97685 - btrfs_set_root_generation(&log_root->root_item, trans->transid);
97686 -
97687 - WARN_ON(root->log_root);
97688 - root->log_root = log_root;
97689 - root->log_transid = 0;
97690 + fs_info->log_root_tree = root;
97691 return 0;
97692 }
97693
97694 @@ -1245,6 +1136,7 @@
97695 {
97696 struct btrfs_fs_info *info = (struct btrfs_fs_info *)congested_data;
97697 int ret = 0;
97698 + struct list_head *cur;
97699 struct btrfs_device *device;
97700 struct backing_dev_info *bdi;
97701 #if 0
97702 @@ -1252,7 +1144,8 @@
97703 btrfs_congested_async(info, 0))
97704 return 1;
97705 #endif
97706 - list_for_each_entry(device, &info->fs_devices->devices, dev_list) {
97707 + list_for_each(cur, &info->fs_devices->devices) {
97708 + device = list_entry(cur, struct btrfs_device, dev_list);
97709 if (!device->bdev)
97710 continue;
97711 bdi = blk_get_backing_dev_info(device->bdev);
97712 @@ -1270,11 +1163,13 @@
97713 */
97714 static void __unplug_io_fn(struct backing_dev_info *bdi, struct page *page)
97715 {
97716 + struct list_head *cur;
97717 struct btrfs_device *device;
97718 struct btrfs_fs_info *info;
97719
97720 info = (struct btrfs_fs_info *)bdi->unplug_io_data;
97721 - list_for_each_entry(device, &info->fs_devices->devices, dev_list) {
97722 + list_for_each(cur, &info->fs_devices->devices) {
97723 + device = list_entry(cur, struct btrfs_device, dev_list);
97724 if (!device->bdev)
97725 continue;
97726
97727 @@ -1552,6 +1447,7 @@
97728 INIT_LIST_HEAD(&fs_info->dead_roots);
97729 INIT_LIST_HEAD(&fs_info->hashers);
97730 INIT_LIST_HEAD(&fs_info->delalloc_inodes);
97731 + spin_lock_init(&fs_info->hash_lock);
97732 spin_lock_init(&fs_info->delalloc_lock);
97733 spin_lock_init(&fs_info->new_trans_lock);
97734 spin_lock_init(&fs_info->ref_cache_lock);
97735 @@ -1639,6 +1535,10 @@
97736 init_waitqueue_head(&fs_info->transaction_throttle);
97737 init_waitqueue_head(&fs_info->transaction_wait);
97738 init_waitqueue_head(&fs_info->async_submit_wait);
97739 + init_waitqueue_head(&fs_info->tree_log_wait);
97740 + atomic_set(&fs_info->tree_log_commit, 0);
97741 + atomic_set(&fs_info->tree_log_writers, 0);
97742 + fs_info->tree_log_transid = 0;
97743
97744 __setup_root(4096, 4096, 4096, 4096, tree_root,
97745 fs_info, BTRFS_ROOT_TREE_OBJECTID);
97746 @@ -1727,8 +1627,6 @@
97747 * low idle thresh
97748 */
97749 fs_info->endio_workers.idle_thresh = 4;
97750 - fs_info->endio_meta_workers.idle_thresh = 4;
97751 -
97752 fs_info->endio_write_workers.idle_thresh = 64;
97753 fs_info->endio_meta_write_workers.idle_thresh = 64;
97754
97755 @@ -1822,6 +1720,7 @@
97756 ret = find_and_setup_root(tree_root, fs_info,
97757 BTRFS_DEV_TREE_OBJECTID, dev_root);
97758 dev_root->track_dirty = 1;
97759 +
97760 if (ret)
97761 goto fail_extent_root;
97762
97763 @@ -1841,13 +1740,13 @@
97764 fs_info->system_alloc_profile = fs_info->metadata_alloc_profile;
97765 fs_info->cleaner_kthread = kthread_run(cleaner_kthread, tree_root,
97766 "btrfs-cleaner");
97767 - if (IS_ERR(fs_info->cleaner_kthread))
97768 + if (!fs_info->cleaner_kthread)
97769 goto fail_csum_root;
97770
97771 fs_info->transaction_kthread = kthread_run(transaction_kthread,
97772 tree_root,
97773 "btrfs-transaction");
97774 - if (IS_ERR(fs_info->transaction_kthread))
97775 + if (!fs_info->transaction_kthread)
97776 goto fail_cleaner;
97777
97778 if (btrfs_super_log_root(disk_super) != 0) {
97779 @@ -1929,14 +1828,13 @@
97780 fail_iput:
97781 invalidate_inode_pages2(fs_info->btree_inode->i_mapping);
97782 iput(fs_info->btree_inode);
97783 -
97784 +fail:
97785 btrfs_close_devices(fs_info->fs_devices);
97786 btrfs_mapping_tree_free(&fs_info->mapping_tree);
97787 - bdi_destroy(&fs_info->bdi);
97788
97789 -fail:
97790 kfree(extent_root);
97791 kfree(tree_root);
97792 + bdi_destroy(&fs_info->bdi);
97793 kfree(fs_info);
97794 kfree(chunk_root);
97795 kfree(dev_root);
97796 @@ -2097,6 +1995,7 @@
97797
97798 int write_all_supers(struct btrfs_root *root, int max_mirrors)
97799 {
97800 + struct list_head *cur;
97801 struct list_head *head = &root->fs_info->fs_devices->devices;
97802 struct btrfs_device *dev;
97803 struct btrfs_super_block *sb;
97804 @@ -2112,7 +2011,8 @@
97805
97806 sb = &root->fs_info->super_for_commit;
97807 dev_item = &sb->dev_item;
97808 - list_for_each_entry(dev, head, dev_list) {
97809 + list_for_each(cur, head) {
97810 + dev = list_entry(cur, struct btrfs_device, dev_list);
97811 if (!dev->bdev) {
97812 total_errors++;
97813 continue;
97814 @@ -2145,7 +2045,8 @@
97815 }
97816
97817 total_errors = 0;
97818 - list_for_each_entry(dev, head, dev_list) {
97819 + list_for_each(cur, head) {
97820 + dev = list_entry(cur, struct btrfs_device, dev_list);
97821 if (!dev->bdev)
97822 continue;
97823 if (!dev->in_fs_metadata || !dev->writeable)
97824 @@ -2359,9 +2260,7 @@
97825 u64 transid = btrfs_header_generation(buf);
97826 struct inode *btree_inode = root->fs_info->btree_inode;
97827
97828 - btrfs_set_lock_blocking(buf);
97829 -
97830 - btrfs_assert_tree_locked(buf);
97831 + WARN_ON(!btrfs_tree_locked(buf));
97832 if (transid != root->fs_info->generation) {
97833 printk(KERN_CRIT "btrfs transid mismatch buffer %llu, "
97834 "found %llu running %llu\n",
97835 @@ -2403,13 +2302,14 @@
97836 int ret;
97837 ret = btree_read_extent_buffer_pages(root, buf, 0, parent_transid);
97838 if (ret == 0)
97839 - set_bit(EXTENT_BUFFER_UPTODATE, &buf->bflags);
97840 + buf->flags |= EXTENT_UPTODATE;
97841 return ret;
97842 }
97843
97844 int btree_lock_page_hook(struct page *page)
97845 {
97846 struct inode *inode = page->mapping->host;
97847 + struct btrfs_root *root = BTRFS_I(inode)->root;
97848 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree;
97849 struct extent_buffer *eb;
97850 unsigned long len;
97851 @@ -2424,7 +2324,9 @@
97852 goto out;
97853
97854 btrfs_tree_lock(eb);
97855 + spin_lock(&root->fs_info->hash_lock);
97856 btrfs_set_header_flag(eb, BTRFS_HEADER_FLAG_WRITTEN);
97857 + spin_unlock(&root->fs_info->hash_lock);
97858 btrfs_tree_unlock(eb);
97859 free_extent_buffer(eb);
97860 out:
97861 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/btrfs/disk-io.h linux-2.6.29-rc3.owrt/fs/btrfs/disk-io.h
97862 --- linux-2.6.29.owrt/fs/btrfs/disk-io.h 2009-05-10 22:04:39.000000000 +0200
97863 +++ linux-2.6.29-rc3.owrt/fs/btrfs/disk-io.h 2009-05-10 23:48:29.000000000 +0200
97864 @@ -98,17 +98,5 @@
97865 struct btrfs_fs_info *fs_info);
97866 int btrfs_init_log_root_tree(struct btrfs_trans_handle *trans,
97867 struct btrfs_fs_info *fs_info);
97868 -int btrfs_add_log_tree(struct btrfs_trans_handle *trans,
97869 - struct btrfs_root *root);
97870 int btree_lock_page_hook(struct page *page);
97871 -
97872 -
97873 -#ifdef CONFIG_DEBUG_LOCK_ALLOC
97874 -void btrfs_set_buffer_lockdep_class(struct extent_buffer *eb, int level);
97875 -#else
97876 -static inline void btrfs_set_buffer_lockdep_class(struct extent_buffer *eb,
97877 - int level)
97878 -{
97879 -}
97880 -#endif
97881 #endif
97882 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/btrfs/extent_io.c linux-2.6.29-rc3.owrt/fs/btrfs/extent_io.c
97883 --- linux-2.6.29.owrt/fs/btrfs/extent_io.c 2009-05-10 22:04:39.000000000 +0200
97884 +++ linux-2.6.29-rc3.owrt/fs/btrfs/extent_io.c 2009-05-10 23:48:29.000000000 +0200
97885 @@ -9,6 +9,7 @@
97886 #include <linux/spinlock.h>
97887 #include <linux/blkdev.h>
97888 #include <linux/swap.h>
97889 +#include <linux/version.h>
97890 #include <linux/writeback.h>
97891 #include <linux/pagevec.h>
97892 #include "extent_io.h"
97893 @@ -30,7 +31,7 @@
97894 static LIST_HEAD(states);
97895
97896 #define LEAK_DEBUG 0
97897 -#if LEAK_DEBUG
97898 +#ifdef LEAK_DEBUG
97899 static DEFINE_SPINLOCK(leak_lock);
97900 #endif
97901
97902 @@ -119,7 +120,7 @@
97903 static struct extent_state *alloc_extent_state(gfp_t mask)
97904 {
97905 struct extent_state *state;
97906 -#if LEAK_DEBUG
97907 +#ifdef LEAK_DEBUG
97908 unsigned long flags;
97909 #endif
97910
97911 @@ -129,7 +130,7 @@
97912 state->state = 0;
97913 state->private = 0;
97914 state->tree = NULL;
97915 -#if LEAK_DEBUG
97916 +#ifdef LEAK_DEBUG
97917 spin_lock_irqsave(&leak_lock, flags);
97918 list_add(&state->leak_list, &states);
97919 spin_unlock_irqrestore(&leak_lock, flags);
97920 @@ -144,11 +145,11 @@
97921 if (!state)
97922 return;
97923 if (atomic_dec_and_test(&state->refs)) {
97924 -#if LEAK_DEBUG
97925 +#ifdef LEAK_DEBUG
97926 unsigned long flags;
97927 #endif
97928 WARN_ON(state->tree);
97929 -#if LEAK_DEBUG
97930 +#ifdef LEAK_DEBUG
97931 spin_lock_irqsave(&leak_lock, flags);
97932 list_del(&state->leak_list);
97933 spin_unlock_irqrestore(&leak_lock, flags);
97934 @@ -415,6 +416,8 @@
97935
97936 node = tree_insert(&tree->state, prealloc->end, &prealloc->rb_node);
97937 if (node) {
97938 + struct extent_state *found;
97939 + found = rb_entry(node, struct extent_state, rb_node);
97940 free_extent_state(prealloc);
97941 return -EEXIST;
97942 }
97943 @@ -2375,6 +2378,11 @@
97944 int scanned = 0;
97945 int range_whole = 0;
97946
97947 + if (wbc->nonblocking && bdi_write_congested(bdi)) {
97948 + wbc->encountered_congestion = 1;
97949 + return 0;
97950 + }
97951 +
97952 pagevec_init(&pvec, 0);
97953 if (wbc->range_cyclic) {
97954 index = mapping->writeback_index; /* Start from prev offset */
97955 @@ -2847,98 +2855,6 @@
97956 return sector;
97957 }
97958
97959 -int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
97960 - __u64 start, __u64 len, get_extent_t *get_extent)
97961 -{
97962 - int ret;
97963 - u64 off = start;
97964 - u64 max = start + len;
97965 - u32 flags = 0;
97966 - u64 disko = 0;
97967 - struct extent_map *em = NULL;
97968 - int end = 0;
97969 - u64 em_start = 0, em_len = 0;
97970 - unsigned long emflags;
97971 - ret = 0;
97972 -
97973 - if (len == 0)
97974 - return -EINVAL;
97975 -
97976 - lock_extent(&BTRFS_I(inode)->io_tree, start, start + len,
97977 - GFP_NOFS);
97978 - em = get_extent(inode, NULL, 0, off, max - off, 0);
97979 - if (!em)
97980 - goto out;
97981 - if (IS_ERR(em)) {
97982 - ret = PTR_ERR(em);
97983 - goto out;
97984 - }
97985 - while (!end) {
97986 - off = em->start + em->len;
97987 - if (off >= max)
97988 - end = 1;
97989 -
97990 - em_start = em->start;
97991 - em_len = em->len;
97992 -
97993 - disko = 0;
97994 - flags = 0;
97995 -
97996 - switch (em->block_start) {
97997 - case EXTENT_MAP_LAST_BYTE:
97998 - end = 1;
97999 - flags |= FIEMAP_EXTENT_LAST;
98000 - break;
98001 - case EXTENT_MAP_HOLE:
98002 - flags |= FIEMAP_EXTENT_UNWRITTEN;
98003 - break;
98004 - case EXTENT_MAP_INLINE:
98005 - flags |= (FIEMAP_EXTENT_DATA_INLINE |
98006 - FIEMAP_EXTENT_NOT_ALIGNED);
98007 - break;
98008 - case EXTENT_MAP_DELALLOC:
98009 - flags |= (FIEMAP_EXTENT_DELALLOC |
98010 - FIEMAP_EXTENT_UNKNOWN);
98011 - break;
98012 - default:
98013 - disko = em->block_start;
98014 - break;
98015 - }
98016 - if (test_bit(EXTENT_FLAG_COMPRESSED, &em->flags))
98017 - flags |= FIEMAP_EXTENT_ENCODED;
98018 -
98019 - emflags = em->flags;
98020 - free_extent_map(em);
98021 - em = NULL;
98022 -
98023 - if (!end) {
98024 - em = get_extent(inode, NULL, 0, off, max - off, 0);
98025 - if (!em)
98026 - goto out;
98027 - if (IS_ERR(em)) {
98028 - ret = PTR_ERR(em);
98029 - goto out;
98030 - }
98031 - emflags = em->flags;
98032 - }
98033 - if (test_bit(EXTENT_FLAG_VACANCY, &emflags)) {
98034 - flags |= FIEMAP_EXTENT_LAST;
98035 - end = 1;
98036 - }
98037 -
98038 - ret = fiemap_fill_next_extent(fieinfo, em_start, disko,
98039 - em_len, flags);
98040 - if (ret)
98041 - goto out_free;
98042 - }
98043 -out_free:
98044 - free_extent_map(em);
98045 -out:
98046 - unlock_extent(&BTRFS_I(inode)->io_tree, start, start + len,
98047 - GFP_NOFS);
98048 - return ret;
98049 -}
98050 -
98051 static inline struct page *extent_buffer_page(struct extent_buffer *eb,
98052 unsigned long i)
98053 {
98054 @@ -2976,17 +2892,15 @@
98055 gfp_t mask)
98056 {
98057 struct extent_buffer *eb = NULL;
98058 -#if LEAK_DEBUG
98059 +#ifdef LEAK_DEBUG
98060 unsigned long flags;
98061 #endif
98062
98063 eb = kmem_cache_zalloc(extent_buffer_cache, mask);
98064 eb->start = start;
98065 eb->len = len;
98066 - spin_lock_init(&eb->lock);
98067 - init_waitqueue_head(&eb->lock_wq);
98068 -
98069 -#if LEAK_DEBUG
98070 + mutex_init(&eb->mutex);
98071 +#ifdef LEAK_DEBUG
98072 spin_lock_irqsave(&leak_lock, flags);
98073 list_add(&eb->leak_list, &buffers);
98074 spin_unlock_irqrestore(&leak_lock, flags);
98075 @@ -2998,7 +2912,7 @@
98076
98077 static void __free_extent_buffer(struct extent_buffer *eb)
98078 {
98079 -#if LEAK_DEBUG
98080 +#ifdef LEAK_DEBUG
98081 unsigned long flags;
98082 spin_lock_irqsave(&leak_lock, flags);
98083 list_del(&eb->leak_list);
98084 @@ -3066,7 +2980,8 @@
98085 unlock_page(p);
98086 }
98087 if (uptodate)
98088 - set_bit(EXTENT_BUFFER_UPTODATE, &eb->bflags);
98089 + eb->flags |= EXTENT_UPTODATE;
98090 + eb->flags |= EXTENT_BUFFER_FILLED;
98091
98092 spin_lock(&tree->buffer_lock);
98093 exists = buffer_tree_insert(tree, start, &eb->rb_node);
98094 @@ -3220,7 +3135,7 @@
98095 unsigned long num_pages;
98096
98097 num_pages = num_extent_pages(eb->start, eb->len);
98098 - clear_bit(EXTENT_BUFFER_UPTODATE, &eb->bflags);
98099 + eb->flags &= ~EXTENT_UPTODATE;
98100
98101 clear_extent_uptodate(tree, eb->start, eb->start + eb->len - 1,
98102 GFP_NOFS);
98103 @@ -3291,7 +3206,7 @@
98104 struct page *page;
98105 int pg_uptodate = 1;
98106
98107 - if (test_bit(EXTENT_BUFFER_UPTODATE, &eb->bflags))
98108 + if (eb->flags & EXTENT_UPTODATE)
98109 return 1;
98110
98111 ret = test_range_bit(tree, eb->start, eb->start + eb->len - 1,
98112 @@ -3327,7 +3242,7 @@
98113 struct bio *bio = NULL;
98114 unsigned long bio_flags = 0;
98115
98116 - if (test_bit(EXTENT_BUFFER_UPTODATE, &eb->bflags))
98117 + if (eb->flags & EXTENT_UPTODATE)
98118 return 0;
98119
98120 if (test_range_bit(tree, eb->start, eb->start + eb->len - 1,
98121 @@ -3358,7 +3273,7 @@
98122 }
98123 if (all_uptodate) {
98124 if (start_i == 0)
98125 - set_bit(EXTENT_BUFFER_UPTODATE, &eb->bflags);
98126 + eb->flags |= EXTENT_UPTODATE;
98127 goto unlock_exit;
98128 }
98129
98130 @@ -3394,7 +3309,7 @@
98131 }
98132
98133 if (!ret)
98134 - set_bit(EXTENT_BUFFER_UPTODATE, &eb->bflags);
98135 + eb->flags |= EXTENT_UPTODATE;
98136 return ret;
98137
98138 unlock_exit:
98139 @@ -3491,6 +3406,7 @@
98140 unmap_extent_buffer(eb, eb->map_token, km);
98141 eb->map_token = NULL;
98142 save = 1;
98143 + WARN_ON(!mutex_is_locked(&eb->mutex));
98144 }
98145 err = map_private_extent_buffer(eb, start, min_len, token, map,
98146 map_start, map_len, km);
98147 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/btrfs/extent_io.h linux-2.6.29-rc3.owrt/fs/btrfs/extent_io.h
98148 --- linux-2.6.29.owrt/fs/btrfs/extent_io.h 2009-05-10 22:04:39.000000000 +0200
98149 +++ linux-2.6.29-rc3.owrt/fs/btrfs/extent_io.h 2009-05-10 23:48:29.000000000 +0200
98150 @@ -22,10 +22,6 @@
98151 /* flags for bio submission */
98152 #define EXTENT_BIO_COMPRESSED 1
98153
98154 -/* these are bit numbers for test/set bit */
98155 -#define EXTENT_BUFFER_UPTODATE 0
98156 -#define EXTENT_BUFFER_BLOCKING 1
98157 -
98158 /*
98159 * page->private values. Every page that is controlled by the extent
98160 * map has page->private set to one.
98161 @@ -99,19 +95,11 @@
98162 unsigned long map_start;
98163 unsigned long map_len;
98164 struct page *first_page;
98165 - unsigned long bflags;
98166 atomic_t refs;
98167 + int flags;
98168 struct list_head leak_list;
98169 struct rb_node rb_node;
98170 -
98171 - /* the spinlock is used to protect most operations */
98172 - spinlock_t lock;
98173 -
98174 - /*
98175 - * when we keep the lock held while blocking, waiters go onto
98176 - * the wq
98177 - */
98178 - wait_queue_head_t lock_wq;
98179 + struct mutex mutex;
98180 };
98181
98182 struct extent_map_tree;
98183 @@ -205,8 +193,6 @@
98184 unsigned from, unsigned to);
98185 sector_t extent_bmap(struct address_space *mapping, sector_t iblock,
98186 get_extent_t *get_extent);
98187 -int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
98188 - __u64 start, __u64 len, get_extent_t *get_extent);
98189 int set_range_dirty(struct extent_io_tree *tree, u64 start, u64 end);
98190 int set_state_private(struct extent_io_tree *tree, u64 start, u64 private);
98191 int get_state_private(struct extent_io_tree *tree, u64 start, u64 *private);
98192 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/btrfs/extent_map.c linux-2.6.29-rc3.owrt/fs/btrfs/extent_map.c
98193 --- linux-2.6.29.owrt/fs/btrfs/extent_map.c 2009-05-10 22:04:39.000000000 +0200
98194 +++ linux-2.6.29-rc3.owrt/fs/btrfs/extent_map.c 2009-05-10 23:48:29.000000000 +0200
98195 @@ -3,6 +3,7 @@
98196 #include <linux/slab.h>
98197 #include <linux/module.h>
98198 #include <linux/spinlock.h>
98199 +#include <linux/version.h>
98200 #include <linux/hardirq.h>
98201 #include "extent_map.h"
98202
98203 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/btrfs/extent-tree.c linux-2.6.29-rc3.owrt/fs/btrfs/extent-tree.c
98204 --- linux-2.6.29.owrt/fs/btrfs/extent-tree.c 2009-05-10 22:04:39.000000000 +0200
98205 +++ linux-2.6.29-rc3.owrt/fs/btrfs/extent-tree.c 2009-05-10 23:48:29.000000000 +0200
98206 @@ -19,8 +19,7 @@
98207 #include <linux/pagemap.h>
98208 #include <linux/writeback.h>
98209 #include <linux/blkdev.h>
98210 -#include <linux/sort.h>
98211 -#include <linux/rcupdate.h>
98212 +#include <linux/version.h>
98213 #include "compat.h"
98214 #include "hash.h"
98215 #include "crc32c.h"
98216 @@ -31,6 +30,7 @@
98217 #include "volumes.h"
98218 #include "locking.h"
98219 #include "ref-cache.h"
98220 +#include "compat.h"
98221
98222 #define PENDING_EXTENT_INSERT 0
98223 #define PENDING_EXTENT_DELETE 1
98224 @@ -61,10 +61,6 @@
98225 u64 bytenr, u64 num_bytes, int alloc,
98226 int mark_free);
98227
98228 -static int do_chunk_alloc(struct btrfs_trans_handle *trans,
98229 - struct btrfs_root *extent_root, u64 alloc_bytes,
98230 - u64 flags, int force);
98231 -
98232 static int block_group_bits(struct btrfs_block_group_cache *cache, u64 bits)
98233 {
98234 return (cache->flags & bits) == bits;
98235 @@ -330,34 +326,16 @@
98236 u64 flags)
98237 {
98238 struct list_head *head = &info->space_info;
98239 + struct list_head *cur;
98240 struct btrfs_space_info *found;
98241 -
98242 - rcu_read_lock();
98243 - list_for_each_entry_rcu(found, head, list) {
98244 - if (found->flags == flags) {
98245 - rcu_read_unlock();
98246 + list_for_each(cur, head) {
98247 + found = list_entry(cur, struct btrfs_space_info, list);
98248 + if (found->flags == flags)
98249 return found;
98250 - }
98251 }
98252 - rcu_read_unlock();
98253 return NULL;
98254 }
98255
98256 -/*
98257 - * after adding space to the filesystem, we need to clear the full flags
98258 - * on all the space infos.
98259 - */
98260 -void btrfs_clear_space_info_full(struct btrfs_fs_info *info)
98261 -{
98262 - struct list_head *head = &info->space_info;
98263 - struct btrfs_space_info *found;
98264 -
98265 - rcu_read_lock();
98266 - list_for_each_entry_rcu(found, head, list)
98267 - found->full = 0;
98268 - rcu_read_unlock();
98269 -}
98270 -
98271 static u64 div_factor(u64 num, int factor)
98272 {
98273 if (factor == 10)
98274 @@ -1348,25 +1326,8 @@
98275 int btrfs_extent_post_op(struct btrfs_trans_handle *trans,
98276 struct btrfs_root *root)
98277 {
98278 - u64 start;
98279 - u64 end;
98280 - int ret;
98281 -
98282 - while(1) {
98283 - finish_current_insert(trans, root->fs_info->extent_root, 1);
98284 - del_pending_extents(trans, root->fs_info->extent_root, 1);
98285 -
98286 - /* is there more work to do? */
98287 - ret = find_first_extent_bit(&root->fs_info->pending_del,
98288 - 0, &start, &end, EXTENT_WRITEBACK);
98289 - if (!ret)
98290 - continue;
98291 - ret = find_first_extent_bit(&root->fs_info->extent_ins,
98292 - 0, &start, &end, EXTENT_WRITEBACK);
98293 - if (!ret)
98294 - continue;
98295 - break;
98296 - }
98297 + finish_current_insert(trans, root->fs_info->extent_root, 1);
98298 + del_pending_extents(trans, root->fs_info->extent_root, 1);
98299 return 0;
98300 }
98301
98302 @@ -1564,55 +1525,15 @@
98303 return ret;
98304 }
98305
98306 -/* when a block goes through cow, we update the reference counts of
98307 - * everything that block points to. The internal pointers of the block
98308 - * can be in just about any order, and it is likely to have clusters of
98309 - * things that are close together and clusters of things that are not.
98310 - *
98311 - * To help reduce the seeks that come with updating all of these reference
98312 - * counts, sort them by byte number before actual updates are done.
98313 - *
98314 - * struct refsort is used to match byte number to slot in the btree block.
98315 - * we sort based on the byte number and then use the slot to actually
98316 - * find the item.
98317 - *
98318 - * struct refsort is smaller than strcut btrfs_item and smaller than
98319 - * struct btrfs_key_ptr. Since we're currently limited to the page size
98320 - * for a btree block, there's no way for a kmalloc of refsorts for a
98321 - * single node to be bigger than a page.
98322 - */
98323 -struct refsort {
98324 - u64 bytenr;
98325 - u32 slot;
98326 -};
98327 -
98328 -/*
98329 - * for passing into sort()
98330 - */
98331 -static int refsort_cmp(const void *a_void, const void *b_void)
98332 -{
98333 - const struct refsort *a = a_void;
98334 - const struct refsort *b = b_void;
98335 -
98336 - if (a->bytenr < b->bytenr)
98337 - return -1;
98338 - if (a->bytenr > b->bytenr)
98339 - return 1;
98340 - return 0;
98341 -}
98342 -
98343 -
98344 -noinline int btrfs_inc_ref(struct btrfs_trans_handle *trans,
98345 - struct btrfs_root *root,
98346 - struct extent_buffer *orig_buf,
98347 - struct extent_buffer *buf, u32 *nr_extents)
98348 +int btrfs_inc_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root,
98349 + struct extent_buffer *orig_buf, struct extent_buffer *buf,
98350 + u32 *nr_extents)
98351 {
98352 u64 bytenr;
98353 u64 ref_root;
98354 u64 orig_root;
98355 u64 ref_generation;
98356 u64 orig_generation;
98357 - struct refsort *sorted;
98358 u32 nritems;
98359 u32 nr_file_extents = 0;
98360 struct btrfs_key key;
98361 @@ -1621,8 +1542,6 @@
98362 int level;
98363 int ret = 0;
98364 int faili = 0;
98365 - int refi = 0;
98366 - int slot;
98367 int (*process_func)(struct btrfs_trans_handle *, struct btrfs_root *,
98368 u64, u64, u64, u64, u64, u64, u64, u64);
98369
98370 @@ -1634,9 +1553,6 @@
98371 nritems = btrfs_header_nritems(buf);
98372 level = btrfs_header_level(buf);
98373
98374 - sorted = kmalloc(sizeof(struct refsort) * nritems, GFP_NOFS);
98375 - BUG_ON(!sorted);
98376 -
98377 if (root->ref_cows) {
98378 process_func = __btrfs_inc_extent_ref;
98379 } else {
98380 @@ -1649,11 +1565,6 @@
98381 process_func = __btrfs_update_extent_ref;
98382 }
98383
98384 - /*
98385 - * we make two passes through the items. In the first pass we
98386 - * only record the byte number and slot. Then we sort based on
98387 - * byte number and do the actual work based on the sorted results
98388 - */
98389 for (i = 0; i < nritems; i++) {
98390 cond_resched();
98391 if (level == 0) {
98392 @@ -1670,32 +1581,6 @@
98393 continue;
98394
98395 nr_file_extents++;
98396 - sorted[refi].bytenr = bytenr;
98397 - sorted[refi].slot = i;
98398 - refi++;
98399 - } else {
98400 - bytenr = btrfs_node_blockptr(buf, i);
98401 - sorted[refi].bytenr = bytenr;
98402 - sorted[refi].slot = i;
98403 - refi++;
98404 - }
98405 - }
98406 - /*
98407 - * if refi == 0, we didn't actually put anything into the sorted
98408 - * array and we're done
98409 - */
98410 - if (refi == 0)
98411 - goto out;
98412 -
98413 - sort(sorted, refi, sizeof(struct refsort), refsort_cmp, NULL);
98414 -
98415 - for (i = 0; i < refi; i++) {
98416 - cond_resched();
98417 - slot = sorted[i].slot;
98418 - bytenr = sorted[i].bytenr;
98419 -
98420 - if (level == 0) {
98421 - btrfs_item_key_to_cpu(buf, &key, slot);
98422
98423 ret = process_func(trans, root, bytenr,
98424 orig_buf->start, buf->start,
98425 @@ -1704,25 +1589,25 @@
98426 key.objectid);
98427
98428 if (ret) {
98429 - faili = slot;
98430 + faili = i;
98431 WARN_ON(1);
98432 goto fail;
98433 }
98434 } else {
98435 + bytenr = btrfs_node_blockptr(buf, i);
98436 ret = process_func(trans, root, bytenr,
98437 orig_buf->start, buf->start,
98438 orig_root, ref_root,
98439 orig_generation, ref_generation,
98440 level - 1);
98441 if (ret) {
98442 - faili = slot;
98443 + faili = i;
98444 WARN_ON(1);
98445 goto fail;
98446 }
98447 }
98448 }
98449 out:
98450 - kfree(sorted);
98451 if (nr_extents) {
98452 if (level == 0)
98453 *nr_extents = nr_file_extents;
98454 @@ -1731,7 +1616,6 @@
98455 }
98456 return 0;
98457 fail:
98458 - kfree(sorted);
98459 WARN_ON(1);
98460 return ret;
98461 }
98462 @@ -1924,6 +1808,7 @@
98463 if (!found)
98464 return -ENOMEM;
98465
98466 + list_add(&found->list, &info->space_info);
98467 INIT_LIST_HEAD(&found->block_groups);
98468 init_rwsem(&found->groups_sem);
98469 spin_lock_init(&found->lock);
98470 @@ -1933,11 +1818,9 @@
98471 found->bytes_pinned = 0;
98472 found->bytes_reserved = 0;
98473 found->bytes_readonly = 0;
98474 - found->bytes_delalloc = 0;
98475 found->full = 0;
98476 found->force_alloc = 0;
98477 *space_info = found;
98478 - list_add_rcu(&found->list, &info->space_info);
98479 return 0;
98480 }
98481
98482 @@ -1998,233 +1881,6 @@
98483 return flags;
98484 }
98485
98486 -static u64 btrfs_get_alloc_profile(struct btrfs_root *root, u64 data)
98487 -{
98488 - struct btrfs_fs_info *info = root->fs_info;
98489 - u64 alloc_profile;
98490 -
98491 - if (data) {
98492 - alloc_profile = info->avail_data_alloc_bits &
98493 - info->data_alloc_profile;
98494 - data = BTRFS_BLOCK_GROUP_DATA | alloc_profile;
98495 - } else if (root == root->fs_info->chunk_root) {
98496 - alloc_profile = info->avail_system_alloc_bits &
98497 - info->system_alloc_profile;
98498 - data = BTRFS_BLOCK_GROUP_SYSTEM | alloc_profile;
98499 - } else {
98500 - alloc_profile = info->avail_metadata_alloc_bits &
98501 - info->metadata_alloc_profile;
98502 - data = BTRFS_BLOCK_GROUP_METADATA | alloc_profile;
98503 - }
98504 -
98505 - return btrfs_reduce_alloc_profile(root, data);
98506 -}
98507 -
98508 -void btrfs_set_inode_space_info(struct btrfs_root *root, struct inode *inode)
98509 -{
98510 - u64 alloc_target;
98511 -
98512 - alloc_target = btrfs_get_alloc_profile(root, 1);
98513 - BTRFS_I(inode)->space_info = __find_space_info(root->fs_info,
98514 - alloc_target);
98515 -}
98516 -
98517 -/*
98518 - * for now this just makes sure we have at least 5% of our metadata space free
98519 - * for use.
98520 - */
98521 -int btrfs_check_metadata_free_space(struct btrfs_root *root)
98522 -{
98523 - struct btrfs_fs_info *info = root->fs_info;
98524 - struct btrfs_space_info *meta_sinfo;
98525 - u64 alloc_target, thresh;
98526 - int committed = 0, ret;
98527 -
98528 - /* get the space info for where the metadata will live */
98529 - alloc_target = btrfs_get_alloc_profile(root, 0);
98530 - meta_sinfo = __find_space_info(info, alloc_target);
98531 -
98532 -again:
98533 - spin_lock(&meta_sinfo->lock);
98534 - if (!meta_sinfo->full)
98535 - thresh = meta_sinfo->total_bytes * 80;
98536 - else
98537 - thresh = meta_sinfo->total_bytes * 95;
98538 -
98539 - do_div(thresh, 100);
98540 -
98541 - if (meta_sinfo->bytes_used + meta_sinfo->bytes_reserved +
98542 - meta_sinfo->bytes_pinned + meta_sinfo->bytes_readonly > thresh) {
98543 - struct btrfs_trans_handle *trans;
98544 - if (!meta_sinfo->full) {
98545 - meta_sinfo->force_alloc = 1;
98546 - spin_unlock(&meta_sinfo->lock);
98547 -
98548 - trans = btrfs_start_transaction(root, 1);
98549 - if (!trans)
98550 - return -ENOMEM;
98551 -
98552 - ret = do_chunk_alloc(trans, root->fs_info->extent_root,
98553 - 2 * 1024 * 1024, alloc_target, 0);
98554 - btrfs_end_transaction(trans, root);
98555 - goto again;
98556 - }
98557 - spin_unlock(&meta_sinfo->lock);
98558 -
98559 - if (!committed) {
98560 - committed = 1;
98561 - trans = btrfs_join_transaction(root, 1);
98562 - if (!trans)
98563 - return -ENOMEM;
98564 - ret = btrfs_commit_transaction(trans, root);
98565 - if (ret)
98566 - return ret;
98567 - goto again;
98568 - }
98569 - return -ENOSPC;
98570 - }
98571 - spin_unlock(&meta_sinfo->lock);
98572 -
98573 - return 0;
98574 -}
98575 -
98576 -/*
98577 - * This will check the space that the inode allocates from to make sure we have
98578 - * enough space for bytes.
98579 - */
98580 -int btrfs_check_data_free_space(struct btrfs_root *root, struct inode *inode,
98581 - u64 bytes)
98582 -{
98583 - struct btrfs_space_info *data_sinfo;
98584 - int ret = 0, committed = 0;
98585 -
98586 - /* make sure bytes are sectorsize aligned */
98587 - bytes = (bytes + root->sectorsize - 1) & ~((u64)root->sectorsize - 1);
98588 -
98589 - data_sinfo = BTRFS_I(inode)->space_info;
98590 -again:
98591 - /* make sure we have enough space to handle the data first */
98592 - spin_lock(&data_sinfo->lock);
98593 - if (data_sinfo->total_bytes - data_sinfo->bytes_used -
98594 - data_sinfo->bytes_delalloc - data_sinfo->bytes_reserved -
98595 - data_sinfo->bytes_pinned - data_sinfo->bytes_readonly -
98596 - data_sinfo->bytes_may_use < bytes) {
98597 - struct btrfs_trans_handle *trans;
98598 -
98599 - /*
98600 - * if we don't have enough free bytes in this space then we need
98601 - * to alloc a new chunk.
98602 - */
98603 - if (!data_sinfo->full) {
98604 - u64 alloc_target;
98605 -
98606 - data_sinfo->force_alloc = 1;
98607 - spin_unlock(&data_sinfo->lock);
98608 -
98609 - alloc_target = btrfs_get_alloc_profile(root, 1);
98610 - trans = btrfs_start_transaction(root, 1);
98611 - if (!trans)
98612 - return -ENOMEM;
98613 -
98614 - ret = do_chunk_alloc(trans, root->fs_info->extent_root,
98615 - bytes + 2 * 1024 * 1024,
98616 - alloc_target, 0);
98617 - btrfs_end_transaction(trans, root);
98618 - if (ret)
98619 - return ret;
98620 - goto again;
98621 - }
98622 - spin_unlock(&data_sinfo->lock);
98623 -
98624 - /* commit the current transaction and try again */
98625 - if (!committed) {
98626 - committed = 1;
98627 - trans = btrfs_join_transaction(root, 1);
98628 - if (!trans)
98629 - return -ENOMEM;
98630 - ret = btrfs_commit_transaction(trans, root);
98631 - if (ret)
98632 - return ret;
98633 - goto again;
98634 - }
98635 -
98636 - printk(KERN_ERR "no space left, need %llu, %llu delalloc bytes"
98637 - ", %llu bytes_used, %llu bytes_reserved, "
98638 - "%llu bytes_pinned, %llu bytes_readonly, %llu may use"
98639 - "%llu total\n", bytes, data_sinfo->bytes_delalloc,
98640 - data_sinfo->bytes_used, data_sinfo->bytes_reserved,
98641 - data_sinfo->bytes_pinned, data_sinfo->bytes_readonly,
98642 - data_sinfo->bytes_may_use, data_sinfo->total_bytes);
98643 - return -ENOSPC;
98644 - }
98645 - data_sinfo->bytes_may_use += bytes;
98646 - BTRFS_I(inode)->reserved_bytes += bytes;
98647 - spin_unlock(&data_sinfo->lock);
98648 -
98649 - return btrfs_check_metadata_free_space(root);
98650 -}
98651 -
98652 -/*
98653 - * if there was an error for whatever reason after calling
98654 - * btrfs_check_data_free_space, call this so we can cleanup the counters.
98655 - */
98656 -void btrfs_free_reserved_data_space(struct btrfs_root *root,
98657 - struct inode *inode, u64 bytes)
98658 -{
98659 - struct btrfs_space_info *data_sinfo;
98660 -
98661 - /* make sure bytes are sectorsize aligned */
98662 - bytes = (bytes + root->sectorsize - 1) & ~((u64)root->sectorsize - 1);
98663 -
98664 - data_sinfo = BTRFS_I(inode)->space_info;
98665 - spin_lock(&data_sinfo->lock);
98666 - data_sinfo->bytes_may_use -= bytes;
98667 - BTRFS_I(inode)->reserved_bytes -= bytes;
98668 - spin_unlock(&data_sinfo->lock);
98669 -}
98670 -
98671 -/* called when we are adding a delalloc extent to the inode's io_tree */
98672 -void btrfs_delalloc_reserve_space(struct btrfs_root *root, struct inode *inode,
98673 - u64 bytes)
98674 -{
98675 - struct btrfs_space_info *data_sinfo;
98676 -
98677 - /* get the space info for where this inode will be storing its data */
98678 - data_sinfo = BTRFS_I(inode)->space_info;
98679 -
98680 - /* make sure we have enough space to handle the data first */
98681 - spin_lock(&data_sinfo->lock);
98682 - data_sinfo->bytes_delalloc += bytes;
98683 -
98684 - /*
98685 - * we are adding a delalloc extent without calling
98686 - * btrfs_check_data_free_space first. This happens on a weird
98687 - * writepage condition, but shouldn't hurt our accounting
98688 - */
98689 - if (unlikely(bytes > BTRFS_I(inode)->reserved_bytes)) {
98690 - data_sinfo->bytes_may_use -= BTRFS_I(inode)->reserved_bytes;
98691 - BTRFS_I(inode)->reserved_bytes = 0;
98692 - } else {
98693 - data_sinfo->bytes_may_use -= bytes;
98694 - BTRFS_I(inode)->reserved_bytes -= bytes;
98695 - }
98696 -
98697 - spin_unlock(&data_sinfo->lock);
98698 -}
98699 -
98700 -/* called when we are clearing an delalloc extent from the inode's io_tree */
98701 -void btrfs_delalloc_free_space(struct btrfs_root *root, struct inode *inode,
98702 - u64 bytes)
98703 -{
98704 - struct btrfs_space_info *info;
98705 -
98706 - info = BTRFS_I(inode)->space_info;
98707 -
98708 - spin_lock(&info->lock);
98709 - info->bytes_delalloc -= bytes;
98710 - spin_unlock(&info->lock);
98711 -}
98712 -
98713 static int do_chunk_alloc(struct btrfs_trans_handle *trans,
98714 struct btrfs_root *extent_root, u64 alloc_bytes,
98715 u64 flags, int force)
98716 @@ -2481,12 +2137,13 @@
98717 u64 end;
98718 u64 priv;
98719 u64 search = 0;
98720 + u64 skipped = 0;
98721 struct btrfs_fs_info *info = extent_root->fs_info;
98722 struct btrfs_path *path;
98723 struct pending_extent_op *extent_op, *tmp;
98724 struct list_head insert_list, update_list;
98725 int ret;
98726 - int num_inserts = 0, max_inserts, restart = 0;
98727 + int num_inserts = 0, max_inserts;
98728
98729 path = btrfs_alloc_path();
98730 INIT_LIST_HEAD(&insert_list);
98731 @@ -2502,19 +2159,18 @@
98732 ret = find_first_extent_bit(&info->extent_ins, search, &start,
98733 &end, EXTENT_WRITEBACK);
98734 if (ret) {
98735 - if (restart && !num_inserts &&
98736 - list_empty(&update_list)) {
98737 - restart = 0;
98738 + if (skipped && all && !num_inserts) {
98739 + skipped = 0;
98740 search = 0;
98741 continue;
98742 }
98743 + mutex_unlock(&info->extent_ins_mutex);
98744 break;
98745 }
98746
98747 ret = try_lock_extent(&info->extent_ins, start, end, GFP_NOFS);
98748 if (!ret) {
98749 - if (all)
98750 - restart = 1;
98751 + skipped = 1;
98752 search = end + 1;
98753 if (need_resched()) {
98754 mutex_unlock(&info->extent_ins_mutex);
98755 @@ -2533,7 +2189,7 @@
98756 list_add_tail(&extent_op->list, &insert_list);
98757 search = end + 1;
98758 if (num_inserts == max_inserts) {
98759 - restart = 1;
98760 + mutex_unlock(&info->extent_ins_mutex);
98761 break;
98762 }
98763 } else if (extent_op->type == PENDING_BACKREF_UPDATE) {
98764 @@ -2549,6 +2205,7 @@
98765 * somebody marked this thing for deletion then just unlock it and be
98766 * done, the free_extents will handle it
98767 */
98768 + mutex_lock(&info->extent_ins_mutex);
98769 list_for_each_entry_safe(extent_op, tmp, &update_list, list) {
98770 clear_extent_bits(&info->extent_ins, extent_op->bytenr,
98771 extent_op->bytenr + extent_op->num_bytes - 1,
98772 @@ -2570,10 +2227,6 @@
98773 if (!list_empty(&update_list)) {
98774 ret = update_backrefs(trans, extent_root, path, &update_list);
98775 BUG_ON(ret);
98776 -
98777 - /* we may have COW'ed new blocks, so lets start over */
98778 - if (all)
98779 - restart = 1;
98780 }
98781
98782 /*
98783 @@ -2581,9 +2234,9 @@
98784 * need to make sure everything is cleaned then reset everything and
98785 * go back to the beginning
98786 */
98787 - if (!num_inserts && restart) {
98788 + if (!num_inserts && all && skipped) {
98789 search = 0;
98790 - restart = 0;
98791 + skipped = 0;
98792 INIT_LIST_HEAD(&update_list);
98793 INIT_LIST_HEAD(&insert_list);
98794 goto again;
98795 @@ -2640,19 +2293,27 @@
98796 BUG_ON(ret);
98797
98798 /*
98799 - * if restart is set for whatever reason we need to go back and start
98800 - * searching through the pending list again.
98801 - *
98802 - * We just inserted some extents, which could have resulted in new
98803 - * blocks being allocated, which would result in new blocks needing
98804 - * updates, so if all is set we _must_ restart to get the updated
98805 - * blocks.
98806 + * if we broke out of the loop in order to insert stuff because we hit
98807 + * the maximum number of inserts at a time we can handle, then loop
98808 + * back and pick up where we left off
98809 */
98810 - if (restart || all) {
98811 + if (num_inserts == max_inserts) {
98812 + INIT_LIST_HEAD(&insert_list);
98813 + INIT_LIST_HEAD(&update_list);
98814 + num_inserts = 0;
98815 + goto again;
98816 + }
98817 +
98818 + /*
98819 + * again, if we need to make absolutely sure there are no more pending
98820 + * extent operations left and we know that we skipped some, go back to
98821 + * the beginning and do it all again
98822 + */
98823 + if (all && skipped) {
98824 INIT_LIST_HEAD(&insert_list);
98825 INIT_LIST_HEAD(&update_list);
98826 search = 0;
98827 - restart = 0;
98828 + skipped = 0;
98829 num_inserts = 0;
98830 goto again;
98831 }
98832 @@ -2886,7 +2547,6 @@
98833 if (ret) {
98834 if (all && skipped && !nr) {
98835 search = 0;
98836 - skipped = 0;
98837 continue;
98838 }
98839 mutex_unlock(&info->extent_ins_mutex);
98840 @@ -2973,8 +2633,6 @@
98841 goto again;
98842 }
98843
98844 - if (!err)
98845 - finish_current_insert(trans, extent_root, 0);
98846 return err;
98847 }
98848
98849 @@ -3042,9 +2700,13 @@
98850 /* if metadata always pin */
98851 if (owner_objectid < BTRFS_FIRST_FREE_OBJECTID) {
98852 if (root->root_key.objectid == BTRFS_TREE_LOG_OBJECTID) {
98853 - mutex_lock(&root->fs_info->pinned_mutex);
98854 - btrfs_update_pinned_extents(root, bytenr, num_bytes, 1);
98855 - mutex_unlock(&root->fs_info->pinned_mutex);
98856 + struct btrfs_block_group_cache *cache;
98857 +
98858 + /* btrfs_free_reserved_extent */
98859 + cache = btrfs_lookup_block_group(root->fs_info, bytenr);
98860 + BUG_ON(!cache);
98861 + btrfs_add_free_space(cache, bytenr, num_bytes);
98862 + put_block_group(cache);
98863 update_reserved_extents(root, bytenr, num_bytes, 0);
98864 return 0;
98865 }
98866 @@ -3125,8 +2787,7 @@
98867
98868 if (data & BTRFS_BLOCK_GROUP_METADATA) {
98869 last_ptr = &root->fs_info->last_alloc;
98870 - if (!btrfs_test_opt(root, SSD))
98871 - empty_cluster = 64 * 1024;
98872 + empty_cluster = 64 * 1024;
98873 }
98874
98875 if ((data & BTRFS_BLOCK_GROUP_DATA) && btrfs_test_opt(root, SSD))
98876 @@ -3353,18 +3014,16 @@
98877 static void dump_space_info(struct btrfs_space_info *info, u64 bytes)
98878 {
98879 struct btrfs_block_group_cache *cache;
98880 + struct list_head *l;
98881
98882 printk(KERN_INFO "space_info has %llu free, is %sfull\n",
98883 (unsigned long long)(info->total_bytes - info->bytes_used -
98884 info->bytes_pinned - info->bytes_reserved),
98885 (info->full) ? "" : "not ");
98886 - printk(KERN_INFO "space_info total=%llu, pinned=%llu, delalloc=%llu,"
98887 - " may_use=%llu, used=%llu\n", info->total_bytes,
98888 - info->bytes_pinned, info->bytes_delalloc, info->bytes_may_use,
98889 - info->bytes_used);
98890
98891 down_read(&info->groups_sem);
98892 - list_for_each_entry(cache, &info->block_groups, list) {
98893 + list_for_each(l, &info->block_groups) {
98894 + cache = list_entry(l, struct btrfs_block_group_cache, list);
98895 spin_lock(&cache->lock);
98896 printk(KERN_INFO "block group %llu has %llu bytes, %llu used "
98897 "%llu pinned %llu reserved\n",
98898 @@ -3388,10 +3047,24 @@
98899 {
98900 int ret;
98901 u64 search_start = 0;
98902 + u64 alloc_profile;
98903 struct btrfs_fs_info *info = root->fs_info;
98904
98905 - data = btrfs_get_alloc_profile(root, data);
98906 + if (data) {
98907 + alloc_profile = info->avail_data_alloc_bits &
98908 + info->data_alloc_profile;
98909 + data = BTRFS_BLOCK_GROUP_DATA | alloc_profile;
98910 + } else if (root == root->fs_info->chunk_root) {
98911 + alloc_profile = info->avail_system_alloc_bits &
98912 + info->system_alloc_profile;
98913 + data = BTRFS_BLOCK_GROUP_SYSTEM | alloc_profile;
98914 + } else {
98915 + alloc_profile = info->avail_metadata_alloc_bits &
98916 + info->metadata_alloc_profile;
98917 + data = BTRFS_BLOCK_GROUP_METADATA | alloc_profile;
98918 + }
98919 again:
98920 + data = btrfs_reduce_alloc_profile(root, data);
98921 /*
98922 * the only place that sets empty_size is btrfs_realloc_node, which
98923 * is not called recursively on allocations
98924 @@ -3659,8 +3332,7 @@
98925
98926 struct extent_buffer *btrfs_init_new_buffer(struct btrfs_trans_handle *trans,
98927 struct btrfs_root *root,
98928 - u64 bytenr, u32 blocksize,
98929 - int level)
98930 + u64 bytenr, u32 blocksize)
98931 {
98932 struct extent_buffer *buf;
98933
98934 @@ -3668,13 +3340,9 @@
98935 if (!buf)
98936 return ERR_PTR(-ENOMEM);
98937 btrfs_set_header_generation(buf, trans->transid);
98938 - btrfs_set_buffer_lockdep_class(buf, level);
98939 btrfs_tree_lock(buf);
98940 clean_tree_block(trans, root, buf);
98941 -
98942 - btrfs_set_lock_blocking(buf);
98943 btrfs_set_buffer_uptodate(buf);
98944 -
98945 if (root->root_key.objectid == BTRFS_TREE_LOG_OBJECTID) {
98946 set_extent_dirty(&root->dirty_log_pages, buf->start,
98947 buf->start + buf->len - 1, GFP_NOFS);
98948 @@ -3683,7 +3351,6 @@
98949 buf->start + buf->len - 1, GFP_NOFS);
98950 }
98951 trans->blocks_used++;
98952 - /* this returns a buffer locked for blocking */
98953 return buf;
98954 }
98955
98956 @@ -3712,8 +3379,7 @@
98957 return ERR_PTR(ret);
98958 }
98959
98960 - buf = btrfs_init_new_buffer(trans, root, ins.objectid,
98961 - blocksize, level);
98962 + buf = btrfs_init_new_buffer(trans, root, ins.objectid, blocksize);
98963 return buf;
98964 }
98965
98966 @@ -3722,73 +3388,36 @@
98967 {
98968 u64 leaf_owner;
98969 u64 leaf_generation;
98970 - struct refsort *sorted;
98971 struct btrfs_key key;
98972 struct btrfs_file_extent_item *fi;
98973 int i;
98974 int nritems;
98975 int ret;
98976 - int refi = 0;
98977 - int slot;
98978
98979 BUG_ON(!btrfs_is_leaf(leaf));
98980 nritems = btrfs_header_nritems(leaf);
98981 leaf_owner = btrfs_header_owner(leaf);
98982 leaf_generation = btrfs_header_generation(leaf);
98983
98984 - sorted = kmalloc(sizeof(*sorted) * nritems, GFP_NOFS);
98985 - /* we do this loop twice. The first time we build a list
98986 - * of the extents we have a reference on, then we sort the list
98987 - * by bytenr. The second time around we actually do the
98988 - * extent freeing.
98989 - */
98990 for (i = 0; i < nritems; i++) {
98991 u64 disk_bytenr;
98992 cond_resched();
98993
98994 btrfs_item_key_to_cpu(leaf, &key, i);
98995 -
98996 - /* only extents have references, skip everything else */
98997 if (btrfs_key_type(&key) != BTRFS_EXTENT_DATA_KEY)
98998 continue;
98999 -
99000 fi = btrfs_item_ptr(leaf, i, struct btrfs_file_extent_item);
99001 -
99002 - /* inline extents live in the btree, they don't have refs */
99003 if (btrfs_file_extent_type(leaf, fi) ==
99004 BTRFS_FILE_EXTENT_INLINE)
99005 continue;
99006 -
99007 + /*
99008 + * FIXME make sure to insert a trans record that
99009 + * repeats the snapshot del on crash
99010 + */
99011 disk_bytenr = btrfs_file_extent_disk_bytenr(leaf, fi);
99012 -
99013 - /* holes don't have refs */
99014 if (disk_bytenr == 0)
99015 continue;
99016
99017 - sorted[refi].bytenr = disk_bytenr;
99018 - sorted[refi].slot = i;
99019 - refi++;
99020 - }
99021 -
99022 - if (refi == 0)
99023 - goto out;
99024 -
99025 - sort(sorted, refi, sizeof(struct refsort), refsort_cmp, NULL);
99026 -
99027 - for (i = 0; i < refi; i++) {
99028 - u64 disk_bytenr;
99029 -
99030 - disk_bytenr = sorted[i].bytenr;
99031 - slot = sorted[i].slot;
99032 -
99033 - cond_resched();
99034 -
99035 - btrfs_item_key_to_cpu(leaf, &key, slot);
99036 - if (btrfs_key_type(&key) != BTRFS_EXTENT_DATA_KEY)
99037 - continue;
99038 -
99039 - fi = btrfs_item_ptr(leaf, slot, struct btrfs_file_extent_item);
99040 -
99041 ret = __btrfs_free_extent(trans, root, disk_bytenr,
99042 btrfs_file_extent_disk_num_bytes(leaf, fi),
99043 leaf->start, leaf_owner, leaf_generation,
99044 @@ -3799,8 +3428,6 @@
99045 wake_up(&root->fs_info->transaction_throttle);
99046 cond_resched();
99047 }
99048 -out:
99049 - kfree(sorted);
99050 return 0;
99051 }
99052
99053 @@ -3810,25 +3437,9 @@
99054 {
99055 int i;
99056 int ret;
99057 - struct btrfs_extent_info *info;
99058 - struct refsort *sorted;
99059 -
99060 - if (ref->nritems == 0)
99061 - return 0;
99062 + struct btrfs_extent_info *info = ref->extents;
99063
99064 - sorted = kmalloc(sizeof(*sorted) * ref->nritems, GFP_NOFS);
99065 for (i = 0; i < ref->nritems; i++) {
99066 - sorted[i].bytenr = ref->extents[i].bytenr;
99067 - sorted[i].slot = i;
99068 - }
99069 - sort(sorted, ref->nritems, sizeof(struct refsort), refsort_cmp, NULL);
99070 -
99071 - /*
99072 - * the items in the ref were sorted when the ref was inserted
99073 - * into the ref cache, so this is already in order
99074 - */
99075 - for (i = 0; i < ref->nritems; i++) {
99076 - info = ref->extents + sorted[i].slot;
99077 ret = __btrfs_free_extent(trans, root, info->bytenr,
99078 info->num_bytes, ref->bytenr,
99079 ref->owner, ref->generation,
99080 @@ -3842,7 +3453,6 @@
99081 info++;
99082 }
99083
99084 - kfree(sorted);
99085 return 0;
99086 }
99087
99088 @@ -3887,152 +3497,6 @@
99089 }
99090
99091 /*
99092 - * this is used while deleting old snapshots, and it drops the refs
99093 - * on a whole subtree starting from a level 1 node.
99094 - *
99095 - * The idea is to sort all the leaf pointers, and then drop the
99096 - * ref on all the leaves in order. Most of the time the leaves
99097 - * will have ref cache entries, so no leaf IOs will be required to
99098 - * find the extents they have references on.
99099 - *
99100 - * For each leaf, any references it has are also dropped in order
99101 - *
99102 - * This ends up dropping the references in something close to optimal
99103 - * order for reading and modifying the extent allocation tree.
99104 - */
99105 -static noinline int drop_level_one_refs(struct btrfs_trans_handle *trans,
99106 - struct btrfs_root *root,
99107 - struct btrfs_path *path)
99108 -{
99109 - u64 bytenr;
99110 - u64 root_owner;
99111 - u64 root_gen;
99112 - struct extent_buffer *eb = path->nodes[1];
99113 - struct extent_buffer *leaf;
99114 - struct btrfs_leaf_ref *ref;
99115 - struct refsort *sorted = NULL;
99116 - int nritems = btrfs_header_nritems(eb);
99117 - int ret;
99118 - int i;
99119 - int refi = 0;
99120 - int slot = path->slots[1];
99121 - u32 blocksize = btrfs_level_size(root, 0);
99122 - u32 refs;
99123 -
99124 - if (nritems == 0)
99125 - goto out;
99126 -
99127 - root_owner = btrfs_header_owner(eb);
99128 - root_gen = btrfs_header_generation(eb);
99129 - sorted = kmalloc(sizeof(*sorted) * nritems, GFP_NOFS);
99130 -
99131 - /*
99132 - * step one, sort all the leaf pointers so we don't scribble
99133 - * randomly into the extent allocation tree
99134 - */
99135 - for (i = slot; i < nritems; i++) {
99136 - sorted[refi].bytenr = btrfs_node_blockptr(eb, i);
99137 - sorted[refi].slot = i;
99138 - refi++;
99139 - }
99140 -
99141 - /*
99142 - * nritems won't be zero, but if we're picking up drop_snapshot
99143 - * after a crash, slot might be > 0, so double check things
99144 - * just in case.
99145 - */
99146 - if (refi == 0)
99147 - goto out;
99148 -
99149 - sort(sorted, refi, sizeof(struct refsort), refsort_cmp, NULL);
99150 -
99151 - /*
99152 - * the first loop frees everything the leaves point to
99153 - */
99154 - for (i = 0; i < refi; i++) {
99155 - u64 ptr_gen;
99156 -
99157 - bytenr = sorted[i].bytenr;
99158 -
99159 - /*
99160 - * check the reference count on this leaf. If it is > 1
99161 - * we just decrement it below and don't update any
99162 - * of the refs the leaf points to.
99163 - */
99164 - ret = drop_snap_lookup_refcount(root, bytenr, blocksize, &refs);
99165 - BUG_ON(ret);
99166 - if (refs != 1)
99167 - continue;
99168 -
99169 - ptr_gen = btrfs_node_ptr_generation(eb, sorted[i].slot);
99170 -
99171 - /*
99172 - * the leaf only had one reference, which means the
99173 - * only thing pointing to this leaf is the snapshot
99174 - * we're deleting. It isn't possible for the reference
99175 - * count to increase again later
99176 - *
99177 - * The reference cache is checked for the leaf,
99178 - * and if found we'll be able to drop any refs held by
99179 - * the leaf without needing to read it in.
99180 - */
99181 - ref = btrfs_lookup_leaf_ref(root, bytenr);
99182 - if (ref && ref->generation != ptr_gen) {
99183 - btrfs_free_leaf_ref(root, ref);
99184 - ref = NULL;
99185 - }
99186 - if (ref) {
99187 - ret = cache_drop_leaf_ref(trans, root, ref);
99188 - BUG_ON(ret);
99189 - btrfs_remove_leaf_ref(root, ref);
99190 - btrfs_free_leaf_ref(root, ref);
99191 - } else {
99192 - /*
99193 - * the leaf wasn't in the reference cache, so
99194 - * we have to read it.
99195 - */
99196 - leaf = read_tree_block(root, bytenr, blocksize,
99197 - ptr_gen);
99198 - ret = btrfs_drop_leaf_ref(trans, root, leaf);
99199 - BUG_ON(ret);
99200 - free_extent_buffer(leaf);
99201 - }
99202 - atomic_inc(&root->fs_info->throttle_gen);
99203 - wake_up(&root->fs_info->transaction_throttle);
99204 - cond_resched();
99205 - }
99206 -
99207 - /*
99208 - * run through the loop again to free the refs on the leaves.
99209 - * This is faster than doing it in the loop above because
99210 - * the leaves are likely to be clustered together. We end up
99211 - * working in nice chunks on the extent allocation tree.
99212 - */
99213 - for (i = 0; i < refi; i++) {
99214 - bytenr = sorted[i].bytenr;
99215 - ret = __btrfs_free_extent(trans, root, bytenr,
99216 - blocksize, eb->start,
99217 - root_owner, root_gen, 0, 1);
99218 - BUG_ON(ret);
99219 -
99220 - atomic_inc(&root->fs_info->throttle_gen);
99221 - wake_up(&root->fs_info->transaction_throttle);
99222 - cond_resched();
99223 - }
99224 -out:
99225 - kfree(sorted);
99226 -
99227 - /*
99228 - * update the path to show we've processed the entire level 1
99229 - * node. This will get saved into the root's drop_snapshot_progress
99230 - * field so these drops are not repeated again if this transaction
99231 - * commits.
99232 - */
99233 - path->slots[1] = nritems;
99234 - return 0;
99235 -}
99236 -
99237 -/*
99238 * helper function for drop_snapshot, this walks down the tree dropping ref
99239 * counts as it goes.
99240 */
99241 @@ -4047,6 +3511,7 @@
99242 struct extent_buffer *next;
99243 struct extent_buffer *cur;
99244 struct extent_buffer *parent;
99245 + struct btrfs_leaf_ref *ref;
99246 u32 blocksize;
99247 int ret;
99248 u32 refs;
99249 @@ -4073,46 +3538,17 @@
99250 if (path->slots[*level] >=
99251 btrfs_header_nritems(cur))
99252 break;
99253 -
99254 - /* the new code goes down to level 1 and does all the
99255 - * leaves pointed to that node in bulk. So, this check
99256 - * for level 0 will always be false.
99257 - *
99258 - * But, the disk format allows the drop_snapshot_progress
99259 - * field in the root to leave things in a state where
99260 - * a leaf will need cleaning up here. If someone crashes
99261 - * with the old code and then boots with the new code,
99262 - * we might find a leaf here.
99263 - */
99264 if (*level == 0) {
99265 ret = btrfs_drop_leaf_ref(trans, root, cur);
99266 BUG_ON(ret);
99267 break;
99268 }
99269 -
99270 - /*
99271 - * once we get to level one, process the whole node
99272 - * at once, including everything below it.
99273 - */
99274 - if (*level == 1) {
99275 - ret = drop_level_one_refs(trans, root, path);
99276 - BUG_ON(ret);
99277 - break;
99278 - }
99279 -
99280 bytenr = btrfs_node_blockptr(cur, path->slots[*level]);
99281 ptr_gen = btrfs_node_ptr_generation(cur, path->slots[*level]);
99282 blocksize = btrfs_level_size(root, *level - 1);
99283
99284 ret = drop_snap_lookup_refcount(root, bytenr, blocksize, &refs);
99285 BUG_ON(ret);
99286 -
99287 - /*
99288 - * if there is more than one reference, we don't need
99289 - * to read that node to drop any references it has. We
99290 - * just drop the ref we hold on that node and move on to the
99291 - * next slot in this level.
99292 - */
99293 if (refs != 1) {
99294 parent = path->nodes[*level];
99295 root_owner = btrfs_header_owner(parent);
99296 @@ -4131,12 +3567,46 @@
99297
99298 continue;
99299 }
99300 -
99301 /*
99302 - * we need to keep freeing things in the next level down.
99303 - * read the block and loop around to process it
99304 + * at this point, we have a single ref, and since the
99305 + * only place referencing this extent is a dead root
99306 + * the reference count should never go higher.
99307 + * So, we don't need to check it again
99308 */
99309 - next = read_tree_block(root, bytenr, blocksize, ptr_gen);
99310 + if (*level == 1) {
99311 + ref = btrfs_lookup_leaf_ref(root, bytenr);
99312 + if (ref && ref->generation != ptr_gen) {
99313 + btrfs_free_leaf_ref(root, ref);
99314 + ref = NULL;
99315 + }
99316 + if (ref) {
99317 + ret = cache_drop_leaf_ref(trans, root, ref);
99318 + BUG_ON(ret);
99319 + btrfs_remove_leaf_ref(root, ref);
99320 + btrfs_free_leaf_ref(root, ref);
99321 + *level = 0;
99322 + break;
99323 + }
99324 + }
99325 + next = btrfs_find_tree_block(root, bytenr, blocksize);
99326 + if (!next || !btrfs_buffer_uptodate(next, ptr_gen)) {
99327 + free_extent_buffer(next);
99328 +
99329 + next = read_tree_block(root, bytenr, blocksize,
99330 + ptr_gen);
99331 + cond_resched();
99332 +#if 0
99333 + /*
99334 + * this is a debugging check and can go away
99335 + * the ref should never go all the way down to 1
99336 + * at this point
99337 + */
99338 + ret = lookup_extent_ref(NULL, root, bytenr, blocksize,
99339 + &refs);
99340 + BUG_ON(ret);
99341 + WARN_ON(refs != 1);
99342 +#endif
99343 + }
99344 WARN_ON(*level <= 0);
99345 if (path->nodes[*level-1])
99346 free_extent_buffer(path->nodes[*level-1]);
99347 @@ -4161,16 +3631,11 @@
99348 root_owner = btrfs_header_owner(parent);
99349 root_gen = btrfs_header_generation(parent);
99350
99351 - /*
99352 - * cleanup and free the reference on the last node
99353 - * we processed
99354 - */
99355 ret = __btrfs_free_extent(trans, root, bytenr, blocksize,
99356 parent->start, root_owner, root_gen,
99357 *level, 1);
99358 free_extent_buffer(path->nodes[*level]);
99359 path->nodes[*level] = NULL;
99360 -
99361 *level += 1;
99362 BUG_ON(ret);
99363
99364 @@ -4222,7 +3687,6 @@
99365
99366 next = read_tree_block(root, bytenr, blocksize, ptr_gen);
99367 btrfs_tree_lock(next);
99368 - btrfs_set_lock_blocking(next);
99369
99370 ret = btrfs_lookup_extent_ref(trans, root, bytenr, blocksize,
99371 &refs);
99372 @@ -4290,13 +3754,6 @@
99373 if (slot < btrfs_header_nritems(path->nodes[i]) - 1) {
99374 struct extent_buffer *node;
99375 struct btrfs_disk_key disk_key;
99376 -
99377 - /*
99378 - * there is more work to do in this level.
99379 - * Update the drop_progress marker to reflect
99380 - * the work we've done so far, and then bump
99381 - * the slot number
99382 - */
99383 node = path->nodes[i];
99384 path->slots[i]++;
99385 *level = i;
99386 @@ -4308,11 +3765,6 @@
99387 return 0;
99388 } else {
99389 struct extent_buffer *parent;
99390 -
99391 - /*
99392 - * this whole node is done, free our reference
99393 - * on it and go up one level
99394 - */
99395 if (path->nodes[*level] == root->node)
99396 parent = path->nodes[*level];
99397 else
99398 @@ -4439,13 +3891,13 @@
99399 path = btrfs_alloc_path();
99400 BUG_ON(!path);
99401
99402 - btrfs_assert_tree_locked(parent);
99403 + BUG_ON(!btrfs_tree_locked(parent));
99404 parent_level = btrfs_header_level(parent);
99405 extent_buffer_get(parent);
99406 path->nodes[parent_level] = parent;
99407 path->slots[parent_level] = btrfs_header_nritems(parent);
99408
99409 - btrfs_assert_tree_locked(node);
99410 + BUG_ON(!btrfs_tree_locked(node));
99411 level = btrfs_header_level(node);
99412 extent_buffer_get(node);
99413 path->nodes[level] = node;
99414 @@ -4992,7 +4444,7 @@
99415 u64 lock_end = 0;
99416 u64 num_bytes;
99417 u64 ext_offset;
99418 - u64 search_end = (u64)-1;
99419 + u64 first_pos;
99420 u32 nritems;
99421 int nr_scaned = 0;
99422 int extent_locked = 0;
99423 @@ -5000,6 +4452,7 @@
99424 int ret;
99425
99426 memcpy(&key, leaf_key, sizeof(key));
99427 + first_pos = INT_LIMIT(loff_t) - extent_key->offset;
99428 if (ref_path->owner_objectid != BTRFS_MULTIPLE_OBJECTIDS) {
99429 if (key.objectid < ref_path->owner_objectid ||
99430 (key.objectid == ref_path->owner_objectid &&
99431 @@ -5048,7 +4501,7 @@
99432 if ((key.objectid > ref_path->owner_objectid) ||
99433 (key.objectid == ref_path->owner_objectid &&
99434 key.type > BTRFS_EXTENT_DATA_KEY) ||
99435 - key.offset >= search_end)
99436 + (key.offset >= first_pos + extent_key->offset))
99437 break;
99438 }
99439
99440 @@ -5081,10 +4534,8 @@
99441 num_bytes = btrfs_file_extent_num_bytes(leaf, fi);
99442 ext_offset = btrfs_file_extent_offset(leaf, fi);
99443
99444 - if (search_end == (u64)-1) {
99445 - search_end = key.offset - ext_offset +
99446 - btrfs_file_extent_ram_bytes(leaf, fi);
99447 - }
99448 + if (first_pos > key.offset - ext_offset)
99449 + first_pos = key.offset - ext_offset;
99450
99451 if (!extent_locked) {
99452 lock_start = key.offset;
99453 @@ -5273,7 +4724,7 @@
99454 }
99455 skip:
99456 if (ref_path->owner_objectid != BTRFS_MULTIPLE_OBJECTIDS &&
99457 - key.offset >= search_end)
99458 + key.offset >= first_pos + extent_key->offset)
99459 break;
99460
99461 cond_resched();
99462 @@ -5327,7 +4778,6 @@
99463 ref->bytenr = buf->start;
99464 ref->owner = btrfs_header_owner(buf);
99465 ref->generation = btrfs_header_generation(buf);
99466 -
99467 ret = btrfs_add_leaf_ref(root, ref, 0);
99468 WARN_ON(ret);
99469 btrfs_free_leaf_ref(root, ref);
99470 @@ -5901,9 +5351,7 @@
99471 prev_block = block_start;
99472 }
99473
99474 - mutex_lock(&extent_root->fs_info->trans_mutex);
99475 btrfs_record_root_in_trans(found_root);
99476 - mutex_unlock(&extent_root->fs_info->trans_mutex);
99477 if (ref_path->owner_objectid >= BTRFS_FIRST_FREE_OBJECTID) {
99478 /*
99479 * try to update data extent references while
99480 @@ -6341,7 +5789,6 @@
99481 int btrfs_free_block_groups(struct btrfs_fs_info *info)
99482 {
99483 struct btrfs_block_group_cache *block_group;
99484 - struct btrfs_space_info *space_info;
99485 struct rb_node *n;
99486
99487 spin_lock(&info->block_group_cache_lock);
99488 @@ -6363,23 +5810,6 @@
99489 spin_lock(&info->block_group_cache_lock);
99490 }
99491 spin_unlock(&info->block_group_cache_lock);
99492 -
99493 - /* now that all the block groups are freed, go through and
99494 - * free all the space_info structs. This is only called during
99495 - * the final stages of unmount, and so we know nobody is
99496 - * using them. We call synchronize_rcu() once before we start,
99497 - * just to be on the safe side.
99498 - */
99499 - synchronize_rcu();
99500 -
99501 - while(!list_empty(&info->space_info)) {
99502 - space_info = list_entry(info->space_info.next,
99503 - struct btrfs_space_info,
99504 - list);
99505 -
99506 - list_del(&space_info->list);
99507 - kfree(space_info);
99508 - }
99509 return 0;
99510 }
99511
99512 @@ -6527,11 +5957,9 @@
99513 path = btrfs_alloc_path();
99514 BUG_ON(!path);
99515
99516 - spin_lock(&root->fs_info->block_group_cache_lock);
99517 + btrfs_remove_free_space_cache(block_group);
99518 rb_erase(&block_group->cache_node,
99519 &root->fs_info->block_group_cache_tree);
99520 - spin_unlock(&root->fs_info->block_group_cache_lock);
99521 - btrfs_remove_free_space_cache(block_group);
99522 down_write(&block_group->space_info->groups_sem);
99523 list_del(&block_group->list);
99524 up_write(&block_group->space_info->groups_sem);
99525 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/btrfs/file.c linux-2.6.29-rc3.owrt/fs/btrfs/file.c
99526 --- linux-2.6.29.owrt/fs/btrfs/file.c 2009-05-10 22:04:39.000000000 +0200
99527 +++ linux-2.6.29-rc3.owrt/fs/btrfs/file.c 2009-05-10 23:48:29.000000000 +0200
99528 @@ -29,6 +29,7 @@
99529 #include <linux/writeback.h>
99530 #include <linux/statfs.h>
99531 #include <linux/compat.h>
99532 +#include <linux/version.h>
99533 #include "ctree.h"
99534 #include "disk-io.h"
99535 #include "transaction.h"
99536 @@ -1091,24 +1092,19 @@
99537 WARN_ON(num_pages > nrptrs);
99538 memset(pages, 0, sizeof(struct page *) * nrptrs);
99539
99540 - ret = btrfs_check_data_free_space(root, inode, write_bytes);
99541 + ret = btrfs_check_free_space(root, write_bytes, 0);
99542 if (ret)
99543 goto out;
99544
99545 ret = prepare_pages(root, file, pages, num_pages,
99546 pos, first_index, last_index,
99547 write_bytes);
99548 - if (ret) {
99549 - btrfs_free_reserved_data_space(root, inode,
99550 - write_bytes);
99551 + if (ret)
99552 goto out;
99553 - }
99554
99555 ret = btrfs_copy_from_user(pos, num_pages,
99556 write_bytes, pages, buf);
99557 if (ret) {
99558 - btrfs_free_reserved_data_space(root, inode,
99559 - write_bytes);
99560 btrfs_drop_pages(pages, num_pages);
99561 goto out;
99562 }
99563 @@ -1116,11 +1112,8 @@
99564 ret = dirty_and_release_pages(NULL, root, file, pages,
99565 num_pages, pos, write_bytes);
99566 btrfs_drop_pages(pages, num_pages);
99567 - if (ret) {
99568 - btrfs_free_reserved_data_space(root, inode,
99569 - write_bytes);
99570 + if (ret)
99571 goto out;
99572 - }
99573
99574 if (will_write) {
99575 btrfs_fdatawrite_range(inode->i_mapping, pos,
99576 @@ -1144,8 +1137,6 @@
99577 }
99578 out:
99579 mutex_unlock(&inode->i_mutex);
99580 - if (ret)
99581 - err = ret;
99582
99583 out_nolock:
99584 kfree(pages);
99585 @@ -1224,15 +1215,15 @@
99586 }
99587 mutex_unlock(&root->fs_info->trans_mutex);
99588
99589 - root->log_batch++;
99590 + root->fs_info->tree_log_batch++;
99591 filemap_fdatawrite(inode->i_mapping);
99592 btrfs_wait_ordered_range(inode, 0, (u64)-1);
99593 - root->log_batch++;
99594 + root->fs_info->tree_log_batch++;
99595
99596 /*
99597 * ok we haven't committed the transaction yet, lets do a commit
99598 */
99599 - if (file && file->private_data)
99600 + if (file->private_data)
99601 btrfs_ioctl_trans_end(file);
99602
99603 trans = btrfs_start_transaction(root, 1);
99604 @@ -1241,7 +1232,7 @@
99605 goto out;
99606 }
99607
99608 - ret = btrfs_log_dentry_safe(trans, root, dentry);
99609 + ret = btrfs_log_dentry_safe(trans, root, file->f_dentry);
99610 if (ret < 0)
99611 goto out;
99612
99613 @@ -1255,7 +1246,7 @@
99614 * file again, but that will end up using the synchronization
99615 * inside btrfs_sync_log to keep things safe.
99616 */
99617 - mutex_unlock(&dentry->d_inode->i_mutex);
99618 + mutex_unlock(&file->f_dentry->d_inode->i_mutex);
99619
99620 if (ret > 0) {
99621 ret = btrfs_commit_transaction(trans, root);
99622 @@ -1263,7 +1254,7 @@
99623 btrfs_sync_log(trans, root);
99624 ret = btrfs_end_transaction(trans, root);
99625 }
99626 - mutex_lock(&dentry->d_inode->i_mutex);
99627 + mutex_lock(&file->f_dentry->d_inode->i_mutex);
99628 out:
99629 return ret > 0 ? EIO : ret;
99630 }
99631 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/btrfs/inode.c linux-2.6.29-rc3.owrt/fs/btrfs/inode.c
99632 --- linux-2.6.29.owrt/fs/btrfs/inode.c 2009-05-10 22:04:39.000000000 +0200
99633 +++ linux-2.6.29-rc3.owrt/fs/btrfs/inode.c 2009-05-10 23:48:29.000000000 +0200
99634 @@ -34,6 +34,7 @@
99635 #include <linux/statfs.h>
99636 #include <linux/compat.h>
99637 #include <linux/bit_spinlock.h>
99638 +#include <linux/version.h>
99639 #include <linux/xattr.h>
99640 #include <linux/posix_acl.h>
99641 #include <linux/falloc.h>
99642 @@ -50,7 +51,6 @@
99643 #include "tree-log.h"
99644 #include "ref-cache.h"
99645 #include "compression.h"
99646 -#include "locking.h"
99647
99648 struct btrfs_iget_args {
99649 u64 ino;
99650 @@ -91,14 +91,32 @@
99651 u64 start, u64 end, int *page_started,
99652 unsigned long *nr_written, int unlock);
99653
99654 -static int btrfs_init_inode_security(struct inode *inode, struct inode *dir)
99655 +/*
99656 + * a very lame attempt at stopping writes when the FS is 85% full. There
99657 + * are countless ways this is incorrect, but it is better than nothing.
99658 + */
99659 +int btrfs_check_free_space(struct btrfs_root *root, u64 num_required,
99660 + int for_del)
99661 {
99662 - int err;
99663 + u64 total;
99664 + u64 used;
99665 + u64 thresh;
99666 + int ret = 0;
99667
99668 - err = btrfs_init_acl(inode, dir);
99669 - if (!err)
99670 - err = btrfs_xattr_security_init(inode, dir);
99671 - return err;
99672 + spin_lock(&root->fs_info->delalloc_lock);
99673 + total = btrfs_super_total_bytes(&root->fs_info->super_copy);
99674 + used = btrfs_super_bytes_used(&root->fs_info->super_copy);
99675 + if (for_del)
99676 + thresh = total * 90;
99677 + else
99678 + thresh = total * 85;
99679 +
99680 + do_div(thresh, 100);
99681 +
99682 + if (used + root->fs_info->delalloc_bytes + num_required > thresh)
99683 + ret = -ENOSPC;
99684 + spin_unlock(&root->fs_info->delalloc_lock);
99685 + return ret;
99686 }
99687
99688 /*
99689 @@ -332,19 +350,6 @@
99690 nr_pages = (end >> PAGE_CACHE_SHIFT) - (start >> PAGE_CACHE_SHIFT) + 1;
99691 nr_pages = min(nr_pages, (128 * 1024UL) / PAGE_CACHE_SIZE);
99692
99693 - /*
99694 - * we don't want to send crud past the end of i_size through
99695 - * compression, that's just a waste of CPU time. So, if the
99696 - * end of the file is before the start of our current
99697 - * requested range of bytes, we bail out to the uncompressed
99698 - * cleanup code that can deal with all of this.
99699 - *
99700 - * It isn't really the fastest way to fix things, but this is a
99701 - * very uncommon corner.
99702 - */
99703 - if (actual_end <= start)
99704 - goto cleanup_and_bail_uncompressed;
99705 -
99706 total_compressed = actual_end - start;
99707
99708 /* we want to make sure that amount of ram required to uncompress
99709 @@ -489,7 +494,6 @@
99710 goto again;
99711 }
99712 } else {
99713 -cleanup_and_bail_uncompressed:
99714 /*
99715 * No compression, but we still need to write the pages in
99716 * the file we've been given so far. redirty the locked
99717 @@ -1162,7 +1166,6 @@
99718 */
99719 if (!(old & EXTENT_DELALLOC) && (bits & EXTENT_DELALLOC)) {
99720 struct btrfs_root *root = BTRFS_I(inode)->root;
99721 - btrfs_delalloc_reserve_space(root, inode, end - start + 1);
99722 spin_lock(&root->fs_info->delalloc_lock);
99723 BTRFS_I(inode)->delalloc_bytes += end - start + 1;
99724 root->fs_info->delalloc_bytes += end - start + 1;
99725 @@ -1196,12 +1199,9 @@
99726 (unsigned long long)end - start + 1,
99727 (unsigned long long)
99728 root->fs_info->delalloc_bytes);
99729 - btrfs_delalloc_free_space(root, inode, (u64)-1);
99730 root->fs_info->delalloc_bytes = 0;
99731 BTRFS_I(inode)->delalloc_bytes = 0;
99732 } else {
99733 - btrfs_delalloc_free_space(root, inode,
99734 - end - start + 1);
99735 root->fs_info->delalloc_bytes -= end - start + 1;
99736 BTRFS_I(inode)->delalloc_bytes -= end - start + 1;
99737 }
99738 @@ -1324,11 +1324,12 @@
99739 struct inode *inode, u64 file_offset,
99740 struct list_head *list)
99741 {
99742 + struct list_head *cur;
99743 struct btrfs_ordered_sum *sum;
99744
99745 btrfs_set_trans_block_group(trans, inode);
99746 -
99747 - list_for_each_entry(sum, list, list) {
99748 + list_for_each(cur, list) {
99749 + sum = list_entry(cur, struct btrfs_ordered_sum, list);
99750 btrfs_csum_file_blocks(trans,
99751 BTRFS_I(inode)->root->fs_info->csum_root, sum);
99752 }
99753 @@ -2012,7 +2013,6 @@
99754 BTRFS_I(inode)->flags = btrfs_inode_flags(leaf, inode_item);
99755
99756 alloc_group_block = btrfs_inode_block_group(leaf, inode_item);
99757 -
99758 BTRFS_I(inode)->block_group = btrfs_find_block_group(root, 0,
99759 alloc_group_block, 0);
99760 btrfs_free_path(path);
99761 @@ -2039,7 +2039,6 @@
99762 inode->i_mapping->backing_dev_info = &root->fs_info->bdi;
99763 break;
99764 default:
99765 - inode->i_op = &btrfs_special_inode_operations;
99766 init_special_inode(inode, inode->i_mode, rdev);
99767 break;
99768 }
99769 @@ -2109,7 +2108,6 @@
99770 goto failed;
99771 }
99772
99773 - btrfs_unlock_up_safe(path, 1);
99774 leaf = path->nodes[0];
99775 inode_item = btrfs_item_ptr(leaf, path->slots[0],
99776 struct btrfs_inode_item);
99777 @@ -2221,6 +2219,10 @@
99778
99779 root = BTRFS_I(dir)->root;
99780
99781 + ret = btrfs_check_free_space(root, 1, 1);
99782 + if (ret)
99783 + goto fail;
99784 +
99785 trans = btrfs_start_transaction(root, 1);
99786
99787 btrfs_set_trans_block_group(trans, dir);
99788 @@ -2233,6 +2235,7 @@
99789 nr = trans->blocks_used;
99790
99791 btrfs_end_transaction_throttle(trans, root);
99792 +fail:
99793 btrfs_btree_balance_dirty(root, nr);
99794 return ret;
99795 }
99796 @@ -2255,6 +2258,10 @@
99797 return -ENOTEMPTY;
99798 }
99799
99800 + ret = btrfs_check_free_space(root, 1, 1);
99801 + if (ret)
99802 + goto fail;
99803 +
99804 trans = btrfs_start_transaction(root, 1);
99805 btrfs_set_trans_block_group(trans, dir);
99806
99807 @@ -2271,6 +2278,7 @@
99808 fail_trans:
99809 nr = trans->blocks_used;
99810 ret = btrfs_end_transaction_throttle(trans, root);
99811 +fail:
99812 btrfs_btree_balance_dirty(root, nr);
99813
99814 if (ret && !err)
99815 @@ -2421,8 +2429,6 @@
99816 ref->generation = leaf_gen;
99817 ref->nritems = 0;
99818
99819 - btrfs_sort_leaf_ref(ref);
99820 -
99821 ret = btrfs_add_leaf_ref(root, ref, 0);
99822 WARN_ON(ret);
99823 btrfs_free_leaf_ref(root, ref);
99824 @@ -2470,7 +2476,7 @@
99825 struct btrfs_path *path;
99826 struct btrfs_key key;
99827 struct btrfs_key found_key;
99828 - u32 found_type = (u8)-1;
99829 + u32 found_type;
99830 struct extent_buffer *leaf;
99831 struct btrfs_file_extent_item *fi;
99832 u64 extent_start = 0;
99833 @@ -2497,6 +2503,8 @@
99834 key.offset = (u64)-1;
99835 key.type = (u8)-1;
99836
99837 + btrfs_init_path(path);
99838 +
99839 search_again:
99840 ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
99841 if (ret < 0)
99842 @@ -2655,8 +2663,6 @@
99843 if (pending_del_nr)
99844 goto del_pending;
99845 btrfs_release_path(root, path);
99846 - if (found_type == BTRFS_INODE_ITEM_KEY)
99847 - break;
99848 goto search_again;
99849 }
99850
99851 @@ -2673,8 +2679,6 @@
99852 BUG_ON(ret);
99853 pending_del_nr = 0;
99854 btrfs_release_path(root, path);
99855 - if (found_type == BTRFS_INODE_ITEM_KEY)
99856 - break;
99857 goto search_again;
99858 }
99859 }
99860 @@ -2784,7 +2788,7 @@
99861 if (size <= hole_start)
99862 return 0;
99863
99864 - err = btrfs_check_metadata_free_space(root);
99865 + err = btrfs_check_free_space(root, 1, 0);
99866 if (err)
99867 return err;
99868
99869 @@ -2980,7 +2984,6 @@
99870 bi->last_trans = 0;
99871 bi->logged_trans = 0;
99872 bi->delalloc_bytes = 0;
99873 - bi->reserved_bytes = 0;
99874 bi->disk_i_size = 0;
99875 bi->flags = 0;
99876 bi->index_cnt = (u64)-1;
99877 @@ -3002,7 +3005,6 @@
99878 inode->i_ino = args->ino;
99879 init_btrfs_i(inode);
99880 BTRFS_I(inode)->root = args->root;
99881 - btrfs_set_inode_space_info(args->root, inode);
99882 return 0;
99883 }
99884
99885 @@ -3263,7 +3265,7 @@
99886
99887 /* Reached end of directory/root. Bump pos past the last item. */
99888 if (key_type == BTRFS_DIR_INDEX_KEY)
99889 - filp->f_pos = INT_LIMIT(off_t);
99890 + filp->f_pos = INT_LIMIT(typeof(filp->f_pos));
99891 else
99892 filp->f_pos++;
99893 nopos:
99894 @@ -3423,7 +3425,6 @@
99895 BTRFS_I(inode)->index_cnt = 2;
99896 BTRFS_I(inode)->root = root;
99897 BTRFS_I(inode)->generation = trans->transid;
99898 - btrfs_set_inode_space_info(root, inode);
99899
99900 if (mode & S_IFDIR)
99901 owner = 0;
99902 @@ -3457,14 +3458,7 @@
99903 root->highest_inode = objectid;
99904
99905 inode->i_uid = current_fsuid();
99906 -
99907 - if (dir && (dir->i_mode & S_ISGID)) {
99908 - inode->i_gid = dir->i_gid;
99909 - if (S_ISDIR(mode))
99910 - mode |= S_ISGID;
99911 - } else
99912 - inode->i_gid = current_fsgid();
99913 -
99914 + inode->i_gid = current_fsgid();
99915 inode->i_mode = mode;
99916 inode->i_ino = objectid;
99917 inode_set_bytes(inode, 0);
99918 @@ -3571,7 +3565,7 @@
99919 if (!new_valid_dev(rdev))
99920 return -EINVAL;
99921
99922 - err = btrfs_check_metadata_free_space(root);
99923 + err = btrfs_check_free_space(root, 1, 0);
99924 if (err)
99925 goto fail;
99926
99927 @@ -3592,7 +3586,7 @@
99928 if (IS_ERR(inode))
99929 goto out_unlock;
99930
99931 - err = btrfs_init_inode_security(inode, dir);
99932 + err = btrfs_init_acl(inode, dir);
99933 if (err) {
99934 drop_inode = 1;
99935 goto out_unlock;
99936 @@ -3634,7 +3628,7 @@
99937 u64 objectid;
99938 u64 index = 0;
99939
99940 - err = btrfs_check_metadata_free_space(root);
99941 + err = btrfs_check_free_space(root, 1, 0);
99942 if (err)
99943 goto fail;
99944 trans = btrfs_start_transaction(root, 1);
99945 @@ -3655,7 +3649,7 @@
99946 if (IS_ERR(inode))
99947 goto out_unlock;
99948
99949 - err = btrfs_init_inode_security(inode, dir);
99950 + err = btrfs_init_acl(inode, dir);
99951 if (err) {
99952 drop_inode = 1;
99953 goto out_unlock;
99954 @@ -3702,7 +3696,7 @@
99955 return -ENOENT;
99956
99957 btrfs_inc_nlink(inode);
99958 - err = btrfs_check_metadata_free_space(root);
99959 + err = btrfs_check_free_space(root, 1, 0);
99960 if (err)
99961 goto fail;
99962 err = btrfs_set_inode_index(dir, &index);
99963 @@ -3748,7 +3742,7 @@
99964 u64 index = 0;
99965 unsigned long nr = 1;
99966
99967 - err = btrfs_check_metadata_free_space(root);
99968 + err = btrfs_check_free_space(root, 1, 0);
99969 if (err)
99970 goto out_unlock;
99971
99972 @@ -3778,7 +3772,7 @@
99973
99974 drop_on_err = 1;
99975
99976 - err = btrfs_init_inode_security(inode, dir);
99977 + err = btrfs_init_acl(inode, dir);
99978 if (err)
99979 goto out_fail;
99980
99981 @@ -4164,10 +4158,9 @@
99982 return -EINVAL;
99983 }
99984
99985 -static int btrfs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
99986 - __u64 start, __u64 len)
99987 +static sector_t btrfs_bmap(struct address_space *mapping, sector_t iblock)
99988 {
99989 - return extent_fiemap(inode, fieinfo, start, len, btrfs_get_extent);
99990 + return extent_bmap(mapping, iblock, btrfs_get_extent);
99991 }
99992
99993 int btrfs_readpage(struct file *file, struct page *page)
99994 @@ -4230,7 +4223,7 @@
99995 {
99996 if (PageWriteback(page) || PageDirty(page))
99997 return 0;
99998 - return __btrfs_releasepage(page, gfp_flags & GFP_NOFS);
99999 + return __btrfs_releasepage(page, gfp_flags);
100000 }
100001
100002 static void btrfs_invalidatepage(struct page *page, unsigned long offset)
100003 @@ -4305,7 +4298,7 @@
100004 u64 page_start;
100005 u64 page_end;
100006
100007 - ret = btrfs_check_data_free_space(root, inode, PAGE_CACHE_SIZE);
100008 + ret = btrfs_check_free_space(root, PAGE_CACHE_SIZE, 0);
100009 if (ret)
100010 goto out;
100011
100012 @@ -4318,7 +4311,6 @@
100013
100014 if ((page->mapping != inode->i_mapping) ||
100015 (page_start >= size)) {
100016 - btrfs_free_reserved_data_space(root, inode, PAGE_CACHE_SIZE);
100017 /* page got truncated out from underneath us */
100018 goto out_unlock;
100019 }
100020 @@ -4601,7 +4593,7 @@
100021 if (old_inode->i_ino == BTRFS_FIRST_FREE_OBJECTID)
100022 return -EXDEV;
100023
100024 - ret = btrfs_check_metadata_free_space(root);
100025 + ret = btrfs_check_free_space(root, 1, 0);
100026 if (ret)
100027 goto out_unlock;
100028
100029 @@ -4719,7 +4711,7 @@
100030 if (name_len > BTRFS_MAX_INLINE_DATA_SIZE(root))
100031 return -ENAMETOOLONG;
100032
100033 - err = btrfs_check_metadata_free_space(root);
100034 + err = btrfs_check_free_space(root, 1, 0);
100035 if (err)
100036 goto out_fail;
100037
100038 @@ -4741,7 +4733,7 @@
100039 if (IS_ERR(inode))
100040 goto out_unlock;
100041
100042 - err = btrfs_init_inode_security(inode, dir);
100043 + err = btrfs_init_acl(inode, dir);
100044 if (err) {
100045 drop_inode = 1;
100046 goto out_unlock;
100047 @@ -4995,24 +4987,13 @@
100048 .clear_bit_hook = btrfs_clear_bit_hook,
100049 };
100050
100051 -/*
100052 - * btrfs doesn't support the bmap operation because swapfiles
100053 - * use bmap to make a mapping of extents in the file. They assume
100054 - * these extents won't change over the life of the file and they
100055 - * use the bmap result to do IO directly to the drive.
100056 - *
100057 - * the btrfs bmap call would return logical addresses that aren't
100058 - * suitable for IO and they also will change frequently as COW
100059 - * operations happen. So, swapfile + btrfs == corruption.
100060 - *
100061 - * For now we're avoiding this by dropping bmap.
100062 - */
100063 static struct address_space_operations btrfs_aops = {
100064 .readpage = btrfs_readpage,
100065 .writepage = btrfs_writepage,
100066 .writepages = btrfs_writepages,
100067 .readpages = btrfs_readpages,
100068 .sync_page = block_sync_page,
100069 + .bmap = btrfs_bmap,
100070 .direct_IO = btrfs_direct_IO,
100071 .invalidatepage = btrfs_invalidatepage,
100072 .releasepage = btrfs_releasepage,
100073 @@ -5036,7 +5017,6 @@
100074 .removexattr = btrfs_removexattr,
100075 .permission = btrfs_permission,
100076 .fallocate = btrfs_fallocate,
100077 - .fiemap = btrfs_fiemap,
100078 };
100079 static struct inode_operations btrfs_special_inode_operations = {
100080 .getattr = btrfs_getattr,
100081 @@ -5052,8 +5032,4 @@
100082 .follow_link = page_follow_link_light,
100083 .put_link = page_put_link,
100084 .permission = btrfs_permission,
100085 - .setxattr = btrfs_setxattr,
100086 - .getxattr = btrfs_getxattr,
100087 - .listxattr = btrfs_listxattr,
100088 - .removexattr = btrfs_removexattr,
100089 };
100090 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/btrfs/inode-map.c linux-2.6.29-rc3.owrt/fs/btrfs/inode-map.c
100091 --- linux-2.6.29.owrt/fs/btrfs/inode-map.c 2009-05-10 22:04:39.000000000 +0200
100092 +++ linux-2.6.29-rc3.owrt/fs/btrfs/inode-map.c 2009-05-10 23:48:29.000000000 +0200
100093 @@ -84,6 +84,7 @@
100094 search_key.type = 0;
100095 search_key.offset = 0;
100096
100097 + btrfs_init_path(path);
100098 start_found = 0;
100099 ret = btrfs_search_slot(trans, root, &search_key, path, 0, 0);
100100 if (ret < 0)
100101 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/btrfs/ioctl.c linux-2.6.29-rc3.owrt/fs/btrfs/ioctl.c
100102 --- linux-2.6.29.owrt/fs/btrfs/ioctl.c 2009-05-10 22:04:39.000000000 +0200
100103 +++ linux-2.6.29-rc3.owrt/fs/btrfs/ioctl.c 2009-05-10 23:48:29.000000000 +0200
100104 @@ -38,6 +38,7 @@
100105 #include <linux/compat.h>
100106 #include <linux/bit_spinlock.h>
100107 #include <linux/security.h>
100108 +#include <linux/version.h>
100109 #include <linux/xattr.h>
100110 #include <linux/vmalloc.h>
100111 #include "compat.h"
100112 @@ -70,7 +71,7 @@
100113 u64 index = 0;
100114 unsigned long nr = 1;
100115
100116 - ret = btrfs_check_metadata_free_space(root);
100117 + ret = btrfs_check_free_space(root, 1, 0);
100118 if (ret)
100119 goto fail_commit;
100120
100121 @@ -203,7 +204,7 @@
100122 if (!root->ref_cows)
100123 return -EINVAL;
100124
100125 - ret = btrfs_check_metadata_free_space(root);
100126 + ret = btrfs_check_free_space(root, 1, 0);
100127 if (ret)
100128 goto fail_unlock;
100129
100130 @@ -374,7 +375,7 @@
100131 unsigned long i;
100132 int ret;
100133
100134 - ret = btrfs_check_data_free_space(root, inode, inode->i_size);
100135 + ret = btrfs_check_free_space(root, inode->i_size, 0);
100136 if (ret)
100137 return -ENOSPC;
100138
100139 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/btrfs/Kconfig linux-2.6.29-rc3.owrt/fs/btrfs/Kconfig
100140 --- linux-2.6.29.owrt/fs/btrfs/Kconfig 2009-05-10 22:04:39.000000000 +0200
100141 +++ linux-2.6.29-rc3.owrt/fs/btrfs/Kconfig 2009-05-10 23:48:29.000000000 +0200
100142 @@ -16,16 +16,3 @@
100143 module will be called btrfs.
100144
100145 If unsure, say N.
100146 -
100147 -config BTRFS_FS_POSIX_ACL
100148 - bool "Btrfs POSIX Access Control Lists"
100149 - depends on BTRFS_FS
100150 - select FS_POSIX_ACL
100151 - help
100152 - POSIX Access Control Lists (ACLs) support permissions for users and
100153 - groups beyond the owner/group/world scheme.
100154 -
100155 - To learn more about Access Control Lists, visit the POSIX ACLs for
100156 - Linux website <http://acl.bestbits.at/>.
100157 -
100158 - If you don't know what Access Control Lists are, say N
100159 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/btrfs/locking.c linux-2.6.29-rc3.owrt/fs/btrfs/locking.c
100160 --- linux-2.6.29.owrt/fs/btrfs/locking.c 2009-05-10 22:04:39.000000000 +0200
100161 +++ linux-2.6.29-rc3.owrt/fs/btrfs/locking.c 2009-05-10 23:48:29.000000000 +0200
100162 @@ -25,203 +25,64 @@
100163 #include "extent_io.h"
100164 #include "locking.h"
100165
100166 -static inline void spin_nested(struct extent_buffer *eb)
100167 -{
100168 - spin_lock(&eb->lock);
100169 -}
100170 -
100171 -/*
100172 - * Setting a lock to blocking will drop the spinlock and set the
100173 - * flag that forces other procs who want the lock to wait. After
100174 - * this you can safely schedule with the lock held.
100175 - */
100176 -void btrfs_set_lock_blocking(struct extent_buffer *eb)
100177 -{
100178 - if (!test_bit(EXTENT_BUFFER_BLOCKING, &eb->bflags)) {
100179 - set_bit(EXTENT_BUFFER_BLOCKING, &eb->bflags);
100180 - spin_unlock(&eb->lock);
100181 - }
100182 - /* exit with the spin lock released and the bit set */
100183 -}
100184 -
100185 /*
100186 - * clearing the blocking flag will take the spinlock again.
100187 - * After this you can't safely schedule
100188 - */
100189 -void btrfs_clear_lock_blocking(struct extent_buffer *eb)
100190 -{
100191 - if (test_bit(EXTENT_BUFFER_BLOCKING, &eb->bflags)) {
100192 - spin_nested(eb);
100193 - clear_bit(EXTENT_BUFFER_BLOCKING, &eb->bflags);
100194 - smp_mb__after_clear_bit();
100195 - }
100196 - /* exit with the spin lock held */
100197 -}
100198 -
100199 -/*
100200 - * unfortunately, many of the places that currently set a lock to blocking
100201 - * don't end up blocking for every long, and often they don't block
100202 - * at all. For a dbench 50 run, if we don't spin one the blocking bit
100203 - * at all, the context switch rate can jump up to 400,000/sec or more.
100204 + * locks the per buffer mutex in an extent buffer. This uses adaptive locks
100205 + * and the spin is not tuned very extensively. The spinning does make a big
100206 + * difference in almost every workload, but spinning for the right amount of
100207 + * time needs some help.
100208 *
100209 - * So, we're still stuck with this crummy spin on the blocking bit,
100210 - * at least until the most common causes of the short blocks
100211 - * can be dealt with.
100212 + * In general, we want to spin as long as the lock holder is doing btree
100213 + * searches, and we should give up if they are in more expensive code.
100214 */
100215 -static int btrfs_spin_on_block(struct extent_buffer *eb)
100216 +
100217 +int btrfs_tree_lock(struct extent_buffer *eb)
100218 {
100219 int i;
100220 +
100221 + if (mutex_trylock(&eb->mutex))
100222 + return 0;
100223 for (i = 0; i < 512; i++) {
100224 cpu_relax();
100225 - if (!test_bit(EXTENT_BUFFER_BLOCKING, &eb->bflags))
100226 - return 1;
100227 - if (need_resched())
100228 - break;
100229 + if (mutex_trylock(&eb->mutex))
100230 + return 0;
100231 }
100232 + cpu_relax();
100233 + mutex_lock_nested(&eb->mutex, BTRFS_MAX_LEVEL - btrfs_header_level(eb));
100234 return 0;
100235 }
100236
100237 -/*
100238 - * This is somewhat different from trylock. It will take the
100239 - * spinlock but if it finds the lock is set to blocking, it will
100240 - * return without the lock held.
100241 - *
100242 - * returns 1 if it was able to take the lock and zero otherwise
100243 - *
100244 - * After this call, scheduling is not safe without first calling
100245 - * btrfs_set_lock_blocking()
100246 - */
100247 -int btrfs_try_spin_lock(struct extent_buffer *eb)
100248 +int btrfs_try_tree_lock(struct extent_buffer *eb)
100249 {
100250 - int i;
100251 -
100252 - spin_nested(eb);
100253 - if (!test_bit(EXTENT_BUFFER_BLOCKING, &eb->bflags))
100254 - return 1;
100255 - spin_unlock(&eb->lock);
100256 -
100257 - /* spin for a bit on the BLOCKING flag */
100258 - for (i = 0; i < 2; i++) {
100259 - if (!btrfs_spin_on_block(eb))
100260 - break;
100261 -
100262 - spin_nested(eb);
100263 - if (!test_bit(EXTENT_BUFFER_BLOCKING, &eb->bflags))
100264 - return 1;
100265 - spin_unlock(&eb->lock);
100266 - }
100267 - return 0;
100268 + return mutex_trylock(&eb->mutex);
100269 }
100270
100271 -/*
100272 - * the autoremove wake function will return 0 if it tried to wake up
100273 - * a process that was already awake, which means that process won't
100274 - * count as an exclusive wakeup. The waitq code will continue waking
100275 - * procs until it finds one that was actually sleeping.
100276 - *
100277 - * For btrfs, this isn't quite what we want. We want a single proc
100278 - * to be notified that the lock is ready for taking. If that proc
100279 - * already happen to be awake, great, it will loop around and try for
100280 - * the lock.
100281 - *
100282 - * So, btrfs_wake_function always returns 1, even when the proc that we
100283 - * tried to wake up was already awake.
100284 - */
100285 -static int btrfs_wake_function(wait_queue_t *wait, unsigned mode,
100286 - int sync, void *key)
100287 +int btrfs_tree_unlock(struct extent_buffer *eb)
100288 {
100289 - autoremove_wake_function(wait, mode, sync, key);
100290 - return 1;
100291 + mutex_unlock(&eb->mutex);
100292 + return 0;
100293 }
100294
100295 -/*
100296 - * returns with the extent buffer spinlocked.
100297 - *
100298 - * This will spin and/or wait as required to take the lock, and then
100299 - * return with the spinlock held.
100300 - *
100301 - * After this call, scheduling is not safe without first calling
100302 - * btrfs_set_lock_blocking()
100303 - */
100304 -int btrfs_tree_lock(struct extent_buffer *eb)
100305 +int btrfs_tree_locked(struct extent_buffer *eb)
100306 {
100307 - DEFINE_WAIT(wait);
100308 - wait.func = btrfs_wake_function;
100309 -
100310 - while(1) {
100311 - spin_nested(eb);
100312 -
100313 - /* nobody is blocking, exit with the spinlock held */
100314 - if (!test_bit(EXTENT_BUFFER_BLOCKING, &eb->bflags))
100315 - return 0;
100316 -
100317 - /*
100318 - * we have the spinlock, but the real owner is blocking.
100319 - * wait for them
100320 - */
100321 - spin_unlock(&eb->lock);
100322 -
100323 - /*
100324 - * spin for a bit, and if the blocking flag goes away,
100325 - * loop around
100326 - */
100327 - if (btrfs_spin_on_block(eb))
100328 - continue;
100329 -
100330 - prepare_to_wait_exclusive(&eb->lock_wq, &wait,
100331 - TASK_UNINTERRUPTIBLE);
100332 -
100333 - if (test_bit(EXTENT_BUFFER_BLOCKING, &eb->bflags))
100334 - schedule();
100335 -
100336 - finish_wait(&eb->lock_wq, &wait);
100337 - }
100338 - return 0;
100339 + return mutex_is_locked(&eb->mutex);
100340 }
100341
100342 /*
100343 - * Very quick trylock, this does not spin or schedule. It returns
100344 - * 1 with the spinlock held if it was able to take the lock, or it
100345 - * returns zero if it was unable to take the lock.
100346 - *
100347 - * After this call, scheduling is not safe without first calling
100348 - * btrfs_set_lock_blocking()
100349 + * btrfs_search_slot uses this to decide if it should drop its locks
100350 + * before doing something expensive like allocating free blocks for cow.
100351 */
100352 -int btrfs_try_tree_lock(struct extent_buffer *eb)
100353 +int btrfs_path_lock_waiting(struct btrfs_path *path, int level)
100354 {
100355 - if (spin_trylock(&eb->lock)) {
100356 - if (test_bit(EXTENT_BUFFER_BLOCKING, &eb->bflags)) {
100357 - /*
100358 - * we've got the spinlock, but the real owner is
100359 - * blocking. Drop the spinlock and return failure
100360 - */
100361 - spin_unlock(&eb->lock);
100362 - return 0;
100363 - }
100364 - return 1;
100365 + int i;
100366 + struct extent_buffer *eb;
100367 + for (i = level; i <= level + 1 && i < BTRFS_MAX_LEVEL; i++) {
100368 + eb = path->nodes[i];
100369 + if (!eb)
100370 + break;
100371 + smp_mb();
100372 + if (!list_empty(&eb->mutex.wait_list))
100373 + return 1;
100374 }
100375 - /* someone else has the spinlock giveup */
100376 return 0;
100377 }
100378
100379 -int btrfs_tree_unlock(struct extent_buffer *eb)
100380 -{
100381 - /*
100382 - * if we were a blocking owner, we don't have the spinlock held
100383 - * just clear the bit and look for waiters
100384 - */
100385 - if (test_and_clear_bit(EXTENT_BUFFER_BLOCKING, &eb->bflags))
100386 - smp_mb__after_clear_bit();
100387 - else
100388 - spin_unlock(&eb->lock);
100389 -
100390 - if (waitqueue_active(&eb->lock_wq))
100391 - wake_up(&eb->lock_wq);
100392 - return 0;
100393 -}
100394 -
100395 -void btrfs_assert_tree_locked(struct extent_buffer *eb)
100396 -{
100397 - if (!test_bit(EXTENT_BUFFER_BLOCKING, &eb->bflags))
100398 - assert_spin_locked(&eb->lock);
100399 -}
100400 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/btrfs/locking.h linux-2.6.29-rc3.owrt/fs/btrfs/locking.h
100401 --- linux-2.6.29.owrt/fs/btrfs/locking.h 2009-05-10 22:04:39.000000000 +0200
100402 +++ linux-2.6.29-rc3.owrt/fs/btrfs/locking.h 2009-05-10 23:48:29.000000000 +0200
100403 @@ -21,11 +21,7 @@
100404
100405 int btrfs_tree_lock(struct extent_buffer *eb);
100406 int btrfs_tree_unlock(struct extent_buffer *eb);
100407 -
100408 +int btrfs_tree_locked(struct extent_buffer *eb);
100409 int btrfs_try_tree_lock(struct extent_buffer *eb);
100410 -int btrfs_try_spin_lock(struct extent_buffer *eb);
100411 -
100412 -void btrfs_set_lock_blocking(struct extent_buffer *eb);
100413 -void btrfs_clear_lock_blocking(struct extent_buffer *eb);
100414 -void btrfs_assert_tree_locked(struct extent_buffer *eb);
100415 +int btrfs_path_lock_waiting(struct btrfs_path *path, int level);
100416 #endif
100417 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/btrfs/ordered-data.c linux-2.6.29-rc3.owrt/fs/btrfs/ordered-data.c
100418 --- linux-2.6.29.owrt/fs/btrfs/ordered-data.c 2009-05-10 22:04:39.000000000 +0200
100419 +++ linux-2.6.29-rc3.owrt/fs/btrfs/ordered-data.c 2009-05-10 23:48:29.000000000 +0200
100420 @@ -613,6 +613,7 @@
100421 struct btrfs_sector_sum *sector_sums;
100422 struct btrfs_ordered_extent *ordered;
100423 struct btrfs_ordered_inode_tree *tree = &BTRFS_I(inode)->ordered_tree;
100424 + struct list_head *cur;
100425 unsigned long num_sectors;
100426 unsigned long i;
100427 u32 sectorsize = BTRFS_I(inode)->root->sectorsize;
100428 @@ -623,7 +624,8 @@
100429 return 1;
100430
100431 mutex_lock(&tree->mutex);
100432 - list_for_each_entry_reverse(ordered_sum, &ordered->list, list) {
100433 + list_for_each_prev(cur, &ordered->list) {
100434 + ordered_sum = list_entry(cur, struct btrfs_ordered_sum, list);
100435 if (disk_bytenr >= ordered_sum->bytenr) {
100436 num_sectors = ordered_sum->len / sectorsize;
100437 sector_sums = ordered_sum->sums;
100438 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/btrfs/ref-cache.c linux-2.6.29-rc3.owrt/fs/btrfs/ref-cache.c
100439 --- linux-2.6.29.owrt/fs/btrfs/ref-cache.c 2009-05-10 22:04:39.000000000 +0200
100440 +++ linux-2.6.29-rc3.owrt/fs/btrfs/ref-cache.c 2009-05-10 23:48:29.000000000 +0200
100441 @@ -17,7 +17,6 @@
100442 */
100443
100444 #include <linux/sched.h>
100445 -#include <linux/sort.h>
100446 #include "ctree.h"
100447 #include "ref-cache.h"
100448 #include "transaction.h"
100449 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/btrfs/ref-cache.h linux-2.6.29-rc3.owrt/fs/btrfs/ref-cache.h
100450 --- linux-2.6.29.owrt/fs/btrfs/ref-cache.h 2009-05-10 22:04:39.000000000 +0200
100451 +++ linux-2.6.29-rc3.owrt/fs/btrfs/ref-cache.h 2009-05-10 23:48:29.000000000 +0200
100452 @@ -73,4 +73,5 @@
100453 int btrfs_remove_leaf_refs(struct btrfs_root *root, u64 max_root_gen,
100454 int shared);
100455 int btrfs_remove_leaf_ref(struct btrfs_root *root, struct btrfs_leaf_ref *ref);
100456 +
100457 #endif
100458 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/btrfs/super.c linux-2.6.29-rc3.owrt/fs/btrfs/super.c
100459 --- linux-2.6.29.owrt/fs/btrfs/super.c 2009-05-10 22:04:39.000000000 +0200
100460 +++ linux-2.6.29-rc3.owrt/fs/btrfs/super.c 2009-05-10 23:48:29.000000000 +0200
100461 @@ -37,6 +37,7 @@
100462 #include <linux/ctype.h>
100463 #include <linux/namei.h>
100464 #include <linux/miscdevice.h>
100465 +#include <linux/version.h>
100466 #include <linux/magic.h>
100467 #include "compat.h"
100468 #include "ctree.h"
100469 @@ -379,6 +380,7 @@
100470 btrfs_start_delalloc_inodes(root);
100471 btrfs_wait_ordered_extents(root, 0);
100472
100473 + btrfs_clean_old_snapshots(root);
100474 trans = btrfs_start_transaction(root, 1);
100475 ret = btrfs_commit_transaction(trans, root);
100476 sb->s_dirt = 0;
100477 @@ -510,10 +512,6 @@
100478 struct btrfs_root *root = btrfs_sb(sb);
100479 int ret;
100480
100481 - ret = btrfs_parse_options(root, data);
100482 - if (ret)
100483 - return -EINVAL;
100484 -
100485 if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY))
100486 return 0;
100487
100488 @@ -585,18 +583,17 @@
100489 struct btrfs_ioctl_vol_args *vol;
100490 struct btrfs_fs_devices *fs_devices;
100491 int ret = -ENOTTY;
100492 + int len;
100493
100494 if (!capable(CAP_SYS_ADMIN))
100495 return -EPERM;
100496
100497 vol = kmalloc(sizeof(*vol), GFP_KERNEL);
100498 - if (!vol)
100499 - return -ENOMEM;
100500 -
100501 if (copy_from_user(vol, (void __user *)arg, sizeof(*vol))) {
100502 ret = -EFAULT;
100503 goto out;
100504 }
100505 + len = strnlen(vol->name, BTRFS_PATH_NAME_MAX);
100506
100507 switch (cmd) {
100508 case BTRFS_IOC_SCAN_DEV:
100509 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/btrfs/transaction.c linux-2.6.29-rc3.owrt/fs/btrfs/transaction.c
100510 --- linux-2.6.29.owrt/fs/btrfs/transaction.c 2009-05-10 22:04:39.000000000 +0200
100511 +++ linux-2.6.29-rc3.owrt/fs/btrfs/transaction.c 2009-05-10 23:48:29.000000000 +0200
100512 @@ -688,9 +688,7 @@
100513 num_bytes -= btrfs_root_used(&dirty->root->root_item);
100514 bytes_used = btrfs_root_used(&root->root_item);
100515 if (num_bytes) {
100516 - mutex_lock(&root->fs_info->trans_mutex);
100517 btrfs_record_root_in_trans(root);
100518 - mutex_unlock(&root->fs_info->trans_mutex);
100519 btrfs_set_root_used(&root->root_item,
100520 bytes_used - num_bytes);
100521 }
100522 @@ -854,9 +852,11 @@
100523 {
100524 struct btrfs_pending_snapshot *pending;
100525 struct list_head *head = &trans->transaction->pending_snapshots;
100526 + struct list_head *cur;
100527 int ret;
100528
100529 - list_for_each_entry(pending, head, list) {
100530 + list_for_each(cur, head) {
100531 + pending = list_entry(cur, struct btrfs_pending_snapshot, list);
100532 ret = create_pending_snapshot(trans, fs_info, pending);
100533 BUG_ON(ret);
100534 }
100535 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/btrfs/tree-defrag.c linux-2.6.29-rc3.owrt/fs/btrfs/tree-defrag.c
100536 --- linux-2.6.29.owrt/fs/btrfs/tree-defrag.c 2009-05-10 22:04:39.000000000 +0200
100537 +++ linux-2.6.29-rc3.owrt/fs/btrfs/tree-defrag.c 2009-05-10 23:48:29.000000000 +0200
100538 @@ -74,7 +74,6 @@
100539 u32 nritems;
100540
100541 root_node = btrfs_lock_root_node(root);
100542 - btrfs_set_lock_blocking(root_node);
100543 nritems = btrfs_header_nritems(root_node);
100544 root->defrag_max.objectid = 0;
100545 /* from above we know this is not a leaf */
100546 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/btrfs/tree-log.c linux-2.6.29-rc3.owrt/fs/btrfs/tree-log.c
100547 --- linux-2.6.29.owrt/fs/btrfs/tree-log.c 2009-05-10 22:04:39.000000000 +0200
100548 +++ linux-2.6.29-rc3.owrt/fs/btrfs/tree-log.c 2009-05-10 23:48:29.000000000 +0200
100549 @@ -78,6 +78,104 @@
100550 */
100551
100552 /*
100553 + * btrfs_add_log_tree adds a new per-subvolume log tree into the
100554 + * tree of log tree roots. This must be called with a tree log transaction
100555 + * running (see start_log_trans).
100556 + */
100557 +static int btrfs_add_log_tree(struct btrfs_trans_handle *trans,
100558 + struct btrfs_root *root)
100559 +{
100560 + struct btrfs_key key;
100561 + struct btrfs_root_item root_item;
100562 + struct btrfs_inode_item *inode_item;
100563 + struct extent_buffer *leaf;
100564 + struct btrfs_root *new_root = root;
100565 + int ret;
100566 + u64 objectid = root->root_key.objectid;
100567 +
100568 + leaf = btrfs_alloc_free_block(trans, root, root->leafsize, 0,
100569 + BTRFS_TREE_LOG_OBJECTID,
100570 + trans->transid, 0, 0, 0);
100571 + if (IS_ERR(leaf)) {
100572 + ret = PTR_ERR(leaf);
100573 + return ret;
100574 + }
100575 +
100576 + btrfs_set_header_nritems(leaf, 0);
100577 + btrfs_set_header_level(leaf, 0);
100578 + btrfs_set_header_bytenr(leaf, leaf->start);
100579 + btrfs_set_header_generation(leaf, trans->transid);
100580 + btrfs_set_header_owner(leaf, BTRFS_TREE_LOG_OBJECTID);
100581 +
100582 + write_extent_buffer(leaf, root->fs_info->fsid,
100583 + (unsigned long)btrfs_header_fsid(leaf),
100584 + BTRFS_FSID_SIZE);
100585 + btrfs_mark_buffer_dirty(leaf);
100586 +
100587 + inode_item = &root_item.inode;
100588 + memset(inode_item, 0, sizeof(*inode_item));
100589 + inode_item->generation = cpu_to_le64(1);
100590 + inode_item->size = cpu_to_le64(3);
100591 + inode_item->nlink = cpu_to_le32(1);
100592 + inode_item->nbytes = cpu_to_le64(root->leafsize);
100593 + inode_item->mode = cpu_to_le32(S_IFDIR | 0755);
100594 +
100595 + btrfs_set_root_bytenr(&root_item, leaf->start);
100596 + btrfs_set_root_generation(&root_item, trans->transid);
100597 + btrfs_set_root_level(&root_item, 0);
100598 + btrfs_set_root_refs(&root_item, 0);
100599 + btrfs_set_root_used(&root_item, 0);
100600 +
100601 + memset(&root_item.drop_progress, 0, sizeof(root_item.drop_progress));
100602 + root_item.drop_level = 0;
100603 +
100604 + btrfs_tree_unlock(leaf);
100605 + free_extent_buffer(leaf);
100606 + leaf = NULL;
100607 +
100608 + btrfs_set_root_dirid(&root_item, 0);
100609 +
100610 + key.objectid = BTRFS_TREE_LOG_OBJECTID;
100611 + key.offset = objectid;
100612 + btrfs_set_key_type(&key, BTRFS_ROOT_ITEM_KEY);
100613 + ret = btrfs_insert_root(trans, root->fs_info->log_root_tree, &key,
100614 + &root_item);
100615 + if (ret)
100616 + goto fail;
100617 +
100618 + new_root = btrfs_read_fs_root_no_radix(root->fs_info->log_root_tree,
100619 + &key);
100620 + BUG_ON(!new_root);
100621 +
100622 + WARN_ON(root->log_root);
100623 + root->log_root = new_root;
100624 +
100625 + /*
100626 + * log trees do not get reference counted because they go away
100627 + * before a real commit is actually done. They do store pointers
100628 + * to file data extents, and those reference counts still get
100629 + * updated (along with back refs to the log tree).
100630 + */
100631 + new_root->ref_cows = 0;
100632 + new_root->last_trans = trans->transid;
100633 +
100634 + /*
100635 + * we need to make sure the root block for this new tree
100636 + * is marked as dirty in the dirty_log_pages tree. This
100637 + * is how it gets flushed down to disk at tree log commit time.
100638 + *
100639 + * the tree logging mutex keeps others from coming in and changing
100640 + * the new_root->node, so we can safely access it here
100641 + */
100642 + set_extent_dirty(&new_root->dirty_log_pages, new_root->node->start,
100643 + new_root->node->start + new_root->node->len - 1,
100644 + GFP_NOFS);
100645 +
100646 +fail:
100647 + return ret;
100648 +}
100649 +
100650 +/*
100651 * start a sub transaction and setup the log tree
100652 * this increments the log tree writer count to make the people
100653 * syncing the tree wait for us to finish
100654 @@ -86,14 +184,6 @@
100655 struct btrfs_root *root)
100656 {
100657 int ret;
100658 -
100659 - mutex_lock(&root->log_mutex);
100660 - if (root->log_root) {
100661 - root->log_batch++;
100662 - atomic_inc(&root->log_writers);
100663 - mutex_unlock(&root->log_mutex);
100664 - return 0;
100665 - }
100666 mutex_lock(&root->fs_info->tree_log_mutex);
100667 if (!root->fs_info->log_root_tree) {
100668 ret = btrfs_init_log_root_tree(trans, root->fs_info);
100669 @@ -103,10 +193,9 @@
100670 ret = btrfs_add_log_tree(trans, root);
100671 BUG_ON(ret);
100672 }
100673 + atomic_inc(&root->fs_info->tree_log_writers);
100674 + root->fs_info->tree_log_batch++;
100675 mutex_unlock(&root->fs_info->tree_log_mutex);
100676 - root->log_batch++;
100677 - atomic_inc(&root->log_writers);
100678 - mutex_unlock(&root->log_mutex);
100679 return 0;
100680 }
100681
100682 @@ -123,12 +212,13 @@
100683 if (!root->log_root)
100684 return -ENOENT;
100685
100686 - mutex_lock(&root->log_mutex);
100687 + mutex_lock(&root->fs_info->tree_log_mutex);
100688 if (root->log_root) {
100689 ret = 0;
100690 - atomic_inc(&root->log_writers);
100691 + atomic_inc(&root->fs_info->tree_log_writers);
100692 + root->fs_info->tree_log_batch++;
100693 }
100694 - mutex_unlock(&root->log_mutex);
100695 + mutex_unlock(&root->fs_info->tree_log_mutex);
100696 return ret;
100697 }
100698
100699 @@ -138,11 +228,10 @@
100700 */
100701 static int end_log_trans(struct btrfs_root *root)
100702 {
100703 - if (atomic_dec_and_test(&root->log_writers)) {
100704 - smp_mb();
100705 - if (waitqueue_active(&root->log_writer_wait))
100706 - wake_up(&root->log_writer_wait);
100707 - }
100708 + atomic_dec(&root->fs_info->tree_log_writers);
100709 + smp_mb();
100710 + if (waitqueue_active(&root->fs_info->tree_log_wait))
100711 + wake_up(&root->fs_info->tree_log_wait);
100712 return 0;
100713 }
100714
100715 @@ -1615,7 +1704,6 @@
100716
100717 btrfs_tree_lock(next);
100718 clean_tree_block(trans, root, next);
100719 - btrfs_set_lock_blocking(next);
100720 btrfs_wait_tree_block_writeback(next);
100721 btrfs_tree_unlock(next);
100722
100723 @@ -1662,7 +1750,6 @@
100724 next = path->nodes[*level];
100725 btrfs_tree_lock(next);
100726 clean_tree_block(trans, root, next);
100727 - btrfs_set_lock_blocking(next);
100728 btrfs_wait_tree_block_writeback(next);
100729 btrfs_tree_unlock(next);
100730
100731 @@ -1720,7 +1807,6 @@
100732
100733 btrfs_tree_lock(next);
100734 clean_tree_block(trans, root, next);
100735 - btrfs_set_lock_blocking(next);
100736 btrfs_wait_tree_block_writeback(next);
100737 btrfs_tree_unlock(next);
100738
100739 @@ -1793,7 +1879,6 @@
100740
100741 btrfs_tree_lock(next);
100742 clean_tree_block(trans, log, next);
100743 - btrfs_set_lock_blocking(next);
100744 btrfs_wait_tree_block_writeback(next);
100745 btrfs_tree_unlock(next);
100746
100747 @@ -1817,65 +1902,26 @@
100748 }
100749 }
100750 btrfs_free_path(path);
100751 + if (wc->free)
100752 + free_extent_buffer(log->node);
100753 return ret;
100754 }
100755
100756 -/*
100757 - * helper function to update the item for a given subvolumes log root
100758 - * in the tree of log roots
100759 - */
100760 -static int update_log_root(struct btrfs_trans_handle *trans,
100761 - struct btrfs_root *log)
100762 -{
100763 - int ret;
100764 -
100765 - if (log->log_transid == 1) {
100766 - /* insert root item on the first sync */
100767 - ret = btrfs_insert_root(trans, log->fs_info->log_root_tree,
100768 - &log->root_key, &log->root_item);
100769 - } else {
100770 - ret = btrfs_update_root(trans, log->fs_info->log_root_tree,
100771 - &log->root_key, &log->root_item);
100772 - }
100773 - return ret;
100774 -}
100775 -
100776 -static int wait_log_commit(struct btrfs_root *root, unsigned long transid)
100777 +static int wait_log_commit(struct btrfs_root *log)
100778 {
100779 DEFINE_WAIT(wait);
100780 - int index = transid % 2;
100781 + u64 transid = log->fs_info->tree_log_transid;
100782
100783 - /*
100784 - * we only allow two pending log transactions at a time,
100785 - * so we know that if ours is more than 2 older than the
100786 - * current transaction, we're done
100787 - */
100788 do {
100789 - prepare_to_wait(&root->log_commit_wait[index],
100790 - &wait, TASK_UNINTERRUPTIBLE);
100791 - mutex_unlock(&root->log_mutex);
100792 - if (root->log_transid < transid + 2 &&
100793 - atomic_read(&root->log_commit[index]))
100794 + prepare_to_wait(&log->fs_info->tree_log_wait, &wait,
100795 + TASK_UNINTERRUPTIBLE);
100796 + mutex_unlock(&log->fs_info->tree_log_mutex);
100797 + if (atomic_read(&log->fs_info->tree_log_commit))
100798 schedule();
100799 - finish_wait(&root->log_commit_wait[index], &wait);
100800 - mutex_lock(&root->log_mutex);
100801 - } while (root->log_transid < transid + 2 &&
100802 - atomic_read(&root->log_commit[index]));
100803 - return 0;
100804 -}
100805 -
100806 -static int wait_for_writer(struct btrfs_root *root)
100807 -{
100808 - DEFINE_WAIT(wait);
100809 - while (atomic_read(&root->log_writers)) {
100810 - prepare_to_wait(&root->log_writer_wait,
100811 - &wait, TASK_UNINTERRUPTIBLE);
100812 - mutex_unlock(&root->log_mutex);
100813 - if (atomic_read(&root->log_writers))
100814 - schedule();
100815 - mutex_lock(&root->log_mutex);
100816 - finish_wait(&root->log_writer_wait, &wait);
100817 - }
100818 + finish_wait(&log->fs_info->tree_log_wait, &wait);
100819 + mutex_lock(&log->fs_info->tree_log_mutex);
100820 + } while (transid == log->fs_info->tree_log_transid &&
100821 + atomic_read(&log->fs_info->tree_log_commit));
100822 return 0;
100823 }
100824
100825 @@ -1887,114 +1933,57 @@
100826 int btrfs_sync_log(struct btrfs_trans_handle *trans,
100827 struct btrfs_root *root)
100828 {
100829 - int index1;
100830 - int index2;
100831 int ret;
100832 + unsigned long batch;
100833 struct btrfs_root *log = root->log_root;
100834 - struct btrfs_root *log_root_tree = root->fs_info->log_root_tree;
100835
100836 - mutex_lock(&root->log_mutex);
100837 - index1 = root->log_transid % 2;
100838 - if (atomic_read(&root->log_commit[index1])) {
100839 - wait_log_commit(root, root->log_transid);
100840 - mutex_unlock(&root->log_mutex);
100841 - return 0;
100842 + mutex_lock(&log->fs_info->tree_log_mutex);
100843 + if (atomic_read(&log->fs_info->tree_log_commit)) {
100844 + wait_log_commit(log);
100845 + goto out;
100846 }
100847 - atomic_set(&root->log_commit[index1], 1);
100848 -
100849 - /* wait for previous tree log sync to complete */
100850 - if (atomic_read(&root->log_commit[(index1 + 1) % 2]))
100851 - wait_log_commit(root, root->log_transid - 1);
100852 + atomic_set(&log->fs_info->tree_log_commit, 1);
100853
100854 while (1) {
100855 - unsigned long batch = root->log_batch;
100856 - mutex_unlock(&root->log_mutex);
100857 + batch = log->fs_info->tree_log_batch;
100858 + mutex_unlock(&log->fs_info->tree_log_mutex);
100859 schedule_timeout_uninterruptible(1);
100860 - mutex_lock(&root->log_mutex);
100861 - wait_for_writer(root);
100862 - if (batch == root->log_batch)
100863 + mutex_lock(&log->fs_info->tree_log_mutex);
100864 +
100865 + while (atomic_read(&log->fs_info->tree_log_writers)) {
100866 + DEFINE_WAIT(wait);
100867 + prepare_to_wait(&log->fs_info->tree_log_wait, &wait,
100868 + TASK_UNINTERRUPTIBLE);
100869 + mutex_unlock(&log->fs_info->tree_log_mutex);
100870 + if (atomic_read(&log->fs_info->tree_log_writers))
100871 + schedule();
100872 + mutex_lock(&log->fs_info->tree_log_mutex);
100873 + finish_wait(&log->fs_info->tree_log_wait, &wait);
100874 + }
100875 + if (batch == log->fs_info->tree_log_batch)
100876 break;
100877 }
100878
100879 ret = btrfs_write_and_wait_marked_extents(log, &log->dirty_log_pages);
100880 BUG_ON(ret);
100881 -
100882 - btrfs_set_root_bytenr(&log->root_item, log->node->start);
100883 - btrfs_set_root_generation(&log->root_item, trans->transid);
100884 - btrfs_set_root_level(&log->root_item, btrfs_header_level(log->node));
100885 -
100886 - root->log_batch = 0;
100887 - root->log_transid++;
100888 - log->log_transid = root->log_transid;
100889 - smp_mb();
100890 - /*
100891 - * log tree has been flushed to disk, new modifications of
100892 - * the log will be written to new positions. so it's safe to
100893 - * allow log writers to go in.
100894 - */
100895 - mutex_unlock(&root->log_mutex);
100896 -
100897 - mutex_lock(&log_root_tree->log_mutex);
100898 - log_root_tree->log_batch++;
100899 - atomic_inc(&log_root_tree->log_writers);
100900 - mutex_unlock(&log_root_tree->log_mutex);
100901 -
100902 - ret = update_log_root(trans, log);
100903 - BUG_ON(ret);
100904 -
100905 - mutex_lock(&log_root_tree->log_mutex);
100906 - if (atomic_dec_and_test(&log_root_tree->log_writers)) {
100907 - smp_mb();
100908 - if (waitqueue_active(&log_root_tree->log_writer_wait))
100909 - wake_up(&log_root_tree->log_writer_wait);
100910 - }
100911 -
100912 - index2 = log_root_tree->log_transid % 2;
100913 - if (atomic_read(&log_root_tree->log_commit[index2])) {
100914 - wait_log_commit(log_root_tree, log_root_tree->log_transid);
100915 - mutex_unlock(&log_root_tree->log_mutex);
100916 - goto out;
100917 - }
100918 - atomic_set(&log_root_tree->log_commit[index2], 1);
100919 -
100920 - if (atomic_read(&log_root_tree->log_commit[(index2 + 1) % 2]))
100921 - wait_log_commit(log_root_tree, log_root_tree->log_transid - 1);
100922 -
100923 - wait_for_writer(log_root_tree);
100924 -
100925 - ret = btrfs_write_and_wait_marked_extents(log_root_tree,
100926 - &log_root_tree->dirty_log_pages);
100927 + ret = btrfs_write_and_wait_marked_extents(root->fs_info->log_root_tree,
100928 + &root->fs_info->log_root_tree->dirty_log_pages);
100929 BUG_ON(ret);
100930
100931 btrfs_set_super_log_root(&root->fs_info->super_for_commit,
100932 - log_root_tree->node->start);
100933 + log->fs_info->log_root_tree->node->start);
100934 btrfs_set_super_log_root_level(&root->fs_info->super_for_commit,
100935 - btrfs_header_level(log_root_tree->node));
100936 -
100937 - log_root_tree->log_batch = 0;
100938 - log_root_tree->log_transid++;
100939 - smp_mb();
100940 -
100941 - mutex_unlock(&log_root_tree->log_mutex);
100942 -
100943 - /*
100944 - * nobody else is going to jump in and write the the ctree
100945 - * super here because the log_commit atomic below is protecting
100946 - * us. We must be called with a transaction handle pinning
100947 - * the running transaction open, so a full commit can't hop
100948 - * in and cause problems either.
100949 - */
100950 - write_ctree_super(trans, root->fs_info->tree_root, 2);
100951 + btrfs_header_level(log->fs_info->log_root_tree->node));
100952
100953 - atomic_set(&log_root_tree->log_commit[index2], 0);
100954 + write_ctree_super(trans, log->fs_info->tree_root, 2);
100955 + log->fs_info->tree_log_transid++;
100956 + log->fs_info->tree_log_batch = 0;
100957 + atomic_set(&log->fs_info->tree_log_commit, 0);
100958 smp_mb();
100959 - if (waitqueue_active(&log_root_tree->log_commit_wait[index2]))
100960 - wake_up(&log_root_tree->log_commit_wait[index2]);
100961 + if (waitqueue_active(&log->fs_info->tree_log_wait))
100962 + wake_up(&log->fs_info->tree_log_wait);
100963 out:
100964 - atomic_set(&root->log_commit[index1], 0);
100965 - smp_mb();
100966 - if (waitqueue_active(&root->log_commit_wait[index1]))
100967 - wake_up(&root->log_commit_wait[index1]);
100968 + mutex_unlock(&log->fs_info->tree_log_mutex);
100969 return 0;
100970 }
100971
100972 @@ -2030,18 +2019,38 @@
100973 start, end, GFP_NOFS);
100974 }
100975
100976 - if (log->log_transid > 0) {
100977 - ret = btrfs_del_root(trans, root->fs_info->log_root_tree,
100978 - &log->root_key);
100979 - BUG_ON(ret);
100980 - }
100981 + log = root->log_root;
100982 + ret = btrfs_del_root(trans, root->fs_info->log_root_tree,
100983 + &log->root_key);
100984 + BUG_ON(ret);
100985 root->log_root = NULL;
100986 - free_extent_buffer(log->node);
100987 - kfree(log);
100988 + kfree(root->log_root);
100989 return 0;
100990 }
100991
100992 /*
100993 + * helper function to update the item for a given subvolumes log root
100994 + * in the tree of log roots
100995 + */
100996 +static int update_log_root(struct btrfs_trans_handle *trans,
100997 + struct btrfs_root *log)
100998 +{
100999 + u64 bytenr = btrfs_root_bytenr(&log->root_item);
101000 + int ret;
101001 +
101002 + if (log->node->start == bytenr)
101003 + return 0;
101004 +
101005 + btrfs_set_root_bytenr(&log->root_item, log->node->start);
101006 + btrfs_set_root_generation(&log->root_item, trans->transid);
101007 + btrfs_set_root_level(&log->root_item, btrfs_header_level(log->node));
101008 + ret = btrfs_update_root(trans, log->fs_info->log_root_tree,
101009 + &log->root_key, &log->root_item);
101010 + BUG_ON(ret);
101011 + return ret;
101012 +}
101013 +
101014 +/*
101015 * If both a file and directory are logged, and unlinks or renames are
101016 * mixed in, we have a few interesting corners:
101017 *
101018 @@ -2702,6 +2711,11 @@
101019
101020 btrfs_free_path(path);
101021 btrfs_free_path(dst_path);
101022 +
101023 + mutex_lock(&root->fs_info->tree_log_mutex);
101024 + ret = update_log_root(trans, log);
101025 + BUG_ON(ret);
101026 + mutex_unlock(&root->fs_info->tree_log_mutex);
101027 out:
101028 return 0;
101029 }
101030 @@ -2832,9 +2846,7 @@
101031 BUG_ON(!wc.replay_dest);
101032
101033 wc.replay_dest->log_root = log;
101034 - mutex_lock(&fs_info->trans_mutex);
101035 btrfs_record_root_in_trans(wc.replay_dest);
101036 - mutex_unlock(&fs_info->trans_mutex);
101037 ret = walk_log_tree(trans, log, &wc);
101038 BUG_ON(ret);
101039
101040 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/btrfs/volumes.c linux-2.6.29-rc3.owrt/fs/btrfs/volumes.c
101041 --- linux-2.6.29.owrt/fs/btrfs/volumes.c 2009-05-10 22:04:39.000000000 +0200
101042 +++ linux-2.6.29-rc3.owrt/fs/btrfs/volumes.c 2009-05-10 23:48:29.000000000 +0200
101043 @@ -20,6 +20,7 @@
101044 #include <linux/buffer_head.h>
101045 #include <linux/blkdev.h>
101046 #include <linux/random.h>
101047 +#include <linux/version.h>
101048 #include <asm/div64.h>
101049 #include "compat.h"
101050 #include "ctree.h"
101051 @@ -103,8 +104,10 @@
101052 u64 devid, u8 *uuid)
101053 {
101054 struct btrfs_device *dev;
101055 + struct list_head *cur;
101056
101057 - list_for_each_entry(dev, head, dev_list) {
101058 + list_for_each(cur, head) {
101059 + dev = list_entry(cur, struct btrfs_device, dev_list);
101060 if (dev->devid == devid &&
101061 (!uuid || !memcmp(dev->uuid, uuid, BTRFS_UUID_SIZE))) {
101062 return dev;
101063 @@ -115,9 +118,11 @@
101064
101065 static noinline struct btrfs_fs_devices *find_fsid(u8 *fsid)
101066 {
101067 + struct list_head *cur;
101068 struct btrfs_fs_devices *fs_devices;
101069
101070 - list_for_each_entry(fs_devices, &fs_uuids, list) {
101071 + list_for_each(cur, &fs_uuids) {
101072 + fs_devices = list_entry(cur, struct btrfs_fs_devices, list);
101073 if (memcmp(fsid, fs_devices->fsid, BTRFS_FSID_SIZE) == 0)
101074 return fs_devices;
101075 }
101076 @@ -154,7 +159,6 @@
101077 loop:
101078 spin_lock(&device->io_lock);
101079
101080 -loop_lock:
101081 /* take all the bios off the list at once and process them
101082 * later on (without the lock held). But, remember the
101083 * tail and other pointers so the bios can be properly reinserted
101084 @@ -204,7 +208,7 @@
101085 * is now congested. Back off and let other work structs
101086 * run instead
101087 */
101088 - if (pending && bdi_write_congested(bdi) && num_run > 16 &&
101089 + if (pending && bdi_write_congested(bdi) &&
101090 fs_info->fs_devices->open_devices > 1) {
101091 struct bio *old_head;
101092
101093 @@ -216,8 +220,7 @@
101094 tail->bi_next = old_head;
101095 else
101096 device->pending_bio_tail = tail;
101097 -
101098 - device->running_pending = 1;
101099 + device->running_pending = 0;
101100
101101 spin_unlock(&device->io_lock);
101102 btrfs_requeue_work(&device->work);
101103 @@ -226,11 +229,6 @@
101104 }
101105 if (again)
101106 goto loop;
101107 -
101108 - spin_lock(&device->io_lock);
101109 - if (device->pending_bios)
101110 - goto loop_lock;
101111 - spin_unlock(&device->io_lock);
101112 done:
101113 return 0;
101114 }
101115 @@ -347,11 +345,14 @@
101116
101117 int btrfs_close_extra_devices(struct btrfs_fs_devices *fs_devices)
101118 {
101119 - struct btrfs_device *device, *next;
101120 + struct list_head *tmp;
101121 + struct list_head *cur;
101122 + struct btrfs_device *device;
101123
101124 mutex_lock(&uuid_mutex);
101125 again:
101126 - list_for_each_entry_safe(device, next, &fs_devices->devices, dev_list) {
101127 + list_for_each_safe(cur, tmp, &fs_devices->devices) {
101128 + device = list_entry(cur, struct btrfs_device, dev_list);
101129 if (device->in_fs_metadata)
101130 continue;
101131
101132 @@ -382,12 +383,14 @@
101133
101134 static int __btrfs_close_devices(struct btrfs_fs_devices *fs_devices)
101135 {
101136 + struct list_head *cur;
101137 struct btrfs_device *device;
101138
101139 if (--fs_devices->opened > 0)
101140 return 0;
101141
101142 - list_for_each_entry(device, &fs_devices->devices, dev_list) {
101143 + list_for_each(cur, &fs_devices->devices) {
101144 + device = list_entry(cur, struct btrfs_device, dev_list);
101145 if (device->bdev) {
101146 close_bdev_exclusive(device->bdev, device->mode);
101147 fs_devices->open_devices--;
101148 @@ -436,6 +439,7 @@
101149 {
101150 struct block_device *bdev;
101151 struct list_head *head = &fs_devices->devices;
101152 + struct list_head *cur;
101153 struct btrfs_device *device;
101154 struct block_device *latest_bdev = NULL;
101155 struct buffer_head *bh;
101156 @@ -446,7 +450,8 @@
101157 int seeding = 1;
101158 int ret = 0;
101159
101160 - list_for_each_entry(device, head, dev_list) {
101161 + list_for_each(cur, head) {
101162 + device = list_entry(cur, struct btrfs_device, dev_list);
101163 if (device->bdev)
101164 continue;
101165 if (!device->name)
101166 @@ -573,7 +578,7 @@
101167 *(unsigned long long *)disk_super->fsid,
101168 *(unsigned long long *)(disk_super->fsid + 8));
101169 }
101170 - printk(KERN_CONT "devid %llu transid %llu %s\n",
101171 + printk(KERN_INFO "devid %llu transid %llu %s\n",
101172 (unsigned long long)devid, (unsigned long long)transid, path);
101173 ret = device_list_add(path, disk_super, devid, fs_devices_ret);
101174
101175 @@ -1012,12 +1017,14 @@
101176 }
101177
101178 if (strcmp(device_path, "missing") == 0) {
101179 + struct list_head *cur;
101180 struct list_head *devices;
101181 struct btrfs_device *tmp;
101182
101183 device = NULL;
101184 devices = &root->fs_info->fs_devices->devices;
101185 - list_for_each_entry(tmp, devices, dev_list) {
101186 + list_for_each(cur, devices) {
101187 + tmp = list_entry(cur, struct btrfs_device, dev_list);
101188 if (tmp->in_fs_metadata && !tmp->bdev) {
101189 device = tmp;
101190 break;
101191 @@ -1273,6 +1280,7 @@
101192 struct btrfs_trans_handle *trans;
101193 struct btrfs_device *device;
101194 struct block_device *bdev;
101195 + struct list_head *cur;
101196 struct list_head *devices;
101197 struct super_block *sb = root->fs_info->sb;
101198 u64 total_bytes;
101199 @@ -1296,7 +1304,8 @@
101200 mutex_lock(&root->fs_info->volume_mutex);
101201
101202 devices = &root->fs_info->fs_devices->devices;
101203 - list_for_each_entry(device, devices, dev_list) {
101204 + list_for_each(cur, devices) {
101205 + device = list_entry(cur, struct btrfs_device, dev_list);
101206 if (device->bdev == bdev) {
101207 ret = -EEXIST;
101208 goto error;
101209 @@ -1374,12 +1383,6 @@
101210 ret = btrfs_add_device(trans, root, device);
101211 }
101212
101213 - /*
101214 - * we've got more storage, clear any full flags on the space
101215 - * infos
101216 - */
101217 - btrfs_clear_space_info_full(root->fs_info);
101218 -
101219 unlock_chunks(root);
101220 btrfs_commit_transaction(trans, root);
101221
101222 @@ -1465,8 +1468,6 @@
101223 device->fs_devices->total_rw_bytes += diff;
101224
101225 device->total_bytes = new_size;
101226 - btrfs_clear_space_info_full(device->dev_root->fs_info);
101227 -
101228 return btrfs_update_device(trans, device);
101229 }
101230
101231 @@ -1703,6 +1704,7 @@
101232 int btrfs_balance(struct btrfs_root *dev_root)
101233 {
101234 int ret;
101235 + struct list_head *cur;
101236 struct list_head *devices = &dev_root->fs_info->fs_devices->devices;
101237 struct btrfs_device *device;
101238 u64 old_size;
101239 @@ -1721,7 +1723,8 @@
101240 dev_root = dev_root->fs_info->dev_root;
101241
101242 /* step one make some room on all the devices */
101243 - list_for_each_entry(device, devices, dev_list) {
101244 + list_for_each(cur, devices) {
101245 + device = list_entry(cur, struct btrfs_device, dev_list);
101246 old_size = device->total_bytes;
101247 size_to_free = div_factor(old_size, 1);
101248 size_to_free = min(size_to_free, (u64)1 * 1024 * 1024);
101249 @@ -2902,6 +2905,10 @@
101250 free_extent_map(em);
101251 }
101252
101253 + map = kzalloc(sizeof(*map), GFP_NOFS);
101254 + if (!map)
101255 + return -ENOMEM;
101256 +
101257 em = alloc_extent_map(GFP_NOFS);
101258 if (!em)
101259 return -ENOMEM;
101260 @@ -3110,8 +3117,6 @@
101261 if (!sb)
101262 return -ENOMEM;
101263 btrfs_set_buffer_uptodate(sb);
101264 - btrfs_set_buffer_lockdep_class(sb, 0);
101265 -
101266 write_extent_buffer(sb, super_copy, 0, BTRFS_SUPER_INFO_SIZE);
101267 array_size = btrfs_super_sys_array_size(super_copy);
101268
101269 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/btrfs/xattr.c linux-2.6.29-rc3.owrt/fs/btrfs/xattr.c
101270 --- linux-2.6.29.owrt/fs/btrfs/xattr.c 2009-05-10 22:04:39.000000000 +0200
101271 +++ linux-2.6.29-rc3.owrt/fs/btrfs/xattr.c 2009-05-10 23:48:29.000000000 +0200
101272 @@ -21,7 +21,6 @@
101273 #include <linux/slab.h>
101274 #include <linux/rwsem.h>
101275 #include <linux/xattr.h>
101276 -#include <linux/security.h>
101277 #include "ctree.h"
101278 #include "btrfs_inode.h"
101279 #include "transaction.h"
101280 @@ -46,12 +45,9 @@
101281 /* lookup the xattr by name */
101282 di = btrfs_lookup_xattr(NULL, root, path, inode->i_ino, name,
101283 strlen(name), 0);
101284 - if (!di) {
101285 + if (!di || IS_ERR(di)) {
101286 ret = -ENODATA;
101287 goto out;
101288 - } else if (IS_ERR(di)) {
101289 - ret = PTR_ERR(di);
101290 - goto out;
101291 }
101292
101293 leaf = path->nodes[0];
101294 @@ -66,14 +62,6 @@
101295 ret = -ERANGE;
101296 goto out;
101297 }
101298 -
101299 - /*
101300 - * The way things are packed into the leaf is like this
101301 - * |struct btrfs_dir_item|name|data|
101302 - * where name is the xattr name, so security.foo, and data is the
101303 - * content of the xattr. data_ptr points to the location in memory
101304 - * where the data starts in the in memory leaf
101305 - */
101306 data_ptr = (unsigned long)((char *)(di + 1) +
101307 btrfs_dir_name_len(leaf, di));
101308 read_extent_buffer(leaf, buffer, data_ptr,
101309 @@ -98,7 +86,7 @@
101310 if (!path)
101311 return -ENOMEM;
101312
101313 - trans = btrfs_join_transaction(root, 1);
101314 + trans = btrfs_start_transaction(root, 1);
101315 btrfs_set_trans_block_group(trans, inode);
101316
101317 /* first lets see if we already have this xattr */
101318 @@ -188,6 +176,7 @@
101319 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
101320 if (ret < 0)
101321 goto err;
101322 + ret = 0;
101323 advance = 0;
101324 while (1) {
101325 leaf = path->nodes[0];
101326 @@ -331,34 +320,3 @@
101327 return -EOPNOTSUPP;
101328 return __btrfs_setxattr(dentry->d_inode, name, NULL, 0, XATTR_REPLACE);
101329 }
101330 -
101331 -int btrfs_xattr_security_init(struct inode *inode, struct inode *dir)
101332 -{
101333 - int err;
101334 - size_t len;
101335 - void *value;
101336 - char *suffix;
101337 - char *name;
101338 -
101339 - err = security_inode_init_security(inode, dir, &suffix, &value, &len);
101340 - if (err) {
101341 - if (err == -EOPNOTSUPP)
101342 - return 0;
101343 - return err;
101344 - }
101345 -
101346 - name = kmalloc(XATTR_SECURITY_PREFIX_LEN + strlen(suffix) + 1,
101347 - GFP_NOFS);
101348 - if (!name) {
101349 - err = -ENOMEM;
101350 - } else {
101351 - strcpy(name, XATTR_SECURITY_PREFIX);
101352 - strcpy(name + XATTR_SECURITY_PREFIX_LEN, suffix);
101353 - err = __btrfs_setxattr(inode, name, value, len, 0);
101354 - kfree(name);
101355 - }
101356 -
101357 - kfree(suffix);
101358 - kfree(value);
101359 - return err;
101360 -}
101361 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/btrfs/xattr.h linux-2.6.29-rc3.owrt/fs/btrfs/xattr.h
101362 --- linux-2.6.29.owrt/fs/btrfs/xattr.h 2009-05-10 22:04:39.000000000 +0200
101363 +++ linux-2.6.29-rc3.owrt/fs/btrfs/xattr.h 2009-05-10 23:48:29.000000000 +0200
101364 @@ -36,6 +36,4 @@
101365 const void *value, size_t size, int flags);
101366 extern int btrfs_removexattr(struct dentry *dentry, const char *name);
101367
101368 -extern int btrfs_xattr_security_init(struct inode *inode, struct inode *dir);
101369 -
101370 #endif /* __XATTR__ */
101371 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/buffer.c linux-2.6.29-rc3.owrt/fs/buffer.c
101372 --- linux-2.6.29.owrt/fs/buffer.c 2009-05-10 22:04:39.000000000 +0200
101373 +++ linux-2.6.29-rc3.owrt/fs/buffer.c 2009-05-10 23:48:29.000000000 +0200
101374 @@ -760,9 +760,15 @@
101375 * If warn is true, then emit a warning if the page is not uptodate and has
101376 * not been truncated.
101377 */
101378 -static void __set_page_dirty(struct page *page,
101379 +static int __set_page_dirty(struct page *page,
101380 struct address_space *mapping, int warn)
101381 {
101382 + if (unlikely(!mapping))
101383 + return !TestSetPageDirty(page);
101384 +
101385 + if (TestSetPageDirty(page))
101386 + return 0;
101387 +
101388 spin_lock_irq(&mapping->tree_lock);
101389 if (page->mapping) { /* Race with truncate? */
101390 WARN_ON_ONCE(warn && !PageUptodate(page));
101391 @@ -771,7 +777,6 @@
101392 __inc_zone_page_state(page, NR_FILE_DIRTY);
101393 __inc_bdi_stat(mapping->backing_dev_info,
101394 BDI_RECLAIMABLE);
101395 - task_dirty_inc(current);
101396 task_io_account_write(PAGE_CACHE_SIZE);
101397 }
101398 radix_tree_tag_set(&mapping->page_tree,
101399 @@ -779,6 +784,8 @@
101400 }
101401 spin_unlock_irq(&mapping->tree_lock);
101402 __mark_inode_dirty(mapping->host, I_DIRTY_PAGES);
101403 +
101404 + return 1;
101405 }
101406
101407 /*
101408 @@ -808,7 +815,6 @@
101409 */
101410 int __set_page_dirty_buffers(struct page *page)
101411 {
101412 - int newly_dirty;
101413 struct address_space *mapping = page_mapping(page);
101414
101415 if (unlikely(!mapping))
101416 @@ -824,12 +830,9 @@
101417 bh = bh->b_this_page;
101418 } while (bh != head);
101419 }
101420 - newly_dirty = !TestSetPageDirty(page);
101421 spin_unlock(&mapping->private_lock);
101422
101423 - if (newly_dirty)
101424 - __set_page_dirty(page, mapping, 1);
101425 - return newly_dirty;
101426 + return __set_page_dirty(page, mapping, 1);
101427 }
101428 EXPORT_SYMBOL(__set_page_dirty_buffers);
101429
101430 @@ -1258,11 +1261,8 @@
101431 return;
101432 }
101433
101434 - if (!test_set_buffer_dirty(bh)) {
101435 - struct page *page = bh->b_page;
101436 - if (!TestSetPageDirty(page))
101437 - __set_page_dirty(page, page_mapping(page), 0);
101438 - }
101439 + if (!test_set_buffer_dirty(bh))
101440 + __set_page_dirty(bh->b_page, page_mapping(bh->b_page), 0);
101441 }
101442
101443 /*
101444 @@ -2688,7 +2688,7 @@
101445 struct buffer_head *bh;
101446 BUG_ON(fsdata != NULL && page_has_buffers(page));
101447
101448 - if (unlikely(copied < len) && head)
101449 + if (unlikely(copied < len) && !page_has_buffers(page))
101450 attach_nobh_buffers(page, head);
101451 if (page_has_buffers(page))
101452 return generic_write_end(file, mapping, pos, len,
101453 @@ -3108,7 +3108,7 @@
101454 if (test_clear_buffer_dirty(bh)) {
101455 get_bh(bh);
101456 bh->b_end_io = end_buffer_write_sync;
101457 - ret = submit_bh(WRITE, bh);
101458 + ret = submit_bh(WRITE_SYNC, bh);
101459 wait_on_buffer(bh);
101460 if (buffer_eopnotsupp(bh)) {
101461 clear_buffer_eopnotsupp(bh);
101462 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/cifs/CHANGES linux-2.6.29-rc3.owrt/fs/cifs/CHANGES
101463 --- linux-2.6.29.owrt/fs/cifs/CHANGES 2009-05-10 22:04:39.000000000 +0200
101464 +++ linux-2.6.29-rc3.owrt/fs/cifs/CHANGES 2009-05-10 23:48:29.000000000 +0200
101465 @@ -1,13 +1,3 @@
101466 -Version 1.57
101467 -------------
101468 -Improve support for multiple security contexts to the same server. We
101469 -used to use the same "vcnumber" for all connections which could cause
101470 -the server to treat subsequent connections, especially those that
101471 -are authenticated as guest, as reconnections, invalidating the earlier
101472 -user's smb session. This fix allows cifs to mount multiple times to the
101473 -same server with different userids without risking invalidating earlier
101474 -established security contexts.
101475 -
101476 Version 1.56
101477 ------------
101478 Add "forcemandatorylock" mount option to allow user to use mandatory
101479 @@ -15,12 +5,7 @@
101480 support posix byte range locks. Fix query of root inode when prefixpath
101481 specified and user does not have access to query information about the
101482 top of the share. Fix problem in 2.6.28 resolving DFS paths to
101483 -Samba servers (worked to Windows). Fix rmdir so that pending search
101484 -(readdir) requests do not get invalid results which include the now
101485 -removed directory. Fix oops in cifs_dfs_ref.c when prefixpath is not reachable
101486 -when using DFS. Add better file create support to servers which support
101487 -the CIFS POSIX protocol extensions (this adds support for new flags
101488 -on create, and improves semantics for write of locked ranges).
101489 +Samba servers (worked to Windows).
101490
101491 Version 1.55
101492 ------------
101493 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/cifs/cifsencrypt.c linux-2.6.29-rc3.owrt/fs/cifs/cifsencrypt.c
101494 --- linux-2.6.29.owrt/fs/cifs/cifsencrypt.c 2009-05-10 22:04:39.000000000 +0200
101495 +++ linux-2.6.29-rc3.owrt/fs/cifs/cifsencrypt.c 2009-05-10 23:48:29.000000000 +0200
101496 @@ -48,11 +48,11 @@
101497 if ((cifs_pdu == NULL) || (signature == NULL) || (key == NULL))
101498 return -EINVAL;
101499
101500 - cifs_MD5_init(&context);
101501 - cifs_MD5_update(&context, (char *)&key->data, key->len);
101502 - cifs_MD5_update(&context, cifs_pdu->Protocol, cifs_pdu->smb_buf_length);
101503 + MD5Init(&context);
101504 + MD5Update(&context, (char *)&key->data, key->len);
101505 + MD5Update(&context, cifs_pdu->Protocol, cifs_pdu->smb_buf_length);
101506
101507 - cifs_MD5_final(signature, &context);
101508 + MD5Final(signature, &context);
101509 return 0;
101510 }
101511
101512 @@ -96,8 +96,8 @@
101513 if ((iov == NULL) || (signature == NULL) || (key == NULL))
101514 return -EINVAL;
101515
101516 - cifs_MD5_init(&context);
101517 - cifs_MD5_update(&context, (char *)&key->data, key->len);
101518 + MD5Init(&context);
101519 + MD5Update(&context, (char *)&key->data, key->len);
101520 for (i = 0; i < n_vec; i++) {
101521 if (iov[i].iov_len == 0)
101522 continue;
101523 @@ -110,13 +110,13 @@
101524 if (i == 0) {
101525 if (iov[0].iov_len <= 8) /* cmd field at offset 9 */
101526 break; /* nothing to sign or corrupt header */
101527 - cifs_MD5_update(&context, iov[0].iov_base+4,
101528 + MD5Update(&context, iov[0].iov_base+4,
101529 iov[0].iov_len-4);
101530 } else
101531 - cifs_MD5_update(&context, iov[i].iov_base, iov[i].iov_len);
101532 + MD5Update(&context, iov[i].iov_base, iov[i].iov_len);
101533 }
101534
101535 - cifs_MD5_final(signature, &context);
101536 + MD5Final(signature, &context);
101537
101538 return 0;
101539 }
101540 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/cifs/cifsfs.h linux-2.6.29-rc3.owrt/fs/cifs/cifsfs.h
101541 --- linux-2.6.29.owrt/fs/cifs/cifsfs.h 2009-05-10 22:04:39.000000000 +0200
101542 +++ linux-2.6.29-rc3.owrt/fs/cifs/cifsfs.h 2009-05-10 23:48:29.000000000 +0200
101543 @@ -100,5 +100,5 @@
101544 extern const struct export_operations cifs_export_ops;
101545 #endif /* EXPERIMENTAL */
101546
101547 -#define CIFS_VERSION "1.57"
101548 +#define CIFS_VERSION "1.56"
101549 #endif /* _CIFSFS_H */
101550 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/cifs/cifsglob.h linux-2.6.29-rc3.owrt/fs/cifs/cifsglob.h
101551 --- linux-2.6.29.owrt/fs/cifs/cifsglob.h 2009-05-10 22:04:39.000000000 +0200
101552 +++ linux-2.6.29-rc3.owrt/fs/cifs/cifsglob.h 2009-05-10 23:48:29.000000000 +0200
101553 @@ -164,12 +164,9 @@
101554 /* multiplexed reads or writes */
101555 unsigned int maxBuf; /* maxBuf specifies the maximum */
101556 /* message size the server can send or receive for non-raw SMBs */
101557 - unsigned int max_rw; /* maxRw specifies the maximum */
101558 + unsigned int maxRw; /* maxRw specifies the maximum */
101559 /* message size the server can send or receive for */
101560 /* SMB_COM_WRITE_RAW or SMB_COM_READ_RAW. */
101561 - unsigned int max_vcs; /* maximum number of smb sessions, at least
101562 - those that can be specified uniquely with
101563 - vcnumbers */
101564 char sessid[4]; /* unique token id for this session */
101565 /* (returned on Negotiate */
101566 int capabilities; /* allow selective disabling of caps by smb sess */
101567 @@ -213,7 +210,6 @@
101568 unsigned overrideSecFlg; /* if non-zero override global sec flags */
101569 __u16 ipc_tid; /* special tid for connection to IPC share */
101570 __u16 flags;
101571 - __u16 vcnum;
101572 char *serverOS; /* name of operating system underlying server */
101573 char *serverNOS; /* name of network operating system of server */
101574 char *serverDomain; /* security realm of server */
101575 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/cifs/cifsproto.h linux-2.6.29-rc3.owrt/fs/cifs/cifsproto.h
101576 --- linux-2.6.29.owrt/fs/cifs/cifsproto.h 2009-05-10 22:04:39.000000000 +0200
101577 +++ linux-2.6.29-rc3.owrt/fs/cifs/cifsproto.h 2009-05-10 23:48:29.000000000 +0200
101578 @@ -35,14 +35,13 @@
101579 extern void cifs_buf_release(void *);
101580 extern struct smb_hdr *cifs_small_buf_get(void);
101581 extern void cifs_small_buf_release(void *);
101582 -extern int smb_send(struct TCP_Server_Info *, struct smb_hdr *,
101583 - unsigned int /* length */);
101584 +extern int smb_send(struct socket *, struct smb_hdr *,
101585 + unsigned int /* length */ , struct sockaddr *, bool);
101586 extern unsigned int _GetXid(void);
101587 extern void _FreeXid(unsigned int);
101588 #define GetXid() (int)_GetXid(); cFYI(1,("CIFS VFS: in %s as Xid: %d with uid: %d",__func__, xid,current_fsuid()));
101589 #define FreeXid(curr_xid) {_FreeXid(curr_xid); cFYI(1,("CIFS VFS: leaving %s (xid = %d) rc = %d",__func__,curr_xid,(int)rc));}
101590 extern char *build_path_from_dentry(struct dentry *);
101591 -extern char *cifs_build_path_to_root(struct cifs_sb_info *cifs_sb);
101592 extern char *build_wildcard_path_from_dentry(struct dentry *direntry);
101593 /* extern void renew_parental_timestamps(struct dentry *direntry);*/
101594 extern int SendReceive(const unsigned int /* xid */ , struct cifsSesInfo *,
101595 @@ -92,9 +91,6 @@
101596 extern __le64 cnvrtDosCifsTm(__u16 date, __u16 time);
101597 extern struct timespec cnvrtDosUnixTm(__u16 date, __u16 time);
101598
101599 -extern void posix_fill_in_inode(struct inode *tmp_inode,
101600 - FILE_UNIX_BASIC_INFO *pData, int isNewInode);
101601 -extern struct inode *cifs_new_inode(struct super_block *sb, __u64 *inum);
101602 extern int cifs_get_inode_info(struct inode **pinode,
101603 const unsigned char *search_path,
101604 FILE_ALL_INFO *pfile_info,
101605 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/cifs/cifssmb.c linux-2.6.29-rc3.owrt/fs/cifs/cifssmb.c
101606 --- linux-2.6.29.owrt/fs/cifs/cifssmb.c 2009-05-10 22:04:39.000000000 +0200
101607 +++ linux-2.6.29-rc3.owrt/fs/cifs/cifssmb.c 2009-05-10 23:48:29.000000000 +0200
101608 @@ -528,15 +528,14 @@
101609 server->maxReq = le16_to_cpu(rsp->MaxMpxCount);
101610 server->maxBuf = min((__u32)le16_to_cpu(rsp->MaxBufSize),
101611 (__u32)CIFSMaxBufSize + MAX_CIFS_HDR_SIZE);
101612 - server->max_vcs = le16_to_cpu(rsp->MaxNumberVcs);
101613 GETU32(server->sessid) = le32_to_cpu(rsp->SessionKey);
101614 /* even though we do not use raw we might as well set this
101615 accurately, in case we ever find a need for it */
101616 if ((le16_to_cpu(rsp->RawMode) & RAW_ENABLE) == RAW_ENABLE) {
101617 - server->max_rw = 0xFF00;
101618 + server->maxRw = 0xFF00;
101619 server->capabilities = CAP_MPX_MODE | CAP_RAW_MODE;
101620 } else {
101621 - server->max_rw = 0;/* do not need to use raw anyway */
101622 + server->maxRw = 0;/* we do not need to use raw anyway */
101623 server->capabilities = CAP_MPX_MODE;
101624 }
101625 tmp = (__s16)le16_to_cpu(rsp->ServerTimeZone);
101626 @@ -639,7 +638,7 @@
101627 /* probably no need to store and check maxvcs */
101628 server->maxBuf = min(le32_to_cpu(pSMBr->MaxBufferSize),
101629 (__u32) CIFSMaxBufSize + MAX_CIFS_HDR_SIZE);
101630 - server->max_rw = le32_to_cpu(pSMBr->MaxRawSize);
101631 + server->maxRw = le32_to_cpu(pSMBr->MaxRawSize);
101632 cFYI(DBG2, ("Max buf = %d", ses->server->maxBuf));
101633 GETU32(ses->server->sessid) = le32_to_cpu(pSMBr->SessionKey);
101634 server->capabilities = le32_to_cpu(pSMBr->Capabilities);
101635 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/cifs/connect.c linux-2.6.29-rc3.owrt/fs/cifs/connect.c
101636 --- linux-2.6.29.owrt/fs/cifs/connect.c 2009-05-10 22:04:39.000000000 +0200
101637 +++ linux-2.6.29-rc3.owrt/fs/cifs/connect.c 2009-05-10 23:48:29.000000000 +0200
101638 @@ -23,6 +23,7 @@
101639 #include <linux/string.h>
101640 #include <linux/list.h>
101641 #include <linux/wait.h>
101642 +#include <linux/ipv6.h>
101643 #include <linux/pagemap.h>
101644 #include <linux/ctype.h>
101645 #include <linux/utsname.h>
101646 @@ -34,7 +35,6 @@
101647 #include <linux/freezer.h>
101648 #include <asm/uaccess.h>
101649 #include <asm/processor.h>
101650 -#include <net/ipv6.h>
101651 #include "cifspdu.h"
101652 #include "cifsglob.h"
101653 #include "cifsproto.h"
101654 @@ -1354,7 +1354,7 @@
101655 }
101656
101657 static struct TCP_Server_Info *
101658 -cifs_find_tcp_session(struct sockaddr_storage *addr)
101659 +cifs_find_tcp_session(struct sockaddr *addr)
101660 {
101661 struct list_head *tmp;
101662 struct TCP_Server_Info *server;
101663 @@ -1374,13 +1374,13 @@
101664 if (server->tcpStatus == CifsNew)
101665 continue;
101666
101667 - if (addr->ss_family == AF_INET &&
101668 + if (addr->sa_family == AF_INET &&
101669 (addr4->sin_addr.s_addr !=
101670 server->addr.sockAddr.sin_addr.s_addr))
101671 continue;
101672 - else if (addr->ss_family == AF_INET6 &&
101673 - !ipv6_addr_equal(&server->addr.sockAddr6.sin6_addr,
101674 - &addr6->sin6_addr))
101675 + else if (addr->sa_family == AF_INET6 &&
101676 + memcmp(&server->addr.sockAddr6.sin6_addr,
101677 + &addr6->sin6_addr, sizeof(addr6->sin6_addr)))
101678 continue;
101679
101680 ++server->srv_count;
101681 @@ -1419,12 +1419,12 @@
101682 cifs_get_tcp_session(struct smb_vol *volume_info)
101683 {
101684 struct TCP_Server_Info *tcp_ses = NULL;
101685 - struct sockaddr_storage addr;
101686 + struct sockaddr addr;
101687 struct sockaddr_in *sin_server = (struct sockaddr_in *) &addr;
101688 struct sockaddr_in6 *sin_server6 = (struct sockaddr_in6 *) &addr;
101689 int rc;
101690
101691 - memset(&addr, 0, sizeof(struct sockaddr_storage));
101692 + memset(&addr, 0, sizeof(struct sockaddr));
101693
101694 if (volume_info->UNCip && volume_info->UNC) {
101695 rc = cifs_inet_pton(AF_INET, volume_info->UNCip,
101696 @@ -1435,9 +1435,9 @@
101697 rc = cifs_inet_pton(AF_INET6, volume_info->UNCip,
101698 &sin_server6->sin6_addr.in6_u);
101699 if (rc > 0)
101700 - addr.ss_family = AF_INET6;
101701 + addr.sa_family = AF_INET6;
101702 } else {
101703 - addr.ss_family = AF_INET;
101704 + addr.sa_family = AF_INET;
101705 }
101706
101707 if (rc <= 0) {
101708 @@ -1502,7 +1502,7 @@
101709 tcp_ses->tcpStatus = CifsNew;
101710 ++tcp_ses->srv_count;
101711
101712 - if (addr.ss_family == AF_INET6) {
101713 + if (addr.sa_family == AF_INET6) {
101714 cFYI(1, ("attempting ipv6 connect"));
101715 /* BB should we allow ipv6 on port 139? */
101716 /* other OS never observed in Wild doing 139 with v6 */
101717 @@ -1802,7 +1802,7 @@
101718 * user space buffer
101719 */
101720 socket->sk->sk_rcvtimeo = 7 * HZ;
101721 - socket->sk->sk_sndtimeo = 5 * HZ;
101722 + socket->sk->sk_sndtimeo = 3 * HZ;
101723
101724 /* make the bufsizes depend on wsize/rsize and max requests */
101725 if (server->noautotune) {
101726 @@ -1860,7 +1860,9 @@
101727 smb_buf = (struct smb_hdr *)ses_init_buf;
101728 /* sizeof RFC1002_SESSION_REQUEST with no scope */
101729 smb_buf->smb_buf_length = 0x81000044;
101730 - rc = smb_send(server, smb_buf, 0x44);
101731 + rc = smb_send(socket, smb_buf, 0x44,
101732 + (struct sockaddr *) &server->addr.sockAddr,
101733 + server->noblocksnd);
101734 kfree(ses_init_buf);
101735 msleep(1); /* RFC1001 layer in at least one server
101736 requires very short break before negprot
101737 @@ -1953,7 +1955,7 @@
101738 * user space buffer
101739 */
101740 socket->sk->sk_rcvtimeo = 7 * HZ;
101741 - socket->sk->sk_sndtimeo = 5 * HZ;
101742 + socket->sk->sk_sndtimeo = 3 * HZ;
101743 server->ssocket = socket;
101744
101745 return rc;
101746 @@ -2180,33 +2182,6 @@
101747 "mount option supported"));
101748 }
101749
101750 -static int
101751 -is_path_accessible(int xid, struct cifsTconInfo *tcon,
101752 - struct cifs_sb_info *cifs_sb, const char *full_path)
101753 -{
101754 - int rc;
101755 - __u64 inode_num;
101756 - FILE_ALL_INFO *pfile_info;
101757 -
101758 - rc = CIFSGetSrvInodeNumber(xid, tcon, full_path, &inode_num,
101759 - cifs_sb->local_nls,
101760 - cifs_sb->mnt_cifs_flags &
101761 - CIFS_MOUNT_MAP_SPECIAL_CHR);
101762 - if (rc != -EOPNOTSUPP)
101763 - return rc;
101764 -
101765 - pfile_info = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL);
101766 - if (pfile_info == NULL)
101767 - return -ENOMEM;
101768 -
101769 - rc = CIFSSMBQPathInfo(xid, tcon, full_path, pfile_info,
101770 - 0 /* not legacy */, cifs_sb->local_nls,
101771 - cifs_sb->mnt_cifs_flags &
101772 - CIFS_MOUNT_MAP_SPECIAL_CHR);
101773 - kfree(pfile_info);
101774 - return rc;
101775 -}
101776 -
101777 int
101778 cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
101779 char *mount_data, const char *devname)
101780 @@ -2217,7 +2192,6 @@
101781 struct cifsSesInfo *pSesInfo = NULL;
101782 struct cifsTconInfo *tcon = NULL;
101783 struct TCP_Server_Info *srvTcp = NULL;
101784 - char *full_path;
101785
101786 xid = GetXid();
101787
101788 @@ -2454,23 +2428,6 @@
101789 cifs_sb->rsize = min(cifs_sb->rsize,
101790 (tcon->ses->server->maxBuf - MAX_CIFS_HDR_SIZE));
101791
101792 - if (!rc && cifs_sb->prepathlen) {
101793 - /* build_path_to_root works only when we have a valid tcon */
101794 - full_path = cifs_build_path_to_root(cifs_sb);
101795 - if (full_path == NULL) {
101796 - rc = -ENOMEM;
101797 - goto mount_fail_check;
101798 - }
101799 - rc = is_path_accessible(xid, tcon, cifs_sb, full_path);
101800 - if (rc) {
101801 - cERROR(1, ("Path %s in not accessible: %d",
101802 - full_path, rc));
101803 - kfree(full_path);
101804 - goto mount_fail_check;
101805 - }
101806 - kfree(full_path);
101807 - }
101808 -
101809 /* volume_info->password is freed above when existing session found
101810 (in which case it is not needed anymore) but when new sesion is created
101811 the password ptr is put in the new session structure (in which case the
101812 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/cifs/dir.c linux-2.6.29-rc3.owrt/fs/cifs/dir.c
101813 --- linux-2.6.29.owrt/fs/cifs/dir.c 2009-05-10 22:04:39.000000000 +0200
101814 +++ linux-2.6.29-rc3.owrt/fs/cifs/dir.c 2009-05-10 23:48:29.000000000 +0200
101815 @@ -3,7 +3,7 @@
101816 *
101817 * vfs operations that deal with dentries
101818 *
101819 - * Copyright (C) International Business Machines Corp., 2002,2009
101820 + * Copyright (C) International Business Machines Corp., 2002,2008
101821 * Author(s): Steve French (sfrench@us.ibm.com)
101822 *
101823 * This library is free software; you can redistribute it and/or modify
101824 @@ -129,89 +129,6 @@
101825 return full_path;
101826 }
101827
101828 -static int cifs_posix_open(char *full_path, struct inode **pinode,
101829 - struct super_block *sb, int mode, int oflags,
101830 - int *poplock, __u16 *pnetfid, int xid)
101831 -{
101832 - int rc;
101833 - __u32 oplock;
101834 - FILE_UNIX_BASIC_INFO *presp_data;
101835 - __u32 posix_flags = 0;
101836 - struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
101837 -
101838 - cFYI(1, ("posix open %s", full_path));
101839 -
101840 - presp_data = kzalloc(sizeof(FILE_UNIX_BASIC_INFO), GFP_KERNEL);
101841 - if (presp_data == NULL)
101842 - return -ENOMEM;
101843 -
101844 -/* So far cifs posix extensions can only map the following flags.
101845 - There are other valid fmode oflags such as FMODE_LSEEK, FMODE_PREAD, but
101846 - so far we do not seem to need them, and we can treat them as local only */
101847 - if ((oflags & (FMODE_READ | FMODE_WRITE)) ==
101848 - (FMODE_READ | FMODE_WRITE))
101849 - posix_flags = SMB_O_RDWR;
101850 - else if (oflags & FMODE_READ)
101851 - posix_flags = SMB_O_RDONLY;
101852 - else if (oflags & FMODE_WRITE)
101853 - posix_flags = SMB_O_WRONLY;
101854 - if (oflags & O_CREAT)
101855 - posix_flags |= SMB_O_CREAT;
101856 - if (oflags & O_EXCL)
101857 - posix_flags |= SMB_O_EXCL;
101858 - if (oflags & O_TRUNC)
101859 - posix_flags |= SMB_O_TRUNC;
101860 - if (oflags & O_APPEND)
101861 - posix_flags |= SMB_O_APPEND;
101862 - if (oflags & O_SYNC)
101863 - posix_flags |= SMB_O_SYNC;
101864 - if (oflags & O_DIRECTORY)
101865 - posix_flags |= SMB_O_DIRECTORY;
101866 - if (oflags & O_NOFOLLOW)
101867 - posix_flags |= SMB_O_NOFOLLOW;
101868 - if (oflags & O_DIRECT)
101869 - posix_flags |= SMB_O_DIRECT;
101870 -
101871 -
101872 - rc = CIFSPOSIXCreate(xid, cifs_sb->tcon, posix_flags, mode,
101873 - pnetfid, presp_data, &oplock, full_path,
101874 - cifs_sb->local_nls, cifs_sb->mnt_cifs_flags &
101875 - CIFS_MOUNT_MAP_SPECIAL_CHR);
101876 - if (rc)
101877 - goto posix_open_ret;
101878 -
101879 - if (presp_data->Type == cpu_to_le32(-1))
101880 - goto posix_open_ret; /* open ok, caller does qpathinfo */
101881 -
101882 - /* get new inode and set it up */
101883 - if (!pinode)
101884 - goto posix_open_ret; /* caller does not need info */
101885 -
101886 - *pinode = cifs_new_inode(sb, &presp_data->UniqueId);
101887 -
101888 - /* We do not need to close the file if new_inode fails since
101889 - the caller will retry qpathinfo as long as inode is null */
101890 - if (*pinode == NULL)
101891 - goto posix_open_ret;
101892 -
101893 - posix_fill_in_inode(*pinode, presp_data, 1);
101894 -
101895 -posix_open_ret:
101896 - kfree(presp_data);
101897 - return rc;
101898 -}
101899 -
101900 -static void setup_cifs_dentry(struct cifsTconInfo *tcon,
101901 - struct dentry *direntry,
101902 - struct inode *newinode)
101903 -{
101904 - if (tcon->nocase)
101905 - direntry->d_op = &cifs_ci_dentry_ops;
101906 - else
101907 - direntry->d_op = &cifs_dentry_ops;
101908 - d_instantiate(direntry, newinode);
101909 -}
101910 -
101911 /* Inode operations in similar order to how they appear in Linux file fs.h */
101912
101913 int
101914 @@ -222,21 +139,14 @@
101915 int xid;
101916 int create_options = CREATE_NOT_DIR;
101917 int oplock = 0;
101918 - int oflags;
101919 - /*
101920 - * BB below access is probably too much for mknod to request
101921 - * but we have to do query and setpathinfo so requesting
101922 - * less could fail (unless we want to request getatr and setatr
101923 - * permissions (only). At least for POSIX we do not have to
101924 - * request so much.
101925 - */
101926 int desiredAccess = GENERIC_READ | GENERIC_WRITE;
101927 __u16 fileHandle;
101928 struct cifs_sb_info *cifs_sb;
101929 - struct cifsTconInfo *tcon;
101930 + struct cifsTconInfo *pTcon;
101931 char *full_path = NULL;
101932 FILE_ALL_INFO *buf = NULL;
101933 struct inode *newinode = NULL;
101934 + struct cifsFileInfo *pCifsFile = NULL;
101935 struct cifsInodeInfo *pCifsInode;
101936 int disposition = FILE_OVERWRITE_IF;
101937 bool write_only = false;
101938 @@ -244,7 +154,7 @@
101939 xid = GetXid();
101940
101941 cifs_sb = CIFS_SB(inode->i_sb);
101942 - tcon = cifs_sb->tcon;
101943 + pTcon = cifs_sb->tcon;
101944
101945 full_path = build_path_from_dentry(direntry);
101946 if (full_path == NULL) {
101947 @@ -252,44 +162,12 @@
101948 return -ENOMEM;
101949 }
101950
101951 - mode &= ~current->fs->umask;
101952 - if (oplockEnabled)
101953 - oplock = REQ_OPLOCK;
101954 -
101955 - if (nd && (nd->flags & LOOKUP_OPEN))
101956 - oflags = nd->intent.open.flags;
101957 - else
101958 - oflags = FMODE_READ;
101959 -
101960 - if (tcon->unix_ext && (tcon->ses->capabilities & CAP_UNIX) &&
101961 - (CIFS_UNIX_POSIX_PATH_OPS_CAP &
101962 - le64_to_cpu(tcon->fsUnixInfo.Capability))) {
101963 - rc = cifs_posix_open(full_path, &newinode, inode->i_sb,
101964 - mode, oflags, &oplock, &fileHandle, xid);
101965 - /* EIO could indicate that (posix open) operation is not
101966 - supported, despite what server claimed in capability
101967 - negotation. EREMOTE indicates DFS junction, which is not
101968 - handled in posix open */
101969 -
101970 - if ((rc == 0) && (newinode == NULL))
101971 - goto cifs_create_get_file_info; /* query inode info */
101972 - else if (rc == 0) /* success, no need to query */
101973 - goto cifs_create_set_dentry;
101974 - else if ((rc != -EIO) && (rc != -EREMOTE) &&
101975 - (rc != -EOPNOTSUPP)) /* path not found or net err */
101976 - goto cifs_create_out;
101977 - /* else fallthrough to retry, using older open call, this is
101978 - case where server does not support this SMB level, and
101979 - falsely claims capability (also get here for DFS case
101980 - which should be rare for path not covered on files) */
101981 - }
101982 -
101983 if (nd && (nd->flags & LOOKUP_OPEN)) {
101984 - /* if the file is going to stay open, then we
101985 - need to set the desired access properly */
101986 + int oflags = nd->intent.open.flags;
101987 +
101988 desiredAccess = 0;
101989 if (oflags & FMODE_READ)
101990 - desiredAccess |= GENERIC_READ; /* is this too little? */
101991 + desiredAccess |= GENERIC_READ;
101992 if (oflags & FMODE_WRITE) {
101993 desiredAccess |= GENERIC_WRITE;
101994 if (!(oflags & FMODE_READ))
101995 @@ -308,6 +186,8 @@
101996
101997 /* BB add processing to set equivalent of mode - e.g. via CreateX with
101998 ACLs */
101999 + if (oplockEnabled)
102000 + oplock = REQ_OPLOCK;
102001
102002 buf = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL);
102003 if (buf == NULL) {
102004 @@ -316,15 +196,17 @@
102005 return -ENOMEM;
102006 }
102007
102008 + mode &= ~current->fs->umask;
102009 +
102010 /*
102011 * if we're not using unix extensions, see if we need to set
102012 * ATTR_READONLY on the create call
102013 */
102014 - if (!tcon->unix_ext && (mode & S_IWUGO) == 0)
102015 + if (!pTcon->unix_ext && (mode & S_IWUGO) == 0)
102016 create_options |= CREATE_OPTION_READONLY;
102017
102018 if (cifs_sb->tcon->ses->capabilities & CAP_NT_SMBS)
102019 - rc = CIFSSMBOpen(xid, tcon, full_path, disposition,
102020 + rc = CIFSSMBOpen(xid, pTcon, full_path, disposition,
102021 desiredAccess, create_options,
102022 &fileHandle, &oplock, buf, cifs_sb->local_nls,
102023 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
102024 @@ -333,119 +215,128 @@
102025
102026 if (rc == -EIO) {
102027 /* old server, retry the open legacy style */
102028 - rc = SMBLegacyOpen(xid, tcon, full_path, disposition,
102029 + rc = SMBLegacyOpen(xid, pTcon, full_path, disposition,
102030 desiredAccess, create_options,
102031 &fileHandle, &oplock, buf, cifs_sb->local_nls,
102032 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
102033 }
102034 if (rc) {
102035 cFYI(1, ("cifs_create returned 0x%x", rc));
102036 - goto cifs_create_out;
102037 - }
102038 -
102039 - /* If Open reported that we actually created a file
102040 - then we now have to set the mode if possible */
102041 - if ((tcon->unix_ext) && (oplock & CIFS_CREATE_ACTION)) {
102042 - struct cifs_unix_set_info_args args = {
102043 + } else {
102044 + /* If Open reported that we actually created a file
102045 + then we now have to set the mode if possible */
102046 + if ((pTcon->unix_ext) && (oplock & CIFS_CREATE_ACTION)) {
102047 + struct cifs_unix_set_info_args args = {
102048 .mode = mode,
102049 .ctime = NO_CHANGE_64,
102050 .atime = NO_CHANGE_64,
102051 .mtime = NO_CHANGE_64,
102052 .device = 0,
102053 - };
102054 + };
102055
102056 - if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) {
102057 - args.uid = (__u64) current_fsuid();
102058 - if (inode->i_mode & S_ISGID)
102059 - args.gid = (__u64) inode->i_gid;
102060 - else
102061 - args.gid = (__u64) current_fsgid();
102062 - } else {
102063 - args.uid = NO_CHANGE_64;
102064 - args.gid = NO_CHANGE_64;
102065 - }
102066 - CIFSSMBUnixSetInfo(xid, tcon, full_path, &args,
102067 - cifs_sb->local_nls,
102068 - cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
102069 - } else {
102070 - /* BB implement mode setting via Windows security
102071 - descriptors e.g. */
102072 - /* CIFSSMBWinSetPerms(xid,tcon,path,mode,-1,-1,nls);*/
102073 -
102074 - /* Could set r/o dos attribute if mode & 0222 == 0 */
102075 - }
102076 -
102077 -cifs_create_get_file_info:
102078 - /* server might mask mode so we have to query for it */
102079 - if (tcon->unix_ext)
102080 - rc = cifs_get_inode_info_unix(&newinode, full_path,
102081 - inode->i_sb, xid);
102082 - else {
102083 - rc = cifs_get_inode_info(&newinode, full_path, buf,
102084 - inode->i_sb, xid, &fileHandle);
102085 - if (newinode) {
102086 - if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DYNPERM)
102087 - newinode->i_mode = mode;
102088 - if ((oplock & CIFS_CREATE_ACTION) &&
102089 - (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID)) {
102090 - newinode->i_uid = current_fsuid();
102091 + if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) {
102092 + args.uid = (__u64) current_fsuid();
102093 if (inode->i_mode & S_ISGID)
102094 - newinode->i_gid = inode->i_gid;
102095 + args.gid = (__u64) inode->i_gid;
102096 else
102097 - newinode->i_gid = current_fsgid();
102098 + args.gid = (__u64) current_fsgid();
102099 + } else {
102100 + args.uid = NO_CHANGE_64;
102101 + args.gid = NO_CHANGE_64;
102102 }
102103 + CIFSSMBUnixSetInfo(xid, pTcon, full_path, &args,
102104 + cifs_sb->local_nls,
102105 + cifs_sb->mnt_cifs_flags &
102106 + CIFS_MOUNT_MAP_SPECIAL_CHR);
102107 + } else {
102108 + /* BB implement mode setting via Windows security
102109 + descriptors e.g. */
102110 + /* CIFSSMBWinSetPerms(xid,pTcon,path,mode,-1,-1,nls);*/
102111 +
102112 + /* Could set r/o dos attribute if mode & 0222 == 0 */
102113 }
102114 - }
102115
102116 -cifs_create_set_dentry:
102117 - if (rc == 0)
102118 - setup_cifs_dentry(tcon, direntry, newinode);
102119 - else
102120 - cFYI(1, ("Create worked, get_inode_info failed rc = %d", rc));
102121 + /* server might mask mode so we have to query for it */
102122 + if (pTcon->unix_ext)
102123 + rc = cifs_get_inode_info_unix(&newinode, full_path,
102124 + inode->i_sb, xid);
102125 + else {
102126 + rc = cifs_get_inode_info(&newinode, full_path,
102127 + buf, inode->i_sb, xid,
102128 + &fileHandle);
102129 + if (newinode) {
102130 + if (cifs_sb->mnt_cifs_flags &
102131 + CIFS_MOUNT_DYNPERM)
102132 + newinode->i_mode = mode;
102133 + if ((oplock & CIFS_CREATE_ACTION) &&
102134 + (cifs_sb->mnt_cifs_flags &
102135 + CIFS_MOUNT_SET_UID)) {
102136 + newinode->i_uid = current_fsuid();
102137 + if (inode->i_mode & S_ISGID)
102138 + newinode->i_gid =
102139 + inode->i_gid;
102140 + else
102141 + newinode->i_gid =
102142 + current_fsgid();
102143 + }
102144 + }
102145 + }
102146
102147 - /* nfsd case - nfs srv does not set nd */
102148 - if ((nd == NULL) || (!(nd->flags & LOOKUP_OPEN))) {
102149 - /* mknod case - do not leave file open */
102150 - CIFSSMBClose(xid, tcon, fileHandle);
102151 - } else if (newinode) {
102152 - struct cifsFileInfo *pCifsFile =
102153 - kzalloc(sizeof(struct cifsFileInfo), GFP_KERNEL);
102154 -
102155 - if (pCifsFile == NULL)
102156 - goto cifs_create_out;
102157 - pCifsFile->netfid = fileHandle;
102158 - pCifsFile->pid = current->tgid;
102159 - pCifsFile->pInode = newinode;
102160 - pCifsFile->invalidHandle = false;
102161 - pCifsFile->closePend = false;
102162 - init_MUTEX(&pCifsFile->fh_sem);
102163 - mutex_init(&pCifsFile->lock_mutex);
102164 - INIT_LIST_HEAD(&pCifsFile->llist);
102165 - atomic_set(&pCifsFile->wrtPending, 0);
102166 + if (rc != 0) {
102167 + cFYI(1,
102168 + ("Create worked but get_inode_info failed rc = %d",
102169 + rc));
102170 + } else {
102171 + if (pTcon->nocase)
102172 + direntry->d_op = &cifs_ci_dentry_ops;
102173 + else
102174 + direntry->d_op = &cifs_dentry_ops;
102175 + d_instantiate(direntry, newinode);
102176 + }
102177 + if ((nd == NULL /* nfsd case - nfs srv does not set nd */) ||
102178 + (!(nd->flags & LOOKUP_OPEN))) {
102179 + /* mknod case - do not leave file open */
102180 + CIFSSMBClose(xid, pTcon, fileHandle);
102181 + } else if (newinode) {
102182 + pCifsFile =
102183 + kzalloc(sizeof(struct cifsFileInfo), GFP_KERNEL);
102184 +
102185 + if (pCifsFile == NULL)
102186 + goto cifs_create_out;
102187 + pCifsFile->netfid = fileHandle;
102188 + pCifsFile->pid = current->tgid;
102189 + pCifsFile->pInode = newinode;
102190 + pCifsFile->invalidHandle = false;
102191 + pCifsFile->closePend = false;
102192 + init_MUTEX(&pCifsFile->fh_sem);
102193 + mutex_init(&pCifsFile->lock_mutex);
102194 + INIT_LIST_HEAD(&pCifsFile->llist);
102195 + atomic_set(&pCifsFile->wrtPending, 0);
102196
102197 - /* set the following in open now
102198 + /* set the following in open now
102199 pCifsFile->pfile = file; */
102200 - write_lock(&GlobalSMBSeslock);
102201 - list_add(&pCifsFile->tlist, &tcon->openFileList);
102202 - pCifsInode = CIFS_I(newinode);
102203 - if (pCifsInode) {
102204 - /* if readable file instance put first in list*/
102205 - if (write_only) {
102206 - list_add_tail(&pCifsFile->flist,
102207 - &pCifsInode->openFileList);
102208 - } else {
102209 - list_add(&pCifsFile->flist,
102210 - &pCifsInode->openFileList);
102211 + write_lock(&GlobalSMBSeslock);
102212 + list_add(&pCifsFile->tlist, &pTcon->openFileList);
102213 + pCifsInode = CIFS_I(newinode);
102214 + if (pCifsInode) {
102215 + /* if readable file instance put first in list*/
102216 + if (write_only) {
102217 + list_add_tail(&pCifsFile->flist,
102218 + &pCifsInode->openFileList);
102219 + } else {
102220 + list_add(&pCifsFile->flist,
102221 + &pCifsInode->openFileList);
102222 + }
102223 + if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) {
102224 + pCifsInode->clientCanCacheAll = true;
102225 + pCifsInode->clientCanCacheRead = true;
102226 + cFYI(1, ("Exclusive Oplock inode %p",
102227 + newinode));
102228 + } else if ((oplock & 0xF) == OPLOCK_READ)
102229 + pCifsInode->clientCanCacheRead = true;
102230 }
102231 - if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) {
102232 - pCifsInode->clientCanCacheAll = true;
102233 - pCifsInode->clientCanCacheRead = true;
102234 - cFYI(1, ("Exclusive Oplock inode %p",
102235 - newinode));
102236 - } else if ((oplock & 0xF) == OPLOCK_READ)
102237 - pCifsInode->clientCanCacheRead = true;
102238 + write_unlock(&GlobalSMBSeslock);
102239 }
102240 - write_unlock(&GlobalSMBSeslock);
102241 }
102242 cifs_create_out:
102243 kfree(buf);
102244 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/cifs/inode.c linux-2.6.29-rc3.owrt/fs/cifs/inode.c
102245 --- linux-2.6.29.owrt/fs/cifs/inode.c 2009-05-10 22:04:39.000000000 +0200
102246 +++ linux-2.6.29-rc3.owrt/fs/cifs/inode.c 2009-05-10 23:48:29.000000000 +0200
102247 @@ -199,49 +199,6 @@
102248 pfnd_dat->Gid = cpu_to_le64(pinode->i_gid);
102249 }
102250
102251 -/**
102252 - * cifs_new inode - create new inode, initialize, and hash it
102253 - * @sb - pointer to superblock
102254 - * @inum - if valid pointer and serverino is enabled, replace i_ino with val
102255 - *
102256 - * Create a new inode, initialize it for CIFS and hash it. Returns the new
102257 - * inode or NULL if one couldn't be allocated.
102258 - *
102259 - * If the share isn't mounted with "serverino" or inum is a NULL pointer then
102260 - * we'll just use the inode number assigned by new_inode(). Note that this can
102261 - * mean i_ino collisions since the i_ino assigned by new_inode is not
102262 - * guaranteed to be unique.
102263 - */
102264 -struct inode *
102265 -cifs_new_inode(struct super_block *sb, __u64 *inum)
102266 -{
102267 - struct inode *inode;
102268 -
102269 - inode = new_inode(sb);
102270 - if (inode == NULL)
102271 - return NULL;
102272 -
102273 - /*
102274 - * BB: Is i_ino == 0 legal? Here, we assume that it is. If it isn't we
102275 - * stop passing inum as ptr. Are there sanity checks we can use to
102276 - * ensure that the server is really filling in that field? Also,
102277 - * if serverino is disabled, perhaps we should be using iunique()?
102278 - */
102279 - if (inum && (CIFS_SB(sb)->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM))
102280 - inode->i_ino = (unsigned long) *inum;
102281 -
102282 - /*
102283 - * must set this here instead of cifs_alloc_inode since VFS will
102284 - * clobber i_flags
102285 - */
102286 - if (sb->s_flags & MS_NOATIME)
102287 - inode->i_flags |= S_NOATIME | S_NOCMTIME;
102288 -
102289 - insert_inode_hash(inode);
102290 -
102291 - return inode;
102292 -}
102293 -
102294 int cifs_get_inode_info_unix(struct inode **pinode,
102295 const unsigned char *full_path, struct super_block *sb, int xid)
102296 {
102297 @@ -276,11 +233,22 @@
102298
102299 /* get new inode */
102300 if (*pinode == NULL) {
102301 - *pinode = cifs_new_inode(sb, &find_data.UniqueId);
102302 + *pinode = new_inode(sb);
102303 if (*pinode == NULL) {
102304 rc = -ENOMEM;
102305 goto cgiiu_exit;
102306 }
102307 + /* Is an i_ino of zero legal? */
102308 + /* note ino incremented to unique num in new_inode */
102309 + /* Are there sanity checks we can use to ensure that
102310 + the server is really filling in that field? */
102311 + if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM)
102312 + (*pinode)->i_ino = (unsigned long)find_data.UniqueId;
102313 +
102314 + if (sb->s_flags & MS_NOATIME)
102315 + (*pinode)->i_flags |= S_NOATIME | S_NOCMTIME;
102316 +
102317 + insert_inode_hash(*pinode);
102318 }
102319
102320 inode = *pinode;
102321 @@ -497,9 +465,11 @@
102322
102323 /* get new inode */
102324 if (*pinode == NULL) {
102325 - __u64 inode_num;
102326 - __u64 *pinum = &inode_num;
102327 -
102328 + *pinode = new_inode(sb);
102329 + if (*pinode == NULL) {
102330 + rc = -ENOMEM;
102331 + goto cgii_exit;
102332 + }
102333 /* Is an i_ino of zero legal? Can we use that to check
102334 if the server supports returning inode numbers? Are
102335 there other sanity checks we can use to ensure that
102336 @@ -516,26 +486,22 @@
102337
102338 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) {
102339 int rc1 = 0;
102340 + __u64 inode_num;
102341
102342 rc1 = CIFSGetSrvInodeNumber(xid, pTcon,
102343 - full_path, pinum,
102344 + full_path, &inode_num,
102345 cifs_sb->local_nls,
102346 cifs_sb->mnt_cifs_flags &
102347 CIFS_MOUNT_MAP_SPECIAL_CHR);
102348 if (rc1) {
102349 cFYI(1, ("GetSrvInodeNum rc %d", rc1));
102350 - pinum = NULL;
102351 /* BB EOPNOSUPP disable SERVER_INUM? */
102352 - }
102353 - } else {
102354 - pinum = NULL;
102355 - }
102356 -
102357 - *pinode = cifs_new_inode(sb, pinum);
102358 - if (*pinode == NULL) {
102359 - rc = -ENOMEM;
102360 - goto cgii_exit;
102361 - }
102362 + } else /* do we need cast or hash to ino? */
102363 + (*pinode)->i_ino = inode_num;
102364 + } /* else ino incremented to unique num in new_inode*/
102365 + if (sb->s_flags & MS_NOATIME)
102366 + (*pinode)->i_flags |= S_NOATIME | S_NOCMTIME;
102367 + insert_inode_hash(*pinode);
102368 }
102369 inode = *pinode;
102370 cifsInfo = CIFS_I(inode);
102371 @@ -655,7 +621,7 @@
102372 .lookup = cifs_lookup,
102373 };
102374
102375 -char *cifs_build_path_to_root(struct cifs_sb_info *cifs_sb)
102376 +static char *build_path_to_root(struct cifs_sb_info *cifs_sb)
102377 {
102378 int pplen = cifs_sb->prepathlen;
102379 int dfsplen;
102380 @@ -712,7 +678,7 @@
102381 return inode;
102382
102383 cifs_sb = CIFS_SB(inode->i_sb);
102384 - full_path = cifs_build_path_to_root(cifs_sb);
102385 + full_path = build_path_to_root(cifs_sb);
102386 if (full_path == NULL)
102387 return ERR_PTR(-ENOMEM);
102388
102389 @@ -1051,7 +1017,7 @@
102390 return rc;
102391 }
102392
102393 -void posix_fill_in_inode(struct inode *tmp_inode,
102394 +static void posix_fill_in_inode(struct inode *tmp_inode,
102395 FILE_UNIX_BASIC_INFO *pData, int isNewInode)
102396 {
102397 struct cifsInodeInfo *cifsInfo = CIFS_I(tmp_inode);
102398 @@ -1148,14 +1114,24 @@
102399 else
102400 direntry->d_op = &cifs_dentry_ops;
102401
102402 - newinode = cifs_new_inode(inode->i_sb,
102403 - &pInfo->UniqueId);
102404 + newinode = new_inode(inode->i_sb);
102405 if (newinode == NULL) {
102406 kfree(pInfo);
102407 goto mkdir_get_info;
102408 }
102409
102410 + /* Is an i_ino of zero legal? */
102411 + /* Are there sanity checks we can use to ensure that
102412 + the server is really filling in that field? */
102413 + if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) {
102414 + newinode->i_ino =
102415 + (unsigned long)pInfo->UniqueId;
102416 + } /* note ino incremented to unique num in new_inode */
102417 + if (inode->i_sb->s_flags & MS_NOATIME)
102418 + newinode->i_flags |= S_NOATIME | S_NOCMTIME;
102419 newinode->i_nlink = 2;
102420 +
102421 + insert_inode_hash(newinode);
102422 d_instantiate(direntry, newinode);
102423
102424 /* we already checked in POSIXCreate whether
102425 @@ -1309,11 +1285,6 @@
102426 cifsInode = CIFS_I(direntry->d_inode);
102427 cifsInode->time = 0; /* force revalidate to go get info when
102428 needed */
102429 -
102430 - cifsInode = CIFS_I(inode);
102431 - cifsInode->time = 0; /* force revalidate to get parent dir info
102432 - since cached search results now invalid */
102433 -
102434 direntry->d_inode->i_ctime = inode->i_ctime = inode->i_mtime =
102435 current_fs_time(inode->i_sb);
102436
102437 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/cifs/md5.c linux-2.6.29-rc3.owrt/fs/cifs/md5.c
102438 --- linux-2.6.29.owrt/fs/cifs/md5.c 2009-05-10 22:04:39.000000000 +0200
102439 +++ linux-2.6.29-rc3.owrt/fs/cifs/md5.c 2009-05-10 23:48:29.000000000 +0200
102440 @@ -10,8 +10,8 @@
102441 * with every copy.
102442 *
102443 * To compute the message digest of a chunk of bytes, declare an
102444 - * MD5Context structure, pass it to cifs_MD5_init, call cifs_MD5_update as
102445 - * needed on buffers full of bytes, and then call cifs_MD5_final, which
102446 + * MD5Context structure, pass it to MD5Init, call MD5Update as
102447 + * needed on buffers full of bytes, and then call MD5Final, which
102448 * will fill a supplied 16-byte array with the digest.
102449 */
102450
102451 @@ -45,7 +45,7 @@
102452 * initialization constants.
102453 */
102454 void
102455 -cifs_MD5_init(struct MD5Context *ctx)
102456 +MD5Init(struct MD5Context *ctx)
102457 {
102458 ctx->buf[0] = 0x67452301;
102459 ctx->buf[1] = 0xefcdab89;
102460 @@ -61,7 +61,7 @@
102461 * of bytes.
102462 */
102463 void
102464 -cifs_MD5_update(struct MD5Context *ctx, unsigned char const *buf, unsigned len)
102465 +MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len)
102466 {
102467 register __u32 t;
102468
102469 @@ -110,7 +110,7 @@
102470 * 1 0* (64-bit count of bits processed, MSB-first)
102471 */
102472 void
102473 -cifs_MD5_final(unsigned char digest[16], struct MD5Context *ctx)
102474 +MD5Final(unsigned char digest[16], struct MD5Context *ctx)
102475 {
102476 unsigned int count;
102477 unsigned char *p;
102478 @@ -165,7 +165,7 @@
102479
102480 /*
102481 * The core of the MD5 algorithm, this alters an existing MD5 hash to
102482 - * reflect the addition of 16 longwords of new data. cifs_MD5_update blocks
102483 + * reflect the addition of 16 longwords of new data. MD5Update blocks
102484 * the data and converts bytes into longwords for this routine.
102485 */
102486 static void
102487 @@ -267,9 +267,9 @@
102488 unsigned char tk[16];
102489 struct MD5Context tctx;
102490
102491 - cifs_MD5_init(&tctx);
102492 - cifs_MD5_update(&tctx, key, key_len);
102493 - cifs_MD5_final(tk, &tctx);
102494 + MD5Init(&tctx);
102495 + MD5Update(&tctx, key, key_len);
102496 + MD5Final(tk, &tctx);
102497
102498 key = tk;
102499 key_len = 16;
102500 @@ -287,8 +287,8 @@
102501 ctx->k_opad[i] ^= 0x5c;
102502 }
102503
102504 - cifs_MD5_init(&ctx->ctx);
102505 - cifs_MD5_update(&ctx->ctx, ctx->k_ipad, 64);
102506 + MD5Init(&ctx->ctx);
102507 + MD5Update(&ctx->ctx, ctx->k_ipad, 64);
102508 }
102509 #endif
102510
102511 @@ -317,8 +317,8 @@
102512 ctx->k_opad[i] ^= 0x5c;
102513 }
102514
102515 - cifs_MD5_init(&ctx->ctx);
102516 - cifs_MD5_update(&ctx->ctx, ctx->k_ipad, 64);
102517 + MD5Init(&ctx->ctx);
102518 + MD5Update(&ctx->ctx, ctx->k_ipad, 64);
102519 }
102520
102521 /***********************************************************************
102522 @@ -328,7 +328,7 @@
102523 hmac_md5_update(const unsigned char *text, int text_len,
102524 struct HMACMD5Context *ctx)
102525 {
102526 - cifs_MD5_update(&ctx->ctx, text, text_len); /* then text of datagram */
102527 + MD5Update(&ctx->ctx, text, text_len); /* then text of datagram */
102528 }
102529
102530 /***********************************************************************
102531 @@ -339,12 +339,12 @@
102532 {
102533 struct MD5Context ctx_o;
102534
102535 - cifs_MD5_final(digest, &ctx->ctx);
102536 + MD5Final(digest, &ctx->ctx);
102537
102538 - cifs_MD5_init(&ctx_o);
102539 - cifs_MD5_update(&ctx_o, ctx->k_opad, 64);
102540 - cifs_MD5_update(&ctx_o, digest, 16);
102541 - cifs_MD5_final(digest, &ctx_o);
102542 + MD5Init(&ctx_o);
102543 + MD5Update(&ctx_o, ctx->k_opad, 64);
102544 + MD5Update(&ctx_o, digest, 16);
102545 + MD5Final(digest, &ctx_o);
102546 }
102547
102548 /***********************************************************
102549 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/cifs/md5.h linux-2.6.29-rc3.owrt/fs/cifs/md5.h
102550 --- linux-2.6.29.owrt/fs/cifs/md5.h 2009-05-10 22:04:39.000000000 +0200
102551 +++ linux-2.6.29-rc3.owrt/fs/cifs/md5.h 2009-05-10 23:48:29.000000000 +0200
102552 @@ -20,10 +20,10 @@
102553 };
102554 #endif /* _HMAC_MD5_H */
102555
102556 -void cifs_MD5_init(struct MD5Context *context);
102557 -void cifs_MD5_update(struct MD5Context *context, unsigned char const *buf,
102558 +void MD5Init(struct MD5Context *context);
102559 +void MD5Update(struct MD5Context *context, unsigned char const *buf,
102560 unsigned len);
102561 -void cifs_MD5_final(unsigned char digest[16], struct MD5Context *context);
102562 +void MD5Final(unsigned char digest[16], struct MD5Context *context);
102563
102564 /* The following definitions come from lib/hmacmd5.c */
102565
102566 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/cifs/readdir.c linux-2.6.29-rc3.owrt/fs/cifs/readdir.c
102567 --- linux-2.6.29.owrt/fs/cifs/readdir.c 2009-05-10 22:04:39.000000000 +0200
102568 +++ linux-2.6.29-rc3.owrt/fs/cifs/readdir.c 2009-05-10 23:48:29.000000000 +0200
102569 @@ -56,34 +56,35 @@
102570 }
102571 #endif /* DEBUG2 */
102572
102573 -/* Returns 1 if new inode created, 2 if both dentry and inode were */
102574 +/* Returns one if new inode created (which therefore needs to be hashed) */
102575 /* Might check in the future if inode number changed so we can rehash inode */
102576 -static int
102577 -construct_dentry(struct qstr *qstring, struct file *file,
102578 - struct inode **ptmp_inode, struct dentry **pnew_dentry,
102579 - __u64 *inum)
102580 +static int construct_dentry(struct qstr *qstring, struct file *file,
102581 + struct inode **ptmp_inode, struct dentry **pnew_dentry)
102582 {
102583 - struct dentry *tmp_dentry = NULL;
102584 - struct super_block *sb = file->f_path.dentry->d_sb;
102585 + struct dentry *tmp_dentry;
102586 + struct cifs_sb_info *cifs_sb;
102587 + struct cifsTconInfo *pTcon;
102588 int rc = 0;
102589
102590 cFYI(1, ("For %s", qstring->name));
102591 + cifs_sb = CIFS_SB(file->f_path.dentry->d_sb);
102592 + pTcon = cifs_sb->tcon;
102593
102594 qstring->hash = full_name_hash(qstring->name, qstring->len);
102595 tmp_dentry = d_lookup(file->f_path.dentry, qstring);
102596 if (tmp_dentry) {
102597 - /* BB: overwrite old name? i.e. tmp_dentry->d_name and
102598 - * tmp_dentry->d_name.len??
102599 - */
102600 cFYI(0, ("existing dentry with inode 0x%p",
102601 tmp_dentry->d_inode));
102602 *ptmp_inode = tmp_dentry->d_inode;
102603 +/* BB overwrite old name? i.e. tmp_dentry->d_name and tmp_dentry->d_name.len??*/
102604 if (*ptmp_inode == NULL) {
102605 - *ptmp_inode = cifs_new_inode(sb, inum);
102606 + *ptmp_inode = new_inode(file->f_path.dentry->d_sb);
102607 if (*ptmp_inode == NULL)
102608 return rc;
102609 rc = 1;
102610 }
102611 + if (file->f_path.dentry->d_sb->s_flags & MS_NOATIME)
102612 + (*ptmp_inode)->i_flags |= S_NOATIME | S_NOCMTIME;
102613 } else {
102614 tmp_dentry = d_alloc(file->f_path.dentry, qstring);
102615 if (tmp_dentry == NULL) {
102616 @@ -92,14 +93,15 @@
102617 return rc;
102618 }
102619
102620 - if (CIFS_SB(sb)->tcon->nocase)
102621 + *ptmp_inode = new_inode(file->f_path.dentry->d_sb);
102622 + if (pTcon->nocase)
102623 tmp_dentry->d_op = &cifs_ci_dentry_ops;
102624 else
102625 tmp_dentry->d_op = &cifs_dentry_ops;
102626 -
102627 - *ptmp_inode = cifs_new_inode(sb, inum);
102628 if (*ptmp_inode == NULL)
102629 return rc;
102630 + if (file->f_path.dentry->d_sb->s_flags & MS_NOATIME)
102631 + (*ptmp_inode)->i_flags |= S_NOATIME | S_NOCMTIME;
102632 rc = 2;
102633 }
102634
102635 @@ -820,7 +822,7 @@
102636 /* inode num, inode type and filename returned */
102637 static int cifs_get_name_from_search_buf(struct qstr *pqst,
102638 char *current_entry, __u16 level, unsigned int unicode,
102639 - struct cifs_sb_info *cifs_sb, int max_len, __u64 *pinum)
102640 + struct cifs_sb_info *cifs_sb, int max_len, ino_t *pinum)
102641 {
102642 int rc = 0;
102643 unsigned int len = 0;
102644 @@ -840,7 +842,9 @@
102645 len = strnlen(filename, PATH_MAX);
102646 }
102647
102648 - *pinum = pFindData->UniqueId;
102649 + /* BB fixme - hash low and high 32 bits if not 64 bit arch BB */
102650 + if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM)
102651 + *pinum = pFindData->UniqueId;
102652 } else if (level == SMB_FIND_FILE_DIRECTORY_INFO) {
102653 FILE_DIRECTORY_INFO *pFindData =
102654 (FILE_DIRECTORY_INFO *)current_entry;
102655 @@ -903,7 +907,7 @@
102656 struct qstr qstring;
102657 struct cifsFileInfo *pCifsF;
102658 unsigned int obj_type;
102659 - __u64 inum;
102660 + ino_t inum;
102661 struct cifs_sb_info *cifs_sb;
102662 struct inode *tmp_inode;
102663 struct dentry *tmp_dentry;
102664 @@ -936,18 +940,20 @@
102665 if (rc)
102666 return rc;
102667
102668 - /* only these two infolevels return valid inode numbers */
102669 - if (pCifsF->srch_inf.info_level == SMB_FIND_FILE_UNIX ||
102670 - pCifsF->srch_inf.info_level == SMB_FIND_FILE_ID_FULL_DIR_INFO)
102671 - rc = construct_dentry(&qstring, file, &tmp_inode, &tmp_dentry,
102672 - &inum);
102673 - else
102674 - rc = construct_dentry(&qstring, file, &tmp_inode, &tmp_dentry,
102675 - NULL);
102676 -
102677 + rc = construct_dentry(&qstring, file, &tmp_inode, &tmp_dentry);
102678 if ((tmp_inode == NULL) || (tmp_dentry == NULL))
102679 return -ENOMEM;
102680
102681 + if (rc) {
102682 + /* inode created, we need to hash it with right inode number */
102683 + if (inum != 0) {
102684 + /* BB fixme - hash the 2 32 quantities bits together if
102685 + * necessary BB */
102686 + tmp_inode->i_ino = inum;
102687 + }
102688 + insert_inode_hash(tmp_inode);
102689 + }
102690 +
102691 /* we pass in rc below, indicating whether it is a new inode,
102692 so we can figure out whether to invalidate the inode cached
102693 data if the file has changed */
102694 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/cifs/sess.c linux-2.6.29-rc3.owrt/fs/cifs/sess.c
102695 --- linux-2.6.29.owrt/fs/cifs/sess.c 2009-05-10 22:04:39.000000000 +0200
102696 +++ linux-2.6.29-rc3.owrt/fs/cifs/sess.c 2009-05-10 23:48:29.000000000 +0200
102697 @@ -34,99 +34,15 @@
102698 extern void SMBNTencrypt(unsigned char *passwd, unsigned char *c8,
102699 unsigned char *p24);
102700
102701 -/* Checks if this is the first smb session to be reconnected after
102702 - the socket has been reestablished (so we know whether to use vc 0).
102703 - Called while holding the cifs_tcp_ses_lock, so do not block */
102704 -static bool is_first_ses_reconnect(struct cifsSesInfo *ses)
102705 -{
102706 - struct list_head *tmp;
102707 - struct cifsSesInfo *tmp_ses;
102708 -
102709 - list_for_each(tmp, &ses->server->smb_ses_list) {
102710 - tmp_ses = list_entry(tmp, struct cifsSesInfo,
102711 - smb_ses_list);
102712 - if (tmp_ses->need_reconnect == false)
102713 - return false;
102714 - }
102715 - /* could not find a session that was already connected,
102716 - this must be the first one we are reconnecting */
102717 - return true;
102718 -}
102719 -
102720 -/*
102721 - * vc number 0 is treated specially by some servers, and should be the
102722 - * first one we request. After that we can use vcnumbers up to maxvcs,
102723 - * one for each smb session (some Windows versions set maxvcs incorrectly
102724 - * so maxvc=1 can be ignored). If we have too many vcs, we can reuse
102725 - * any vc but zero (some servers reset the connection on vcnum zero)
102726 - *
102727 - */
102728 -static __le16 get_next_vcnum(struct cifsSesInfo *ses)
102729 -{
102730 - __u16 vcnum = 0;
102731 - struct list_head *tmp;
102732 - struct cifsSesInfo *tmp_ses;
102733 - __u16 max_vcs = ses->server->max_vcs;
102734 - __u16 i;
102735 - int free_vc_found = 0;
102736 -
102737 - /* Quoting the MS-SMB specification: "Windows-based SMB servers set this
102738 - field to one but do not enforce this limit, which allows an SMB client
102739 - to establish more virtual circuits than allowed by this value ... but
102740 - other server implementations can enforce this limit." */
102741 - if (max_vcs < 2)
102742 - max_vcs = 0xFFFF;
102743 -
102744 - write_lock(&cifs_tcp_ses_lock);
102745 - if ((ses->need_reconnect) && is_first_ses_reconnect(ses))
102746 - goto get_vc_num_exit; /* vcnum will be zero */
102747 - for (i = ses->server->srv_count - 1; i < max_vcs; i++) {
102748 - if (i == 0) /* this is the only connection, use vc 0 */
102749 - break;
102750 -
102751 - free_vc_found = 1;
102752 -
102753 - list_for_each(tmp, &ses->server->smb_ses_list) {
102754 - tmp_ses = list_entry(tmp, struct cifsSesInfo,
102755 - smb_ses_list);
102756 - if (tmp_ses->vcnum == i) {
102757 - free_vc_found = 0;
102758 - break; /* found duplicate, try next vcnum */
102759 - }
102760 - }
102761 - if (free_vc_found)
102762 - break; /* we found a vcnumber that will work - use it */
102763 - }
102764 -
102765 - if (i == 0)
102766 - vcnum = 0; /* for most common case, ie if one smb session, use
102767 - vc zero. Also for case when no free vcnum, zero
102768 - is safest to send (some clients only send zero) */
102769 - else if (free_vc_found == 0)
102770 - vcnum = 1; /* we can not reuse vc=0 safely, since some servers
102771 - reset all uids on that, but 1 is ok. */
102772 - else
102773 - vcnum = i;
102774 - ses->vcnum = vcnum;
102775 -get_vc_num_exit:
102776 - write_unlock(&cifs_tcp_ses_lock);
102777 -
102778 - return le16_to_cpu(vcnum);
102779 -}
102780 -
102781 static __u32 cifs_ssetup_hdr(struct cifsSesInfo *ses, SESSION_SETUP_ANDX *pSMB)
102782 {
102783 __u32 capabilities = 0;
102784
102785 /* init fields common to all four types of SessSetup */
102786 - /* Note that offsets for first seven fields in req struct are same */
102787 - /* in CIFS Specs so does not matter which of 3 forms of struct */
102788 - /* that we use in next few lines */
102789 - /* Note that header is initialized to zero in header_assemble */
102790 + /* note that header is initialized to zero in header_assemble */
102791 pSMB->req.AndXCommand = 0xFF;
102792 pSMB->req.MaxBufferSize = cpu_to_le16(ses->server->maxBuf);
102793 pSMB->req.MaxMpxCount = cpu_to_le16(ses->server->maxReq);
102794 - pSMB->req.VcNumber = get_next_vcnum(ses);
102795
102796 /* Now no need to set SMBFLG_CASELESS or obsolete CANONICAL PATH */
102797
102798 @@ -155,6 +71,7 @@
102799 if (ses->capabilities & CAP_UNIX)
102800 capabilities |= CAP_UNIX;
102801
102802 + /* BB check whether to init vcnum BB */
102803 return capabilities;
102804 }
102805
102806 @@ -311,7 +228,7 @@
102807
102808 kfree(ses->serverOS);
102809 /* UTF-8 string will not grow more than four times as big as UCS-16 */
102810 - ses->serverOS = kzalloc((4 * len) + 2 /* trailing null */, GFP_KERNEL);
102811 + ses->serverOS = kzalloc(4 * len, GFP_KERNEL);
102812 if (ses->serverOS != NULL)
102813 cifs_strfromUCS_le(ses->serverOS, (__le16 *)data, len, nls_cp);
102814 data += 2 * (len + 1);
102815 @@ -324,7 +241,7 @@
102816 return rc;
102817
102818 kfree(ses->serverNOS);
102819 - ses->serverNOS = kzalloc((4 * len) + 2 /* trailing null */, GFP_KERNEL);
102820 + ses->serverNOS = kzalloc(4 * len, GFP_KERNEL); /* BB this is wrong length FIXME BB */
102821 if (ses->serverNOS != NULL) {
102822 cifs_strfromUCS_le(ses->serverNOS, (__le16 *)data, len,
102823 nls_cp);
102824 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/cifs/transport.c linux-2.6.29-rc3.owrt/fs/cifs/transport.c
102825 --- linux-2.6.29.owrt/fs/cifs/transport.c 2009-05-10 22:04:39.000000000 +0200
102826 +++ linux-2.6.29-rc3.owrt/fs/cifs/transport.c 2009-05-10 23:48:29.000000000 +0200
102827 @@ -154,8 +154,81 @@
102828 spin_unlock(&GlobalMid_Lock);
102829 }
102830
102831 +int
102832 +smb_send(struct socket *ssocket, struct smb_hdr *smb_buffer,
102833 + unsigned int smb_buf_length, struct sockaddr *sin, bool noblocksnd)
102834 +{
102835 + int rc = 0;
102836 + int i = 0;
102837 + struct msghdr smb_msg;
102838 + struct kvec iov;
102839 + unsigned len = smb_buf_length + 4;
102840 +
102841 + if (ssocket == NULL)
102842 + return -ENOTSOCK; /* BB eventually add reconnect code here */
102843 + iov.iov_base = smb_buffer;
102844 + iov.iov_len = len;
102845 +
102846 + smb_msg.msg_name = sin;
102847 + smb_msg.msg_namelen = sizeof(struct sockaddr);
102848 + smb_msg.msg_control = NULL;
102849 + smb_msg.msg_controllen = 0;
102850 + if (noblocksnd)
102851 + smb_msg.msg_flags = MSG_DONTWAIT + MSG_NOSIGNAL;
102852 + else
102853 + smb_msg.msg_flags = MSG_NOSIGNAL;
102854 +
102855 + /* smb header is converted in header_assemble. bcc and rest of SMB word
102856 + area, and byte area if necessary, is converted to littleendian in
102857 + cifssmb.c and RFC1001 len is converted to bigendian in smb_send
102858 + Flags2 is converted in SendReceive */
102859 +
102860 + smb_buffer->smb_buf_length = cpu_to_be32(smb_buffer->smb_buf_length);
102861 + cFYI(1, ("Sending smb of length %d", smb_buf_length));
102862 + dump_smb(smb_buffer, len);
102863 +
102864 + while (len > 0) {
102865 + rc = kernel_sendmsg(ssocket, &smb_msg, &iov, 1, len);
102866 + if ((rc == -ENOSPC) || (rc == -EAGAIN)) {
102867 + i++;
102868 + /* smaller timeout here than send2 since smaller size */
102869 + /* Although it may not be required, this also is smaller
102870 + oplock break time */
102871 + if (i > 12) {
102872 + cERROR(1,
102873 + ("sends on sock %p stuck for 7 seconds",
102874 + ssocket));
102875 + rc = -EAGAIN;
102876 + break;
102877 + }
102878 + msleep(1 << i);
102879 + continue;
102880 + }
102881 + if (rc < 0)
102882 + break;
102883 + else
102884 + i = 0; /* reset i after each successful send */
102885 + iov.iov_base += rc;
102886 + iov.iov_len -= rc;
102887 + len -= rc;
102888 + }
102889 +
102890 + if (rc < 0) {
102891 + cERROR(1, ("Error %d sending data on socket to server", rc));
102892 + } else {
102893 + rc = 0;
102894 + }
102895 +
102896 + /* Don't want to modify the buffer as a
102897 + side effect of this call. */
102898 + smb_buffer->smb_buf_length = smb_buf_length;
102899 +
102900 + return rc;
102901 +}
102902 +
102903 static int
102904 -smb_sendv(struct TCP_Server_Info *server, struct kvec *iov, int n_vec)
102905 +smb_send2(struct TCP_Server_Info *server, struct kvec *iov, int n_vec,
102906 + struct sockaddr *sin, bool noblocksnd)
102907 {
102908 int rc = 0;
102909 int i = 0;
102910 @@ -170,11 +243,11 @@
102911 if (ssocket == NULL)
102912 return -ENOTSOCK; /* BB eventually add reconnect code here */
102913
102914 - smb_msg.msg_name = (struct sockaddr *) &server->addr.sockAddr;
102915 + smb_msg.msg_name = sin;
102916 smb_msg.msg_namelen = sizeof(struct sockaddr);
102917 smb_msg.msg_control = NULL;
102918 smb_msg.msg_controllen = 0;
102919 - if (server->noblocksnd)
102920 + if (noblocksnd)
102921 smb_msg.msg_flags = MSG_DONTWAIT + MSG_NOSIGNAL;
102922 else
102923 smb_msg.msg_flags = MSG_NOSIGNAL;
102924 @@ -199,25 +272,7 @@
102925 n_vec - first_vec, total_len);
102926 if ((rc == -ENOSPC) || (rc == -EAGAIN)) {
102927 i++;
102928 - /* if blocking send we try 3 times, since each can block
102929 - for 5 seconds. For nonblocking we have to try more
102930 - but wait increasing amounts of time allowing time for
102931 - socket to clear. The overall time we wait in either
102932 - case to send on the socket is about 15 seconds.
102933 - Similarly we wait for 15 seconds for
102934 - a response from the server in SendReceive[2]
102935 - for the server to send a response back for
102936 - most types of requests (except SMB Write
102937 - past end of file which can be slow, and
102938 - blocking lock operations). NFS waits slightly longer
102939 - than CIFS, but this can make it take longer for
102940 - nonresponsive servers to be detected and 15 seconds
102941 - is more than enough time for modern networks to
102942 - send a packet. In most cases if we fail to send
102943 - after the retries we will kill the socket and
102944 - reconnect which may clear the network problem.
102945 - */
102946 - if ((i >= 14) || (!server->noblocksnd && (i > 2))) {
102947 + if (i >= 14) {
102948 cERROR(1,
102949 ("sends on sock %p stuck for 15 seconds",
102950 ssocket));
102951 @@ -284,18 +339,6 @@
102952 return rc;
102953 }
102954
102955 -int
102956 -smb_send(struct TCP_Server_Info *server, struct smb_hdr *smb_buffer,
102957 - unsigned int smb_buf_length)
102958 -{
102959 - struct kvec iov;
102960 -
102961 - iov.iov_base = smb_buffer;
102962 - iov.iov_len = smb_buf_length + 4;
102963 -
102964 - return smb_sendv(server, &iov, 1);
102965 -}
102966 -
102967 static int wait_for_free_request(struct cifsSesInfo *ses, const int long_op)
102968 {
102969 if (long_op == CIFS_ASYNC_OP) {
102970 @@ -497,7 +540,9 @@
102971 #ifdef CONFIG_CIFS_STATS2
102972 atomic_inc(&ses->server->inSend);
102973 #endif
102974 - rc = smb_sendv(ses->server, iov, n_vec);
102975 + rc = smb_send2(ses->server, iov, n_vec,
102976 + (struct sockaddr *) &(ses->server->addr.sockAddr),
102977 + ses->server->noblocksnd);
102978 #ifdef CONFIG_CIFS_STATS2
102979 atomic_dec(&ses->server->inSend);
102980 midQ->when_sent = jiffies;
102981 @@ -691,7 +736,9 @@
102982 #ifdef CONFIG_CIFS_STATS2
102983 atomic_inc(&ses->server->inSend);
102984 #endif
102985 - rc = smb_send(ses->server, in_buf, in_buf->smb_buf_length);
102986 + rc = smb_send(ses->server->ssocket, in_buf, in_buf->smb_buf_length,
102987 + (struct sockaddr *) &(ses->server->addr.sockAddr),
102988 + ses->server->noblocksnd);
102989 #ifdef CONFIG_CIFS_STATS2
102990 atomic_dec(&ses->server->inSend);
102991 midQ->when_sent = jiffies;
102992 @@ -832,7 +879,9 @@
102993 mutex_unlock(&ses->server->srv_mutex);
102994 return rc;
102995 }
102996 - rc = smb_send(ses->server, in_buf, in_buf->smb_buf_length);
102997 + rc = smb_send(ses->server->ssocket, in_buf, in_buf->smb_buf_length,
102998 + (struct sockaddr *) &(ses->server->addr.sockAddr),
102999 + ses->server->noblocksnd);
103000 mutex_unlock(&ses->server->srv_mutex);
103001 return rc;
103002 }
103003 @@ -924,7 +973,9 @@
103004 #ifdef CONFIG_CIFS_STATS2
103005 atomic_inc(&ses->server->inSend);
103006 #endif
103007 - rc = smb_send(ses->server, in_buf, in_buf->smb_buf_length);
103008 + rc = smb_send(ses->server->ssocket, in_buf, in_buf->smb_buf_length,
103009 + (struct sockaddr *) &(ses->server->addr.sockAddr),
103010 + ses->server->noblocksnd);
103011 #ifdef CONFIG_CIFS_STATS2
103012 atomic_dec(&ses->server->inSend);
103013 midQ->when_sent = jiffies;
103014 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/compat.c linux-2.6.29-rc3.owrt/fs/compat.c
103015 --- linux-2.6.29.owrt/fs/compat.c 2009-05-10 22:04:39.000000000 +0200
103016 +++ linux-2.6.29-rc3.owrt/fs/compat.c 2009-05-10 23:48:29.000000000 +0200
103017 @@ -1407,7 +1407,7 @@
103018 bprm->cred = prepare_exec_creds();
103019 if (!bprm->cred)
103020 goto out_unlock;
103021 - check_unsafe_exec(bprm, current->files);
103022 + check_unsafe_exec(bprm);
103023
103024 file = open_exec(filename);
103025 retval = PTR_ERR(file);
103026 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/compat_ioctl.c linux-2.6.29-rc3.owrt/fs/compat_ioctl.c
103027 --- linux-2.6.29.owrt/fs/compat_ioctl.c 2009-05-10 22:04:39.000000000 +0200
103028 +++ linux-2.6.29-rc3.owrt/fs/compat_ioctl.c 2009-05-10 23:48:29.000000000 +0200
103029 @@ -538,7 +538,6 @@
103030 * cannot be fixed without breaking all existing apps.
103031 */
103032 case TUNSETIFF:
103033 - case TUNGETIFF:
103034 case SIOCGIFFLAGS:
103035 case SIOCGIFMETRIC:
103036 case SIOCGIFMTU:
103037 @@ -785,7 +784,7 @@
103038
103039 if (copy_in_user(&sgio->status, &sgio32->status,
103040 (4 * sizeof(unsigned char)) +
103041 - (2 * sizeof(unsigned short)) +
103042 + (2 * sizeof(unsigned (short))) +
103043 (3 * sizeof(int))))
103044 return -EFAULT;
103045
103046 @@ -1913,9 +1912,6 @@
103047 /* 0x00 */
103048 COMPATIBLE_IOCTL(FIBMAP)
103049 COMPATIBLE_IOCTL(FIGETBSZ)
103050 -/* 'X' - originally XFS but some now in the VFS */
103051 -COMPATIBLE_IOCTL(FIFREEZE)
103052 -COMPATIBLE_IOCTL(FITHAW)
103053 /* RAID */
103054 COMPATIBLE_IOCTL(RAID_VERSION)
103055 COMPATIBLE_IOCTL(GET_ARRAY_INFO)
103056 @@ -1941,8 +1937,6 @@
103057 /* Big K */
103058 COMPATIBLE_IOCTL(PIO_FONT)
103059 COMPATIBLE_IOCTL(GIO_FONT)
103060 -COMPATIBLE_IOCTL(PIO_CMAP)
103061 -COMPATIBLE_IOCTL(GIO_CMAP)
103062 ULONG_IOCTL(KDSIGACCEPT)
103063 COMPATIBLE_IOCTL(KDGETKEYCODE)
103064 COMPATIBLE_IOCTL(KDSETKEYCODE)
103065 @@ -1988,11 +1982,6 @@
103066 COMPATIBLE_IOCTL(TUNSETDEBUG)
103067 COMPATIBLE_IOCTL(TUNSETPERSIST)
103068 COMPATIBLE_IOCTL(TUNSETOWNER)
103069 -COMPATIBLE_IOCTL(TUNSETLINK)
103070 -COMPATIBLE_IOCTL(TUNSETGROUP)
103071 -COMPATIBLE_IOCTL(TUNGETFEATURES)
103072 -COMPATIBLE_IOCTL(TUNSETOFFLOAD)
103073 -COMPATIBLE_IOCTL(TUNSETTXFILTER)
103074 /* Big V */
103075 COMPATIBLE_IOCTL(VT_SETMODE)
103076 COMPATIBLE_IOCTL(VT_GETMODE)
103077 @@ -2584,7 +2573,6 @@
103078 HANDLE_IOCTL(SIOCGIFTXQLEN, dev_ifsioc)
103079 HANDLE_IOCTL(SIOCSIFTXQLEN, dev_ifsioc)
103080 HANDLE_IOCTL(TUNSETIFF, dev_ifsioc)
103081 -HANDLE_IOCTL(TUNGETIFF, dev_ifsioc)
103082 HANDLE_IOCTL(SIOCETHTOOL, ethtool_ioctl)
103083 HANDLE_IOCTL(SIOCBONDENSLAVE, bond_ioctl)
103084 HANDLE_IOCTL(SIOCBONDRELEASE, bond_ioctl)
103085 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/dcache.c linux-2.6.29-rc3.owrt/fs/dcache.c
103086 --- linux-2.6.29.owrt/fs/dcache.c 2009-05-10 22:04:39.000000000 +0200
103087 +++ linux-2.6.29-rc3.owrt/fs/dcache.c 2009-05-10 23:48:29.000000000 +0200
103088 @@ -1180,7 +1180,7 @@
103089 iput(inode);
103090 return res;
103091 }
103092 -EXPORT_SYMBOL(d_obtain_alias);
103093 +EXPORT_SYMBOL_GPL(d_obtain_alias);
103094
103095 /**
103096 * d_splice_alias - splice a disconnected dentry into the tree if one exists
103097 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/devpts/inode.c linux-2.6.29-rc3.owrt/fs/devpts/inode.c
103098 --- linux-2.6.29.owrt/fs/devpts/inode.c 2009-05-10 22:04:39.000000000 +0200
103099 +++ linux-2.6.29-rc3.owrt/fs/devpts/inode.c 2009-05-10 23:48:29.000000000 +0200
103100 @@ -198,6 +198,9 @@
103101
103102 fsi->ptmx_dentry = dentry;
103103 rc = 0;
103104 +
103105 + printk(KERN_DEBUG "Created ptmx node in devpts ino %lu\n",
103106 + inode->i_ino);
103107 out:
103108 mutex_unlock(&root->d_inode->i_mutex);
103109 return rc;
103110 @@ -366,6 +369,8 @@
103111 struct pts_fs_info *fsi;
103112 struct pts_mount_opts *opts;
103113
103114 + printk(KERN_NOTICE "devpts: newinstance mount\n");
103115 +
103116 err = get_sb_nodev(fs_type, flags, data, devpts_fill_super, mnt);
103117 if (err)
103118 return err;
103119 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ecryptfs/crypto.c linux-2.6.29-rc3.owrt/fs/ecryptfs/crypto.c
103120 --- linux-2.6.29.owrt/fs/ecryptfs/crypto.c 2009-05-10 22:04:39.000000000 +0200
103121 +++ linux-2.6.29-rc3.owrt/fs/ecryptfs/crypto.c 2009-05-10 23:48:29.000000000 +0200
103122 @@ -946,8 +946,6 @@
103123 list_for_each_entry(global_auth_tok,
103124 &mount_crypt_stat->global_auth_tok_list,
103125 mount_crypt_stat_list) {
103126 - if (global_auth_tok->flags & ECRYPTFS_AUTH_TOK_FNEK)
103127 - continue;
103128 rc = ecryptfs_add_keysig(crypt_stat, global_auth_tok->sig);
103129 if (rc) {
103130 printk(KERN_ERR "Error adding keysig; rc = [%d]\n", rc);
103131 @@ -1324,13 +1322,14 @@
103132 }
103133
103134 static int
103135 -ecryptfs_write_metadata_to_contents(struct dentry *ecryptfs_dentry,
103136 - char *virt, size_t virt_len)
103137 +ecryptfs_write_metadata_to_contents(struct ecryptfs_crypt_stat *crypt_stat,
103138 + struct dentry *ecryptfs_dentry,
103139 + char *virt)
103140 {
103141 int rc;
103142
103143 rc = ecryptfs_write_lower(ecryptfs_dentry->d_inode, virt,
103144 - 0, virt_len);
103145 + 0, crypt_stat->num_header_bytes_at_front);
103146 if (rc)
103147 printk(KERN_ERR "%s: Error attempting to write header "
103148 "information to lower file; rc = [%d]\n", __func__,
103149 @@ -1340,6 +1339,7 @@
103150
103151 static int
103152 ecryptfs_write_metadata_to_xattr(struct dentry *ecryptfs_dentry,
103153 + struct ecryptfs_crypt_stat *crypt_stat,
103154 char *page_virt, size_t size)
103155 {
103156 int rc;
103157 @@ -1349,17 +1349,6 @@
103158 return rc;
103159 }
103160
103161 -static unsigned long ecryptfs_get_zeroed_pages(gfp_t gfp_mask,
103162 - unsigned int order)
103163 -{
103164 - struct page *page;
103165 -
103166 - page = alloc_pages(gfp_mask | __GFP_ZERO, order);
103167 - if (page)
103168 - return (unsigned long) page_address(page);
103169 - return 0;
103170 -}
103171 -
103172 /**
103173 * ecryptfs_write_metadata
103174 * @ecryptfs_dentry: The eCryptfs dentry
103175 @@ -1376,9 +1365,7 @@
103176 {
103177 struct ecryptfs_crypt_stat *crypt_stat =
103178 &ecryptfs_inode_to_private(ecryptfs_dentry->d_inode)->crypt_stat;
103179 - unsigned int order;
103180 char *virt;
103181 - size_t virt_len;
103182 size_t size = 0;
103183 int rc = 0;
103184
103185 @@ -1394,35 +1381,33 @@
103186 rc = -EINVAL;
103187 goto out;
103188 }
103189 - virt_len = crypt_stat->num_header_bytes_at_front;
103190 - order = get_order(virt_len);
103191 /* Released in this function */
103192 - virt = (char *)ecryptfs_get_zeroed_pages(GFP_KERNEL, order);
103193 + virt = (char *)get_zeroed_page(GFP_KERNEL);
103194 if (!virt) {
103195 printk(KERN_ERR "%s: Out of memory\n", __func__);
103196 rc = -ENOMEM;
103197 goto out;
103198 }
103199 - rc = ecryptfs_write_headers_virt(virt, virt_len, &size, crypt_stat,
103200 - ecryptfs_dentry);
103201 + rc = ecryptfs_write_headers_virt(virt, PAGE_CACHE_SIZE, &size,
103202 + crypt_stat, ecryptfs_dentry);
103203 if (unlikely(rc)) {
103204 printk(KERN_ERR "%s: Error whilst writing headers; rc = [%d]\n",
103205 __func__, rc);
103206 goto out_free;
103207 }
103208 if (crypt_stat->flags & ECRYPTFS_METADATA_IN_XATTR)
103209 - rc = ecryptfs_write_metadata_to_xattr(ecryptfs_dentry, virt,
103210 - size);
103211 + rc = ecryptfs_write_metadata_to_xattr(ecryptfs_dentry,
103212 + crypt_stat, virt, size);
103213 else
103214 - rc = ecryptfs_write_metadata_to_contents(ecryptfs_dentry, virt,
103215 - virt_len);
103216 + rc = ecryptfs_write_metadata_to_contents(crypt_stat,
103217 + ecryptfs_dentry, virt);
103218 if (rc) {
103219 printk(KERN_ERR "%s: Error writing metadata out to lower file; "
103220 "rc = [%d]\n", __func__, rc);
103221 goto out_free;
103222 }
103223 out_free:
103224 - free_pages((unsigned long)virt, order);
103225 + free_page((unsigned long)virt);
103226 out:
103227 return rc;
103228 }
103229 @@ -1731,7 +1716,7 @@
103230 {
103231 int rc = 0;
103232
103233 - (*copied_name) = kmalloc((name_size + 1), GFP_KERNEL);
103234 + (*copied_name) = kmalloc((name_size + 2), GFP_KERNEL);
103235 if (!(*copied_name)) {
103236 rc = -ENOMEM;
103237 goto out;
103238 @@ -1741,7 +1726,7 @@
103239 * in printing out the
103240 * string in debug
103241 * messages */
103242 - (*copied_name_size) = name_size;
103243 + (*copied_name_size) = (name_size + 1);
103244 out:
103245 return rc;
103246 }
103247 @@ -2221,19 +2206,17 @@
103248 struct dentry *ecryptfs_dir_dentry,
103249 const char *name, size_t name_size)
103250 {
103251 - struct ecryptfs_mount_crypt_stat *mount_crypt_stat =
103252 - &ecryptfs_superblock_to_private(
103253 - ecryptfs_dir_dentry->d_sb)->mount_crypt_stat;
103254 char *decoded_name;
103255 size_t decoded_name_size;
103256 size_t packet_size;
103257 int rc = 0;
103258
103259 - if ((mount_crypt_stat->flags & ECRYPTFS_GLOBAL_ENCRYPT_FILENAMES)
103260 - && !(mount_crypt_stat->flags & ECRYPTFS_ENCRYPTED_VIEW_ENABLED)
103261 - && (name_size > ECRYPTFS_FNEK_ENCRYPTED_FILENAME_PREFIX_SIZE)
103262 + if ((name_size > ECRYPTFS_FNEK_ENCRYPTED_FILENAME_PREFIX_SIZE)
103263 && (strncmp(name, ECRYPTFS_FNEK_ENCRYPTED_FILENAME_PREFIX,
103264 ECRYPTFS_FNEK_ENCRYPTED_FILENAME_PREFIX_SIZE) == 0)) {
103265 + struct ecryptfs_mount_crypt_stat *mount_crypt_stat =
103266 + &ecryptfs_superblock_to_private(
103267 + ecryptfs_dir_dentry->d_sb)->mount_crypt_stat;
103268 const char *orig_name = name;
103269 size_t orig_name_size = name_size;
103270
103271 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ecryptfs/ecryptfs_kernel.h linux-2.6.29-rc3.owrt/fs/ecryptfs/ecryptfs_kernel.h
103272 --- linux-2.6.29.owrt/fs/ecryptfs/ecryptfs_kernel.h 2009-05-10 22:04:39.000000000 +0200
103273 +++ linux-2.6.29-rc3.owrt/fs/ecryptfs/ecryptfs_kernel.h 2009-05-10 23:48:29.000000000 +0200
103274 @@ -328,7 +328,6 @@
103275 */
103276 struct ecryptfs_global_auth_tok {
103277 #define ECRYPTFS_AUTH_TOK_INVALID 0x00000001
103278 -#define ECRYPTFS_AUTH_TOK_FNEK 0x00000002
103279 u32 flags;
103280 struct list_head mount_crypt_stat_list;
103281 struct key *global_auth_tok_key;
103282 @@ -620,6 +619,7 @@
103283 u32 flags);
103284 int ecryptfs_lookup_and_interpose_lower(struct dentry *ecryptfs_dentry,
103285 struct dentry *lower_dentry,
103286 + struct ecryptfs_crypt_stat *crypt_stat,
103287 struct inode *ecryptfs_dir_inode,
103288 struct nameidata *ecryptfs_nd);
103289 int ecryptfs_decode_and_decrypt_filename(char **decrypted_name,
103290 @@ -696,7 +696,7 @@
103291 int ecryptfs_add_keysig(struct ecryptfs_crypt_stat *crypt_stat, char *sig);
103292 int
103293 ecryptfs_add_global_auth_tok(struct ecryptfs_mount_crypt_stat *mount_crypt_stat,
103294 - char *sig, u32 global_auth_tok_flags);
103295 + char *sig);
103296 int ecryptfs_get_global_auth_tok_for_sig(
103297 struct ecryptfs_global_auth_tok **global_auth_tok,
103298 struct ecryptfs_mount_crypt_stat *mount_crypt_stat, char *sig);
103299 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ecryptfs/inode.c linux-2.6.29-rc3.owrt/fs/ecryptfs/inode.c
103300 --- linux-2.6.29.owrt/fs/ecryptfs/inode.c 2009-05-10 22:04:39.000000000 +0200
103301 +++ linux-2.6.29-rc3.owrt/fs/ecryptfs/inode.c 2009-05-10 23:48:29.000000000 +0200
103302 @@ -246,6 +246,7 @@
103303 */
103304 int ecryptfs_lookup_and_interpose_lower(struct dentry *ecryptfs_dentry,
103305 struct dentry *lower_dentry,
103306 + struct ecryptfs_crypt_stat *crypt_stat,
103307 struct inode *ecryptfs_dir_inode,
103308 struct nameidata *ecryptfs_nd)
103309 {
103310 @@ -253,7 +254,6 @@
103311 struct vfsmount *lower_mnt;
103312 struct inode *lower_inode;
103313 struct ecryptfs_mount_crypt_stat *mount_crypt_stat;
103314 - struct ecryptfs_crypt_stat *crypt_stat;
103315 char *page_virt = NULL;
103316 u64 file_size;
103317 int rc = 0;
103318 @@ -314,11 +314,6 @@
103319 goto out_free_kmem;
103320 }
103321 }
103322 - crypt_stat = &ecryptfs_inode_to_private(
103323 - ecryptfs_dentry->d_inode)->crypt_stat;
103324 - /* TODO: lock for crypt_stat comparison */
103325 - if (!(crypt_stat->flags & ECRYPTFS_POLICY_APPLIED))
103326 - ecryptfs_set_default_sizes(crypt_stat);
103327 rc = ecryptfs_read_and_validate_header_region(page_virt,
103328 ecryptfs_dentry->d_inode);
103329 if (rc) {
103330 @@ -367,7 +362,9 @@
103331 {
103332 char *encrypted_and_encoded_name = NULL;
103333 size_t encrypted_and_encoded_name_size;
103334 + struct ecryptfs_crypt_stat *crypt_stat = NULL;
103335 struct ecryptfs_mount_crypt_stat *mount_crypt_stat = NULL;
103336 + struct ecryptfs_inode_info *inode_info;
103337 struct dentry *lower_dir_dentry, *lower_dentry;
103338 int rc = 0;
103339
103340 @@ -391,15 +388,26 @@
103341 }
103342 if (lower_dentry->d_inode)
103343 goto lookup_and_interpose;
103344 - mount_crypt_stat = &ecryptfs_superblock_to_private(
103345 - ecryptfs_dentry->d_sb)->mount_crypt_stat;
103346 - if (!(mount_crypt_stat
103347 - && (mount_crypt_stat->flags & ECRYPTFS_GLOBAL_ENCRYPT_FILENAMES)))
103348 + inode_info = ecryptfs_inode_to_private(ecryptfs_dentry->d_inode);
103349 + if (inode_info) {
103350 + crypt_stat = &inode_info->crypt_stat;
103351 + /* TODO: lock for crypt_stat comparison */
103352 + if (!(crypt_stat->flags & ECRYPTFS_POLICY_APPLIED))
103353 + ecryptfs_set_default_sizes(crypt_stat);
103354 + }
103355 + if (crypt_stat)
103356 + mount_crypt_stat = crypt_stat->mount_crypt_stat;
103357 + else
103358 + mount_crypt_stat = &ecryptfs_superblock_to_private(
103359 + ecryptfs_dentry->d_sb)->mount_crypt_stat;
103360 + if (!(crypt_stat && (crypt_stat->flags & ECRYPTFS_ENCRYPT_FILENAMES))
103361 + && !(mount_crypt_stat && (mount_crypt_stat->flags
103362 + & ECRYPTFS_GLOBAL_ENCRYPT_FILENAMES)))
103363 goto lookup_and_interpose;
103364 dput(lower_dentry);
103365 rc = ecryptfs_encrypt_and_encode_filename(
103366 &encrypted_and_encoded_name, &encrypted_and_encoded_name_size,
103367 - NULL, mount_crypt_stat, ecryptfs_dentry->d_name.name,
103368 + crypt_stat, mount_crypt_stat, ecryptfs_dentry->d_name.name,
103369 ecryptfs_dentry->d_name.len);
103370 if (rc) {
103371 printk(KERN_ERR "%s: Error attempting to encrypt and encode "
103372 @@ -418,7 +426,7 @@
103373 }
103374 lookup_and_interpose:
103375 rc = ecryptfs_lookup_and_interpose_lower(ecryptfs_dentry, lower_dentry,
103376 - ecryptfs_dir_inode,
103377 + crypt_stat, ecryptfs_dir_inode,
103378 ecryptfs_nd);
103379 goto out;
103380 out_d_drop:
103381 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ecryptfs/keystore.c linux-2.6.29-rc3.owrt/fs/ecryptfs/keystore.c
103382 --- linux-2.6.29.owrt/fs/ecryptfs/keystore.c 2009-05-10 22:04:39.000000000 +0200
103383 +++ linux-2.6.29-rc3.owrt/fs/ecryptfs/keystore.c 2009-05-10 23:48:29.000000000 +0200
103384 @@ -2375,7 +2375,7 @@
103385
103386 int
103387 ecryptfs_add_global_auth_tok(struct ecryptfs_mount_crypt_stat *mount_crypt_stat,
103388 - char *sig, u32 global_auth_tok_flags)
103389 + char *sig)
103390 {
103391 struct ecryptfs_global_auth_tok *new_auth_tok;
103392 int rc = 0;
103393 @@ -2389,7 +2389,6 @@
103394 goto out;
103395 }
103396 memcpy(new_auth_tok->sig, sig, ECRYPTFS_SIG_SIZE_HEX);
103397 - new_auth_tok->flags = global_auth_tok_flags;
103398 new_auth_tok->sig[ECRYPTFS_SIG_SIZE_HEX] = '\0';
103399 mutex_lock(&mount_crypt_stat->global_auth_tok_list_mutex);
103400 list_add(&new_auth_tok->mount_crypt_stat_list,
103401 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ecryptfs/main.c linux-2.6.29-rc3.owrt/fs/ecryptfs/main.c
103402 --- linux-2.6.29.owrt/fs/ecryptfs/main.c 2009-05-10 22:04:39.000000000 +0200
103403 +++ linux-2.6.29-rc3.owrt/fs/ecryptfs/main.c 2009-05-10 23:48:29.000000000 +0200
103404 @@ -319,7 +319,7 @@
103405 case ecryptfs_opt_ecryptfs_sig:
103406 sig_src = args[0].from;
103407 rc = ecryptfs_add_global_auth_tok(mount_crypt_stat,
103408 - sig_src, 0);
103409 + sig_src);
103410 if (rc) {
103411 printk(KERN_ERR "Error attempting to register "
103412 "global sig; rc = [%d]\n", rc);
103413 @@ -370,8 +370,7 @@
103414 ECRYPTFS_SIG_SIZE_HEX] = '\0';
103415 rc = ecryptfs_add_global_auth_tok(
103416 mount_crypt_stat,
103417 - mount_crypt_stat->global_default_fnek_sig,
103418 - ECRYPTFS_AUTH_TOK_FNEK);
103419 + mount_crypt_stat->global_default_fnek_sig);
103420 if (rc) {
103421 printk(KERN_ERR "Error attempting to register "
103422 "global fnek sig [%s]; rc = [%d]\n",
103423 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/eventpoll.c linux-2.6.29-rc3.owrt/fs/eventpoll.c
103424 --- linux-2.6.29.owrt/fs/eventpoll.c 2009-05-10 22:04:39.000000000 +0200
103425 +++ linux-2.6.29-rc3.owrt/fs/eventpoll.c 2009-05-10 23:48:29.000000000 +0200
103426 @@ -234,6 +234,8 @@
103427 /*
103428 * Configuration options available inside /proc/sys/fs/epoll/
103429 */
103430 +/* Maximum number of epoll devices, per user */
103431 +static int max_user_instances __read_mostly;
103432 /* Maximum number of epoll watched descriptors, per user */
103433 static int max_user_watches __read_mostly;
103434
103435 @@ -259,6 +261,14 @@
103436
103437 ctl_table epoll_table[] = {
103438 {
103439 + .procname = "max_user_instances",
103440 + .data = &max_user_instances,
103441 + .maxlen = sizeof(int),
103442 + .mode = 0644,
103443 + .proc_handler = &proc_dointvec_minmax,
103444 + .extra1 = &zero,
103445 + },
103446 + {
103447 .procname = "max_user_watches",
103448 .data = &max_user_watches,
103449 .maxlen = sizeof(int),
103450 @@ -481,6 +491,7 @@
103451
103452 mutex_unlock(&epmutex);
103453 mutex_destroy(&ep->mtx);
103454 + atomic_dec(&ep->user->epoll_devs);
103455 free_uid(ep->user);
103456 kfree(ep);
103457 }
103458 @@ -570,6 +581,10 @@
103459 struct eventpoll *ep;
103460
103461 user = get_current_user();
103462 + error = -EMFILE;
103463 + if (unlikely(atomic_read(&user->epoll_devs) >=
103464 + max_user_instances))
103465 + goto free_uid;
103466 error = -ENOMEM;
103467 ep = kzalloc(sizeof(*ep), GFP_KERNEL);
103468 if (unlikely(!ep))
103469 @@ -1126,6 +1141,7 @@
103470 flags & O_CLOEXEC);
103471 if (fd < 0)
103472 ep_free(ep);
103473 + atomic_inc(&ep->user->epoll_devs);
103474
103475 error_return:
103476 DNPRINTK(3, (KERN_INFO "[%p] eventpoll: sys_epoll_create(%d) = %d\n",
103477 @@ -1350,10 +1366,8 @@
103478 struct sysinfo si;
103479
103480 si_meminfo(&si);
103481 - /*
103482 - * Allows top 4% of lomem to be allocated for epoll watches (per user).
103483 - */
103484 - max_user_watches = (((si.totalram - si.totalhigh) / 25) << PAGE_SHIFT) /
103485 + max_user_instances = 128;
103486 + max_user_watches = (((si.totalram - si.totalhigh) / 32) << PAGE_SHIFT) /
103487 EP_ITEM_COST;
103488
103489 /* Initialize the structure used to perform safe poll wait head wake ups */
103490 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/exec.c linux-2.6.29-rc3.owrt/fs/exec.c
103491 --- linux-2.6.29.owrt/fs/exec.c 2009-05-10 22:04:39.000000000 +0200
103492 +++ linux-2.6.29-rc3.owrt/fs/exec.c 2009-05-10 23:48:29.000000000 +0200
103493 @@ -1049,32 +1049,16 @@
103494 * - the caller must hold current->cred_exec_mutex to protect against
103495 * PTRACE_ATTACH
103496 */
103497 -void check_unsafe_exec(struct linux_binprm *bprm, struct files_struct *files)
103498 +void check_unsafe_exec(struct linux_binprm *bprm)
103499 {
103500 - struct task_struct *p = current, *t;
103501 - unsigned long flags;
103502 - unsigned n_fs, n_files, n_sighand;
103503 + struct task_struct *p = current;
103504
103505 bprm->unsafe = tracehook_unsafe_exec(p);
103506
103507 - n_fs = 1;
103508 - n_files = 1;
103509 - n_sighand = 1;
103510 - lock_task_sighand(p, &flags);
103511 - for (t = next_thread(p); t != p; t = next_thread(t)) {
103512 - if (t->fs == p->fs)
103513 - n_fs++;
103514 - if (t->files == files)
103515 - n_files++;
103516 - n_sighand++;
103517 - }
103518 -
103519 - if (atomic_read(&p->fs->count) > n_fs ||
103520 - atomic_read(&p->files->count) > n_files ||
103521 - atomic_read(&p->sighand->count) > n_sighand)
103522 + if (atomic_read(&p->fs->count) > 1 ||
103523 + atomic_read(&p->files->count) > 1 ||
103524 + atomic_read(&p->sighand->count) > 1)
103525 bprm->unsafe |= LSM_UNSAFE_SHARE;
103526 -
103527 - unlock_task_sighand(p, &flags);
103528 }
103529
103530 /*
103531 @@ -1289,7 +1273,7 @@
103532 bprm->cred = prepare_exec_creds();
103533 if (!bprm->cred)
103534 goto out_unlock;
103535 - check_unsafe_exec(bprm, displaced);
103536 + check_unsafe_exec(bprm);
103537
103538 file = open_exec(filename);
103539 retval = PTR_ERR(file);
103540 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ext2/super.c linux-2.6.29-rc3.owrt/fs/ext2/super.c
103541 --- linux-2.6.29.owrt/fs/ext2/super.c 2009-05-10 22:04:39.000000000 +0200
103542 +++ linux-2.6.29-rc3.owrt/fs/ext2/super.c 2009-05-10 23:48:29.000000000 +0200
103543 @@ -1185,12 +1185,9 @@
103544 es = sbi->s_es;
103545 if (((sbi->s_mount_opt & EXT2_MOUNT_XIP) !=
103546 (old_mount_opt & EXT2_MOUNT_XIP)) &&
103547 - invalidate_inodes(sb)) {
103548 - ext2_warning(sb, __func__, "refusing change of xip flag "
103549 - "with busy inodes while remounting");
103550 - sbi->s_mount_opt &= ~EXT2_MOUNT_XIP;
103551 - sbi->s_mount_opt |= old_mount_opt & EXT2_MOUNT_XIP;
103552 - }
103553 + invalidate_inodes(sb))
103554 + ext2_warning(sb, __func__, "busy inodes while remounting "\
103555 + "xip remain in cache (no functional problem)");
103556 if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY))
103557 return 0;
103558 if (*flags & MS_RDONLY) {
103559 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ext3/namei.c linux-2.6.29-rc3.owrt/fs/ext3/namei.c
103560 --- linux-2.6.29.owrt/fs/ext3/namei.c 2009-05-10 22:04:39.000000000 +0200
103561 +++ linux-2.6.29-rc3.owrt/fs/ext3/namei.c 2009-05-10 23:48:29.000000000 +0200
103562 @@ -1358,7 +1358,7 @@
103563 struct fake_dirent *fde;
103564
103565 blocksize = dir->i_sb->s_blocksize;
103566 - dxtrace(printk(KERN_DEBUG "Creating index: inode %lu\n", dir->i_ino));
103567 + dxtrace(printk("Creating index\n"));
103568 retval = ext3_journal_get_write_access(handle, bh);
103569 if (retval) {
103570 ext3_std_error(dir->i_sb, retval);
103571 @@ -1367,19 +1367,6 @@
103572 }
103573 root = (struct dx_root *) bh->b_data;
103574
103575 - /* The 0th block becomes the root, move the dirents out */
103576 - fde = &root->dotdot;
103577 - de = (struct ext3_dir_entry_2 *)((char *)fde +
103578 - ext3_rec_len_from_disk(fde->rec_len));
103579 - if ((char *) de >= (((char *) root) + blocksize)) {
103580 - ext3_error(dir->i_sb, __func__,
103581 - "invalid rec_len for '..' in inode %lu",
103582 - dir->i_ino);
103583 - brelse(bh);
103584 - return -EIO;
103585 - }
103586 - len = ((char *) root) + blocksize - (char *) de;
103587 -
103588 bh2 = ext3_append (handle, dir, &block, &retval);
103589 if (!(bh2)) {
103590 brelse(bh);
103591 @@ -1388,6 +1375,11 @@
103592 EXT3_I(dir)->i_flags |= EXT3_INDEX_FL;
103593 data1 = bh2->b_data;
103594
103595 + /* The 0th block becomes the root, move the dirents out */
103596 + fde = &root->dotdot;
103597 + de = (struct ext3_dir_entry_2 *)((char *)fde +
103598 + ext3_rec_len_from_disk(fde->rec_len));
103599 + len = ((char *) root) + blocksize - (char *) de;
103600 memcpy (data1, de, len);
103601 de = (struct ext3_dir_entry_2 *) data1;
103602 top = data1 + len;
103603 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ext3/super.c linux-2.6.29-rc3.owrt/fs/ext3/super.c
103604 --- linux-2.6.29.owrt/fs/ext3/super.c 2009-05-10 22:04:39.000000000 +0200
103605 +++ linux-2.6.29-rc3.owrt/fs/ext3/super.c 2009-05-10 23:48:29.000000000 +0200
103606 @@ -2428,13 +2428,12 @@
103607
103608 static int ext3_sync_fs(struct super_block *sb, int wait)
103609 {
103610 - tid_t target;
103611 -
103612 sb->s_dirt = 0;
103613 - if (journal_start_commit(EXT3_SB(sb)->s_journal, &target)) {
103614 - if (wait)
103615 - log_wait_commit(EXT3_SB(sb)->s_journal, target);
103616 - }
103617 + if (wait)
103618 + ext3_force_commit(sb);
103619 + else
103620 + journal_start_commit(EXT3_SB(sb)->s_journal, NULL);
103621 +
103622 return 0;
103623 }
103624
103625 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ext4/balloc.c linux-2.6.29-rc3.owrt/fs/ext4/balloc.c
103626 --- linux-2.6.29.owrt/fs/ext4/balloc.c 2009-05-10 22:04:39.000000000 +0200
103627 +++ linux-2.6.29-rc3.owrt/fs/ext4/balloc.c 2009-05-10 23:48:29.000000000 +0200
103628 @@ -609,9 +609,7 @@
103629 */
103630 int ext4_should_retry_alloc(struct super_block *sb, int *retries)
103631 {
103632 - if (!ext4_has_free_blocks(EXT4_SB(sb), 1) ||
103633 - (*retries)++ > 3 ||
103634 - !EXT4_SB(sb)->s_journal)
103635 + if (!ext4_has_free_blocks(EXT4_SB(sb), 1) || (*retries)++ > 3)
103636 return 0;
103637
103638 jbd_debug(1, "%s: retrying operation after ENOSPC\n", sb->s_id);
103639 @@ -686,15 +684,15 @@
103640 gdp = ext4_get_group_desc(sb, i, NULL);
103641 if (!gdp)
103642 continue;
103643 - desc_count += ext4_free_blks_count(sb, gdp);
103644 + desc_count += le16_to_cpu(gdp->bg_free_blocks_count);
103645 brelse(bitmap_bh);
103646 bitmap_bh = ext4_read_block_bitmap(sb, i);
103647 if (bitmap_bh == NULL)
103648 continue;
103649
103650 x = ext4_count_free(bitmap_bh, sb->s_blocksize);
103651 - printk(KERN_DEBUG "group %u: stored = %d, counted = %u\n",
103652 - i, ext4_free_blks_count(sb, gdp), x);
103653 + printk(KERN_DEBUG "group %lu: stored = %d, counted = %u\n",
103654 + i, le16_to_cpu(gdp->bg_free_blocks_count), x);
103655 bitmap_count += x;
103656 }
103657 brelse(bitmap_bh);
103658 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ext4/ext4.h linux-2.6.29-rc3.owrt/fs/ext4/ext4.h
103659 --- linux-2.6.29.owrt/fs/ext4/ext4.h 2009-05-10 22:04:39.000000000 +0200
103660 +++ linux-2.6.29-rc3.owrt/fs/ext4/ext4.h 2009-05-10 23:48:29.000000000 +0200
103661 @@ -868,7 +868,7 @@
103662 {
103663 unsigned len = le16_to_cpu(dlen);
103664
103665 - if (len == EXT4_MAX_REC_LEN || len == 0)
103666 + if (len == EXT4_MAX_REC_LEN)
103667 return 1 << 16;
103668 return len;
103669 }
103670 @@ -1206,11 +1206,8 @@
103671
103672 static inline loff_t ext4_isize(struct ext4_inode *raw_inode)
103673 {
103674 - if (S_ISREG(le16_to_cpu(raw_inode->i_mode)))
103675 - return ((loff_t)le32_to_cpu(raw_inode->i_size_high) << 32) |
103676 - le32_to_cpu(raw_inode->i_size_lo);
103677 - else
103678 - return (loff_t) le32_to_cpu(raw_inode->i_size_lo);
103679 + return ((loff_t)le32_to_cpu(raw_inode->i_size_high) << 32) |
103680 + le32_to_cpu(raw_inode->i_size_lo);
103681 }
103682
103683 static inline void ext4_isize_set(struct ext4_inode *raw_inode, loff_t i_size)
103684 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ext4/extents.c linux-2.6.29-rc3.owrt/fs/ext4/extents.c
103685 --- linux-2.6.29.owrt/fs/ext4/extents.c 2009-05-10 22:04:39.000000000 +0200
103686 +++ linux-2.6.29-rc3.owrt/fs/ext4/extents.c 2009-05-10 23:48:29.000000000 +0200
103687 @@ -1122,8 +1122,7 @@
103688 struct ext4_extent_idx *ix;
103689 struct ext4_extent *ex;
103690 ext4_fsblk_t block;
103691 - int depth; /* Note, NOT eh_depth; depth from top of tree */
103692 - int ee_len;
103693 + int depth, ee_len;
103694
103695 BUG_ON(path == NULL);
103696 depth = path->p_depth;
103697 @@ -1180,8 +1179,7 @@
103698 if (bh == NULL)
103699 return -EIO;
103700 eh = ext_block_hdr(bh);
103701 - /* subtract from p_depth to get proper eh_depth */
103702 - if (ext4_ext_check_header(inode, eh, path->p_depth - depth)) {
103703 + if (ext4_ext_check_header(inode, eh, depth)) {
103704 put_bh(bh);
103705 return -EIO;
103706 }
103707 @@ -3050,7 +3048,7 @@
103708 WARN_ON(ret <= 0);
103709 printk(KERN_ERR "%s: ext4_ext_get_blocks "
103710 "returned error inode#%lu, block=%u, "
103711 - "max_blocks=%u", __func__,
103712 + "max_blocks=%lu", __func__,
103713 inode->i_ino, block, max_blocks);
103714 #endif
103715 ext4_mark_inode_dirty(handle, inode);
103716 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ext4/ialloc.c linux-2.6.29-rc3.owrt/fs/ext4/ialloc.c
103717 --- linux-2.6.29.owrt/fs/ext4/ialloc.c 2009-05-10 22:04:39.000000000 +0200
103718 +++ linux-2.6.29-rc3.owrt/fs/ext4/ialloc.c 2009-05-10 23:48:29.000000000 +0200
103719 @@ -188,7 +188,7 @@
103720 struct ext4_group_desc *gdp;
103721 struct ext4_super_block *es;
103722 struct ext4_sb_info *sbi;
103723 - int fatal = 0, err, count, cleared;
103724 + int fatal = 0, err, count;
103725 ext4_group_t flex_group;
103726
103727 if (atomic_read(&inode->i_count) > 1) {
103728 @@ -248,10 +248,8 @@
103729 goto error_return;
103730
103731 /* Ok, now we can actually update the inode bitmaps.. */
103732 - spin_lock(sb_bgl_lock(sbi, block_group));
103733 - cleared = ext4_clear_bit(bit, bitmap_bh->b_data);
103734 - spin_unlock(sb_bgl_lock(sbi, block_group));
103735 - if (!cleared)
103736 + if (!ext4_clear_bit_atomic(sb_bgl_lock(sbi, block_group),
103737 + bit, bitmap_bh->b_data))
103738 ext4_error(sb, "ext4_free_inode",
103739 "bit already cleared for inode %lu", ino);
103740 else {
103741 @@ -698,7 +696,6 @@
103742 struct inode *ret;
103743 ext4_group_t i;
103744 int free = 0;
103745 - static int once = 1;
103746 ext4_group_t flex_group;
103747
103748 /* Cannot create files in a deleted directory */
103749 @@ -718,14 +715,6 @@
103750
103751 if (sbi->s_log_groups_per_flex) {
103752 ret2 = find_group_flex(sb, dir, &group);
103753 - if (ret2 == -1) {
103754 - ret2 = find_group_other(sb, dir, &group);
103755 - if (ret2 == 0 && once)
103756 - once = 0;
103757 - printk(KERN_NOTICE "ext4: find_group_flex "
103758 - "failed, fallback succeeded dir %lu\n",
103759 - dir->i_ino);
103760 - }
103761 goto got_group;
103762 }
103763
103764 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ext4/inode.c linux-2.6.29-rc3.owrt/fs/ext4/inode.c
103765 --- linux-2.6.29.owrt/fs/ext4/inode.c 2009-05-10 22:04:39.000000000 +0200
103766 +++ linux-2.6.29-rc3.owrt/fs/ext4/inode.c 2009-05-10 23:48:29.000000000 +0200
103767 @@ -47,10 +47,8 @@
103768 static inline int ext4_begin_ordered_truncate(struct inode *inode,
103769 loff_t new_size)
103770 {
103771 - return jbd2_journal_begin_ordered_truncate(
103772 - EXT4_SB(inode->i_sb)->s_journal,
103773 - &EXT4_I(inode)->jinode,
103774 - new_size);
103775 + return jbd2_journal_begin_ordered_truncate(&EXT4_I(inode)->jinode,
103776 + new_size);
103777 }
103778
103779 static void ext4_invalidatepage(struct page *page, unsigned long offset);
103780 @@ -362,9 +360,9 @@
103781 final = ptrs;
103782 } else {
103783 ext4_warning(inode->i_sb, "ext4_block_to_path",
103784 - "block %lu > max in inode %lu",
103785 + "block %lu > max",
103786 i_block + direct_blocks +
103787 - indirect_blocks + double_blocks, inode->i_ino);
103788 + indirect_blocks + double_blocks);
103789 }
103790 if (boundary)
103791 *boundary = final - 1 - (i_block & (ptrs - 1));
103792 @@ -1368,10 +1366,6 @@
103793 goto out;
103794 }
103795
103796 - /* We cannot recurse into the filesystem as the transaction is already
103797 - * started */
103798 - flags |= AOP_FLAG_NOFS;
103799 -
103800 page = grab_cache_page_write_begin(mapping, index, flags);
103801 if (!page) {
103802 ext4_journal_stop(handle);
103803 @@ -1381,7 +1375,7 @@
103804 *pagep = page;
103805
103806 ret = block_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
103807 - ext4_get_block);
103808 + ext4_get_block);
103809
103810 if (!ret && ext4_should_journal_data(inode)) {
103811 ret = walk_page_buffers(handle, page_buffers(page),
103812 @@ -2443,7 +2437,6 @@
103813 int no_nrwrite_index_update;
103814 int pages_written = 0;
103815 long pages_skipped;
103816 - int range_cyclic, cycled = 1, io_done = 0;
103817 int needed_blocks, ret = 0, nr_to_writebump = 0;
103818 struct ext4_sb_info *sbi = EXT4_SB(mapping->host->i_sb);
103819
103820 @@ -2495,15 +2488,9 @@
103821 if (wbc->range_start == 0 && wbc->range_end == LLONG_MAX)
103822 range_whole = 1;
103823
103824 - range_cyclic = wbc->range_cyclic;
103825 - if (wbc->range_cyclic) {
103826 + if (wbc->range_cyclic)
103827 index = mapping->writeback_index;
103828 - if (index)
103829 - cycled = 0;
103830 - wbc->range_start = index << PAGE_CACHE_SHIFT;
103831 - wbc->range_end = LLONG_MAX;
103832 - wbc->range_cyclic = 0;
103833 - } else
103834 + else
103835 index = wbc->range_start >> PAGE_CACHE_SHIFT;
103836
103837 mpd.wbc = wbc;
103838 @@ -2517,7 +2504,6 @@
103839 wbc->no_nrwrite_index_update = 1;
103840 pages_skipped = wbc->pages_skipped;
103841
103842 -retry:
103843 while (!ret && wbc->nr_to_write > 0) {
103844
103845 /*
103846 @@ -2544,7 +2530,7 @@
103847
103848 ext4_journal_stop(handle);
103849
103850 - if ((mpd.retval == -ENOSPC) && sbi->s_journal) {
103851 + if (mpd.retval == -ENOSPC) {
103852 /* commit the transaction which would
103853 * free blocks released in the transaction
103854 * and try again
103855 @@ -2560,7 +2546,6 @@
103856 pages_written += mpd.pages_written;
103857 wbc->pages_skipped = pages_skipped;
103858 ret = 0;
103859 - io_done = 1;
103860 } else if (wbc->nr_to_write)
103861 /*
103862 * There is no more writeout needed
103863 @@ -2569,13 +2554,6 @@
103864 */
103865 break;
103866 }
103867 - if (!io_done && !cycled) {
103868 - cycled = 1;
103869 - index = 0;
103870 - wbc->range_start = index << PAGE_CACHE_SHIFT;
103871 - wbc->range_end = mapping->writeback_index - 1;
103872 - goto retry;
103873 - }
103874 if (pages_skipped != wbc->pages_skipped)
103875 printk(KERN_EMERG "This should not happen leaving %s "
103876 "with nr_to_write = %ld ret = %d\n",
103877 @@ -2583,7 +2561,6 @@
103878
103879 /* Update index */
103880 index += pages_written;
103881 - wbc->range_cyclic = range_cyclic;
103882 if (wbc->range_cyclic || (range_whole && wbc->nr_to_write > 0))
103883 /*
103884 * set the writeback_index so that range_cyclic
103885 @@ -2671,9 +2648,6 @@
103886 ret = PTR_ERR(handle);
103887 goto out;
103888 }
103889 - /* We cannot recurse into the filesystem as the transaction is already
103890 - * started */
103891 - flags |= AOP_FLAG_NOFS;
103892
103893 page = grab_cache_page_write_begin(mapping, index, flags);
103894 if (!page) {
103895 @@ -2847,6 +2821,9 @@
103896 filemap_write_and_wait(mapping);
103897 }
103898
103899 + BUG_ON(!EXT4_JOURNAL(inode) &&
103900 + EXT4_I(inode)->i_state & EXT4_STATE_JDATA);
103901 +
103902 if (EXT4_JOURNAL(inode) && EXT4_I(inode)->i_state & EXT4_STATE_JDATA) {
103903 /*
103904 * This is a REALLY heavyweight approach, but the use of
103905 @@ -3645,7 +3622,7 @@
103906 * block pointed to itself, it would have been detached when
103907 * the block was cleared. Check for this instead of OOPSing.
103908 */
103909 - if ((EXT4_JOURNAL(inode) == NULL) || bh2jh(this_bh))
103910 + if (bh2jh(this_bh))
103911 ext4_handle_dirty_metadata(handle, inode, this_bh);
103912 else
103913 ext4_error(inode->i_sb, __func__,
103914 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ext4/mballoc.c linux-2.6.29-rc3.owrt/fs/ext4/mballoc.c
103915 --- linux-2.6.29.owrt/fs/ext4/mballoc.c 2009-05-10 22:04:39.000000000 +0200
103916 +++ linux-2.6.29-rc3.owrt/fs/ext4/mballoc.c 2009-05-10 23:48:29.000000000 +0200
103917 @@ -1447,7 +1447,7 @@
103918 struct ext4_free_extent *gex = &ac->ac_g_ex;
103919
103920 BUG_ON(ex->fe_len <= 0);
103921 - BUG_ON(ex->fe_len > EXT4_BLOCKS_PER_GROUP(ac->ac_sb));
103922 + BUG_ON(ex->fe_len >= EXT4_BLOCKS_PER_GROUP(ac->ac_sb));
103923 BUG_ON(ex->fe_start >= EXT4_BLOCKS_PER_GROUP(ac->ac_sb));
103924 BUG_ON(ac->ac_status != AC_STATUS_CONTINUE);
103925
103926 @@ -3025,7 +3025,7 @@
103927 goto out_err;
103928
103929 ext4_debug("using block group %u(%d)\n", ac->ac_b_ex.fe_group,
103930 - ext4_free_blks_count(sb, gdp));
103931 + gdp->bg_free_blocks_count);
103932
103933 err = ext4_journal_get_write_access(handle, gdp_bh);
103934 if (err)
103935 @@ -3292,7 +3292,7 @@
103936 }
103937 BUG_ON(start + size <= ac->ac_o_ex.fe_logical &&
103938 start > ac->ac_o_ex.fe_logical);
103939 - BUG_ON(size <= 0 || size > EXT4_BLOCKS_PER_GROUP(ac->ac_sb));
103940 + BUG_ON(size <= 0 || size >= EXT4_BLOCKS_PER_GROUP(ac->ac_sb));
103941
103942 /* now prepare goal request */
103943
103944 @@ -3589,7 +3589,6 @@
103945 struct super_block *sb, struct ext4_prealloc_space *pa)
103946 {
103947 ext4_group_t grp;
103948 - ext4_fsblk_t grp_blk;
103949
103950 if (!atomic_dec_and_test(&pa->pa_count) || pa->pa_free != 0)
103951 return;
103952 @@ -3604,12 +3603,8 @@
103953 pa->pa_deleted = 1;
103954 spin_unlock(&pa->pa_lock);
103955
103956 - grp_blk = pa->pa_pstart;
103957 - /* If linear, pa_pstart may be in the next group when pa is used up */
103958 - if (pa->pa_linear)
103959 - grp_blk--;
103960 -
103961 - ext4_get_group_no_and_offset(sb, grp_blk, &grp, NULL);
103962 + /* -1 is to protect from crossing allocation group */
103963 + ext4_get_group_no_and_offset(sb, pa->pa_pstart - 1, &grp, NULL);
103964
103965 /*
103966 * possible race:
103967 @@ -3698,8 +3693,6 @@
103968 pa->pa_free = pa->pa_len;
103969 atomic_set(&pa->pa_count, 1);
103970 spin_lock_init(&pa->pa_lock);
103971 - INIT_LIST_HEAD(&pa->pa_inode_list);
103972 - INIT_LIST_HEAD(&pa->pa_group_list);
103973 pa->pa_deleted = 0;
103974 pa->pa_linear = 0;
103975
103976 @@ -3762,7 +3755,6 @@
103977 atomic_set(&pa->pa_count, 1);
103978 spin_lock_init(&pa->pa_lock);
103979 INIT_LIST_HEAD(&pa->pa_inode_list);
103980 - INIT_LIST_HEAD(&pa->pa_group_list);
103981 pa->pa_deleted = 0;
103982 pa->pa_linear = 1;
103983
103984 @@ -4484,26 +4476,23 @@
103985 pa->pa_free -= ac->ac_b_ex.fe_len;
103986 pa->pa_len -= ac->ac_b_ex.fe_len;
103987 spin_unlock(&pa->pa_lock);
103988 + /*
103989 + * We want to add the pa to the right bucket.
103990 + * Remove it from the list and while adding
103991 + * make sure the list to which we are adding
103992 + * doesn't grow big.
103993 + */
103994 + if (likely(pa->pa_free)) {
103995 + spin_lock(pa->pa_obj_lock);
103996 + list_del_rcu(&pa->pa_inode_list);
103997 + spin_unlock(pa->pa_obj_lock);
103998 + ext4_mb_add_n_trim(ac);
103999 + }
104000 }
104001 + ext4_mb_put_pa(ac, ac->ac_sb, pa);
104002 }
104003 if (ac->alloc_semp)
104004 up_read(ac->alloc_semp);
104005 - if (pa) {
104006 - /*
104007 - * We want to add the pa to the right bucket.
104008 - * Remove it from the list and while adding
104009 - * make sure the list to which we are adding
104010 - * doesn't grow big. We need to release
104011 - * alloc_semp before calling ext4_mb_add_n_trim()
104012 - */
104013 - if (pa->pa_linear && likely(pa->pa_free)) {
104014 - spin_lock(pa->pa_obj_lock);
104015 - list_del_rcu(&pa->pa_inode_list);
104016 - spin_unlock(pa->pa_obj_lock);
104017 - ext4_mb_add_n_trim(ac);
104018 - }
104019 - ext4_mb_put_pa(ac, ac->ac_sb, pa);
104020 - }
104021 if (ac->ac_bitmap_page)
104022 page_cache_release(ac->ac_bitmap_page);
104023 if (ac->ac_buddy_page)
104024 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ext4/migrate.c linux-2.6.29-rc3.owrt/fs/ext4/migrate.c
104025 --- linux-2.6.29.owrt/fs/ext4/migrate.c 2009-05-10 22:04:39.000000000 +0200
104026 +++ linux-2.6.29-rc3.owrt/fs/ext4/migrate.c 2009-05-10 23:48:29.000000000 +0200
104027 @@ -481,7 +481,7 @@
104028 + 1);
104029 if (IS_ERR(handle)) {
104030 retval = PTR_ERR(handle);
104031 - return retval;
104032 + goto err_out;
104033 }
104034 tmp_inode = ext4_new_inode(handle,
104035 inode->i_sb->s_root->d_inode,
104036 @@ -489,7 +489,8 @@
104037 if (IS_ERR(tmp_inode)) {
104038 retval = -ENOMEM;
104039 ext4_journal_stop(handle);
104040 - return retval;
104041 + tmp_inode = NULL;
104042 + goto err_out;
104043 }
104044 i_size_write(tmp_inode, i_size_read(inode));
104045 /*
104046 @@ -617,7 +618,8 @@
104047
104048 ext4_journal_stop(handle);
104049
104050 - iput(tmp_inode);
104051 + if (tmp_inode)
104052 + iput(tmp_inode);
104053
104054 return retval;
104055 }
104056 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ext4/namei.c linux-2.6.29-rc3.owrt/fs/ext4/namei.c
104057 --- linux-2.6.29.owrt/fs/ext4/namei.c 2009-05-10 22:04:39.000000000 +0200
104058 +++ linux-2.6.29-rc3.owrt/fs/ext4/namei.c 2009-05-10 23:48:29.000000000 +0200
104059 @@ -1368,7 +1368,7 @@
104060 struct fake_dirent *fde;
104061
104062 blocksize = dir->i_sb->s_blocksize;
104063 - dxtrace(printk(KERN_DEBUG "Creating index: inode %lu\n", dir->i_ino));
104064 + dxtrace(printk(KERN_DEBUG "Creating index\n"));
104065 retval = ext4_journal_get_write_access(handle, bh);
104066 if (retval) {
104067 ext4_std_error(dir->i_sb, retval);
104068 @@ -1377,20 +1377,6 @@
104069 }
104070 root = (struct dx_root *) bh->b_data;
104071
104072 - /* The 0th block becomes the root, move the dirents out */
104073 - fde = &root->dotdot;
104074 - de = (struct ext4_dir_entry_2 *)((char *)fde +
104075 - ext4_rec_len_from_disk(fde->rec_len));
104076 - if ((char *) de >= (((char *) root) + blocksize)) {
104077 - ext4_error(dir->i_sb, __func__,
104078 - "invalid rec_len for '..' in inode %lu",
104079 - dir->i_ino);
104080 - brelse(bh);
104081 - return -EIO;
104082 - }
104083 - len = ((char *) root) + blocksize - (char *) de;
104084 -
104085 - /* Allocate new block for the 0th block's dirents */
104086 bh2 = ext4_append(handle, dir, &block, &retval);
104087 if (!(bh2)) {
104088 brelse(bh);
104089 @@ -1399,6 +1385,11 @@
104090 EXT4_I(dir)->i_flags |= EXT4_INDEX_FL;
104091 data1 = bh2->b_data;
104092
104093 + /* The 0th block becomes the root, move the dirents out */
104094 + fde = &root->dotdot;
104095 + de = (struct ext4_dir_entry_2 *)((char *)fde +
104096 + ext4_rec_len_from_disk(fde->rec_len));
104097 + len = ((char *) root) + blocksize - (char *) de;
104098 memcpy (data1, de, len);
104099 de = (struct ext4_dir_entry_2 *) data1;
104100 top = data1 + len;
104101 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ext4/resize.c linux-2.6.29-rc3.owrt/fs/ext4/resize.c
104102 --- linux-2.6.29.owrt/fs/ext4/resize.c 2009-05-10 22:04:39.000000000 +0200
104103 +++ linux-2.6.29-rc3.owrt/fs/ext4/resize.c 2009-05-10 23:48:29.000000000 +0200
104104 @@ -861,13 +861,12 @@
104105 gdp = (struct ext4_group_desc *)((char *)primary->b_data +
104106 gdb_off * EXT4_DESC_SIZE(sb));
104107
104108 - memset(gdp, 0, EXT4_DESC_SIZE(sb));
104109 ext4_block_bitmap_set(sb, gdp, input->block_bitmap); /* LV FIXME */
104110 ext4_inode_bitmap_set(sb, gdp, input->inode_bitmap); /* LV FIXME */
104111 ext4_inode_table_set(sb, gdp, input->inode_table); /* LV FIXME */
104112 ext4_free_blks_set(sb, gdp, input->free_blocks_count);
104113 ext4_free_inodes_set(sb, gdp, EXT4_INODES_PER_GROUP(sb));
104114 - gdp->bg_flags = cpu_to_le16(EXT4_BG_INODE_ZEROED);
104115 + gdp->bg_flags |= cpu_to_le16(EXT4_BG_INODE_ZEROED);
104116 gdp->bg_checksum = ext4_group_desc_csum(sbi, input->group, gdp);
104117
104118 /*
104119 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ext4/super.c linux-2.6.29-rc3.owrt/fs/ext4/super.c
104120 --- linux-2.6.29.owrt/fs/ext4/super.c 2009-05-10 22:04:39.000000000 +0200
104121 +++ linux-2.6.29-rc3.owrt/fs/ext4/super.c 2009-05-10 23:48:29.000000000 +0200
104122 @@ -3046,17 +3046,14 @@
104123 static int ext4_sync_fs(struct super_block *sb, int wait)
104124 {
104125 int ret = 0;
104126 - tid_t target;
104127
104128 trace_mark(ext4_sync_fs, "dev %s wait %d", sb->s_id, wait);
104129 sb->s_dirt = 0;
104130 if (EXT4_SB(sb)->s_journal) {
104131 - if (jbd2_journal_start_commit(EXT4_SB(sb)->s_journal,
104132 - &target)) {
104133 - if (wait)
104134 - jbd2_log_wait_commit(EXT4_SB(sb)->s_journal,
104135 - target);
104136 - }
104137 + if (wait)
104138 + ret = ext4_force_commit(sb);
104139 + else
104140 + jbd2_journal_start_commit(EXT4_SB(sb)->s_journal, NULL);
104141 } else {
104142 ext4_commit_super(sb, EXT4_SB(sb)->s_es, wait);
104143 }
104144 @@ -3091,6 +3088,7 @@
104145
104146 /* Journal blocked and flushed, clear needs_recovery flag. */
104147 EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER);
104148 + ext4_commit_super(sb, EXT4_SB(sb)->s_es, 1);
104149 error = ext4_commit_super(sb, EXT4_SB(sb)->s_es, 1);
104150 if (error)
104151 goto out;
104152 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/fat/inode.c linux-2.6.29-rc3.owrt/fs/fat/inode.c
104153 --- linux-2.6.29.owrt/fs/fat/inode.c 2009-05-10 22:04:39.000000000 +0200
104154 +++ linux-2.6.29-rc3.owrt/fs/fat/inode.c 2009-05-10 23:48:29.000000000 +0200
104155 @@ -202,9 +202,9 @@
104156 sector_t blocknr;
104157
104158 /* fat_get_cluster() assumes the requested blocknr isn't truncated. */
104159 - down_read(&mapping->host->i_alloc_sem);
104160 + mutex_lock(&mapping->host->i_mutex);
104161 blocknr = generic_block_bmap(mapping, block, fat_get_block);
104162 - up_read(&mapping->host->i_alloc_sem);
104163 + mutex_unlock(&mapping->host->i_mutex);
104164
104165 return blocknr;
104166 }
104167 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/fs-writeback.c linux-2.6.29-rc3.owrt/fs/fs-writeback.c
104168 --- linux-2.6.29.owrt/fs/fs-writeback.c 2009-05-10 22:04:39.000000000 +0200
104169 +++ linux-2.6.29-rc3.owrt/fs/fs-writeback.c 2009-05-10 23:48:29.000000000 +0200
104170 @@ -274,7 +274,6 @@
104171 int ret;
104172
104173 BUG_ON(inode->i_state & I_SYNC);
104174 - WARN_ON(inode->i_state & I_NEW);
104175
104176 /* Set I_SYNC, reset I_DIRTY */
104177 dirty = inode->i_state & I_DIRTY;
104178 @@ -299,7 +298,6 @@
104179 }
104180
104181 spin_lock(&inode_lock);
104182 - WARN_ON(inode->i_state & I_NEW);
104183 inode->i_state &= ~I_SYNC;
104184 if (!(inode->i_state & I_FREEING)) {
104185 if (!(inode->i_state & I_DIRTY) &&
104186 @@ -472,11 +470,6 @@
104187 break;
104188 }
104189
104190 - if (inode->i_state & I_NEW) {
104191 - requeue_io(inode);
104192 - continue;
104193 - }
104194 -
104195 if (wbc->nonblocking && bdi_write_congested(bdi)) {
104196 wbc->encountered_congestion = 1;
104197 if (!sb_is_blkdev_sb(sb))
104198 @@ -538,7 +531,7 @@
104199 list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
104200 struct address_space *mapping;
104201
104202 - if (inode->i_state & (I_FREEING|I_WILL_FREE|I_NEW))
104203 + if (inode->i_state & (I_FREEING|I_WILL_FREE))
104204 continue;
104205 mapping = inode->i_mapping;
104206 if (mapping->nrpages == 0)
104207 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/hugetlbfs/inode.c linux-2.6.29-rc3.owrt/fs/hugetlbfs/inode.c
104208 --- linux-2.6.29.owrt/fs/hugetlbfs/inode.c 2009-05-10 22:04:39.000000000 +0200
104209 +++ linux-2.6.29-rc3.owrt/fs/hugetlbfs/inode.c 2009-05-10 23:48:29.000000000 +0200
104210 @@ -108,8 +108,7 @@
104211
104212 if (hugetlb_reserve_pages(inode,
104213 vma->vm_pgoff >> huge_page_order(h),
104214 - len >> huge_page_shift(h), vma,
104215 - vma->vm_flags))
104216 + len >> huge_page_shift(h), vma))
104217 goto out;
104218
104219 ret = 0;
104220 @@ -948,7 +947,7 @@
104221 can_do_mlock());
104222 }
104223
104224 -struct file *hugetlb_file_setup(const char *name, size_t size, int acctflag)
104225 +struct file *hugetlb_file_setup(const char *name, size_t size)
104226 {
104227 int error = -ENOMEM;
104228 struct file *file;
104229 @@ -982,8 +981,7 @@
104230
104231 error = -ENOMEM;
104232 if (hugetlb_reserve_pages(inode, 0,
104233 - size >> huge_page_shift(hstate_inode(inode)), NULL,
104234 - acctflag))
104235 + size >> huge_page_shift(hstate_inode(inode)), NULL))
104236 goto out_inode;
104237
104238 d_instantiate(dentry, inode);
104239 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/inode.c linux-2.6.29-rc3.owrt/fs/inode.c
104240 --- linux-2.6.29.owrt/fs/inode.c 2009-05-10 22:04:39.000000000 +0200
104241 +++ linux-2.6.29-rc3.owrt/fs/inode.c 2009-05-10 23:48:29.000000000 +0200
104242 @@ -359,7 +359,6 @@
104243 invalidate_inode_buffers(inode);
104244 if (!atomic_read(&inode->i_count)) {
104245 list_move(&inode->i_list, dispose);
104246 - WARN_ON(inode->i_state & I_NEW);
104247 inode->i_state |= I_FREEING;
104248 count++;
104249 continue;
104250 @@ -461,7 +460,6 @@
104251 continue;
104252 }
104253 list_move(&inode->i_list, &freeable);
104254 - WARN_ON(inode->i_state & I_NEW);
104255 inode->i_state |= I_FREEING;
104256 nr_pruned++;
104257 }
104258 @@ -658,7 +656,6 @@
104259 * just created it (so there can be no old holders
104260 * that haven't tested I_LOCK).
104261 */
104262 - WARN_ON((inode->i_state & (I_LOCK|I_NEW)) != (I_LOCK|I_NEW));
104263 inode->i_state &= ~(I_LOCK|I_NEW);
104264 wake_up_inode(inode);
104265 }
104266 @@ -1148,7 +1145,6 @@
104267
104268 list_del_init(&inode->i_list);
104269 list_del_init(&inode->i_sb_list);
104270 - WARN_ON(inode->i_state & I_NEW);
104271 inode->i_state |= I_FREEING;
104272 inodes_stat.nr_inodes--;
104273 spin_unlock(&inode_lock);
104274 @@ -1190,19 +1186,16 @@
104275 spin_unlock(&inode_lock);
104276 return;
104277 }
104278 - WARN_ON(inode->i_state & I_NEW);
104279 inode->i_state |= I_WILL_FREE;
104280 spin_unlock(&inode_lock);
104281 write_inode_now(inode, 1);
104282 spin_lock(&inode_lock);
104283 - WARN_ON(inode->i_state & I_NEW);
104284 inode->i_state &= ~I_WILL_FREE;
104285 inodes_stat.nr_unused--;
104286 hlist_del_init(&inode->i_hash);
104287 }
104288 list_del_init(&inode->i_list);
104289 list_del_init(&inode->i_sb_list);
104290 - WARN_ON(inode->i_state & I_NEW);
104291 inode->i_state |= I_FREEING;
104292 inodes_stat.nr_inodes--;
104293 spin_unlock(&inode_lock);
104294 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/internal.h linux-2.6.29-rc3.owrt/fs/internal.h
104295 --- linux-2.6.29.owrt/fs/internal.h 2009-05-10 22:04:39.000000000 +0200
104296 +++ linux-2.6.29-rc3.owrt/fs/internal.h 2009-05-10 23:48:29.000000000 +0200
104297 @@ -43,7 +43,7 @@
104298 /*
104299 * exec.c
104300 */
104301 -extern void check_unsafe_exec(struct linux_binprm *, struct files_struct *);
104302 +extern void check_unsafe_exec(struct linux_binprm *);
104303
104304 /*
104305 * namespace.c
104306 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/jbd/journal.c linux-2.6.29-rc3.owrt/fs/jbd/journal.c
104307 --- linux-2.6.29.owrt/fs/jbd/journal.c 2009-05-10 22:04:39.000000000 +0200
104308 +++ linux-2.6.29-rc3.owrt/fs/jbd/journal.c 2009-05-10 23:48:29.000000000 +0200
104309 @@ -427,7 +427,7 @@
104310 }
104311
104312 /*
104313 - * Called under j_state_lock. Returns true if a transaction commit was started.
104314 + * Called under j_state_lock. Returns true if a transaction was started.
104315 */
104316 int __log_start_commit(journal_t *journal, tid_t target)
104317 {
104318 @@ -495,8 +495,7 @@
104319
104320 /*
104321 * Start a commit of the current running transaction (if any). Returns true
104322 - * if a transaction is going to be committed (or is currently already
104323 - * committing), and fills its tid in at *ptid
104324 + * if a transaction was started, and fills its tid in at *ptid
104325 */
104326 int journal_start_commit(journal_t *journal, tid_t *ptid)
104327 {
104328 @@ -506,19 +505,15 @@
104329 if (journal->j_running_transaction) {
104330 tid_t tid = journal->j_running_transaction->t_tid;
104331
104332 - __log_start_commit(journal, tid);
104333 - /* There's a running transaction and we've just made sure
104334 - * it's commit has been scheduled. */
104335 - if (ptid)
104336 + ret = __log_start_commit(journal, tid);
104337 + if (ret && ptid)
104338 *ptid = tid;
104339 - ret = 1;
104340 - } else if (journal->j_committing_transaction) {
104341 + } else if (journal->j_committing_transaction && ptid) {
104342 /*
104343 * If ext3_write_super() recently started a commit, then we
104344 * have to wait for completion of that transaction
104345 */
104346 - if (ptid)
104347 - *ptid = journal->j_committing_transaction->t_tid;
104348 + *ptid = journal->j_committing_transaction->t_tid;
104349 ret = 1;
104350 }
104351 spin_unlock(&journal->j_state_lock);
104352 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/jbd2/journal.c linux-2.6.29-rc3.owrt/fs/jbd2/journal.c
104353 --- linux-2.6.29.owrt/fs/jbd2/journal.c 2009-05-10 22:04:39.000000000 +0200
104354 +++ linux-2.6.29-rc3.owrt/fs/jbd2/journal.c 2009-05-10 23:48:29.000000000 +0200
104355 @@ -37,10 +37,10 @@
104356 #include <linux/proc_fs.h>
104357 #include <linux/debugfs.h>
104358 #include <linux/seq_file.h>
104359 -#include <linux/math64.h>
104360
104361 #include <asm/uaccess.h>
104362 #include <asm/page.h>
104363 +#include <asm/div64.h>
104364
104365 EXPORT_SYMBOL(jbd2_journal_start);
104366 EXPORT_SYMBOL(jbd2_journal_restart);
104367 @@ -450,7 +450,7 @@
104368 }
104369
104370 /*
104371 - * Called under j_state_lock. Returns true if a transaction commit was started.
104372 + * Called under j_state_lock. Returns true if a transaction was started.
104373 */
104374 int __jbd2_log_start_commit(journal_t *journal, tid_t target)
104375 {
104376 @@ -518,8 +518,7 @@
104377
104378 /*
104379 * Start a commit of the current running transaction (if any). Returns true
104380 - * if a transaction is going to be committed (or is currently already
104381 - * committing), and fills its tid in at *ptid
104382 + * if a transaction was started, and fills its tid in at *ptid
104383 */
104384 int jbd2_journal_start_commit(journal_t *journal, tid_t *ptid)
104385 {
104386 @@ -529,19 +528,15 @@
104387 if (journal->j_running_transaction) {
104388 tid_t tid = journal->j_running_transaction->t_tid;
104389
104390 - __jbd2_log_start_commit(journal, tid);
104391 - /* There's a running transaction and we've just made sure
104392 - * it's commit has been scheduled. */
104393 - if (ptid)
104394 + ret = __jbd2_log_start_commit(journal, tid);
104395 + if (ret && ptid)
104396 *ptid = tid;
104397 - ret = 1;
104398 - } else if (journal->j_committing_transaction) {
104399 + } else if (journal->j_committing_transaction && ptid) {
104400 /*
104401 * If ext3_write_super() recently started a commit, then we
104402 * have to wait for completion of that transaction
104403 */
104404 - if (ptid)
104405 - *ptid = journal->j_committing_transaction->t_tid;
104406 + *ptid = journal->j_committing_transaction->t_tid;
104407 ret = 1;
104408 }
104409 spin_unlock(&journal->j_state_lock);
104410 @@ -851,8 +846,8 @@
104411 jiffies_to_msecs(s->stats->u.run.rs_flushing / s->stats->ts_tid));
104412 seq_printf(seq, " %ums logging transaction\n",
104413 jiffies_to_msecs(s->stats->u.run.rs_logging / s->stats->ts_tid));
104414 - seq_printf(seq, " %lluus average transaction commit time\n",
104415 - div_u64(s->journal->j_average_commit_time, 1000));
104416 + seq_printf(seq, " %luus average transaction commit time\n",
104417 + do_div(s->journal->j_average_commit_time, 1000));
104418 seq_printf(seq, " %lu handles per transaction\n",
104419 s->stats->u.run.rs_handle_count / s->stats->ts_tid);
104420 seq_printf(seq, " %lu blocks per transaction\n",
104421 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/jbd2/transaction.c linux-2.6.29-rc3.owrt/fs/jbd2/transaction.c
104422 --- linux-2.6.29.owrt/fs/jbd2/transaction.c 2009-05-10 22:04:39.000000000 +0200
104423 +++ linux-2.6.29-rc3.owrt/fs/jbd2/transaction.c 2009-05-10 23:48:29.000000000 +0200
104424 @@ -2129,46 +2129,26 @@
104425 }
104426
104427 /*
104428 - * File truncate and transaction commit interact with each other in a
104429 - * non-trivial way. If a transaction writing data block A is
104430 - * committing, we cannot discard the data by truncate until we have
104431 - * written them. Otherwise if we crashed after the transaction with
104432 - * write has committed but before the transaction with truncate has
104433 - * committed, we could see stale data in block A. This function is a
104434 - * helper to solve this problem. It starts writeout of the truncated
104435 - * part in case it is in the committing transaction.
104436 - *
104437 - * Filesystem code must call this function when inode is journaled in
104438 - * ordered mode before truncation happens and after the inode has been
104439 - * placed on orphan list with the new inode size. The second condition
104440 - * avoids the race that someone writes new data and we start
104441 - * committing the transaction after this function has been called but
104442 - * before a transaction for truncate is started (and furthermore it
104443 - * allows us to optimize the case where the addition to orphan list
104444 - * happens in the same transaction as write --- we don't have to write
104445 - * any data in such case).
104446 + * This function must be called when inode is journaled in ordered mode
104447 + * before truncation happens. It starts writeout of truncated part in
104448 + * case it is in the committing transaction so that we stand to ordered
104449 + * mode consistency guarantees.
104450 */
104451 -int jbd2_journal_begin_ordered_truncate(journal_t *journal,
104452 - struct jbd2_inode *jinode,
104453 +int jbd2_journal_begin_ordered_truncate(struct jbd2_inode *inode,
104454 loff_t new_size)
104455 {
104456 - transaction_t *inode_trans, *commit_trans;
104457 + journal_t *journal;
104458 + transaction_t *commit_trans;
104459 int ret = 0;
104460
104461 - /* This is a quick check to avoid locking if not necessary */
104462 - if (!jinode->i_transaction)
104463 + if (!inode->i_transaction && !inode->i_next_transaction)
104464 goto out;
104465 - /* Locks are here just to force reading of recent values, it is
104466 - * enough that the transaction was not committing before we started
104467 - * a transaction adding the inode to orphan list */
104468 + journal = inode->i_transaction->t_journal;
104469 spin_lock(&journal->j_state_lock);
104470 commit_trans = journal->j_committing_transaction;
104471 spin_unlock(&journal->j_state_lock);
104472 - spin_lock(&journal->j_list_lock);
104473 - inode_trans = jinode->i_transaction;
104474 - spin_unlock(&journal->j_list_lock);
104475 - if (inode_trans == commit_trans) {
104476 - ret = filemap_fdatawrite_range(jinode->i_vfs_inode->i_mapping,
104477 + if (inode->i_transaction == commit_trans) {
104478 + ret = filemap_fdatawrite_range(inode->i_vfs_inode->i_mapping,
104479 new_size, LLONG_MAX);
104480 if (ret)
104481 jbd2_journal_abort(journal, ret);
104482 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/jffs2/background.c linux-2.6.29-rc3.owrt/fs/jffs2/background.c
104483 --- linux-2.6.29.owrt/fs/jffs2/background.c 2009-05-10 22:04:39.000000000 +0200
104484 +++ linux-2.6.29-rc3.owrt/fs/jffs2/background.c 2009-05-10 23:48:29.000000000 +0200
104485 @@ -95,17 +95,13 @@
104486 spin_unlock(&c->erase_completion_lock);
104487
104488
104489 - /* Problem - immediately after bootup, the GCD spends a lot
104490 - * of time in places like jffs2_kill_fragtree(); so much so
104491 - * that userspace processes (like gdm and X) are starved
104492 - * despite plenty of cond_resched()s and renicing. Yield()
104493 - * doesn't help, either (presumably because userspace and GCD
104494 - * are generally competing for a higher latency resource -
104495 - * disk).
104496 - * This forces the GCD to slow the hell down. Pulling an
104497 - * inode in with read_inode() is much preferable to having
104498 - * the GC thread get there first. */
104499 - schedule_timeout_interruptible(msecs_to_jiffies(50));
104500 + /* This thread is purely an optimisation. But if it runs when
104501 + other things could be running, it actually makes things a
104502 + lot worse. Use yield() and put it at the back of the runqueue
104503 + every time. Especially during boot, pulling an inode in
104504 + with read_inode() is much preferable to having the GC thread
104505 + get there first. */
104506 + yield();
104507
104508 /* Put_super will send a SIGKILL and then wait on the sem.
104509 */
104510 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/jffs2/readinode.c linux-2.6.29-rc3.owrt/fs/jffs2/readinode.c
104511 --- linux-2.6.29.owrt/fs/jffs2/readinode.c 2009-05-10 22:04:39.000000000 +0200
104512 +++ linux-2.6.29-rc3.owrt/fs/jffs2/readinode.c 2009-05-10 23:48:29.000000000 +0200
104513 @@ -220,7 +220,7 @@
104514 struct jffs2_tmp_dnode_info *tn)
104515 {
104516 uint32_t fn_end = tn->fn->ofs + tn->fn->size;
104517 - struct jffs2_tmp_dnode_info *this, *ptn;
104518 + struct jffs2_tmp_dnode_info *this;
104519
104520 dbg_readinode("insert fragment %#04x-%#04x, ver %u at %08x\n", tn->fn->ofs, fn_end, tn->version, ref_offset(tn->fn->raw));
104521
104522 @@ -251,18 +251,11 @@
104523 if (this) {
104524 /* If the node is coincident with another at a lower address,
104525 back up until the other node is found. It may be relevant */
104526 - while (this->overlapped) {
104527 - ptn = tn_prev(this);
104528 - if (!ptn) {
104529 - /*
104530 - * We killed a node which set the overlapped
104531 - * flags during the scan. Fix it up.
104532 - */
104533 - this->overlapped = 0;
104534 - break;
104535 - }
104536 - this = ptn;
104537 - }
104538 + while (this->overlapped)
104539 + this = tn_prev(this);
104540 +
104541 + /* First node should never be marked overlapped */
104542 + BUG_ON(!this);
104543 dbg_readinode("'this' found %#04x-%#04x (%s)\n", this->fn->ofs, this->fn->ofs + this->fn->size, this->fn ? "data" : "hole");
104544 }
104545
104546 @@ -367,17 +360,7 @@
104547 }
104548 if (!this->overlapped)
104549 break;
104550 -
104551 - ptn = tn_prev(this);
104552 - if (!ptn) {
104553 - /*
104554 - * We killed a node which set the overlapped
104555 - * flags during the scan. Fix it up.
104556 - */
104557 - this->overlapped = 0;
104558 - break;
104559 - }
104560 - this = ptn;
104561 + this = tn_prev(this);
104562 }
104563 }
104564
104565 @@ -473,15 +456,8 @@
104566 eat_last(&rii->tn_root, &last->rb);
104567 ver_insert(&ver_root, last);
104568
104569 - if (unlikely(last->overlapped)) {
104570 - if (pen)
104571 - continue;
104572 - /*
104573 - * We killed a node which set the overlapped
104574 - * flags during the scan. Fix it up.
104575 - */
104576 - last->overlapped = 0;
104577 - }
104578 + if (unlikely(last->overlapped))
104579 + continue;
104580
104581 /* Now we have a bunch of nodes in reverse version
104582 order, in the tree at ver_root. Most of the time,
104583 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/lockd/clntlock.c linux-2.6.29-rc3.owrt/fs/lockd/clntlock.c
104584 --- linux-2.6.29.owrt/fs/lockd/clntlock.c 2009-05-10 22:04:39.000000000 +0200
104585 +++ linux-2.6.29-rc3.owrt/fs/lockd/clntlock.c 2009-05-10 23:48:29.000000000 +0200
104586 @@ -139,55 +139,6 @@
104587 return 0;
104588 }
104589
104590 -#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
104591 -static const struct in6_addr *nlmclnt_map_v4addr(const struct sockaddr *sap,
104592 - struct in6_addr *addr_mapped)
104593 -{
104594 - const struct sockaddr_in *sin = (const struct sockaddr_in *)sap;
104595 -
104596 - switch (sap->sa_family) {
104597 - case AF_INET6:
104598 - return &((const struct sockaddr_in6 *)sap)->sin6_addr;
104599 - case AF_INET:
104600 - ipv6_addr_set_v4mapped(sin->sin_addr.s_addr, addr_mapped);
104601 - return addr_mapped;
104602 - }
104603 -
104604 - return NULL;
104605 -}
104606 -
104607 -/*
104608 - * If lockd is using a PF_INET6 listener, all incoming requests appear
104609 - * to come from AF_INET6 remotes. The address of AF_INET remotes are
104610 - * mapped to AF_INET6 automatically by the network layer. In case the
104611 - * user passed an AF_INET server address at mount time, ensure both
104612 - * addresses are AF_INET6 before comparing them.
104613 - */
104614 -static int nlmclnt_cmp_addr(const struct nlm_host *host,
104615 - const struct sockaddr *sap)
104616 -{
104617 - const struct in6_addr *addr1;
104618 - const struct in6_addr *addr2;
104619 - struct in6_addr addr1_mapped;
104620 - struct in6_addr addr2_mapped;
104621 -
104622 - addr1 = nlmclnt_map_v4addr(nlm_addr(host), &addr1_mapped);
104623 - if (likely(addr1 != NULL)) {
104624 - addr2 = nlmclnt_map_v4addr(sap, &addr2_mapped);
104625 - if (likely(addr2 != NULL))
104626 - return ipv6_addr_equal(addr1, addr2);
104627 - }
104628 -
104629 - return 0;
104630 -}
104631 -#else /* !(CONFIG_IPV6 || CONFIG_IPV6_MODULE) */
104632 -static int nlmclnt_cmp_addr(const struct nlm_host *host,
104633 - const struct sockaddr *sap)
104634 -{
104635 - return nlm_cmp_addr(nlm_addr(host), sap);
104636 -}
104637 -#endif /* !(CONFIG_IPV6 || CONFIG_IPV6_MODULE) */
104638 -
104639 /*
104640 * The server lockd has called us back to tell us the lock was granted
104641 */
104642 @@ -215,7 +166,7 @@
104643 */
104644 if (fl_blocked->fl_u.nfs_fl.owner->pid != lock->svid)
104645 continue;
104646 - if (!nlmclnt_cmp_addr(block->b_host, addr))
104647 + if (!nlm_cmp_addr(nlm_addr(block->b_host), addr))
104648 continue;
104649 if (nfs_compare_fh(NFS_FH(fl_blocked->fl_file->f_path.dentry->d_inode) ,fh) != 0)
104650 continue;
104651 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/lockd/svclock.c linux-2.6.29-rc3.owrt/fs/lockd/svclock.c
104652 --- linux-2.6.29.owrt/fs/lockd/svclock.c 2009-05-10 22:04:39.000000000 +0200
104653 +++ linux-2.6.29-rc3.owrt/fs/lockd/svclock.c 2009-05-10 23:48:29.000000000 +0200
104654 @@ -427,7 +427,7 @@
104655 goto out;
104656 case -EAGAIN:
104657 ret = nlm_lck_denied;
104658 - break;
104659 + goto out;
104660 case FILE_LOCK_DEFERRED:
104661 if (wait)
104662 break;
104663 @@ -443,10 +443,6 @@
104664 goto out;
104665 }
104666
104667 - ret = nlm_lck_denied;
104668 - if (!wait)
104669 - goto out;
104670 -
104671 ret = nlm_lck_blocked;
104672
104673 /* Append to list of blocked */
104674 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/Makefile linux-2.6.29-rc3.owrt/fs/Makefile
104675 --- linux-2.6.29.owrt/fs/Makefile 2009-05-10 22:04:39.000000000 +0200
104676 +++ linux-2.6.29-rc3.owrt/fs/Makefile 2009-05-10 23:48:29.000000000 +0200
104677 @@ -69,12 +69,10 @@
104678 # Do not add any filesystems before this line
104679 obj-$(CONFIG_REISERFS_FS) += reiserfs/
104680 obj-$(CONFIG_EXT3_FS) += ext3/ # Before ext2 so root fs can be ext3
104681 -obj-$(CONFIG_EXT2_FS) += ext2/
104682 -# We place ext4 after ext2 so plain ext2 root fs's are mounted using ext2
104683 -# unless explicitly requested by rootfstype
104684 -obj-$(CONFIG_EXT4_FS) += ext4/
104685 +obj-$(CONFIG_EXT4_FS) += ext4/ # Before ext2 so root fs can be ext4
104686 obj-$(CONFIG_JBD) += jbd/
104687 obj-$(CONFIG_JBD2) += jbd2/
104688 +obj-$(CONFIG_EXT2_FS) += ext2/
104689 obj-$(CONFIG_CRAMFS) += cramfs/
104690 obj-$(CONFIG_SQUASHFS) += squashfs/
104691 obj-y += ramfs/
104692 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/minix/inode.c linux-2.6.29-rc3.owrt/fs/minix/inode.c
104693 --- linux-2.6.29.owrt/fs/minix/inode.c 2009-05-10 22:04:39.000000000 +0200
104694 +++ linux-2.6.29-rc3.owrt/fs/minix/inode.c 2009-05-10 23:48:29.000000000 +0200
104695 @@ -3,7 +3,7 @@
104696 *
104697 * Copyright (C) 1991, 1992 Linus Torvalds
104698 *
104699 - * Copyright (C) 1996 Gertjan van Wingerde
104700 + * Copyright (C) 1996 Gertjan van Wingerde (gertjan@cs.vu.nl)
104701 * Minix V2 fs support.
104702 *
104703 * Modified for 680x0 by Andreas Schwab
104704 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/namespace.c linux-2.6.29-rc3.owrt/fs/namespace.c
104705 --- linux-2.6.29.owrt/fs/namespace.c 2009-05-10 22:04:39.000000000 +0200
104706 +++ linux-2.6.29-rc3.owrt/fs/namespace.c 2009-05-10 23:48:29.000000000 +0200
104707 @@ -614,11 +614,9 @@
104708 */
104709 for_each_possible_cpu(cpu) {
104710 struct mnt_writer *cpu_writer = &per_cpu(mnt_writers, cpu);
104711 - spin_lock(&cpu_writer->lock);
104712 - if (cpu_writer->mnt != mnt) {
104713 - spin_unlock(&cpu_writer->lock);
104714 + if (cpu_writer->mnt != mnt)
104715 continue;
104716 - }
104717 + spin_lock(&cpu_writer->lock);
104718 atomic_add(cpu_writer->count, &mnt->__mnt_writers);
104719 cpu_writer->count = 0;
104720 /*
104721 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/nfs/client.c linux-2.6.29-rc3.owrt/fs/nfs/client.c
104722 --- linux-2.6.29.owrt/fs/nfs/client.c 2009-05-10 22:04:39.000000000 +0200
104723 +++ linux-2.6.29-rc3.owrt/fs/nfs/client.c 2009-05-10 23:48:29.000000000 +0200
104724 @@ -255,32 +255,6 @@
104725 }
104726 return 0;
104727 }
104728 -
104729 -/*
104730 - * Test if two ip6 socket addresses refer to the same socket by
104731 - * comparing relevant fields. The padding bytes specifically, are not
104732 - * compared. sin6_flowinfo is not compared because it only affects QoS
104733 - * and sin6_scope_id is only compared if the address is "link local"
104734 - * because "link local" addresses need only be unique to a specific
104735 - * link. Conversely, ordinary unicast addresses might have different
104736 - * sin6_scope_id.
104737 - *
104738 - * The caller should ensure both socket addresses are AF_INET6.
104739 - */
104740 -static int nfs_sockaddr_cmp_ip6(const struct sockaddr *sa1,
104741 - const struct sockaddr *sa2)
104742 -{
104743 - const struct sockaddr_in6 *saddr1 = (const struct sockaddr_in6 *)sa1;
104744 - const struct sockaddr_in6 *saddr2 = (const struct sockaddr_in6 *)sa2;
104745 -
104746 - if (!ipv6_addr_equal(&saddr1->sin6_addr,
104747 - &saddr1->sin6_addr))
104748 - return 0;
104749 - if (ipv6_addr_scope(&saddr1->sin6_addr) == IPV6_ADDR_SCOPE_LINKLOCAL &&
104750 - saddr1->sin6_scope_id != saddr2->sin6_scope_id)
104751 - return 0;
104752 - return saddr1->sin6_port == saddr2->sin6_port;
104753 -}
104754 #else
104755 static int nfs_sockaddr_match_ipaddr4(const struct sockaddr_in *sa1,
104756 const struct sockaddr_in *sa2)
104757 @@ -296,52 +270,9 @@
104758 return nfs_sockaddr_match_ipaddr4((const struct sockaddr_in *)sa1,
104759 (const struct sockaddr_in *)sa2);
104760 }
104761 -
104762 -static int nfs_sockaddr_cmp_ip6(const struct sockaddr * sa1,
104763 - const struct sockaddr * sa2)
104764 -{
104765 - return 0;
104766 -}
104767 #endif
104768
104769 /*
104770 - * Test if two ip4 socket addresses refer to the same socket, by
104771 - * comparing relevant fields. The padding bytes specifically, are
104772 - * not compared.
104773 - *
104774 - * The caller should ensure both socket addresses are AF_INET.
104775 - */
104776 -static int nfs_sockaddr_cmp_ip4(const struct sockaddr *sa1,
104777 - const struct sockaddr *sa2)
104778 -{
104779 - const struct sockaddr_in *saddr1 = (const struct sockaddr_in *)sa1;
104780 - const struct sockaddr_in *saddr2 = (const struct sockaddr_in *)sa2;
104781 -
104782 - if (saddr1->sin_addr.s_addr != saddr2->sin_addr.s_addr)
104783 - return 0;
104784 - return saddr1->sin_port == saddr2->sin_port;
104785 -}
104786 -
104787 -/*
104788 - * Test if two socket addresses represent the same actual socket,
104789 - * by comparing (only) relevant fields.
104790 - */
104791 -static int nfs_sockaddr_cmp(const struct sockaddr *sa1,
104792 - const struct sockaddr *sa2)
104793 -{
104794 - if (sa1->sa_family != sa2->sa_family)
104795 - return 0;
104796 -
104797 - switch (sa1->sa_family) {
104798 - case AF_INET:
104799 - return nfs_sockaddr_cmp_ip4(sa1, sa2);
104800 - case AF_INET6:
104801 - return nfs_sockaddr_cmp_ip6(sa1, sa2);
104802 - }
104803 - return 0;
104804 -}
104805 -
104806 -/*
104807 * Find a client by IP address and protocol version
104808 * - returns NULL if no such client
104809 */
104810 @@ -413,10 +344,8 @@
104811 static struct nfs_client *nfs_match_client(const struct nfs_client_initdata *data)
104812 {
104813 struct nfs_client *clp;
104814 - const struct sockaddr *sap = data->addr;
104815
104816 list_for_each_entry(clp, &nfs_client_list, cl_share_link) {
104817 - const struct sockaddr *clap = (struct sockaddr *)&clp->cl_addr;
104818 /* Don't match clients that failed to initialise properly */
104819 if (clp->cl_cons_state < 0)
104820 continue;
104821 @@ -429,7 +358,7 @@
104822 continue;
104823
104824 /* Match the full socket address */
104825 - if (!nfs_sockaddr_cmp(sap, clap))
104826 + if (memcmp(&clp->cl_addr, data->addr, sizeof(clp->cl_addr)) != 0)
104827 continue;
104828
104829 atomic_inc(&clp->cl_count);
104830 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/nfs/dir.c linux-2.6.29-rc3.owrt/fs/nfs/dir.c
104831 --- linux-2.6.29.owrt/fs/nfs/dir.c 2009-05-10 22:04:39.000000000 +0200
104832 +++ linux-2.6.29-rc3.owrt/fs/nfs/dir.c 2009-05-10 23:48:29.000000000 +0200
104833 @@ -1892,14 +1892,8 @@
104834 cache.cred = cred;
104835 cache.jiffies = jiffies;
104836 status = NFS_PROTO(inode)->access(inode, &cache);
104837 - if (status != 0) {
104838 - if (status == -ESTALE) {
104839 - nfs_zap_caches(inode);
104840 - if (!S_ISDIR(inode->i_mode))
104841 - set_bit(NFS_INO_STALE, &NFS_I(inode)->flags);
104842 - }
104843 + if (status != 0)
104844 return status;
104845 - }
104846 nfs_access_add_cache(inode, &cache);
104847 out:
104848 if ((mask & ~cache.mask & (MAY_READ | MAY_WRITE | MAY_EXEC)) == 0)
104849 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/nfs/nfs3acl.c linux-2.6.29-rc3.owrt/fs/nfs/nfs3acl.c
104850 --- linux-2.6.29.owrt/fs/nfs/nfs3acl.c 2009-05-10 22:04:39.000000000 +0200
104851 +++ linux-2.6.29-rc3.owrt/fs/nfs/nfs3acl.c 2009-05-10 23:48:29.000000000 +0200
104852 @@ -292,7 +292,7 @@
104853 {
104854 struct nfs_server *server = NFS_SERVER(inode);
104855 struct nfs_fattr fattr;
104856 - struct page *pages[NFSACL_MAXPAGES];
104857 + struct page *pages[NFSACL_MAXPAGES] = { };
104858 struct nfs3_setaclargs args = {
104859 .inode = inode,
104860 .mask = NFS_ACL,
104861 @@ -303,7 +303,7 @@
104862 .rpc_argp = &args,
104863 .rpc_resp = &fattr,
104864 };
104865 - int status;
104866 + int status, count;
104867
104868 status = -EOPNOTSUPP;
104869 if (!nfs_server_capable(inode, NFS_CAP_ACLS))
104870 @@ -319,20 +319,6 @@
104871 if (S_ISDIR(inode->i_mode)) {
104872 args.mask |= NFS_DFACL;
104873 args.acl_default = dfacl;
104874 - args.len = nfsacl_size(acl, dfacl);
104875 - } else
104876 - args.len = nfsacl_size(acl, NULL);
104877 -
104878 - if (args.len > NFS_ACL_INLINE_BUFSIZE) {
104879 - unsigned int npages = 1 + ((args.len - 1) >> PAGE_SHIFT);
104880 -
104881 - status = -ENOMEM;
104882 - do {
104883 - args.pages[args.npages] = alloc_page(GFP_KERNEL);
104884 - if (args.pages[args.npages] == NULL)
104885 - goto out_freepages;
104886 - args.npages++;
104887 - } while (args.npages < npages);
104888 }
104889
104890 dprintk("NFS call setacl\n");
104891 @@ -343,6 +329,10 @@
104892 nfs_zap_acl_cache(inode);
104893 dprintk("NFS reply setacl: %d\n", status);
104894
104895 + /* pages may have been allocated at the xdr layer. */
104896 + for (count = 0; count < NFSACL_MAXPAGES && args.pages[count]; count++)
104897 + __free_page(args.pages[count]);
104898 +
104899 switch (status) {
104900 case 0:
104901 status = nfs_refresh_inode(inode, &fattr);
104902 @@ -356,11 +346,6 @@
104903 case -ENOTSUPP:
104904 status = -EOPNOTSUPP;
104905 }
104906 -out_freepages:
104907 - while (args.npages != 0) {
104908 - args.npages--;
104909 - __free_page(args.pages[args.npages]);
104910 - }
104911 out:
104912 return status;
104913 }
104914 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/nfs/nfs3xdr.c linux-2.6.29-rc3.owrt/fs/nfs/nfs3xdr.c
104915 --- linux-2.6.29.owrt/fs/nfs/nfs3xdr.c 2009-05-10 22:04:39.000000000 +0200
104916 +++ linux-2.6.29-rc3.owrt/fs/nfs/nfs3xdr.c 2009-05-10 23:48:29.000000000 +0200
104917 @@ -82,10 +82,8 @@
104918 #define NFS3_commitres_sz (1+NFS3_wcc_data_sz+2)
104919
104920 #define ACL3_getaclargs_sz (NFS3_fh_sz+1)
104921 -#define ACL3_setaclargs_sz (NFS3_fh_sz+1+ \
104922 - XDR_QUADLEN(NFS_ACL_INLINE_BUFSIZE))
104923 -#define ACL3_getaclres_sz (1+NFS3_post_op_attr_sz+1+ \
104924 - XDR_QUADLEN(NFS_ACL_INLINE_BUFSIZE))
104925 +#define ACL3_setaclargs_sz (NFS3_fh_sz+1+2*(2+5*3))
104926 +#define ACL3_getaclres_sz (1+NFS3_post_op_attr_sz+1+2*(2+5*3))
104927 #define ACL3_setaclres_sz (1+NFS3_post_op_attr_sz)
104928
104929 /*
104930 @@ -705,18 +703,28 @@
104931 struct nfs3_setaclargs *args)
104932 {
104933 struct xdr_buf *buf = &req->rq_snd_buf;
104934 - unsigned int base;
104935 - int err;
104936 + unsigned int base, len_in_head, len = nfsacl_size(
104937 + (args->mask & NFS_ACL) ? args->acl_access : NULL,
104938 + (args->mask & NFS_DFACL) ? args->acl_default : NULL);
104939 + int count, err;
104940
104941 p = xdr_encode_fhandle(p, NFS_FH(args->inode));
104942 *p++ = htonl(args->mask);
104943 - req->rq_slen = xdr_adjust_iovec(req->rq_svec, p);
104944 - base = req->rq_slen;
104945 -
104946 - if (args->npages != 0)
104947 - xdr_encode_pages(buf, args->pages, 0, args->len);
104948 - else
104949 - req->rq_slen += args->len;
104950 + base = (char *)p - (char *)buf->head->iov_base;
104951 + /* put as much of the acls into head as possible. */
104952 + len_in_head = min_t(unsigned int, buf->head->iov_len - base, len);
104953 + len -= len_in_head;
104954 + req->rq_slen = xdr_adjust_iovec(req->rq_svec, p + (len_in_head >> 2));
104955 +
104956 + for (count = 0; (count << PAGE_SHIFT) < len; count++) {
104957 + args->pages[count] = alloc_page(GFP_KERNEL);
104958 + if (!args->pages[count]) {
104959 + while (count)
104960 + __free_page(args->pages[--count]);
104961 + return -ENOMEM;
104962 + }
104963 + }
104964 + xdr_encode_pages(buf, args->pages, 0, len);
104965
104966 err = nfsacl_encode(buf, base, args->inode,
104967 (args->mask & NFS_ACL) ?
104968 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/nfs/nfs4namespace.c linux-2.6.29-rc3.owrt/fs/nfs/nfs4namespace.c
104969 --- linux-2.6.29.owrt/fs/nfs/nfs4namespace.c 2009-05-10 22:04:39.000000000 +0200
104970 +++ linux-2.6.29-rc3.owrt/fs/nfs/nfs4namespace.c 2009-05-10 23:48:29.000000000 +0200
104971 @@ -21,9 +21,7 @@
104972 #define NFSDBG_FACILITY NFSDBG_VFS
104973
104974 /*
104975 - * Convert the NFSv4 pathname components into a standard posix path.
104976 - *
104977 - * Note that the resulting string will be placed at the end of the buffer
104978 + * Check if fs_root is valid
104979 */
104980 static inline char *nfs4_pathname_string(const struct nfs4_pathname *pathname,
104981 char *buffer, ssize_t buflen)
104982 @@ -101,20 +99,21 @@
104983 {
104984 struct vfsmount *mnt = ERR_PTR(-ENOENT);
104985 char *mnt_path;
104986 - unsigned int maxbuflen;
104987 + int page2len;
104988 unsigned int s;
104989
104990 mnt_path = nfs4_pathname_string(&location->rootpath, page2, PAGE_SIZE);
104991 if (IS_ERR(mnt_path))
104992 return mnt;
104993 mountdata->mnt_path = mnt_path;
104994 - maxbuflen = mnt_path - 1 - page2;
104995 + page2 += strlen(mnt_path) + 1;
104996 + page2len = PAGE_SIZE - strlen(mnt_path) - 1;
104997
104998 for (s = 0; s < location->nservers; s++) {
104999 const struct nfs4_string *buf = &location->servers[s];
105000 struct sockaddr_storage addr;
105001
105002 - if (buf->len <= 0 || buf->len >= maxbuflen)
105003 + if (buf->len <= 0 || buf->len >= PAGE_SIZE)
105004 continue;
105005
105006 mountdata->addr = (struct sockaddr *)&addr;
105007 @@ -127,8 +126,8 @@
105008 continue;
105009 nfs_set_port(mountdata->addr, NFS_PORT);
105010
105011 - memcpy(page2, buf->data, buf->len);
105012 - page2[buf->len] = '\0';
105013 + strncpy(page2, buf->data, page2len);
105014 + page2[page2len] = '\0';
105015 mountdata->hostname = page2;
105016
105017 snprintf(page, PAGE_SIZE, "%s:%s",
105018 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/nfsd/nfs4xdr.c linux-2.6.29-rc3.owrt/fs/nfsd/nfs4xdr.c
105019 --- linux-2.6.29.owrt/fs/nfsd/nfs4xdr.c 2009-05-10 22:04:39.000000000 +0200
105020 +++ linux-2.6.29-rc3.owrt/fs/nfsd/nfs4xdr.c 2009-05-10 23:48:29.000000000 +0200
105021 @@ -2596,7 +2596,6 @@
105022 [OP_LOOKUPP] = (nfsd4_enc)nfsd4_encode_noop,
105023 [OP_NVERIFY] = (nfsd4_enc)nfsd4_encode_noop,
105024 [OP_OPEN] = (nfsd4_enc)nfsd4_encode_open,
105025 - [OP_OPENATTR] = (nfsd4_enc)nfsd4_encode_noop,
105026 [OP_OPEN_CONFIRM] = (nfsd4_enc)nfsd4_encode_open_confirm,
105027 [OP_OPEN_DOWNGRADE] = (nfsd4_enc)nfsd4_encode_open_downgrade,
105028 [OP_PUTFH] = (nfsd4_enc)nfsd4_encode_noop,
105029 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/notify/inotify/inotify.c linux-2.6.29-rc3.owrt/fs/notify/inotify/inotify.c
105030 --- linux-2.6.29.owrt/fs/notify/inotify/inotify.c 2009-05-10 22:04:39.000000000 +0200
105031 +++ linux-2.6.29-rc3.owrt/fs/notify/inotify/inotify.c 2009-05-10 23:48:29.000000000 +0200
105032 @@ -156,7 +156,7 @@
105033 int ret;
105034
105035 do {
105036 - if (unlikely(!idr_pre_get(&ih->idr, GFP_NOFS)))
105037 + if (unlikely(!idr_pre_get(&ih->idr, GFP_KERNEL)))
105038 return -ENOSPC;
105039 ret = idr_get_new_above(&ih->idr, watch, ih->last_wd+1, &watch->wd);
105040 } while (ret == -EAGAIN);
105041 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ocfs2/alloc.c linux-2.6.29-rc3.owrt/fs/ocfs2/alloc.c
105042 --- linux-2.6.29.owrt/fs/ocfs2/alloc.c 2009-05-10 22:04:39.000000000 +0200
105043 +++ linux-2.6.29-rc3.owrt/fs/ocfs2/alloc.c 2009-05-10 23:48:29.000000000 +0200
105044 @@ -176,8 +176,7 @@
105045
105046 BUG_ON(OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL);
105047 mlog_bug_on_msg(!ocfs2_sparse_alloc(osb) &&
105048 - (OCFS2_I(inode)->ip_clusters !=
105049 - le32_to_cpu(rec->e_cpos)),
105050 + (OCFS2_I(inode)->ip_clusters != rec->e_cpos),
105051 "Device %s, asking for sparse allocation: inode %llu, "
105052 "cpos %u, clusters %u\n",
105053 osb->dev_str,
105054 @@ -4797,29 +4796,6 @@
105055 return ret;
105056 }
105057
105058 -static int ocfs2_replace_extent_rec(struct inode *inode,
105059 - handle_t *handle,
105060 - struct ocfs2_path *path,
105061 - struct ocfs2_extent_list *el,
105062 - int split_index,
105063 - struct ocfs2_extent_rec *split_rec)
105064 -{
105065 - int ret;
105066 -
105067 - ret = ocfs2_path_bh_journal_access(handle, inode, path,
105068 - path_num_items(path) - 1);
105069 - if (ret) {
105070 - mlog_errno(ret);
105071 - goto out;
105072 - }
105073 -
105074 - el->l_recs[split_index] = *split_rec;
105075 -
105076 - ocfs2_journal_dirty(handle, path_leaf_bh(path));
105077 -out:
105078 - return ret;
105079 -}
105080 -
105081 /*
105082 * Mark part or all of the extent record at split_index in the leaf
105083 * pointed to by path as written. This removes the unwritten
105084 @@ -4909,9 +4885,7 @@
105085
105086 if (ctxt.c_contig_type == CONTIG_NONE) {
105087 if (ctxt.c_split_covers_rec)
105088 - ret = ocfs2_replace_extent_rec(inode, handle,
105089 - path, el,
105090 - split_index, split_rec);
105091 + el->l_recs[split_index] = *split_rec;
105092 else
105093 ret = ocfs2_split_and_insert(inode, handle, path, et,
105094 &last_eb_bh, split_index,
105095 @@ -5416,9 +5390,6 @@
105096 goto out;
105097 }
105098
105099 - vfs_dq_free_space_nodirty(inode,
105100 - ocfs2_clusters_to_bytes(inode->i_sb, len));
105101 -
105102 ret = ocfs2_remove_extent(inode, et, cpos, len, handle, meta_ac,
105103 dealloc);
105104 if (ret) {
105105 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ocfs2/aops.c linux-2.6.29-rc3.owrt/fs/ocfs2/aops.c
105106 --- linux-2.6.29.owrt/fs/ocfs2/aops.c 2009-05-10 22:04:39.000000000 +0200
105107 +++ linux-2.6.29-rc3.owrt/fs/ocfs2/aops.c 2009-05-10 23:48:29.000000000 +0200
105108 @@ -227,7 +227,7 @@
105109 size = i_size_read(inode);
105110
105111 if (size > PAGE_CACHE_SIZE ||
105112 - size > ocfs2_max_inline_data_with_xattr(inode->i_sb, di)) {
105113 + size > ocfs2_max_inline_data(inode->i_sb)) {
105114 ocfs2_error(inode->i_sb,
105115 "Inode %llu has with inline data has bad size: %Lu",
105116 (unsigned long long)OCFS2_I(inode)->ip_blkno,
105117 @@ -1555,7 +1555,6 @@
105118 int ret, written = 0;
105119 loff_t end = pos + len;
105120 struct ocfs2_inode_info *oi = OCFS2_I(inode);
105121 - struct ocfs2_dinode *di = NULL;
105122
105123 mlog(0, "Inode %llu, write of %u bytes at off %llu. features: 0x%x\n",
105124 (unsigned long long)oi->ip_blkno, len, (unsigned long long)pos,
105125 @@ -1588,9 +1587,7 @@
105126 /*
105127 * Check whether the write can fit.
105128 */
105129 - di = (struct ocfs2_dinode *)wc->w_di_bh->b_data;
105130 - if (mmap_page ||
105131 - end > ocfs2_max_inline_data_with_xattr(inode->i_sb, di))
105132 + if (mmap_page || end > ocfs2_max_inline_data(inode->i_sb))
105133 return 0;
105134
105135 do_inline_write:
105136 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ocfs2/dcache.c linux-2.6.29-rc3.owrt/fs/ocfs2/dcache.c
105137 --- linux-2.6.29.owrt/fs/ocfs2/dcache.c 2009-05-10 22:04:39.000000000 +0200
105138 +++ linux-2.6.29-rc3.owrt/fs/ocfs2/dcache.c 2009-05-10 23:48:29.000000000 +0200
105139 @@ -38,7 +38,6 @@
105140 #include "dlmglue.h"
105141 #include "file.h"
105142 #include "inode.h"
105143 -#include "super.h"
105144
105145
105146 static int ocfs2_dentry_revalidate(struct dentry *dentry,
105147 @@ -295,34 +294,6 @@
105148 return ret;
105149 }
105150
105151 -static DEFINE_SPINLOCK(dentry_list_lock);
105152 -
105153 -/* We limit the number of dentry locks to drop in one go. We have
105154 - * this limit so that we don't starve other users of ocfs2_wq. */
105155 -#define DL_INODE_DROP_COUNT 64
105156 -
105157 -/* Drop inode references from dentry locks */
105158 -void ocfs2_drop_dl_inodes(struct work_struct *work)
105159 -{
105160 - struct ocfs2_super *osb = container_of(work, struct ocfs2_super,
105161 - dentry_lock_work);
105162 - struct ocfs2_dentry_lock *dl;
105163 - int drop_count = DL_INODE_DROP_COUNT;
105164 -
105165 - spin_lock(&dentry_list_lock);
105166 - while (osb->dentry_lock_list && drop_count--) {
105167 - dl = osb->dentry_lock_list;
105168 - osb->dentry_lock_list = dl->dl_next;
105169 - spin_unlock(&dentry_list_lock);
105170 - iput(dl->dl_inode);
105171 - kfree(dl);
105172 - spin_lock(&dentry_list_lock);
105173 - }
105174 - if (osb->dentry_lock_list)
105175 - queue_work(ocfs2_wq, &osb->dentry_lock_work);
105176 - spin_unlock(&dentry_list_lock);
105177 -}
105178 -
105179 /*
105180 * ocfs2_dentry_iput() and friends.
105181 *
105182 @@ -347,23 +318,16 @@
105183 static void ocfs2_drop_dentry_lock(struct ocfs2_super *osb,
105184 struct ocfs2_dentry_lock *dl)
105185 {
105186 + iput(dl->dl_inode);
105187 ocfs2_simple_drop_lockres(osb, &dl->dl_lockres);
105188 ocfs2_lock_res_free(&dl->dl_lockres);
105189 -
105190 - /* We leave dropping of inode reference to ocfs2_wq as that can
105191 - * possibly lead to inode deletion which gets tricky */
105192 - spin_lock(&dentry_list_lock);
105193 - if (!osb->dentry_lock_list)
105194 - queue_work(ocfs2_wq, &osb->dentry_lock_work);
105195 - dl->dl_next = osb->dentry_lock_list;
105196 - osb->dentry_lock_list = dl;
105197 - spin_unlock(&dentry_list_lock);
105198 + kfree(dl);
105199 }
105200
105201 void ocfs2_dentry_lock_put(struct ocfs2_super *osb,
105202 struct ocfs2_dentry_lock *dl)
105203 {
105204 - int unlock;
105205 + int unlock = 0;
105206
105207 BUG_ON(dl->dl_count == 0);
105208
105209 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ocfs2/dcache.h linux-2.6.29-rc3.owrt/fs/ocfs2/dcache.h
105210 --- linux-2.6.29.owrt/fs/ocfs2/dcache.h 2009-05-10 22:04:39.000000000 +0200
105211 +++ linux-2.6.29-rc3.owrt/fs/ocfs2/dcache.h 2009-05-10 23:48:29.000000000 +0200
105212 @@ -29,13 +29,8 @@
105213 extern struct dentry_operations ocfs2_dentry_ops;
105214
105215 struct ocfs2_dentry_lock {
105216 - /* Use count of dentry lock */
105217 unsigned int dl_count;
105218 - union {
105219 - /* Linked list of dentry locks to release */
105220 - struct ocfs2_dentry_lock *dl_next;
105221 - u64 dl_parent_blkno;
105222 - };
105223 + u64 dl_parent_blkno;
105224
105225 /*
105226 * The ocfs2_dentry_lock keeps an inode reference until
105227 @@ -52,8 +47,6 @@
105228 void ocfs2_dentry_lock_put(struct ocfs2_super *osb,
105229 struct ocfs2_dentry_lock *dl);
105230
105231 -void ocfs2_drop_dl_inodes(struct work_struct *work);
105232 -
105233 struct dentry *ocfs2_find_local_alias(struct inode *inode, u64 parent_blkno,
105234 int skip_unhashed);
105235
105236 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ocfs2/dlm/dlmmaster.c linux-2.6.29-rc3.owrt/fs/ocfs2/dlm/dlmmaster.c
105237 --- linux-2.6.29.owrt/fs/ocfs2/dlm/dlmmaster.c 2009-05-10 22:04:39.000000000 +0200
105238 +++ linux-2.6.29-rc3.owrt/fs/ocfs2/dlm/dlmmaster.c 2009-05-10 23:48:29.000000000 +0200
105239 @@ -1849,12 +1849,12 @@
105240 if (!mle) {
105241 if (res->owner != DLM_LOCK_RES_OWNER_UNKNOWN &&
105242 res->owner != assert->node_idx) {
105243 - mlog(ML_ERROR, "DIE! Mastery assert from %u, "
105244 - "but current owner is %u! (%.*s)\n",
105245 - assert->node_idx, res->owner, namelen,
105246 - name);
105247 - __dlm_print_one_lock_resource(res);
105248 - BUG();
105249 + mlog(ML_ERROR, "assert_master from "
105250 + "%u, but current owner is "
105251 + "%u! (%.*s)\n",
105252 + assert->node_idx, res->owner,
105253 + namelen, name);
105254 + goto kill;
105255 }
105256 } else if (mle->type != DLM_MLE_MIGRATION) {
105257 if (res->owner != DLM_LOCK_RES_OWNER_UNKNOWN) {
105258 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ocfs2/dlm/dlmthread.c linux-2.6.29-rc3.owrt/fs/ocfs2/dlm/dlmthread.c
105259 --- linux-2.6.29.owrt/fs/ocfs2/dlm/dlmthread.c 2009-05-10 22:04:39.000000000 +0200
105260 +++ linux-2.6.29-rc3.owrt/fs/ocfs2/dlm/dlmthread.c 2009-05-10 23:48:29.000000000 +0200
105261 @@ -181,7 +181,8 @@
105262
105263 spin_lock(&res->spinlock);
105264 /* This ensures that clear refmap is sent after the set */
105265 - __dlm_wait_on_lockres_flags(res, DLM_LOCK_RES_SETREF_INPROG);
105266 + __dlm_wait_on_lockres_flags(res, (DLM_LOCK_RES_SETREF_INPROG |
105267 + DLM_LOCK_RES_MIGRATING));
105268 spin_unlock(&res->spinlock);
105269
105270 /* clear our bit from the master's refmap, ignore errors */
105271 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ocfs2/dlm/dlmunlock.c linux-2.6.29-rc3.owrt/fs/ocfs2/dlm/dlmunlock.c
105272 --- linux-2.6.29.owrt/fs/ocfs2/dlm/dlmunlock.c 2009-05-10 22:04:39.000000000 +0200
105273 +++ linux-2.6.29-rc3.owrt/fs/ocfs2/dlm/dlmunlock.c 2009-05-10 23:48:29.000000000 +0200
105274 @@ -117,11 +117,11 @@
105275 else
105276 BUG_ON(res->owner == dlm->node_num);
105277
105278 - spin_lock(&dlm->ast_lock);
105279 + spin_lock(&dlm->spinlock);
105280 /* We want to be sure that we're not freeing a lock
105281 * that still has AST's pending... */
105282 in_use = !list_empty(&lock->ast_list);
105283 - spin_unlock(&dlm->ast_lock);
105284 + spin_unlock(&dlm->spinlock);
105285 if (in_use) {
105286 mlog(ML_ERROR, "lockres %.*s: Someone is calling dlmunlock "
105287 "while waiting for an ast!", res->lockname.len,
105288 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ocfs2/dlmglue.c linux-2.6.29-rc3.owrt/fs/ocfs2/dlmglue.c
105289 --- linux-2.6.29.owrt/fs/ocfs2/dlmglue.c 2009-05-10 22:04:39.000000000 +0200
105290 +++ linux-2.6.29-rc3.owrt/fs/ocfs2/dlmglue.c 2009-05-10 23:48:29.000000000 +0200
105291 @@ -320,14 +320,9 @@
105292 struct ocfs2_lock_res *lockres);
105293 static inline void ocfs2_recover_from_dlm_error(struct ocfs2_lock_res *lockres,
105294 int convert);
105295 -#define ocfs2_log_dlm_error(_func, _err, _lockres) do { \
105296 - if ((_lockres)->l_type != OCFS2_LOCK_TYPE_DENTRY) \
105297 - mlog(ML_ERROR, "DLM error %d while calling %s on resource %s\n", \
105298 - _err, _func, _lockres->l_name); \
105299 - else \
105300 - mlog(ML_ERROR, "DLM error %d while calling %s on resource %.*s%08x\n", \
105301 - _err, _func, OCFS2_DENTRY_LOCK_INO_START - 1, (_lockres)->l_name, \
105302 - (unsigned int)ocfs2_get_dentry_lock_ino(_lockres)); \
105303 +#define ocfs2_log_dlm_error(_func, _err, _lockres) do { \
105304 + mlog(ML_ERROR, "DLM error %d while calling %s on resource %s\n", \
105305 + _err, _func, _lockres->l_name); \
105306 } while (0)
105307 static int ocfs2_downconvert_thread(void *arg);
105308 static void ocfs2_downconvert_on_unlock(struct ocfs2_super *osb,
105309 @@ -2865,10 +2860,6 @@
105310 case OCFS2_UNLOCK_CANCEL_CONVERT:
105311 mlog(0, "Cancel convert success for %s\n", lockres->l_name);
105312 lockres->l_action = OCFS2_AST_INVALID;
105313 - /* Downconvert thread may have requeued this lock, we
105314 - * need to wake it. */
105315 - if (lockres->l_flags & OCFS2_LOCK_BLOCKED)
105316 - ocfs2_wake_downconvert_thread(ocfs2_get_lockres_osb(lockres));
105317 break;
105318 case OCFS2_UNLOCK_DROP_LOCK:
105319 lockres->l_level = DLM_LOCK_IV;
105320 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ocfs2/journal.h linux-2.6.29-rc3.owrt/fs/ocfs2/journal.h
105321 --- linux-2.6.29.owrt/fs/ocfs2/journal.h 2009-05-10 22:04:39.000000000 +0200
105322 +++ linux-2.6.29-rc3.owrt/fs/ocfs2/journal.h 2009-05-10 23:48:29.000000000 +0200
105323 @@ -513,10 +513,8 @@
105324 static inline int ocfs2_begin_ordered_truncate(struct inode *inode,
105325 loff_t new_size)
105326 {
105327 - return jbd2_journal_begin_ordered_truncate(
105328 - OCFS2_SB(inode->i_sb)->journal->j_journal,
105329 - &OCFS2_I(inode)->ip_jinode,
105330 - new_size);
105331 + return jbd2_journal_begin_ordered_truncate(&OCFS2_I(inode)->ip_jinode,
105332 + new_size);
105333 }
105334
105335 #endif /* OCFS2_JOURNAL_H */
105336 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ocfs2/namei.c linux-2.6.29-rc3.owrt/fs/ocfs2/namei.c
105337 --- linux-2.6.29.owrt/fs/ocfs2/namei.c 2009-05-10 22:04:39.000000000 +0200
105338 +++ linux-2.6.29-rc3.owrt/fs/ocfs2/namei.c 2009-05-10 23:48:29.000000000 +0200
105339 @@ -532,8 +532,7 @@
105340
105341 fe->i_dyn_features = cpu_to_le16(feat | OCFS2_INLINE_DATA_FL);
105342
105343 - fe->id2.i_data.id_count = cpu_to_le16(
105344 - ocfs2_max_inline_data_with_xattr(osb->sb, fe));
105345 + fe->id2.i_data.id_count = cpu_to_le16(ocfs2_max_inline_data(osb->sb));
105346 } else {
105347 fel = &fe->id2.i_list;
105348 fel->l_tree_depth = 0;
105349 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ocfs2/ocfs2_fs.h linux-2.6.29-rc3.owrt/fs/ocfs2/ocfs2_fs.h
105350 --- linux-2.6.29.owrt/fs/ocfs2/ocfs2_fs.h 2009-05-10 22:04:39.000000000 +0200
105351 +++ linux-2.6.29-rc3.owrt/fs/ocfs2/ocfs2_fs.h 2009-05-10 23:48:29.000000000 +0200
105352 @@ -1070,6 +1070,12 @@
105353 offsetof(struct ocfs2_dinode, id2.i_symlink);
105354 }
105355
105356 +static inline int ocfs2_max_inline_data(struct super_block *sb)
105357 +{
105358 + return sb->s_blocksize -
105359 + offsetof(struct ocfs2_dinode, id2.i_data.id_data);
105360 +}
105361 +
105362 static inline int ocfs2_max_inline_data_with_xattr(struct super_block *sb,
105363 struct ocfs2_dinode *di)
105364 {
105365 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ocfs2/ocfs2.h linux-2.6.29-rc3.owrt/fs/ocfs2/ocfs2.h
105366 --- linux-2.6.29.owrt/fs/ocfs2/ocfs2.h 2009-05-10 22:04:39.000000000 +0200
105367 +++ linux-2.6.29-rc3.owrt/fs/ocfs2/ocfs2.h 2009-05-10 23:48:29.000000000 +0200
105368 @@ -210,7 +210,6 @@
105369 struct ocfs2_slot_info;
105370 struct ocfs2_recovery_map;
105371 struct ocfs2_quota_recovery;
105372 -struct ocfs2_dentry_lock;
105373 struct ocfs2_super
105374 {
105375 struct task_struct *commit_task;
105376 @@ -326,11 +325,6 @@
105377 struct list_head blocked_lock_list;
105378 unsigned long blocked_lock_count;
105379
105380 - /* List of dentry locks to release. Anyone can add locks to
105381 - * the list, ocfs2_wq processes the list */
105382 - struct ocfs2_dentry_lock *dentry_lock_list;
105383 - struct work_struct dentry_lock_work;
105384 -
105385 wait_queue_head_t osb_mount_event;
105386
105387 /* Truncate log info */
105388 @@ -341,9 +335,6 @@
105389 struct ocfs2_node_map osb_recovering_orphan_dirs;
105390 unsigned int *osb_orphan_wipes;
105391 wait_queue_head_t osb_wipe_event;
105392 -
105393 - /* used to protect metaecc calculation check of xattr. */
105394 - spinlock_t osb_xattr_lock;
105395 };
105396
105397 #define OCFS2_SB(sb) ((struct ocfs2_super *)(sb)->s_fs_info)
105398 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ocfs2/quota_global.c linux-2.6.29-rc3.owrt/fs/ocfs2/quota_global.c
105399 --- linux-2.6.29.owrt/fs/ocfs2/quota_global.c 2009-05-10 22:04:39.000000000 +0200
105400 +++ linux-2.6.29-rc3.owrt/fs/ocfs2/quota_global.c 2009-05-10 23:48:29.000000000 +0200
105401 @@ -754,9 +754,7 @@
105402 if (dquot->dq_flags & mask)
105403 sync = 1;
105404 spin_unlock(&dq_data_lock);
105405 - /* This is a slight hack but we can't afford getting global quota
105406 - * lock if we already have a transaction started. */
105407 - if (!sync || journal_current_handle()) {
105408 + if (!sync) {
105409 status = ocfs2_write_dquot(dquot);
105410 goto out;
105411 }
105412 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ocfs2/super.c linux-2.6.29-rc3.owrt/fs/ocfs2/super.c
105413 --- linux-2.6.29.owrt/fs/ocfs2/super.c 2009-05-10 22:04:39.000000000 +0200
105414 +++ linux-2.6.29-rc3.owrt/fs/ocfs2/super.c 2009-05-10 23:48:29.000000000 +0200
105415 @@ -1537,13 +1537,6 @@
105416 unlock_buffer(*bh);
105417 ll_rw_block(READ, 1, bh);
105418 wait_on_buffer(*bh);
105419 - if (!buffer_uptodate(*bh)) {
105420 - mlog_errno(-EIO);
105421 - brelse(*bh);
105422 - *bh = NULL;
105423 - return -EIO;
105424 - }
105425 -
105426 return 0;
105427 }
105428
105429 @@ -1754,7 +1747,6 @@
105430 INIT_LIST_HEAD(&osb->blocked_lock_list);
105431 osb->blocked_lock_count = 0;
105432 spin_lock_init(&osb->osb_lock);
105433 - spin_lock_init(&osb->osb_xattr_lock);
105434 ocfs2_init_inode_steal_slot(osb);
105435
105436 atomic_set(&osb->alloc_stats.moves, 0);
105437 @@ -1895,9 +1887,6 @@
105438 INIT_WORK(&journal->j_recovery_work, ocfs2_complete_recovery);
105439 journal->j_state = OCFS2_JOURNAL_FREE;
105440
105441 - INIT_WORK(&osb->dentry_lock_work, ocfs2_drop_dl_inodes);
105442 - osb->dentry_lock_list = NULL;
105443 -
105444 /* get some pseudo constants for clustersize bits */
105445 osb->s_clustersize_bits =
105446 le32_to_cpu(di->id2.i_super.s_clustersize_bits);
105447 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ocfs2/xattr.c linux-2.6.29-rc3.owrt/fs/ocfs2/xattr.c
105448 --- linux-2.6.29.owrt/fs/ocfs2/xattr.c 2009-05-10 22:04:39.000000000 +0200
105449 +++ linux-2.6.29-rc3.owrt/fs/ocfs2/xattr.c 2009-05-10 23:48:29.000000000 +0200
105450 @@ -82,14 +82,13 @@
105451
105452 #define OCFS2_XATTR_ROOT_SIZE (sizeof(struct ocfs2_xattr_def_value_root))
105453 #define OCFS2_XATTR_INLINE_SIZE 80
105454 -#define OCFS2_XATTR_HEADER_GAP 4
105455 #define OCFS2_XATTR_FREE_IN_IBODY (OCFS2_MIN_XATTR_INLINE_SIZE \
105456 - sizeof(struct ocfs2_xattr_header) \
105457 - - OCFS2_XATTR_HEADER_GAP)
105458 + - sizeof(__u32))
105459 #define OCFS2_XATTR_FREE_IN_BLOCK(ptr) ((ptr)->i_sb->s_blocksize \
105460 - sizeof(struct ocfs2_xattr_block) \
105461 - sizeof(struct ocfs2_xattr_header) \
105462 - - OCFS2_XATTR_HEADER_GAP)
105463 + - sizeof(__u32))
105464
105465 static struct ocfs2_xattr_def_value_root def_xv = {
105466 .xv.xr_list.l_count = cpu_to_le16(1),
105467 @@ -275,12 +274,10 @@
105468 bucket->bu_blocks, bucket->bu_bhs, 0,
105469 NULL);
105470 if (!rc) {
105471 - spin_lock(&OCFS2_SB(bucket->bu_inode->i_sb)->osb_xattr_lock);
105472 rc = ocfs2_validate_meta_ecc_bhs(bucket->bu_inode->i_sb,
105473 bucket->bu_bhs,
105474 bucket->bu_blocks,
105475 &bucket_xh(bucket)->xh_check);
105476 - spin_unlock(&OCFS2_SB(bucket->bu_inode->i_sb)->osb_xattr_lock);
105477 if (rc)
105478 mlog_errno(rc);
105479 }
105480 @@ -313,11 +310,9 @@
105481 {
105482 int i;
105483
105484 - spin_lock(&OCFS2_SB(bucket->bu_inode->i_sb)->osb_xattr_lock);
105485 ocfs2_compute_meta_ecc_bhs(bucket->bu_inode->i_sb,
105486 bucket->bu_bhs, bucket->bu_blocks,
105487 &bucket_xh(bucket)->xh_check);
105488 - spin_unlock(&OCFS2_SB(bucket->bu_inode->i_sb)->osb_xattr_lock);
105489
105490 for (i = 0; i < bucket->bu_blocks; i++)
105491 ocfs2_journal_dirty(handle, bucket->bu_bhs[i]);
105492 @@ -547,12 +542,8 @@
105493 * when blocksize = 512, may reserve one more cluser for
105494 * xattr bucket, otherwise reserve one metadata block
105495 * for them is ok.
105496 - * If this is a new directory with inline data,
105497 - * we choose to reserve the entire inline area for
105498 - * directory contents and force an external xattr block.
105499 */
105500 if (dir->i_sb->s_blocksize == OCFS2_MIN_BLOCKSIZE ||
105501 - (S_ISDIR(mode) && ocfs2_supports_inline_data(osb)) ||
105502 (s_size + a_size) > OCFS2_XATTR_FREE_IN_IBODY) {
105503 ret = ocfs2_reserve_new_metadata_blocks(osb, 1, xattr_ac);
105504 if (ret) {
105505 @@ -1516,7 +1507,7 @@
105506 last += 1;
105507 }
105508
105509 - free = min_offs - ((void *)last - xs->base) - OCFS2_XATTR_HEADER_GAP;
105510 + free = min_offs - ((void *)last - xs->base) - sizeof(__u32);
105511 if (free < 0)
105512 return -EIO;
105513
105514 @@ -2199,7 +2190,7 @@
105515 last += 1;
105516 }
105517
105518 - free = min_offs - ((void *)last - xs->base) - OCFS2_XATTR_HEADER_GAP;
105519 + free = min_offs - ((void *)last - xs->base) - sizeof(__u32);
105520 if (free < 0)
105521 return 0;
105522
105523 @@ -2601,9 +2592,8 @@
105524
105525 if (!ret) {
105526 /* Update inode ctime. */
105527 - ret = ocfs2_journal_access_di(ctxt->handle, inode,
105528 - xis->inode_bh,
105529 - OCFS2_JOURNAL_ACCESS_WRITE);
105530 + ret = ocfs2_journal_access(ctxt->handle, inode, xis->inode_bh,
105531 + OCFS2_JOURNAL_ACCESS_WRITE);
105532 if (ret) {
105533 mlog_errno(ret);
105534 goto out;
105535 @@ -4739,6 +4729,13 @@
105536 vb.vb_xv = (struct ocfs2_xattr_value_root *)
105537 (vb.vb_bh->b_data + offset % blocksize);
105538
105539 + ret = ocfs2_xattr_bucket_journal_access(ctxt->handle, bucket,
105540 + OCFS2_JOURNAL_ACCESS_WRITE);
105541 + if (ret) {
105542 + mlog_errno(ret);
105543 + goto out;
105544 + }
105545 +
105546 /*
105547 * From here on out we have to dirty the bucket. The generic
105548 * value calls only modify one of the bucket's bhs, but we need
105549 @@ -4751,18 +4748,12 @@
105550 ret = ocfs2_xattr_value_truncate(inode, &vb, len, ctxt);
105551 if (ret) {
105552 mlog_errno(ret);
105553 - goto out;
105554 - }
105555 -
105556 - ret = ocfs2_xattr_bucket_journal_access(ctxt->handle, bucket,
105557 - OCFS2_JOURNAL_ACCESS_WRITE);
105558 - if (ret) {
105559 - mlog_errno(ret);
105560 - goto out;
105561 + goto out_dirty;
105562 }
105563
105564 xe->xe_value_size = cpu_to_le64(len);
105565
105566 +out_dirty:
105567 ocfs2_xattr_bucket_journal_dirty(ctxt->handle, bucket);
105568
105569 out:
105570 @@ -4795,33 +4786,19 @@
105571 char *val,
105572 int value_len)
105573 {
105574 - int ret, offset, block_off;
105575 + int offset;
105576 struct ocfs2_xattr_value_root *xv;
105577 struct ocfs2_xattr_entry *xe = xs->here;
105578 - struct ocfs2_xattr_header *xh = bucket_xh(xs->bucket);
105579 - void *base;
105580
105581 BUG_ON(!xs->base || !xe || ocfs2_xattr_is_local(xe));
105582
105583 - ret = ocfs2_xattr_bucket_get_name_value(inode, xh,
105584 - xe - xh->xh_entries,
105585 - &block_off,
105586 - &offset);
105587 - if (ret) {
105588 - mlog_errno(ret);
105589 - goto out;
105590 - }
105591 + offset = le16_to_cpu(xe->xe_name_offset) +
105592 + OCFS2_XATTR_SIZE(xe->xe_name_len);
105593
105594 - base = bucket_block(xs->bucket, block_off);
105595 - xv = (struct ocfs2_xattr_value_root *)(base + offset +
105596 - OCFS2_XATTR_SIZE(xe->xe_name_len));
105597 + xv = (struct ocfs2_xattr_value_root *)(xs->base + offset);
105598
105599 - ret = __ocfs2_xattr_set_value_outside(inode, handle,
105600 - xv, val, value_len);
105601 - if (ret)
105602 - mlog_errno(ret);
105603 -out:
105604 - return ret;
105605 + return __ocfs2_xattr_set_value_outside(inode, handle,
105606 + xv, val, value_len);
105607 }
105608
105609 static int ocfs2_rm_xattr_cluster(struct inode *inode,
105610 @@ -5084,8 +5061,8 @@
105611 xh_free_start = le16_to_cpu(xh->xh_free_start);
105612 header_size = sizeof(struct ocfs2_xattr_header) +
105613 count * sizeof(struct ocfs2_xattr_entry);
105614 - max_free = OCFS2_XATTR_BUCKET_SIZE - header_size -
105615 - le16_to_cpu(xh->xh_name_value_len) - OCFS2_XATTR_HEADER_GAP;
105616 + max_free = OCFS2_XATTR_BUCKET_SIZE -
105617 + le16_to_cpu(xh->xh_name_value_len) - header_size;
105618
105619 mlog_bug_on_msg(header_size > blocksize, "bucket %llu has header size "
105620 "of %u which exceed block size\n",
105621 @@ -5118,7 +5095,7 @@
105622 need = 0;
105623 }
105624
105625 - free = xh_free_start - header_size - OCFS2_XATTR_HEADER_GAP;
105626 + free = xh_free_start - header_size;
105627 /*
105628 * We need to make sure the new name/value pair
105629 * can exist in the same block.
105630 @@ -5151,8 +5128,7 @@
105631 }
105632
105633 xh_free_start = le16_to_cpu(xh->xh_free_start);
105634 - free = xh_free_start - header_size
105635 - - OCFS2_XATTR_HEADER_GAP;
105636 + free = xh_free_start - header_size;
105637 if (xh_free_start % blocksize < need)
105638 free -= xh_free_start % blocksize;
105639
105640 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/pipe.c linux-2.6.29-rc3.owrt/fs/pipe.c
105641 --- linux-2.6.29.owrt/fs/pipe.c 2009-05-10 22:04:39.000000000 +0200
105642 +++ linux-2.6.29-rc3.owrt/fs/pipe.c 2009-05-10 23:48:29.000000000 +0200
105643 @@ -699,12 +699,12 @@
105644 int retval;
105645
105646 mutex_lock(&inode->i_mutex);
105647 +
105648 retval = fasync_helper(fd, filp, on, &pipe->fasync_readers);
105649 - if (retval >= 0) {
105650 +
105651 + if (retval >= 0)
105652 retval = fasync_helper(fd, filp, on, &pipe->fasync_writers);
105653 - if (retval < 0) /* this can happen only if on == T */
105654 - fasync_helper(-1, filp, 0, &pipe->fasync_readers);
105655 - }
105656 +
105657 mutex_unlock(&inode->i_mutex);
105658
105659 if (retval < 0)
105660 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/proc/base.c linux-2.6.29-rc3.owrt/fs/proc/base.c
105661 --- linux-2.6.29.owrt/fs/proc/base.c 2009-05-10 22:04:39.000000000 +0200
105662 +++ linux-2.6.29-rc3.owrt/fs/proc/base.c 2009-05-10 23:48:29.000000000 +0200
105663 @@ -3066,6 +3066,7 @@
105664 int retval = -ENOENT;
105665 ino_t ino;
105666 int tid;
105667 + unsigned long pos = filp->f_pos; /* avoiding "long long" filp->f_pos */
105668 struct pid_namespace *ns;
105669
105670 task = get_proc_task(inode);
105671 @@ -3082,18 +3083,18 @@
105672 goto out_no_task;
105673 retval = 0;
105674
105675 - switch ((unsigned long)filp->f_pos) {
105676 + switch (pos) {
105677 case 0:
105678 ino = inode->i_ino;
105679 - if (filldir(dirent, ".", 1, filp->f_pos, ino, DT_DIR) < 0)
105680 + if (filldir(dirent, ".", 1, pos, ino, DT_DIR) < 0)
105681 goto out;
105682 - filp->f_pos++;
105683 + pos++;
105684 /* fall through */
105685 case 1:
105686 ino = parent_ino(dentry);
105687 - if (filldir(dirent, "..", 2, filp->f_pos, ino, DT_DIR) < 0)
105688 + if (filldir(dirent, "..", 2, pos, ino, DT_DIR) < 0)
105689 goto out;
105690 - filp->f_pos++;
105691 + pos++;
105692 /* fall through */
105693 }
105694
105695 @@ -3103,9 +3104,9 @@
105696 ns = filp->f_dentry->d_sb->s_fs_info;
105697 tid = (int)filp->f_version;
105698 filp->f_version = 0;
105699 - for (task = first_tid(leader, tid, filp->f_pos - 2, ns);
105700 + for (task = first_tid(leader, tid, pos - 2, ns);
105701 task;
105702 - task = next_tid(task), filp->f_pos++) {
105703 + task = next_tid(task), pos++) {
105704 tid = task_pid_nr_ns(task, ns);
105705 if (proc_task_fill_cache(filp, dirent, filldir, task, tid) < 0) {
105706 /* returning this tgid failed, save it as the first
105707 @@ -3116,6 +3117,7 @@
105708 }
105709 }
105710 out:
105711 + filp->f_pos = pos;
105712 put_task_struct(leader);
105713 out_no_task:
105714 return retval;
105715 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/proc/inode.c linux-2.6.29-rc3.owrt/fs/proc/inode.c
105716 --- linux-2.6.29.owrt/fs/proc/inode.c 2009-05-10 22:04:39.000000000 +0200
105717 +++ linux-2.6.29-rc3.owrt/fs/proc/inode.c 2009-05-10 23:48:29.000000000 +0200
105718 @@ -485,10 +485,8 @@
105719 }
105720 }
105721 unlock_new_inode(inode);
105722 - } else {
105723 + } else
105724 module_put(de->owner);
105725 - de_put(de);
105726 - }
105727 return inode;
105728
105729 out_ino:
105730 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/proc/page.c linux-2.6.29-rc3.owrt/fs/proc/page.c
105731 --- linux-2.6.29.owrt/fs/proc/page.c 2009-05-10 22:04:39.000000000 +0200
105732 +++ linux-2.6.29-rc3.owrt/fs/proc/page.c 2009-05-10 23:48:29.000000000 +0200
105733 @@ -80,7 +80,7 @@
105734 #define KPF_RECLAIM 9
105735 #define KPF_BUDDY 10
105736
105737 -#define kpf_copy_bit(flags, dstpos, srcpos) (((flags >> srcpos) & 1) << dstpos)
105738 +#define kpf_copy_bit(flags, srcpos, dstpos) (((flags >> srcpos) & 1) << dstpos)
105739
105740 static ssize_t kpageflags_read(struct file *file, char __user *buf,
105741 size_t count, loff_t *ppos)
105742 @@ -107,7 +107,7 @@
105743 else
105744 kflags = ppage->flags;
105745
105746 - uflags = kpf_copy_bit(kflags, KPF_LOCKED, PG_locked) |
105747 + uflags = kpf_copy_bit(KPF_LOCKED, PG_locked, kflags) |
105748 kpf_copy_bit(kflags, KPF_ERROR, PG_error) |
105749 kpf_copy_bit(kflags, KPF_REFERENCED, PG_referenced) |
105750 kpf_copy_bit(kflags, KPF_UPTODATE, PG_uptodate) |
105751 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ramfs/file-nommu.c linux-2.6.29-rc3.owrt/fs/ramfs/file-nommu.c
105752 --- linux-2.6.29.owrt/fs/ramfs/file-nommu.c 2009-05-10 22:04:39.000000000 +0200
105753 +++ linux-2.6.29-rc3.owrt/fs/ramfs/file-nommu.c 2009-05-10 23:48:29.000000000 +0200
105754 @@ -114,9 +114,6 @@
105755 if (!pagevec_add(&lru_pvec, page))
105756 __pagevec_lru_add_file(&lru_pvec);
105757
105758 - /* prevent the page from being discarded on memory pressure */
105759 - SetPageDirty(page);
105760 -
105761 unlock_page(page);
105762 }
105763
105764 @@ -129,7 +126,6 @@
105765 return -EFBIG;
105766
105767 add_error:
105768 - pagevec_lru_add_file(&lru_pvec);
105769 page_cache_release(pages + loop);
105770 for (loop++; loop < npages; loop++)
105771 __free_page(pages + loop);
105772 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/seq_file.c linux-2.6.29-rc3.owrt/fs/seq_file.c
105773 --- linux-2.6.29.owrt/fs/seq_file.c 2009-05-10 22:04:39.000000000 +0200
105774 +++ linux-2.6.29-rc3.owrt/fs/seq_file.c 2009-05-10 23:48:29.000000000 +0200
105775 @@ -48,78 +48,12 @@
105776 */
105777 file->f_version = 0;
105778
105779 - /*
105780 - * seq_files support lseek() and pread(). They do not implement
105781 - * write() at all, but we clear FMODE_PWRITE here for historical
105782 - * reasons.
105783 - *
105784 - * If a client of seq_files a) implements file.write() and b) wishes to
105785 - * support pwrite() then that client will need to implement its own
105786 - * file.open() which calls seq_open() and then sets FMODE_PWRITE.
105787 - */
105788 - file->f_mode &= ~FMODE_PWRITE;
105789 + /* SEQ files support lseek, but not pread/pwrite */
105790 + file->f_mode &= ~(FMODE_PREAD | FMODE_PWRITE);
105791 return 0;
105792 }
105793 EXPORT_SYMBOL(seq_open);
105794
105795 -static int traverse(struct seq_file *m, loff_t offset)
105796 -{
105797 - loff_t pos = 0, index;
105798 - int error = 0;
105799 - void *p;
105800 -
105801 - m->version = 0;
105802 - index = 0;
105803 - m->count = m->from = 0;
105804 - if (!offset) {
105805 - m->index = index;
105806 - return 0;
105807 - }
105808 - if (!m->buf) {
105809 - m->buf = kmalloc(m->size = PAGE_SIZE, GFP_KERNEL);
105810 - if (!m->buf)
105811 - return -ENOMEM;
105812 - }
105813 - p = m->op->start(m, &index);
105814 - while (p) {
105815 - error = PTR_ERR(p);
105816 - if (IS_ERR(p))
105817 - break;
105818 - error = m->op->show(m, p);
105819 - if (error < 0)
105820 - break;
105821 - if (unlikely(error)) {
105822 - error = 0;
105823 - m->count = 0;
105824 - }
105825 - if (m->count == m->size)
105826 - goto Eoverflow;
105827 - if (pos + m->count > offset) {
105828 - m->from = offset - pos;
105829 - m->count -= m->from;
105830 - m->index = index;
105831 - break;
105832 - }
105833 - pos += m->count;
105834 - m->count = 0;
105835 - if (pos == offset) {
105836 - index++;
105837 - m->index = index;
105838 - break;
105839 - }
105840 - p = m->op->next(m, p, &index);
105841 - }
105842 - m->op->stop(m, p);
105843 - m->index = index;
105844 - return error;
105845 -
105846 -Eoverflow:
105847 - m->op->stop(m, p);
105848 - kfree(m->buf);
105849 - m->buf = kmalloc(m->size <<= 1, GFP_KERNEL);
105850 - return !m->buf ? -ENOMEM : -EAGAIN;
105851 -}
105852 -
105853 /**
105854 * seq_read - ->read() method for sequential files.
105855 * @file: the file to read from
105856 @@ -139,22 +73,6 @@
105857 int err = 0;
105858
105859 mutex_lock(&m->lock);
105860 -
105861 - /* Don't assume *ppos is where we left it */
105862 - if (unlikely(*ppos != m->read_pos)) {
105863 - m->read_pos = *ppos;
105864 - while ((err = traverse(m, *ppos)) == -EAGAIN)
105865 - ;
105866 - if (err) {
105867 - /* With prejudice... */
105868 - m->read_pos = 0;
105869 - m->version = 0;
105870 - m->index = 0;
105871 - m->count = 0;
105872 - goto Done;
105873 - }
105874 - }
105875 -
105876 /*
105877 * seq_file->op->..m_start/m_stop/m_next may do special actions
105878 * or optimisations based on the file->f_version, so we want to
105879 @@ -254,10 +172,8 @@
105880 Done:
105881 if (!copied)
105882 copied = err;
105883 - else {
105884 + else
105885 *ppos += copied;
105886 - m->read_pos += copied;
105887 - }
105888 file->f_version = m->version;
105889 mutex_unlock(&m->lock);
105890 return copied;
105891 @@ -270,6 +186,63 @@
105892 }
105893 EXPORT_SYMBOL(seq_read);
105894
105895 +static int traverse(struct seq_file *m, loff_t offset)
105896 +{
105897 + loff_t pos = 0, index;
105898 + int error = 0;
105899 + void *p;
105900 +
105901 + m->version = 0;
105902 + index = 0;
105903 + m->count = m->from = 0;
105904 + if (!offset) {
105905 + m->index = index;
105906 + return 0;
105907 + }
105908 + if (!m->buf) {
105909 + m->buf = kmalloc(m->size = PAGE_SIZE, GFP_KERNEL);
105910 + if (!m->buf)
105911 + return -ENOMEM;
105912 + }
105913 + p = m->op->start(m, &index);
105914 + while (p) {
105915 + error = PTR_ERR(p);
105916 + if (IS_ERR(p))
105917 + break;
105918 + error = m->op->show(m, p);
105919 + if (error < 0)
105920 + break;
105921 + if (unlikely(error)) {
105922 + error = 0;
105923 + m->count = 0;
105924 + }
105925 + if (m->count == m->size)
105926 + goto Eoverflow;
105927 + if (pos + m->count > offset) {
105928 + m->from = offset - pos;
105929 + m->count -= m->from;
105930 + m->index = index;
105931 + break;
105932 + }
105933 + pos += m->count;
105934 + m->count = 0;
105935 + if (pos == offset) {
105936 + index++;
105937 + m->index = index;
105938 + break;
105939 + }
105940 + p = m->op->next(m, p, &index);
105941 + }
105942 + m->op->stop(m, p);
105943 + return error;
105944 +
105945 +Eoverflow:
105946 + m->op->stop(m, p);
105947 + kfree(m->buf);
105948 + m->buf = kmalloc(m->size <<= 1, GFP_KERNEL);
105949 + return !m->buf ? -ENOMEM : -EAGAIN;
105950 +}
105951 +
105952 /**
105953 * seq_lseek - ->llseek() method for sequential files.
105954 * @file: the file in question
105955 @@ -292,18 +265,16 @@
105956 if (offset < 0)
105957 break;
105958 retval = offset;
105959 - if (offset != m->read_pos) {
105960 + if (offset != file->f_pos) {
105961 while ((retval=traverse(m, offset)) == -EAGAIN)
105962 ;
105963 if (retval) {
105964 /* with extreme prejudice... */
105965 file->f_pos = 0;
105966 - m->read_pos = 0;
105967 m->version = 0;
105968 m->index = 0;
105969 m->count = 0;
105970 } else {
105971 - m->read_pos = offset;
105972 retval = file->f_pos = offset;
105973 }
105974 }
105975 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/squashfs/block.c linux-2.6.29-rc3.owrt/fs/squashfs/block.c
105976 --- linux-2.6.29.owrt/fs/squashfs/block.c 2009-05-10 22:04:39.000000000 +0200
105977 +++ linux-2.6.29-rc3.owrt/fs/squashfs/block.c 2009-05-10 23:48:29.000000000 +0200
105978 @@ -80,7 +80,7 @@
105979 * generated a larger block - this does occasionally happen with zlib).
105980 */
105981 int squashfs_read_data(struct super_block *sb, void **buffer, u64 index,
105982 - int length, u64 *next_index, int srclength, int pages)
105983 + int length, u64 *next_index, int srclength)
105984 {
105985 struct squashfs_sb_info *msblk = sb->s_fs_info;
105986 struct buffer_head **bh;
105987 @@ -184,7 +184,7 @@
105988 offset = 0;
105989 }
105990
105991 - if (msblk->stream.avail_out == 0 && page < pages) {
105992 + if (msblk->stream.avail_out == 0) {
105993 msblk->stream.next_out = buffer[page++];
105994 msblk->stream.avail_out = PAGE_CACHE_SIZE;
105995 }
105996 @@ -201,20 +201,25 @@
105997 zlib_init = 1;
105998 }
105999
106000 - zlib_err = zlib_inflate(&msblk->stream, Z_SYNC_FLUSH);
106001 + zlib_err = zlib_inflate(&msblk->stream, Z_NO_FLUSH);
106002
106003 if (msblk->stream.avail_in == 0 && k < b)
106004 put_bh(bh[k++]);
106005 } while (zlib_err == Z_OK);
106006
106007 if (zlib_err != Z_STREAM_END) {
106008 - ERROR("zlib_inflate error, data probably corrupt\n");
106009 + ERROR("zlib_inflate returned unexpected result"
106010 + " 0x%x, srclength %d, avail_in %d,"
106011 + " avail_out %d\n", zlib_err, srclength,
106012 + msblk->stream.avail_in,
106013 + msblk->stream.avail_out);
106014 goto release_mutex;
106015 }
106016
106017 zlib_err = zlib_inflateEnd(&msblk->stream);
106018 if (zlib_err != Z_OK) {
106019 - ERROR("zlib_inflate error, data probably corrupt\n");
106020 + ERROR("zlib_inflateEnd returned unexpected result 0x%x,"
106021 + " srclength %d\n", zlib_err, srclength);
106022 goto release_mutex;
106023 }
106024 length = msblk->stream.total_out;
106025 @@ -263,8 +268,7 @@
106026 put_bh(bh[k]);
106027
106028 read_failure:
106029 - ERROR("squashfs_read_data failed to read block 0x%llx\n",
106030 - (unsigned long long) index);
106031 + ERROR("sb_bread failed reading block 0x%llx\n", cur_index);
106032 kfree(bh);
106033 return -EIO;
106034 }
106035 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/squashfs/cache.c linux-2.6.29-rc3.owrt/fs/squashfs/cache.c
106036 --- linux-2.6.29.owrt/fs/squashfs/cache.c 2009-05-10 22:04:39.000000000 +0200
106037 +++ linux-2.6.29-rc3.owrt/fs/squashfs/cache.c 2009-05-10 23:48:29.000000000 +0200
106038 @@ -119,7 +119,7 @@
106039
106040 entry->length = squashfs_read_data(sb, entry->data,
106041 block, length, &entry->next_index,
106042 - cache->block_size, cache->pages);
106043 + cache->block_size);
106044
106045 spin_lock(&cache->lock);
106046
106047 @@ -406,7 +406,7 @@
106048 for (i = 0; i < pages; i++, buffer += PAGE_CACHE_SIZE)
106049 data[i] = buffer;
106050 res = squashfs_read_data(sb, data, block, length |
106051 - SQUASHFS_COMPRESSED_BIT_BLOCK, NULL, length, pages);
106052 + SQUASHFS_COMPRESSED_BIT_BLOCK, NULL, length);
106053 kfree(data);
106054 return res;
106055 }
106056 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/squashfs/inode.c linux-2.6.29-rc3.owrt/fs/squashfs/inode.c
106057 --- linux-2.6.29.owrt/fs/squashfs/inode.c 2009-05-10 22:04:39.000000000 +0200
106058 +++ linux-2.6.29-rc3.owrt/fs/squashfs/inode.c 2009-05-10 23:48:29.000000000 +0200
106059 @@ -133,8 +133,7 @@
106060 type = le16_to_cpu(sqshb_ino->inode_type);
106061 switch (type) {
106062 case SQUASHFS_REG_TYPE: {
106063 - unsigned int frag_offset, frag;
106064 - int frag_size;
106065 + unsigned int frag_offset, frag_size, frag;
106066 u64 frag_blk;
106067 struct squashfs_reg_inode *sqsh_ino = &squashfs_ino.reg;
106068
106069 @@ -176,8 +175,7 @@
106070 break;
106071 }
106072 case SQUASHFS_LREG_TYPE: {
106073 - unsigned int frag_offset, frag;
106074 - int frag_size;
106075 + unsigned int frag_offset, frag_size, frag;
106076 u64 frag_blk;
106077 struct squashfs_lreg_inode *sqsh_ino = &squashfs_ino.lreg;
106078
106079 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/squashfs/squashfs.h linux-2.6.29-rc3.owrt/fs/squashfs/squashfs.h
106080 --- linux-2.6.29.owrt/fs/squashfs/squashfs.h 2009-05-10 22:04:39.000000000 +0200
106081 +++ linux-2.6.29-rc3.owrt/fs/squashfs/squashfs.h 2009-05-10 23:48:29.000000000 +0200
106082 @@ -34,7 +34,7 @@
106083
106084 /* block.c */
106085 extern int squashfs_read_data(struct super_block *, void **, u64, int, u64 *,
106086 - int, int);
106087 + int);
106088
106089 /* cache.c */
106090 extern struct squashfs_cache *squashfs_cache_init(char *, int, int);
106091 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/squashfs/super.c linux-2.6.29-rc3.owrt/fs/squashfs/super.c
106092 --- linux-2.6.29.owrt/fs/squashfs/super.c 2009-05-10 22:04:39.000000000 +0200
106093 +++ linux-2.6.29-rc3.owrt/fs/squashfs/super.c 2009-05-10 23:48:29.000000000 +0200
106094 @@ -389,7 +389,7 @@
106095 return err;
106096 }
106097
106098 - printk(KERN_INFO "squashfs: version 4.0 (2009/01/31) "
106099 + printk(KERN_INFO "squashfs: version 4.0 (2009/01/03) "
106100 "Phillip Lougher\n");
106101
106102 return 0;
106103 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/super.c linux-2.6.29-rc3.owrt/fs/super.c
106104 --- linux-2.6.29.owrt/fs/super.c 2009-05-10 22:04:39.000000000 +0200
106105 +++ linux-2.6.29-rc3.owrt/fs/super.c 2009-05-10 23:48:29.000000000 +0200
106106 @@ -82,22 +82,7 @@
106107 * lock ordering than usbfs:
106108 */
106109 lockdep_set_class(&s->s_lock, &type->s_lock_key);
106110 - /*
106111 - * sget() can have s_umount recursion.
106112 - *
106113 - * When it cannot find a suitable sb, it allocates a new
106114 - * one (this one), and tries again to find a suitable old
106115 - * one.
106116 - *
106117 - * In case that succeeds, it will acquire the s_umount
106118 - * lock of the old one. Since these are clearly distrinct
106119 - * locks, and this object isn't exposed yet, there's no
106120 - * risk of deadlocks.
106121 - *
106122 - * Annotate this by putting this lock in a different
106123 - * subclass.
106124 - */
106125 - down_write_nested(&s->s_umount, SINGLE_DEPTH_NESTING);
106126 + down_write(&s->s_umount);
106127 s->s_count = S_BIAS;
106128 atomic_set(&s->s_active, 1);
106129 mutex_init(&s->s_vfs_rename_mutex);
106130 @@ -316,7 +301,7 @@
106131 /*
106132 * wait for asynchronous fs operations to finish before going further
106133 */
106134 - async_synchronize_full_domain(&sb->s_async_list);
106135 + async_synchronize_full_special(&sb->s_async_list);
106136
106137 /* bad name - it should be evict_inodes() */
106138 invalidate_inodes(sb);
106139 @@ -371,10 +356,8 @@
106140 continue;
106141 if (!grab_super(old))
106142 goto retry;
106143 - if (s) {
106144 - up_write(&s->s_umount);
106145 + if (s)
106146 destroy_super(s);
106147 - }
106148 return old;
106149 }
106150 }
106151 @@ -389,7 +372,6 @@
106152 err = set(s, data);
106153 if (err) {
106154 spin_unlock(&sb_lock);
106155 - up_write(&s->s_umount);
106156 destroy_super(s);
106157 return ERR_PTR(err);
106158 }
106159 @@ -488,7 +470,7 @@
106160 sb->s_count++;
106161 spin_unlock(&sb_lock);
106162 down_read(&sb->s_umount);
106163 - async_synchronize_full_domain(&sb->s_async_list);
106164 + async_synchronize_full_special(&sb->s_async_list);
106165 if (sb->s_root && (wait || sb->s_dirt))
106166 sb->s_op->sync_fs(sb, wait);
106167 up_read(&sb->s_umount);
106168 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/timerfd.c linux-2.6.29-rc3.owrt/fs/timerfd.c
106169 --- linux-2.6.29.owrt/fs/timerfd.c 2009-05-10 22:04:39.000000000 +0200
106170 +++ linux-2.6.29-rc3.owrt/fs/timerfd.c 2009-05-10 23:48:29.000000000 +0200
106171 @@ -186,9 +186,10 @@
106172 BUILD_BUG_ON(TFD_CLOEXEC != O_CLOEXEC);
106173 BUILD_BUG_ON(TFD_NONBLOCK != O_NONBLOCK);
106174
106175 - if ((flags & ~TFD_CREATE_FLAGS) ||
106176 - (clockid != CLOCK_MONOTONIC &&
106177 - clockid != CLOCK_REALTIME))
106178 + if (flags & ~(TFD_CLOEXEC | TFD_NONBLOCK))
106179 + return -EINVAL;
106180 + if (clockid != CLOCK_MONOTONIC &&
106181 + clockid != CLOCK_REALTIME)
106182 return -EINVAL;
106183
106184 ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
106185 @@ -200,7 +201,7 @@
106186 hrtimer_init(&ctx->tmr, clockid, HRTIMER_MODE_ABS);
106187
106188 ufd = anon_inode_getfd("[timerfd]", &timerfd_fops, ctx,
106189 - flags & TFD_SHARED_FCNTL_FLAGS);
106190 + flags & (O_CLOEXEC | O_NONBLOCK));
106191 if (ufd < 0)
106192 kfree(ctx);
106193
106194 @@ -218,8 +219,7 @@
106195 if (copy_from_user(&ktmr, utmr, sizeof(ktmr)))
106196 return -EFAULT;
106197
106198 - if ((flags & ~TFD_SETTIME_FLAGS) ||
106199 - !timespec_valid(&ktmr.it_value) ||
106200 + if (!timespec_valid(&ktmr.it_value) ||
106201 !timespec_valid(&ktmr.it_interval))
106202 return -EINVAL;
106203
106204 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ubifs/budget.c linux-2.6.29-rc3.owrt/fs/ubifs/budget.c
106205 --- linux-2.6.29.owrt/fs/ubifs/budget.c 2009-05-10 22:04:39.000000000 +0200
106206 +++ linux-2.6.29-rc3.owrt/fs/ubifs/budget.c 2009-05-10 23:48:29.000000000 +0200
106207 @@ -689,7 +689,7 @@
106208 }
106209
106210 /**
106211 - * ubifs_get_free_space_nolock - return amount of free space.
106212 + * ubifs_get_free_space - return amount of free space.
106213 * @c: UBIFS file-system description object
106214 *
106215 * This function calculates amount of free space to report to user-space.
106216 @@ -704,14 +704,16 @@
106217 * traditional file-systems, because they have way less overhead than UBIFS.
106218 * So, to keep users happy, UBIFS tries to take the overhead into account.
106219 */
106220 -long long ubifs_get_free_space_nolock(struct ubifs_info *c)
106221 +long long ubifs_get_free_space(struct ubifs_info *c)
106222 {
106223 - int rsvd_idx_lebs, lebs;
106224 + int min_idx_lebs, rsvd_idx_lebs, lebs;
106225 long long available, outstanding, free;
106226
106227 - ubifs_assert(c->min_idx_lebs == ubifs_calc_min_idx_lebs(c));
106228 + spin_lock(&c->space_lock);
106229 + min_idx_lebs = c->min_idx_lebs;
106230 + ubifs_assert(min_idx_lebs == ubifs_calc_min_idx_lebs(c));
106231 outstanding = c->budg_data_growth + c->budg_dd_growth;
106232 - available = ubifs_calc_available(c, c->min_idx_lebs);
106233 + available = ubifs_calc_available(c, min_idx_lebs);
106234
106235 /*
106236 * When reporting free space to user-space, UBIFS guarantees that it is
106237 @@ -724,14 +726,15 @@
106238 * Note, the calculations below are similar to what we have in
106239 * 'do_budget_space()', so refer there for comments.
106240 */
106241 - if (c->min_idx_lebs > c->lst.idx_lebs)
106242 - rsvd_idx_lebs = c->min_idx_lebs - c->lst.idx_lebs;
106243 + if (min_idx_lebs > c->lst.idx_lebs)
106244 + rsvd_idx_lebs = min_idx_lebs - c->lst.idx_lebs;
106245 else
106246 rsvd_idx_lebs = 0;
106247 lebs = c->lst.empty_lebs + c->freeable_cnt + c->idx_gc_cnt -
106248 c->lst.taken_empty_lebs;
106249 lebs -= rsvd_idx_lebs;
106250 available += lebs * (c->dark_wm - c->leb_overhead);
106251 + spin_unlock(&c->space_lock);
106252
106253 if (available > outstanding)
106254 free = ubifs_reported_space(c, available - outstanding);
106255 @@ -739,21 +742,3 @@
106256 free = 0;
106257 return free;
106258 }
106259 -
106260 -/**
106261 - * ubifs_get_free_space - return amount of free space.
106262 - * @c: UBIFS file-system description object
106263 - *
106264 - * This function calculates and retuns amount of free space to report to
106265 - * user-space.
106266 - */
106267 -long long ubifs_get_free_space(struct ubifs_info *c)
106268 -{
106269 - long long free;
106270 -
106271 - spin_lock(&c->space_lock);
106272 - free = ubifs_get_free_space_nolock(c);
106273 - spin_unlock(&c->space_lock);
106274 -
106275 - return free;
106276 -}
106277 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ubifs/debug.c linux-2.6.29-rc3.owrt/fs/ubifs/debug.c
106278 --- linux-2.6.29.owrt/fs/ubifs/debug.c 2009-05-10 22:04:39.000000000 +0200
106279 +++ linux-2.6.29-rc3.owrt/fs/ubifs/debug.c 2009-05-10 23:48:29.000000000 +0200
106280 @@ -620,11 +620,9 @@
106281 c->dark_wm, c->dead_wm, c->max_idx_node_sz);
106282 printk(KERN_DEBUG "\tgc_lnum %d, ihead_lnum %d\n",
106283 c->gc_lnum, c->ihead_lnum);
106284 - /* If we are in R/O mode, journal heads do not exist */
106285 - if (c->jheads)
106286 - for (i = 0; i < c->jhead_cnt; i++)
106287 - printk(KERN_DEBUG "\tjhead %d\t LEB %d\n",
106288 - c->jheads[i].wbuf.jhead, c->jheads[i].wbuf.lnum);
106289 + for (i = 0; i < c->jhead_cnt; i++)
106290 + printk(KERN_DEBUG "\tjhead %d\t LEB %d\n",
106291 + c->jheads[i].wbuf.jhead, c->jheads[i].wbuf.lnum);
106292 for (rb = rb_first(&c->buds); rb; rb = rb_next(rb)) {
106293 bud = rb_entry(rb, struct ubifs_bud, rb);
106294 printk(KERN_DEBUG "\tbud LEB %d\n", bud->lnum);
106295 @@ -639,7 +637,10 @@
106296 /* Print budgeting predictions */
106297 available = ubifs_calc_available(c, c->min_idx_lebs);
106298 outstanding = c->budg_data_growth + c->budg_dd_growth;
106299 - free = ubifs_get_free_space_nolock(c);
106300 + if (available > outstanding)
106301 + free = ubifs_reported_space(c, available - outstanding);
106302 + else
106303 + free = 0;
106304 printk(KERN_DEBUG "Budgeting predictions:\n");
106305 printk(KERN_DEBUG "\tavailable: %lld, outstanding %lld, free %lld\n",
106306 available, outstanding, free);
106307 @@ -860,65 +861,6 @@
106308 }
106309
106310 /**
106311 - * dbg_save_space_info - save information about flash space.
106312 - * @c: UBIFS file-system description object
106313 - *
106314 - * This function saves information about UBIFS free space, dirty space, etc, in
106315 - * order to check it later.
106316 - */
106317 -void dbg_save_space_info(struct ubifs_info *c)
106318 -{
106319 - struct ubifs_debug_info *d = c->dbg;
106320 -
106321 - ubifs_get_lp_stats(c, &d->saved_lst);
106322 -
106323 - spin_lock(&c->space_lock);
106324 - d->saved_free = ubifs_get_free_space_nolock(c);
106325 - spin_unlock(&c->space_lock);
106326 -}
106327 -
106328 -/**
106329 - * dbg_check_space_info - check flash space information.
106330 - * @c: UBIFS file-system description object
106331 - *
106332 - * This function compares current flash space information with the information
106333 - * which was saved when the 'dbg_save_space_info()' function was called.
106334 - * Returns zero if the information has not changed, and %-EINVAL it it has
106335 - * changed.
106336 - */
106337 -int dbg_check_space_info(struct ubifs_info *c)
106338 -{
106339 - struct ubifs_debug_info *d = c->dbg;
106340 - struct ubifs_lp_stats lst;
106341 - long long avail, free;
106342 -
106343 - spin_lock(&c->space_lock);
106344 - avail = ubifs_calc_available(c, c->min_idx_lebs);
106345 - spin_unlock(&c->space_lock);
106346 - free = ubifs_get_free_space(c);
106347 -
106348 - if (free != d->saved_free) {
106349 - ubifs_err("free space changed from %lld to %lld",
106350 - d->saved_free, free);
106351 - goto out;
106352 - }
106353 -
106354 - return 0;
106355 -
106356 -out:
106357 - ubifs_msg("saved lprops statistics dump");
106358 - dbg_dump_lstats(&d->saved_lst);
106359 - ubifs_get_lp_stats(c, &lst);
106360 - ubifs_msg("current lprops statistics dump");
106361 - dbg_dump_lstats(&d->saved_lst);
106362 - spin_lock(&c->space_lock);
106363 - dbg_dump_budg(c);
106364 - spin_unlock(&c->space_lock);
106365 - dump_stack();
106366 - return -EINVAL;
106367 -}
106368 -
106369 -/**
106370 * dbg_check_synced_i_size - check synchronized inode size.
106371 * @inode: inode to check
106372 *
106373 @@ -1407,7 +1349,7 @@
106374 * @c: UBIFS file-system description object
106375 * @leaf_cb: called for each leaf node
106376 * @znode_cb: called for each indexing node
106377 - * @priv: private data which is passed to callbacks
106378 + * @priv: private date which is passed to callbacks
106379 *
106380 * This function walks the UBIFS index and calls the @leaf_cb for each leaf
106381 * node and @znode_cb for each indexing node. Returns zero in case of success
106382 @@ -2467,7 +2409,7 @@
106383 * Root directory for UBIFS stuff in debugfs. Contains sub-directories which
106384 * contain the stuff specific to particular file-system mounts.
106385 */
106386 -static struct dentry *dfs_rootdir;
106387 +static struct dentry *debugfs_rootdir;
106388
106389 /**
106390 * dbg_debugfs_init - initialize debugfs file-system.
106391 @@ -2479,9 +2421,9 @@
106392 */
106393 int dbg_debugfs_init(void)
106394 {
106395 - dfs_rootdir = debugfs_create_dir("ubifs", NULL);
106396 - if (IS_ERR(dfs_rootdir)) {
106397 - int err = PTR_ERR(dfs_rootdir);
106398 + debugfs_rootdir = debugfs_create_dir("ubifs", NULL);
106399 + if (IS_ERR(debugfs_rootdir)) {
106400 + int err = PTR_ERR(debugfs_rootdir);
106401 ubifs_err("cannot create \"ubifs\" debugfs directory, "
106402 "error %d\n", err);
106403 return err;
106404 @@ -2495,7 +2437,7 @@
106405 */
106406 void dbg_debugfs_exit(void)
106407 {
106408 - debugfs_remove(dfs_rootdir);
106409 + debugfs_remove(debugfs_rootdir);
106410 }
106411
106412 static int open_debugfs_file(struct inode *inode, struct file *file)
106413 @@ -2510,13 +2452,13 @@
106414 struct ubifs_info *c = file->private_data;
106415 struct ubifs_debug_info *d = c->dbg;
106416
106417 - if (file->f_path.dentry == d->dfs_dump_lprops)
106418 + if (file->f_path.dentry == d->dump_lprops)
106419 dbg_dump_lprops(c);
106420 - else if (file->f_path.dentry == d->dfs_dump_budg) {
106421 + else if (file->f_path.dentry == d->dump_budg) {
106422 spin_lock(&c->space_lock);
106423 dbg_dump_budg(c);
106424 spin_unlock(&c->space_lock);
106425 - } else if (file->f_path.dentry == d->dfs_dump_tnc) {
106426 + } else if (file->f_path.dentry == d->dump_tnc) {
106427 mutex_lock(&c->tnc_mutex);
106428 dbg_dump_tnc(c);
106429 mutex_unlock(&c->tnc_mutex);
106430 @@ -2527,7 +2469,7 @@
106431 return count;
106432 }
106433
106434 -static const struct file_operations dfs_fops = {
106435 +static const struct file_operations debugfs_fops = {
106436 .open = open_debugfs_file,
106437 .write = write_debugfs_file,
106438 .owner = THIS_MODULE,
106439 @@ -2552,32 +2494,36 @@
106440 struct dentry *dent;
106441 struct ubifs_debug_info *d = c->dbg;
106442
106443 - sprintf(d->dfs_dir_name, "ubi%d_%d", c->vi.ubi_num, c->vi.vol_id);
106444 - d->dfs_dir = debugfs_create_dir(d->dfs_dir_name, dfs_rootdir);
106445 - if (IS_ERR(d->dfs_dir)) {
106446 - err = PTR_ERR(d->dfs_dir);
106447 + sprintf(d->debugfs_dir_name, "ubi%d_%d", c->vi.ubi_num, c->vi.vol_id);
106448 + d->debugfs_dir = debugfs_create_dir(d->debugfs_dir_name,
106449 + debugfs_rootdir);
106450 + if (IS_ERR(d->debugfs_dir)) {
106451 + err = PTR_ERR(d->debugfs_dir);
106452 ubifs_err("cannot create \"%s\" debugfs directory, error %d\n",
106453 - d->dfs_dir_name, err);
106454 + d->debugfs_dir_name, err);
106455 goto out;
106456 }
106457
106458 fname = "dump_lprops";
106459 - dent = debugfs_create_file(fname, S_IWUGO, d->dfs_dir, c, &dfs_fops);
106460 + dent = debugfs_create_file(fname, S_IWUGO, d->debugfs_dir, c,
106461 + &debugfs_fops);
106462 if (IS_ERR(dent))
106463 goto out_remove;
106464 - d->dfs_dump_lprops = dent;
106465 + d->dump_lprops = dent;
106466
106467 fname = "dump_budg";
106468 - dent = debugfs_create_file(fname, S_IWUGO, d->dfs_dir, c, &dfs_fops);
106469 + dent = debugfs_create_file(fname, S_IWUGO, d->debugfs_dir, c,
106470 + &debugfs_fops);
106471 if (IS_ERR(dent))
106472 goto out_remove;
106473 - d->dfs_dump_budg = dent;
106474 + d->dump_budg = dent;
106475
106476 fname = "dump_tnc";
106477 - dent = debugfs_create_file(fname, S_IWUGO, d->dfs_dir, c, &dfs_fops);
106478 + dent = debugfs_create_file(fname, S_IWUGO, d->debugfs_dir, c,
106479 + &debugfs_fops);
106480 if (IS_ERR(dent))
106481 goto out_remove;
106482 - d->dfs_dump_tnc = dent;
106483 + d->dump_tnc = dent;
106484
106485 return 0;
106486
106487 @@ -2585,7 +2531,7 @@
106488 err = PTR_ERR(dent);
106489 ubifs_err("cannot create \"%s\" debugfs directory, error %d\n",
106490 fname, err);
106491 - debugfs_remove_recursive(d->dfs_dir);
106492 + debugfs_remove_recursive(d->debugfs_dir);
106493 out:
106494 return err;
106495 }
106496 @@ -2596,7 +2542,7 @@
106497 */
106498 void dbg_debugfs_exit_fs(struct ubifs_info *c)
106499 {
106500 - debugfs_remove_recursive(c->dbg->dfs_dir);
106501 + debugfs_remove_recursive(c->dbg->debugfs_dir);
106502 }
106503
106504 #endif /* CONFIG_UBIFS_FS_DEBUG */
106505 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ubifs/debug.h linux-2.6.29-rc3.owrt/fs/ubifs/debug.h
106506 --- linux-2.6.29.owrt/fs/ubifs/debug.h 2009-05-10 22:04:39.000000000 +0200
106507 +++ linux-2.6.29-rc3.owrt/fs/ubifs/debug.h 2009-05-10 23:48:29.000000000 +0200
106508 @@ -41,17 +41,15 @@
106509 * @chk_lpt_wastage: used by LPT tree size checker
106510 * @chk_lpt_lebs: used by LPT tree size checker
106511 * @new_nhead_offs: used by LPT tree size checker
106512 - * @new_ihead_lnum: used by debugging to check @c->ihead_lnum
106513 - * @new_ihead_offs: used by debugging to check @c->ihead_offs
106514 + * @new_ihead_lnum: used by debugging to check ihead_lnum
106515 + * @new_ihead_offs: used by debugging to check ihead_offs
106516 *
106517 - * @saved_lst: saved lprops statistics (used by 'dbg_save_space_info()')
106518 - * @saved_free: saved free space (used by 'dbg_save_space_info()')
106519 - *
106520 - * dfs_dir_name: name of debugfs directory containing this file-system's files
106521 - * dfs_dir: direntry object of the file-system debugfs directory
106522 - * dfs_dump_lprops: "dump lprops" debugfs knob
106523 - * dfs_dump_budg: "dump budgeting information" debugfs knob
106524 - * dfs_dump_tnc: "dump TNC" debugfs knob
106525 + * debugfs_dir_name: name of debugfs directory containing this file-system's
106526 + * files
106527 + * debugfs_dir: direntry object of the file-system debugfs directory
106528 + * dump_lprops: "dump lprops" debugfs knob
106529 + * dump_budg: "dump budgeting information" debugfs knob
106530 + * dump_tnc: "dump TNC" debugfs knob
106531 */
106532 struct ubifs_debug_info {
106533 void *buf;
106534 @@ -71,14 +69,11 @@
106535 int new_ihead_lnum;
106536 int new_ihead_offs;
106537
106538 - struct ubifs_lp_stats saved_lst;
106539 - long long saved_free;
106540 -
106541 - char dfs_dir_name[100];
106542 - struct dentry *dfs_dir;
106543 - struct dentry *dfs_dump_lprops;
106544 - struct dentry *dfs_dump_budg;
106545 - struct dentry *dfs_dump_tnc;
106546 + char debugfs_dir_name[100];
106547 + struct dentry *debugfs_dir;
106548 + struct dentry *dump_lprops;
106549 + struct dentry *dump_budg;
106550 + struct dentry *dump_tnc;
106551 };
106552
106553 #define ubifs_assert(expr) do { \
106554 @@ -302,8 +297,7 @@
106555 dbg_znode_callback znode_cb, void *priv);
106556
106557 /* Checking functions */
106558 -void dbg_save_space_info(struct ubifs_info *c);
106559 -int dbg_check_space_info(struct ubifs_info *c);
106560 +
106561 int dbg_check_lprops(struct ubifs_info *c);
106562 int dbg_old_index_check_init(struct ubifs_info *c, struct ubifs_zbranch *zroot);
106563 int dbg_check_old_index(struct ubifs_info *c, struct ubifs_zbranch *zroot);
106564 @@ -445,8 +439,6 @@
106565
106566 #define dbg_walk_index(c, leaf_cb, znode_cb, priv) 0
106567 #define dbg_old_index_check_init(c, zroot) 0
106568 -#define dbg_save_space_info(c) ({})
106569 -#define dbg_check_space_info(c) 0
106570 #define dbg_check_old_index(c, zroot) 0
106571 #define dbg_check_cats(c) 0
106572 #define dbg_check_ltab(c) 0
106573 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ubifs/dir.c linux-2.6.29-rc3.owrt/fs/ubifs/dir.c
106574 --- linux-2.6.29.owrt/fs/ubifs/dir.c 2009-05-10 22:04:39.000000000 +0200
106575 +++ linux-2.6.29-rc3.owrt/fs/ubifs/dir.c 2009-05-10 23:48:29.000000000 +0200
106576 @@ -482,29 +482,30 @@
106577 }
106578
106579 /**
106580 - * lock_2_inodes - a wrapper for locking two UBIFS inodes.
106581 + * lock_2_inodes - lock two UBIFS inodes.
106582 * @inode1: first inode
106583 * @inode2: second inode
106584 - *
106585 - * We do not implement any tricks to guarantee strict lock ordering, because
106586 - * VFS has already done it for us on the @i_mutex. So this is just a simple
106587 - * wrapper function.
106588 */
106589 static void lock_2_inodes(struct inode *inode1, struct inode *inode2)
106590 {
106591 - mutex_lock_nested(&ubifs_inode(inode1)->ui_mutex, WB_MUTEX_1);
106592 - mutex_lock_nested(&ubifs_inode(inode2)->ui_mutex, WB_MUTEX_2);
106593 + if (inode1->i_ino < inode2->i_ino) {
106594 + mutex_lock_nested(&ubifs_inode(inode1)->ui_mutex, WB_MUTEX_2);
106595 + mutex_lock_nested(&ubifs_inode(inode2)->ui_mutex, WB_MUTEX_3);
106596 + } else {
106597 + mutex_lock_nested(&ubifs_inode(inode2)->ui_mutex, WB_MUTEX_2);
106598 + mutex_lock_nested(&ubifs_inode(inode1)->ui_mutex, WB_MUTEX_3);
106599 + }
106600 }
106601
106602 /**
106603 - * unlock_2_inodes - a wrapper for unlocking two UBIFS inodes.
106604 + * unlock_2_inodes - unlock two UBIFS inodes inodes.
106605 * @inode1: first inode
106606 * @inode2: second inode
106607 */
106608 static void unlock_2_inodes(struct inode *inode1, struct inode *inode2)
106609 {
106610 - mutex_unlock(&ubifs_inode(inode2)->ui_mutex);
106611 mutex_unlock(&ubifs_inode(inode1)->ui_mutex);
106612 + mutex_unlock(&ubifs_inode(inode2)->ui_mutex);
106613 }
106614
106615 static int ubifs_link(struct dentry *old_dentry, struct inode *dir,
106616 @@ -526,8 +527,6 @@
106617 dbg_gen("dent '%.*s' to ino %lu (nlink %d) in dir ino %lu",
106618 dentry->d_name.len, dentry->d_name.name, inode->i_ino,
106619 inode->i_nlink, dir->i_ino);
106620 - ubifs_assert(mutex_is_locked(&dir->i_mutex));
106621 - ubifs_assert(mutex_is_locked(&inode->i_mutex));
106622 err = dbg_check_synced_i_size(inode);
106623 if (err)
106624 return err;
106625 @@ -581,8 +580,6 @@
106626 dbg_gen("dent '%.*s' from ino %lu (nlink %d) in dir ino %lu",
106627 dentry->d_name.len, dentry->d_name.name, inode->i_ino,
106628 inode->i_nlink, dir->i_ino);
106629 - ubifs_assert(mutex_is_locked(&dir->i_mutex));
106630 - ubifs_assert(mutex_is_locked(&inode->i_mutex));
106631 err = dbg_check_synced_i_size(inode);
106632 if (err)
106633 return err;
106634 @@ -670,8 +667,7 @@
106635
106636 dbg_gen("directory '%.*s', ino %lu in dir ino %lu", dentry->d_name.len,
106637 dentry->d_name.name, inode->i_ino, dir->i_ino);
106638 - ubifs_assert(mutex_is_locked(&dir->i_mutex));
106639 - ubifs_assert(mutex_is_locked(&inode->i_mutex));
106640 +
106641 err = check_dir_empty(c, dentry->d_inode);
106642 if (err)
106643 return err;
106644 @@ -926,30 +922,59 @@
106645 }
106646
106647 /**
106648 - * lock_3_inodes - a wrapper for locking three UBIFS inodes.
106649 + * lock_3_inodes - lock three UBIFS inodes for rename.
106650 * @inode1: first inode
106651 * @inode2: second inode
106652 * @inode3: third inode
106653 *
106654 - * This function is used for 'ubifs_rename()' and @inode1 may be the same as
106655 - * @inode2 whereas @inode3 may be %NULL.
106656 - *
106657 - * We do not implement any tricks to guarantee strict lock ordering, because
106658 - * VFS has already done it for us on the @i_mutex. So this is just a simple
106659 - * wrapper function.
106660 + * For 'ubifs_rename()', @inode1 may be the same as @inode2 whereas @inode3 may
106661 + * be null.
106662 */
106663 static void lock_3_inodes(struct inode *inode1, struct inode *inode2,
106664 struct inode *inode3)
106665 {
106666 - mutex_lock_nested(&ubifs_inode(inode1)->ui_mutex, WB_MUTEX_1);
106667 - if (inode2 != inode1)
106668 - mutex_lock_nested(&ubifs_inode(inode2)->ui_mutex, WB_MUTEX_2);
106669 - if (inode3)
106670 - mutex_lock_nested(&ubifs_inode(inode3)->ui_mutex, WB_MUTEX_3);
106671 + struct inode *i1, *i2, *i3;
106672 +
106673 + if (!inode3) {
106674 + if (inode1 != inode2) {
106675 + lock_2_inodes(inode1, inode2);
106676 + return;
106677 + }
106678 + mutex_lock_nested(&ubifs_inode(inode1)->ui_mutex, WB_MUTEX_1);
106679 + return;
106680 + }
106681 +
106682 + if (inode1 == inode2) {
106683 + lock_2_inodes(inode1, inode3);
106684 + return;
106685 + }
106686 +
106687 + /* 3 different inodes */
106688 + if (inode1 < inode2) {
106689 + i3 = inode2;
106690 + if (inode1 < inode3) {
106691 + i1 = inode1;
106692 + i2 = inode3;
106693 + } else {
106694 + i1 = inode3;
106695 + i2 = inode1;
106696 + }
106697 + } else {
106698 + i3 = inode1;
106699 + if (inode2 < inode3) {
106700 + i1 = inode2;
106701 + i2 = inode3;
106702 + } else {
106703 + i1 = inode3;
106704 + i2 = inode2;
106705 + }
106706 + }
106707 + mutex_lock_nested(&ubifs_inode(i1)->ui_mutex, WB_MUTEX_1);
106708 + lock_2_inodes(i2, i3);
106709 }
106710
106711 /**
106712 - * unlock_3_inodes - a wrapper for unlocking three UBIFS inodes for rename.
106713 + * unlock_3_inodes - unlock three UBIFS inodes for rename.
106714 * @inode1: first inode
106715 * @inode2: second inode
106716 * @inode3: third inode
106717 @@ -957,11 +982,11 @@
106718 static void unlock_3_inodes(struct inode *inode1, struct inode *inode2,
106719 struct inode *inode3)
106720 {
106721 - if (inode3)
106722 - mutex_unlock(&ubifs_inode(inode3)->ui_mutex);
106723 + mutex_unlock(&ubifs_inode(inode1)->ui_mutex);
106724 if (inode1 != inode2)
106725 mutex_unlock(&ubifs_inode(inode2)->ui_mutex);
106726 - mutex_unlock(&ubifs_inode(inode1)->ui_mutex);
106727 + if (inode3)
106728 + mutex_unlock(&ubifs_inode(inode3)->ui_mutex);
106729 }
106730
106731 static int ubifs_rename(struct inode *old_dir, struct dentry *old_dentry,
106732 @@ -995,11 +1020,6 @@
106733 "dir ino %lu", old_dentry->d_name.len, old_dentry->d_name.name,
106734 old_inode->i_ino, old_dir->i_ino, new_dentry->d_name.len,
106735 new_dentry->d_name.name, new_dir->i_ino);
106736 - ubifs_assert(mutex_is_locked(&old_dir->i_mutex));
106737 - ubifs_assert(mutex_is_locked(&new_dir->i_mutex));
106738 - if (unlink)
106739 - ubifs_assert(mutex_is_locked(&new_inode->i_mutex));
106740 -
106741
106742 if (unlink && is_dir) {
106743 err = check_dir_empty(c, new_inode);
106744 @@ -1179,7 +1199,7 @@
106745 return 0;
106746 }
106747
106748 -const struct inode_operations ubifs_dir_inode_operations = {
106749 +struct inode_operations ubifs_dir_inode_operations = {
106750 .lookup = ubifs_lookup,
106751 .create = ubifs_create,
106752 .link = ubifs_link,
106753 @@ -1199,7 +1219,7 @@
106754 #endif
106755 };
106756
106757 -const struct file_operations ubifs_dir_operations = {
106758 +struct file_operations ubifs_dir_operations = {
106759 .llseek = ubifs_dir_llseek,
106760 .release = ubifs_dir_release,
106761 .read = generic_read_dir,
106762 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ubifs/file.c linux-2.6.29-rc3.owrt/fs/ubifs/file.c
106763 --- linux-2.6.29.owrt/fs/ubifs/file.c 2009-05-10 22:04:39.000000000 +0200
106764 +++ linux-2.6.29-rc3.owrt/fs/ubifs/file.c 2009-05-10 23:48:29.000000000 +0200
106765 @@ -432,6 +432,7 @@
106766 int uninitialized_var(err), appending = !!(pos + len > inode->i_size);
106767 struct page *page;
106768
106769 +
106770 ubifs_assert(ubifs_inode(inode)->ui_size == inode->i_size);
106771
106772 if (unlikely(c->ro_media))
106773 @@ -1540,7 +1541,7 @@
106774 return 0;
106775 }
106776
106777 -const struct address_space_operations ubifs_file_address_operations = {
106778 +struct address_space_operations ubifs_file_address_operations = {
106779 .readpage = ubifs_readpage,
106780 .writepage = ubifs_writepage,
106781 .write_begin = ubifs_write_begin,
106782 @@ -1550,7 +1551,7 @@
106783 .releasepage = ubifs_releasepage,
106784 };
106785
106786 -const struct inode_operations ubifs_file_inode_operations = {
106787 +struct inode_operations ubifs_file_inode_operations = {
106788 .setattr = ubifs_setattr,
106789 .getattr = ubifs_getattr,
106790 #ifdef CONFIG_UBIFS_FS_XATTR
106791 @@ -1561,14 +1562,14 @@
106792 #endif
106793 };
106794
106795 -const struct inode_operations ubifs_symlink_inode_operations = {
106796 +struct inode_operations ubifs_symlink_inode_operations = {
106797 .readlink = generic_readlink,
106798 .follow_link = ubifs_follow_link,
106799 .setattr = ubifs_setattr,
106800 .getattr = ubifs_getattr,
106801 };
106802
106803 -const struct file_operations ubifs_file_operations = {
106804 +struct file_operations ubifs_file_operations = {
106805 .llseek = generic_file_llseek,
106806 .read = do_sync_read,
106807 .write = do_sync_write,
106808 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ubifs/gc.c linux-2.6.29-rc3.owrt/fs/ubifs/gc.c
106809 --- linux-2.6.29.owrt/fs/ubifs/gc.c 2009-05-10 22:04:39.000000000 +0200
106810 +++ linux-2.6.29-rc3.owrt/fs/ubifs/gc.c 2009-05-10 23:48:29.000000000 +0200
106811 @@ -31,26 +31,6 @@
106812 * to be reused. Garbage collection will cause the number of dirty index nodes
106813 * to grow, however sufficient space is reserved for the index to ensure the
106814 * commit will never run out of space.
106815 - *
106816 - * Notes about dead watermark. At current UBIFS implementation we assume that
106817 - * LEBs which have less than @c->dead_wm bytes of free + dirty space are full
106818 - * and not worth garbage-collecting. The dead watermark is one min. I/O unit
106819 - * size, or min. UBIFS node size, depending on what is greater. Indeed, UBIFS
106820 - * Garbage Collector has to synchronize the GC head's write buffer before
106821 - * returning, so this is about wasting one min. I/O unit. However, UBIFS GC can
106822 - * actually reclaim even very small pieces of dirty space by garbage collecting
106823 - * enough dirty LEBs, but we do not bother doing this at this implementation.
106824 - *
106825 - * Notes about dark watermark. The results of GC work depends on how big are
106826 - * the UBIFS nodes GC deals with. Large nodes make GC waste more space. Indeed,
106827 - * if GC move data from LEB A to LEB B and nodes in LEB A are large, GC would
106828 - * have to waste large pieces of free space at the end of LEB B, because nodes
106829 - * from LEB A would not fit. And the worst situation is when all nodes are of
106830 - * maximum size. So dark watermark is the amount of free + dirty space in LEB
106831 - * which are guaranteed to be reclaimable. If LEB has less space, the GC migh
106832 - * be unable to reclaim it. So, LEBs with free + dirty greater than dark
106833 - * watermark are "good" LEBs from GC's point of few. The other LEBs are not so
106834 - * good, and GC takes extra care when moving them.
106835 */
106836
106837 #include <linux/pagemap.h>
106838 @@ -401,7 +381,7 @@
106839
106840 /*
106841 * Don't release the LEB until after the next commit, because
106842 - * it may contain data which is needed for recovery. So
106843 + * it may contain date which is needed for recovery. So
106844 * although we freed this LEB, it will become usable only after
106845 * the commit.
106846 */
106847 @@ -830,9 +810,8 @@
106848 * ubifs_destroy_idx_gc - destroy idx_gc list.
106849 * @c: UBIFS file-system description object
106850 *
106851 - * This function destroys the @c->idx_gc list. It is called when unmounting
106852 - * so locks are not needed. Returns zero in case of success and a negative
106853 - * error code in case of failure.
106854 + * This function destroys the idx_gc list. It is called when unmounting or
106855 + * remounting read-only so locks are not needed.
106856 */
106857 void ubifs_destroy_idx_gc(struct ubifs_info *c)
106858 {
106859 @@ -845,6 +824,7 @@
106860 list_del(&idx_gc->list);
106861 kfree(idx_gc);
106862 }
106863 +
106864 }
106865
106866 /**
106867 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ubifs/io.c linux-2.6.29-rc3.owrt/fs/ubifs/io.c
106868 --- linux-2.6.29.owrt/fs/ubifs/io.c 2009-05-10 22:04:39.000000000 +0200
106869 +++ linux-2.6.29-rc3.owrt/fs/ubifs/io.c 2009-05-10 23:48:29.000000000 +0200
106870 @@ -29,7 +29,7 @@
106871 * would have been wasted for padding to the nearest minimal I/O unit boundary.
106872 * Instead, data first goes to the write-buffer and is flushed when the
106873 * buffer is full or when it is not used for some time (by timer). This is
106874 - * similar to the mechanism is used by JFFS2.
106875 + * similarto the mechanism is used by JFFS2.
106876 *
106877 * Write-buffers are defined by 'struct ubifs_wbuf' objects and protected by
106878 * mutexes defined inside these objects. Since sometimes upper-level code
106879 @@ -75,7 +75,7 @@
106880 * @lnum: logical eraseblock number
106881 * @offs: offset within the logical eraseblock
106882 * @quiet: print no messages
106883 - * @must_chk_crc: indicates whether to always check the CRC
106884 + * @chk_crc: indicates whether to always check the CRC
106885 *
106886 * This function checks node magic number and CRC checksum. This function also
106887 * validates node length to prevent UBIFS from becoming crazy when an attacker
106888 @@ -83,17 +83,11 @@
106889 * node length in the common header could cause UBIFS to read memory outside of
106890 * allocated buffer when checking the CRC checksum.
106891 *
106892 - * This function may skip data nodes CRC checking if @c->no_chk_data_crc is
106893 - * true, which is controlled by corresponding UBIFS mount option. However, if
106894 - * @must_chk_crc is true, then @c->no_chk_data_crc is ignored and CRC is
106895 - * checked. Similarly, if @c->always_chk_crc is true, @c->no_chk_data_crc is
106896 - * ignored and CRC is checked.
106897 - *
106898 - * This function returns zero in case of success and %-EUCLEAN in case of bad
106899 - * CRC or magic.
106900 + * This function returns zero in case of success %-EUCLEAN in case of bad CRC
106901 + * or magic.
106902 */
106903 int ubifs_check_node(const struct ubifs_info *c, const void *buf, int lnum,
106904 - int offs, int quiet, int must_chk_crc)
106905 + int offs, int quiet, int chk_crc)
106906 {
106907 int err = -EINVAL, type, node_len;
106908 uint32_t crc, node_crc, magic;
106909 @@ -129,9 +123,9 @@
106910 node_len > c->ranges[type].max_len)
106911 goto out_len;
106912
106913 - if (!must_chk_crc && type == UBIFS_DATA_NODE && !c->always_chk_crc &&
106914 - c->no_chk_data_crc)
106915 - return 0;
106916 + if (!chk_crc && type == UBIFS_DATA_NODE && !c->always_chk_crc)
106917 + if (c->no_chk_data_crc)
106918 + return 0;
106919
106920 crc = crc32(UBIFS_CRC32_INIT, buf + 8, node_len - 8);
106921 node_crc = le32_to_cpu(ch->crc);
106922 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ubifs/journal.c linux-2.6.29-rc3.owrt/fs/ubifs/journal.c
106923 --- linux-2.6.29.owrt/fs/ubifs/journal.c 2009-05-10 22:04:39.000000000 +0200
106924 +++ linux-2.6.29-rc3.owrt/fs/ubifs/journal.c 2009-05-10 23:48:29.000000000 +0200
106925 @@ -208,7 +208,7 @@
106926 offs = 0;
106927
106928 out:
106929 - err = ubifs_wbuf_seek_nolock(wbuf, lnum, offs, wbuf->dtype);
106930 + err = ubifs_wbuf_seek_nolock(wbuf, lnum, offs, UBI_SHORTTERM);
106931 if (err)
106932 goto out_unlock;
106933
106934 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ubifs/lprops.c linux-2.6.29-rc3.owrt/fs/ubifs/lprops.c
106935 --- linux-2.6.29.owrt/fs/ubifs/lprops.c 2009-05-10 22:04:39.000000000 +0200
106936 +++ linux-2.6.29-rc3.owrt/fs/ubifs/lprops.c 2009-05-10 23:48:29.000000000 +0200
106937 @@ -635,10 +635,10 @@
106938 * @c: UBIFS file-system description object
106939 * @st: return statistics
106940 */
106941 -void ubifs_get_lp_stats(struct ubifs_info *c, struct ubifs_lp_stats *lst)
106942 +void ubifs_get_lp_stats(struct ubifs_info *c, struct ubifs_lp_stats *st)
106943 {
106944 spin_lock(&c->space_lock);
106945 - memcpy(lst, &c->lst, sizeof(struct ubifs_lp_stats));
106946 + memcpy(st, &c->lst, sizeof(struct ubifs_lp_stats));
106947 spin_unlock(&c->space_lock);
106948 }
106949
106950 @@ -678,9 +678,6 @@
106951
106952 out:
106953 ubifs_release_lprops(c);
106954 - if (err)
106955 - ubifs_err("cannot change properties of LEB %d, error %d",
106956 - lnum, err);
106957 return err;
106958 }
106959
106960 @@ -717,9 +714,6 @@
106961
106962 out:
106963 ubifs_release_lprops(c);
106964 - if (err)
106965 - ubifs_err("cannot update properties of LEB %d, error %d",
106966 - lnum, err);
106967 return err;
106968 }
106969
106970 @@ -743,8 +737,6 @@
106971 lpp = ubifs_lpt_lookup(c, lnum);
106972 if (IS_ERR(lpp)) {
106973 err = PTR_ERR(lpp);
106974 - ubifs_err("cannot read properties of LEB %d, error %d",
106975 - lnum, err);
106976 goto out;
106977 }
106978
106979 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ubifs/lpt_commit.c linux-2.6.29-rc3.owrt/fs/ubifs/lpt_commit.c
106980 --- linux-2.6.29.owrt/fs/ubifs/lpt_commit.c 2009-05-10 22:04:39.000000000 +0200
106981 +++ linux-2.6.29-rc3.owrt/fs/ubifs/lpt_commit.c 2009-05-10 23:48:29.000000000 +0200
106982 @@ -556,23 +556,23 @@
106983 }
106984
106985 /**
106986 - * next_pnode_to_dirty - find next pnode to dirty.
106987 + * next_pnode - find next pnode.
106988 * @c: UBIFS file-system description object
106989 * @pnode: pnode
106990 *
106991 - * This function returns the next pnode to dirty or %NULL if there are no more
106992 - * pnodes. Note that pnodes that have never been written (lnum == 0) are
106993 - * skipped.
106994 + * This function returns the next pnode or %NULL if there are no more pnodes.
106995 */
106996 -static struct ubifs_pnode *next_pnode_to_dirty(struct ubifs_info *c,
106997 - struct ubifs_pnode *pnode)
106998 +static struct ubifs_pnode *next_pnode(struct ubifs_info *c,
106999 + struct ubifs_pnode *pnode)
107000 {
107001 struct ubifs_nnode *nnode;
107002 int iip;
107003
107004 /* Try to go right */
107005 nnode = pnode->parent;
107006 - for (iip = pnode->iip + 1; iip < UBIFS_LPT_FANOUT; iip++) {
107007 + iip = pnode->iip + 1;
107008 + if (iip < UBIFS_LPT_FANOUT) {
107009 + /* We assume here that LEB zero is never an LPT LEB */
107010 if (nnode->nbranch[iip].lnum)
107011 return ubifs_get_pnode(c, nnode, iip);
107012 }
107013 @@ -583,11 +583,8 @@
107014 nnode = nnode->parent;
107015 if (!nnode)
107016 return NULL;
107017 - for (; iip < UBIFS_LPT_FANOUT; iip++) {
107018 - if (nnode->nbranch[iip].lnum)
107019 - break;
107020 - }
107021 - } while (iip >= UBIFS_LPT_FANOUT);
107022 + /* We assume here that LEB zero is never an LPT LEB */
107023 + } while (iip >= UBIFS_LPT_FANOUT || !nnode->nbranch[iip].lnum);
107024
107025 /* Go right */
107026 nnode = ubifs_get_nnode(c, nnode, iip);
107027 @@ -596,29 +593,12 @@
107028
107029 /* Go down to level 1 */
107030 while (nnode->level > 1) {
107031 - for (iip = 0; iip < UBIFS_LPT_FANOUT; iip++) {
107032 - if (nnode->nbranch[iip].lnum)
107033 - break;
107034 - }
107035 - if (iip >= UBIFS_LPT_FANOUT) {
107036 - /*
107037 - * Should not happen, but we need to keep going
107038 - * if it does.
107039 - */
107040 - iip = 0;
107041 - }
107042 - nnode = ubifs_get_nnode(c, nnode, iip);
107043 + nnode = ubifs_get_nnode(c, nnode, 0);
107044 if (IS_ERR(nnode))
107045 return (void *)nnode;
107046 }
107047
107048 - for (iip = 0; iip < UBIFS_LPT_FANOUT; iip++)
107049 - if (nnode->nbranch[iip].lnum)
107050 - break;
107051 - if (iip >= UBIFS_LPT_FANOUT)
107052 - /* Should not happen, but we need to keep going if it does */
107053 - iip = 0;
107054 - return ubifs_get_pnode(c, nnode, iip);
107055 + return ubifs_get_pnode(c, nnode, 0);
107056 }
107057
107058 /**
107059 @@ -708,7 +688,7 @@
107060 pnode = pnode_lookup(c, 0);
107061 while (pnode) {
107062 do_make_pnode_dirty(c, pnode);
107063 - pnode = next_pnode_to_dirty(c, pnode);
107064 + pnode = next_pnode(c, pnode);
107065 if (IS_ERR(pnode))
107066 return PTR_ERR(pnode);
107067 }
107068 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ubifs/master.c linux-2.6.29-rc3.owrt/fs/ubifs/master.c
107069 --- linux-2.6.29.owrt/fs/ubifs/master.c 2009-05-10 22:04:39.000000000 +0200
107070 +++ linux-2.6.29-rc3.owrt/fs/ubifs/master.c 2009-05-10 23:48:29.000000000 +0200
107071 @@ -354,7 +354,7 @@
107072 int err, lnum, offs, len;
107073
107074 if (c->ro_media)
107075 - return -EROFS;
107076 + return -EINVAL;
107077
107078 lnum = UBIFS_MST_LNUM;
107079 offs = c->mst_offs + c->mst_node_alsz;
107080 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ubifs/orphan.c linux-2.6.29-rc3.owrt/fs/ubifs/orphan.c
107081 --- linux-2.6.29.owrt/fs/ubifs/orphan.c 2009-05-10 22:04:39.000000000 +0200
107082 +++ linux-2.6.29-rc3.owrt/fs/ubifs/orphan.c 2009-05-10 23:48:29.000000000 +0200
107083 @@ -46,7 +46,7 @@
107084 * Orphans are accumulated in a rb-tree. When an inode's link count drops to
107085 * zero, the inode number is added to the rb-tree. It is removed from the tree
107086 * when the inode is deleted. Any new orphans that are in the orphan tree when
107087 - * the commit is run, are written to the orphan area in 1 or more orphan nodes.
107088 + * the commit is run, are written to the orphan area in 1 or more orph nodes.
107089 * If the orphan area is full, it is consolidated to make space. There is
107090 * always enough space because validation prevents the user from creating more
107091 * than the maximum number of orphans allowed.
107092 @@ -231,7 +231,7 @@
107093 }
107094
107095 /**
107096 - * do_write_orph_node - write a node to the orphan head.
107097 + * do_write_orph_node - write a node
107098 * @c: UBIFS file-system description object
107099 * @len: length of node
107100 * @atomic: write atomically
107101 @@ -264,11 +264,11 @@
107102 }
107103
107104 /**
107105 - * write_orph_node - write an orphan node.
107106 + * write_orph_node - write an orph node
107107 * @c: UBIFS file-system description object
107108 * @atomic: write atomically
107109 *
107110 - * This function builds an orphan node from the cnext list and writes it to the
107111 + * This function builds an orph node from the cnext list and writes it to the
107112 * orphan head. On success, %0 is returned, otherwise a negative error code
107113 * is returned.
107114 */
107115 @@ -326,11 +326,11 @@
107116 }
107117
107118 /**
107119 - * write_orph_nodes - write orphan nodes until there are no more to commit.
107120 + * write_orph_nodes - write orph nodes until there are no more to commit
107121 * @c: UBIFS file-system description object
107122 * @atomic: write atomically
107123 *
107124 - * This function writes orphan nodes for all the orphans to commit. On success,
107125 + * This function writes orph nodes for all the orphans to commit. On success,
107126 * %0 is returned, otherwise a negative error code is returned.
107127 */
107128 static int write_orph_nodes(struct ubifs_info *c, int atomic)
107129 @@ -478,14 +478,14 @@
107130 }
107131
107132 /**
107133 - * ubifs_clear_orphans - erase all LEBs used for orphans.
107134 + * clear_orphans - erase all LEBs used for orphans.
107135 * @c: UBIFS file-system description object
107136 *
107137 * If recovery is not required, then the orphans from the previous session
107138 * are not needed. This function locates the LEBs used to record
107139 * orphans, and un-maps them.
107140 */
107141 -int ubifs_clear_orphans(struct ubifs_info *c)
107142 +static int clear_orphans(struct ubifs_info *c)
107143 {
107144 int lnum, err;
107145
107146 @@ -547,9 +547,9 @@
107147 * do_kill_orphans - remove orphan inodes from the index.
107148 * @c: UBIFS file-system description object
107149 * @sleb: scanned LEB
107150 - * @last_cmt_no: cmt_no of last orphan node read is passed and returned here
107151 + * @last_cmt_no: cmt_no of last orph node read is passed and returned here
107152 * @outofdate: whether the LEB is out of date is returned here
107153 - * @last_flagged: whether the end orphan node is encountered
107154 + * @last_flagged: whether the end orph node is encountered
107155 *
107156 * This function is a helper to the 'kill_orphans()' function. It goes through
107157 * every orphan node in a LEB and for every inode number recorded, removes
107158 @@ -580,8 +580,8 @@
107159 /*
107160 * The commit number on the master node may be less, because
107161 * of a failed commit. If there are several failed commits in a
107162 - * row, the commit number written on orphan nodes will continue
107163 - * to increase (because the commit number is adjusted here) even
107164 + * row, the commit number written on orph nodes will continue to
107165 + * increase (because the commit number is adjusted here) even
107166 * though the commit number on the master node stays the same
107167 * because the master node has not been re-written.
107168 */
107169 @@ -589,9 +589,9 @@
107170 c->cmt_no = cmt_no;
107171 if (cmt_no < *last_cmt_no && *last_flagged) {
107172 /*
107173 - * The last orphan node had a higher commit number and
107174 - * was flagged as the last written for that commit
107175 - * number. That makes this orphan node, out of date.
107176 + * The last orph node had a higher commit number and was
107177 + * flagged as the last written for that commit number.
107178 + * That makes this orph node, out of date.
107179 */
107180 if (!first) {
107181 ubifs_err("out of order commit number %llu in "
107182 @@ -658,10 +658,10 @@
107183 /*
107184 * Orph nodes always start at c->orph_first and are written to each
107185 * successive LEB in turn. Generally unused LEBs will have been unmapped
107186 - * but may contain out of date orphan nodes if the unmap didn't go
107187 - * through. In addition, the last orphan node written for each commit is
107188 + * but may contain out of date orph nodes if the unmap didn't go
107189 + * through. In addition, the last orph node written for each commit is
107190 * marked (top bit of orph->cmt_no is set to 1). It is possible that
107191 - * there are orphan nodes from the next commit (i.e. the commit did not
107192 + * there are orph nodes from the next commit (i.e. the commit did not
107193 * complete successfully). In that case, no orphans will have been lost
107194 * due to the way that orphans are written, and any orphans added will
107195 * be valid orphans anyway and so can be deleted.
107196 @@ -718,7 +718,7 @@
107197 if (unclean)
107198 err = kill_orphans(c);
107199 else if (!read_only)
107200 - err = ubifs_clear_orphans(c);
107201 + err = clear_orphans(c);
107202
107203 return err;
107204 }
107205 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ubifs/super.c linux-2.6.29-rc3.owrt/fs/ubifs/super.c
107206 --- linux-2.6.29.owrt/fs/ubifs/super.c 2009-05-10 22:04:39.000000000 +0200
107207 +++ linux-2.6.29-rc3.owrt/fs/ubifs/super.c 2009-05-10 23:48:29.000000000 +0200
107208 @@ -397,7 +397,6 @@
107209 buf->f_namelen = UBIFS_MAX_NLEN;
107210 buf->f_fsid.val[0] = le32_to_cpu(uuid[0]) ^ le32_to_cpu(uuid[2]);
107211 buf->f_fsid.val[1] = le32_to_cpu(uuid[1]) ^ le32_to_cpu(uuid[3]);
107212 - ubifs_assert(buf->f_bfree <= c->block_cnt);
107213 return 0;
107214 }
107215
107216 @@ -433,24 +432,33 @@
107217 int i, err;
107218 struct ubifs_info *c = sb->s_fs_info;
107219 struct writeback_control wbc = {
107220 - .sync_mode = WB_SYNC_ALL,
107221 + .sync_mode = wait ? WB_SYNC_ALL : WB_SYNC_NONE,
107222 .range_start = 0,
107223 .range_end = LLONG_MAX,
107224 .nr_to_write = LONG_MAX,
107225 };
107226
107227 /*
107228 - * Zero @wait is just an advisory thing to help the file system shove
107229 - * lots of data into the queues, and there will be the second
107230 + * Note by akpm about WB_SYNC_NONE used above: zero @wait is just an
107231 + * advisory thing to help the file system shove lots of data into the
107232 + * queues. If some gets missed then it'll be picked up on the second
107233 * '->sync_fs()' call, with non-zero @wait.
107234 */
107235 - if (!wait)
107236 - return 0;
107237
107238 if (sb->s_flags & MS_RDONLY)
107239 return 0;
107240
107241 /*
107242 + * Synchronize write buffers, because 'ubifs_run_commit()' does not
107243 + * do this if it waits for an already running commit.
107244 + */
107245 + for (i = 0; i < c->jhead_cnt; i++) {
107246 + err = ubifs_wbuf_sync(&c->jheads[i].wbuf);
107247 + if (err)
107248 + return err;
107249 + }
107250 +
107251 + /*
107252 * VFS calls '->sync_fs()' before synchronizing all dirty inodes and
107253 * pages, so synchronize them first, then commit the journal. Strictly
107254 * speaking, it is not necessary to commit the journal here,
107255 @@ -461,16 +469,6 @@
107256 */
107257 generic_sync_sb_inodes(sb, &wbc);
107258
107259 - /*
107260 - * Synchronize write buffers, because 'ubifs_run_commit()' does not
107261 - * do this if it waits for an already running commit.
107262 - */
107263 - for (i = 0; i < c->jhead_cnt; i++) {
107264 - err = ubifs_wbuf_sync(&c->jheads[i].wbuf);
107265 - if (err)
107266 - return err;
107267 - }
107268 -
107269 err = ubifs_run_commit(c);
107270 if (err)
107271 return err;
107272 @@ -574,8 +572,15 @@
107273 c->ranges[UBIFS_IDX_NODE].max_len = INT_MAX;
107274
107275 /*
107276 - * Initialize dead and dark LEB space watermarks. See gc.c for comments
107277 - * about these values.
107278 + * Initialize dead and dark LEB space watermarks.
107279 + *
107280 + * Dead space is the space which cannot be used. Its watermark is
107281 + * equivalent to min. I/O unit or minimum node size if it is greater
107282 + * then min. I/O unit.
107283 + *
107284 + * Dark space is the space which might be used, or might not, depending
107285 + * on which node should be written to the LEB. Its watermark is
107286 + * equivalent to maximum UBIFS node size.
107287 */
107288 c->dead_wm = ALIGN(MIN_WRITE_SZ, c->min_io_size);
107289 c->dark_wm = ALIGN(UBIFS_MAX_NODE_SZ, c->min_io_size);
107290 @@ -736,12 +741,12 @@
107291 * take_gc_lnum - reserve GC LEB.
107292 * @c: UBIFS file-system description object
107293 *
107294 - * This function ensures that the LEB reserved for garbage collection is marked
107295 - * as "taken" in lprops. We also have to set free space to LEB size and dirty
107296 - * space to zero, because lprops may contain out-of-date information if the
107297 - * file-system was un-mounted before it has been committed. This function
107298 - * returns zero in case of success and a negative error code in case of
107299 - * failure.
107300 + * This function ensures that the LEB reserved for garbage collection is
107301 + * unmapped and is marked as "taken" in lprops. We also have to set free space
107302 + * to LEB size and dirty space to zero, because lprops may contain out-of-date
107303 + * information if the file-system was un-mounted before it has been committed.
107304 + * This function returns zero in case of success and a negative error code in
107305 + * case of failure.
107306 */
107307 static int take_gc_lnum(struct ubifs_info *c)
107308 {
107309 @@ -752,6 +757,10 @@
107310 return -EINVAL;
107311 }
107312
107313 + err = ubifs_leb_unmap(c, c->gc_lnum);
107314 + if (err)
107315 + return err;
107316 +
107317 /* And we have to tell lprops that this LEB is taken */
107318 err = ubifs_change_one_lp(c, c->gc_lnum, c->leb_size, 0,
107319 LPROPS_TAKEN, 0, 0);
107320 @@ -957,16 +966,13 @@
107321
107322 token = match_token(p, tokens, args);
107323 switch (token) {
107324 - /*
107325 - * %Opt_fast_unmount and %Opt_norm_unmount options are ignored.
107326 - * We accepte them in order to be backware-compatible. But this
107327 - * should be removed at some point.
107328 - */
107329 case Opt_fast_unmount:
107330 c->mount_opts.unmount_mode = 2;
107331 + c->fast_unmount = 1;
107332 break;
107333 case Opt_norm_unmount:
107334 c->mount_opts.unmount_mode = 1;
107335 + c->fast_unmount = 0;
107336 break;
107337 case Opt_bulk_read:
107338 c->mount_opts.bulk_read = 2;
107339 @@ -1088,7 +1094,12 @@
107340 ubifs_err("insufficient free space to mount in read/write mode");
107341 dbg_dump_budg(c);
107342 dbg_dump_lprops(c);
107343 - return -ENOSPC;
107344 + /*
107345 + * We return %-EINVAL instead of %-ENOSPC because it seems to
107346 + * be the closest error code mentioned in the mount function
107347 + * documentation.
107348 + */
107349 + return -EINVAL;
107350 }
107351 return 0;
107352 }
107353 @@ -1275,19 +1286,10 @@
107354 if (err)
107355 goto out_orphans;
107356 err = ubifs_rcvry_gc_commit(c);
107357 - } else {
107358 + } else
107359 err = take_gc_lnum(c);
107360 - if (err)
107361 - goto out_orphans;
107362 -
107363 - /*
107364 - * GC LEB may contain garbage if there was an unclean
107365 - * reboot, and it should be un-mapped.
107366 - */
107367 - err = ubifs_leb_unmap(c, c->gc_lnum);
107368 - if (err)
107369 - return err;
107370 - }
107371 + if (err)
107372 + goto out_orphans;
107373
107374 err = dbg_check_lprops(c);
107375 if (err)
107376 @@ -1296,16 +1298,6 @@
107377 err = ubifs_recover_size(c);
107378 if (err)
107379 goto out_orphans;
107380 - } else {
107381 - /*
107382 - * Even if we mount read-only, we have to set space in GC LEB
107383 - * to proper value because this affects UBIFS free space
107384 - * reporting. We do not want to have a situation when
107385 - * re-mounting from R/O to R/W changes amount of free space.
107386 - */
107387 - err = take_gc_lnum(c);
107388 - if (err)
107389 - goto out_orphans;
107390 }
107391
107392 spin_lock(&ubifs_infos_lock);
107393 @@ -1318,17 +1310,14 @@
107394 else {
107395 c->need_recovery = 0;
107396 ubifs_msg("recovery completed");
107397 - /* GC LEB has to be empty and taken at this point */
107398 - ubifs_assert(c->lst.taken_empty_lebs == 1);
107399 }
107400 - } else
107401 - ubifs_assert(c->lst.taken_empty_lebs == 1);
107402 + }
107403
107404 - err = dbg_check_filesystem(c);
107405 + err = dbg_debugfs_init_fs(c);
107406 if (err)
107407 goto out_infos;
107408
107409 - err = dbg_debugfs_init_fs(c);
107410 + err = dbg_check_filesystem(c);
107411 if (err)
107412 goto out_infos;
107413
107414 @@ -1362,6 +1351,7 @@
107415 c->uuid[4], c->uuid[5], c->uuid[6], c->uuid[7],
107416 c->uuid[8], c->uuid[9], c->uuid[10], c->uuid[11],
107417 c->uuid[12], c->uuid[13], c->uuid[14], c->uuid[15]);
107418 + dbg_msg("fast unmount: %d", c->fast_unmount);
107419 dbg_msg("big_lpt %d", c->big_lpt);
107420 dbg_msg("log LEBs: %d (%d - %d)",
107421 c->log_lebs, UBIFS_LOG_LNUM, c->log_last);
107422 @@ -1485,8 +1475,10 @@
107423 {
107424 int err, lnum;
107425
107426 + if (c->ro_media)
107427 + return -EINVAL;
107428 +
107429 mutex_lock(&c->umount_mutex);
107430 - dbg_save_space_info(c);
107431 c->remounting_rw = 1;
107432 c->always_chk_crc = 1;
107433
107434 @@ -1522,12 +1514,6 @@
107435 err = ubifs_recover_inl_heads(c, c->sbuf);
107436 if (err)
107437 goto out;
107438 - } else {
107439 - /* A readonly mount is not allowed to have orphans */
107440 - ubifs_assert(c->tot_orphans == 0);
107441 - err = ubifs_clear_orphans(c);
107442 - if (err)
107443 - goto out;
107444 }
107445
107446 if (!(c->mst_node->flags & cpu_to_le32(UBIFS_MST_DIRTY))) {
107447 @@ -1583,7 +1569,7 @@
107448 if (c->need_recovery)
107449 err = ubifs_rcvry_gc_commit(c);
107450 else
107451 - err = ubifs_leb_unmap(c, c->gc_lnum);
107452 + err = take_gc_lnum(c);
107453 if (err)
107454 goto out;
107455
107456 @@ -1596,9 +1582,8 @@
107457 c->vfs_sb->s_flags &= ~MS_RDONLY;
107458 c->remounting_rw = 0;
107459 c->always_chk_crc = 0;
107460 - err = dbg_check_space_info(c);
107461 mutex_unlock(&c->umount_mutex);
107462 - return err;
107463 + return 0;
107464
107465 out:
107466 vfree(c->orph_buf);
107467 @@ -1618,18 +1603,43 @@
107468 }
107469
107470 /**
107471 + * commit_on_unmount - commit the journal when un-mounting.
107472 + * @c: UBIFS file-system description object
107473 + *
107474 + * This function is called during un-mounting and re-mounting, and it commits
107475 + * the journal unless the "fast unmount" mode is enabled.
107476 + */
107477 +static void commit_on_unmount(struct ubifs_info *c)
107478 +{
107479 + struct super_block *sb = c->vfs_sb;
107480 + long long bud_bytes;
107481 +
107482 + /*
107483 + * This function is called before the background thread is stopped, so
107484 + * we may race with ongoing commit, which means we have to take
107485 + * @c->bud_lock to access @c->bud_bytes.
107486 + */
107487 + spin_lock(&c->buds_lock);
107488 + bud_bytes = c->bud_bytes;
107489 + spin_unlock(&c->buds_lock);
107490 +
107491 + if (!c->fast_unmount && !(sb->s_flags & MS_RDONLY) && bud_bytes)
107492 + ubifs_run_commit(c);
107493 +}
107494 +
107495 +/**
107496 * ubifs_remount_ro - re-mount in read-only mode.
107497 * @c: UBIFS file-system description object
107498 *
107499 - * We assume VFS has stopped writing. Possibly the background thread could be
107500 - * running a commit, however kthread_stop will wait in that case.
107501 + * We rely on VFS to have stopped writing. Possibly the background thread could
107502 + * be running a commit, however kthread_stop will wait in that case.
107503 */
107504 static void ubifs_remount_ro(struct ubifs_info *c)
107505 {
107506 int i, err;
107507
107508 ubifs_assert(!c->need_recovery);
107509 - ubifs_assert(!(c->vfs_sb->s_flags & MS_RDONLY));
107510 + commit_on_unmount(c);
107511
107512 mutex_lock(&c->umount_mutex);
107513 if (c->bgt) {
107514 @@ -1637,29 +1647,27 @@
107515 c->bgt = NULL;
107516 }
107517
107518 - dbg_save_space_info(c);
107519 -
107520 for (i = 0; i < c->jhead_cnt; i++) {
107521 ubifs_wbuf_sync(&c->jheads[i].wbuf);
107522 del_timer_sync(&c->jheads[i].wbuf.timer);
107523 }
107524
107525 - c->mst_node->flags &= ~cpu_to_le32(UBIFS_MST_DIRTY);
107526 - c->mst_node->flags |= cpu_to_le32(UBIFS_MST_NO_ORPHS);
107527 - c->mst_node->gc_lnum = cpu_to_le32(c->gc_lnum);
107528 - err = ubifs_write_master(c);
107529 - if (err)
107530 - ubifs_ro_mode(c, err);
107531 + if (!c->ro_media) {
107532 + c->mst_node->flags &= ~cpu_to_le32(UBIFS_MST_DIRTY);
107533 + c->mst_node->flags |= cpu_to_le32(UBIFS_MST_NO_ORPHS);
107534 + c->mst_node->gc_lnum = cpu_to_le32(c->gc_lnum);
107535 + err = ubifs_write_master(c);
107536 + if (err)
107537 + ubifs_ro_mode(c, err);
107538 + }
107539
107540 + ubifs_destroy_idx_gc(c);
107541 free_wbufs(c);
107542 vfree(c->orph_buf);
107543 c->orph_buf = NULL;
107544 vfree(c->ileb_buf);
107545 c->ileb_buf = NULL;
107546 ubifs_lpt_free(c, 1);
107547 - err = dbg_check_space_info(c);
107548 - if (err)
107549 - ubifs_ro_mode(c, err);
107550 mutex_unlock(&c->umount_mutex);
107551 }
107552
107553 @@ -1752,20 +1760,11 @@
107554 }
107555
107556 if ((sb->s_flags & MS_RDONLY) && !(*flags & MS_RDONLY)) {
107557 - if (c->ro_media) {
107558 - ubifs_msg("cannot re-mount due to prior errors");
107559 - return -EROFS;
107560 - }
107561 err = ubifs_remount_rw(c);
107562 if (err)
107563 return err;
107564 - } else if (!(sb->s_flags & MS_RDONLY) && (*flags & MS_RDONLY)) {
107565 - if (c->ro_media) {
107566 - ubifs_msg("cannot re-mount due to prior errors");
107567 - return -EROFS;
107568 - }
107569 + } else if (!(sb->s_flags & MS_RDONLY) && (*flags & MS_RDONLY))
107570 ubifs_remount_ro(c);
107571 - }
107572
107573 if (c->bulk_read == 1)
107574 bu_init(c);
107575 @@ -1775,11 +1774,10 @@
107576 c->bu.buf = NULL;
107577 }
107578
107579 - ubifs_assert(c->lst.taken_empty_lebs == 1);
107580 return 0;
107581 }
107582
107583 -const struct super_operations ubifs_super_operations = {
107584 +struct super_operations ubifs_super_operations = {
107585 .alloc_inode = ubifs_alloc_inode,
107586 .destroy_inode = ubifs_destroy_inode,
107587 .put_super = ubifs_put_super,
107588 @@ -2046,6 +2044,15 @@
107589
107590 static void ubifs_kill_sb(struct super_block *sb)
107591 {
107592 + struct ubifs_info *c = sb->s_fs_info;
107593 +
107594 + /*
107595 + * We do 'commit_on_unmount()' here instead of 'ubifs_put_super()'
107596 + * in order to be outside BKL.
107597 + */
107598 + if (sb->s_root)
107599 + commit_on_unmount(c);
107600 + /* The un-mount routine is actually done in put_super() */
107601 generic_shutdown_super(sb);
107602 }
107603
107604 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ubifs/tnc.c linux-2.6.29-rc3.owrt/fs/ubifs/tnc.c
107605 --- linux-2.6.29.owrt/fs/ubifs/tnc.c 2009-05-10 22:04:39.000000000 +0200
107606 +++ linux-2.6.29-rc3.owrt/fs/ubifs/tnc.c 2009-05-10 23:48:29.000000000 +0200
107607 @@ -443,11 +443,6 @@
107608 * This function performs that same function as ubifs_read_node except that
107609 * it does not require that there is actually a node present and instead
107610 * the return code indicates if a node was read.
107611 - *
107612 - * Note, this function does not check CRC of data nodes if @c->no_chk_data_crc
107613 - * is true (it is controlled by corresponding mount option). However, if
107614 - * @c->always_chk_crc is true, @c->no_chk_data_crc is ignored and CRC is always
107615 - * checked.
107616 */
107617 static int try_read_node(const struct ubifs_info *c, void *buf, int type,
107618 int len, int lnum, int offs)
107619 @@ -475,8 +470,9 @@
107620 if (node_len != len)
107621 return 0;
107622
107623 - if (type == UBIFS_DATA_NODE && !c->always_chk_crc && c->no_chk_data_crc)
107624 - return 1;
107625 + if (type == UBIFS_DATA_NODE && !c->always_chk_crc)
107626 + if (c->no_chk_data_crc)
107627 + return 0;
107628
107629 crc = crc32(UBIFS_CRC32_INIT, buf + 8, node_len - 8);
107630 node_crc = le32_to_cpu(ch->crc);
107631 @@ -1510,7 +1506,7 @@
107632 *
107633 * Note, if the bulk-read buffer length (@bu->buf_len) is known, this function
107634 * makes sure bulk-read nodes fit the buffer. Otherwise, this function prepares
107635 - * maximum possible amount of nodes for bulk-read.
107636 + * maxumum possible amount of nodes for bulk-read.
107637 */
107638 int ubifs_tnc_get_bu_keys(struct ubifs_info *c, struct bu_info *bu)
107639 {
107640 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ubifs/ubifs.h linux-2.6.29-rc3.owrt/fs/ubifs/ubifs.h
107641 --- linux-2.6.29.owrt/fs/ubifs/ubifs.h 2009-05-10 22:04:39.000000000 +0200
107642 +++ linux-2.6.29-rc3.owrt/fs/ubifs/ubifs.h 2009-05-10 23:48:29.000000000 +0200
107643 @@ -426,9 +426,9 @@
107644 * LEB properties flags.
107645 *
107646 * LPROPS_UNCAT: not categorized
107647 - * LPROPS_DIRTY: dirty > free, dirty >= @c->dead_wm, not index
107648 + * LPROPS_DIRTY: dirty > 0, not index
107649 * LPROPS_DIRTY_IDX: dirty + free > @c->min_idx_node_sze and index
107650 - * LPROPS_FREE: free > 0, dirty < @c->dead_wm, not empty, not index
107651 + * LPROPS_FREE: free > 0, not empty, not index
107652 * LPROPS_HEAP_CNT: number of heaps used for storing categorized LEBs
107653 * LPROPS_EMPTY: LEB is empty, not taken
107654 * LPROPS_FREEABLE: free + dirty == leb_size, not index, not taken
107655 @@ -961,6 +961,7 @@
107656 * @cs_lock: commit state lock
107657 * @cmt_wq: wait queue to sleep on if the log is full and a commit is running
107658 *
107659 + * @fast_unmount: do not run journal commit before un-mounting
107660 * @big_lpt: flag that LPT is too big to write whole during commit
107661 * @no_chk_data_crc: do not check CRCs when reading data nodes (except during
107662 * recovery)
107663 @@ -1201,6 +1202,7 @@
107664 spinlock_t cs_lock;
107665 wait_queue_head_t cmt_wq;
107666
107667 + unsigned int fast_unmount:1;
107668 unsigned int big_lpt:1;
107669 unsigned int no_chk_data_crc:1;
107670 unsigned int bulk_read:1;
107671 @@ -1403,13 +1405,13 @@
107672 extern spinlock_t ubifs_infos_lock;
107673 extern atomic_long_t ubifs_clean_zn_cnt;
107674 extern struct kmem_cache *ubifs_inode_slab;
107675 -extern const struct super_operations ubifs_super_operations;
107676 -extern const struct address_space_operations ubifs_file_address_operations;
107677 -extern const struct file_operations ubifs_file_operations;
107678 -extern const struct inode_operations ubifs_file_inode_operations;
107679 -extern const struct file_operations ubifs_dir_operations;
107680 -extern const struct inode_operations ubifs_dir_inode_operations;
107681 -extern const struct inode_operations ubifs_symlink_inode_operations;
107682 +extern struct super_operations ubifs_super_operations;
107683 +extern struct address_space_operations ubifs_file_address_operations;
107684 +extern struct file_operations ubifs_file_operations;
107685 +extern struct inode_operations ubifs_file_inode_operations;
107686 +extern struct file_operations ubifs_dir_operations;
107687 +extern struct inode_operations ubifs_dir_inode_operations;
107688 +extern struct inode_operations ubifs_symlink_inode_operations;
107689 extern struct backing_dev_info ubifs_backing_dev_info;
107690 extern struct ubifs_compressor *ubifs_compressors[UBIFS_COMPR_TYPES_CNT];
107691
107692 @@ -1426,7 +1428,7 @@
107693 int ubifs_write_node(struct ubifs_info *c, void *node, int len, int lnum,
107694 int offs, int dtype);
107695 int ubifs_check_node(const struct ubifs_info *c, const void *buf, int lnum,
107696 - int offs, int quiet, int must_chk_crc);
107697 + int offs, int quiet, int chk_crc);
107698 void ubifs_prepare_node(struct ubifs_info *c, void *buf, int len, int pad);
107699 void ubifs_prep_grp_node(struct ubifs_info *c, void *node, int len, int last);
107700 int ubifs_io_init(struct ubifs_info *c);
107701 @@ -1493,7 +1495,6 @@
107702 void ubifs_cancel_ino_op(struct ubifs_info *c, struct inode *inode,
107703 struct ubifs_budget_req *req);
107704 long long ubifs_get_free_space(struct ubifs_info *c);
107705 -long long ubifs_get_free_space_nolock(struct ubifs_info *c);
107706 int ubifs_calc_min_idx_lebs(struct ubifs_info *c);
107707 void ubifs_convert_page_budget(struct ubifs_info *c);
107708 long long ubifs_reported_space(const struct ubifs_info *c, long long free);
107709 @@ -1602,7 +1603,6 @@
107710 int ubifs_orphan_start_commit(struct ubifs_info *c);
107711 int ubifs_orphan_end_commit(struct ubifs_info *c);
107712 int ubifs_mount_orphans(struct ubifs_info *c, int unclean, int read_only);
107713 -int ubifs_clear_orphans(struct ubifs_info *c);
107714
107715 /* lpt.c */
107716 int ubifs_calc_lpt_geom(struct ubifs_info *c);
107717 @@ -1646,7 +1646,7 @@
107718 const struct ubifs_lprops *lp,
107719 int free, int dirty, int flags,
107720 int idx_gc_cnt);
107721 -void ubifs_get_lp_stats(struct ubifs_info *c, struct ubifs_lp_stats *lst);
107722 +void ubifs_get_lp_stats(struct ubifs_info *c, struct ubifs_lp_stats *stats);
107723 void ubifs_add_to_cat(struct ubifs_info *c, struct ubifs_lprops *lprops,
107724 int cat);
107725 void ubifs_replace_cat(struct ubifs_info *c, struct ubifs_lprops *old_lprops,
107726 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/ufs/super.c linux-2.6.29-rc3.owrt/fs/ufs/super.c
107727 --- linux-2.6.29.owrt/fs/ufs/super.c 2009-05-10 22:04:39.000000000 +0200
107728 +++ linux-2.6.29-rc3.owrt/fs/ufs/super.c 2009-05-10 23:48:29.000000000 +0200
107729 @@ -41,7 +41,7 @@
107730 * Stefan Reinauer <stepan@home.culture.mipt.ru>
107731 *
107732 * Module usage counts added on 96/04/29 by
107733 - * Gertjan van Wingerde <gwingerde@gmail.com>
107734 + * Gertjan van Wingerde <gertjan@cs.vu.nl>
107735 *
107736 * Clean swab support on 19970406 by
107737 * Francois-Rene Rideau <fare@tunes.org>
107738 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/xfs/linux-2.6/xfs_buf.c linux-2.6.29-rc3.owrt/fs/xfs/linux-2.6/xfs_buf.c
107739 --- linux-2.6.29.owrt/fs/xfs/linux-2.6/xfs_buf.c 2009-05-10 22:04:39.000000000 +0200
107740 +++ linux-2.6.29-rc3.owrt/fs/xfs/linux-2.6/xfs_buf.c 2009-05-10 23:48:29.000000000 +0200
107741 @@ -34,12 +34,6 @@
107742 #include <linux/backing-dev.h>
107743 #include <linux/freezer.h>
107744
107745 -#include "xfs_sb.h"
107746 -#include "xfs_inum.h"
107747 -#include "xfs_ag.h"
107748 -#include "xfs_dmapi.h"
107749 -#include "xfs_mount.h"
107750 -
107751 static kmem_zone_t *xfs_buf_zone;
107752 STATIC int xfsbufd(void *);
107753 STATIC int xfsbufd_wakeup(int, gfp_t);
107754 @@ -172,75 +166,6 @@
107755 }
107756
107757 /*
107758 - * Mapping of multi-page buffers into contiguous virtual space
107759 - */
107760 -
107761 -typedef struct a_list {
107762 - void *vm_addr;
107763 - struct a_list *next;
107764 -} a_list_t;
107765 -
107766 -static a_list_t *as_free_head;
107767 -static int as_list_len;
107768 -static DEFINE_SPINLOCK(as_lock);
107769 -
107770 -/*
107771 - * Try to batch vunmaps because they are costly.
107772 - */
107773 -STATIC void
107774 -free_address(
107775 - void *addr)
107776 -{
107777 - a_list_t *aentry;
107778 -
107779 -#ifdef CONFIG_XEN
107780 - /*
107781 - * Xen needs to be able to make sure it can get an exclusive
107782 - * RO mapping of pages it wants to turn into a pagetable. If
107783 - * a newly allocated page is also still being vmap()ed by xfs,
107784 - * it will cause pagetable construction to fail. This is a
107785 - * quick workaround to always eagerly unmap pages so that Xen
107786 - * is happy.
107787 - */
107788 - vunmap(addr);
107789 - return;
107790 -#endif
107791 -
107792 - aentry = kmalloc(sizeof(a_list_t), GFP_NOWAIT);
107793 - if (likely(aentry)) {
107794 - spin_lock(&as_lock);
107795 - aentry->next = as_free_head;
107796 - aentry->vm_addr = addr;
107797 - as_free_head = aentry;
107798 - as_list_len++;
107799 - spin_unlock(&as_lock);
107800 - } else {
107801 - vunmap(addr);
107802 - }
107803 -}
107804 -
107805 -STATIC void
107806 -purge_addresses(void)
107807 -{
107808 - a_list_t *aentry, *old;
107809 -
107810 - if (as_free_head == NULL)
107811 - return;
107812 -
107813 - spin_lock(&as_lock);
107814 - aentry = as_free_head;
107815 - as_free_head = NULL;
107816 - as_list_len = 0;
107817 - spin_unlock(&as_lock);
107818 -
107819 - while ((old = aentry) != NULL) {
107820 - vunmap(aentry->vm_addr);
107821 - aentry = aentry->next;
107822 - kfree(old);
107823 - }
107824 -}
107825 -
107826 -/*
107827 * Internal xfs_buf_t object manipulation
107828 */
107829
107830 @@ -339,7 +264,7 @@
107831 uint i;
107832
107833 if ((bp->b_flags & XBF_MAPPED) && (bp->b_page_count > 1))
107834 - free_address(bp->b_addr - bp->b_offset);
107835 + vm_unmap_ram(bp->b_addr - bp->b_offset, bp->b_page_count);
107836
107837 for (i = 0; i < bp->b_page_count; i++) {
107838 struct page *page = bp->b_pages[i];
107839 @@ -461,10 +386,8 @@
107840 bp->b_addr = page_address(bp->b_pages[0]) + bp->b_offset;
107841 bp->b_flags |= XBF_MAPPED;
107842 } else if (flags & XBF_MAPPED) {
107843 - if (as_list_len > 64)
107844 - purge_addresses();
107845 - bp->b_addr = vmap(bp->b_pages, bp->b_page_count,
107846 - VM_MAP, PAGE_KERNEL);
107847 + bp->b_addr = vm_map_ram(bp->b_pages, bp->b_page_count,
107848 + -1, PAGE_KERNEL);
107849 if (unlikely(bp->b_addr == NULL))
107850 return -ENOMEM;
107851 bp->b_addr += bp->b_offset;
107852 @@ -1441,12 +1364,10 @@
107853
107854 void
107855 xfs_free_buftarg(
107856 - struct xfs_mount *mp,
107857 - struct xfs_buftarg *btp)
107858 + xfs_buftarg_t *btp)
107859 {
107860 xfs_flush_buftarg(btp, 1);
107861 - if (mp->m_flags & XFS_MOUNT_BARRIER)
107862 - xfs_blkdev_issue_flush(btp);
107863 + xfs_blkdev_issue_flush(btp);
107864 xfs_free_bufhash(btp);
107865 iput(btp->bt_mapping->host);
107866
107867 @@ -1751,8 +1672,6 @@
107868 count++;
107869 }
107870
107871 - if (as_list_len > 0)
107872 - purge_addresses();
107873 if (count)
107874 blk_run_address_space(target->bt_mapping);
107875
107876 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/xfs/linux-2.6/xfs_buf.h linux-2.6.29-rc3.owrt/fs/xfs/linux-2.6/xfs_buf.h
107877 --- linux-2.6.29.owrt/fs/xfs/linux-2.6/xfs_buf.h 2009-05-10 22:04:39.000000000 +0200
107878 +++ linux-2.6.29-rc3.owrt/fs/xfs/linux-2.6/xfs_buf.h 2009-05-10 23:48:29.000000000 +0200
107879 @@ -413,7 +413,7 @@
107880 * Handling of buftargs.
107881 */
107882 extern xfs_buftarg_t *xfs_alloc_buftarg(struct block_device *, int);
107883 -extern void xfs_free_buftarg(struct xfs_mount *, struct xfs_buftarg *);
107884 +extern void xfs_free_buftarg(xfs_buftarg_t *);
107885 extern void xfs_wait_buftarg(xfs_buftarg_t *);
107886 extern int xfs_setsize_buftarg(xfs_buftarg_t *, unsigned int, unsigned int);
107887 extern int xfs_flush_buftarg(xfs_buftarg_t *, int);
107888 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/xfs/linux-2.6/xfs_super.c linux-2.6.29-rc3.owrt/fs/xfs/linux-2.6/xfs_super.c
107889 --- linux-2.6.29.owrt/fs/xfs/linux-2.6/xfs_super.c 2009-05-10 22:04:39.000000000 +0200
107890 +++ linux-2.6.29-rc3.owrt/fs/xfs/linux-2.6/xfs_super.c 2009-05-10 23:48:29.000000000 +0200
107891 @@ -734,15 +734,15 @@
107892 {
107893 if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp) {
107894 struct block_device *logdev = mp->m_logdev_targp->bt_bdev;
107895 - xfs_free_buftarg(mp, mp->m_logdev_targp);
107896 + xfs_free_buftarg(mp->m_logdev_targp);
107897 xfs_blkdev_put(logdev);
107898 }
107899 if (mp->m_rtdev_targp) {
107900 struct block_device *rtdev = mp->m_rtdev_targp->bt_bdev;
107901 - xfs_free_buftarg(mp, mp->m_rtdev_targp);
107902 + xfs_free_buftarg(mp->m_rtdev_targp);
107903 xfs_blkdev_put(rtdev);
107904 }
107905 - xfs_free_buftarg(mp, mp->m_ddev_targp);
107906 + xfs_free_buftarg(mp->m_ddev_targp);
107907 }
107908
107909 /*
107910 @@ -811,9 +811,9 @@
107911
107912 out_free_rtdev_targ:
107913 if (mp->m_rtdev_targp)
107914 - xfs_free_buftarg(mp, mp->m_rtdev_targp);
107915 + xfs_free_buftarg(mp->m_rtdev_targp);
107916 out_free_ddev_targ:
107917 - xfs_free_buftarg(mp, mp->m_ddev_targp);
107918 + xfs_free_buftarg(mp->m_ddev_targp);
107919 out_close_rtdev:
107920 if (rtdev)
107921 xfs_blkdev_put(rtdev);
107922 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/xfs/linux-2.6/xfs_sync.c linux-2.6.29-rc3.owrt/fs/xfs/linux-2.6/xfs_sync.c
107923 --- linux-2.6.29.owrt/fs/xfs/linux-2.6/xfs_sync.c 2009-05-10 22:04:39.000000000 +0200
107924 +++ linux-2.6.29-rc3.owrt/fs/xfs/linux-2.6/xfs_sync.c 2009-05-10 23:48:29.000000000 +0200
107925 @@ -371,11 +371,7 @@
107926 /* flush inodes and push all remaining buffers out to disk */
107927 xfs_quiesce_fs(mp);
107928
107929 - /*
107930 - * Just warn here till VFS can correctly support
107931 - * read-only remount without racing.
107932 - */
107933 - WARN_ON(atomic_read(&mp->m_active_trans) != 0);
107934 + ASSERT_ALWAYS(atomic_read(&mp->m_active_trans) == 0);
107935
107936 /* Push the superblock and write an unmount record */
107937 error = xfs_log_sbcount(mp, 1);
107938 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/xfs/xfs_dfrag.c linux-2.6.29-rc3.owrt/fs/xfs/xfs_dfrag.c
107939 --- linux-2.6.29.owrt/fs/xfs/xfs_dfrag.c 2009-05-10 22:04:39.000000000 +0200
107940 +++ linux-2.6.29-rc3.owrt/fs/xfs/xfs_dfrag.c 2009-05-10 23:48:29.000000000 +0200
107941 @@ -55,11 +55,17 @@
107942 struct file *file, *target_file;
107943 int error = 0;
107944
107945 + sxp = kmem_alloc(sizeof(xfs_swapext_t), KM_MAYFAIL);
107946 + if (!sxp) {
107947 + error = XFS_ERROR(ENOMEM);
107948 + goto out;
107949 + }
107950 +
107951 /* Pull information for the target fd */
107952 file = fget((int)sxp->sx_fdtarget);
107953 if (!file) {
107954 error = XFS_ERROR(EINVAL);
107955 - goto out;
107956 + goto out_free_sxp;
107957 }
107958
107959 if (!(file->f_mode & FMODE_WRITE) || (file->f_flags & O_APPEND)) {
107960 @@ -103,6 +109,8 @@
107961 fput(target_file);
107962 out_put_file:
107963 fput(file);
107964 + out_free_sxp:
107965 + kmem_free(sxp);
107966 out:
107967 return error;
107968 }
107969 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/xfs/xfs_iget.c linux-2.6.29-rc3.owrt/fs/xfs/xfs_iget.c
107970 --- linux-2.6.29.owrt/fs/xfs/xfs_iget.c 2009-05-10 22:04:39.000000000 +0200
107971 +++ linux-2.6.29-rc3.owrt/fs/xfs/xfs_iget.c 2009-05-10 23:48:29.000000000 +0200
107972 @@ -246,6 +246,9 @@
107973 goto out_destroy;
107974 }
107975
107976 + if (lock_flags)
107977 + xfs_ilock(ip, lock_flags);
107978 +
107979 /*
107980 * Preload the radix tree so we can insert safely under the
107981 * write spinlock. Note that we cannot sleep inside the preload
107982 @@ -253,16 +256,7 @@
107983 */
107984 if (radix_tree_preload(GFP_KERNEL)) {
107985 error = EAGAIN;
107986 - goto out_destroy;
107987 - }
107988 -
107989 - /*
107990 - * Because the inode hasn't been added to the radix-tree yet it can't
107991 - * be found by another thread, so we can do the non-sleeping lock here.
107992 - */
107993 - if (lock_flags) {
107994 - if (!xfs_ilock_nowait(ip, lock_flags))
107995 - BUG();
107996 + goto out_unlock;
107997 }
107998
107999 mask = ~(((XFS_INODE_CLUSTER_SIZE(mp) >> mp->m_sb.sb_inodelog)) - 1);
108000 @@ -290,6 +284,7 @@
108001 out_preload_end:
108002 write_unlock(&pag->pag_ici_lock);
108003 radix_tree_preload_end();
108004 +out_unlock:
108005 if (lock_flags)
108006 xfs_iunlock(ip, lock_flags);
108007 out_destroy:
108008 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/fs/xfs/xfs_log_recover.c linux-2.6.29-rc3.owrt/fs/xfs/xfs_log_recover.c
108009 --- linux-2.6.29.owrt/fs/xfs/xfs_log_recover.c 2009-05-10 22:04:39.000000000 +0200
108010 +++ linux-2.6.29-rc3.owrt/fs/xfs/xfs_log_recover.c 2009-05-10 23:48:29.000000000 +0200
108011 @@ -70,21 +70,16 @@
108012 xfs_buf_t *
108013 xlog_get_bp(
108014 xlog_t *log,
108015 - int nbblks)
108016 + int num_bblks)
108017 {
108018 - if (nbblks <= 0 || nbblks > log->l_logBBsize) {
108019 - xlog_warn("XFS: Invalid block length (0x%x) given for buffer", nbblks);
108020 - XFS_ERROR_REPORT("xlog_get_bp(1)",
108021 - XFS_ERRLEVEL_HIGH, log->l_mp);
108022 - return NULL;
108023 - }
108024 + ASSERT(num_bblks > 0);
108025
108026 if (log->l_sectbb_log) {
108027 - if (nbblks > 1)
108028 - nbblks += XLOG_SECTOR_ROUNDUP_BBCOUNT(log, 1);
108029 - nbblks = XLOG_SECTOR_ROUNDUP_BBCOUNT(log, nbblks);
108030 + if (num_bblks > 1)
108031 + num_bblks += XLOG_SECTOR_ROUNDUP_BBCOUNT(log, 1);
108032 + num_bblks = XLOG_SECTOR_ROUNDUP_BBCOUNT(log, num_bblks);
108033 }
108034 - return xfs_buf_get_noaddr(BBTOB(nbblks), log->l_mp->m_logdev_targp);
108035 + return xfs_buf_get_noaddr(BBTOB(num_bblks), log->l_mp->m_logdev_targp);
108036 }
108037
108038 void
108039 @@ -107,13 +102,6 @@
108040 {
108041 int error;
108042
108043 - if (nbblks <= 0 || nbblks > log->l_logBBsize) {
108044 - xlog_warn("XFS: Invalid block length (0x%x) given for buffer", nbblks);
108045 - XFS_ERROR_REPORT("xlog_bread(1)",
108046 - XFS_ERRLEVEL_HIGH, log->l_mp);
108047 - return EFSCORRUPTED;
108048 - }
108049 -
108050 if (log->l_sectbb_log) {
108051 blk_no = XLOG_SECTOR_ROUNDDOWN_BLKNO(log, blk_no);
108052 nbblks = XLOG_SECTOR_ROUNDUP_BBCOUNT(log, nbblks);
108053 @@ -151,13 +139,6 @@
108054 {
108055 int error;
108056
108057 - if (nbblks <= 0 || nbblks > log->l_logBBsize) {
108058 - xlog_warn("XFS: Invalid block length (0x%x) given for buffer", nbblks);
108059 - XFS_ERROR_REPORT("xlog_bwrite(1)",
108060 - XFS_ERRLEVEL_HIGH, log->l_mp);
108061 - return EFSCORRUPTED;
108062 - }
108063 -
108064 if (log->l_sectbb_log) {
108065 blk_no = XLOG_SECTOR_ROUNDDOWN_BLKNO(log, blk_no);
108066 nbblks = XLOG_SECTOR_ROUNDUP_BBCOUNT(log, nbblks);
108067 @@ -1455,19 +1436,10 @@
108068 item = item->ri_prev;
108069
108070 if (item->ri_total == 0) { /* first region to be added */
108071 - if (in_f->ilf_size == 0 ||
108072 - in_f->ilf_size > XLOG_MAX_REGIONS_IN_ITEM) {
108073 - xlog_warn(
108074 - "XFS: bad number of regions (%d) in inode log format",
108075 - in_f->ilf_size);
108076 - ASSERT(0);
108077 - return XFS_ERROR(EIO);
108078 - }
108079 -
108080 - item->ri_total = in_f->ilf_size;
108081 - item->ri_buf =
108082 - kmem_zalloc(item->ri_total * sizeof(xfs_log_iovec_t),
108083 - KM_SLEEP);
108084 + item->ri_total = in_f->ilf_size;
108085 + ASSERT(item->ri_total <= XLOG_MAX_REGIONS_IN_ITEM);
108086 + item->ri_buf = kmem_zalloc((item->ri_total *
108087 + sizeof(xfs_log_iovec_t)), KM_SLEEP);
108088 }
108089 ASSERT(item->ri_total > item->ri_cnt);
108090 /* Description region is ri_buf[0] */
108091 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/acpi/pdc_intel.h linux-2.6.29-rc3.owrt/include/acpi/pdc_intel.h
108092 --- linux-2.6.29.owrt/include/acpi/pdc_intel.h 2009-05-10 22:04:37.000000000 +0200
108093 +++ linux-2.6.29-rc3.owrt/include/acpi/pdc_intel.h 2009-05-10 23:48:29.000000000 +0200
108094 @@ -14,7 +14,6 @@
108095 #define ACPI_PDC_SMP_T_SWCOORD (0x0080)
108096 #define ACPI_PDC_C_C1_FFH (0x0100)
108097 #define ACPI_PDC_C_C2C3_FFH (0x0200)
108098 -#define ACPI_PDC_SMP_P_HWCOORD (0x0800)
108099
108100 #define ACPI_PDC_EST_CAPABILITY_SMP (ACPI_PDC_SMP_C1PT | \
108101 ACPI_PDC_C_C1_HALT | \
108102 @@ -23,7 +22,6 @@
108103 #define ACPI_PDC_EST_CAPABILITY_SWSMP (ACPI_PDC_SMP_C1PT | \
108104 ACPI_PDC_C_C1_HALT | \
108105 ACPI_PDC_SMP_P_SWCOORD | \
108106 - ACPI_PDC_SMP_P_HWCOORD | \
108107 ACPI_PDC_P_FFH)
108108
108109 #define ACPI_PDC_C_CAPABILITY_SMP (ACPI_PDC_SMP_C2C3 | \
108110 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/asm-frv/pgtable.h linux-2.6.29-rc3.owrt/include/asm-frv/pgtable.h
108111 --- linux-2.6.29.owrt/include/asm-frv/pgtable.h 2009-05-10 22:04:37.000000000 +0200
108112 +++ linux-2.6.29-rc3.owrt/include/asm-frv/pgtable.h 2009-05-10 23:48:29.000000000 +0200
108113 @@ -478,7 +478,7 @@
108114 #define __swp_type(x) (((x).val >> 2) & 0x1f)
108115 #define __swp_offset(x) ((x).val >> 8)
108116 #define __swp_entry(type, offset) ((swp_entry_t) { ((type) << 2) | ((offset) << 8) })
108117 -#define __pte_to_swp_entry(_pte) ((swp_entry_t) { (_pte).pte })
108118 +#define __pte_to_swp_entry(pte) ((swp_entry_t) { (pte).pte })
108119 #define __swp_entry_to_pte(x) ((pte_t) { (x).val })
108120
108121 static inline int pte_file(pte_t pte)
108122 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/crypto/hash.h linux-2.6.29-rc3.owrt/include/crypto/hash.h
108123 --- linux-2.6.29.owrt/include/crypto/hash.h 2009-05-10 22:04:38.000000000 +0200
108124 +++ linux-2.6.29-rc3.owrt/include/crypto/hash.h 2009-05-10 23:48:29.000000000 +0200
108125 @@ -222,7 +222,7 @@
108126
108127 static inline void crypto_free_shash(struct crypto_shash *tfm)
108128 {
108129 - crypto_destroy_tfm(tfm, crypto_shash_tfm(tfm));
108130 + crypto_free_tfm(crypto_shash_tfm(tfm));
108131 }
108132
108133 static inline unsigned int crypto_shash_alignmask(
108134 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/drm/drm_crtc.h linux-2.6.29-rc3.owrt/include/drm/drm_crtc.h
108135 --- linux-2.6.29.owrt/include/drm/drm_crtc.h 2009-05-10 22:04:38.000000000 +0200
108136 +++ linux-2.6.29-rc3.owrt/include/drm/drm_crtc.h 2009-05-10 23:48:29.000000000 +0200
108137 @@ -609,7 +609,7 @@
108138 extern char *drm_get_dvi_i_select_name(int val);
108139 extern char *drm_get_tv_subconnector_name(int val);
108140 extern char *drm_get_tv_select_name(int val);
108141 -extern void drm_fb_release(struct drm_file *file_priv);
108142 +extern void drm_fb_release(struct file *filp);
108143 extern int drm_mode_group_init_legacy_group(struct drm_device *dev, struct drm_mode_group *group);
108144 extern struct edid *drm_get_edid(struct drm_connector *connector,
108145 struct i2c_adapter *adapter);
108146 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/drm/drm_crtc_helper.h linux-2.6.29-rc3.owrt/include/drm/drm_crtc_helper.h
108147 --- linux-2.6.29.owrt/include/drm/drm_crtc_helper.h 2009-05-10 22:04:38.000000000 +0200
108148 +++ linux-2.6.29-rc3.owrt/include/drm/drm_crtc_helper.h 2009-05-10 23:48:29.000000000 +0200
108149 @@ -54,13 +54,13 @@
108150 struct drm_display_mode *mode,
108151 struct drm_display_mode *adjusted_mode);
108152 /* Actually set the mode */
108153 - int (*mode_set)(struct drm_crtc *crtc, struct drm_display_mode *mode,
108154 - struct drm_display_mode *adjusted_mode, int x, int y,
108155 - struct drm_framebuffer *old_fb);
108156 + void (*mode_set)(struct drm_crtc *crtc, struct drm_display_mode *mode,
108157 + struct drm_display_mode *adjusted_mode, int x, int y,
108158 + struct drm_framebuffer *old_fb);
108159
108160 /* Move the crtc on the current fb to the given position *optional* */
108161 - int (*mode_set_base)(struct drm_crtc *crtc, int x, int y,
108162 - struct drm_framebuffer *old_fb);
108163 + void (*mode_set_base)(struct drm_crtc *crtc, int x, int y,
108164 + struct drm_framebuffer *old_fb);
108165 };
108166
108167 struct drm_encoder_helper_funcs {
108168 @@ -76,7 +76,6 @@
108169 void (*mode_set)(struct drm_encoder *encoder,
108170 struct drm_display_mode *mode,
108171 struct drm_display_mode *adjusted_mode);
108172 - struct drm_crtc *(*get_crtc)(struct drm_encoder *encoder);
108173 /* detect for DAC style encoders */
108174 enum drm_connector_status (*detect)(struct drm_encoder *encoder,
108175 struct drm_connector *connector);
108176 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/drm/drm_edid.h linux-2.6.29-rc3.owrt/include/drm/drm_edid.h
108177 --- linux-2.6.29.owrt/include/drm/drm_edid.h 2009-05-10 22:04:38.000000000 +0200
108178 +++ linux-2.6.29-rc3.owrt/include/drm/drm_edid.h 2009-05-10 23:48:29.000000000 +0200
108179 @@ -58,10 +58,10 @@
108180 u8 hsync_pulse_width_lo;
108181 u8 vsync_pulse_width_lo:4;
108182 u8 vsync_offset_lo:4;
108183 - u8 vsync_pulse_width_hi:2;
108184 - u8 vsync_offset_hi:2;
108185 u8 hsync_pulse_width_hi:2;
108186 u8 hsync_offset_hi:2;
108187 + u8 vsync_pulse_width_hi:2;
108188 + u8 vsync_offset_hi:2;
108189 u8 width_mm_lo;
108190 u8 height_mm_lo;
108191 u8 height_mm_hi:4;
108192 @@ -69,8 +69,8 @@
108193 u8 hborder;
108194 u8 vborder;
108195 u8 unknown0:1;
108196 - u8 hsync_positive:1;
108197 u8 vsync_positive:1;
108198 + u8 hsync_positive:1;
108199 u8 separate_sync:2;
108200 u8 stereo:1;
108201 u8 unknown6:1;
108202 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/drm/drmP.h linux-2.6.29-rc3.owrt/include/drm/drmP.h
108203 --- linux-2.6.29.owrt/include/drm/drmP.h 2009-05-10 22:04:38.000000000 +0200
108204 +++ linux-2.6.29-rc3.owrt/include/drm/drmP.h 2009-05-10 23:48:29.000000000 +0200
108205 @@ -1321,8 +1321,6 @@
108206 struct drm_gem_object *drm_gem_object_alloc(struct drm_device *dev,
108207 size_t size);
108208 void drm_gem_object_handle_free(struct kref *kref);
108209 -void drm_gem_vm_open(struct vm_area_struct *vma);
108210 -void drm_gem_vm_close(struct vm_area_struct *vma);
108211 int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma);
108212
108213 static inline void
108214 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/drm/i915_drm.h linux-2.6.29-rc3.owrt/include/drm/i915_drm.h
108215 --- linux-2.6.29.owrt/include/drm/i915_drm.h 2009-05-10 22:04:38.000000000 +0200
108216 +++ linux-2.6.29-rc3.owrt/include/drm/i915_drm.h 2009-05-10 23:48:29.000000000 +0200
108217 @@ -261,7 +261,6 @@
108218 #define I915_PARAM_LAST_DISPATCH 3
108219 #define I915_PARAM_CHIPSET_ID 4
108220 #define I915_PARAM_HAS_GEM 5
108221 -#define I915_PARAM_NUM_FENCES_AVAIL 6
108222
108223 typedef struct drm_i915_getparam {
108224 int param;
108225 @@ -273,7 +272,6 @@
108226 #define I915_SETPARAM_USE_MI_BATCHBUFFER_START 1
108227 #define I915_SETPARAM_TEX_LRU_LOG_GRANULARITY 2
108228 #define I915_SETPARAM_ALLOW_BATCHBUFFER 3
108229 -#define I915_SETPARAM_NUM_USED_FENCES 4
108230
108231 typedef struct drm_i915_setparam {
108232 int param;
108233 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/aio_abi.h linux-2.6.29-rc3.owrt/include/linux/aio_abi.h
108234 --- linux-2.6.29.owrt/include/linux/aio_abi.h 2009-05-10 22:04:37.000000000 +0200
108235 +++ linux-2.6.29-rc3.owrt/include/linux/aio_abi.h 2009-05-10 23:48:29.000000000 +0200
108236 @@ -27,7 +27,6 @@
108237 #ifndef __LINUX__AIO_ABI_H
108238 #define __LINUX__AIO_ABI_H
108239
108240 -#include <linux/types.h>
108241 #include <asm/byteorder.h>
108242
108243 typedef unsigned long aio_context_t;
108244 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/async.h linux-2.6.29-rc3.owrt/include/linux/async.h
108245 --- linux-2.6.29.owrt/include/linux/async.h 2009-05-10 22:04:37.000000000 +0200
108246 +++ linux-2.6.29-rc3.owrt/include/linux/async.h 2009-05-10 23:48:29.000000000 +0200
108247 @@ -17,11 +17,9 @@
108248 typedef void (async_func_ptr) (void *data, async_cookie_t cookie);
108249
108250 extern async_cookie_t async_schedule(async_func_ptr *ptr, void *data);
108251 -extern async_cookie_t async_schedule_domain(async_func_ptr *ptr, void *data,
108252 - struct list_head *list);
108253 +extern async_cookie_t async_schedule_special(async_func_ptr *ptr, void *data, struct list_head *list);
108254 extern void async_synchronize_full(void);
108255 -extern void async_synchronize_full_domain(struct list_head *list);
108256 +extern void async_synchronize_full_special(struct list_head *list);
108257 extern void async_synchronize_cookie(async_cookie_t cookie);
108258 -extern void async_synchronize_cookie_domain(async_cookie_t cookie,
108259 - struct list_head *list);
108260 +extern void async_synchronize_cookie_special(async_cookie_t cookie, struct list_head *list);
108261
108262 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/ata.h linux-2.6.29-rc3.owrt/include/linux/ata.h
108263 --- linux-2.6.29.owrt/include/linux/ata.h 2009-05-10 22:04:37.000000000 +0200
108264 +++ linux-2.6.29-rc3.owrt/include/linux/ata.h 2009-05-10 23:48:29.000000000 +0200
108265 @@ -89,8 +89,6 @@
108266 ATA_ID_DLF = 128,
108267 ATA_ID_CSFO = 129,
108268 ATA_ID_CFA_POWER = 160,
108269 - ATA_ID_CFA_KEY_MGMT = 162,
108270 - ATA_ID_CFA_MODES = 163,
108271 ATA_ID_ROT_SPEED = 217,
108272 ATA_ID_PIO4 = (1 << 1),
108273
108274 @@ -733,17 +731,12 @@
108275
108276 static inline int ata_id_is_cfa(const u16 *id)
108277 {
108278 - if (id[ATA_ID_CONFIG] == 0x848A) /* Traditional CF */
108279 + if (id[ATA_ID_CONFIG] == 0x848A) /* Standard CF */
108280 return 1;
108281 - /*
108282 - * CF specs don't require specific value in the word 0 anymore and yet
108283 - * they forbid to report the ATA version in the word 80 and require the
108284 - * CFA feature set support to be indicated in the word 83 in this case.
108285 - * Unfortunately, some cards only follow either of this requirements,
108286 - * and while those that don't indicate CFA feature support need some
108287 - * sort of quirk list, it seems impractical for the ones that do...
108288 - */
108289 - if ((id[ATA_ID_COMMAND_SET_2] & 0xC004) == 0x4004)
108290 + /* Could be CF hiding as standard ATA */
108291 + if (ata_id_major_version(id) >= 3 &&
108292 + id[ATA_ID_COMMAND_SET_1] != 0xFFFF &&
108293 + (id[ATA_ID_COMMAND_SET_1] & (1 << 2)))
108294 return 1;
108295 return 0;
108296 }
108297 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/atalk.h linux-2.6.29-rc3.owrt/include/linux/atalk.h
108298 --- linux-2.6.29.owrt/include/linux/atalk.h 2009-05-10 22:04:37.000000000 +0200
108299 +++ linux-2.6.29-rc3.owrt/include/linux/atalk.h 2009-05-10 23:48:29.000000000 +0200
108300 @@ -1,7 +1,6 @@
108301 #ifndef __LINUX_ATALK_H__
108302 #define __LINUX_ATALK_H__
108303
108304 -#include <linux/types.h>
108305 #include <asm/byteorder.h>
108306
108307 /*
108308 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/atmbr2684.h linux-2.6.29-rc3.owrt/include/linux/atmbr2684.h
108309 --- linux-2.6.29.owrt/include/linux/atmbr2684.h 2009-05-10 22:04:37.000000000 +0200
108310 +++ linux-2.6.29-rc3.owrt/include/linux/atmbr2684.h 2009-05-10 23:48:29.000000000 +0200
108311 @@ -1,7 +1,6 @@
108312 #ifndef _LINUX_ATMBR2684_H
108313 #define _LINUX_ATMBR2684_H
108314
108315 -#include <linux/types.h>
108316 #include <linux/atm.h>
108317 #include <linux/if.h> /* For IFNAMSIZ */
108318
108319 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/auto_fs4.h linux-2.6.29-rc3.owrt/include/linux/auto_fs4.h
108320 --- linux-2.6.29.owrt/include/linux/auto_fs4.h 2009-05-10 22:04:37.000000000 +0200
108321 +++ linux-2.6.29-rc3.owrt/include/linux/auto_fs4.h 2009-05-10 23:48:29.000000000 +0200
108322 @@ -12,7 +12,6 @@
108323 #define _LINUX_AUTO_FS4_H
108324
108325 /* Include common v3 definitions */
108326 -#include <linux/types.h>
108327 #include <linux/auto_fs.h>
108328
108329 /* autofs v4 definitions */
108330 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/bfs_fs.h linux-2.6.29-rc3.owrt/include/linux/bfs_fs.h
108331 --- linux-2.6.29.owrt/include/linux/bfs_fs.h 2009-05-10 22:04:37.000000000 +0200
108332 +++ linux-2.6.29-rc3.owrt/include/linux/bfs_fs.h 2009-05-10 23:48:29.000000000 +0200
108333 @@ -6,8 +6,6 @@
108334 #ifndef _LINUX_BFS_FS_H
108335 #define _LINUX_BFS_FS_H
108336
108337 -#include <linux/types.h>
108338 -
108339 #define BFS_BSIZE_BITS 9
108340 #define BFS_BSIZE (1<<BFS_BSIZE_BITS)
108341
108342 @@ -19,6 +17,7 @@
108343 #define BFS_VDIR 2L
108344 #define BFS_VREG 1L
108345
108346 +
108347 /* BFS inode layout on disk */
108348 struct bfs_inode {
108349 __le16 i_ino;
108350 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/bio.h linux-2.6.29-rc3.owrt/include/linux/bio.h
108351 --- linux-2.6.29.owrt/include/linux/bio.h 2009-05-10 22:04:37.000000000 +0200
108352 +++ linux-2.6.29-rc3.owrt/include/linux/bio.h 2009-05-10 23:48:29.000000000 +0200
108353 @@ -144,7 +144,7 @@
108354 * bit 1 -- rw-ahead when set
108355 * bit 2 -- barrier
108356 * Insert a serialization point in the IO queue, forcing previously
108357 - * submitted IO to be completed before this one is issued.
108358 + * submitted IO to be completed before this oen is issued.
108359 * bit 3 -- synchronous I/O hint: the block layer will unplug immediately
108360 * Note that this does NOT indicate that the IO itself is sync, just
108361 * that the block layer will not postpone issue of this IO by plugging.
108362 @@ -163,31 +163,12 @@
108363 #define BIO_RW 0 /* Must match RW in req flags (blkdev.h) */
108364 #define BIO_RW_AHEAD 1 /* Must match FAILFAST in req flags */
108365 #define BIO_RW_BARRIER 2
108366 -#define BIO_RW_SYNCIO 3
108367 -#define BIO_RW_UNPLUG 4
108368 -#define BIO_RW_META 5
108369 -#define BIO_RW_DISCARD 6
108370 -#define BIO_RW_FAILFAST_DEV 7
108371 -#define BIO_RW_FAILFAST_TRANSPORT 8
108372 -#define BIO_RW_FAILFAST_DRIVER 9
108373 -
108374 -#define bio_rw_flagged(bio, flag) ((bio)->bi_rw & (1 << (flag)))
108375 -
108376 -/*
108377 - * Old defines, these should eventually be replaced by direct usage of
108378 - * bio_rw_flagged()
108379 - */
108380 -#define bio_barrier(bio) bio_rw_flagged(bio, BIO_RW_BARRIER)
108381 -#define bio_sync(bio) bio_rw_flagged(bio, BIO_RW_SYNCIO)
108382 -#define bio_unplug(bio) bio_rw_flagged(bio, BIO_RW_UNPLUG)
108383 -#define bio_failfast_dev(bio) bio_rw_flagged(bio, BIO_RW_FAILFAST_DEV)
108384 -#define bio_failfast_transport(bio) \
108385 - bio_rw_flagged(bio, BIO_RW_FAILFAST_TRANSPORT)
108386 -#define bio_failfast_driver(bio) \
108387 - bio_rw_flagged(bio, BIO_RW_FAILFAST_DRIVER)
108388 -#define bio_rw_ahead(bio) bio_rw_flagged(bio, BIO_RW_AHEAD)
108389 -#define bio_rw_meta(bio) bio_rw_flagged(bio, BIO_RW_META)
108390 -#define bio_discard(bio) bio_rw_flagged(bio, BIO_RW_DISCARD)
108391 +#define BIO_RW_SYNC 3
108392 +#define BIO_RW_META 4
108393 +#define BIO_RW_DISCARD 5
108394 +#define BIO_RW_FAILFAST_DEV 6
108395 +#define BIO_RW_FAILFAST_TRANSPORT 7
108396 +#define BIO_RW_FAILFAST_DRIVER 8
108397
108398 /*
108399 * upper 16 bits of bi_rw define the io priority of this bio
108400 @@ -212,6 +193,15 @@
108401 #define bio_offset(bio) bio_iovec((bio))->bv_offset
108402 #define bio_segments(bio) ((bio)->bi_vcnt - (bio)->bi_idx)
108403 #define bio_sectors(bio) ((bio)->bi_size >> 9)
108404 +#define bio_barrier(bio) ((bio)->bi_rw & (1 << BIO_RW_BARRIER))
108405 +#define bio_sync(bio) ((bio)->bi_rw & (1 << BIO_RW_SYNC))
108406 +#define bio_failfast_dev(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST_DEV))
108407 +#define bio_failfast_transport(bio) \
108408 + ((bio)->bi_rw & (1 << BIO_RW_FAILFAST_TRANSPORT))
108409 +#define bio_failfast_driver(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST_DRIVER))
108410 +#define bio_rw_ahead(bio) ((bio)->bi_rw & (1 << BIO_RW_AHEAD))
108411 +#define bio_rw_meta(bio) ((bio)->bi_rw & (1 << BIO_RW_META))
108412 +#define bio_discard(bio) ((bio)->bi_rw & (1 << BIO_RW_DISCARD))
108413 #define bio_empty_barrier(bio) (bio_barrier(bio) && !bio_has_data(bio) && !bio_discard(bio))
108414
108415 static inline unsigned int bio_cur_sectors(struct bio *bio)
108416 @@ -322,6 +312,7 @@
108417 void *bip_buf; /* generated integrity data */
108418 bio_end_io_t *bip_end_io; /* saved I/O completion fn */
108419
108420 + int bip_error; /* saved I/O error */
108421 unsigned int bip_size;
108422
108423 unsigned short bip_pool; /* pool the ivec came from */
108424 @@ -449,13 +440,12 @@
108425
108426 #ifdef CONFIG_HIGHMEM
108427 /*
108428 - * remember never ever reenable interrupts between a bvec_kmap_irq and
108429 - * bvec_kunmap_irq!
108430 + * remember to add offset! and never ever reenable interrupts between a
108431 + * bvec_kmap_irq and bvec_kunmap_irq!!
108432 *
108433 * This function MUST be inlined - it plays with the CPU interrupt flags.
108434 */
108435 -static __always_inline char *bvec_kmap_irq(struct bio_vec *bvec,
108436 - unsigned long *flags)
108437 +static inline char *bvec_kmap_irq(struct bio_vec *bvec, unsigned long *flags)
108438 {
108439 unsigned long addr;
108440
108441 @@ -471,8 +461,7 @@
108442 return (char *) addr + bvec->bv_offset;
108443 }
108444
108445 -static __always_inline void bvec_kunmap_irq(char *buffer,
108446 - unsigned long *flags)
108447 +static inline void bvec_kunmap_irq(char *buffer, unsigned long *flags)
108448 {
108449 unsigned long ptr = (unsigned long) buffer & PAGE_MASK;
108450
108451 @@ -531,7 +520,7 @@
108452 extern void bio_integrity_advance(struct bio *, unsigned int);
108453 extern void bio_integrity_trim(struct bio *, unsigned int, unsigned int);
108454 extern void bio_integrity_split(struct bio *, struct bio_pair *, int);
108455 -extern int bio_integrity_clone(struct bio *, struct bio *, gfp_t, struct bio_set *);
108456 +extern int bio_integrity_clone(struct bio *, struct bio *, struct bio_set *);
108457 extern int bioset_integrity_create(struct bio_set *, int);
108458 extern void bioset_integrity_free(struct bio_set *);
108459 extern void bio_integrity_init_slab(void);
108460 @@ -542,7 +531,7 @@
108461 #define bioset_integrity_create(a, b) (0)
108462 #define bio_integrity_prep(a) (0)
108463 #define bio_integrity_enabled(a) (0)
108464 -#define bio_integrity_clone(a, b, c,d ) (0)
108465 +#define bio_integrity_clone(a, b, c) (0)
108466 #define bioset_integrity_free(a) do { } while (0)
108467 #define bio_integrity_free(a, b) do { } while (0)
108468 #define bio_integrity_endio(a, b) do { } while (0)
108469 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/blkdev.h linux-2.6.29-rc3.owrt/include/linux/blkdev.h
108470 --- linux-2.6.29.owrt/include/linux/blkdev.h 2009-05-10 22:04:37.000000000 +0200
108471 +++ linux-2.6.29-rc3.owrt/include/linux/blkdev.h 2009-05-10 23:48:29.000000000 +0200
108472 @@ -108,7 +108,6 @@
108473 __REQ_RW_META, /* metadata io request */
108474 __REQ_COPY_USER, /* contains copies of user pages */
108475 __REQ_INTEGRITY, /* integrity metadata has been remapped */
108476 - __REQ_UNPLUG, /* unplug queue on submission */
108477 __REQ_NR_BITS, /* stops here */
108478 };
108479
108480 @@ -135,7 +134,6 @@
108481 #define REQ_RW_META (1 << __REQ_RW_META)
108482 #define REQ_COPY_USER (1 << __REQ_COPY_USER)
108483 #define REQ_INTEGRITY (1 << __REQ_INTEGRITY)
108484 -#define REQ_UNPLUG (1 << __REQ_UNPLUG)
108485
108486 #define BLK_MAX_CDB 16
108487
108488 @@ -451,11 +449,6 @@
108489 #define QUEUE_FLAG_STACKABLE 13 /* supports request stacking */
108490 #define QUEUE_FLAG_NONROT 14 /* non-rotational device (SSD) */
108491 #define QUEUE_FLAG_VIRT QUEUE_FLAG_NONROT /* paravirt device */
108492 -#define QUEUE_FLAG_IO_STAT 15 /* do IO stats */
108493 -
108494 -#define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \
108495 - (1 << QUEUE_FLAG_CLUSTER) | \
108496 - (1 << QUEUE_FLAG_STACKABLE))
108497
108498 static inline int queue_is_locked(struct request_queue *q)
108499 {
108500 @@ -572,7 +565,6 @@
108501 #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags)
108502 #define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags)
108503 #define blk_queue_nonrot(q) test_bit(QUEUE_FLAG_NONROT, &(q)->queue_flags)
108504 -#define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags)
108505 #define blk_queue_flushing(q) ((q)->ordseq)
108506 #define blk_queue_stackable(q) \
108507 test_bit(QUEUE_FLAG_STACKABLE, &(q)->queue_flags)
108508 @@ -708,8 +700,6 @@
108509 };
108510
108511 /* This should not be used directly - use rq_for_each_segment */
108512 -#define for_each_bio(_bio) \
108513 - for (; _bio; _bio = _bio->bi_next)
108514 #define __rq_for_each_bio(_bio, rq) \
108515 if ((rq->bio)) \
108516 for (_bio = (rq)->bio; _bio; _bio = _bio->bi_next)
108517 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/blktrace_api.h linux-2.6.29-rc3.owrt/include/linux/blktrace_api.h
108518 --- linux-2.6.29.owrt/include/linux/blktrace_api.h 2009-05-10 22:04:37.000000000 +0200
108519 +++ linux-2.6.29-rc3.owrt/include/linux/blktrace_api.h 2009-05-10 23:48:29.000000000 +0200
108520 @@ -1,7 +1,6 @@
108521 #ifndef BLKTRACE_H
108522 #define BLKTRACE_H
108523
108524 -#include <linux/types.h>
108525 #ifdef __KERNEL__
108526 #include <linux/blkdev.h>
108527 #include <linux/relay.h>
108528 @@ -15,7 +14,6 @@
108529 BLK_TC_WRITE = 1 << 1, /* writes */
108530 BLK_TC_BARRIER = 1 << 2, /* barrier */
108531 BLK_TC_SYNC = 1 << 3, /* sync IO */
108532 - BLK_TC_SYNCIO = BLK_TC_SYNC,
108533 BLK_TC_QUEUE = 1 << 4, /* queueing/merging */
108534 BLK_TC_REQUEUE = 1 << 5, /* requeueing */
108535 BLK_TC_ISSUE = 1 << 6, /* issue */
108536 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/can/bcm.h linux-2.6.29-rc3.owrt/include/linux/can/bcm.h
108537 --- linux-2.6.29.owrt/include/linux/can/bcm.h 2009-05-10 22:04:37.000000000 +0200
108538 +++ linux-2.6.29-rc3.owrt/include/linux/can/bcm.h 2009-05-10 23:48:29.000000000 +0200
108539 @@ -14,8 +14,6 @@
108540 #ifndef CAN_BCM_H
108541 #define CAN_BCM_H
108542
108543 -#include <linux/types.h>
108544 -
108545 /**
108546 * struct bcm_msg_head - head of messages to/from the broadcast manager
108547 * @opcode: opcode, see enum below.
108548 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/capability.h linux-2.6.29-rc3.owrt/include/linux/capability.h
108549 --- linux-2.6.29.owrt/include/linux/capability.h 2009-05-10 22:04:37.000000000 +0200
108550 +++ linux-2.6.29-rc3.owrt/include/linux/capability.h 2009-05-10 23:48:29.000000000 +0200
108551 @@ -69,6 +69,10 @@
108552 #define VFS_CAP_U32 VFS_CAP_U32_2
108553 #define VFS_CAP_REVISION VFS_CAP_REVISION_2
108554
108555 +#ifdef CONFIG_SECURITY_FILE_CAPABILITIES
108556 +extern int file_caps_enabled;
108557 +#endif
108558 +
108559 struct vfs_cap_data {
108560 __le32 magic_etc; /* Little endian */
108561 struct {
108562 @@ -92,10 +96,6 @@
108563 #define _KERNEL_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_3
108564 #define _KERNEL_CAPABILITY_U32S _LINUX_CAPABILITY_U32S_3
108565
108566 -#ifdef CONFIG_SECURITY_FILE_CAPABILITIES
108567 -extern int file_caps_enabled;
108568 -#endif
108569 -
108570 typedef struct kernel_cap_struct {
108571 __u32 cap[_KERNEL_CAPABILITY_U32S];
108572 } kernel_cap_t;
108573 @@ -393,10 +393,8 @@
108574 # define CAP_FULL_SET ((kernel_cap_t){{ ~0, ~0 }})
108575 # define CAP_INIT_EFF_SET ((kernel_cap_t){{ ~CAP_TO_MASK(CAP_SETPCAP), ~0 }})
108576 # define CAP_FS_SET ((kernel_cap_t){{ CAP_FS_MASK_B0, CAP_FS_MASK_B1 } })
108577 -# define CAP_NFSD_SET ((kernel_cap_t){{ CAP_FS_MASK_B0 \
108578 - | CAP_TO_MASK(CAP_SYS_RESOURCE) \
108579 - | CAP_TO_MASK(CAP_MKNOD), \
108580 - CAP_FS_MASK_B1 } })
108581 +# define CAP_NFSD_SET ((kernel_cap_t){{ CAP_FS_MASK_B0|CAP_TO_MASK(CAP_SYS_RESOURCE), \
108582 + CAP_FS_MASK_B1 } })
108583
108584 #endif /* _KERNEL_CAPABILITY_U32S != 2 */
108585
108586 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/cdrom.h linux-2.6.29-rc3.owrt/include/linux/cdrom.h
108587 --- linux-2.6.29.owrt/include/linux/cdrom.h 2009-05-10 22:04:37.000000000 +0200
108588 +++ linux-2.6.29-rc3.owrt/include/linux/cdrom.h 2009-05-10 23:48:29.000000000 +0200
108589 @@ -11,7 +11,6 @@
108590 #ifndef _LINUX_CDROM_H
108591 #define _LINUX_CDROM_H
108592
108593 -#include <linux/types.h>
108594 #include <asm/byteorder.h>
108595
108596 /*******************************************************
108597 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/cgroup.h linux-2.6.29-rc3.owrt/include/linux/cgroup.h
108598 --- linux-2.6.29.owrt/include/linux/cgroup.h 2009-05-10 22:04:37.000000000 +0200
108599 +++ linux-2.6.29-rc3.owrt/include/linux/cgroup.h 2009-05-10 23:48:29.000000000 +0200
108600 @@ -99,7 +99,6 @@
108601 while (!atomic_inc_not_zero(&css->refcnt)) {
108602 if (test_bit(CSS_REMOVED, &css->flags))
108603 return false;
108604 - cpu_relax();
108605 }
108606 return true;
108607 }
108608 @@ -378,7 +377,6 @@
108609 * - initiating hotplug events
108610 */
108611 struct mutex hierarchy_mutex;
108612 - struct lock_class_key subsys_key;
108613
108614 /*
108615 * Link to parent, and list entry in parent's children.
108616 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/cgroupstats.h linux-2.6.29-rc3.owrt/include/linux/cgroupstats.h
108617 --- linux-2.6.29.owrt/include/linux/cgroupstats.h 2009-05-10 22:04:37.000000000 +0200
108618 +++ linux-2.6.29-rc3.owrt/include/linux/cgroupstats.h 2009-05-10 23:48:29.000000000 +0200
108619 @@ -15,7 +15,6 @@
108620 #ifndef _LINUX_CGROUPSTATS_H
108621 #define _LINUX_CGROUPSTATS_H
108622
108623 -#include <linux/types.h>
108624 #include <linux/taskstats.h>
108625
108626 /*
108627 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/clockchips.h linux-2.6.29-rc3.owrt/include/linux/clockchips.h
108628 --- linux-2.6.29.owrt/include/linux/clockchips.h 2009-05-10 22:04:37.000000000 +0200
108629 +++ linux-2.6.29-rc3.owrt/include/linux/clockchips.h 2009-05-10 23:48:29.000000000 +0200
108630 @@ -36,7 +36,6 @@
108631 CLOCK_EVT_NOTIFY_BROADCAST_EXIT,
108632 CLOCK_EVT_NOTIFY_SUSPEND,
108633 CLOCK_EVT_NOTIFY_RESUME,
108634 - CLOCK_EVT_NOTIFY_CPU_DYING,
108635 CLOCK_EVT_NOTIFY_CPU_DEAD,
108636 };
108637
108638 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/compiler-gcc.h linux-2.6.29-rc3.owrt/include/linux/compiler-gcc.h
108639 --- linux-2.6.29.owrt/include/linux/compiler-gcc.h 2009-05-10 22:04:37.000000000 +0200
108640 +++ linux-2.6.29-rc3.owrt/include/linux/compiler-gcc.h 2009-05-10 23:48:29.000000000 +0200
108641 @@ -52,15 +52,7 @@
108642 #define __deprecated __attribute__((deprecated))
108643 #define __packed __attribute__((packed))
108644 #define __weak __attribute__((weak))
108645 -
108646 -/*
108647 - * it doesn't make sense on ARM (currently the only user of __naked) to trace
108648 - * naked functions because then mcount is called without stack and frame pointer
108649 - * being set up and there is no chance to restore the lr register to the value
108650 - * before mcount was called.
108651 - */
108652 -#define __naked __attribute__((naked)) notrace
108653 -
108654 +#define __naked __attribute__((naked))
108655 #define __noreturn __attribute__((noreturn))
108656
108657 /*
108658 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/cpufreq.h linux-2.6.29-rc3.owrt/include/linux/cpufreq.h
108659 --- linux-2.6.29.owrt/include/linux/cpufreq.h 2009-05-10 22:04:37.000000000 +0200
108660 +++ linux-2.6.29-rc3.owrt/include/linux/cpufreq.h 2009-05-10 23:48:29.000000000 +0200
108661 @@ -234,6 +234,7 @@
108662 int (*suspend) (struct cpufreq_policy *policy, pm_message_t pmsg);
108663 int (*resume) (struct cpufreq_policy *policy);
108664 struct freq_attr **attr;
108665 + bool hide_interface;
108666 };
108667
108668 /* flags */
108669 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/crypto.h linux-2.6.29-rc3.owrt/include/linux/crypto.h
108670 --- linux-2.6.29.owrt/include/linux/crypto.h 2009-05-10 22:04:37.000000000 +0200
108671 +++ linux-2.6.29-rc3.owrt/include/linux/crypto.h 2009-05-10 23:48:29.000000000 +0200
108672 @@ -552,12 +552,7 @@
108673 const struct crypto_type *frontend,
108674 u32 type, u32 mask);
108675 struct crypto_tfm *crypto_alloc_base(const char *alg_name, u32 type, u32 mask);
108676 -void crypto_destroy_tfm(void *mem, struct crypto_tfm *tfm);
108677 -
108678 -static inline void crypto_free_tfm(struct crypto_tfm *tfm)
108679 -{
108680 - return crypto_destroy_tfm(tfm, tfm);
108681 -}
108682 +void crypto_free_tfm(struct crypto_tfm *tfm);
108683
108684 int alg_test(const char *driver, const char *alg, u32 type, u32 mask);
108685
108686 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/dca.h linux-2.6.29-rc3.owrt/include/linux/dca.h
108687 --- linux-2.6.29.owrt/include/linux/dca.h 2009-05-10 22:04:37.000000000 +0200
108688 +++ linux-2.6.29-rc3.owrt/include/linux/dca.h 2009-05-10 23:48:29.000000000 +0200
108689 @@ -1,23 +1,3 @@
108690 -/*
108691 - * Copyright(c) 2007 - 2009 Intel Corporation. All rights reserved.
108692 - *
108693 - * This program is free software; you can redistribute it and/or modify it
108694 - * under the terms of the GNU General Public License as published by the Free
108695 - * Software Foundation; either version 2 of the License, or (at your option)
108696 - * any later version.
108697 - *
108698 - * This program is distributed in the hope that it will be useful, but WITHOUT
108699 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
108700 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
108701 - * more details.
108702 - *
108703 - * You should have received a copy of the GNU General Public License along with
108704 - * this program; if not, write to the Free Software Foundation, Inc., 59
108705 - * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
108706 - *
108707 - * The full GNU General Public License is included in this distribution in the
108708 - * file called COPYING.
108709 - */
108710 #ifndef DCA_H
108711 #define DCA_H
108712 /* DCA Provider API */
108713 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/dcbnl.h linux-2.6.29-rc3.owrt/include/linux/dcbnl.h
108714 --- linux-2.6.29.owrt/include/linux/dcbnl.h 2009-05-10 22:04:37.000000000 +0200
108715 +++ linux-2.6.29-rc3.owrt/include/linux/dcbnl.h 2009-05-10 23:48:29.000000000 +0200
108716 @@ -20,12 +20,10 @@
108717 #ifndef __LINUX_DCBNL_H__
108718 #define __LINUX_DCBNL_H__
108719
108720 -#include <linux/types.h>
108721 -
108722 #define DCB_PROTO_VERSION 1
108723
108724 struct dcbmsg {
108725 - __u8 dcb_family;
108726 + unsigned char dcb_family;
108727 __u8 cmd;
108728 __u16 dcb_pad;
108729 };
108730 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/device.h linux-2.6.29-rc3.owrt/include/linux/device.h
108731 --- linux-2.6.29.owrt/include/linux/device.h 2009-05-10 22:04:37.000000000 +0200
108732 +++ linux-2.6.29-rc3.owrt/include/linux/device.h 2009-05-10 23:48:29.000000000 +0200
108733 @@ -147,8 +147,6 @@
108734 extern struct device_driver *driver_find(const char *name,
108735 struct bus_type *bus);
108736 extern int driver_probe_done(void);
108737 -extern int wait_for_device_probe(void);
108738 -
108739
108740 /* sysfs interface for exporting driver attributes */
108741
108742 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/dlm_plock.h linux-2.6.29-rc3.owrt/include/linux/dlm_plock.h
108743 --- linux-2.6.29.owrt/include/linux/dlm_plock.h 2009-05-10 22:04:37.000000000 +0200
108744 +++ linux-2.6.29-rc3.owrt/include/linux/dlm_plock.h 2009-05-10 23:48:29.000000000 +0200
108745 @@ -9,8 +9,6 @@
108746 #ifndef __DLM_PLOCK_DOT_H__
108747 #define __DLM_PLOCK_DOT_H__
108748
108749 -#include <linux/types.h>
108750 -
108751 #define DLM_PLOCK_MISC_NAME "dlm_plock"
108752
108753 #define DLM_PLOCK_VERSION_MAJOR 1
108754 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/dmaengine.h linux-2.6.29-rc3.owrt/include/linux/dmaengine.h
108755 --- linux-2.6.29.owrt/include/linux/dmaengine.h 2009-05-10 22:04:37.000000000 +0200
108756 +++ linux-2.6.29-rc3.owrt/include/linux/dmaengine.h 2009-05-10 23:48:29.000000000 +0200
108757 @@ -97,6 +97,7 @@
108758
108759 /**
108760 * struct dma_chan_percpu - the per-CPU part of struct dma_chan
108761 + * @refcount: local_t used for open-coded "bigref" counting
108762 * @memcpy_count: transaction counter
108763 * @bytes_transferred: byte counter
108764 */
108765 @@ -113,11 +114,13 @@
108766 * @cookie: last cookie value returned to client
108767 * @chan_id: channel ID for sysfs
108768 * @dev: class device for sysfs
108769 + * @refcount: kref, used in "bigref" slow-mode
108770 + * @slow_ref: indicates that the DMA channel is free
108771 + * @rcu: the DMA channel's RCU head
108772 * @device_node: used to add this to the device chan list
108773 * @local: per-cpu pointer to a struct dma_chan_percpu
108774 * @client-count: how many clients are using this channel
108775 * @table_count: number of appearances in the mem-to-mem allocation table
108776 - * @private: private data for certain client-channel associations
108777 */
108778 struct dma_chan {
108779 struct dma_device *device;
108780 @@ -131,7 +134,6 @@
108781 struct dma_chan_percpu *local;
108782 int client_count;
108783 int table_count;
108784 - void *private;
108785 };
108786
108787 /**
108788 @@ -209,6 +211,8 @@
108789 * @global_node: list_head for global dma_device_list
108790 * @cap_mask: one or more dma_capability flags
108791 * @max_xor: maximum number of xor sources, 0 if no capability
108792 + * @refcount: reference count
108793 + * @done: IO completion struct
108794 * @dev_id: unique device ID
108795 * @dev: struct device reference for dma mapping api
108796 * @device_alloc_chan_resources: allocate resources and return the
108797 @@ -221,7 +225,6 @@
108798 * @device_prep_dma_interrupt: prepares an end of chain interrupt operation
108799 * @device_prep_slave_sg: prepares a slave dma operation
108800 * @device_terminate_all: terminate all pending operations
108801 - * @device_is_tx_complete: poll for transaction completion
108802 * @device_issue_pending: push pending transactions to hardware
108803 */
108804 struct dma_device {
108805 @@ -279,18 +282,6 @@
108806 }
108807 #endif
108808
108809 -#ifdef CONFIG_NET_DMA
108810 -#define net_dmaengine_get() dmaengine_get()
108811 -#define net_dmaengine_put() dmaengine_put()
108812 -#else
108813 -static inline void net_dmaengine_get(void)
108814 -{
108815 -}
108816 -static inline void net_dmaengine_put(void)
108817 -{
108818 -}
108819 -#endif
108820 -
108821 dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan,
108822 void *dest, void *src, size_t len);
108823 dma_cookie_t dma_async_memcpy_buf_to_pg(struct dma_chan *chan,
108824 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/dn.h linux-2.6.29-rc3.owrt/include/linux/dn.h
108825 --- linux-2.6.29.owrt/include/linux/dn.h 2009-05-10 22:04:37.000000000 +0200
108826 +++ linux-2.6.29-rc3.owrt/include/linux/dn.h 2009-05-10 23:48:29.000000000 +0200
108827 @@ -1,8 +1,6 @@
108828 #ifndef _LINUX_DN_H
108829 #define _LINUX_DN_H
108830
108831 -#include <linux/types.h>
108832 -
108833 /*
108834
108835 DECnet Data Structures and Constants
108836 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/dvb/audio.h linux-2.6.29-rc3.owrt/include/linux/dvb/audio.h
108837 --- linux-2.6.29.owrt/include/linux/dvb/audio.h 2009-05-10 22:04:37.000000000 +0200
108838 +++ linux-2.6.29-rc3.owrt/include/linux/dvb/audio.h 2009-05-10 23:48:29.000000000 +0200
108839 @@ -24,7 +24,12 @@
108840 #ifndef _DVBAUDIO_H_
108841 #define _DVBAUDIO_H_
108842
108843 +#ifdef __KERNEL__
108844 #include <linux/types.h>
108845 +#else
108846 +#include <stdint.h>
108847 +#endif
108848 +
108849
108850 typedef enum {
108851 AUDIO_SOURCE_DEMUX, /* Select the demux as the main source */
108852 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/dvb/dmx.h linux-2.6.29-rc3.owrt/include/linux/dvb/dmx.h
108853 --- linux-2.6.29.owrt/include/linux/dvb/dmx.h 2009-05-10 22:04:37.000000000 +0200
108854 +++ linux-2.6.29-rc3.owrt/include/linux/dvb/dmx.h 2009-05-10 23:48:29.000000000 +0200
108855 @@ -24,7 +24,7 @@
108856 #ifndef _DVBDMX_H_
108857 #define _DVBDMX_H_
108858
108859 -#include <linux/types.h>
108860 +#include <asm/types.h>
108861 #ifdef __KERNEL__
108862 #include <linux/time.h>
108863 #else
108864 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/dvb/frontend.h linux-2.6.29-rc3.owrt/include/linux/dvb/frontend.h
108865 --- linux-2.6.29.owrt/include/linux/dvb/frontend.h 2009-05-10 22:04:37.000000000 +0200
108866 +++ linux-2.6.29-rc3.owrt/include/linux/dvb/frontend.h 2009-05-10 23:48:29.000000000 +0200
108867 @@ -26,7 +26,8 @@
108868 #ifndef _DVBFRONTEND_H_
108869 #define _DVBFRONTEND_H_
108870
108871 -#include <linux/types.h>
108872 +#include <asm/types.h>
108873 +
108874
108875 typedef enum fe_type {
108876 FE_QPSK,
108877 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/dvb/net.h linux-2.6.29-rc3.owrt/include/linux/dvb/net.h
108878 --- linux-2.6.29.owrt/include/linux/dvb/net.h 2009-05-10 22:04:37.000000000 +0200
108879 +++ linux-2.6.29-rc3.owrt/include/linux/dvb/net.h 2009-05-10 23:48:29.000000000 +0200
108880 @@ -24,7 +24,8 @@
108881 #ifndef _DVBNET_H_
108882 #define _DVBNET_H_
108883
108884 -#include <linux/types.h>
108885 +#include <asm/types.h>
108886 +
108887
108888 struct dvb_net_if {
108889 __u16 pid;
108890 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/dvb/video.h linux-2.6.29-rc3.owrt/include/linux/dvb/video.h
108891 --- linux-2.6.29.owrt/include/linux/dvb/video.h 2009-05-10 22:04:37.000000000 +0200
108892 +++ linux-2.6.29-rc3.owrt/include/linux/dvb/video.h 2009-05-10 23:48:29.000000000 +0200
108893 @@ -24,14 +24,17 @@
108894 #ifndef _DVBVIDEO_H_
108895 #define _DVBVIDEO_H_
108896
108897 -#include <linux/types.h>
108898 -#ifdef __KERNEL__
108899 #include <linux/compiler.h>
108900 +
108901 +#ifdef __KERNEL__
108902 +#include <linux/types.h>
108903 #else
108904 +#include <asm/types.h>
108905 #include <stdint.h>
108906 #include <time.h>
108907 #endif
108908
108909 +
108910 typedef enum {
108911 VIDEO_FORMAT_4_3, /* Select 4:3 format */
108912 VIDEO_FORMAT_16_9, /* Select 16:9 format. */
108913 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/edd.h linux-2.6.29-rc3.owrt/include/linux/edd.h
108914 --- linux-2.6.29.owrt/include/linux/edd.h 2009-05-10 22:04:37.000000000 +0200
108915 +++ linux-2.6.29-rc3.owrt/include/linux/edd.h 2009-05-10 23:48:29.000000000 +0200
108916 @@ -30,8 +30,6 @@
108917 #ifndef _LINUX_EDD_H
108918 #define _LINUX_EDD_H
108919
108920 -#include <linux/types.h>
108921 -
108922 #define EDDNR 0x1e9 /* addr of number of edd_info structs at EDDBUF
108923 in boot_params - treat this as 1 byte */
108924 #define EDDBUF 0xd00 /* addr of edd_info structs in boot_params */
108925 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/efs_fs_sb.h linux-2.6.29-rc3.owrt/include/linux/efs_fs_sb.h
108926 --- linux-2.6.29.owrt/include/linux/efs_fs_sb.h 2009-05-10 22:04:37.000000000 +0200
108927 +++ linux-2.6.29-rc3.owrt/include/linux/efs_fs_sb.h 2009-05-10 23:48:29.000000000 +0200
108928 @@ -9,7 +9,6 @@
108929 #ifndef __EFS_FS_SB_H__
108930 #define __EFS_FS_SB_H__
108931
108932 -#include <linux/types.h>
108933 #include <linux/magic.h>
108934
108935 /* EFS superblock magic numbers */
108936 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/elf-fdpic.h linux-2.6.29-rc3.owrt/include/linux/elf-fdpic.h
108937 --- linux-2.6.29.owrt/include/linux/elf-fdpic.h 2009-05-10 22:04:37.000000000 +0200
108938 +++ linux-2.6.29-rc3.owrt/include/linux/elf-fdpic.h 2009-05-10 23:48:29.000000000 +0200
108939 @@ -58,13 +58,11 @@
108940 #define ELF_FDPIC_FLAG_PRESENT 0x80000000 /* T if this object is present */
108941 };
108942
108943 -#ifdef __KERNEL__
108944 #ifdef CONFIG_MMU
108945 extern void elf_fdpic_arch_lay_out_mm(struct elf_fdpic_params *exec_params,
108946 struct elf_fdpic_params *interp_params,
108947 unsigned long *start_stack,
108948 unsigned long *start_brk);
108949 #endif
108950 -#endif /* __KERNEL__ */
108951
108952 #endif /* _LINUX_ELF_FDPIC_H */
108953 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/elf.h linux-2.6.29-rc3.owrt/include/linux/elf.h
108954 --- linux-2.6.29.owrt/include/linux/elf.h 2009-05-10 22:04:37.000000000 +0200
108955 +++ linux-2.6.29-rc3.owrt/include/linux/elf.h 2009-05-10 23:48:29.000000000 +0200
108956 @@ -377,7 +377,6 @@
108957 Elf64_Word n_type; /* Content type */
108958 } Elf64_Nhdr;
108959
108960 -#ifdef __KERNEL__
108961 #if ELF_CLASS == ELFCLASS32
108962
108963 extern Elf32_Dyn _DYNAMIC [];
108964 @@ -405,5 +404,5 @@
108965 extern int elf_coredump_extra_notes_size(void);
108966 extern int elf_coredump_extra_notes_write(struct file *file, loff_t *foffset);
108967 #endif
108968 -#endif /* __KERNEL__ */
108969 +
108970 #endif /* _LINUX_ELF_H */
108971 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/errqueue.h linux-2.6.29-rc3.owrt/include/linux/errqueue.h
108972 --- linux-2.6.29.owrt/include/linux/errqueue.h 2009-05-10 22:04:37.000000000 +0200
108973 +++ linux-2.6.29-rc3.owrt/include/linux/errqueue.h 2009-05-10 23:48:29.000000000 +0200
108974 @@ -1,8 +1,6 @@
108975 #ifndef _LINUX_ERRQUEUE_H
108976 #define _LINUX_ERRQUEUE_H 1
108977
108978 -#include <linux/types.h>
108979 -
108980 struct sock_extended_err
108981 {
108982 __u32 ee_errno;
108983 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/fb.h linux-2.6.29-rc3.owrt/include/linux/fb.h
108984 --- linux-2.6.29.owrt/include/linux/fb.h 2009-05-10 22:04:37.000000000 +0200
108985 +++ linux-2.6.29-rc3.owrt/include/linux/fb.h 2009-05-10 23:48:29.000000000 +0200
108986 @@ -960,21 +960,6 @@
108987 extern int num_registered_fb;
108988 extern struct class *fb_class;
108989
108990 -static inline int lock_fb_info(struct fb_info *info)
108991 -{
108992 - mutex_lock(&info->lock);
108993 - if (!info->fbops) {
108994 - mutex_unlock(&info->lock);
108995 - return 0;
108996 - }
108997 - return 1;
108998 -}
108999 -
109000 -static inline void unlock_fb_info(struct fb_info *info)
109001 -{
109002 - mutex_unlock(&info->lock);
109003 -}
109004 -
109005 static inline void __fb_pad_aligned_buffer(u8 *dst, u32 d_pitch,
109006 u8 *src, u32 s_pitch, u32 height)
109007 {
109008 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/firmware-map.h linux-2.6.29-rc3.owrt/include/linux/firmware-map.h
109009 --- linux-2.6.29.owrt/include/linux/firmware-map.h 2009-05-10 22:04:37.000000000 +0200
109010 +++ linux-2.6.29-rc3.owrt/include/linux/firmware-map.h 2009-05-10 23:48:29.000000000 +0200
109011 @@ -1,7 +1,7 @@
109012 /*
109013 * include/linux/firmware-map.h:
109014 * Copyright (C) 2008 SUSE LINUX Products GmbH
109015 - * by Bernhard Walle <bernhard.walle@gmx.de>
109016 + * by Bernhard Walle <bwalle@suse.de>
109017 *
109018 * This program is free software; you can redistribute it and/or modify
109019 * it under the terms of the GNU General Public License v2.0 as published by
109020 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/fs.h linux-2.6.29-rc3.owrt/include/linux/fs.h
109021 --- linux-2.6.29.owrt/include/linux/fs.h 2009-05-10 22:04:37.000000000 +0200
109022 +++ linux-2.6.29-rc3.owrt/include/linux/fs.h 2009-05-10 23:48:29.000000000 +0200
109023 @@ -54,30 +54,24 @@
109024 #define MAY_ACCESS 16
109025 #define MAY_OPEN 32
109026
109027 -/*
109028 - * flags in file.f_mode. Note that FMODE_READ and FMODE_WRITE must correspond
109029 - * to O_WRONLY and O_RDWR via the strange trick in __dentry_open()
109030 - */
109031 -
109032 /* file is open for reading */
109033 #define FMODE_READ ((__force fmode_t)1)
109034 /* file is open for writing */
109035 #define FMODE_WRITE ((__force fmode_t)2)
109036 /* file is seekable */
109037 #define FMODE_LSEEK ((__force fmode_t)4)
109038 -/* file can be accessed using pread */
109039 +/* file can be accessed using pread/pwrite */
109040 #define FMODE_PREAD ((__force fmode_t)8)
109041 -/* file can be accessed using pwrite */
109042 -#define FMODE_PWRITE ((__force fmode_t)16)
109043 +#define FMODE_PWRITE FMODE_PREAD /* These go hand in hand */
109044 /* File is opened for execution with sys_execve / sys_uselib */
109045 -#define FMODE_EXEC ((__force fmode_t)32)
109046 +#define FMODE_EXEC ((__force fmode_t)16)
109047 /* File is opened with O_NDELAY (only set for block devices) */
109048 -#define FMODE_NDELAY ((__force fmode_t)64)
109049 +#define FMODE_NDELAY ((__force fmode_t)32)
109050 /* File is opened with O_EXCL (only set for block devices) */
109051 -#define FMODE_EXCL ((__force fmode_t)128)
109052 +#define FMODE_EXCL ((__force fmode_t)64)
109053 /* File is opened using open(.., 3, ..) and is writeable only for ioctls
109054 (specialy hack for floppy.c) */
109055 -#define FMODE_WRITE_IOCTL ((__force fmode_t)256)
109056 +#define FMODE_WRITE_IOCTL ((__force fmode_t)128)
109057
109058 /*
109059 * Don't update ctime and mtime.
109060 @@ -93,10 +87,10 @@
109061 #define WRITE 1
109062 #define READA 2 /* read-ahead - don't block if no resources */
109063 #define SWRITE 3 /* for ll_rw_block() - wait for buffer lock */
109064 -#define READ_SYNC (READ | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG))
109065 +#define READ_SYNC (READ | (1 << BIO_RW_SYNC))
109066 #define READ_META (READ | (1 << BIO_RW_META))
109067 -#define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG))
109068 -#define SWRITE_SYNC (SWRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG))
109069 +#define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC))
109070 +#define SWRITE_SYNC (SWRITE | (1 << BIO_RW_SYNC))
109071 #define WRITE_BARRIER (WRITE | (1 << BIO_RW_BARRIER))
109072 #define DISCARD_NOBARRIER (1 << BIO_RW_DISCARD)
109073 #define DISCARD_BARRIER ((1 << BIO_RW_DISCARD) | (1 << BIO_RW_BARRIER))
109074 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/genetlink.h linux-2.6.29-rc3.owrt/include/linux/genetlink.h
109075 --- linux-2.6.29.owrt/include/linux/genetlink.h 2009-05-10 22:04:37.000000000 +0200
109076 +++ linux-2.6.29-rc3.owrt/include/linux/genetlink.h 2009-05-10 23:48:29.000000000 +0200
109077 @@ -1,7 +1,6 @@
109078 #ifndef __LINUX_GENERIC_NETLINK_H
109079 #define __LINUX_GENERIC_NETLINK_H
109080
109081 -#include <linux/types.h>
109082 #include <linux/netlink.h>
109083
109084 #define GENL_NAMSIZ 16 /* length of family name */
109085 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/gfs2_ondisk.h linux-2.6.29-rc3.owrt/include/linux/gfs2_ondisk.h
109086 --- linux-2.6.29.owrt/include/linux/gfs2_ondisk.h 2009-05-10 22:04:37.000000000 +0200
109087 +++ linux-2.6.29-rc3.owrt/include/linux/gfs2_ondisk.h 2009-05-10 23:48:29.000000000 +0200
109088 @@ -10,8 +10,6 @@
109089 #ifndef __GFS2_ONDISK_DOT_H__
109090 #define __GFS2_ONDISK_DOT_H__
109091
109092 -#include <linux/types.h>
109093 -
109094 #define GFS2_MAGIC 0x01161970
109095 #define GFS2_BASIC_BLOCK 512
109096 #define GFS2_BASIC_BLOCK_SHIFT 9
109097 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/hdreg.h linux-2.6.29-rc3.owrt/include/linux/hdreg.h
109098 --- linux-2.6.29.owrt/include/linux/hdreg.h 2009-05-10 22:04:37.000000000 +0200
109099 +++ linux-2.6.29-rc3.owrt/include/linux/hdreg.h 2009-05-10 23:48:29.000000000 +0200
109100 @@ -511,6 +511,7 @@
109101 unsigned short words69_70[2]; /* reserved words 69-70
109102 * future command overlap and queuing
109103 */
109104 + /* HDIO_GET_IDENTITY currently returns only words 0 through 70 */
109105 unsigned short words71_74[4]; /* reserved words 71-74
109106 * for IDENTIFY PACKET DEVICE command
109107 */
109108 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/hiddev.h linux-2.6.29-rc3.owrt/include/linux/hiddev.h
109109 --- linux-2.6.29.owrt/include/linux/hiddev.h 2009-05-10 22:04:37.000000000 +0200
109110 +++ linux-2.6.29-rc3.owrt/include/linux/hiddev.h 2009-05-10 23:48:29.000000000 +0200
109111 @@ -27,8 +27,6 @@
109112 * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
109113 */
109114
109115 -#include <linux/types.h>
109116 -
109117 /*
109118 * The event structure itself
109119 */
109120 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/hid.h linux-2.6.29-rc3.owrt/include/linux/hid.h
109121 --- linux-2.6.29.owrt/include/linux/hid.h 2009-05-10 22:04:37.000000000 +0200
109122 +++ linux-2.6.29-rc3.owrt/include/linux/hid.h 2009-05-10 23:48:29.000000000 +0200
109123 @@ -791,7 +791,6 @@
109124 __FILE__ , ## arg)
109125 #endif /* HID_FF */
109126
109127 -#ifdef __KERNEL__
109128 #ifdef CONFIG_HID_COMPAT
109129 #define HID_COMPAT_LOAD_DRIVER(name) \
109130 /* prototype to avoid sparse warning */ \
109131 @@ -805,7 +804,6 @@
109132 extern void hid_compat_##name(void); \
109133 hid_compat_##name(); \
109134 } while (0)
109135 -#endif /* __KERNEL__ */
109136
109137 #endif
109138
109139 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/hugetlb.h linux-2.6.29-rc3.owrt/include/linux/hugetlb.h
109140 --- linux-2.6.29.owrt/include/linux/hugetlb.h 2009-05-10 22:04:37.000000000 +0200
109141 +++ linux-2.6.29-rc3.owrt/include/linux/hugetlb.h 2009-05-10 23:48:29.000000000 +0200
109142 @@ -33,8 +33,7 @@
109143 int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
109144 unsigned long address, int write_access);
109145 int hugetlb_reserve_pages(struct inode *inode, long from, long to,
109146 - struct vm_area_struct *vma,
109147 - int acctflags);
109148 + struct vm_area_struct *vma);
109149 void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed);
109150
109151 extern unsigned long hugepages_treat_as_movable;
109152 @@ -139,7 +138,7 @@
109153
109154 extern const struct file_operations hugetlbfs_file_operations;
109155 extern struct vm_operations_struct hugetlb_vm_ops;
109156 -struct file *hugetlb_file_setup(const char *name, size_t, int);
109157 +struct file *hugetlb_file_setup(const char *name, size_t);
109158 int hugetlb_get_quota(struct address_space *mapping, long delta);
109159 void hugetlb_put_quota(struct address_space *mapping, long delta);
109160
109161 @@ -159,9 +158,9 @@
109162 }
109163 #else /* !CONFIG_HUGETLBFS */
109164
109165 -#define is_file_hugepages(file) 0
109166 -#define set_file_hugepages(file) BUG()
109167 -#define hugetlb_file_setup(name,size,acctflag) ERR_PTR(-ENOSYS)
109168 +#define is_file_hugepages(file) 0
109169 +#define set_file_hugepages(file) BUG()
109170 +#define hugetlb_file_setup(name,size) ERR_PTR(-ENOSYS)
109171
109172 #endif /* !CONFIG_HUGETLBFS */
109173
109174 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/i2c-dev.h linux-2.6.29-rc3.owrt/include/linux/i2c-dev.h
109175 --- linux-2.6.29.owrt/include/linux/i2c-dev.h 2009-05-10 22:04:37.000000000 +0200
109176 +++ linux-2.6.29-rc3.owrt/include/linux/i2c-dev.h 2009-05-10 23:48:29.000000000 +0200
109177 @@ -33,7 +33,7 @@
109178 */
109179 #define I2C_RETRIES 0x0701 /* number of times a device address should
109180 be polled when not acknowledging */
109181 -#define I2C_TIMEOUT 0x0702 /* set timeout in units of 10 ms */
109182 +#define I2C_TIMEOUT 0x0702 /* set timeout in jiffies - call with int */
109183
109184 /* NOTE: Slave address is 7 or 10 bits, but 10-bit addresses
109185 * are NOT supported! (due to code brokenness)
109186 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/i2c.h linux-2.6.29-rc3.owrt/include/linux/i2c.h
109187 --- linux-2.6.29.owrt/include/linux/i2c.h 2009-05-10 22:04:37.000000000 +0200
109188 +++ linux-2.6.29-rc3.owrt/include/linux/i2c.h 2009-05-10 23:48:29.000000000 +0200
109189 @@ -361,7 +361,7 @@
109190 struct mutex bus_lock;
109191 struct mutex clist_lock;
109192
109193 - int timeout; /* in jiffies */
109194 + int timeout;
109195 int retries;
109196 struct device dev; /* the adapter device */
109197
109198 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/icmpv6.h linux-2.6.29-rc3.owrt/include/linux/icmpv6.h
109199 --- linux-2.6.29.owrt/include/linux/icmpv6.h 2009-05-10 22:04:37.000000000 +0200
109200 +++ linux-2.6.29-rc3.owrt/include/linux/icmpv6.h 2009-05-10 23:48:29.000000000 +0200
109201 @@ -1,7 +1,6 @@
109202 #ifndef _LINUX_ICMPV6_H
109203 #define _LINUX_ICMPV6_H
109204
109205 -#include <linux/types.h>
109206 #include <asm/byteorder.h>
109207
109208 struct icmp6hdr {
109209 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/ide.h linux-2.6.29-rc3.owrt/include/linux/ide.h
109210 --- linux-2.6.29.owrt/include/linux/ide.h 2009-05-10 22:04:37.000000000 +0200
109211 +++ linux-2.6.29-rc3.owrt/include/linux/ide.h 2009-05-10 23:48:29.000000000 +0200
109212 @@ -663,7 +663,7 @@
109213 #define to_ide_device(dev) container_of(dev, ide_drive_t, gendev)
109214
109215 #define to_ide_drv(obj, cont_type) \
109216 - container_of(obj, struct cont_type, dev)
109217 + container_of(obj, struct cont_type, kref)
109218
109219 #define ide_drv_g(disk, cont_type) \
109220 container_of((disk)->private_data, struct cont_type, driver)
109221 @@ -797,7 +797,6 @@
109222 struct scatterlist *sg_table;
109223 int sg_max_nents; /* Maximum number of entries in it */
109224 int sg_nents; /* Current number of entries in it */
109225 - int orig_sg_nents;
109226 int sg_dma_direction; /* dma transfer direction */
109227
109228 /* data phase of the active command (currently only valid for PIO/DMA) */
109229 @@ -867,7 +866,6 @@
109230 unsigned int n_ports;
109231 struct device *dev[2];
109232 unsigned int (*init_chipset)(struct pci_dev *);
109233 - irq_handler_t irq_handler;
109234 unsigned long host_flags;
109235 void *host_priv;
109236 ide_hwif_t *cur_port; /* for hosts requiring serialization */
109237 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/if_addr.h linux-2.6.29-rc3.owrt/include/linux/if_addr.h
109238 --- linux-2.6.29.owrt/include/linux/if_addr.h 2009-05-10 22:04:37.000000000 +0200
109239 +++ linux-2.6.29-rc3.owrt/include/linux/if_addr.h 2009-05-10 23:48:29.000000000 +0200
109240 @@ -1,7 +1,6 @@
109241 #ifndef __LINUX_IF_ADDR_H
109242 #define __LINUX_IF_ADDR_H
109243
109244 -#include <linux/types.h>
109245 #include <linux/netlink.h>
109246
109247 struct ifaddrmsg
109248 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/if_addrlabel.h linux-2.6.29-rc3.owrt/include/linux/if_addrlabel.h
109249 --- linux-2.6.29.owrt/include/linux/if_addrlabel.h 2009-05-10 22:04:37.000000000 +0200
109250 +++ linux-2.6.29-rc3.owrt/include/linux/if_addrlabel.h 2009-05-10 23:48:29.000000000 +0200
109251 @@ -10,8 +10,6 @@
109252 #ifndef __LINUX_IF_ADDRLABEL_H
109253 #define __LINUX_IF_ADDRLABEL_H
109254
109255 -#include <linux/types.h>
109256 -
109257 struct ifaddrlblmsg
109258 {
109259 __u8 ifal_family; /* Address family */
109260 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/if_fc.h linux-2.6.29-rc3.owrt/include/linux/if_fc.h
109261 --- linux-2.6.29.owrt/include/linux/if_fc.h 2009-05-10 22:04:37.000000000 +0200
109262 +++ linux-2.6.29-rc3.owrt/include/linux/if_fc.h 2009-05-10 23:48:29.000000000 +0200
109263 @@ -20,7 +20,6 @@
109264 #ifndef _LINUX_IF_FC_H
109265 #define _LINUX_IF_FC_H
109266
109267 -#include <linux/types.h>
109268
109269 #define FC_ALEN 6 /* Octets in one ethernet addr */
109270 #define FC_HLEN (sizeof(struct fch_hdr)+sizeof(struct fcllc))
109271 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/if_hippi.h linux-2.6.29-rc3.owrt/include/linux/if_hippi.h
109272 --- linux-2.6.29.owrt/include/linux/if_hippi.h 2009-05-10 22:04:37.000000000 +0200
109273 +++ linux-2.6.29-rc3.owrt/include/linux/if_hippi.h 2009-05-10 23:48:29.000000000 +0200
109274 @@ -22,7 +22,6 @@
109275 #ifndef _LINUX_IF_HIPPI_H
109276 #define _LINUX_IF_HIPPI_H
109277
109278 -#include <linux/types.h>
109279 #include <asm/byteorder.h>
109280
109281 /*
109282 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/if_link.h linux-2.6.29-rc3.owrt/include/linux/if_link.h
109283 --- linux-2.6.29.owrt/include/linux/if_link.h 2009-05-10 22:04:37.000000000 +0200
109284 +++ linux-2.6.29-rc3.owrt/include/linux/if_link.h 2009-05-10 23:48:29.000000000 +0200
109285 @@ -1,7 +1,6 @@
109286 #ifndef _LINUX_IF_LINK_H
109287 #define _LINUX_IF_LINK_H
109288
109289 -#include <linux/types.h>
109290 #include <linux/netlink.h>
109291
109292 /* The struct should be in sync with struct net_device_stats */
109293 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/if_ppp.h linux-2.6.29-rc3.owrt/include/linux/if_ppp.h
109294 --- linux-2.6.29.owrt/include/linux/if_ppp.h 2009-05-10 22:04:37.000000000 +0200
109295 +++ linux-2.6.29-rc3.owrt/include/linux/if_ppp.h 2009-05-10 23:48:29.000000000 +0200
109296 @@ -33,7 +33,6 @@
109297 #ifndef _IF_PPP_H_
109298 #define _IF_PPP_H_
109299
109300 -#include <linux/types.h>
109301 #include <linux/compiler.h>
109302
109303 /*
109304 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/if_strip.h linux-2.6.29-rc3.owrt/include/linux/if_strip.h
109305 --- linux-2.6.29.owrt/include/linux/if_strip.h 2009-05-10 22:04:37.000000000 +0200
109306 +++ linux-2.6.29-rc3.owrt/include/linux/if_strip.h 2009-05-10 23:48:29.000000000 +0200
109307 @@ -18,8 +18,6 @@
109308 #ifndef __LINUX_STRIP_H
109309 #define __LINUX_STRIP_H
109310
109311 -#include <linux/types.h>
109312 -
109313 typedef struct {
109314 __u8 c[6];
109315 } MetricomAddress;
109316 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/if_tr.h linux-2.6.29-rc3.owrt/include/linux/if_tr.h
109317 --- linux-2.6.29.owrt/include/linux/if_tr.h 2009-05-10 22:04:37.000000000 +0200
109318 +++ linux-2.6.29-rc3.owrt/include/linux/if_tr.h 2009-05-10 23:48:29.000000000 +0200
109319 @@ -19,7 +19,6 @@
109320 #ifndef _LINUX_IF_TR_H
109321 #define _LINUX_IF_TR_H
109322
109323 -#include <linux/types.h>
109324 #include <asm/byteorder.h> /* For __be16 */
109325
109326 /* IEEE 802.5 Token-Ring magic constants. The frame sizes omit the preamble
109327 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/if_tunnel.h linux-2.6.29-rc3.owrt/include/linux/if_tunnel.h
109328 --- linux-2.6.29.owrt/include/linux/if_tunnel.h 2009-05-10 22:04:37.000000000 +0200
109329 +++ linux-2.6.29-rc3.owrt/include/linux/if_tunnel.h 2009-05-10 23:48:29.000000000 +0200
109330 @@ -2,10 +2,7 @@
109331 #define _IF_TUNNEL_H_
109332
109333 #include <linux/types.h>
109334 -
109335 -#ifdef __KERNEL__
109336 #include <linux/ip.h>
109337 -#endif
109338
109339 #define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0)
109340 #define SIOCADDTUNNEL (SIOCDEVPRIVATE + 1)
109341 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/if_vlan.h linux-2.6.29-rc3.owrt/include/linux/if_vlan.h
109342 --- linux-2.6.29.owrt/include/linux/if_vlan.h 2009-05-10 22:04:37.000000000 +0200
109343 +++ linux-2.6.29-rc3.owrt/include/linux/if_vlan.h 2009-05-10 23:48:29.000000000 +0200
109344 @@ -210,7 +210,6 @@
109345
109346 /* Move the mac addresses to the beginning of the new header. */
109347 memmove(skb->data, skb->data + VLAN_HLEN, 2 * VLAN_ETH_ALEN);
109348 - skb->mac_header -= VLAN_HLEN;
109349
109350 /* first, the ethernet type */
109351 veth->h_vlan_proto = htons(ETH_P_8021Q);
109352 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/igmp.h linux-2.6.29-rc3.owrt/include/linux/igmp.h
109353 --- linux-2.6.29.owrt/include/linux/igmp.h 2009-05-10 22:04:37.000000000 +0200
109354 +++ linux-2.6.29-rc3.owrt/include/linux/igmp.h 2009-05-10 23:48:29.000000000 +0200
109355 @@ -16,7 +16,6 @@
109356 #ifndef _LINUX_IGMP_H
109357 #define _LINUX_IGMP_H
109358
109359 -#include <linux/types.h>
109360 #include <asm/byteorder.h>
109361
109362 /*
109363 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/inet_diag.h linux-2.6.29-rc3.owrt/include/linux/inet_diag.h
109364 --- linux-2.6.29.owrt/include/linux/inet_diag.h 2009-05-10 22:04:37.000000000 +0200
109365 +++ linux-2.6.29-rc3.owrt/include/linux/inet_diag.h 2009-05-10 23:48:29.000000000 +0200
109366 @@ -1,8 +1,6 @@
109367 #ifndef _INET_DIAG_H_
109368 #define _INET_DIAG_H_ 1
109369
109370 -#include <linux/types.h>
109371 -
109372 /* Just some random number */
109373 #define TCPDIAG_GETSOCK 18
109374 #define DCCPDIAG_GETSOCK 19
109375 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/init_task.h linux-2.6.29-rc3.owrt/include/linux/init_task.h
109376 --- linux-2.6.29.owrt/include/linux/init_task.h 2009-05-10 22:04:37.000000000 +0200
109377 +++ linux-2.6.29-rc3.owrt/include/linux/init_task.h 2009-05-10 23:48:29.000000000 +0200
109378 @@ -48,11 +48,12 @@
109379 .posix_timers = LIST_HEAD_INIT(sig.posix_timers), \
109380 .cpu_timers = INIT_CPU_TIMERS(sig.cpu_timers), \
109381 .rlim = INIT_RLIMITS, \
109382 - .cputimer = { \
109383 - .cputime = INIT_CPUTIME, \
109384 - .running = 0, \
109385 - .lock = __SPIN_LOCK_UNLOCKED(sig.cputimer.lock), \
109386 - }, \
109387 + .cputime = { .totals = { \
109388 + .utime = cputime_zero, \
109389 + .stime = cputime_zero, \
109390 + .sum_exec_runtime = 0, \
109391 + .lock = __SPIN_LOCK_UNLOCKED(sig.cputime.totals.lock), \
109392 + }, }, \
109393 }
109394
109395 extern struct nsproxy init_nsproxy;
109396 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/intel-iommu.h linux-2.6.29-rc3.owrt/include/linux/intel-iommu.h
109397 --- linux-2.6.29.owrt/include/linux/intel-iommu.h 2009-05-10 22:04:37.000000000 +0200
109398 +++ linux-2.6.29-rc3.owrt/include/linux/intel-iommu.h 2009-05-10 23:48:29.000000000 +0200
109399 @@ -194,7 +194,6 @@
109400 /* FSTS_REG */
109401 #define DMA_FSTS_PPF ((u32)2)
109402 #define DMA_FSTS_PFO ((u32)1)
109403 -#define DMA_FSTS_IQE (1 << 4)
109404 #define dma_fsts_fault_record_index(s) (((s) >> 8) & 0xff)
109405
109406 /* FRCD_REG, 32 bits access */
109407 @@ -329,7 +328,7 @@
109408 unsigned int size_order, u64 type,
109409 int non_present_entry_flush);
109410
109411 -extern int qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu);
109412 +extern void qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu);
109413
109414 extern void *intel_alloc_coherent(struct device *, size_t, dma_addr_t *, gfp_t);
109415 extern void intel_free_coherent(struct device *, size_t, void *, dma_addr_t);
109416 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/io-mapping.h linux-2.6.29-rc3.owrt/include/linux/io-mapping.h
109417 --- linux-2.6.29.owrt/include/linux/io-mapping.h 2009-05-10 22:04:37.000000000 +0200
109418 +++ linux-2.6.29-rc3.owrt/include/linux/io-mapping.h 2009-05-10 23:48:29.000000000 +0200
109419 @@ -30,13 +30,10 @@
109420 * See Documentation/io_mapping.txt
109421 */
109422
109423 -#ifdef CONFIG_HAVE_ATOMIC_IOMAP
109424 +/* this struct isn't actually defined anywhere */
109425 +struct io_mapping;
109426
109427 -struct io_mapping {
109428 - resource_size_t base;
109429 - unsigned long size;
109430 - pgprot_t prot;
109431 -};
109432 +#ifdef CONFIG_HAVE_ATOMIC_IOMAP
109433
109434 /*
109435 * For small address space machines, mapping large objects
109436 @@ -46,40 +43,23 @@
109437 */
109438
109439 static inline struct io_mapping *
109440 -io_mapping_create_wc(resource_size_t base, unsigned long size)
109441 +io_mapping_create_wc(unsigned long base, unsigned long size)
109442 {
109443 - struct io_mapping *iomap;
109444 -
109445 - if (!is_io_mapping_possible(base, size))
109446 - return NULL;
109447 -
109448 - iomap = kmalloc(sizeof(*iomap), GFP_KERNEL);
109449 - if (!iomap)
109450 - return NULL;
109451 -
109452 - iomap->base = base;
109453 - iomap->size = size;
109454 - iomap->prot = pgprot_writecombine(__pgprot(__PAGE_KERNEL));
109455 - return iomap;
109456 + return (struct io_mapping *) base;
109457 }
109458
109459 static inline void
109460 io_mapping_free(struct io_mapping *mapping)
109461 {
109462 - kfree(mapping);
109463 }
109464
109465 /* Atomic map/unmap */
109466 static inline void *
109467 io_mapping_map_atomic_wc(struct io_mapping *mapping, unsigned long offset)
109468 {
109469 - resource_size_t phys_addr;
109470 - unsigned long pfn;
109471 -
109472 - BUG_ON(offset >= mapping->size);
109473 - phys_addr = mapping->base + offset;
109474 - pfn = (unsigned long) (phys_addr >> PAGE_SHIFT);
109475 - return iomap_atomic_prot_pfn(pfn, KM_USER0, mapping->prot);
109476 + offset += (unsigned long) mapping;
109477 + return iomap_atomic_prot_pfn(offset >> PAGE_SHIFT, KM_USER0,
109478 + __pgprot(__PAGE_KERNEL_WC));
109479 }
109480
109481 static inline void
109482 @@ -91,12 +71,8 @@
109483 static inline void *
109484 io_mapping_map_wc(struct io_mapping *mapping, unsigned long offset)
109485 {
109486 - resource_size_t phys_addr;
109487 -
109488 - BUG_ON(offset >= mapping->size);
109489 - phys_addr = mapping->base + offset;
109490 -
109491 - return ioremap_wc(phys_addr, PAGE_SIZE);
109492 + offset += (unsigned long) mapping;
109493 + return ioremap_wc(offset, PAGE_SIZE);
109494 }
109495
109496 static inline void
109497 @@ -107,12 +83,9 @@
109498
109499 #else
109500
109501 -/* this struct isn't actually defined anywhere */
109502 -struct io_mapping;
109503 -
109504 /* Create the io_mapping object*/
109505 static inline struct io_mapping *
109506 -io_mapping_create_wc(resource_size_t base, unsigned long size)
109507 +io_mapping_create_wc(unsigned long base, unsigned long size)
109508 {
109509 return (struct io_mapping *) ioremap_wc(base, size);
109510 }
109511 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/ip6_tunnel.h linux-2.6.29-rc3.owrt/include/linux/ip6_tunnel.h
109512 --- linux-2.6.29.owrt/include/linux/ip6_tunnel.h 2009-05-10 22:04:37.000000000 +0200
109513 +++ linux-2.6.29-rc3.owrt/include/linux/ip6_tunnel.h 2009-05-10 23:48:29.000000000 +0200
109514 @@ -1,8 +1,6 @@
109515 #ifndef _IP6_TUNNEL_H
109516 #define _IP6_TUNNEL_H
109517
109518 -#include <linux/types.h>
109519 -
109520 #define IPV6_TLV_TNL_ENCAP_LIMIT 4
109521 #define IPV6_DEFAULT_TNL_ENCAP_LIMIT 4
109522
109523 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/ipv6.h linux-2.6.29-rc3.owrt/include/linux/ipv6.h
109524 --- linux-2.6.29.owrt/include/linux/ipv6.h 2009-05-10 22:04:37.000000000 +0200
109525 +++ linux-2.6.29-rc3.owrt/include/linux/ipv6.h 2009-05-10 23:48:29.000000000 +0200
109526 @@ -1,7 +1,6 @@
109527 #ifndef _IPV6_H
109528 #define _IPV6_H
109529
109530 -#include <linux/types.h>
109531 #include <linux/in6.h>
109532 #include <asm/byteorder.h>
109533
109534 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/ipv6_route.h linux-2.6.29-rc3.owrt/include/linux/ipv6_route.h
109535 --- linux-2.6.29.owrt/include/linux/ipv6_route.h 2009-05-10 22:04:37.000000000 +0200
109536 +++ linux-2.6.29-rc3.owrt/include/linux/ipv6_route.h 2009-05-10 23:48:29.000000000 +0200
109537 @@ -13,8 +13,6 @@
109538 #ifndef _LINUX_IPV6_ROUTE_H
109539 #define _LINUX_IPV6_ROUTE_H
109540
109541 -#include <linux/types.h>
109542 -
109543 #define RTF_DEFAULT 0x00010000 /* default - learned via ND */
109544 #define RTF_ALLONLINK 0x00020000 /* (deprecated and will be removed)
109545 fallback, no routers on link */
109546 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/ipx.h linux-2.6.29-rc3.owrt/include/linux/ipx.h
109547 --- linux-2.6.29.owrt/include/linux/ipx.h 2009-05-10 22:04:37.000000000 +0200
109548 +++ linux-2.6.29-rc3.owrt/include/linux/ipx.h 2009-05-10 23:48:29.000000000 +0200
109549 @@ -1,6 +1,5 @@
109550 #ifndef _IPX_H_
109551 #define _IPX_H_
109552 -#include <linux/types.h>
109553 #include <linux/sockios.h>
109554 #include <linux/socket.h>
109555 #define IPX_NODE_LEN 6
109556 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/irda.h linux-2.6.29-rc3.owrt/include/linux/irda.h
109557 --- linux-2.6.29.owrt/include/linux/irda.h 2009-05-10 22:04:37.000000000 +0200
109558 +++ linux-2.6.29-rc3.owrt/include/linux/irda.h 2009-05-10 23:48:29.000000000 +0200
109559 @@ -25,8 +25,6 @@
109560 #ifndef KERNEL_IRDA_H
109561 #define KERNEL_IRDA_H
109562
109563 -#include <linux/types.h>
109564 -
109565 /* Please do *not* add any #include in this file, this file is
109566 * included as-is in user space.
109567 * Please fix the calling file to properly included needed files before
109568 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/jbd2.h linux-2.6.29-rc3.owrt/include/linux/jbd2.h
109569 --- linux-2.6.29.owrt/include/linux/jbd2.h 2009-05-10 22:04:37.000000000 +0200
109570 +++ linux-2.6.29-rc3.owrt/include/linux/jbd2.h 2009-05-10 23:48:29.000000000 +0200
109571 @@ -308,8 +308,7 @@
109572 int val = (expr); \
109573 if (!val) { \
109574 printk(KERN_ERR \
109575 - "JBD2 unexpected failure: %s: %s;\n", \
109576 - __func__, #expr); \
109577 + "EXT3-fs unexpected failure: %s;\n",# expr); \
109578 printk(KERN_ERR why "\n"); \
109579 } \
109580 val; \
109581 @@ -1150,8 +1149,7 @@
109582 extern int jbd2_journal_bmap(journal_t *, unsigned long, unsigned long long *);
109583 extern int jbd2_journal_force_commit(journal_t *);
109584 extern int jbd2_journal_file_inode(handle_t *handle, struct jbd2_inode *inode);
109585 -extern int jbd2_journal_begin_ordered_truncate(journal_t *journal,
109586 - struct jbd2_inode *inode, loff_t new_size);
109587 +extern int jbd2_journal_begin_ordered_truncate(struct jbd2_inode *inode, loff_t new_size);
109588 extern void jbd2_journal_init_jbd_inode(struct jbd2_inode *jinode, struct inode *inode);
109589 extern void jbd2_journal_release_jbd_inode(journal_t *journal, struct jbd2_inode *jinode);
109590
109591 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/Kbuild linux-2.6.29-rc3.owrt/include/linux/Kbuild
109592 --- linux-2.6.29.owrt/include/linux/Kbuild 2009-05-10 22:04:37.000000000 +0200
109593 +++ linux-2.6.29-rc3.owrt/include/linux/Kbuild 2009-05-10 23:48:29.000000000 +0200
109594 @@ -41,7 +41,6 @@
109595 header-y += bfs_fs.h
109596 header-y += blkpg.h
109597 header-y += bpqether.h
109598 -header-y += bsg.h
109599 header-y += can.h
109600 header-y += cdk.h
109601 header-y += chio.h
109602 @@ -52,7 +51,6 @@
109603 header-y += cgroupstats.h
109604 header-y += cramfs_fs.h
109605 header-y += cycx_cfm.h
109606 -header-y += dcbnl.h
109607 header-y += dlmconstants.h
109608 header-y += dlm_device.h
109609 header-y += dlm_netlink.h
109610 @@ -91,6 +89,7 @@
109611 header-y += if_slip.h
109612 header-y += if_strip.h
109613 header-y += if_tun.h
109614 +header-y += if_tunnel.h
109615 header-y += in_route.h
109616 header-y += ioctl.h
109617 header-y += ip6_tunnel.h
109618 @@ -236,7 +235,6 @@
109619 unifdef-y += if_pppol2tp.h
109620 unifdef-y += if_pppox.h
109621 unifdef-y += if_tr.h
109622 -unifdef-y += if_tunnel.h
109623 unifdef-y += if_vlan.h
109624 unifdef-y += igmp.h
109625 unifdef-y += inet_diag.h
109626 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/kernel.h linux-2.6.29-rc3.owrt/include/linux/kernel.h
109627 --- linux-2.6.29.owrt/include/linux/kernel.h 2009-05-10 22:04:37.000000000 +0200
109628 +++ linux-2.6.29-rc3.owrt/include/linux/kernel.h 2009-05-10 23:48:29.000000000 +0200
109629 @@ -480,8 +480,7 @@
109630 /*
109631 * swap - swap value of @a and @b
109632 */
109633 -#define swap(a, b) \
109634 - do { typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while (0)
109635 +#define swap(a, b) ({ typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; })
109636
109637 /**
109638 * container_of - cast a member of a structure out to the containing structure
109639 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/kprobes.h linux-2.6.29-rc3.owrt/include/linux/kprobes.h
109640 --- linux-2.6.29.owrt/include/linux/kprobes.h 2009-05-10 22:04:37.000000000 +0200
109641 +++ linux-2.6.29-rc3.owrt/include/linux/kprobes.h 2009-05-10 23:48:29.000000000 +0200
109642 @@ -49,13 +49,6 @@
109643
109644 /* Attach to insert probes on any functions which should be ignored*/
109645 #define __kprobes __attribute__((__section__(".kprobes.text"))) notrace
109646 -#else /* CONFIG_KPROBES */
109647 -typedef int kprobe_opcode_t;
109648 -struct arch_specific_insn {
109649 - int dummy;
109650 -};
109651 -#define __kprobes notrace
109652 -#endif /* CONFIG_KPROBES */
109653
109654 struct kprobe;
109655 struct pt_regs;
109656 @@ -138,6 +131,23 @@
109657 /* For backward compatibility with old code using JPROBE_ENTRY() */
109658 #define JPROBE_ENTRY(handler) (handler)
109659
109660 +DECLARE_PER_CPU(struct kprobe *, current_kprobe);
109661 +DECLARE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
109662 +
109663 +#ifdef CONFIG_KRETPROBES
109664 +extern void arch_prepare_kretprobe(struct kretprobe_instance *ri,
109665 + struct pt_regs *regs);
109666 +extern int arch_trampoline_kprobe(struct kprobe *p);
109667 +#else /* CONFIG_KRETPROBES */
109668 +static inline void arch_prepare_kretprobe(struct kretprobe *rp,
109669 + struct pt_regs *regs)
109670 +{
109671 +}
109672 +static inline int arch_trampoline_kprobe(struct kprobe *p)
109673 +{
109674 + return 0;
109675 +}
109676 +#endif /* CONFIG_KRETPROBES */
109677 /*
109678 * Function-return probe -
109679 * Note:
109680 @@ -178,25 +188,6 @@
109681 unsigned long range;
109682 };
109683
109684 -#ifdef CONFIG_KPROBES
109685 -DECLARE_PER_CPU(struct kprobe *, current_kprobe);
109686 -DECLARE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
109687 -
109688 -#ifdef CONFIG_KRETPROBES
109689 -extern void arch_prepare_kretprobe(struct kretprobe_instance *ri,
109690 - struct pt_regs *regs);
109691 -extern int arch_trampoline_kprobe(struct kprobe *p);
109692 -#else /* CONFIG_KRETPROBES */
109693 -static inline void arch_prepare_kretprobe(struct kretprobe *rp,
109694 - struct pt_regs *regs)
109695 -{
109696 -}
109697 -static inline int arch_trampoline_kprobe(struct kprobe *p)
109698 -{
109699 - return 0;
109700 -}
109701 -#endif /* CONFIG_KRETPROBES */
109702 -
109703 extern struct kretprobe_blackpoint kretprobe_blacklist[];
109704
109705 static inline void kretprobe_assert(struct kretprobe_instance *ri,
109706 @@ -273,6 +264,10 @@
109707
109708 #else /* CONFIG_KPROBES */
109709
109710 +#define __kprobes notrace
109711 +struct jprobe;
109712 +struct kretprobe;
109713 +
109714 static inline struct kprobe *get_kprobe(void *addr)
109715 {
109716 return NULL;
109717 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/kvm.h linux-2.6.29-rc3.owrt/include/linux/kvm.h
109718 --- linux-2.6.29.owrt/include/linux/kvm.h 2009-05-10 22:04:37.000000000 +0200
109719 +++ linux-2.6.29-rc3.owrt/include/linux/kvm.h 2009-05-10 23:48:29.000000000 +0200
109720 @@ -58,10 +58,10 @@
109721 __u32 pad;
109722 union {
109723 char dummy[512]; /* reserving space */
109724 -#ifdef __KVM_HAVE_PIT
109725 +#ifdef CONFIG_X86
109726 struct kvm_pic_state pic;
109727 #endif
109728 -#ifdef __KVM_HAVE_IOAPIC
109729 +#if defined(CONFIG_X86) || defined(CONFIG_IA64)
109730 struct kvm_ioapic_state ioapic;
109731 #endif
109732 } chip;
109733 @@ -384,16 +384,16 @@
109734 #define KVM_CAP_MP_STATE 14
109735 #define KVM_CAP_COALESCED_MMIO 15
109736 #define KVM_CAP_SYNC_MMU 16 /* Changes to host mmap are reflected in guest */
109737 -#ifdef __KVM_HAVE_DEVICE_ASSIGNMENT
109738 +#if defined(CONFIG_X86)||defined(CONFIG_IA64)
109739 #define KVM_CAP_DEVICE_ASSIGNMENT 17
109740 #endif
109741 #define KVM_CAP_IOMMU 18
109742 -#ifdef __KVM_HAVE_MSI
109743 +#if defined(CONFIG_X86)
109744 #define KVM_CAP_DEVICE_MSI 20
109745 #endif
109746 /* Bug in KVM_SET_USER_MEMORY_REGION fixed: */
109747 #define KVM_CAP_DESTROY_MEMORY_REGION_WORKS 21
109748 -#ifdef __KVM_HAVE_USER_NMI
109749 +#if defined(CONFIG_X86)
109750 #define KVM_CAP_USER_NMI 22
109751 #endif
109752
109753 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/kvm_host.h linux-2.6.29-rc3.owrt/include/linux/kvm_host.h
109754 --- linux-2.6.29.owrt/include/linux/kvm_host.h 2009-05-10 22:04:37.000000000 +0200
109755 +++ linux-2.6.29-rc3.owrt/include/linux/kvm_host.h 2009-05-10 23:48:29.000000000 +0200
109756 @@ -285,7 +285,6 @@
109757 struct kvm *kvm_arch_create_vm(void);
109758 void kvm_arch_destroy_vm(struct kvm *kvm);
109759 void kvm_free_all_assigned_devices(struct kvm *kvm);
109760 -void kvm_arch_sync_events(struct kvm *kvm);
109761
109762 int kvm_cpu_get_interrupt(struct kvm_vcpu *v);
109763 int kvm_cpu_has_interrupt(struct kvm_vcpu *v);
109764 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/libata.h linux-2.6.29-rc3.owrt/include/linux/libata.h
109765 --- linux-2.6.29.owrt/include/linux/libata.h 2009-05-10 22:04:37.000000000 +0200
109766 +++ linux-2.6.29-rc3.owrt/include/linux/libata.h 2009-05-10 23:48:29.000000000 +0200
109767 @@ -275,7 +275,7 @@
109768 * advised to wait only for the following duration before
109769 * doing SRST.
109770 */
109771 - ATA_TMOUT_PMP_SRST_WAIT = 5000,
109772 + ATA_TMOUT_PMP_SRST_WAIT = 1000,
109773
109774 /* ATA bus states */
109775 BUS_UNKNOWN = 0,
109776 @@ -380,7 +380,6 @@
109777 ATA_HORKAGE_ATAPI_MOD16_DMA = (1 << 11), /* use ATAPI DMA for commands
109778 not multiple of 16 bytes */
109779 ATA_HORKAGE_FIRMWARE_WARN = (1 << 12), /* firwmare update warning */
109780 - ATA_HORKAGE_1_5_GBPS = (1 << 13), /* force 1.5 Gbps */
109781
109782 /* DMA mask for user DMA control: User visible values; DO NOT
109783 renumber */
109784 @@ -530,7 +529,6 @@
109785 unsigned long flags; /* ATA_QCFLAG_xxx */
109786 unsigned int tag;
109787 unsigned int n_elem;
109788 - unsigned int orig_n_elem;
109789
109790 int dma_dir;
109791
109792 @@ -582,7 +580,7 @@
109793 acpi_handle acpi_handle;
109794 union acpi_object *gtf_cache;
109795 #endif
109796 - /* n_sector is CLEAR_BEGIN, read comment above CLEAR_BEGIN */
109797 + /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */
109798 u64 n_sectors; /* size of device, if ATA */
109799 unsigned int class; /* ATA_DEV_xxx */
109800 unsigned long unpark_deadline;
109801 @@ -607,22 +605,20 @@
109802 u16 heads; /* Number of heads */
109803 u16 sectors; /* Number of sectors per track */
109804
109805 + /* error history */
109806 + int spdn_cnt;
109807 + struct ata_ering ering;
109808 +
109809 union {
109810 u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */
109811 u32 gscr[SATA_PMP_GSCR_DWORDS]; /* PMP GSCR block */
109812 };
109813 -
109814 - /* error history */
109815 - int spdn_cnt;
109816 - /* ering is CLEAR_END, read comment above CLEAR_END */
109817 - struct ata_ering ering;
109818 };
109819
109820 -/* Fields between ATA_DEVICE_CLEAR_BEGIN and ATA_DEVICE_CLEAR_END are
109821 - * cleared to zero on ata_dev_init().
109822 +/* Offset into struct ata_device. Fields above it are maintained
109823 + * acress device init. Fields below are zeroed.
109824 */
109825 -#define ATA_DEVICE_CLEAR_BEGIN offsetof(struct ata_device, n_sectors)
109826 -#define ATA_DEVICE_CLEAR_END offsetof(struct ata_device, ering)
109827 +#define ATA_DEVICE_CLEAR_OFFSET offsetof(struct ata_device, n_sectors)
109828
109829 struct ata_eh_info {
109830 struct ata_device *dev; /* offending device */
109831 @@ -751,8 +747,7 @@
109832 acpi_handle acpi_handle;
109833 struct ata_acpi_gtm __acpi_init_gtm; /* use ata_acpi_init_gtm() */
109834 #endif
109835 - /* owned by EH */
109836 - u8 sector_buf[ATA_SECT_SIZE] ____cacheline_aligned;
109837 + u8 sector_buf[ATA_SECT_SIZE]; /* owned by EH */
109838 };
109839
109840 /* The following initializer overrides a method to NULL whether one of
109841 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/lockd/lockd.h linux-2.6.29-rc3.owrt/include/linux/lockd/lockd.h
109842 --- linux-2.6.29.owrt/include/linux/lockd/lockd.h 2009-05-10 22:04:37.000000000 +0200
109843 +++ linux-2.6.29-rc3.owrt/include/linux/lockd/lockd.h 2009-05-10 23:48:29.000000000 +0200
109844 @@ -346,7 +346,6 @@
109845 return sin1->sin_addr.s_addr == sin2->sin_addr.s_addr;
109846 }
109847
109848 -#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
109849 static inline int __nlm_cmp_addr6(const struct sockaddr *sap1,
109850 const struct sockaddr *sap2)
109851 {
109852 @@ -354,13 +353,6 @@
109853 const struct sockaddr_in6 *sin2 = (const struct sockaddr_in6 *)sap2;
109854 return ipv6_addr_equal(&sin1->sin6_addr, &sin2->sin6_addr);
109855 }
109856 -#else /* !(CONFIG_IPV6 || CONFIG_IPV6_MODULE) */
109857 -static inline int __nlm_cmp_addr6(const struct sockaddr *sap1,
109858 - const struct sockaddr *sap2)
109859 -{
109860 - return 0;
109861 -}
109862 -#endif /* !(CONFIG_IPV6 || CONFIG_IPV6_MODULE) */
109863
109864 /*
109865 * Compare two host addresses
109866 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/minix_fs.h linux-2.6.29-rc3.owrt/include/linux/minix_fs.h
109867 --- linux-2.6.29.owrt/include/linux/minix_fs.h 2009-05-10 22:04:37.000000000 +0200
109868 +++ linux-2.6.29-rc3.owrt/include/linux/minix_fs.h 2009-05-10 23:48:29.000000000 +0200
109869 @@ -1,7 +1,6 @@
109870 #ifndef _LINUX_MINIX_FS_H
109871 #define _LINUX_MINIX_FS_H
109872
109873 -#include <linux/types.h>
109874 #include <linux/magic.h>
109875
109876 /*
109877 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/mm.h linux-2.6.29-rc3.owrt/include/linux/mm.h
109878 --- linux-2.6.29.owrt/include/linux/mm.h 2009-05-10 22:04:37.000000000 +0200
109879 +++ linux-2.6.29-rc3.owrt/include/linux/mm.h 2009-05-10 23:48:29.000000000 +0200
109880 @@ -1041,23 +1041,10 @@
109881 typedef int (*work_fn_t)(unsigned long, unsigned long, void *);
109882 extern void work_with_active_regions(int nid, work_fn_t work_fn, void *data);
109883 extern void sparse_memory_present_with_active_regions(int nid);
109884 -#endif /* CONFIG_ARCH_POPULATES_NODE_MAP */
109885 -
109886 -#if !defined(CONFIG_ARCH_POPULATES_NODE_MAP) && \
109887 - !defined(CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID)
109888 -static inline int __early_pfn_to_nid(unsigned long pfn)
109889 -{
109890 - return 0;
109891 -}
109892 -#else
109893 -/* please see mm/page_alloc.c */
109894 -extern int __meminit early_pfn_to_nid(unsigned long pfn);
109895 -#ifdef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID
109896 -/* there is a per-arch backend function. */
109897 -extern int __meminit __early_pfn_to_nid(unsigned long pfn);
109898 +#ifndef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID
109899 +extern int early_pfn_to_nid(unsigned long pfn);
109900 #endif /* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */
109901 -#endif
109902 -
109903 +#endif /* CONFIG_ARCH_POPULATES_NODE_MAP */
109904 extern void set_dma_reserve(unsigned long new_dma_reserve);
109905 extern void memmap_init_zone(unsigned long, int, unsigned long,
109906 unsigned long, enum memmap_context);
109907 @@ -1142,7 +1129,8 @@
109908 unsigned long flag, unsigned long pgoff);
109909 extern unsigned long mmap_region(struct file *file, unsigned long addr,
109910 unsigned long len, unsigned long flags,
109911 - unsigned int vm_flags, unsigned long pgoff);
109912 + unsigned int vm_flags, unsigned long pgoff,
109913 + int accountable);
109914
109915 static inline unsigned long do_mmap(struct file *file, unsigned long addr,
109916 unsigned long len, unsigned long prot,
109917 @@ -1172,7 +1160,6 @@
109918
109919 /* mm/page-writeback.c */
109920 int write_one_page(struct page *page, int wait);
109921 -void task_dirty_inc(struct task_struct *tsk);
109922
109923 /* readahead.c */
109924 #define VM_MAX_READAHEAD 128 /* kbytes */
109925 @@ -1318,6 +1305,5 @@
109926
109927 extern void *alloc_locked_buffer(size_t size);
109928 extern void free_locked_buffer(void *buffer, size_t size);
109929 -extern void release_locked_buffer(void *buffer, size_t size);
109930 #endif /* __KERNEL__ */
109931 #endif /* _LINUX_MM_H */
109932 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/mm_types.h linux-2.6.29-rc3.owrt/include/linux/mm_types.h
109933 --- linux-2.6.29.owrt/include/linux/mm_types.h 2009-05-10 22:04:37.000000000 +0200
109934 +++ linux-2.6.29-rc3.owrt/include/linux/mm_types.h 2009-05-10 23:48:29.000000000 +0200
109935 @@ -276,7 +276,4 @@
109936 #endif
109937 };
109938
109939 -/* Future-safe accessor for struct mm_struct's cpu_vm_mask. */
109940 -#define mm_cpumask(mm) (&(mm)->cpu_vm_mask)
109941 -
109942 #endif /* _LINUX_MM_TYPES_H */
109943 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/mmzone.h linux-2.6.29-rc3.owrt/include/linux/mmzone.h
109944 --- linux-2.6.29.owrt/include/linux/mmzone.h 2009-05-10 22:04:37.000000000 +0200
109945 +++ linux-2.6.29-rc3.owrt/include/linux/mmzone.h 2009-05-10 23:48:29.000000000 +0200
109946 @@ -1071,7 +1071,7 @@
109947 #endif /* CONFIG_SPARSEMEM */
109948
109949 #ifdef CONFIG_NODES_SPAN_OTHER_NODES
109950 -bool early_pfn_in_nid(unsigned long pfn, int nid);
109951 +#define early_pfn_in_nid(pfn, nid) (early_pfn_to_nid(pfn) == (nid))
109952 #else
109953 #define early_pfn_in_nid(pfn, nid) (1)
109954 #endif
109955 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/module.h linux-2.6.29-rc3.owrt/include/linux/module.h
109956 --- linux-2.6.29.owrt/include/linux/module.h 2009-05-10 22:04:37.000000000 +0200
109957 +++ linux-2.6.29-rc3.owrt/include/linux/module.h 2009-05-10 23:48:29.000000000 +0200
109958 @@ -219,6 +219,11 @@
109959
109960 #endif
109961
109962 +struct module_ref
109963 +{
109964 + local_t count;
109965 +} ____cacheline_aligned;
109966 +
109967 enum module_state
109968 {
109969 MODULE_STATE_LIVE,
109970 @@ -339,11 +344,8 @@
109971 /* Destruction function. */
109972 void (*exit)(void);
109973
109974 -#ifdef CONFIG_SMP
109975 - char *refptr;
109976 -#else
109977 - local_t ref;
109978 -#endif
109979 + /* Reference counts */
109980 + struct module_ref ref[NR_CPUS];
109981 #endif
109982 };
109983 #ifndef MODULE_ARCH_INIT
109984 @@ -393,21 +395,13 @@
109985 #define symbol_put(x) __symbol_put(MODULE_SYMBOL_PREFIX #x)
109986 void symbol_put_addr(void *addr);
109987
109988 -static inline local_t *__module_ref_addr(struct module *mod, int cpu)
109989 -{
109990 -#ifdef CONFIG_SMP
109991 - return (local_t *) (mod->refptr + per_cpu_offset(cpu));
109992 -#else
109993 - return &mod->ref;
109994 -#endif
109995 -}
109996 -
109997 /* Sometimes we know we already have a refcount, and it's easier not
109998 to handle the error case (which only happens with rmmod --wait). */
109999 static inline void __module_get(struct module *module)
110000 {
110001 if (module) {
110002 - local_inc(__module_ref_addr(module, get_cpu()));
110003 + BUG_ON(module_refcount(module) == 0);
110004 + local_inc(&module->ref[get_cpu()].count);
110005 put_cpu();
110006 }
110007 }
110008 @@ -419,7 +413,7 @@
110009 if (module) {
110010 unsigned int cpu = get_cpu();
110011 if (likely(module_is_live(module)))
110012 - local_inc(__module_ref_addr(module, cpu));
110013 + local_inc(&module->ref[cpu].count);
110014 else
110015 ret = 0;
110016 put_cpu();
110017 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/msdos_fs.h linux-2.6.29-rc3.owrt/include/linux/msdos_fs.h
110018 --- linux-2.6.29.owrt/include/linux/msdos_fs.h 2009-05-10 22:04:37.000000000 +0200
110019 +++ linux-2.6.29-rc3.owrt/include/linux/msdos_fs.h 2009-05-10 23:48:29.000000000 +0200
110020 @@ -1,7 +1,6 @@
110021 #ifndef _LINUX_MSDOS_FS_H
110022 #define _LINUX_MSDOS_FS_H
110023
110024 -#include <linux/types.h>
110025 #include <linux/magic.h>
110026 #include <asm/byteorder.h>
110027
110028 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/neighbour.h linux-2.6.29-rc3.owrt/include/linux/neighbour.h
110029 --- linux-2.6.29.owrt/include/linux/neighbour.h 2009-05-10 22:04:37.000000000 +0200
110030 +++ linux-2.6.29-rc3.owrt/include/linux/neighbour.h 2009-05-10 23:48:29.000000000 +0200
110031 @@ -1,7 +1,6 @@
110032 #ifndef __LINUX_NEIGHBOUR_H
110033 #define __LINUX_NEIGHBOUR_H
110034
110035 -#include <linux/types.h>
110036 #include <linux/netlink.h>
110037
110038 struct ndmsg
110039 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/netdevice.h linux-2.6.29-rc3.owrt/include/linux/netdevice.h
110040 --- linux-2.6.29.owrt/include/linux/netdevice.h 2009-05-10 22:04:37.000000000 +0200
110041 +++ linux-2.6.29-rc3.owrt/include/linux/netdevice.h 2009-05-10 23:48:29.000000000 +0200
110042 @@ -1081,7 +1081,6 @@
110043 extern int register_netdevice_notifier(struct notifier_block *nb);
110044 extern int unregister_netdevice_notifier(struct notifier_block *nb);
110045 extern int init_dummy_netdev(struct net_device *dev);
110046 -extern void netdev_resync_ops(struct net_device *dev);
110047
110048 extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev);
110049 extern struct net_device *dev_get_by_index(struct net *net, int ifindex);
110050 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/netfilter/xt_conntrack.h linux-2.6.29-rc3.owrt/include/linux/netfilter/xt_conntrack.h
110051 --- linux-2.6.29.owrt/include/linux/netfilter/xt_conntrack.h 2009-05-10 22:04:37.000000000 +0200
110052 +++ linux-2.6.29-rc3.owrt/include/linux/netfilter/xt_conntrack.h 2009-05-10 23:48:29.000000000 +0200
110053 @@ -5,7 +5,6 @@
110054 #ifndef _XT_CONNTRACK_H
110055 #define _XT_CONNTRACK_H
110056
110057 -#include <linux/types.h>
110058 #include <linux/netfilter/nf_conntrack_tuple_common.h>
110059
110060 #define XT_CONNTRACK_STATE_BIT(ctinfo) (1 << ((ctinfo)%IP_CT_IS_REPLY+1))
110061 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/netfilter/xt_NFLOG.h linux-2.6.29-rc3.owrt/include/linux/netfilter/xt_NFLOG.h
110062 --- linux-2.6.29.owrt/include/linux/netfilter/xt_NFLOG.h 2009-05-10 22:04:37.000000000 +0200
110063 +++ linux-2.6.29-rc3.owrt/include/linux/netfilter/xt_NFLOG.h 2009-05-10 23:48:29.000000000 +0200
110064 @@ -2,7 +2,7 @@
110065 #define _XT_NFLOG_TARGET
110066
110067 #define XT_NFLOG_DEFAULT_GROUP 0x1
110068 -#define XT_NFLOG_DEFAULT_THRESHOLD 0
110069 +#define XT_NFLOG_DEFAULT_THRESHOLD 1
110070
110071 #define XT_NFLOG_MASK 0x0
110072
110073 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/nfsacl.h linux-2.6.29-rc3.owrt/include/linux/nfsacl.h
110074 --- linux-2.6.29.owrt/include/linux/nfsacl.h 2009-05-10 22:04:37.000000000 +0200
110075 +++ linux-2.6.29-rc3.owrt/include/linux/nfsacl.h 2009-05-10 23:48:29.000000000 +0200
110076 @@ -37,9 +37,6 @@
110077 #define NFSACL_MAXPAGES ((2*(8+12*NFS_ACL_MAX_ENTRIES) + PAGE_SIZE-1) \
110078 >> PAGE_SHIFT)
110079
110080 -#define NFS_ACL_MAX_ENTRIES_INLINE (5)
110081 -#define NFS_ACL_INLINE_BUFSIZE ((2*(2+3*NFS_ACL_MAX_ENTRIES_INLINE)) << 2)
110082 -
110083 static inline unsigned int
110084 nfsacl_size(struct posix_acl *acl_access, struct posix_acl *acl_default)
110085 {
110086 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/nfsd/export.h linux-2.6.29-rc3.owrt/include/linux/nfsd/export.h
110087 --- linux-2.6.29.owrt/include/linux/nfsd/export.h 2009-05-10 22:04:37.000000000 +0200
110088 +++ linux-2.6.29-rc3.owrt/include/linux/nfsd/export.h 2009-05-10 23:48:29.000000000 +0200
110089 @@ -10,8 +10,9 @@
110090 #ifndef NFSD_EXPORT_H
110091 #define NFSD_EXPORT_H
110092
110093 -# include <linux/types.h>
110094 +#include <asm/types.h>
110095 #ifdef __KERNEL__
110096 +# include <linux/types.h>
110097 # include <linux/in.h>
110098 #endif
110099
110100 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/nfsd/nfsfh.h linux-2.6.29-rc3.owrt/include/linux/nfsd/nfsfh.h
110101 --- linux-2.6.29.owrt/include/linux/nfsd/nfsfh.h 2009-05-10 22:04:37.000000000 +0200
110102 +++ linux-2.6.29-rc3.owrt/include/linux/nfsd/nfsfh.h 2009-05-10 23:48:29.000000000 +0200
110103 @@ -14,8 +14,9 @@
110104 #ifndef _LINUX_NFSD_FH_H
110105 #define _LINUX_NFSD_FH_H
110106
110107 -# include <linux/types.h>
110108 +#include <asm/types.h>
110109 #ifdef __KERNEL__
110110 +# include <linux/types.h>
110111 # include <linux/string.h>
110112 # include <linux/fs.h>
110113 #endif
110114 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/nfsd/syscall.h linux-2.6.29-rc3.owrt/include/linux/nfsd/syscall.h
110115 --- linux-2.6.29.owrt/include/linux/nfsd/syscall.h 2009-05-10 22:04:37.000000000 +0200
110116 +++ linux-2.6.29-rc3.owrt/include/linux/nfsd/syscall.h 2009-05-10 23:48:29.000000000 +0200
110117 @@ -9,8 +9,9 @@
110118 #ifndef NFSD_SYSCALL_H
110119 #define NFSD_SYSCALL_H
110120
110121 -# include <linux/types.h>
110122 +#include <asm/types.h>
110123 #ifdef __KERNEL__
110124 +# include <linux/types.h>
110125 # include <linux/in.h>
110126 #endif
110127 #include <linux/posix_types.h>
110128 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/nfs_idmap.h linux-2.6.29-rc3.owrt/include/linux/nfs_idmap.h
110129 --- linux-2.6.29.owrt/include/linux/nfs_idmap.h 2009-05-10 22:04:37.000000000 +0200
110130 +++ linux-2.6.29-rc3.owrt/include/linux/nfs_idmap.h 2009-05-10 23:48:29.000000000 +0200
110131 @@ -37,8 +37,6 @@
110132 #ifndef NFS_IDMAP_H
110133 #define NFS_IDMAP_H
110134
110135 -#include <linux/types.h>
110136 -
110137 /* XXX from bits/utmp.h */
110138 #define IDMAP_NAMESZ 128
110139
110140 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/nfs_xdr.h linux-2.6.29-rc3.owrt/include/linux/nfs_xdr.h
110141 --- linux-2.6.29.owrt/include/linux/nfs_xdr.h 2009-05-10 22:04:37.000000000 +0200
110142 +++ linux-2.6.29-rc3.owrt/include/linux/nfs_xdr.h 2009-05-10 23:48:29.000000000 +0200
110143 @@ -406,8 +406,6 @@
110144 int mask;
110145 struct posix_acl * acl_access;
110146 struct posix_acl * acl_default;
110147 - size_t len;
110148 - unsigned int npages;
110149 struct page ** pages;
110150 };
110151
110152 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/nubus.h linux-2.6.29-rc3.owrt/include/linux/nubus.h
110153 --- linux-2.6.29.owrt/include/linux/nubus.h 2009-05-10 22:04:37.000000000 +0200
110154 +++ linux-2.6.29-rc3.owrt/include/linux/nubus.h 2009-05-10 23:48:29.000000000 +0200
110155 @@ -12,7 +12,6 @@
110156 #ifndef LINUX_NUBUS_H
110157 #define LINUX_NUBUS_H
110158
110159 -#include <linux/types.h>
110160 #ifdef __KERNEL__
110161 #include <asm/nubus.h>
110162 #endif
110163 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/pci.h linux-2.6.29-rc3.owrt/include/linux/pci.h
110164 --- linux-2.6.29.owrt/include/linux/pci.h 2009-05-10 22:04:37.000000000 +0200
110165 +++ linux-2.6.29-rc3.owrt/include/linux/pci.h 2009-05-10 23:48:29.000000000 +0200
110166 @@ -684,7 +684,7 @@
110167 void pci_disable_rom(struct pci_dev *pdev);
110168 void __iomem __must_check *pci_map_rom(struct pci_dev *pdev, size_t *size);
110169 void pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom);
110170 -size_t pci_get_rom_size(struct pci_dev *pdev, void __iomem *rom, size_t size);
110171 +size_t pci_get_rom_size(void __iomem *rom, size_t size);
110172
110173 /* Power management related routines */
110174 int pci_save_state(struct pci_dev *dev);
110175 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/pci_ids.h linux-2.6.29-rc3.owrt/include/linux/pci_ids.h
110176 --- linux-2.6.29.owrt/include/linux/pci_ids.h 2009-05-10 22:04:37.000000000 +0200
110177 +++ linux-2.6.29-rc3.owrt/include/linux/pci_ids.h 2009-05-10 23:48:29.000000000 +0200
110178 @@ -1312,7 +1312,6 @@
110179 #define PCI_DEVICE_ID_VIA_VT3351 0x0351
110180 #define PCI_DEVICE_ID_VIA_VT3364 0x0364
110181 #define PCI_DEVICE_ID_VIA_8371_0 0x0391
110182 -#define PCI_DEVICE_ID_VIA_6415 0x0415
110183 #define PCI_DEVICE_ID_VIA_8501_0 0x0501
110184 #define PCI_DEVICE_ID_VIA_82C561 0x0561
110185 #define PCI_DEVICE_ID_VIA_82C586_1 0x0571
110186 @@ -1445,7 +1444,6 @@
110187 #define PCI_DEVICE_ID_DIGI_DF_M_E 0x0071
110188 #define PCI_DEVICE_ID_DIGI_DF_M_IOM2_A 0x0072
110189 #define PCI_DEVICE_ID_DIGI_DF_M_A 0x0073
110190 -#define PCI_DEVICE_ID_DIGI_NEO_8 0x00B1
110191 #define PCI_DEVICE_ID_NEO_2DB9 0x00C8
110192 #define PCI_DEVICE_ID_NEO_2DB9PRI 0x00C9
110193 #define PCI_DEVICE_ID_NEO_2RJ45 0x00CA
110194 @@ -2323,9 +2321,6 @@
110195 #define PCI_DEVICE_ID_INTEL_82378 0x0484
110196 #define PCI_DEVICE_ID_INTEL_I960 0x0960
110197 #define PCI_DEVICE_ID_INTEL_I960RM 0x0962
110198 -#define PCI_DEVICE_ID_INTEL_8257X_SOL 0x1062
110199 -#define PCI_DEVICE_ID_INTEL_82573E_SOL 0x1085
110200 -#define PCI_DEVICE_ID_INTEL_82573L_SOL 0x108F
110201 #define PCI_DEVICE_ID_INTEL_82815_MC 0x1130
110202 #define PCI_DEVICE_ID_INTEL_82815_CGC 0x1132
110203 #define PCI_DEVICE_ID_INTEL_82092AA_0 0x1221
110204 @@ -2430,7 +2425,6 @@
110205 #define PCI_DEVICE_ID_INTEL_ICH7_0 0x27b8
110206 #define PCI_DEVICE_ID_INTEL_ICH7_1 0x27b9
110207 #define PCI_DEVICE_ID_INTEL_ICH7_30 0x27b0
110208 -#define PCI_DEVICE_ID_INTEL_TGP_LPC 0x27bc
110209 #define PCI_DEVICE_ID_INTEL_ICH7_31 0x27bd
110210 #define PCI_DEVICE_ID_INTEL_ICH7_17 0x27da
110211 #define PCI_DEVICE_ID_INTEL_ICH7_19 0x27dd
110212 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/phonet.h linux-2.6.29-rc3.owrt/include/linux/phonet.h
110213 --- linux-2.6.29.owrt/include/linux/phonet.h 2009-05-10 22:04:37.000000000 +0200
110214 +++ linux-2.6.29-rc3.owrt/include/linux/phonet.h 2009-05-10 23:48:29.000000000 +0200
110215 @@ -23,8 +23,6 @@
110216 #ifndef LINUX_PHONET_H
110217 #define LINUX_PHONET_H
110218
110219 -#include <linux/types.h>
110220 -
110221 /* Automatic protocol selection */
110222 #define PN_PROTO_TRANSPORT 0
110223 /* Phonet datagram socket */
110224 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/pkt_cls.h linux-2.6.29-rc3.owrt/include/linux/pkt_cls.h
110225 --- linux-2.6.29.owrt/include/linux/pkt_cls.h 2009-05-10 22:04:37.000000000 +0200
110226 +++ linux-2.6.29-rc3.owrt/include/linux/pkt_cls.h 2009-05-10 23:48:29.000000000 +0200
110227 @@ -1,7 +1,6 @@
110228 #ifndef __LINUX_PKT_CLS_H
110229 #define __LINUX_PKT_CLS_H
110230
110231 -#include <linux/types.h>
110232 #include <linux/pkt_sched.h>
110233
110234 /* I think i could have done better macros ; for now this is stolen from
110235 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/pkt_sched.h linux-2.6.29-rc3.owrt/include/linux/pkt_sched.h
110236 --- linux-2.6.29.owrt/include/linux/pkt_sched.h 2009-05-10 22:04:37.000000000 +0200
110237 +++ linux-2.6.29-rc3.owrt/include/linux/pkt_sched.h 2009-05-10 23:48:29.000000000 +0200
110238 @@ -1,8 +1,6 @@
110239 #ifndef __LINUX_PKT_SCHED_H
110240 #define __LINUX_PKT_SCHED_H
110241
110242 -#include <linux/types.h>
110243 -
110244 /* Logical priority bands not depending on specific packet scheduler.
110245 Every scheduler will map them to real traffic classes, if it has
110246 no more precise mechanism to classify packets.
110247 @@ -544,7 +542,7 @@
110248
110249 struct tc_drr_stats
110250 {
110251 - __u32 deficit;
110252 + u32 deficit;
110253 };
110254
110255 #endif
110256 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/pm.h linux-2.6.29-rc3.owrt/include/linux/pm.h
110257 --- linux-2.6.29.owrt/include/linux/pm.h 2009-05-10 22:04:37.000000000 +0200
110258 +++ linux-2.6.29-rc3.owrt/include/linux/pm.h 2009-05-10 23:48:29.000000000 +0200
110259 @@ -381,12 +381,10 @@
110260
110261 #ifdef CONFIG_PM_SLEEP
110262 extern void device_pm_lock(void);
110263 -extern int sysdev_resume(void);
110264 extern void device_power_up(pm_message_t state);
110265 extern void device_resume(pm_message_t state);
110266
110267 extern void device_pm_unlock(void);
110268 -extern int sysdev_suspend(pm_message_t state);
110269 extern int device_power_down(pm_message_t state);
110270 extern int device_suspend(pm_message_t state);
110271 extern int device_prepare_suspend(pm_message_t state);
110272 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/ppp_defs.h linux-2.6.29-rc3.owrt/include/linux/ppp_defs.h
110273 --- linux-2.6.29.owrt/include/linux/ppp_defs.h 2009-05-10 22:04:37.000000000 +0200
110274 +++ linux-2.6.29-rc3.owrt/include/linux/ppp_defs.h 2009-05-10 23:48:29.000000000 +0200
110275 @@ -25,8 +25,6 @@
110276 * OR MODIFICATIONS.
110277 */
110278
110279 -#include <linux/types.h>
110280 -
110281 /*
110282 * ==FILEVERSION 20000114==
110283 *
110284 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/raid/md_p.h linux-2.6.29-rc3.owrt/include/linux/raid/md_p.h
110285 --- linux-2.6.29.owrt/include/linux/raid/md_p.h 2009-05-10 22:04:37.000000000 +0200
110286 +++ linux-2.6.29-rc3.owrt/include/linux/raid/md_p.h 2009-05-10 23:48:29.000000000 +0200
110287 @@ -15,8 +15,6 @@
110288 #ifndef _MD_P_H
110289 #define _MD_P_H
110290
110291 -#include <linux/types.h>
110292 -
110293 /*
110294 * RAID superblock.
110295 *
110296 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/random.h linux-2.6.29-rc3.owrt/include/linux/random.h
110297 --- linux-2.6.29.owrt/include/linux/random.h 2009-05-10 22:04:37.000000000 +0200
110298 +++ linux-2.6.29-rc3.owrt/include/linux/random.h 2009-05-10 23:48:29.000000000 +0200
110299 @@ -7,7 +7,6 @@
110300 #ifndef _LINUX_RANDOM_H
110301 #define _LINUX_RANDOM_H
110302
110303 -#include <linux/types.h>
110304 #include <linux/ioctl.h>
110305 #include <linux/irqnr.h>
110306
110307 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/rcuclassic.h linux-2.6.29-rc3.owrt/include/linux/rcuclassic.h
110308 --- linux-2.6.29.owrt/include/linux/rcuclassic.h 2009-05-10 22:04:37.000000000 +0200
110309 +++ linux-2.6.29-rc3.owrt/include/linux/rcuclassic.h 2009-05-10 23:48:29.000000000 +0200
110310 @@ -181,10 +181,4 @@
110311 #define rcu_enter_nohz() do { } while (0)
110312 #define rcu_exit_nohz() do { } while (0)
110313
110314 -/* A context switch is a grace period for rcuclassic. */
110315 -static inline int rcu_blocking_is_gp(void)
110316 -{
110317 - return num_online_cpus() == 1;
110318 -}
110319 -
110320 #endif /* __LINUX_RCUCLASSIC_H */
110321 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/rcupdate.h linux-2.6.29-rc3.owrt/include/linux/rcupdate.h
110322 --- linux-2.6.29.owrt/include/linux/rcupdate.h 2009-05-10 22:04:37.000000000 +0200
110323 +++ linux-2.6.29-rc3.owrt/include/linux/rcupdate.h 2009-05-10 23:48:29.000000000 +0200
110324 @@ -52,9 +52,6 @@
110325 void (*func)(struct rcu_head *head);
110326 };
110327
110328 -/* Internal to kernel, but needed by rcupreempt.h. */
110329 -extern int rcu_scheduler_active;
110330 -
110331 #if defined(CONFIG_CLASSIC_RCU)
110332 #include <linux/rcuclassic.h>
110333 #elif defined(CONFIG_TREE_RCU)
110334 @@ -268,7 +265,6 @@
110335
110336 /* Internal to kernel */
110337 extern void rcu_init(void);
110338 -extern void rcu_scheduler_starting(void);
110339 extern int rcu_needs_cpu(int cpu);
110340
110341 #endif /* __LINUX_RCUPDATE_H */
110342 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/rcupreempt.h linux-2.6.29-rc3.owrt/include/linux/rcupreempt.h
110343 --- linux-2.6.29.owrt/include/linux/rcupreempt.h 2009-05-10 22:04:37.000000000 +0200
110344 +++ linux-2.6.29-rc3.owrt/include/linux/rcupreempt.h 2009-05-10 23:48:29.000000000 +0200
110345 @@ -142,19 +142,4 @@
110346 #define rcu_exit_nohz() do { } while (0)
110347 #endif /* CONFIG_NO_HZ */
110348
110349 -/*
110350 - * A context switch is a grace period for rcupreempt synchronize_rcu()
110351 - * only during early boot, before the scheduler has been initialized.
110352 - * So, how the heck do we get a context switch? Well, if the caller
110353 - * invokes synchronize_rcu(), they are willing to accept a context
110354 - * switch, so we simply pretend that one happened.
110355 - *
110356 - * After boot, there might be a blocked or preempted task in an RCU
110357 - * read-side critical section, so we cannot then take the fastpath.
110358 - */
110359 -static inline int rcu_blocking_is_gp(void)
110360 -{
110361 - return num_online_cpus() == 1 && !rcu_scheduler_active;
110362 -}
110363 -
110364 #endif /* __LINUX_RCUPREEMPT_H */
110365 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/rcutree.h linux-2.6.29-rc3.owrt/include/linux/rcutree.h
110366 --- linux-2.6.29.owrt/include/linux/rcutree.h 2009-05-10 22:04:37.000000000 +0200
110367 +++ linux-2.6.29-rc3.owrt/include/linux/rcutree.h 2009-05-10 23:48:29.000000000 +0200
110368 @@ -326,10 +326,4 @@
110369 }
110370 #endif /* CONFIG_NO_HZ */
110371
110372 -/* A context switch is a grace period for rcutree. */
110373 -static inline int rcu_blocking_is_gp(void)
110374 -{
110375 - return num_online_cpus() == 1;
110376 -}
110377 -
110378 #endif /* __LINUX_RCUTREE_H */
110379 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/rtnetlink.h linux-2.6.29-rc3.owrt/include/linux/rtnetlink.h
110380 --- linux-2.6.29.owrt/include/linux/rtnetlink.h 2009-05-10 22:04:37.000000000 +0200
110381 +++ linux-2.6.29-rc3.owrt/include/linux/rtnetlink.h 2009-05-10 23:48:29.000000000 +0200
110382 @@ -1,7 +1,6 @@
110383 #ifndef __LINUX_RTNETLINK_H
110384 #define __LINUX_RTNETLINK_H
110385
110386 -#include <linux/types.h>
110387 #include <linux/netlink.h>
110388 #include <linux/if_link.h>
110389 #include <linux/if_addr.h>
110390 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/sched.h linux-2.6.29-rc3.owrt/include/linux/sched.h
110391 --- linux-2.6.29.owrt/include/linux/sched.h 2009-05-10 22:04:37.000000000 +0200
110392 +++ linux-2.6.29-rc3.owrt/include/linux/sched.h 2009-05-10 23:48:29.000000000 +0200
110393 @@ -453,33 +453,23 @@
110394 cputime_t utime;
110395 cputime_t stime;
110396 unsigned long long sum_exec_runtime;
110397 + spinlock_t lock;
110398 };
110399 /* Alternate field names when used to cache expirations. */
110400 #define prof_exp stime
110401 #define virt_exp utime
110402 #define sched_exp sum_exec_runtime
110403
110404 -#define INIT_CPUTIME \
110405 - (struct task_cputime) { \
110406 - .utime = cputime_zero, \
110407 - .stime = cputime_zero, \
110408 - .sum_exec_runtime = 0, \
110409 - }
110410 -
110411 /**
110412 - * struct thread_group_cputimer - thread group interval timer counts
110413 - * @cputime: thread group interval timers.
110414 - * @running: non-zero when there are timers running and
110415 - * @cputime receives updates.
110416 - * @lock: lock for fields in this struct.
110417 + * struct thread_group_cputime - thread group interval timer counts
110418 + * @totals: thread group interval timers; substructure for
110419 + * uniprocessor kernel, per-cpu for SMP kernel.
110420 *
110421 * This structure contains the version of task_cputime, above, that is
110422 - * used for thread group CPU timer calculations.
110423 + * used for thread group CPU clock calculations.
110424 */
110425 -struct thread_group_cputimer {
110426 - struct task_cputime cputime;
110427 - int running;
110428 - spinlock_t lock;
110429 +struct thread_group_cputime {
110430 + struct task_cputime totals;
110431 };
110432
110433 /*
110434 @@ -528,10 +518,10 @@
110435 cputime_t it_prof_incr, it_virt_incr;
110436
110437 /*
110438 - * Thread group totals for process CPU timers.
110439 - * See thread_group_cputimer(), et al, for details.
110440 + * Thread group totals for process CPU clocks.
110441 + * See thread_group_cputime(), et al, for details.
110442 */
110443 - struct thread_group_cputimer cputimer;
110444 + struct thread_group_cputime cputime;
110445
110446 /* Earliest-expiration cache. */
110447 struct task_cputime cputime_expires;
110448 @@ -568,7 +558,7 @@
110449 * Live threads maintain their own counters and add to these
110450 * in __exit_signal, except for the group leader.
110451 */
110452 - cputime_t utime, stime, cutime, cstime;
110453 + cputime_t cutime, cstime;
110454 cputime_t gtime;
110455 cputime_t cgtime;
110456 unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw;
110457 @@ -577,14 +567,6 @@
110458 struct task_io_accounting ioac;
110459
110460 /*
110461 - * Cumulative ns of schedule CPU time fo dead threads in the
110462 - * group, not including a zombie group leader, (This only differs
110463 - * from jiffies_to_ns(utime + stime) if sched_clock uses something
110464 - * other than jiffies.)
110465 - */
110466 - unsigned long long sum_sched_runtime;
110467 -
110468 - /*
110469 * We don't bother to synchronize most readers of this at all,
110470 * because there is no reader checking a limit that actually needs
110471 * to get both rlim_cur and rlim_max atomically, and either one
110472 @@ -648,6 +630,7 @@
110473 atomic_t inotify_devs; /* How many inotify devs does this user have opened? */
110474 #endif
110475 #ifdef CONFIG_EPOLL
110476 + atomic_t epoll_devs; /* The number of epoll descriptors currently open */
110477 atomic_t epoll_watches; /* The number of file descriptors currently watched */
110478 #endif
110479 #ifdef CONFIG_POSIX_MQUEUE
110480 @@ -1419,9 +1402,6 @@
110481 #endif
110482 };
110483
110484 -/* Future-safe accessor for struct task_struct's cpus_allowed. */
110485 -#define tsk_cpumask(tsk) (&(tsk)->cpus_allowed)
110486 -
110487 /*
110488 * Priority of a process goes from 0..MAX_PRIO-1, valid RT
110489 * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH
110490 @@ -2203,14 +2183,27 @@
110491 /*
110492 * Thread group CPU time accounting.
110493 */
110494 -void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times);
110495 -void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times);
110496 +
110497 +static inline
110498 +void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times)
110499 +{
110500 + struct task_cputime *totals = &tsk->signal->cputime.totals;
110501 + unsigned long flags;
110502 +
110503 + spin_lock_irqsave(&totals->lock, flags);
110504 + *times = *totals;
110505 + spin_unlock_irqrestore(&totals->lock, flags);
110506 +}
110507
110508 static inline void thread_group_cputime_init(struct signal_struct *sig)
110509 {
110510 - sig->cputimer.cputime = INIT_CPUTIME;
110511 - spin_lock_init(&sig->cputimer.lock);
110512 - sig->cputimer.running = 0;
110513 + sig->cputime.totals = (struct task_cputime){
110514 + .utime = cputime_zero,
110515 + .stime = cputime_zero,
110516 + .sum_exec_runtime = 0,
110517 + };
110518 +
110519 + spin_lock_init(&sig->cputime.totals.lock);
110520 }
110521
110522 static inline void thread_group_cputime_free(struct signal_struct *sig)
110523 @@ -2294,13 +2287,9 @@
110524 extern int sched_group_set_rt_period(struct task_group *tg,
110525 long rt_period_us);
110526 extern long sched_group_rt_period(struct task_group *tg);
110527 -extern int sched_rt_can_attach(struct task_group *tg, struct task_struct *tsk);
110528 #endif
110529 #endif
110530
110531 -extern int task_can_switch_user(struct user_struct *up,
110532 - struct task_struct *tsk);
110533 -
110534 #ifdef CONFIG_TASK_XACCT
110535 static inline void add_rchar(struct task_struct *tsk, ssize_t amt)
110536 {
110537 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/seq_file.h linux-2.6.29-rc3.owrt/include/linux/seq_file.h
110538 --- linux-2.6.29.owrt/include/linux/seq_file.h 2009-05-10 22:04:37.000000000 +0200
110539 +++ linux-2.6.29-rc3.owrt/include/linux/seq_file.h 2009-05-10 23:48:29.000000000 +0200
110540 @@ -19,7 +19,6 @@
110541 size_t from;
110542 size_t count;
110543 loff_t index;
110544 - loff_t read_pos;
110545 u64 version;
110546 struct mutex lock;
110547 const struct seq_operations *op;
110548 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/serial_core.h linux-2.6.29-rc3.owrt/include/linux/serial_core.h
110549 --- linux-2.6.29.owrt/include/linux/serial_core.h 2009-05-10 22:04:37.000000000 +0200
110550 +++ linux-2.6.29-rc3.owrt/include/linux/serial_core.h 2009-05-10 23:48:29.000000000 +0200
110551 @@ -296,7 +296,6 @@
110552 #define UPF_HARDPPS_CD ((__force upf_t) (1 << 11))
110553 #define UPF_LOW_LATENCY ((__force upf_t) (1 << 13))
110554 #define UPF_BUGGY_UART ((__force upf_t) (1 << 14))
110555 -#define UPF_NO_TXEN_TEST ((__force upf_t) (1 << 15))
110556 #define UPF_MAGIC_MULTIPLIER ((__force upf_t) (1 << 16))
110557 #define UPF_CONS_FLOW ((__force upf_t) (1 << 23))
110558 #define UPF_SHARE_IRQ ((__force upf_t) (1 << 24))
110559 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/serio.h linux-2.6.29-rc3.owrt/include/linux/serio.h
110560 --- linux-2.6.29.owrt/include/linux/serio.h 2009-05-10 22:04:37.000000000 +0200
110561 +++ linux-2.6.29-rc3.owrt/include/linux/serio.h 2009-05-10 23:48:29.000000000 +0200
110562 @@ -212,7 +212,7 @@
110563 #define SERIO_FUJITSU 0x35
110564 #define SERIO_ZHENHUA 0x36
110565 #define SERIO_INEXIO 0x37
110566 -#define SERIO_TOUCHIT213 0x38
110567 +#define SERIO_TOUCHIT213 0x37
110568 #define SERIO_W8001 0x39
110569
110570 #endif
110571 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/signalfd.h linux-2.6.29-rc3.owrt/include/linux/signalfd.h
110572 --- linux-2.6.29.owrt/include/linux/signalfd.h 2009-05-10 22:04:37.000000000 +0200
110573 +++ linux-2.6.29-rc3.owrt/include/linux/signalfd.h 2009-05-10 23:48:29.000000000 +0200
110574 @@ -8,7 +8,6 @@
110575 #ifndef _LINUX_SIGNALFD_H
110576 #define _LINUX_SIGNALFD_H
110577
110578 -#include <linux/types.h>
110579 /* For O_CLOEXEC and O_NONBLOCK */
110580 #include <linux/fcntl.h>
110581
110582 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/skbuff.h linux-2.6.29-rc3.owrt/include/linux/skbuff.h
110583 --- linux-2.6.29.owrt/include/linux/skbuff.h 2009-05-10 22:04:37.000000000 +0200
110584 +++ linux-2.6.29-rc3.owrt/include/linux/skbuff.h 2009-05-10 23:48:29.000000000 +0200
110585 @@ -434,6 +434,15 @@
110586 void *here);
110587 extern void skb_under_panic(struct sk_buff *skb, int len,
110588 void *here);
110589 +extern void skb_truesize_bug(struct sk_buff *skb);
110590 +
110591 +static inline void skb_truesize_check(struct sk_buff *skb)
110592 +{
110593 + int len = sizeof(struct sk_buff) + skb->len;
110594 +
110595 + if (unlikely((int)skb->truesize < len))
110596 + skb_truesize_bug(skb);
110597 +}
110598
110599 extern int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb,
110600 int getfrag(void *from, char *to, int offset,
110601 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/slab_def.h linux-2.6.29-rc3.owrt/include/linux/slab_def.h
110602 --- linux-2.6.29.owrt/include/linux/slab_def.h 2009-05-10 22:04:37.000000000 +0200
110603 +++ linux-2.6.29-rc3.owrt/include/linux/slab_def.h 2009-05-10 23:48:29.000000000 +0200
110604 @@ -43,7 +43,10 @@
110605 i++;
110606 #include <linux/kmalloc_sizes.h>
110607 #undef CACHE
110608 - return NULL;
110609 + {
110610 + extern void __you_cannot_kmalloc_that_much(void);
110611 + __you_cannot_kmalloc_that_much();
110612 + }
110613 found:
110614 #ifdef CONFIG_ZONE_DMA
110615 if (flags & GFP_DMA)
110616 @@ -74,7 +77,10 @@
110617 i++;
110618 #include <linux/kmalloc_sizes.h>
110619 #undef CACHE
110620 - return NULL;
110621 + {
110622 + extern void __you_cannot_kmalloc_that_much(void);
110623 + __you_cannot_kmalloc_that_much();
110624 + }
110625 found:
110626 #ifdef CONFIG_ZONE_DMA
110627 if (flags & GFP_DMA)
110628 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/slab.h linux-2.6.29-rc3.owrt/include/linux/slab.h
110629 --- linux-2.6.29.owrt/include/linux/slab.h 2009-05-10 22:04:37.000000000 +0200
110630 +++ linux-2.6.29-rc3.owrt/include/linux/slab.h 2009-05-10 23:48:29.000000000 +0200
110631 @@ -127,7 +127,6 @@
110632 void * __must_check __krealloc(const void *, size_t, gfp_t);
110633 void * __must_check krealloc(const void *, size_t, gfp_t);
110634 void kfree(const void *);
110635 -void kzfree(const void *);
110636 size_t ksize(const void *);
110637
110638 /*
110639 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/soundcard.h linux-2.6.29-rc3.owrt/include/linux/soundcard.h
110640 --- linux-2.6.29.owrt/include/linux/soundcard.h 2009-05-10 22:04:37.000000000 +0200
110641 +++ linux-2.6.29-rc3.owrt/include/linux/soundcard.h 2009-05-10 23:48:29.000000000 +0200
110642 @@ -1045,36 +1045,50 @@
110643 */
110644 #define LOCL_STARTAUDIO 1
110645
110646 -#if !defined(__KERNEL__) || defined(USE_SEQ_MACROS)
110647 +#if (!defined(__KERNEL__) && !defined(KERNEL) && !defined(INKERNEL) && !defined(_KERNEL)) || defined(USE_SEQ_MACROS)
110648 /*
110649 * Some convenience macros to simplify programming of the
110650 * /dev/sequencer interface
110651 *
110652 - * This is a legacy interface for applications written against
110653 - * the OSSlib-3.8 style interface. It is no longer possible
110654 - * to actually link against OSSlib with this header, but we
110655 - * still provide these macros for programs using them.
110656 - *
110657 - * If you want to use OSSlib, it is recommended that you get
110658 - * the GPL version of OSS-4.x and build against that version
110659 - * of the header.
110660 - *
110661 - * We redefine the extern keyword so that make headers_check
110662 - * does not complain about SEQ_USE_EXTBUF.
110663 + * These macros define the API which should be used when possible.
110664 */
110665 #define SEQ_DECLAREBUF() SEQ_USE_EXTBUF()
110666
110667 void seqbuf_dump(void); /* This function must be provided by programs */
110668
110669 -#define SEQ_PM_DEFINES int __foo_bar___
110670 -
110671 -#define SEQ_LOAD_GMINSTR(dev, instr)
110672 -#define SEQ_LOAD_GMDRUM(dev, drum)
110673 +extern int OSS_init(int seqfd, int buflen);
110674 +extern void OSS_seqbuf_dump(int fd, unsigned char *buf, int buflen);
110675 +extern void OSS_seq_advbuf(int len, int fd, unsigned char *buf, int buflen);
110676 +extern void OSS_seq_needbuf(int len, int fd, unsigned char *buf, int buflen);
110677 +extern void OSS_patch_caching(int dev, int chn, int patch,
110678 + int fd, unsigned char *buf, int buflen);
110679 +extern void OSS_drum_caching(int dev, int chn, int patch,
110680 + int fd, unsigned char *buf, int buflen);
110681 +extern void OSS_write_patch(int fd, unsigned char *buf, int len);
110682 +extern int OSS_write_patch2(int fd, unsigned char *buf, int len);
110683
110684 -#define _SEQ_EXTERN extern
110685 -#define SEQ_USE_EXTBUF() \
110686 - _SEQ_EXTERN unsigned char _seqbuf[]; \
110687 - _SEQ_EXTERN int _seqbuflen; _SEQ_EXTERN int _seqbufptr
110688 +#define SEQ_PM_DEFINES int __foo_bar___
110689 +#ifdef OSSLIB
110690 +# define SEQ_USE_EXTBUF() \
110691 + extern unsigned char *_seqbuf; \
110692 + extern int _seqbuflen;extern int _seqbufptr
110693 +# define SEQ_DEFINEBUF(len) SEQ_USE_EXTBUF();static int _requested_seqbuflen=len
110694 +# define _SEQ_ADVBUF(len) OSS_seq_advbuf(len, seqfd, _seqbuf, _seqbuflen)
110695 +# define _SEQ_NEEDBUF(len) OSS_seq_needbuf(len, seqfd, _seqbuf, _seqbuflen)
110696 +# define SEQ_DUMPBUF() OSS_seqbuf_dump(seqfd, _seqbuf, _seqbuflen)
110697 +
110698 +# define SEQ_LOAD_GMINSTR(dev, instr) \
110699 + OSS_patch_caching(dev, -1, instr, seqfd, _seqbuf, _seqbuflen)
110700 +# define SEQ_LOAD_GMDRUM(dev, drum) \
110701 + OSS_drum_caching(dev, -1, drum, seqfd, _seqbuf, _seqbuflen)
110702 +#else /* !OSSLIB */
110703 +
110704 +# define SEQ_LOAD_GMINSTR(dev, instr)
110705 +# define SEQ_LOAD_GMDRUM(dev, drum)
110706 +
110707 +# define SEQ_USE_EXTBUF() \
110708 + extern unsigned char _seqbuf[]; \
110709 + extern int _seqbuflen;extern int _seqbufptr
110710
110711 #ifndef USE_SIMPLE_MACROS
110712 /* Sample seqbuf_dump() implementation:
110713 @@ -1117,6 +1131,7 @@
110714 */
110715 #define _SEQ_NEEDBUF(len) /* empty */
110716 #endif
110717 +#endif /* !OSSLIB */
110718
110719 #define SEQ_VOLUME_MODE(dev, mode) {_SEQ_NEEDBUF(8);\
110720 _seqbuf[_seqbufptr] = SEQ_EXTENDED;\
110721 @@ -1200,8 +1215,14 @@
110722 _CHN_COMMON(dev, MIDI_CHN_PRESSURE, chn, pressure, 0, 0)
110723
110724 #define SEQ_SET_PATCH SEQ_PGM_CHANGE
110725 -#define SEQ_PGM_CHANGE(dev, chn, patch) \
110726 +#ifdef OSSLIB
110727 +# define SEQ_PGM_CHANGE(dev, chn, patch) \
110728 + {OSS_patch_caching(dev, chn, patch, seqfd, _seqbuf, _seqbuflen); \
110729 + _CHN_COMMON(dev, MIDI_PGM_CHANGE, chn, patch, 0, 0);}
110730 +#else
110731 +# define SEQ_PGM_CHANGE(dev, chn, patch) \
110732 _CHN_COMMON(dev, MIDI_PGM_CHANGE, chn, patch, 0, 0)
110733 +#endif
110734
110735 #define SEQ_CONTROL(dev, chn, controller, value) \
110736 _CHN_COMMON(dev, MIDI_CTL_CHANGE, chn, controller, 0, value)
110737 @@ -1279,12 +1300,19 @@
110738 /*
110739 * Patch loading.
110740 */
110741 -#define SEQ_WRPATCH(patchx, len) \
110742 +#ifdef OSSLIB
110743 +# define SEQ_WRPATCH(patchx, len) \
110744 + OSS_write_patch(seqfd, (char*)(patchx), len)
110745 +# define SEQ_WRPATCH2(patchx, len) \
110746 + OSS_write_patch2(seqfd, (char*)(patchx), len)
110747 +#else
110748 +# define SEQ_WRPATCH(patchx, len) \
110749 {if (_seqbufptr) SEQ_DUMPBUF();\
110750 if (write(seqfd, (char*)(patchx), len)==-1) \
110751 perror("Write patch: /dev/sequencer");}
110752 -#define SEQ_WRPATCH2(patchx, len) \
110753 +# define SEQ_WRPATCH2(patchx, len) \
110754 (SEQ_DUMPBUF(), write(seqfd, (char*)(patchx), len))
110755 +#endif
110756
110757 #endif
110758 #endif
110759 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/sound.h linux-2.6.29-rc3.owrt/include/linux/sound.h
110760 --- linux-2.6.29.owrt/include/linux/sound.h 2009-05-10 22:04:37.000000000 +0200
110761 +++ linux-2.6.29-rc3.owrt/include/linux/sound.h 2009-05-10 23:48:29.000000000 +0200
110762 @@ -25,7 +25,6 @@
110763 #define SND_DEV_AMIDI 13 /* Like /dev/midi (obsolete) */
110764 #define SND_DEV_ADMMIDI 14 /* Like /dev/dmmidi (onsolete) */
110765
110766 -#ifdef __KERNEL__
110767 /*
110768 * Sound core interface functions
110769 */
110770 @@ -41,4 +40,3 @@
110771 extern void unregister_sound_mixer(int unit);
110772 extern void unregister_sound_midi(int unit);
110773 extern void unregister_sound_dsp(int unit);
110774 -#endif /* __KERNEL__ */
110775 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/spi/spi_bitbang.h linux-2.6.29-rc3.owrt/include/linux/spi/spi_bitbang.h
110776 --- linux-2.6.29.owrt/include/linux/spi/spi_bitbang.h 2009-05-10 22:04:37.000000000 +0200
110777 +++ linux-2.6.29-rc3.owrt/include/linux/spi/spi_bitbang.h 2009-05-10 23:48:29.000000000 +0200
110778 @@ -83,13 +83,6 @@
110779 * int getmiso(struct spi_device *);
110780 * void spidelay(unsigned);
110781 *
110782 - * setsck()'s is_on parameter is a zero/nonzero boolean.
110783 - *
110784 - * setmosi()'s is_on parameter is a zero/nonzero boolean.
110785 - *
110786 - * getmiso() is required to return 0 or 1 only. Any other value is invalid
110787 - * and will result in improper operation.
110788 - *
110789 * A non-inlined routine would call bitbang_txrx_*() routines. The
110790 * main loop could easily compile down to a handful of instructions,
110791 * especially if the delay is a NOP (to run at peak speed).
110792 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/spi/spidev.h linux-2.6.29-rc3.owrt/include/linux/spi/spidev.h
110793 --- linux-2.6.29.owrt/include/linux/spi/spidev.h 2009-05-10 22:04:37.000000000 +0200
110794 +++ linux-2.6.29-rc3.owrt/include/linux/spi/spidev.h 2009-05-10 23:48:29.000000000 +0200
110795 @@ -22,7 +22,6 @@
110796 #ifndef SPIDEV_H
110797 #define SPIDEV_H
110798
110799 -#include <linux/types.h>
110800
110801 /* User space versions of kernel symbols for SPI clocking modes,
110802 * matching <linux/spi/spi.h>
110803 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/spinlock.h linux-2.6.29-rc3.owrt/include/linux/spinlock.h
110804 --- linux-2.6.29.owrt/include/linux/spinlock.h 2009-05-10 22:04:37.000000000 +0200
110805 +++ linux-2.6.29-rc3.owrt/include/linux/spinlock.h 2009-05-10 23:48:29.000000000 +0200
110806 @@ -124,12 +124,7 @@
110807 #ifdef CONFIG_GENERIC_LOCKBREAK
110808 #define spin_is_contended(lock) ((lock)->break_lock)
110809 #else
110810 -
110811 -#ifdef __raw_spin_is_contended
110812 #define spin_is_contended(lock) __raw_spin_is_contended(&(lock)->raw_lock)
110813 -#else
110814 -#define spin_is_contended(lock) (((void)(lock), 0))
110815 -#endif /*__raw_spin_is_contended*/
110816 #endif
110817
110818 /**
110819 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/synclink.h linux-2.6.29-rc3.owrt/include/linux/synclink.h
110820 --- linux-2.6.29.owrt/include/linux/synclink.h 2009-05-10 22:04:37.000000000 +0200
110821 +++ linux-2.6.29-rc3.owrt/include/linux/synclink.h 2009-05-10 23:48:29.000000000 +0200
110822 @@ -13,8 +13,6 @@
110823 #define _SYNCLINK_H_
110824 #define SYNCLINK_H_VERSION 3.6
110825
110826 -#include <linux/types.h>
110827 -
110828 #define BIT0 0x0001
110829 #define BIT1 0x0002
110830 #define BIT2 0x0004
110831 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/syscalls.h linux-2.6.29-rc3.owrt/include/linux/syscalls.h
110832 --- linux-2.6.29.owrt/include/linux/syscalls.h 2009-05-10 22:04:37.000000000 +0200
110833 +++ linux-2.6.29-rc3.owrt/include/linux/syscalls.h 2009-05-10 23:48:29.000000000 +0200
110834 @@ -95,47 +95,42 @@
110835 #define __SC_TEST5(t5, a5, ...) __SC_TEST(t5); __SC_TEST4(__VA_ARGS__)
110836 #define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__)
110837
110838 -#define SYSCALL_DEFINE0(name) asmlinkage long sys_##name(void)
110839 -#define SYSCALL_DEFINE1(name, ...) SYSCALL_DEFINEx(1, _##name, __VA_ARGS__)
110840 -#define SYSCALL_DEFINE2(name, ...) SYSCALL_DEFINEx(2, _##name, __VA_ARGS__)
110841 -#define SYSCALL_DEFINE3(name, ...) SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
110842 -#define SYSCALL_DEFINE4(name, ...) SYSCALL_DEFINEx(4, _##name, __VA_ARGS__)
110843 -#define SYSCALL_DEFINE5(name, ...) SYSCALL_DEFINEx(5, _##name, __VA_ARGS__)
110844 -#define SYSCALL_DEFINE6(name, ...) SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
110845 +#define SYSCALL_DEFINE0(name) asmlinkage long sys_##name(void)
110846 +#define SYSCALL_DEFINE1(...) SYSCALL_DEFINEx(1, __VA_ARGS__)
110847 +#define SYSCALL_DEFINE2(...) SYSCALL_DEFINEx(2, __VA_ARGS__)
110848 +#define SYSCALL_DEFINE3(...) SYSCALL_DEFINEx(3, __VA_ARGS__)
110849 +#define SYSCALL_DEFINE4(...) SYSCALL_DEFINEx(4, __VA_ARGS__)
110850 +#define SYSCALL_DEFINE5(...) SYSCALL_DEFINEx(5, __VA_ARGS__)
110851 +#define SYSCALL_DEFINE6(...) SYSCALL_DEFINEx(6, __VA_ARGS__)
110852
110853 #ifdef CONFIG_PPC64
110854 #define SYSCALL_ALIAS(alias, name) \
110855 asm ("\t.globl " #alias "\n\t.set " #alias ", " #name "\n" \
110856 "\t.globl ." #alias "\n\t.set ." #alias ", ." #name)
110857 #else
110858 -#ifdef CONFIG_ALPHA
110859 -#define SYSCALL_ALIAS(alias, name) \
110860 - asm ( #alias " = " #name "\n\t.globl " #alias)
110861 -#else
110862 #define SYSCALL_ALIAS(alias, name) \
110863 asm ("\t.globl " #alias "\n\t.set " #alias ", " #name)
110864 #endif
110865 -#endif
110866
110867 #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
110868
110869 #define SYSCALL_DEFINE(name) static inline long SYSC_##name
110870 #define SYSCALL_DEFINEx(x, name, ...) \
110871 - asmlinkage long sys##name(__SC_DECL##x(__VA_ARGS__)); \
110872 - static inline long SYSC##name(__SC_DECL##x(__VA_ARGS__)); \
110873 - asmlinkage long SyS##name(__SC_LONG##x(__VA_ARGS__)) \
110874 + asmlinkage long sys_##name(__SC_DECL##x(__VA_ARGS__)); \
110875 + static inline long SYSC_##name(__SC_DECL##x(__VA_ARGS__)); \
110876 + asmlinkage long SyS_##name(__SC_LONG##x(__VA_ARGS__)) \
110877 { \
110878 __SC_TEST##x(__VA_ARGS__); \
110879 - return (long) SYSC##name(__SC_CAST##x(__VA_ARGS__)); \
110880 + return (long) SYSC_##name(__SC_CAST##x(__VA_ARGS__)); \
110881 } \
110882 - SYSCALL_ALIAS(sys##name, SyS##name); \
110883 - static inline long SYSC##name(__SC_DECL##x(__VA_ARGS__))
110884 + SYSCALL_ALIAS(sys_##name, SyS_##name); \
110885 + static inline long SYSC_##name(__SC_DECL##x(__VA_ARGS__))
110886
110887 #else /* CONFIG_HAVE_SYSCALL_WRAPPERS */
110888
110889 #define SYSCALL_DEFINE(name) asmlinkage long sys_##name
110890 #define SYSCALL_DEFINEx(x, name, ...) \
110891 - asmlinkage long sys##name(__SC_DECL##x(__VA_ARGS__))
110892 + asmlinkage long sys_##name(__SC_DECL##x(__VA_ARGS__))
110893
110894 #endif /* CONFIG_HAVE_SYSCALL_WRAPPERS */
110895
110896 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/taskstats.h linux-2.6.29-rc3.owrt/include/linux/taskstats.h
110897 --- linux-2.6.29.owrt/include/linux/taskstats.h 2009-05-10 22:04:37.000000000 +0200
110898 +++ linux-2.6.29-rc3.owrt/include/linux/taskstats.h 2009-05-10 23:48:29.000000000 +0200
110899 @@ -16,8 +16,6 @@
110900 #ifndef _LINUX_TASKSTATS_H
110901 #define _LINUX_TASKSTATS_H
110902
110903 -#include <linux/types.h>
110904 -
110905 /* Format for per-task data returned to userland when
110906 * - a task exits
110907 * - listener requests stats for a task
110908 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/tc_act/tc_gact.h linux-2.6.29-rc3.owrt/include/linux/tc_act/tc_gact.h
110909 --- linux-2.6.29.owrt/include/linux/tc_act/tc_gact.h 2009-05-10 22:04:37.000000000 +0200
110910 +++ linux-2.6.29-rc3.owrt/include/linux/tc_act/tc_gact.h 2009-05-10 23:48:29.000000000 +0200
110911 @@ -1,7 +1,6 @@
110912 #ifndef __LINUX_TC_GACT_H
110913 #define __LINUX_TC_GACT_H
110914
110915 -#include <linux/types.h>
110916 #include <linux/pkt_cls.h>
110917
110918 #define TCA_ACT_GACT 5
110919 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/tc_act/tc_mirred.h linux-2.6.29-rc3.owrt/include/linux/tc_act/tc_mirred.h
110920 --- linux-2.6.29.owrt/include/linux/tc_act/tc_mirred.h 2009-05-10 22:04:37.000000000 +0200
110921 +++ linux-2.6.29-rc3.owrt/include/linux/tc_act/tc_mirred.h 2009-05-10 23:48:29.000000000 +0200
110922 @@ -1,7 +1,6 @@
110923 #ifndef __LINUX_TC_MIR_H
110924 #define __LINUX_TC_MIR_H
110925
110926 -#include <linux/types.h>
110927 #include <linux/pkt_cls.h>
110928
110929 #define TCA_ACT_MIRRED 8
110930 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/tc_act/tc_pedit.h linux-2.6.29-rc3.owrt/include/linux/tc_act/tc_pedit.h
110931 --- linux-2.6.29.owrt/include/linux/tc_act/tc_pedit.h 2009-05-10 22:04:37.000000000 +0200
110932 +++ linux-2.6.29-rc3.owrt/include/linux/tc_act/tc_pedit.h 2009-05-10 23:48:29.000000000 +0200
110933 @@ -1,7 +1,6 @@
110934 #ifndef __LINUX_TC_PED_H
110935 #define __LINUX_TC_PED_H
110936
110937 -#include <linux/types.h>
110938 #include <linux/pkt_cls.h>
110939
110940 #define TCA_ACT_PEDIT 7
110941 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/tc_ematch/tc_em_cmp.h linux-2.6.29-rc3.owrt/include/linux/tc_ematch/tc_em_cmp.h
110942 --- linux-2.6.29.owrt/include/linux/tc_ematch/tc_em_cmp.h 2009-05-10 22:04:37.000000000 +0200
110943 +++ linux-2.6.29-rc3.owrt/include/linux/tc_ematch/tc_em_cmp.h 2009-05-10 23:48:29.000000000 +0200
110944 @@ -1,7 +1,6 @@
110945 #ifndef __LINUX_TC_EM_CMP_H
110946 #define __LINUX_TC_EM_CMP_H
110947
110948 -#include <linux/types.h>
110949 #include <linux/pkt_cls.h>
110950
110951 struct tcf_em_cmp
110952 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/tc_ematch/tc_em_meta.h linux-2.6.29-rc3.owrt/include/linux/tc_ematch/tc_em_meta.h
110953 --- linux-2.6.29.owrt/include/linux/tc_ematch/tc_em_meta.h 2009-05-10 22:04:37.000000000 +0200
110954 +++ linux-2.6.29-rc3.owrt/include/linux/tc_ematch/tc_em_meta.h 2009-05-10 23:48:29.000000000 +0200
110955 @@ -1,7 +1,6 @@
110956 #ifndef __LINUX_TC_EM_META_H
110957 #define __LINUX_TC_EM_META_H
110958
110959 -#include <linux/types.h>
110960 #include <linux/pkt_cls.h>
110961
110962 enum
110963 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/tc_ematch/tc_em_nbyte.h linux-2.6.29-rc3.owrt/include/linux/tc_ematch/tc_em_nbyte.h
110964 --- linux-2.6.29.owrt/include/linux/tc_ematch/tc_em_nbyte.h 2009-05-10 22:04:37.000000000 +0200
110965 +++ linux-2.6.29-rc3.owrt/include/linux/tc_ematch/tc_em_nbyte.h 2009-05-10 23:48:29.000000000 +0200
110966 @@ -1,7 +1,6 @@
110967 #ifndef __LINUX_TC_EM_NBYTE_H
110968 #define __LINUX_TC_EM_NBYTE_H
110969
110970 -#include <linux/types.h>
110971 #include <linux/pkt_cls.h>
110972
110973 struct tcf_em_nbyte
110974 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/tc_ematch/tc_em_text.h linux-2.6.29-rc3.owrt/include/linux/tc_ematch/tc_em_text.h
110975 --- linux-2.6.29.owrt/include/linux/tc_ematch/tc_em_text.h 2009-05-10 22:04:37.000000000 +0200
110976 +++ linux-2.6.29-rc3.owrt/include/linux/tc_ematch/tc_em_text.h 2009-05-10 23:48:29.000000000 +0200
110977 @@ -1,7 +1,6 @@
110978 #ifndef __LINUX_TC_EM_TEXT_H
110979 #define __LINUX_TC_EM_TEXT_H
110980
110981 -#include <linux/types.h>
110982 #include <linux/pkt_cls.h>
110983
110984 #define TC_EM_TEXT_ALGOSIZ 16
110985 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/timerfd.h linux-2.6.29-rc3.owrt/include/linux/timerfd.h
110986 --- linux-2.6.29.owrt/include/linux/timerfd.h 2009-05-10 22:04:37.000000000 +0200
110987 +++ linux-2.6.29-rc3.owrt/include/linux/timerfd.h 2009-05-10 23:48:29.000000000 +0200
110988 @@ -11,21 +11,13 @@
110989 /* For O_CLOEXEC and O_NONBLOCK */
110990 #include <linux/fcntl.h>
110991
110992 -/*
110993 - * CAREFUL: Check include/asm-generic/fcntl.h when defining
110994 - * new flags, since they might collide with O_* ones. We want
110995 - * to re-use O_* flags that couldn't possibly have a meaning
110996 - * from eventfd, in order to leave a free define-space for
110997 - * shared O_* flags.
110998 - */
110999 +/* Flags for timerfd_settime. */
111000 #define TFD_TIMER_ABSTIME (1 << 0)
111001 +
111002 +/* Flags for timerfd_create. */
111003 #define TFD_CLOEXEC O_CLOEXEC
111004 #define TFD_NONBLOCK O_NONBLOCK
111005
111006 -#define TFD_SHARED_FCNTL_FLAGS (TFD_CLOEXEC | TFD_NONBLOCK)
111007 -/* Flags for timerfd_create. */
111008 -#define TFD_CREATE_FLAGS TFD_SHARED_FCNTL_FLAGS
111009 -/* Flags for timerfd_settime. */
111010 -#define TFD_SETTIME_FLAGS TFD_TIMER_ABSTIME
111011
111012 #endif /* _LINUX_TIMERFD_H */
111013 +
111014 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/usb/cdc.h linux-2.6.29-rc3.owrt/include/linux/usb/cdc.h
111015 --- linux-2.6.29.owrt/include/linux/usb/cdc.h 2009-05-10 22:04:37.000000000 +0200
111016 +++ linux-2.6.29-rc3.owrt/include/linux/usb/cdc.h 2009-05-10 23:48:29.000000000 +0200
111017 @@ -9,8 +9,6 @@
111018 #ifndef __LINUX_USB_CDC_H
111019 #define __LINUX_USB_CDC_H
111020
111021 -#include <linux/types.h>
111022 -
111023 #define USB_CDC_SUBCLASS_ACM 0x02
111024 #define USB_CDC_SUBCLASS_ETHERNET 0x06
111025 #define USB_CDC_SUBCLASS_WHCM 0x08
111026 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/usb/gadgetfs.h linux-2.6.29-rc3.owrt/include/linux/usb/gadgetfs.h
111027 --- linux-2.6.29.owrt/include/linux/usb/gadgetfs.h 2009-05-10 22:04:37.000000000 +0200
111028 +++ linux-2.6.29-rc3.owrt/include/linux/usb/gadgetfs.h 2009-05-10 23:48:29.000000000 +0200
111029 @@ -18,7 +18,7 @@
111030 #ifndef __LINUX_USB_GADGETFS_H
111031 #define __LINUX_USB_GADGETFS_H
111032
111033 -#include <linux/types.h>
111034 +#include <asm/types.h>
111035 #include <asm/ioctl.h>
111036
111037 #include <linux/usb/ch9.h>
111038 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/user_namespace.h linux-2.6.29-rc3.owrt/include/linux/user_namespace.h
111039 --- linux-2.6.29.owrt/include/linux/user_namespace.h 2009-05-10 22:04:37.000000000 +0200
111040 +++ linux-2.6.29-rc3.owrt/include/linux/user_namespace.h 2009-05-10 23:48:29.000000000 +0200
111041 @@ -13,7 +13,6 @@
111042 struct kref kref;
111043 struct hlist_head uidhash_table[UIDHASH_SZ];
111044 struct user_struct *creator;
111045 - struct work_struct destroyer;
111046 };
111047
111048 extern struct user_namespace init_user_ns;
111049 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/video_decoder.h linux-2.6.29-rc3.owrt/include/linux/video_decoder.h
111050 --- linux-2.6.29.owrt/include/linux/video_decoder.h 2009-05-10 22:04:37.000000000 +0200
111051 +++ linux-2.6.29-rc3.owrt/include/linux/video_decoder.h 2009-05-10 23:48:29.000000000 +0200
111052 @@ -1,8 +1,6 @@
111053 #ifndef _LINUX_VIDEO_DECODER_H
111054 #define _LINUX_VIDEO_DECODER_H
111055
111056 -#include <linux/types.h>
111057 -
111058 #define HAVE_VIDEO_DECODER 1
111059
111060 struct video_decoder_capability { /* this name is too long */
111061 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/videodev.h linux-2.6.29-rc3.owrt/include/linux/videodev.h
111062 --- linux-2.6.29.owrt/include/linux/videodev.h 2009-05-10 22:04:37.000000000 +0200
111063 +++ linux-2.6.29-rc3.owrt/include/linux/videodev.h 2009-05-10 23:48:29.000000000 +0200
111064 @@ -12,7 +12,6 @@
111065 #ifndef __LINUX_VIDEODEV_H
111066 #define __LINUX_VIDEODEV_H
111067
111068 -#include <linux/types.h>
111069 #include <linux/ioctl.h>
111070 #include <linux/videodev2.h>
111071
111072 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/video_encoder.h linux-2.6.29-rc3.owrt/include/linux/video_encoder.h
111073 --- linux-2.6.29.owrt/include/linux/video_encoder.h 2009-05-10 22:04:37.000000000 +0200
111074 +++ linux-2.6.29-rc3.owrt/include/linux/video_encoder.h 2009-05-10 23:48:29.000000000 +0200
111075 @@ -1,8 +1,6 @@
111076 #ifndef _LINUX_VIDEO_ENCODER_H
111077 #define _LINUX_VIDEO_ENCODER_H
111078
111079 -#include <linux/types.h>
111080 -
111081 struct video_encoder_capability { /* this name is too long */
111082 __u32 flags;
111083 #define VIDEO_ENCODER_PAL 1 /* can encode PAL signal */
111084 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/virtio_blk.h linux-2.6.29-rc3.owrt/include/linux/virtio_blk.h
111085 --- linux-2.6.29.owrt/include/linux/virtio_blk.h 2009-05-10 22:04:37.000000000 +0200
111086 +++ linux-2.6.29-rc3.owrt/include/linux/virtio_blk.h 2009-05-10 23:48:29.000000000 +0200
111087 @@ -2,7 +2,6 @@
111088 #define _LINUX_VIRTIO_BLK_H
111089 /* This header is BSD licensed so anyone can use the definitions to implement
111090 * compatible drivers/servers. */
111091 -#include <linux/types.h>
111092 #include <linux/virtio_config.h>
111093
111094 /* The ID for virtio_block */
111095 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/virtio_console.h linux-2.6.29-rc3.owrt/include/linux/virtio_console.h
111096 --- linux-2.6.29.owrt/include/linux/virtio_console.h 2009-05-10 22:04:37.000000000 +0200
111097 +++ linux-2.6.29-rc3.owrt/include/linux/virtio_console.h 2009-05-10 23:48:29.000000000 +0200
111098 @@ -1,6 +1,5 @@
111099 #ifndef _LINUX_VIRTIO_CONSOLE_H
111100 #define _LINUX_VIRTIO_CONSOLE_H
111101 -#include <linux/types.h>
111102 #include <linux/virtio_config.h>
111103 /* This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so
111104 * anyone can use the definitions to implement compatible drivers/servers. */
111105 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/virtio_net.h linux-2.6.29-rc3.owrt/include/linux/virtio_net.h
111106 --- linux-2.6.29.owrt/include/linux/virtio_net.h 2009-05-10 22:04:37.000000000 +0200
111107 +++ linux-2.6.29-rc3.owrt/include/linux/virtio_net.h 2009-05-10 23:48:29.000000000 +0200
111108 @@ -2,7 +2,6 @@
111109 #define _LINUX_VIRTIO_NET_H
111110 /* This header is BSD licensed so anyone can use the definitions to implement
111111 * compatible drivers/servers. */
111112 -#include <linux/types.h>
111113 #include <linux/virtio_config.h>
111114
111115 /* The ID for virtio_net */
111116 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/vmalloc.h linux-2.6.29-rc3.owrt/include/linux/vmalloc.h
111117 --- linux-2.6.29.owrt/include/linux/vmalloc.h 2009-05-10 22:04:37.000000000 +0200
111118 +++ linux-2.6.29-rc3.owrt/include/linux/vmalloc.h 2009-05-10 23:48:29.000000000 +0200
111119 @@ -84,10 +84,6 @@
111120 unsigned long flags, void *caller);
111121 extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags,
111122 unsigned long start, unsigned long end);
111123 -extern struct vm_struct *__get_vm_area_caller(unsigned long size,
111124 - unsigned long flags,
111125 - unsigned long start, unsigned long end,
111126 - void *caller);
111127 extern struct vm_struct *get_vm_area_node(unsigned long size,
111128 unsigned long flags, int node,
111129 gfp_t gfp_mask);
111130 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/linux/wait.h linux-2.6.29-rc3.owrt/include/linux/wait.h
111131 --- linux-2.6.29.owrt/include/linux/wait.h 2009-05-10 22:04:37.000000000 +0200
111132 +++ linux-2.6.29-rc3.owrt/include/linux/wait.h 2009-05-10 23:48:29.000000000 +0200
111133 @@ -132,8 +132,6 @@
111134 list_del(&old->task_list);
111135 }
111136
111137 -void __wake_up_common(wait_queue_head_t *q, unsigned int mode,
111138 - int nr_exclusive, int sync, void *key);
111139 void __wake_up(wait_queue_head_t *q, unsigned int mode, int nr, void *key);
111140 extern void __wake_up_locked(wait_queue_head_t *q, unsigned int mode);
111141 extern void __wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr);
111142 @@ -335,19 +333,16 @@
111143 for (;;) { \
111144 prepare_to_wait_exclusive(&wq, &__wait, \
111145 TASK_INTERRUPTIBLE); \
111146 - if (condition) { \
111147 - finish_wait(&wq, &__wait); \
111148 + if (condition) \
111149 break; \
111150 - } \
111151 if (!signal_pending(current)) { \
111152 schedule(); \
111153 continue; \
111154 } \
111155 ret = -ERESTARTSYS; \
111156 - abort_exclusive_wait(&wq, &__wait, \
111157 - TASK_INTERRUPTIBLE, NULL); \
111158 break; \
111159 } \
111160 + finish_wait(&wq, &__wait); \
111161 } while (0)
111162
111163 #define wait_event_interruptible_exclusive(wq, condition) \
111164 @@ -436,8 +431,6 @@
111165 void prepare_to_wait(wait_queue_head_t *q, wait_queue_t *wait, int state);
111166 void prepare_to_wait_exclusive(wait_queue_head_t *q, wait_queue_t *wait, int state);
111167 void finish_wait(wait_queue_head_t *q, wait_queue_t *wait);
111168 -void abort_exclusive_wait(wait_queue_head_t *q, wait_queue_t *wait,
111169 - unsigned int mode, void *key);
111170 int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
111171 int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
111172
111173 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/media/v4l2-device.h linux-2.6.29-rc3.owrt/include/media/v4l2-device.h
111174 --- linux-2.6.29.owrt/include/media/v4l2-device.h 2009-05-10 22:04:38.000000000 +0200
111175 +++ linux-2.6.29-rc3.owrt/include/media/v4l2-device.h 2009-05-10 23:48:29.000000000 +0200
111176 @@ -94,16 +94,16 @@
111177 /* Call the specified callback for all subdevs matching grp_id (if 0, then
111178 match them all). Ignore any errors. Note that you cannot add or delete
111179 a subdev while walking the subdevs list. */
111180 -#define v4l2_device_call_all(dev, grpid, o, f, args...) \
111181 +#define v4l2_device_call_all(dev, grp_id, o, f, args...) \
111182 __v4l2_device_call_subdevs(dev, \
111183 - !(grpid) || sd->grp_id == (grpid), o, f , ##args)
111184 + !(grp_id) || sd->grp_id == (grp_id), o, f , ##args)
111185
111186 /* Call the specified callback for all subdevs matching grp_id (if 0, then
111187 match them all). If the callback returns an error other than 0 or
111188 -ENOIOCTLCMD, then return with that error code. Note that you cannot
111189 add or delete a subdev while walking the subdevs list. */
111190 -#define v4l2_device_call_until_err(dev, grpid, o, f, args...) \
111191 +#define v4l2_device_call_until_err(dev, grp_id, o, f, args...) \
111192 __v4l2_device_call_subdevs_until_err(dev, \
111193 - !(grpid) || sd->grp_id == (grpid), o, f , ##args)
111194 + !(grp_id) || sd->grp_id == (grp_id), o, f , ##args)
111195
111196 #endif
111197 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/media/videobuf-dma-sg.h linux-2.6.29-rc3.owrt/include/media/videobuf-dma-sg.h
111198 --- linux-2.6.29.owrt/include/media/videobuf-dma-sg.h 2009-05-10 22:04:38.000000000 +0200
111199 +++ linux-2.6.29-rc3.owrt/include/media/videobuf-dma-sg.h 2009-05-10 23:48:29.000000000 +0200
111200 @@ -49,7 +49,7 @@
111201 * does memory allocation too using vmalloc_32().
111202 *
111203 * videobuf_dma_*()
111204 - * see Documentation/PCI/PCI-DMA-mapping.txt, these functions to
111205 + * see Documentation/DMA-mapping.txt, these functions to
111206 * basically the same. The map function does also build a
111207 * scatterlist for the buffer (and unmap frees it ...)
111208 *
111209 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/mtd/inftl-user.h linux-2.6.29-rc3.owrt/include/mtd/inftl-user.h
111210 --- linux-2.6.29.owrt/include/mtd/inftl-user.h 2009-05-10 22:04:38.000000000 +0200
111211 +++ linux-2.6.29-rc3.owrt/include/mtd/inftl-user.h 2009-05-10 23:48:29.000000000 +0200
111212 @@ -6,8 +6,6 @@
111213 #ifndef __MTD_INFTL_USER_H__
111214 #define __MTD_INFTL_USER_H__
111215
111216 -#include <linux/types.h>
111217 -
111218 #define OSAK_VERSION 0x5120
111219 #define PERCENTUSED 98
111220
111221 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/mtd/ubi-user.h linux-2.6.29-rc3.owrt/include/mtd/ubi-user.h
111222 --- linux-2.6.29.owrt/include/mtd/ubi-user.h 2009-05-10 22:04:38.000000000 +0200
111223 +++ linux-2.6.29-rc3.owrt/include/mtd/ubi-user.h 2009-05-10 23:48:29.000000000 +0200
111224 @@ -40,37 +40,37 @@
111225 * UBI volume creation
111226 * ~~~~~~~~~~~~~~~~~~~
111227 *
111228 - * UBI volumes are created via the %UBI_IOCMKVOL ioctl command of UBI character
111229 + * UBI volumes are created via the %UBI_IOCMKVOL IOCTL command of UBI character
111230 * device. A &struct ubi_mkvol_req object has to be properly filled and a
111231 - * pointer to it has to be passed to the ioctl.
111232 + * pointer to it has to be passed to the IOCTL.
111233 *
111234 * UBI volume deletion
111235 * ~~~~~~~~~~~~~~~~~~~
111236 *
111237 - * To delete a volume, the %UBI_IOCRMVOL ioctl command of the UBI character
111238 + * To delete a volume, the %UBI_IOCRMVOL IOCTL command of the UBI character
111239 * device should be used. A pointer to the 32-bit volume ID hast to be passed
111240 - * to the ioctl.
111241 + * to the IOCTL.
111242 *
111243 * UBI volume re-size
111244 * ~~~~~~~~~~~~~~~~~~
111245 *
111246 - * To re-size a volume, the %UBI_IOCRSVOL ioctl command of the UBI character
111247 + * To re-size a volume, the %UBI_IOCRSVOL IOCTL command of the UBI character
111248 * device should be used. A &struct ubi_rsvol_req object has to be properly
111249 - * filled and a pointer to it has to be passed to the ioctl.
111250 + * filled and a pointer to it has to be passed to the IOCTL.
111251 *
111252 * UBI volumes re-name
111253 * ~~~~~~~~~~~~~~~~~~~
111254 *
111255 * To re-name several volumes atomically at one go, the %UBI_IOCRNVOL command
111256 * of the UBI character device should be used. A &struct ubi_rnvol_req object
111257 - * has to be properly filled and a pointer to it has to be passed to the ioctl.
111258 + * has to be properly filled and a pointer to it has to be passed to the IOCTL.
111259 *
111260 * UBI volume update
111261 * ~~~~~~~~~~~~~~~~~
111262 *
111263 - * Volume update should be done via the %UBI_IOCVOLUP ioctl command of the
111264 + * Volume update should be done via the %UBI_IOCVOLUP IOCTL command of the
111265 * corresponding UBI volume character device. A pointer to a 64-bit update
111266 - * size should be passed to the ioctl. After this, UBI expects user to write
111267 + * size should be passed to the IOCTL. After this, UBI expects user to write
111268 * this number of bytes to the volume character device. The update is finished
111269 * when the claimed number of bytes is passed. So, the volume update sequence
111270 * is something like:
111271 @@ -80,58 +80,14 @@
111272 * write(fd, buf, image_size);
111273 * close(fd);
111274 *
111275 - * Logical eraseblock erase
111276 + * Atomic eraseblock change
111277 * ~~~~~~~~~~~~~~~~~~~~~~~~
111278 *
111279 - * To erase a logical eraseblock, the %UBI_IOCEBER ioctl command of the
111280 - * corresponding UBI volume character device should be used. This command
111281 - * unmaps the requested logical eraseblock, makes sure the corresponding
111282 - * physical eraseblock is successfully erased, and returns.
111283 - *
111284 - * Atomic logical eraseblock change
111285 - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
111286 - *
111287 - * Atomic logical eraseblock change operation is called using the %UBI_IOCEBCH
111288 - * ioctl command of the corresponding UBI volume character device. A pointer to
111289 - * a &struct ubi_leb_change_req object has to be passed to the ioctl. Then the
111290 - * user is expected to write the requested amount of bytes (similarly to what
111291 - * should be done in case of the "volume update" ioctl).
111292 - *
111293 - * Logical eraseblock map
111294 - * ~~~~~~~~~~~~~~~~~~~~~
111295 - *
111296 - * To map a logical eraseblock to a physical eraseblock, the %UBI_IOCEBMAP
111297 - * ioctl command should be used. A pointer to a &struct ubi_map_req object is
111298 - * expected to be passed. The ioctl maps the requested logical eraseblock to
111299 - * a physical eraseblock and returns. Only non-mapped logical eraseblocks can
111300 - * be mapped. If the logical eraseblock specified in the request is already
111301 - * mapped to a physical eraseblock, the ioctl fails and returns error.
111302 - *
111303 - * Logical eraseblock unmap
111304 - * ~~~~~~~~~~~~~~~~~~~~~~~~
111305 - *
111306 - * To unmap a logical eraseblock to a physical eraseblock, the %UBI_IOCEBUNMAP
111307 - * ioctl command should be used. The ioctl unmaps the logical eraseblocks,
111308 - * schedules corresponding physical eraseblock for erasure, and returns. Unlike
111309 - * the "LEB erase" command, it does not wait for the physical eraseblock being
111310 - * erased. Note, the side effect of this is that if an unclean reboot happens
111311 - * after the unmap ioctl returns, you may find the LEB mapped again to the same
111312 - * physical eraseblock after the UBI is run again.
111313 - *
111314 - * Check if logical eraseblock is mapped
111315 - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
111316 - *
111317 - * To check if a logical eraseblock is mapped to a physical eraseblock, the
111318 - * %UBI_IOCEBISMAP ioctl command should be used. It returns %0 if the LEB is
111319 - * not mapped, and %1 if it is mapped.
111320 - *
111321 - * Set an UBI volume property
111322 - * ~~~~~~~~~~~~~~~~~~~~~~~~~
111323 - *
111324 - * To set an UBI volume property the %UBI_IOCSETPROP ioctl command should be
111325 - * used. A pointer to a &struct ubi_set_prop_req object is expected to be
111326 - * passed. The object describes which property should be set, and to which value
111327 - * it should be set.
111328 + * Atomic eraseblock change operation is done via the %UBI_IOCEBCH IOCTL
111329 + * command of the corresponding UBI volume character device. A pointer to
111330 + * &struct ubi_leb_change_req has to be passed to the IOCTL. Then the user is
111331 + * expected to write the requested amount of bytes. This is similar to the
111332 + * "volume update" IOCTL.
111333 */
111334
111335 /*
111336 @@ -145,7 +101,7 @@
111337 /* Maximum volume name length */
111338 #define UBI_MAX_VOLUME_NAME 127
111339
111340 -/* ioctl commands of UBI character devices */
111341 +/* IOCTL commands of UBI character devices */
111342
111343 #define UBI_IOC_MAGIC 'o'
111344
111345 @@ -158,7 +114,7 @@
111346 /* Re-name volumes */
111347 #define UBI_IOCRNVOL _IOW(UBI_IOC_MAGIC, 3, struct ubi_rnvol_req)
111348
111349 -/* ioctl commands of the UBI control character device */
111350 +/* IOCTL commands of the UBI control character device */
111351
111352 #define UBI_CTRL_IOC_MAGIC 'o'
111353
111354 @@ -167,24 +123,16 @@
111355 /* Detach an MTD device */
111356 #define UBI_IOCDET _IOW(UBI_CTRL_IOC_MAGIC, 65, int32_t)
111357
111358 -/* ioctl commands of UBI volume character devices */
111359 +/* IOCTL commands of UBI volume character devices */
111360
111361 #define UBI_VOL_IOC_MAGIC 'O'
111362
111363 /* Start UBI volume update */
111364 #define UBI_IOCVOLUP _IOW(UBI_VOL_IOC_MAGIC, 0, int64_t)
111365 -/* LEB erasure command, used for debugging, disabled by default */
111366 +/* An eraseblock erasure command, used for debugging, disabled by default */
111367 #define UBI_IOCEBER _IOW(UBI_VOL_IOC_MAGIC, 1, int32_t)
111368 -/* Atomic LEB change command */
111369 +/* An atomic eraseblock change command */
111370 #define UBI_IOCEBCH _IOW(UBI_VOL_IOC_MAGIC, 2, int32_t)
111371 -/* Map LEB command */
111372 -#define UBI_IOCEBMAP _IOW(UBI_VOL_IOC_MAGIC, 3, struct ubi_map_req)
111373 -/* Unmap LEB command */
111374 -#define UBI_IOCEBUNMAP _IOW(UBI_VOL_IOC_MAGIC, 4, int32_t)
111375 -/* Check if LEB is mapped command */
111376 -#define UBI_IOCEBISMAP _IOR(UBI_VOL_IOC_MAGIC, 5, int32_t)
111377 -/* Set an UBI volume property */
111378 -#define UBI_IOCSETPROP _IOW(UBI_VOL_IOC_MAGIC, 6, struct ubi_set_prop_req)
111379
111380 /* Maximum MTD device name length supported by UBI */
111381 #define MAX_UBI_MTD_NAME_LEN 127
111382 @@ -220,16 +168,6 @@
111383 UBI_STATIC_VOLUME = 4,
111384 };
111385
111386 -/*
111387 - * UBI set property ioctl constants
111388 - *
111389 - * @UBI_PROP_DIRECT_WRITE: allow / disallow user to directly write and
111390 - * erase individual eraseblocks on dynamic volumes
111391 - */
111392 -enum {
111393 - UBI_PROP_DIRECT_WRITE = 1,
111394 -};
111395 -
111396 /**
111397 * struct ubi_attach_req - attach MTD device request.
111398 * @ubi_num: UBI device number to create
111399 @@ -367,8 +305,8 @@
111400 } __attribute__ ((packed));
111401
111402 /**
111403 - * struct ubi_leb_change_req - a data structure used in atomic LEB change
111404 - * requests.
111405 + * struct ubi_leb_change_req - a data structure used in atomic logical
111406 + * eraseblock change requests.
111407 * @lnum: logical eraseblock number to change
111408 * @bytes: how many bytes will be written to the logical eraseblock
111409 * @dtype: data type (%UBI_LONGTERM, %UBI_SHORTTERM, %UBI_UNKNOWN)
111410 @@ -381,30 +319,4 @@
111411 int8_t padding[7];
111412 } __attribute__ ((packed));
111413
111414 -/**
111415 - * struct ubi_map_req - a data structure used in map LEB requests.
111416 - * @lnum: logical eraseblock number to unmap
111417 - * @dtype: data type (%UBI_LONGTERM, %UBI_SHORTTERM, %UBI_UNKNOWN)
111418 - * @padding: reserved for future, not used, has to be zeroed
111419 - */
111420 -struct ubi_map_req {
111421 - int32_t lnum;
111422 - int8_t dtype;
111423 - int8_t padding[3];
111424 -} __attribute__ ((packed));
111425 -
111426 -
111427 -/**
111428 - * struct ubi_set_prop_req - a data structure used to set an ubi volume
111429 - * property.
111430 - * @property: property to set (%UBI_PROP_DIRECT_WRITE)
111431 - * @padding: reserved for future, not used, has to be zeroed
111432 - * @value: value to set
111433 - */
111434 -struct ubi_set_prop_req {
111435 - uint8_t property;
111436 - uint8_t padding[7];
111437 - uint64_t value;
111438 -} __attribute__ ((packed));
111439 -
111440 #endif /* __UBI_USER_H__ */
111441 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/net/inet_hashtables.h linux-2.6.29-rc3.owrt/include/net/inet_hashtables.h
111442 --- linux-2.6.29.owrt/include/net/inet_hashtables.h 2009-05-10 22:04:38.000000000 +0200
111443 +++ linux-2.6.29-rc3.owrt/include/net/inet_hashtables.h 2009-05-10 23:48:29.000000000 +0200
111444 @@ -182,7 +182,7 @@
111445 size = 2048;
111446 if (nr_pcpus >= 32)
111447 size = 4096;
111448 - if (sizeof(spinlock_t) != 0) {
111449 + if (sizeof(rwlock_t) != 0) {
111450 #ifdef CONFIG_NUMA
111451 if (size * sizeof(spinlock_t) > PAGE_SIZE)
111452 hashinfo->ehash_locks = vmalloc(size * sizeof(spinlock_t));
111453 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/net/netfilter/nf_conntrack_core.h linux-2.6.29-rc3.owrt/include/net/netfilter/nf_conntrack_core.h
111454 --- linux-2.6.29.owrt/include/net/netfilter/nf_conntrack_core.h 2009-05-10 22:04:38.000000000 +0200
111455 +++ linux-2.6.29-rc3.owrt/include/net/netfilter/nf_conntrack_core.h 2009-05-10 23:48:29.000000000 +0200
111456 @@ -59,11 +59,10 @@
111457 struct nf_conn *ct = (struct nf_conn *)skb->nfct;
111458 int ret = NF_ACCEPT;
111459
111460 - if (ct && ct != &nf_conntrack_untracked) {
111461 + if (ct) {
111462 if (!nf_ct_is_confirmed(ct) && !nf_ct_is_dying(ct))
111463 ret = __nf_conntrack_confirm(skb);
111464 - if (likely(ret == NF_ACCEPT))
111465 - nf_ct_deliver_cached_events(ct);
111466 + nf_ct_deliver_cached_events(ct);
111467 }
111468 return ret;
111469 }
111470 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/net/net_namespace.h linux-2.6.29-rc3.owrt/include/net/net_namespace.h
111471 --- linux-2.6.29.owrt/include/net/net_namespace.h 2009-05-10 22:04:38.000000000 +0200
111472 +++ linux-2.6.29-rc3.owrt/include/net/net_namespace.h 2009-05-10 23:48:29.000000000 +0200
111473 @@ -109,6 +109,11 @@
111474 #ifdef CONFIG_NET_NS
111475 extern void __put_net(struct net *net);
111476
111477 +static inline int net_alive(struct net *net)
111478 +{
111479 + return net && atomic_read(&net->count);
111480 +}
111481 +
111482 static inline struct net *get_net(struct net *net)
111483 {
111484 atomic_inc(&net->count);
111485 @@ -140,6 +145,11 @@
111486 }
111487 #else
111488
111489 +static inline int net_alive(struct net *net)
111490 +{
111491 + return 1;
111492 +}
111493 +
111494 static inline struct net *get_net(struct net *net)
111495 {
111496 return net;
111497 @@ -224,23 +234,6 @@
111498 void (*exit)(struct net *net);
111499 };
111500
111501 -/*
111502 - * Use these carefully. If you implement a network device and it
111503 - * needs per network namespace operations use device pernet operations,
111504 - * otherwise use pernet subsys operations.
111505 - *
111506 - * This is critically important. Most of the network code cleanup
111507 - * runs with the assumption that dev_remove_pack has been called so no
111508 - * new packets will arrive during and after the cleanup functions have
111509 - * been called. dev_remove_pack is not per namespace so instead the
111510 - * guarantee of no more packets arriving in a network namespace is
111511 - * provided by ensuring that all network devices and all sockets have
111512 - * left the network namespace before the cleanup methods are called.
111513 - *
111514 - * For the longest time the ipv4 icmp code was registered as a pernet
111515 - * device which caused kernel oops, and panics during network
111516 - * namespace cleanup. So please don't get this wrong.
111517 - */
111518 extern int register_pernet_subsys(struct pernet_operations *);
111519 extern void unregister_pernet_subsys(struct pernet_operations *);
111520 extern int register_pernet_gen_subsys(int *id, struct pernet_operations *);
111521 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/net/sock.h linux-2.6.29-rc3.owrt/include/net/sock.h
111522 --- linux-2.6.29.owrt/include/net/sock.h 2009-05-10 22:04:37.000000000 +0200
111523 +++ linux-2.6.29-rc3.owrt/include/net/sock.h 2009-05-10 23:48:29.000000000 +0200
111524 @@ -860,6 +860,7 @@
111525
111526 static inline void sk_wmem_free_skb(struct sock *sk, struct sk_buff *skb)
111527 {
111528 + skb_truesize_check(skb);
111529 sock_set_flag(sk, SOCK_QUEUE_SHRUNK);
111530 sk->sk_wmem_queued -= skb->truesize;
111531 sk_mem_uncharge(sk, skb->truesize);
111532 @@ -1307,7 +1308,7 @@
111533
111534 static inline gfp_t gfp_any(void)
111535 {
111536 - return in_softirq() ? GFP_ATOMIC : GFP_KERNEL;
111537 + return in_atomic() ? GFP_ATOMIC : GFP_KERNEL;
111538 }
111539
111540 static inline long sock_rcvtimeo(const struct sock *sk, int noblock)
111541 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/scsi/fc/fc_fcoe.h linux-2.6.29-rc3.owrt/include/scsi/fc/fc_fcoe.h
111542 --- linux-2.6.29.owrt/include/scsi/fc/fc_fcoe.h 2009-05-10 22:04:38.000000000 +0200
111543 +++ linux-2.6.29-rc3.owrt/include/scsi/fc/fc_fcoe.h 2009-05-10 23:48:29.000000000 +0200
111544 @@ -31,6 +31,10 @@
111545 #define ETH_P_FCOE 0x8906 /* FCOE ether type */
111546 #endif
111547
111548 +#ifndef ETH_P_8021Q
111549 +#define ETH_P_8021Q 0x8100
111550 +#endif
111551 +
111552 /*
111553 * FC_FCOE_OUI hasn't been standardized yet. XXX TBD.
111554 */
111555 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/scsi/fc/fc_fs.h linux-2.6.29-rc3.owrt/include/scsi/fc/fc_fs.h
111556 --- linux-2.6.29.owrt/include/scsi/fc/fc_fs.h 2009-05-10 22:04:38.000000000 +0200
111557 +++ linux-2.6.29-rc3.owrt/include/scsi/fc/fc_fs.h 2009-05-10 23:48:29.000000000 +0200
111558 @@ -337,9 +337,4 @@
111559 FC_RJT_VENDOR = 0xff, /* vendor specific reject */
111560 };
111561
111562 -/* default timeout values */
111563 -
111564 -#define FC_DEF_E_D_TOV 2000UL
111565 -#define FC_DEF_R_A_TOV 10000UL
111566 -
111567 #endif /* _FC_FS_H_ */
111568 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/scsi/libfc.h linux-2.6.29-rc3.owrt/include/scsi/libfc.h
111569 --- linux-2.6.29.owrt/include/scsi/libfc.h 2009-05-10 22:04:38.000000000 +0200
111570 +++ linux-2.6.29-rc3.owrt/include/scsi/libfc.h 2009-05-10 23:48:29.000000000 +0200
111571 @@ -68,6 +68,9 @@
111572 /*
111573 * FC HBA status
111574 */
111575 +#define FC_PAUSE (1 << 1)
111576 +#define FC_LINK_UP (1 << 0)
111577 +
111578 enum fc_lport_state {
111579 LPORT_ST_NONE = 0,
111580 LPORT_ST_FLOGI,
111581 @@ -336,17 +339,31 @@
111582
111583 struct libfc_function_template {
111584
111585 + /**
111586 + * Mandatory Fields
111587 + *
111588 + * These handlers must be implemented by the LLD.
111589 + */
111590 +
111591 /*
111592 * Interface to send a FC frame
111593 - *
111594 - * STATUS: REQUIRED
111595 */
111596 int (*frame_send)(struct fc_lport *lp, struct fc_frame *fp);
111597
111598 - /*
111599 - * Interface to send ELS/CT frames
111600 + /**
111601 + * Optional Fields
111602 *
111603 - * STATUS: OPTIONAL
111604 + * The LLD may choose to implement any of the following handlers.
111605 + * If LLD doesn't specify hander and leaves its pointer NULL then
111606 + * the default libfc function will be used for that handler.
111607 + */
111608 +
111609 + /**
111610 + * ELS/CT interfaces
111611 + */
111612 +
111613 + /*
111614 + * elsct_send - sends ELS/CT frame
111615 */
111616 struct fc_seq *(*elsct_send)(struct fc_lport *lport,
111617 struct fc_rport *rport,
111618 @@ -356,6 +373,9 @@
111619 struct fc_frame *fp,
111620 void *arg),
111621 void *arg, u32 timer_msec);
111622 + /**
111623 + * Exhance Manager interfaces
111624 + */
111625
111626 /*
111627 * Send the FC frame payload using a new exchange and sequence.
111628 @@ -387,8 +407,6 @@
111629 * timer_msec argument is specified. The timer is canceled when
111630 * it fires or when the exchange is done. The exchange timeout handler
111631 * is registered by EM layer.
111632 - *
111633 - * STATUS: OPTIONAL
111634 */
111635 struct fc_seq *(*exch_seq_send)(struct fc_lport *lp,
111636 struct fc_frame *fp,
111637 @@ -400,18 +418,14 @@
111638 void *arg, unsigned int timer_msec);
111639
111640 /*
111641 - * Send a frame using an existing sequence and exchange.
111642 - *
111643 - * STATUS: OPTIONAL
111644 + * send a frame using existing sequence and exchange.
111645 */
111646 int (*seq_send)(struct fc_lport *lp, struct fc_seq *sp,
111647 struct fc_frame *fp);
111648
111649 /*
111650 - * Send an ELS response using infomation from a previous
111651 - * exchange and sequence.
111652 - *
111653 - * STATUS: OPTIONAL
111654 + * Send ELS response using mainly infomation
111655 + * in exchange and sequence in EM layer.
111656 */
111657 void (*seq_els_rsp_send)(struct fc_seq *sp, enum fc_els_cmd els_cmd,
111658 struct fc_seq_els_data *els_data);
111659 @@ -423,8 +437,6 @@
111660 * A timer_msec can be specified for abort timeout, if non-zero
111661 * timer_msec value is specified then exchange resp handler
111662 * will be called with timeout error if no response to abort.
111663 - *
111664 - * STATUS: OPTIONAL
111665 */
111666 int (*seq_exch_abort)(const struct fc_seq *req_sp,
111667 unsigned int timer_msec);
111668 @@ -432,8 +444,6 @@
111669 /*
111670 * Indicate that an exchange/sequence tuple is complete and the memory
111671 * allocated for the related objects may be freed.
111672 - *
111673 - * STATUS: OPTIONAL
111674 */
111675 void (*exch_done)(struct fc_seq *sp);
111676
111677 @@ -441,8 +451,6 @@
111678 * Assigns a EM and a free XID for an new exchange and then
111679 * allocates a new exchange and sequence pair.
111680 * The fp can be used to determine free XID.
111681 - *
111682 - * STATUS: OPTIONAL
111683 */
111684 struct fc_exch *(*exch_get)(struct fc_lport *lp, struct fc_frame *fp);
111685
111686 @@ -450,16 +458,12 @@
111687 * Release previously assigned XID by exch_get API.
111688 * The LLD may implement this if XID is assigned by LLD
111689 * in exch_get().
111690 - *
111691 - * STATUS: OPTIONAL
111692 */
111693 void (*exch_put)(struct fc_lport *lp, struct fc_exch_mgr *mp,
111694 u16 ex_id);
111695
111696 /*
111697 * Start a new sequence on the same exchange/sequence tuple.
111698 - *
111699 - * STATUS: OPTIONAL
111700 */
111701 struct fc_seq *(*seq_start_next)(struct fc_seq *sp);
111702
111703 @@ -467,38 +471,26 @@
111704 * Reset an exchange manager, completing all sequences and exchanges.
111705 * If s_id is non-zero, reset only exchanges originating from that FID.
111706 * If d_id is non-zero, reset only exchanges sending to that FID.
111707 - *
111708 - * STATUS: OPTIONAL
111709 */
111710 - void (*exch_mgr_reset)(struct fc_lport *,
111711 + void (*exch_mgr_reset)(struct fc_exch_mgr *,
111712 u32 s_id, u32 d_id);
111713
111714 - /*
111715 - * Flush the rport work queue. Generally used before shutdown.
111716 - *
111717 - * STATUS: OPTIONAL
111718 - */
111719 void (*rport_flush_queue)(void);
111720 + /**
111721 + * Local Port interfaces
111722 + */
111723
111724 /*
111725 - * Receive a frame for a local port.
111726 - *
111727 - * STATUS: OPTIONAL
111728 + * Receive a frame to a local port.
111729 */
111730 void (*lport_recv)(struct fc_lport *lp, struct fc_seq *sp,
111731 struct fc_frame *fp);
111732
111733 - /*
111734 - * Reset the local port.
111735 - *
111736 - * STATUS: OPTIONAL
111737 - */
111738 int (*lport_reset)(struct fc_lport *);
111739
111740 - /*
111741 - * Create a remote port
111742 + /**
111743 + * Remote Port interfaces
111744 */
111745 - struct fc_rport *(*rport_create)(struct fc_disc_port *);
111746
111747 /*
111748 * Initiates the RP state machine. It is called from the LP module.
111749 @@ -508,72 +500,57 @@
111750 * - PLOGI
111751 * - PRLI
111752 * - RTV
111753 - *
111754 - * STATUS: OPTIONAL
111755 */
111756 int (*rport_login)(struct fc_rport *rport);
111757
111758 /*
111759 * Logoff, and remove the rport from the transport if
111760 * it had been added. This will send a LOGO to the target.
111761 - *
111762 - * STATUS: OPTIONAL
111763 */
111764 int (*rport_logoff)(struct fc_rport *rport);
111765
111766 /*
111767 * Recieve a request from a remote port.
111768 - *
111769 - * STATUS: OPTIONAL
111770 */
111771 void (*rport_recv_req)(struct fc_seq *, struct fc_frame *,
111772 struct fc_rport *);
111773
111774 - /*
111775 - * lookup an rport by it's port ID.
111776 - *
111777 - * STATUS: OPTIONAL
111778 - */
111779 struct fc_rport *(*rport_lookup)(const struct fc_lport *, u32);
111780
111781 + /**
111782 + * FCP interfaces
111783 + */
111784 +
111785 /*
111786 * Send a fcp cmd from fsp pkt.
111787 * Called with the SCSI host lock unlocked and irqs disabled.
111788 *
111789 * The resp handler is called when FCP_RSP received.
111790 *
111791 - * STATUS: OPTIONAL
111792 */
111793 int (*fcp_cmd_send)(struct fc_lport *lp, struct fc_fcp_pkt *fsp,
111794 void (*resp)(struct fc_seq *, struct fc_frame *fp,
111795 void *arg));
111796
111797 /*
111798 - * Cleanup the FCP layer, used durring link down and reset
111799 - *
111800 - * STATUS: OPTIONAL
111801 + * Used at least durring linkdown and reset
111802 */
111803 void (*fcp_cleanup)(struct fc_lport *lp);
111804
111805 /*
111806 * Abort all I/O on a local port
111807 - *
111808 - * STATUS: OPTIONAL
111809 */
111810 void (*fcp_abort_io)(struct fc_lport *lp);
111811
111812 - /*
111813 - * Receive a request for the discovery layer.
111814 - *
111815 - * STATUS: OPTIONAL
111816 + /**
111817 + * Discovery interfaces
111818 */
111819 +
111820 void (*disc_recv_req)(struct fc_seq *,
111821 struct fc_frame *, struct fc_lport *);
111822
111823 /*
111824 * Start discovery for a local port.
111825 - *
111826 - * STATUS: OPTIONAL
111827 */
111828 void (*disc_start)(void (*disc_callback)(struct fc_lport *,
111829 enum fc_disc_event),
111830 @@ -582,8 +559,6 @@
111831 /*
111832 * Stop discovery for a given lport. This will remove
111833 * all discovered rports
111834 - *
111835 - * STATUS: OPTIONAL
111836 */
111837 void (*disc_stop) (struct fc_lport *);
111838
111839 @@ -591,8 +566,6 @@
111840 * Stop discovery for a given lport. This will block
111841 * until all discovered rports are deleted from the
111842 * FC transport class
111843 - *
111844 - * STATUS: OPTIONAL
111845 */
111846 void (*disc_stop_final) (struct fc_lport *);
111847 };
111848 @@ -630,8 +603,7 @@
111849
111850 /* Operational Information */
111851 struct libfc_function_template tt;
111852 - u8 link_up;
111853 - u8 qfull;
111854 + u16 link_status;
111855 enum fc_lport_state state;
111856 unsigned long boot_time;
111857
111858 @@ -665,7 +637,7 @@
111859 struct delayed_work disc_work;
111860 };
111861
111862 -/*
111863 +/**
111864 * FC_LPORT HELPER FUNCTIONS
111865 *****************************/
111866 static inline void *lport_priv(const struct fc_lport *lp)
111867 @@ -697,7 +669,7 @@
111868 }
111869
111870
111871 -/*
111872 +/**
111873 * LOCAL PORT LAYER
111874 *****************************/
111875 int fc_lport_init(struct fc_lport *lp);
111876 @@ -732,6 +704,12 @@
111877 void fc_linkdown(struct fc_lport *);
111878
111879 /*
111880 + * Pause and unpause traffic.
111881 + */
111882 +void fc_pause(struct fc_lport *);
111883 +void fc_unpause(struct fc_lport *);
111884 +
111885 +/*
111886 * Configure the local port.
111887 */
111888 int fc_lport_config(struct fc_lport *);
111889 @@ -747,19 +725,19 @@
111890 int fc_set_mfs(struct fc_lport *lp, u32 mfs);
111891
111892
111893 -/*
111894 +/**
111895 * REMOTE PORT LAYER
111896 *****************************/
111897 int fc_rport_init(struct fc_lport *lp);
111898 void fc_rport_terminate_io(struct fc_rport *rp);
111899
111900 -/*
111901 +/**
111902 * DISCOVERY LAYER
111903 *****************************/
111904 int fc_disc_init(struct fc_lport *lp);
111905
111906
111907 -/*
111908 +/**
111909 * SCSI LAYER
111910 *****************************/
111911 /*
111912 @@ -820,7 +798,7 @@
111913 */
111914 void fc_fcp_destroy(struct fc_lport *);
111915
111916 -/*
111917 +/**
111918 * ELS/CT interface
111919 *****************************/
111920 /*
111921 @@ -829,7 +807,7 @@
111922 int fc_elsct_init(struct fc_lport *lp);
111923
111924
111925 -/*
111926 +/**
111927 * EXCHANGE MANAGER LAYER
111928 *****************************/
111929 /*
111930 @@ -938,7 +916,7 @@
111931 * If s_id is non-zero, reset only exchanges originating from that FID.
111932 * If d_id is non-zero, reset only exchanges sending to that FID.
111933 */
111934 -void fc_exch_mgr_reset(struct fc_lport *, u32 s_id, u32 d_id);
111935 +void fc_exch_mgr_reset(struct fc_exch_mgr *, u32 s_id, u32 d_id);
111936
111937 /*
111938 * Functions for fc_functions_template
111939 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/scsi/libfcoe.h linux-2.6.29-rc3.owrt/include/scsi/libfcoe.h
111940 --- linux-2.6.29.owrt/include/scsi/libfcoe.h 2009-05-10 22:04:38.000000000 +0200
111941 +++ linux-2.6.29-rc3.owrt/include/scsi/libfcoe.h 2009-05-10 23:48:29.000000000 +0200
111942 @@ -46,7 +46,6 @@
111943 struct net_device *phys_dev; /* device with ethtool_ops */
111944 struct packet_type fcoe_packet_type;
111945 struct sk_buff_head fcoe_pending_queue;
111946 - u8 fcoe_pending_queue_active;
111947
111948 u8 dest_addr[ETH_ALEN];
111949 u8 ctl_src_addr[ETH_ALEN];
111950 @@ -59,10 +58,16 @@
111951 u8 address_mode;
111952 };
111953
111954 +static inline struct fcoe_softc *fcoe_softc(
111955 + const struct fc_lport *lp)
111956 +{
111957 + return (struct fcoe_softc *)lport_priv(lp);
111958 +}
111959 +
111960 static inline struct net_device *fcoe_netdev(
111961 const struct fc_lport *lp)
111962 {
111963 - return ((struct fcoe_softc *)lport_priv(lp))->real_dev;
111964 + return fcoe_softc(lp)->real_dev;
111965 }
111966
111967 static inline struct fcoe_hdr *skb_fcoe_header(const struct sk_buff *skb)
111968 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/sound/hdsp.h linux-2.6.29-rc3.owrt/include/sound/hdsp.h
111969 --- linux-2.6.29.owrt/include/sound/hdsp.h 2009-05-10 22:04:38.000000000 +0200
111970 +++ linux-2.6.29-rc3.owrt/include/sound/hdsp.h 2009-05-10 23:48:29.000000000 +0200
111971 @@ -19,8 +19,6 @@
111972 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
111973 */
111974
111975 -#include <linux/types.h>
111976 -
111977 #define HDSP_MATRIX_MIXER_SIZE 2048
111978
111979 enum HDSP_IO_Type {
111980 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/video/aty128.h linux-2.6.29-rc3.owrt/include/video/aty128.h
111981 --- linux-2.6.29.owrt/include/video/aty128.h 2009-05-10 22:04:37.000000000 +0200
111982 +++ linux-2.6.29-rc3.owrt/include/video/aty128.h 2009-05-10 23:48:29.000000000 +0200
111983 @@ -21,9 +21,9 @@
111984 #define I2C_CNTL_1 0x0094
111985 #define PALETTE_INDEX 0x00b0
111986 #define PALETTE_DATA 0x00b4
111987 -#define CNFG_CNTL 0x00e0
111988 +#define CONFIG_CNTL 0x00e0
111989 #define GEN_RESET_CNTL 0x00f0
111990 -#define CNFG_MEMSIZE 0x00f8
111991 +#define CONFIG_MEMSIZE 0x00f8
111992 #define MEM_CNTL 0x0140
111993 #define MEM_POWER_MISC 0x015c
111994 #define AGP_BASE 0x0170
111995 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/video/mach64.h linux-2.6.29-rc3.owrt/include/video/mach64.h
111996 --- linux-2.6.29.owrt/include/video/mach64.h 2009-05-10 22:04:37.000000000 +0200
111997 +++ linux-2.6.29-rc3.owrt/include/video/mach64.h 2009-05-10 23:48:29.000000000 +0200
111998 @@ -103,7 +103,7 @@
111999 #define CUR_HORZ_VERT_OFF 0x0070 /* Dword offset 0_1C */
112000 #define CUR2_HORZ_VERT_OFF 0x0070 /* Dword offset 0_1C */
112001
112002 -#define CNFG_PANEL_LG 0x0074 /* Dword offset 0_1D (LG) */
112003 +#define CONFIG_PANEL_LG 0x0074 /* Dword offset 0_1D (LG) */
112004
112005 /* General I/O Control */
112006 #define GP_IO 0x0078 /* Dword offset 0_1E */
112007 @@ -146,8 +146,8 @@
112008 #define CLOCK_SEL_CNTL 0x0090 /* Dword offset 0_24 */
112009
112010 /* Configuration */
112011 -#define CNFG_STAT1 0x0094 /* Dword offset 0_25 */
112012 -#define CNFG_STAT2 0x0098 /* Dword offset 0_26 */
112013 +#define CONFIG_STAT1 0x0094 /* Dword offset 0_25 */
112014 +#define CONFIG_STAT2 0x0098 /* Dword offset 0_26 */
112015
112016 /* Bus Control */
112017 #define BUS_CNTL 0x00A0 /* Dword offset 0_28 */
112018 @@ -190,9 +190,9 @@
112019 #define POWER_MANAGEMENT_LG 0x00D8 /* Dword offset 0_36 (LG) */
112020
112021 /* Configuration */
112022 -#define CNFG_CNTL 0x00DC /* Dword offset 0_37 (CT, ET, VT) */
112023 -#define CNFG_CHIP_ID 0x00E0 /* Dword offset 0_38 */
112024 -#define CNFG_STAT0 0x00E4 /* Dword offset 0_39 */
112025 +#define CONFIG_CNTL 0x00DC /* Dword offset 0_37 (CT, ET, VT) */
112026 +#define CONFIG_CHIP_ID 0x00E0 /* Dword offset 0_38 */
112027 +#define CONFIG_STAT0 0x00E4 /* Dword offset 0_39 */
112028
112029 /* Test and Debug */
112030 #define CRC_SIG 0x00E8 /* Dword offset 0_3A */
112031 @@ -851,17 +851,17 @@
112032 #define PLL_YCLK_CNTL 0x29
112033 #define PM_DYN_CLK_CNTL 0x2A
112034
112035 -/* CNFG_CNTL register constants */
112036 +/* CONFIG_CNTL register constants */
112037 #define APERTURE_4M_ENABLE 1
112038 #define APERTURE_8M_ENABLE 2
112039 #define VGA_APERTURE_ENABLE 4
112040
112041 -/* CNFG_STAT0 register constants (GX, CX) */
112042 +/* CONFIG_STAT0 register constants (GX, CX) */
112043 #define CFG_BUS_TYPE 0x00000007
112044 #define CFG_MEM_TYPE 0x00000038
112045 #define CFG_INIT_DAC_TYPE 0x00000e00
112046
112047 -/* CNFG_STAT0 register constants (CT, ET, VT) */
112048 +/* CONFIG_STAT0 register constants (CT, ET, VT) */
112049 #define CFG_MEM_TYPE_xT 0x00000007
112050
112051 #define ISA 0
112052 @@ -942,7 +942,7 @@
112053 #define PCI_ATI_VENDOR_ID 0x1002
112054
112055
112056 -/* CNFG_CHIP_ID register constants */
112057 +/* CONFIG_CHIP_ID register constants */
112058 #define CFG_CHIP_TYPE 0x0000FFFF
112059 #define CFG_CHIP_CLASS 0x00FF0000
112060 #define CFG_CHIP_REV 0xFF000000
112061 @@ -951,7 +951,7 @@
112062 #define CFG_CHIP_MINOR 0xC0000000
112063
112064
112065 -/* Chip IDs read from CNFG_CHIP_ID */
112066 +/* Chip IDs read from CONFIG_CHIP_ID */
112067
112068 /* mach64GX family */
112069 #define GX_CHIP_ID 0xD7 /* mach64GX (ATI888GX00) */
112070 @@ -1254,7 +1254,7 @@
112071 #define CRTC2_DISPLAY_DIS 0x00000400
112072
112073 /* LCD register indices */
112074 -#define CNFG_PANEL 0x00
112075 +#define CONFIG_PANEL 0x00
112076 #define LCD_GEN_CNTL 0x01
112077 #define DSTN_CONTROL 0x02
112078 #define HFB_PITCH_ADDR 0x03
112079 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/video/radeon.h linux-2.6.29-rc3.owrt/include/video/radeon.h
112080 --- linux-2.6.29.owrt/include/video/radeon.h 2009-05-10 22:04:37.000000000 +0200
112081 +++ linux-2.6.29-rc3.owrt/include/video/radeon.h 2009-05-10 23:48:29.000000000 +0200
112082 @@ -11,13 +11,13 @@
112083 #define HI_STAT 0x004C
112084 #define BUS_CNTL1 0x0034
112085 #define I2C_CNTL_1 0x0094
112086 -#define CNFG_CNTL 0x00E0
112087 -#define CNFG_MEMSIZE 0x00F8
112088 -#define CNFG_APER_0_BASE 0x0100
112089 -#define CNFG_APER_1_BASE 0x0104
112090 -#define CNFG_APER_SIZE 0x0108
112091 -#define CNFG_REG_1_BASE 0x010C
112092 -#define CNFG_REG_APER_SIZE 0x0110
112093 +#define CONFIG_CNTL 0x00E0
112094 +#define CONFIG_MEMSIZE 0x00F8
112095 +#define CONFIG_APER_0_BASE 0x0100
112096 +#define CONFIG_APER_1_BASE 0x0104
112097 +#define CONFIG_APER_SIZE 0x0108
112098 +#define CONFIG_REG_1_BASE 0x010C
112099 +#define CONFIG_REG_APER_SIZE 0x0110
112100 #define PAD_AGPINPUT_DELAY 0x0164
112101 #define PAD_CTLR_STRENGTH 0x0168
112102 #define PAD_CTLR_UPDATE 0x016C
112103 @@ -509,7 +509,7 @@
112104 /* CLOCK_CNTL_INDEX bit constants */
112105 #define PLL_WR_EN 0x00000080
112106
112107 -/* CNFG_CNTL bit constants */
112108 +/* CONFIG_CNTL bit constants */
112109 #define CFG_VGA_RAM_EN 0x00000100
112110 #define CFG_ATI_REV_ID_MASK (0xf << 16)
112111 #define CFG_ATI_REV_A11 (0 << 16)
112112 @@ -980,7 +980,7 @@
112113
112114 /* masks */
112115
112116 -#define CNFG_MEMSIZE_MASK 0x1f000000
112117 +#define CONFIG_MEMSIZE_MASK 0x1f000000
112118 #define MEM_CFG_TYPE 0x40000000
112119 #define DST_OFFSET_MASK 0x003fffff
112120 #define DST_PITCH_MASK 0x3fc00000
112121 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/video/sisfb.h linux-2.6.29-rc3.owrt/include/video/sisfb.h
112122 --- linux-2.6.29.owrt/include/video/sisfb.h 2009-05-10 22:04:37.000000000 +0200
112123 +++ linux-2.6.29-rc3.owrt/include/video/sisfb.h 2009-05-10 23:48:29.000000000 +0200
112124 @@ -21,8 +21,8 @@
112125 #ifndef _LINUX_SISFB_H_
112126 #define _LINUX_SISFB_H_
112127
112128 -#include <linux/types.h>
112129 #include <asm/ioctl.h>
112130 +#include <asm/types.h>
112131
112132 /**********************************************/
112133 /* PUBLIC */
112134 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/include/video/uvesafb.h linux-2.6.29-rc3.owrt/include/video/uvesafb.h
112135 --- linux-2.6.29.owrt/include/video/uvesafb.h 2009-05-10 22:04:37.000000000 +0200
112136 +++ linux-2.6.29-rc3.owrt/include/video/uvesafb.h 2009-05-10 23:48:29.000000000 +0200
112137 @@ -1,8 +1,6 @@
112138 #ifndef _UVESAFB_H
112139 #define _UVESAFB_H
112140
112141 -#include <linux/types.h>
112142 -
112143 struct v86_regs {
112144 __u32 ebx;
112145 __u32 ecx;
112146 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/init/do_mounts.c linux-2.6.29-rc3.owrt/init/do_mounts.c
112147 --- linux-2.6.29.owrt/init/do_mounts.c 2009-05-10 22:04:39.000000000 +0200
112148 +++ linux-2.6.29-rc3.owrt/init/do_mounts.c 2009-05-10 23:48:29.000000000 +0200
112149 @@ -370,14 +370,10 @@
112150 ssleep(root_delay);
112151 }
112152
112153 - /*
112154 - * wait for the known devices to complete their probing
112155 - *
112156 - * Note: this is a potential source of long boot delays.
112157 - * For example, it is not atypical to wait 5 seconds here
112158 - * for the touchpad of a laptop to initialize.
112159 - */
112160 - wait_for_device_probe();
112161 + /* wait for the known devices to complete their probing */
112162 + while (driver_probe_done() != 0)
112163 + msleep(100);
112164 + async_synchronize_full();
112165
112166 md_run_setup();
112167
112168 @@ -403,7 +399,6 @@
112169 while (driver_probe_done() != 0 ||
112170 (ROOT_DEV = name_to_dev_t(saved_root_name)) == 0)
112171 msleep(100);
112172 - async_synchronize_full();
112173 }
112174
112175 is_floppy = MAJOR(ROOT_DEV) == FLOPPY_MAJOR;
112176 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/init/do_mounts_md.c linux-2.6.29-rc3.owrt/init/do_mounts_md.c
112177 --- linux-2.6.29.owrt/init/do_mounts_md.c 2009-05-10 22:04:39.000000000 +0200
112178 +++ linux-2.6.29-rc3.owrt/init/do_mounts_md.c 2009-05-10 23:48:29.000000000 +0200
112179 @@ -281,9 +281,8 @@
112180 */
112181 printk(KERN_INFO "md: Waiting for all devices to be available before autodetect\n");
112182 printk(KERN_INFO "md: If you don't use raid, use raid=noautodetect\n");
112183 -
112184 - wait_for_device_probe();
112185 -
112186 + while (driver_probe_done() < 0)
112187 + msleep(100);
112188 fd = sys_open("/dev/md0", 0, 0);
112189 if (fd >= 0) {
112190 sys_ioctl(fd, RAID_AUTORUN, raid_autopart);
112191 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/init/Kconfig linux-2.6.29-rc3.owrt/init/Kconfig
112192 --- linux-2.6.29.owrt/init/Kconfig 2009-05-10 22:04:39.000000000 +0200
112193 +++ linux-2.6.29-rc3.owrt/init/Kconfig 2009-05-10 23:48:29.000000000 +0200
112194 @@ -675,9 +675,6 @@
112195 config SYSCTL
112196 bool
112197
112198 -config ANON_INODES
112199 - bool
112200 -
112201 menuconfig EMBEDDED
112202 bool "Configure standard kernel features (for small systems)"
112203 help
112204 @@ -783,6 +780,18 @@
112205 This option allows to disable the internal PC-Speaker
112206 support, saving some memory.
112207
112208 +config COMPAT_BRK
112209 + bool "Disable heap randomization"
112210 + default y
112211 + help
112212 + Randomizing heap placement makes heap exploits harder, but it
112213 + also breaks ancient binaries (including anything libc5 based).
112214 + This option changes the bootup default to heap randomization
112215 + disabled, and can be overriden runtime by setting
112216 + /proc/sys/kernel/randomize_va_space to 2.
112217 +
112218 + On non-ancient distros (post-2000 ones) N is usually a safe choice.
112219 +
112220 config BASE_FULL
112221 default y
112222 bool "Enable full-sized data structures for core" if EMBEDDED
112223 @@ -800,6 +809,9 @@
112224 support for "fast userspace mutexes". The resulting kernel may not
112225 run glibc-based applications correctly.
112226
112227 +config ANON_INODES
112228 + bool
112229 +
112230 config EPOLL
112231 bool "Enable eventpoll support" if EMBEDDED
112232 default y
112233 @@ -885,18 +897,6 @@
112234 SLUB sysfs support. /sys/slab will not exist and there will be
112235 no support for cache validation etc.
112236
112237 -config COMPAT_BRK
112238 - bool "Disable heap randomization"
112239 - default y
112240 - help
112241 - Randomizing heap placement makes heap exploits harder, but it
112242 - also breaks ancient binaries (including anything libc5 based).
112243 - This option changes the bootup default to heap randomization
112244 - disabled, and can be overriden runtime by setting
112245 - /proc/sys/kernel/randomize_va_space to 2.
112246 -
112247 - On non-ancient distros (post-2000 ones) N is usually a safe choice.
112248 -
112249 choice
112250 prompt "Choose SLAB allocator"
112251 default SLUB
112252 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/init/main.c linux-2.6.29-rc3.owrt/init/main.c
112253 --- linux-2.6.29.owrt/init/main.c 2009-05-10 22:04:39.000000000 +0200
112254 +++ linux-2.6.29-rc3.owrt/init/main.c 2009-05-10 23:48:29.000000000 +0200
112255 @@ -97,7 +97,7 @@
112256 extern void tc_init(void);
112257 #endif
112258
112259 -enum system_states system_state __read_mostly;
112260 +enum system_states system_state;
112261 EXPORT_SYMBOL(system_state);
112262
112263 /*
112264 @@ -463,7 +463,6 @@
112265 * at least once to get things moving:
112266 */
112267 init_idle_bootup_task(current);
112268 - rcu_scheduler_starting();
112269 preempt_enable_no_resched();
112270 schedule();
112271 preempt_disable();
112272 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/ipc/shm.c linux-2.6.29-rc3.owrt/ipc/shm.c
112273 --- linux-2.6.29.owrt/ipc/shm.c 2009-05-10 22:04:39.000000000 +0200
112274 +++ linux-2.6.29-rc3.owrt/ipc/shm.c 2009-05-10 23:48:29.000000000 +0200
112275 @@ -340,7 +340,6 @@
112276 struct file * file;
112277 char name[13];
112278 int id;
112279 - int acctflag = 0;
112280
112281 if (size < SHMMIN || size > ns->shm_ctlmax)
112282 return -EINVAL;
112283 @@ -365,19 +364,18 @@
112284
112285 sprintf (name, "SYSV%08x", key);
112286 if (shmflg & SHM_HUGETLB) {
112287 - /* hugetlb_file_setup applies strict accounting */
112288 - if (shmflg & SHM_NORESERVE)
112289 - acctflag = VM_NORESERVE;
112290 - file = hugetlb_file_setup(name, size, acctflag);
112291 + /* hugetlb_file_setup takes care of mlock user accounting */
112292 + file = hugetlb_file_setup(name, size);
112293 shp->mlock_user = current_user();
112294 } else {
112295 + int acctflag = VM_ACCOUNT;
112296 /*
112297 * Do not allow no accounting for OVERCOMMIT_NEVER, even
112298 * if it's asked for.
112299 */
112300 if ((shmflg & SHM_NORESERVE) &&
112301 sysctl_overcommit_memory != OVERCOMMIT_NEVER)
112302 - acctflag = VM_NORESERVE;
112303 + acctflag = 0;
112304 file = shmem_file_setup(name, size, acctflag);
112305 }
112306 error = PTR_ERR(file);
112307 @@ -567,15 +565,11 @@
112308 struct hstate *h = hstate_file(shp->shm_file);
112309 *rss += pages_per_huge_page(h) * mapping->nrpages;
112310 } else {
112311 -#ifdef CONFIG_SHMEM
112312 struct shmem_inode_info *info = SHMEM_I(inode);
112313 spin_lock(&info->lock);
112314 *rss += inode->i_mapping->nrpages;
112315 *swp += info->swapped;
112316 spin_unlock(&info->lock);
112317 -#else
112318 - *rss += inode->i_mapping->nrpages;
112319 -#endif
112320 }
112321
112322 total++;
112323 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/async.c linux-2.6.29-rc3.owrt/kernel/async.c
112324 --- linux-2.6.29.owrt/kernel/async.c 2009-05-10 22:04:41.000000000 +0200
112325 +++ linux-2.6.29-rc3.owrt/kernel/async.c 2009-05-10 23:48:29.000000000 +0200
112326 @@ -54,7 +54,6 @@
112327 #include <linux/sched.h>
112328 #include <linux/init.h>
112329 #include <linux/kthread.h>
112330 -#include <linux/delay.h>
112331 #include <asm/atomic.h>
112332
112333 static async_cookie_t next_cookie = 1;
112334 @@ -133,23 +132,21 @@
112335 entry = list_first_entry(&async_pending, struct async_entry, list);
112336
112337 /* 2) move it to the running queue */
112338 - list_move_tail(&entry->list, entry->running);
112339 + list_del(&entry->list);
112340 + list_add_tail(&entry->list, &async_running);
112341 spin_unlock_irqrestore(&async_lock, flags);
112342
112343 /* 3) run it (and print duration)*/
112344 if (initcall_debug && system_state == SYSTEM_BOOTING) {
112345 - printk("calling %lli_%pF @ %i\n", (long long)entry->cookie,
112346 - entry->func, task_pid_nr(current));
112347 + printk("calling %lli_%pF @ %i\n", entry->cookie, entry->func, task_pid_nr(current));
112348 calltime = ktime_get();
112349 }
112350 entry->func(entry->data, entry->cookie);
112351 if (initcall_debug && system_state == SYSTEM_BOOTING) {
112352 rettime = ktime_get();
112353 delta = ktime_sub(rettime, calltime);
112354 - printk("initcall %lli_%pF returned 0 after %lld usecs\n",
112355 - (long long)entry->cookie,
112356 - entry->func,
112357 - (long long)ktime_to_ns(delta) >> 10);
112358 + printk("initcall %lli_%pF returned 0 after %lld usecs\n", entry->cookie,
112359 + entry->func, ktime_to_ns(delta) >> 10);
112360 }
112361
112362 /* 4) remove it from the running queue */
112363 @@ -208,44 +205,18 @@
112364 return newcookie;
112365 }
112366
112367 -/**
112368 - * async_schedule - schedule a function for asynchronous execution
112369 - * @ptr: function to execute asynchronously
112370 - * @data: data pointer to pass to the function
112371 - *
112372 - * Returns an async_cookie_t that may be used for checkpointing later.
112373 - * Note: This function may be called from atomic or non-atomic contexts.
112374 - */
112375 async_cookie_t async_schedule(async_func_ptr *ptr, void *data)
112376 {
112377 - return __async_schedule(ptr, data, &async_running);
112378 + return __async_schedule(ptr, data, &async_pending);
112379 }
112380 EXPORT_SYMBOL_GPL(async_schedule);
112381
112382 -/**
112383 - * async_schedule_domain - schedule a function for asynchronous execution within a certain domain
112384 - * @ptr: function to execute asynchronously
112385 - * @data: data pointer to pass to the function
112386 - * @running: running list for the domain
112387 - *
112388 - * Returns an async_cookie_t that may be used for checkpointing later.
112389 - * @running may be used in the async_synchronize_*_domain() functions
112390 - * to wait within a certain synchronization domain rather than globally.
112391 - * A synchronization domain is specified via the running queue @running to use.
112392 - * Note: This function may be called from atomic or non-atomic contexts.
112393 - */
112394 -async_cookie_t async_schedule_domain(async_func_ptr *ptr, void *data,
112395 - struct list_head *running)
112396 +async_cookie_t async_schedule_special(async_func_ptr *ptr, void *data, struct list_head *running)
112397 {
112398 return __async_schedule(ptr, data, running);
112399 }
112400 -EXPORT_SYMBOL_GPL(async_schedule_domain);
112401 +EXPORT_SYMBOL_GPL(async_schedule_special);
112402
112403 -/**
112404 - * async_synchronize_full - synchronize all asynchronous function calls
112405 - *
112406 - * This function waits until all asynchronous function calls have been done.
112407 - */
112408 void async_synchronize_full(void)
112409 {
112410 do {
112411 @@ -254,30 +225,13 @@
112412 }
112413 EXPORT_SYMBOL_GPL(async_synchronize_full);
112414
112415 -/**
112416 - * async_synchronize_full_domain - synchronize all asynchronous function within a certain domain
112417 - * @list: running list to synchronize on
112418 - *
112419 - * This function waits until all asynchronous function calls for the
112420 - * synchronization domain specified by the running list @list have been done.
112421 - */
112422 -void async_synchronize_full_domain(struct list_head *list)
112423 +void async_synchronize_full_special(struct list_head *list)
112424 {
112425 - async_synchronize_cookie_domain(next_cookie, list);
112426 + async_synchronize_cookie_special(next_cookie, list);
112427 }
112428 -EXPORT_SYMBOL_GPL(async_synchronize_full_domain);
112429 +EXPORT_SYMBOL_GPL(async_synchronize_full_special);
112430
112431 -/**
112432 - * async_synchronize_cookie_domain - synchronize asynchronous function calls within a certain domain with cookie checkpointing
112433 - * @cookie: async_cookie_t to use as checkpoint
112434 - * @running: running list to synchronize on
112435 - *
112436 - * This function waits until all asynchronous function calls for the
112437 - * synchronization domain specified by the running list @list submitted
112438 - * prior to @cookie have been done.
112439 - */
112440 -void async_synchronize_cookie_domain(async_cookie_t cookie,
112441 - struct list_head *running)
112442 +void async_synchronize_cookie_special(async_cookie_t cookie, struct list_head *running)
112443 {
112444 ktime_t starttime, delta, endtime;
112445
112446 @@ -293,22 +247,14 @@
112447 delta = ktime_sub(endtime, starttime);
112448
112449 printk("async_continuing @ %i after %lli usec\n",
112450 - task_pid_nr(current),
112451 - (long long)ktime_to_ns(delta) >> 10);
112452 + task_pid_nr(current), ktime_to_ns(delta) >> 10);
112453 }
112454 }
112455 -EXPORT_SYMBOL_GPL(async_synchronize_cookie_domain);
112456 +EXPORT_SYMBOL_GPL(async_synchronize_cookie_special);
112457
112458 -/**
112459 - * async_synchronize_cookie - synchronize asynchronous function calls with cookie checkpointing
112460 - * @cookie: async_cookie_t to use as checkpoint
112461 - *
112462 - * This function waits until all asynchronous function calls prior to @cookie
112463 - * have been done.
112464 - */
112465 void async_synchronize_cookie(async_cookie_t cookie)
112466 {
112467 - async_synchronize_cookie_domain(cookie, &async_running);
112468 + async_synchronize_cookie_special(cookie, &async_running);
112469 }
112470 EXPORT_SYMBOL_GPL(async_synchronize_cookie);
112471
112472 @@ -369,11 +315,7 @@
112473 ec = atomic_read(&entry_count);
112474
112475 while (tc < ec && tc < MAX_THREADS) {
112476 - if (IS_ERR(kthread_run(async_thread, NULL, "async/%i",
112477 - tc))) {
112478 - msleep(100);
112479 - continue;
112480 - }
112481 + kthread_run(async_thread, NULL, "async/%i", tc);
112482 atomic_inc(&thread_count);
112483 tc++;
112484 }
112485 @@ -388,9 +330,7 @@
112486 static int __init async_init(void)
112487 {
112488 if (async_enabled)
112489 - if (IS_ERR(kthread_run(async_manager_thread, NULL,
112490 - "async/mgr")))
112491 - async_enabled = 0;
112492 + kthread_run(async_manager_thread, NULL, "async/mgr");
112493 return 0;
112494 }
112495
112496 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/cgroup.c linux-2.6.29-rc3.owrt/kernel/cgroup.c
112497 --- linux-2.6.29.owrt/kernel/cgroup.c 2009-05-10 22:04:41.000000000 +0200
112498 +++ linux-2.6.29-rc3.owrt/kernel/cgroup.c 2009-05-10 23:48:29.000000000 +0200
112499 @@ -1115,15 +1115,13 @@
112500 }
112501 write_unlock(&css_set_lock);
112502
112503 - if (!list_empty(&root->root_list)) {
112504 - list_del(&root->root_list);
112505 - root_count--;
112506 - }
112507 + list_del(&root->root_list);
112508 + root_count--;
112509
112510 mutex_unlock(&cgroup_mutex);
112511
112512 - kill_litter_super(sb);
112513 kfree(root);
112514 + kill_litter_super(sb);
112515 }
112516
112517 static struct file_system_type cgroup_fs_type = {
112518 @@ -2351,7 +2349,7 @@
112519 for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) {
112520 struct cgroup_subsys *ss = subsys[i];
112521 if (ss->root == root)
112522 - mutex_lock(&ss->hierarchy_mutex);
112523 + mutex_lock_nested(&ss->hierarchy_mutex, i);
112524 }
112525 }
112526
112527 @@ -2436,9 +2434,7 @@
112528
112529 err_remove:
112530
112531 - cgroup_lock_hierarchy(root);
112532 list_del(&cgrp->sibling);
112533 - cgroup_unlock_hierarchy(root);
112534 root->number_of_cgroups--;
112535
112536 err_destroy:
112537 @@ -2511,7 +2507,7 @@
112538 for_each_subsys(cgrp->root, ss) {
112539 struct cgroup_subsys_state *css = cgrp->subsys[ss->subsys_id];
112540 int refcnt;
112541 - while (1) {
112542 + do {
112543 /* We can only remove a CSS with a refcnt==1 */
112544 refcnt = atomic_read(&css->refcnt);
112545 if (refcnt > 1) {
112546 @@ -2525,10 +2521,7 @@
112547 * css_tryget() to spin until we set the
112548 * CSS_REMOVED bits or abort
112549 */
112550 - if (atomic_cmpxchg(&css->refcnt, refcnt, 0) == refcnt)
112551 - break;
112552 - cpu_relax();
112553 - }
112554 + } while (atomic_cmpxchg(&css->refcnt, refcnt, 0) != refcnt);
112555 }
112556 done:
112557 for_each_subsys(cgrp->root, ss) {
112558 @@ -2637,7 +2630,6 @@
112559 BUG_ON(!list_empty(&init_task.tasks));
112560
112561 mutex_init(&ss->hierarchy_mutex);
112562 - lockdep_set_class(&ss->hierarchy_mutex, &ss->subsys_key);
112563 ss->active = 1;
112564 }
112565
112566 @@ -2999,21 +2991,20 @@
112567 mutex_unlock(&cgroup_mutex);
112568 return 0;
112569 }
112570 + task_lock(tsk);
112571 + cg = tsk->cgroups;
112572 + parent = task_cgroup(tsk, subsys->subsys_id);
112573
112574 /* Pin the hierarchy */
112575 - if (!atomic_inc_not_zero(&root->sb->s_active)) {
112576 + if (!atomic_inc_not_zero(&parent->root->sb->s_active)) {
112577 /* We race with the final deactivate_super() */
112578 mutex_unlock(&cgroup_mutex);
112579 return 0;
112580 }
112581
112582 /* Keep the cgroup alive */
112583 - task_lock(tsk);
112584 - parent = task_cgroup(tsk, subsys->subsys_id);
112585 - cg = tsk->cgroups;
112586 get_css_set(cg);
112587 task_unlock(tsk);
112588 -
112589 mutex_unlock(&cgroup_mutex);
112590
112591 /* Now do the VFS work to create a cgroup */
112592 @@ -3052,7 +3043,7 @@
112593 mutex_unlock(&inode->i_mutex);
112594 put_css_set(cg);
112595
112596 - deactivate_super(root->sb);
112597 + deactivate_super(parent->root->sb);
112598 /* The cgroup is still accessible in the VFS, but
112599 * we're not going to try to rmdir() it at this
112600 * point. */
112601 @@ -3078,7 +3069,7 @@
112602 mutex_lock(&cgroup_mutex);
112603 put_css_set(cg);
112604 mutex_unlock(&cgroup_mutex);
112605 - deactivate_super(root->sb);
112606 + deactivate_super(parent->root->sb);
112607 return ret;
112608 }
112609
112610 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/cpuset.c linux-2.6.29-rc3.owrt/kernel/cpuset.c
112611 --- linux-2.6.29.owrt/kernel/cpuset.c 2009-05-10 22:04:41.000000000 +0200
112612 +++ linux-2.6.29-rc3.owrt/kernel/cpuset.c 2009-05-10 23:48:29.000000000 +0200
112613 @@ -61,14 +61,6 @@
112614 #include <linux/cgroup.h>
112615
112616 /*
112617 - * Workqueue for cpuset related tasks.
112618 - *
112619 - * Using kevent workqueue may cause deadlock when memory_migrate
112620 - * is set. So we create a separate workqueue thread for cpuset.
112621 - */
112622 -static struct workqueue_struct *cpuset_wq;
112623 -
112624 -/*
112625 * Tracks how many cpusets are currently defined in system.
112626 * When there is only one cpuset (the root cpuset) we can
112627 * short circuit some hooks.
112628 @@ -839,7 +831,7 @@
112629 */
112630 static void async_rebuild_sched_domains(void)
112631 {
112632 - queue_work(cpuset_wq, &rebuild_sched_domains_work);
112633 + schedule_work(&rebuild_sched_domains_work);
112634 }
112635
112636 /*
112637 @@ -2119,9 +2111,6 @@
112638
112639 hotcpu_notifier(cpuset_track_online_cpus, 0);
112640 hotplug_memory_notifier(cpuset_track_online_nodes, 10);
112641 -
112642 - cpuset_wq = create_singlethread_workqueue("cpuset");
112643 - BUG_ON(!cpuset_wq);
112644 }
112645
112646 /**
112647 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/exit.c linux-2.6.29-rc3.owrt/kernel/exit.c
112648 --- linux-2.6.29.owrt/kernel/exit.c 2009-05-10 22:04:41.000000000 +0200
112649 +++ linux-2.6.29-rc3.owrt/kernel/exit.c 2009-05-10 23:48:29.000000000 +0200
112650 @@ -118,8 +118,6 @@
112651 * We won't ever get here for the group leader, since it
112652 * will have been the last reference on the signal_struct.
112653 */
112654 - sig->utime = cputime_add(sig->utime, task_utime(tsk));
112655 - sig->stime = cputime_add(sig->stime, task_stime(tsk));
112656 sig->gtime = cputime_add(sig->gtime, task_gtime(tsk));
112657 sig->min_flt += tsk->min_flt;
112658 sig->maj_flt += tsk->maj_flt;
112659 @@ -128,7 +126,6 @@
112660 sig->inblock += task_io_get_inblock(tsk);
112661 sig->oublock += task_io_get_oublock(tsk);
112662 task_io_accounting_add(&sig->ioac, &tsk->ioac);
112663 - sig->sum_sched_runtime += tsk->se.sum_exec_runtime;
112664 sig = NULL; /* Marker for below. */
112665 }
112666
112667 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/fork.c linux-2.6.29-rc3.owrt/kernel/fork.c
112668 --- linux-2.6.29.owrt/kernel/fork.c 2009-05-10 22:04:41.000000000 +0200
112669 +++ linux-2.6.29-rc3.owrt/kernel/fork.c 2009-05-10 23:48:29.000000000 +0200
112670 @@ -852,14 +852,13 @@
112671 sig->tty_old_pgrp = NULL;
112672 sig->tty = NULL;
112673
112674 - sig->utime = sig->stime = sig->cutime = sig->cstime = cputime_zero;
112675 + sig->cutime = sig->cstime = cputime_zero;
112676 sig->gtime = cputime_zero;
112677 sig->cgtime = cputime_zero;
112678 sig->nvcsw = sig->nivcsw = sig->cnvcsw = sig->cnivcsw = 0;
112679 sig->min_flt = sig->maj_flt = sig->cmin_flt = sig->cmaj_flt = 0;
112680 sig->inblock = sig->oublock = sig->cinblock = sig->coublock = 0;
112681 task_io_accounting_init(&sig->ioac);
112682 - sig->sum_sched_runtime = 0;
112683 taskstats_tgid_init(sig);
112684
112685 task_lock(current->group_leader);
112686 @@ -1007,7 +1006,6 @@
112687 * triggers too late. This doesn't hurt, the check is only there
112688 * to stop root fork bombs.
112689 */
112690 - retval = -EAGAIN;
112691 if (nr_threads >= max_threads)
112692 goto bad_fork_cleanup_count;
112693
112694 @@ -1096,7 +1094,7 @@
112695 #ifdef CONFIG_DEBUG_MUTEXES
112696 p->blocked_on = NULL; /* not blocked yet */
112697 #endif
112698 - if (unlikely(current->ptrace))
112699 + if (unlikely(ptrace_reparented(current)))
112700 ptrace_fork(p, clone_flags);
112701
112702 /* Perform scheduler related setup. Assign this task to a CPU. */
112703 @@ -1180,6 +1178,10 @@
112704 #endif
112705 clear_all_latency_tracing(p);
112706
112707 + /* Our parent execution domain becomes current domain
112708 + These must match for thread signalling to apply */
112709 + p->parent_exec_id = p->self_exec_id;
112710 +
112711 /* ok, now we should be set up.. */
112712 p->exit_signal = (clone_flags & CLONE_THREAD) ? -1 : (clone_flags & CSIGNAL);
112713 p->pdeath_signal = 0;
112714 @@ -1217,13 +1219,10 @@
112715 set_task_cpu(p, smp_processor_id());
112716
112717 /* CLONE_PARENT re-uses the old parent */
112718 - if (clone_flags & (CLONE_PARENT|CLONE_THREAD)) {
112719 + if (clone_flags & (CLONE_PARENT|CLONE_THREAD))
112720 p->real_parent = current->real_parent;
112721 - p->parent_exec_id = current->parent_exec_id;
112722 - } else {
112723 + else
112724 p->real_parent = current;
112725 - p->parent_exec_id = current->self_exec_id;
112726 - }
112727
112728 spin_lock(&current->sighand->siglock);
112729
112730 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/futex.c linux-2.6.29-rc3.owrt/kernel/futex.c
112731 --- linux-2.6.29.owrt/kernel/futex.c 2009-05-10 22:04:41.000000000 +0200
112732 +++ linux-2.6.29-rc3.owrt/kernel/futex.c 2009-05-10 23:48:29.000000000 +0200
112733 @@ -1165,7 +1165,6 @@
112734 u32 val, ktime_t *abs_time, u32 bitset, int clockrt)
112735 {
112736 struct task_struct *curr = current;
112737 - struct restart_block *restart;
112738 DECLARE_WAITQUEUE(wait, curr);
112739 struct futex_hash_bucket *hb;
112740 struct futex_q q;
112741 @@ -1217,13 +1216,11 @@
112742
112743 if (!ret)
112744 goto retry;
112745 - goto out;
112746 + return ret;
112747 }
112748 ret = -EWOULDBLOCK;
112749 - if (unlikely(uval != val)) {
112750 - queue_unlock(&q, hb);
112751 - goto out_put_key;
112752 - }
112753 + if (uval != val)
112754 + goto out_unlock_put_key;
112755
112756 /* Only actually queue if *uaddr contained val. */
112757 queue_me(&q, hb);
112758 @@ -1287,38 +1284,38 @@
112759 */
112760
112761 /* If we were woken (and unqueued), we succeeded, whatever. */
112762 - ret = 0;
112763 if (!unqueue_me(&q))
112764 - goto out_put_key;
112765 - ret = -ETIMEDOUT;
112766 + return 0;
112767 if (rem)
112768 - goto out_put_key;
112769 + return -ETIMEDOUT;
112770
112771 /*
112772 * We expect signal_pending(current), but another thread may
112773 * have handled it for us already.
112774 */
112775 - ret = -ERESTARTSYS;
112776 if (!abs_time)
112777 - goto out_put_key;
112778 -
112779 - restart = &current_thread_info()->restart_block;
112780 - restart->fn = futex_wait_restart;
112781 - restart->futex.uaddr = (u32 *)uaddr;
112782 - restart->futex.val = val;
112783 - restart->futex.time = abs_time->tv64;
112784 - restart->futex.bitset = bitset;
112785 - restart->futex.flags = 0;
112786 -
112787 - if (fshared)
112788 - restart->futex.flags |= FLAGS_SHARED;
112789 - if (clockrt)
112790 - restart->futex.flags |= FLAGS_CLOCKRT;
112791 -
112792 - ret = -ERESTART_RESTARTBLOCK;
112793 + return -ERESTARTSYS;
112794 + else {
112795 + struct restart_block *restart;
112796 + restart = &current_thread_info()->restart_block;
112797 + restart->fn = futex_wait_restart;
112798 + restart->futex.uaddr = (u32 *)uaddr;
112799 + restart->futex.val = val;
112800 + restart->futex.time = abs_time->tv64;
112801 + restart->futex.bitset = bitset;
112802 + restart->futex.flags = 0;
112803 +
112804 + if (fshared)
112805 + restart->futex.flags |= FLAGS_SHARED;
112806 + if (clockrt)
112807 + restart->futex.flags |= FLAGS_CLOCKRT;
112808 + return -ERESTART_RESTARTBLOCK;
112809 + }
112810
112811 -out_put_key:
112812 +out_unlock_put_key:
112813 + queue_unlock(&q, hb);
112814 put_futex_key(fshared, &q.key);
112815 +
112816 out:
112817 return ret;
112818 }
112819 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/hrtimer.c linux-2.6.29-rc3.owrt/kernel/hrtimer.c
112820 --- linux-2.6.29.owrt/kernel/hrtimer.c 2009-05-10 22:04:41.000000000 +0200
112821 +++ linux-2.6.29-rc3.owrt/kernel/hrtimer.c 2009-05-10 23:48:29.000000000 +0200
112822 @@ -501,13 +501,6 @@
112823 continue;
112824 timer = rb_entry(base->first, struct hrtimer, node);
112825 expires = ktime_sub(hrtimer_get_expires(timer), base->offset);
112826 - /*
112827 - * clock_was_set() has changed base->offset so the
112828 - * result might be negative. Fix it up to prevent a
112829 - * false positive in clockevents_program_event()
112830 - */
112831 - if (expires.tv64 < 0)
112832 - expires.tv64 = 0;
112833 if (expires.tv64 < cpu_base->expires_next.tv64)
112834 cpu_base->expires_next = expires;
112835 }
112836 @@ -1165,29 +1158,6 @@
112837
112838 #ifdef CONFIG_HIGH_RES_TIMERS
112839
112840 -static int force_clock_reprogram;
112841 -
112842 -/*
112843 - * After 5 iteration's attempts, we consider that hrtimer_interrupt()
112844 - * is hanging, which could happen with something that slows the interrupt
112845 - * such as the tracing. Then we force the clock reprogramming for each future
112846 - * hrtimer interrupts to avoid infinite loops and use the min_delta_ns
112847 - * threshold that we will overwrite.
112848 - * The next tick event will be scheduled to 3 times we currently spend on
112849 - * hrtimer_interrupt(). This gives a good compromise, the cpus will spend
112850 - * 1/4 of their time to process the hrtimer interrupts. This is enough to
112851 - * let it running without serious starvation.
112852 - */
112853 -
112854 -static inline void
112855 -hrtimer_interrupt_hanging(struct clock_event_device *dev,
112856 - ktime_t try_time)
112857 -{
112858 - force_clock_reprogram = 1;
112859 - dev->min_delta_ns = (unsigned long)try_time.tv64 * 3;
112860 - printk(KERN_WARNING "hrtimer: interrupt too slow, "
112861 - "forcing clock min delta to %lu ns\n", dev->min_delta_ns);
112862 -}
112863 /*
112864 * High resolution timer interrupt
112865 * Called with interrupts disabled
112866 @@ -1197,7 +1167,6 @@
112867 struct hrtimer_cpu_base *cpu_base = &__get_cpu_var(hrtimer_bases);
112868 struct hrtimer_clock_base *base;
112869 ktime_t expires_next, now;
112870 - int nr_retries = 0;
112871 int i;
112872
112873 BUG_ON(!cpu_base->hres_active);
112874 @@ -1205,10 +1174,6 @@
112875 dev->next_event.tv64 = KTIME_MAX;
112876
112877 retry:
112878 - /* 5 retries is enough to notice a hang */
112879 - if (!(++nr_retries % 5))
112880 - hrtimer_interrupt_hanging(dev, ktime_sub(ktime_get(), now));
112881 -
112882 now = ktime_get();
112883
112884 expires_next.tv64 = KTIME_MAX;
112885 @@ -1261,7 +1226,7 @@
112886
112887 /* Reprogramming necessary ? */
112888 if (expires_next.tv64 != KTIME_MAX) {
112889 - if (tick_program_event(expires_next, force_clock_reprogram))
112890 + if (tick_program_event(expires_next, 0))
112891 goto retry;
112892 }
112893 }
112894 @@ -1615,10 +1580,6 @@
112895 break;
112896
112897 #ifdef CONFIG_HOTPLUG_CPU
112898 - case CPU_DYING:
112899 - case CPU_DYING_FROZEN:
112900 - clockevents_notify(CLOCK_EVT_NOTIFY_CPU_DYING, &scpu);
112901 - break;
112902 case CPU_DEAD:
112903 case CPU_DEAD_FROZEN:
112904 {
112905 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/irq/chip.c linux-2.6.29-rc3.owrt/kernel/irq/chip.c
112906 --- linux-2.6.29.owrt/kernel/irq/chip.c 2009-05-10 22:04:41.000000000 +0200
112907 +++ linux-2.6.29-rc3.owrt/kernel/irq/chip.c 2009-05-10 23:48:29.000000000 +0200
112908 @@ -383,7 +383,6 @@
112909 out_unlock:
112910 spin_unlock(&desc->lock);
112911 }
112912 -EXPORT_SYMBOL_GPL(handle_level_irq);
112913
112914 /**
112915 * handle_fasteoi_irq - irq handler for transparent controllers
112916 @@ -594,7 +593,6 @@
112917 }
112918 spin_unlock_irqrestore(&desc->lock, flags);
112919 }
112920 -EXPORT_SYMBOL_GPL(__set_irq_handler);
112921
112922 void
112923 set_irq_chip_and_handler(unsigned int irq, struct irq_chip *chip,
112924 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/irq/numa_migrate.c linux-2.6.29-rc3.owrt/kernel/irq/numa_migrate.c
112925 --- linux-2.6.29.owrt/kernel/irq/numa_migrate.c 2009-05-10 22:04:41.000000000 +0200
112926 +++ linux-2.6.29-rc3.owrt/kernel/irq/numa_migrate.c 2009-05-10 23:48:29.000000000 +0200
112927 @@ -71,7 +71,7 @@
112928 desc = irq_desc_ptrs[irq];
112929
112930 if (desc && old_desc != desc)
112931 - goto out_unlock;
112932 + goto out_unlock;
112933
112934 node = cpu_to_node(cpu);
112935 desc = kzalloc_node(sizeof(*desc), GFP_ATOMIC, node);
112936 @@ -84,15 +84,10 @@
112937 init_copy_one_irq_desc(irq, old_desc, desc, cpu);
112938
112939 irq_desc_ptrs[irq] = desc;
112940 - spin_unlock_irqrestore(&sparse_irq_lock, flags);
112941
112942 /* free the old one */
112943 free_one_irq_desc(old_desc, desc);
112944 - spin_unlock(&old_desc->lock);
112945 kfree(old_desc);
112946 - spin_lock(&desc->lock);
112947 -
112948 - return desc;
112949
112950 out_unlock:
112951 spin_unlock_irqrestore(&sparse_irq_lock, flags);
112952 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/itimer.c linux-2.6.29-rc3.owrt/kernel/itimer.c
112953 --- linux-2.6.29.owrt/kernel/itimer.c 2009-05-10 22:04:41.000000000 +0200
112954 +++ linux-2.6.29-rc3.owrt/kernel/itimer.c 2009-05-10 23:48:29.000000000 +0200
112955 @@ -62,7 +62,7 @@
112956 struct task_cputime cputime;
112957 cputime_t utime;
112958
112959 - thread_group_cputimer(tsk, &cputime);
112960 + thread_group_cputime(tsk, &cputime);
112961 utime = cputime.utime;
112962 if (cputime_le(cval, utime)) { /* about to fire */
112963 cval = jiffies_to_cputime(1);
112964 @@ -82,7 +82,7 @@
112965 struct task_cputime times;
112966 cputime_t ptime;
112967
112968 - thread_group_cputimer(tsk, &times);
112969 + thread_group_cputime(tsk, &times);
112970 ptime = cputime_add(times.utime, times.stime);
112971 if (cputime_le(cval, ptime)) { /* about to fire */
112972 cval = jiffies_to_cputime(1);
112973 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/kexec.c linux-2.6.29-rc3.owrt/kernel/kexec.c
112974 --- linux-2.6.29.owrt/kernel/kexec.c 2009-05-10 22:04:41.000000000 +0200
112975 +++ linux-2.6.29-rc3.owrt/kernel/kexec.c 2009-05-10 23:48:29.000000000 +0200
112976 @@ -1465,11 +1465,6 @@
112977 error = device_power_down(PMSG_FREEZE);
112978 if (error)
112979 goto Enable_irqs;
112980 -
112981 - /* Suspend system devices */
112982 - error = sysdev_suspend(PMSG_FREEZE);
112983 - if (error)
112984 - goto Power_up_devices;
112985 } else
112986 #endif
112987 {
112988 @@ -1482,8 +1477,6 @@
112989
112990 #ifdef CONFIG_KEXEC_JUMP
112991 if (kexec_image->preserve_context) {
112992 - sysdev_resume();
112993 - Power_up_devices:
112994 device_power_up(PMSG_RESTORE);
112995 Enable_irqs:
112996 local_irq_enable();
112997 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/Makefile linux-2.6.29-rc3.owrt/kernel/Makefile
112998 --- linux-2.6.29.owrt/kernel/Makefile 2009-05-10 22:04:41.000000000 +0200
112999 +++ linux-2.6.29-rc3.owrt/kernel/Makefile 2009-05-10 23:48:29.000000000 +0200
113000 @@ -51,7 +51,6 @@
113001 obj-$(CONFIG_MODULES) += module.o
113002 obj-$(CONFIG_KALLSYMS) += kallsyms.o
113003 obj-$(CONFIG_PM) += power/
113004 -obj-$(CONFIG_FREEZER) += power/
113005 obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o
113006 obj-$(CONFIG_KEXEC) += kexec.o
113007 obj-$(CONFIG_BACKTRACE_SELF_TEST) += backtracetest.o
113008 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/module.c linux-2.6.29-rc3.owrt/kernel/module.c
113009 --- linux-2.6.29.owrt/kernel/module.c 2009-05-10 22:04:41.000000000 +0200
113010 +++ linux-2.6.29-rc3.owrt/kernel/module.c 2009-05-10 23:48:29.000000000 +0200
113011 @@ -573,13 +573,13 @@
113012 /* Init the unload section of the module. */
113013 static void module_unload_init(struct module *mod)
113014 {
113015 - int cpu;
113016 + unsigned int i;
113017
113018 INIT_LIST_HEAD(&mod->modules_which_use_me);
113019 - for_each_possible_cpu(cpu)
113020 - local_set(__module_ref_addr(mod, cpu), 0);
113021 + for (i = 0; i < NR_CPUS; i++)
113022 + local_set(&mod->ref[i].count, 0);
113023 /* Hold reference count during initialization. */
113024 - local_set(__module_ref_addr(mod, raw_smp_processor_id()), 1);
113025 + local_set(&mod->ref[raw_smp_processor_id()].count, 1);
113026 /* Backwards compatibility macros put refcount during init. */
113027 mod->waiter = current;
113028 }
113029 @@ -717,11 +717,10 @@
113030
113031 unsigned int module_refcount(struct module *mod)
113032 {
113033 - unsigned int total = 0;
113034 - int cpu;
113035 + unsigned int i, total = 0;
113036
113037 - for_each_possible_cpu(cpu)
113038 - total += local_read(__module_ref_addr(mod, cpu));
113039 + for (i = 0; i < NR_CPUS; i++)
113040 + total += local_read(&mod->ref[i].count);
113041 return total;
113042 }
113043 EXPORT_SYMBOL(module_refcount);
113044 @@ -895,7 +894,7 @@
113045 {
113046 if (module) {
113047 unsigned int cpu = get_cpu();
113048 - local_dec(__module_ref_addr(module, cpu));
113049 + local_dec(&module->ref[cpu].count);
113050 /* Maybe they're waiting for us to drop reference? */
113051 if (unlikely(!module_is_live(module)))
113052 wake_up_process(module->waiter);
113053 @@ -1465,10 +1464,7 @@
113054 kfree(mod->args);
113055 if (mod->percpu)
113056 percpu_modfree(mod->percpu);
113057 -#if defined(CONFIG_MODULE_UNLOAD) && defined(CONFIG_SMP)
113058 - if (mod->refptr)
113059 - percpu_modfree(mod->refptr);
113060 -#endif
113061 +
113062 /* Free lock-classes: */
113063 lockdep_free_key_range(mod->module_core, mod->core_size);
113064
113065 @@ -2074,14 +2070,6 @@
113066 /* Module has been moved. */
113067 mod = (void *)sechdrs[modindex].sh_addr;
113068
113069 -#if defined(CONFIG_MODULE_UNLOAD) && defined(CONFIG_SMP)
113070 - mod->refptr = percpu_modalloc(sizeof(local_t), __alignof__(local_t),
113071 - mod->name);
113072 - if (!mod->refptr) {
113073 - err = -ENOMEM;
113074 - goto free_init;
113075 - }
113076 -#endif
113077 /* Now we've moved module, initialize linked lists, etc. */
113078 module_unload_init(mod);
113079
113080 @@ -2288,14 +2276,9 @@
113081 ftrace_release(mod->module_core, mod->core_size);
113082 free_unload:
113083 module_unload_free(mod);
113084 - free_init:
113085 -#if defined(CONFIG_MODULE_UNLOAD) && defined(CONFIG_SMP)
113086 - percpu_modfree(mod->refptr);
113087 -#endif
113088 module_free(mod, mod->module_init);
113089 free_core:
113090 module_free(mod, mod->module_core);
113091 - /* mod will be freed with core. Don't access it beyond this line! */
113092 free_percpu:
113093 if (percpu)
113094 percpu_modfree(percpu);
113095 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/posix-cpu-timers.c linux-2.6.29-rc3.owrt/kernel/posix-cpu-timers.c
113096 --- linux-2.6.29.owrt/kernel/posix-cpu-timers.c 2009-05-10 22:04:41.000000000 +0200
113097 +++ linux-2.6.29-rc3.owrt/kernel/posix-cpu-timers.c 2009-05-10 23:48:29.000000000 +0200
113098 @@ -230,71 +230,6 @@
113099 return 0;
113100 }
113101
113102 -void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times)
113103 -{
113104 - struct sighand_struct *sighand;
113105 - struct signal_struct *sig;
113106 - struct task_struct *t;
113107 -
113108 - *times = INIT_CPUTIME;
113109 -
113110 - rcu_read_lock();
113111 - sighand = rcu_dereference(tsk->sighand);
113112 - if (!sighand)
113113 - goto out;
113114 -
113115 - sig = tsk->signal;
113116 -
113117 - t = tsk;
113118 - do {
113119 - times->utime = cputime_add(times->utime, t->utime);
113120 - times->stime = cputime_add(times->stime, t->stime);
113121 - times->sum_exec_runtime += t->se.sum_exec_runtime;
113122 -
113123 - t = next_thread(t);
113124 - } while (t != tsk);
113125 -
113126 - times->utime = cputime_add(times->utime, sig->utime);
113127 - times->stime = cputime_add(times->stime, sig->stime);
113128 - times->sum_exec_runtime += sig->sum_sched_runtime;
113129 -out:
113130 - rcu_read_unlock();
113131 -}
113132 -
113133 -static void update_gt_cputime(struct task_cputime *a, struct task_cputime *b)
113134 -{
113135 - if (cputime_gt(b->utime, a->utime))
113136 - a->utime = b->utime;
113137 -
113138 - if (cputime_gt(b->stime, a->stime))
113139 - a->stime = b->stime;
113140 -
113141 - if (b->sum_exec_runtime > a->sum_exec_runtime)
113142 - a->sum_exec_runtime = b->sum_exec_runtime;
113143 -}
113144 -
113145 -void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times)
113146 -{
113147 - struct thread_group_cputimer *cputimer = &tsk->signal->cputimer;
113148 - struct task_cputime sum;
113149 - unsigned long flags;
113150 -
113151 - spin_lock_irqsave(&cputimer->lock, flags);
113152 - if (!cputimer->running) {
113153 - cputimer->running = 1;
113154 - /*
113155 - * The POSIX timer interface allows for absolute time expiry
113156 - * values through the TIMER_ABSTIME flag, therefore we have
113157 - * to synchronize the timer to the clock every time we start
113158 - * it.
113159 - */
113160 - thread_group_cputime(tsk, &sum);
113161 - update_gt_cputime(&cputimer->cputime, &sum);
113162 - }
113163 - *times = cputimer->cputime;
113164 - spin_unlock_irqrestore(&cputimer->lock, flags);
113165 -}
113166 -
113167 /*
113168 * Sample a process (thread group) clock for the given group_leader task.
113169 * Must be called with tasklist_lock held for reading.
113170 @@ -522,7 +457,7 @@
113171 {
113172 struct task_cputime cputime;
113173
113174 - thread_group_cputimer(tsk, &cputime);
113175 + thread_group_cputime(tsk, &cputime);
113176 cleanup_timers(tsk->signal->cpu_timers,
113177 cputime.utime, cputime.stime, cputime.sum_exec_runtime);
113178 }
113179 @@ -681,33 +616,6 @@
113180 }
113181
113182 /*
113183 - * Sample a process (thread group) timer for the given group_leader task.
113184 - * Must be called with tasklist_lock held for reading.
113185 - */
113186 -static int cpu_timer_sample_group(const clockid_t which_clock,
113187 - struct task_struct *p,
113188 - union cpu_time_count *cpu)
113189 -{
113190 - struct task_cputime cputime;
113191 -
113192 - thread_group_cputimer(p, &cputime);
113193 - switch (CPUCLOCK_WHICH(which_clock)) {
113194 - default:
113195 - return -EINVAL;
113196 - case CPUCLOCK_PROF:
113197 - cpu->cpu = cputime_add(cputime.utime, cputime.stime);
113198 - break;
113199 - case CPUCLOCK_VIRT:
113200 - cpu->cpu = cputime.utime;
113201 - break;
113202 - case CPUCLOCK_SCHED:
113203 - cpu->sched = cputime.sum_exec_runtime + task_delta_exec(p);
113204 - break;
113205 - }
113206 - return 0;
113207 -}
113208 -
113209 -/*
113210 * Guts of sys_timer_settime for CPU timers.
113211 * This is called with the timer locked and interrupts disabled.
113212 * If we return TIMER_RETRY, it's necessary to release the timer's lock
113213 @@ -768,7 +676,7 @@
113214 if (CPUCLOCK_PERTHREAD(timer->it_clock)) {
113215 cpu_clock_sample(timer->it_clock, p, &val);
113216 } else {
113217 - cpu_timer_sample_group(timer->it_clock, p, &val);
113218 + cpu_clock_sample_group(timer->it_clock, p, &val);
113219 }
113220
113221 if (old) {
113222 @@ -916,7 +824,7 @@
113223 read_unlock(&tasklist_lock);
113224 goto dead;
113225 } else {
113226 - cpu_timer_sample_group(timer->it_clock, p, &now);
113227 + cpu_clock_sample_group(timer->it_clock, p, &now);
113228 clear_dead = (unlikely(p->exit_state) &&
113229 thread_group_empty(p));
113230 }
113231 @@ -1056,19 +964,6 @@
113232 }
113233 }
113234
113235 -static void stop_process_timers(struct task_struct *tsk)
113236 -{
113237 - struct thread_group_cputimer *cputimer = &tsk->signal->cputimer;
113238 - unsigned long flags;
113239 -
113240 - if (!cputimer->running)
113241 - return;
113242 -
113243 - spin_lock_irqsave(&cputimer->lock, flags);
113244 - cputimer->running = 0;
113245 - spin_unlock_irqrestore(&cputimer->lock, flags);
113246 -}
113247 -
113248 /*
113249 * Check for any per-thread CPU timers that have fired and move them
113250 * off the tsk->*_timers list onto the firing list. Per-thread timers
113251 @@ -1092,15 +987,13 @@
113252 sig->rlim[RLIMIT_CPU].rlim_cur == RLIM_INFINITY &&
113253 list_empty(&timers[CPUCLOCK_VIRT]) &&
113254 cputime_eq(sig->it_virt_expires, cputime_zero) &&
113255 - list_empty(&timers[CPUCLOCK_SCHED])) {
113256 - stop_process_timers(tsk);
113257 + list_empty(&timers[CPUCLOCK_SCHED]))
113258 return;
113259 - }
113260
113261 /*
113262 * Collect the current process totals.
113263 */
113264 - thread_group_cputimer(tsk, &cputime);
113265 + thread_group_cputime(tsk, &cputime);
113266 utime = cputime.utime;
113267 ptime = cputime_add(utime, cputime.stime);
113268 sum_sched_runtime = cputime.sum_exec_runtime;
113269 @@ -1271,7 +1164,7 @@
113270 clear_dead_task(timer, now);
113271 goto out_unlock;
113272 }
113273 - cpu_timer_sample_group(timer->it_clock, p, &now);
113274 + cpu_clock_sample_group(timer->it_clock, p, &now);
113275 bump_cpu_timer(timer, now);
113276 /* Leave the tasklist_lock locked for the call below. */
113277 }
113278 @@ -1366,7 +1259,7 @@
113279 if (!task_cputime_zero(&sig->cputime_expires)) {
113280 struct task_cputime group_sample;
113281
113282 - thread_group_cputimer(tsk, &group_sample);
113283 + thread_group_cputime(tsk, &group_sample);
113284 if (task_cputime_expired(&group_sample, &sig->cputime_expires))
113285 return 1;
113286 }
113287 @@ -1448,7 +1341,7 @@
113288 struct list_head *head;
113289
113290 BUG_ON(clock_idx == CPUCLOCK_SCHED);
113291 - cpu_timer_sample_group(clock_idx, tsk, &now);
113292 + cpu_clock_sample_group(clock_idx, tsk, &now);
113293
113294 if (oldval) {
113295 if (!cputime_eq(*oldval, cputime_zero)) {
113296 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/power/console.c linux-2.6.29-rc3.owrt/kernel/power/console.c
113297 --- linux-2.6.29.owrt/kernel/power/console.c 2009-05-10 22:04:41.000000000 +0200
113298 +++ linux-2.6.29-rc3.owrt/kernel/power/console.c 2009-05-10 23:48:29.000000000 +0200
113299 @@ -78,12 +78,6 @@
113300 }
113301 set_console(orig_fgconsole);
113302 release_console_sem();
113303 -
113304 - if (vt_waitactive(orig_fgconsole)) {
113305 - pr_debug("Resume: Can't switch VCs.");
113306 - return;
113307 - }
113308 -
113309 kmsg_redirect = orig_kmsg;
113310 }
113311 #endif
113312 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/power/disk.c linux-2.6.29-rc3.owrt/kernel/power/disk.c
113313 --- linux-2.6.29.owrt/kernel/power/disk.c 2009-05-10 22:04:41.000000000 +0200
113314 +++ linux-2.6.29-rc3.owrt/kernel/power/disk.c 2009-05-10 23:48:29.000000000 +0200
113315 @@ -227,12 +227,6 @@
113316 "aborting hibernation\n");
113317 goto Enable_irqs;
113318 }
113319 - sysdev_suspend(PMSG_FREEZE);
113320 - if (error) {
113321 - printk(KERN_ERR "PM: Some devices failed to power down, "
113322 - "aborting hibernation\n");
113323 - goto Power_up_devices;
113324 - }
113325
113326 if (hibernation_test(TEST_CORE))
113327 goto Power_up;
113328 @@ -248,11 +242,9 @@
113329 if (!in_suspend)
113330 platform_leave(platform_mode);
113331 Power_up:
113332 - sysdev_resume();
113333 /* NOTE: device_power_up() is just a resume() for devices
113334 * that suspended with irqs off ... no overall powerup.
113335 */
113336 - Power_up_devices:
113337 device_power_up(in_suspend ?
113338 (error ? PMSG_RECOVER : PMSG_THAW) : PMSG_RESTORE);
113339 Enable_irqs:
113340 @@ -343,7 +335,6 @@
113341 "aborting resume\n");
113342 goto Enable_irqs;
113343 }
113344 - sysdev_suspend(PMSG_QUIESCE);
113345 /* We'll ignore saved state, but this gets preempt count (etc) right */
113346 save_processor_state();
113347 error = restore_highmem();
113348 @@ -366,7 +357,6 @@
113349 swsusp_free();
113350 restore_processor_state();
113351 touch_softlockup_watchdog();
113352 - sysdev_resume();
113353 device_power_up(PMSG_RECOVER);
113354 Enable_irqs:
113355 local_irq_enable();
113356 @@ -450,7 +440,6 @@
113357 local_irq_disable();
113358 error = device_power_down(PMSG_HIBERNATE);
113359 if (!error) {
113360 - sysdev_suspend(PMSG_HIBERNATE);
113361 hibernation_ops->enter();
113362 /* We should never get here */
113363 while (1);
113364 @@ -606,12 +595,6 @@
113365 unsigned int flags;
113366
113367 /*
113368 - * If the user said "noresume".. bail out early.
113369 - */
113370 - if (noresume)
113371 - return 0;
113372 -
113373 - /*
113374 * name_to_dev_t() below takes a sysfs buffer mutex when sysfs
113375 * is configured into the kernel. Since the regular hibernate
113376 * trigger path is via sysfs which takes a buffer mutex before
113377 @@ -627,11 +610,6 @@
113378 mutex_unlock(&pm_mutex);
113379 return -ENOENT;
113380 }
113381 - /*
113382 - * Some device discovery might still be in progress; we need
113383 - * to wait for this to finish.
113384 - */
113385 - wait_for_device_probe();
113386 swsusp_resume_device = name_to_dev_t(resume_file);
113387 pr_debug("PM: Resume from partition %s\n", resume_file);
113388 } else {
113389 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/power/main.c linux-2.6.29-rc3.owrt/kernel/power/main.c
113390 --- linux-2.6.29.owrt/kernel/power/main.c 2009-05-10 22:04:41.000000000 +0200
113391 +++ linux-2.6.29-rc3.owrt/kernel/power/main.c 2009-05-10 23:48:29.000000000 +0200
113392 @@ -57,6 +57,16 @@
113393 #ifdef CONFIG_PM_DEBUG
113394 int pm_test_level = TEST_NONE;
113395
113396 +static int suspend_test(int level)
113397 +{
113398 + if (pm_test_level == level) {
113399 + printk(KERN_INFO "suspend debug: Waiting for 5 seconds.\n");
113400 + mdelay(5000);
113401 + return 1;
113402 + }
113403 + return 0;
113404 +}
113405 +
113406 static const char * const pm_tests[__TEST_AFTER_LAST] = {
113407 [TEST_NONE] = "none",
113408 [TEST_CORE] = "core",
113409 @@ -115,24 +125,14 @@
113410 }
113411
113412 power_attr(pm_test);
113413 -#endif /* CONFIG_PM_DEBUG */
113414 +#else /* !CONFIG_PM_DEBUG */
113415 +static inline int suspend_test(int level) { return 0; }
113416 +#endif /* !CONFIG_PM_DEBUG */
113417
113418 #endif /* CONFIG_PM_SLEEP */
113419
113420 #ifdef CONFIG_SUSPEND
113421
113422 -static int suspend_test(int level)
113423 -{
113424 -#ifdef CONFIG_PM_DEBUG
113425 - if (pm_test_level == level) {
113426 - printk(KERN_INFO "suspend debug: Waiting for 5 seconds.\n");
113427 - mdelay(5000);
113428 - return 1;
113429 - }
113430 -#endif /* !CONFIG_PM_DEBUG */
113431 - return 0;
113432 -}
113433 -
113434 #ifdef CONFIG_PM_TEST_SUSPEND
113435
113436 /*
113437 @@ -298,12 +298,8 @@
113438 goto Done;
113439 }
113440
113441 - error = sysdev_suspend(PMSG_SUSPEND);
113442 - if (!error) {
113443 - if (!suspend_test(TEST_CORE))
113444 - error = suspend_ops->enter(state);
113445 - sysdev_resume();
113446 - }
113447 + if (!suspend_test(TEST_CORE))
113448 + error = suspend_ops->enter(state);
113449
113450 device_power_up(PMSG_RESUME);
113451 Done:
113452 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/power/Makefile linux-2.6.29-rc3.owrt/kernel/power/Makefile
113453 --- linux-2.6.29.owrt/kernel/power/Makefile 2009-05-10 22:04:41.000000000 +0200
113454 +++ linux-2.6.29-rc3.owrt/kernel/power/Makefile 2009-05-10 23:48:29.000000000 +0200
113455 @@ -3,7 +3,7 @@
113456 EXTRA_CFLAGS += -DDEBUG
113457 endif
113458
113459 -obj-$(CONFIG_PM) += main.o
113460 +obj-y := main.o
113461 obj-$(CONFIG_PM_SLEEP) += console.o
113462 obj-$(CONFIG_FREEZER) += process.o
113463 obj-$(CONFIG_HIBERNATION) += swsusp.o disk.o snapshot.o swap.o user.o
113464 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/power/swap.c linux-2.6.29-rc3.owrt/kernel/power/swap.c
113465 --- linux-2.6.29.owrt/kernel/power/swap.c 2009-05-10 22:04:41.000000000 +0200
113466 +++ linux-2.6.29-rc3.owrt/kernel/power/swap.c 2009-05-10 23:48:29.000000000 +0200
113467 @@ -60,7 +60,6 @@
113468 static int submit(int rw, pgoff_t page_off, struct page *page,
113469 struct bio **bio_chain)
113470 {
113471 - const int bio_rw = rw | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG);
113472 struct bio *bio;
113473
113474 bio = bio_alloc(__GFP_WAIT | __GFP_HIGH, 1);
113475 @@ -81,7 +80,7 @@
113476 bio_get(bio);
113477
113478 if (bio_chain == NULL) {
113479 - submit_bio(bio_rw, bio);
113480 + submit_bio(rw | (1 << BIO_RW_SYNC), bio);
113481 wait_on_page_locked(page);
113482 if (rw == READ)
113483 bio_set_pages_dirty(bio);
113484 @@ -91,7 +90,7 @@
113485 get_page(page); /* These pages are freed later */
113486 bio->bi_private = *bio_chain;
113487 *bio_chain = bio;
113488 - submit_bio(bio_rw, bio);
113489 + submit_bio(rw | (1 << BIO_RW_SYNC), bio);
113490 }
113491 return 0;
113492 }
113493 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/power/user.c linux-2.6.29-rc3.owrt/kernel/power/user.c
113494 --- linux-2.6.29.owrt/kernel/power/user.c 2009-05-10 22:04:41.000000000 +0200
113495 +++ linux-2.6.29-rc3.owrt/kernel/power/user.c 2009-05-10 23:48:29.000000000 +0200
113496 @@ -95,15 +95,15 @@
113497 data->swap = swsusp_resume_device ?
113498 swap_type_of(swsusp_resume_device, 0, NULL) : -1;
113499 data->mode = O_RDONLY;
113500 - error = pm_notifier_call_chain(PM_HIBERNATION_PREPARE);
113501 + error = pm_notifier_call_chain(PM_RESTORE_PREPARE);
113502 if (error)
113503 - pm_notifier_call_chain(PM_POST_HIBERNATION);
113504 + pm_notifier_call_chain(PM_POST_RESTORE);
113505 } else {
113506 data->swap = -1;
113507 data->mode = O_WRONLY;
113508 - error = pm_notifier_call_chain(PM_RESTORE_PREPARE);
113509 + error = pm_notifier_call_chain(PM_HIBERNATION_PREPARE);
113510 if (error)
113511 - pm_notifier_call_chain(PM_POST_RESTORE);
113512 + pm_notifier_call_chain(PM_POST_HIBERNATION);
113513 }
113514 if (error)
113515 atomic_inc(&snapshot_device_available);
113516 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/printk.c linux-2.6.29-rc3.owrt/kernel/printk.c
113517 --- linux-2.6.29.owrt/kernel/printk.c 2009-05-10 22:04:41.000000000 +0200
113518 +++ linux-2.6.29-rc3.owrt/kernel/printk.c 2009-05-10 23:48:29.000000000 +0200
113519 @@ -73,6 +73,7 @@
113520 * driver system.
113521 */
113522 static DECLARE_MUTEX(console_sem);
113523 +static DECLARE_MUTEX(secondary_console_sem);
113524 struct console *console_drivers;
113525 EXPORT_SYMBOL_GPL(console_drivers);
113526
113527 @@ -890,14 +891,12 @@
113528 printk("Suspending console(s) (use no_console_suspend to debug)\n");
113529 acquire_console_sem();
113530 console_suspended = 1;
113531 - up(&console_sem);
113532 }
113533
113534 void resume_console(void)
113535 {
113536 if (!console_suspend_enabled)
113537 return;
113538 - down(&console_sem);
113539 console_suspended = 0;
113540 release_console_sem();
113541 }
113542 @@ -913,9 +912,11 @@
113543 void acquire_console_sem(void)
113544 {
113545 BUG_ON(in_interrupt());
113546 - down(&console_sem);
113547 - if (console_suspended)
113548 + if (console_suspended) {
113549 + down(&secondary_console_sem);
113550 return;
113551 + }
113552 + down(&console_sem);
113553 console_locked = 1;
113554 console_may_schedule = 1;
113555 }
113556 @@ -925,10 +926,6 @@
113557 {
113558 if (down_trylock(&console_sem))
113559 return -1;
113560 - if (console_suspended) {
113561 - up(&console_sem);
113562 - return -1;
113563 - }
113564 console_locked = 1;
113565 console_may_schedule = 0;
113566 return 0;
113567 @@ -982,7 +979,7 @@
113568 unsigned wake_klogd = 0;
113569
113570 if (console_suspended) {
113571 - up(&console_sem);
113572 + up(&secondary_console_sem);
113573 return;
113574 }
113575
113576 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/profile.c linux-2.6.29-rc3.owrt/kernel/profile.c
113577 --- linux-2.6.29.owrt/kernel/profile.c 2009-05-10 22:04:41.000000000 +0200
113578 +++ linux-2.6.29-rc3.owrt/kernel/profile.c 2009-05-10 23:48:29.000000000 +0200
113579 @@ -114,15 +114,12 @@
113580 if (!slab_is_available()) {
113581 prof_buffer = alloc_bootmem(buffer_bytes);
113582 alloc_bootmem_cpumask_var(&prof_cpu_mask);
113583 - cpumask_copy(prof_cpu_mask, cpu_possible_mask);
113584 return 0;
113585 }
113586
113587 if (!alloc_cpumask_var(&prof_cpu_mask, GFP_KERNEL))
113588 return -ENOMEM;
113589
113590 - cpumask_copy(prof_cpu_mask, cpu_possible_mask);
113591 -
113592 prof_buffer = kzalloc(buffer_bytes, GFP_KERNEL);
113593 if (prof_buffer)
113594 return 0;
113595 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/rcuclassic.c linux-2.6.29-rc3.owrt/kernel/rcuclassic.c
113596 --- linux-2.6.29.owrt/kernel/rcuclassic.c 2009-05-10 22:04:41.000000000 +0200
113597 +++ linux-2.6.29-rc3.owrt/kernel/rcuclassic.c 2009-05-10 23:48:29.000000000 +0200
113598 @@ -679,8 +679,8 @@
113599 void rcu_check_callbacks(int cpu, int user)
113600 {
113601 if (user ||
113602 - (idle_cpu(cpu) && rcu_scheduler_active &&
113603 - !in_softirq() && hardirq_count() <= (1 << HARDIRQ_SHIFT))) {
113604 + (idle_cpu(cpu) && !in_softirq() &&
113605 + hardirq_count() <= (1 << HARDIRQ_SHIFT))) {
113606
113607 /*
113608 * Get here if this CPU took its interrupt from user
113609 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/rcupdate.c linux-2.6.29-rc3.owrt/kernel/rcupdate.c
113610 --- linux-2.6.29.owrt/kernel/rcupdate.c 2009-05-10 22:04:41.000000000 +0200
113611 +++ linux-2.6.29-rc3.owrt/kernel/rcupdate.c 2009-05-10 23:48:29.000000000 +0200
113612 @@ -44,7 +44,6 @@
113613 #include <linux/cpu.h>
113614 #include <linux/mutex.h>
113615 #include <linux/module.h>
113616 -#include <linux/kernel_stat.h>
113617
113618 enum rcu_barrier {
113619 RCU_BARRIER_STD,
113620 @@ -56,7 +55,6 @@
113621 static atomic_t rcu_barrier_cpu_count;
113622 static DEFINE_MUTEX(rcu_barrier_mutex);
113623 static struct completion rcu_barrier_completion;
113624 -int rcu_scheduler_active __read_mostly;
113625
113626 /*
113627 * Awaken the corresponding synchronize_rcu() instance now that a
113628 @@ -82,10 +80,6 @@
113629 void synchronize_rcu(void)
113630 {
113631 struct rcu_synchronize rcu;
113632 -
113633 - if (rcu_blocking_is_gp())
113634 - return;
113635 -
113636 init_completion(&rcu.completion);
113637 /* Will wake me after RCU finished. */
113638 call_rcu(&rcu.head, wakeme_after_rcu);
113639 @@ -181,9 +175,3 @@
113640 __rcu_init();
113641 }
113642
113643 -void rcu_scheduler_starting(void)
113644 -{
113645 - WARN_ON(num_online_cpus() != 1);
113646 - WARN_ON(nr_context_switches() > 0);
113647 - rcu_scheduler_active = 1;
113648 -}
113649 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/rcupreempt.c linux-2.6.29-rc3.owrt/kernel/rcupreempt.c
113650 --- linux-2.6.29.owrt/kernel/rcupreempt.c 2009-05-10 22:04:41.000000000 +0200
113651 +++ linux-2.6.29-rc3.owrt/kernel/rcupreempt.c 2009-05-10 23:48:29.000000000 +0200
113652 @@ -1181,9 +1181,6 @@
113653 {
113654 struct rcu_synchronize rcu;
113655
113656 - if (num_online_cpus() == 1)
113657 - return; /* blocking is gp if only one CPU! */
113658 -
113659 init_completion(&rcu.completion);
113660 /* Will wake me after RCU finished. */
113661 call_rcu_sched(&rcu.head, wakeme_after_rcu);
113662 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/rcutree.c linux-2.6.29-rc3.owrt/kernel/rcutree.c
113663 --- linux-2.6.29.owrt/kernel/rcutree.c 2009-05-10 22:04:41.000000000 +0200
113664 +++ linux-2.6.29-rc3.owrt/kernel/rcutree.c 2009-05-10 23:48:29.000000000 +0200
113665 @@ -948,8 +948,8 @@
113666 void rcu_check_callbacks(int cpu, int user)
113667 {
113668 if (user ||
113669 - (idle_cpu(cpu) && rcu_scheduler_active &&
113670 - !in_softirq() && hardirq_count() <= (1 << HARDIRQ_SHIFT))) {
113671 + (idle_cpu(cpu) && !in_softirq() &&
113672 + hardirq_count() <= (1 << HARDIRQ_SHIFT))) {
113673
113674 /*
113675 * Get here if this CPU took its interrupt from user
113676 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/sched.c linux-2.6.29-rc3.owrt/kernel/sched.c
113677 --- linux-2.6.29.owrt/kernel/sched.c 2009-05-10 22:04:41.000000000 +0200
113678 +++ linux-2.6.29-rc3.owrt/kernel/sched.c 2009-05-10 23:48:29.000000000 +0200
113679 @@ -223,7 +223,7 @@
113680 {
113681 ktime_t now;
113682
113683 - if (!rt_bandwidth_enabled() || rt_b->rt_runtime == RUNTIME_INF)
113684 + if (rt_bandwidth_enabled() && rt_b->rt_runtime == RUNTIME_INF)
113685 return;
113686
113687 if (hrtimer_active(&rt_b->rt_period_timer))
113688 @@ -3880,24 +3880,19 @@
113689 int cpu = smp_processor_id();
113690
113691 if (stop_tick) {
113692 + cpumask_set_cpu(cpu, nohz.cpu_mask);
113693 cpu_rq(cpu)->in_nohz_recently = 1;
113694
113695 - if (!cpu_active(cpu)) {
113696 - if (atomic_read(&nohz.load_balancer) != cpu)
113697 - return 0;
113698 -
113699 - /*
113700 - * If we are going offline and still the leader,
113701 - * give up!
113702 - */
113703 + /*
113704 + * If we are going offline and still the leader, give up!
113705 + */
113706 + if (!cpu_active(cpu) &&
113707 + atomic_read(&nohz.load_balancer) == cpu) {
113708 if (atomic_cmpxchg(&nohz.load_balancer, cpu, -1) != cpu)
113709 BUG();
113710 -
113711 return 0;
113712 }
113713
113714 - cpumask_set_cpu(cpu, nohz.cpu_mask);
113715 -
113716 /* time for ilb owner also to sleep */
113717 if (cpumask_weight(nohz.cpu_mask) == num_online_cpus()) {
113718 if (atomic_read(&nohz.load_balancer) == cpu)
113719 @@ -4692,8 +4687,8 @@
113720 * started to run but is not in state TASK_RUNNING. try_to_wake_up() returns
113721 * zero in this (rare) case, and we handle it by continuing to scan the queue.
113722 */
113723 -void __wake_up_common(wait_queue_head_t *q, unsigned int mode,
113724 - int nr_exclusive, int sync, void *key)
113725 +static void __wake_up_common(wait_queue_head_t *q, unsigned int mode,
113726 + int nr_exclusive, int sync, void *key)
113727 {
113728 wait_queue_t *curr, *next;
113729
113730 @@ -6945,26 +6940,20 @@
113731
113732 static void rq_attach_root(struct rq *rq, struct root_domain *rd)
113733 {
113734 - struct root_domain *old_rd = NULL;
113735 unsigned long flags;
113736
113737 spin_lock_irqsave(&rq->lock, flags);
113738
113739 if (rq->rd) {
113740 - old_rd = rq->rd;
113741 + struct root_domain *old_rd = rq->rd;
113742
113743 if (cpumask_test_cpu(rq->cpu, old_rd->online))
113744 set_rq_offline(rq);
113745
113746 cpumask_clear_cpu(rq->cpu, old_rd->span);
113747
113748 - /*
113749 - * If we dont want to free the old_rt yet then
113750 - * set old_rd to NULL to skip the freeing later
113751 - * in this function:
113752 - */
113753 - if (!atomic_dec_and_test(&old_rd->refcount))
113754 - old_rd = NULL;
113755 + if (atomic_dec_and_test(&old_rd->refcount))
113756 + free_rootdomain(old_rd);
113757 }
113758
113759 atomic_inc(&rd->refcount);
113760 @@ -6975,9 +6964,6 @@
113761 set_rq_online(rq);
113762
113763 spin_unlock_irqrestore(&rq->lock, flags);
113764 -
113765 - if (old_rd)
113766 - free_rootdomain(old_rd);
113767 }
113768
113769 static int __init_refok init_rootdomain(struct root_domain *rd, bool bootmem)
113770 @@ -9225,16 +9211,6 @@
113771
113772 return ret;
113773 }
113774 -
113775 -int sched_rt_can_attach(struct task_group *tg, struct task_struct *tsk)
113776 -{
113777 - /* Don't accept realtime tasks when there is no way for them to run */
113778 - if (rt_task(tsk) && tg->rt_bandwidth.rt_runtime == 0)
113779 - return 0;
113780 -
113781 - return 1;
113782 -}
113783 -
113784 #else /* !CONFIG_RT_GROUP_SCHED */
113785 static int sched_rt_global_constraints(void)
113786 {
113787 @@ -9328,7 +9304,8 @@
113788 struct task_struct *tsk)
113789 {
113790 #ifdef CONFIG_RT_GROUP_SCHED
113791 - if (!sched_rt_can_attach(cgroup_tg(cgrp), tsk))
113792 + /* Don't accept realtime tasks when there is no way for them to run */
113793 + if (rt_task(tsk) && cgroup_tg(cgrp)->rt_bandwidth.rt_runtime == 0)
113794 return -EINVAL;
113795 #else
113796 /* We don't support RT-tasks being in separate groups */
113797 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/sched_fair.c linux-2.6.29-rc3.owrt/kernel/sched_fair.c
113798 --- linux-2.6.29.owrt/kernel/sched_fair.c 2009-05-10 22:04:41.000000000 +0200
113799 +++ linux-2.6.29-rc3.owrt/kernel/sched_fair.c 2009-05-10 23:48:29.000000000 +0200
113800 @@ -719,7 +719,7 @@
113801 __enqueue_entity(cfs_rq, se);
113802 }
113803
113804 -static void __clear_buddies(struct cfs_rq *cfs_rq, struct sched_entity *se)
113805 +static void clear_buddies(struct cfs_rq *cfs_rq, struct sched_entity *se)
113806 {
113807 if (cfs_rq->last == se)
113808 cfs_rq->last = NULL;
113809 @@ -728,12 +728,6 @@
113810 cfs_rq->next = NULL;
113811 }
113812
113813 -static void clear_buddies(struct cfs_rq *cfs_rq, struct sched_entity *se)
113814 -{
113815 - for_each_sched_entity(se)
113816 - __clear_buddies(cfs_rq_of(se), se);
113817 -}
113818 -
113819 static void
113820 dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int sleep)
113821 {
113822 @@ -774,14 +768,8 @@
113823
113824 ideal_runtime = sched_slice(cfs_rq, curr);
113825 delta_exec = curr->sum_exec_runtime - curr->prev_sum_exec_runtime;
113826 - if (delta_exec > ideal_runtime) {
113827 + if (delta_exec > ideal_runtime)
113828 resched_task(rq_of(cfs_rq)->curr);
113829 - /*
113830 - * The current task ran long enough, ensure it doesn't get
113831 - * re-elected due to buddy favours.
113832 - */
113833 - clear_buddies(cfs_rq, curr);
113834 - }
113835 }
113836
113837 static void
113838 @@ -1464,11 +1452,6 @@
113839
113840 do {
113841 se = pick_next_entity(cfs_rq);
113842 - /*
113843 - * If se was a buddy, clear it so that it will have to earn
113844 - * the favour again.
113845 - */
113846 - __clear_buddies(cfs_rq, se);
113847 set_next_entity(cfs_rq, se);
113848 cfs_rq = group_cfs_rq(se);
113849 } while (cfs_rq);
113850 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/sched_rt.c linux-2.6.29-rc3.owrt/kernel/sched_rt.c
113851 --- linux-2.6.29.owrt/kernel/sched_rt.c 2009-05-10 22:04:41.000000000 +0200
113852 +++ linux-2.6.29-rc3.owrt/kernel/sched_rt.c 2009-05-10 23:48:29.000000000 +0200
113853 @@ -968,8 +968,8 @@
113854 if ((this_cpu != -1) && cpu_isset(this_cpu, *mask))
113855 return this_cpu;
113856
113857 - first = cpumask_first(mask);
113858 - if (first < nr_cpu_ids)
113859 + first = first_cpu(*mask);
113860 + if (first != NR_CPUS)
113861 return first;
113862
113863 return -1;
113864 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/sched_stats.h linux-2.6.29-rc3.owrt/kernel/sched_stats.h
113865 --- linux-2.6.29.owrt/kernel/sched_stats.h 2009-05-10 22:04:41.000000000 +0200
113866 +++ linux-2.6.29-rc3.owrt/kernel/sched_stats.h 2009-05-10 23:48:29.000000000 +0200
113867 @@ -296,21 +296,19 @@
113868 static inline void account_group_user_time(struct task_struct *tsk,
113869 cputime_t cputime)
113870 {
113871 - struct thread_group_cputimer *cputimer;
113872 + struct task_cputime *times;
113873 + struct signal_struct *sig;
113874
113875 /* tsk == current, ensure it is safe to use ->signal */
113876 if (unlikely(tsk->exit_state))
113877 return;
113878
113879 - cputimer = &tsk->signal->cputimer;
113880 -
113881 - if (!cputimer->running)
113882 - return;
113883 + sig = tsk->signal;
113884 + times = &sig->cputime.totals;
113885
113886 - spin_lock(&cputimer->lock);
113887 - cputimer->cputime.utime =
113888 - cputime_add(cputimer->cputime.utime, cputime);
113889 - spin_unlock(&cputimer->lock);
113890 + spin_lock(&times->lock);
113891 + times->utime = cputime_add(times->utime, cputime);
113892 + spin_unlock(&times->lock);
113893 }
113894
113895 /**
113896 @@ -326,21 +324,19 @@
113897 static inline void account_group_system_time(struct task_struct *tsk,
113898 cputime_t cputime)
113899 {
113900 - struct thread_group_cputimer *cputimer;
113901 + struct task_cputime *times;
113902 + struct signal_struct *sig;
113903
113904 /* tsk == current, ensure it is safe to use ->signal */
113905 if (unlikely(tsk->exit_state))
113906 return;
113907
113908 - cputimer = &tsk->signal->cputimer;
113909 -
113910 - if (!cputimer->running)
113911 - return;
113912 + sig = tsk->signal;
113913 + times = &sig->cputime.totals;
113914
113915 - spin_lock(&cputimer->lock);
113916 - cputimer->cputime.stime =
113917 - cputime_add(cputimer->cputime.stime, cputime);
113918 - spin_unlock(&cputimer->lock);
113919 + spin_lock(&times->lock);
113920 + times->stime = cputime_add(times->stime, cputime);
113921 + spin_unlock(&times->lock);
113922 }
113923
113924 /**
113925 @@ -356,7 +352,7 @@
113926 static inline void account_group_exec_runtime(struct task_struct *tsk,
113927 unsigned long long ns)
113928 {
113929 - struct thread_group_cputimer *cputimer;
113930 + struct task_cputime *times;
113931 struct signal_struct *sig;
113932
113933 sig = tsk->signal;
113934 @@ -365,12 +361,9 @@
113935 if (unlikely(!sig))
113936 return;
113937
113938 - cputimer = &sig->cputimer;
113939 -
113940 - if (!cputimer->running)
113941 - return;
113942 + times = &sig->cputime.totals;
113943
113944 - spin_lock(&cputimer->lock);
113945 - cputimer->cputime.sum_exec_runtime += ns;
113946 - spin_unlock(&cputimer->lock);
113947 + spin_lock(&times->lock);
113948 + times->sum_exec_runtime += ns;
113949 + spin_unlock(&times->lock);
113950 }
113951 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/seccomp.c linux-2.6.29-rc3.owrt/kernel/seccomp.c
113952 --- linux-2.6.29.owrt/kernel/seccomp.c 2009-05-10 22:04:41.000000000 +0200
113953 +++ linux-2.6.29-rc3.owrt/kernel/seccomp.c 2009-05-10 23:48:29.000000000 +0200
113954 @@ -8,7 +8,6 @@
113955
113956 #include <linux/seccomp.h>
113957 #include <linux/sched.h>
113958 -#include <linux/compat.h>
113959
113960 /* #define SECCOMP_DEBUG 1 */
113961 #define NR_SECCOMP_MODES 1
113962 @@ -23,7 +22,7 @@
113963 0, /* null terminated */
113964 };
113965
113966 -#ifdef CONFIG_COMPAT
113967 +#ifdef TIF_32BIT
113968 static int mode1_syscalls_32[] = {
113969 __NR_seccomp_read_32, __NR_seccomp_write_32, __NR_seccomp_exit_32, __NR_seccomp_sigreturn_32,
113970 0, /* null terminated */
113971 @@ -38,8 +37,8 @@
113972 switch (mode) {
113973 case 1:
113974 syscall = mode1_syscalls;
113975 -#ifdef CONFIG_COMPAT
113976 - if (is_compat_task())
113977 +#ifdef TIF_32BIT
113978 + if (test_thread_flag(TIF_32BIT))
113979 syscall = mode1_syscalls_32;
113980 #endif
113981 do {
113982 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/signal.c linux-2.6.29-rc3.owrt/kernel/signal.c
113983 --- linux-2.6.29.owrt/kernel/signal.c 2009-05-10 22:04:41.000000000 +0200
113984 +++ linux-2.6.29-rc3.owrt/kernel/signal.c 2009-05-10 23:48:29.000000000 +0200
113985 @@ -909,9 +909,7 @@
113986 }
113987 #endif
113988 printk("\n");
113989 - preempt_disable();
113990 show_regs(regs);
113991 - preempt_enable();
113992 }
113993
113994 static int __init setup_print_fatal_signals(char *str)
113995 @@ -1367,6 +1365,7 @@
113996 struct siginfo info;
113997 unsigned long flags;
113998 struct sighand_struct *psig;
113999 + struct task_cputime cputime;
114000 int ret = sig;
114001
114002 BUG_ON(sig == -1);
114003 @@ -1396,10 +1395,9 @@
114004 info.si_uid = __task_cred(tsk)->uid;
114005 rcu_read_unlock();
114006
114007 - info.si_utime = cputime_to_clock_t(cputime_add(tsk->utime,
114008 - tsk->signal->utime));
114009 - info.si_stime = cputime_to_clock_t(cputime_add(tsk->stime,
114010 - tsk->signal->stime));
114011 + thread_group_cputime(tsk, &cputime);
114012 + info.si_utime = cputime_to_jiffies(cputime.utime);
114013 + info.si_stime = cputime_to_jiffies(cputime.stime);
114014
114015 info.si_status = tsk->exit_code & 0x7f;
114016 if (tsk->exit_code & 0x80)
114017 @@ -1575,15 +1573,7 @@
114018 read_lock(&tasklist_lock);
114019 if (may_ptrace_stop()) {
114020 do_notify_parent_cldstop(current, CLD_TRAPPED);
114021 - /*
114022 - * Don't want to allow preemption here, because
114023 - * sys_ptrace() needs this task to be inactive.
114024 - *
114025 - * XXX: implement read_unlock_no_resched().
114026 - */
114027 - preempt_disable();
114028 read_unlock(&tasklist_lock);
114029 - preempt_enable_no_resched();
114030 schedule();
114031 } else {
114032 /*
114033 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/smp.c linux-2.6.29-rc3.owrt/kernel/smp.c
114034 --- linux-2.6.29.owrt/kernel/smp.c 2009-05-10 22:04:41.000000000 +0200
114035 +++ linux-2.6.29-rc3.owrt/kernel/smp.c 2009-05-10 23:48:29.000000000 +0200
114036 @@ -18,7 +18,6 @@
114037 enum {
114038 CSD_FLAG_WAIT = 0x01,
114039 CSD_FLAG_ALLOC = 0x02,
114040 - CSD_FLAG_LOCK = 0x04,
114041 };
114042
114043 struct call_function_data {
114044 @@ -187,9 +186,6 @@
114045 if (data_flags & CSD_FLAG_WAIT) {
114046 smp_wmb();
114047 data->flags &= ~CSD_FLAG_WAIT;
114048 - } else if (data_flags & CSD_FLAG_LOCK) {
114049 - smp_wmb();
114050 - data->flags &= ~CSD_FLAG_LOCK;
114051 } else if (data_flags & CSD_FLAG_ALLOC)
114052 kfree(data);
114053 }
114054 @@ -200,8 +196,6 @@
114055 }
114056 }
114057
114058 -static DEFINE_PER_CPU(struct call_single_data, csd_data);
114059 -
114060 /*
114061 * smp_call_function_single - Run a function on a specific CPU
114062 * @func: The function to run. This must be fast and non-blocking.
114063 @@ -230,38 +224,14 @@
114064 func(info);
114065 local_irq_restore(flags);
114066 } else if ((unsigned)cpu < nr_cpu_ids && cpu_online(cpu)) {
114067 - struct call_single_data *data;
114068 + struct call_single_data *data = NULL;
114069
114070 if (!wait) {
114071 - /*
114072 - * We are calling a function on a single CPU
114073 - * and we are not going to wait for it to finish.
114074 - * We first try to allocate the data, but if we
114075 - * fail, we fall back to use a per cpu data to pass
114076 - * the information to that CPU. Since all callers
114077 - * of this code will use the same data, we must
114078 - * synchronize the callers to prevent a new caller
114079 - * from corrupting the data before the callee
114080 - * can access it.
114081 - *
114082 - * The CSD_FLAG_LOCK is used to let us know when
114083 - * the IPI handler is done with the data.
114084 - * The first caller will set it, and the callee
114085 - * will clear it. The next caller must wait for
114086 - * it to clear before we set it again. This
114087 - * will make sure the callee is done with the
114088 - * data before a new caller will use it.
114089 - */
114090 data = kmalloc(sizeof(*data), GFP_ATOMIC);
114091 if (data)
114092 data->flags = CSD_FLAG_ALLOC;
114093 - else {
114094 - data = &per_cpu(csd_data, me);
114095 - while (data->flags & CSD_FLAG_LOCK)
114096 - cpu_relax();
114097 - data->flags = CSD_FLAG_LOCK;
114098 - }
114099 - } else {
114100 + }
114101 + if (!data) {
114102 data = &d;
114103 data->flags = CSD_FLAG_WAIT;
114104 }
114105 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/softirq.c linux-2.6.29-rc3.owrt/kernel/softirq.c
114106 --- linux-2.6.29.owrt/kernel/softirq.c 2009-05-10 22:04:41.000000000 +0200
114107 +++ linux-2.6.29-rc3.owrt/kernel/softirq.c 2009-05-10 23:48:29.000000000 +0200
114108 @@ -626,7 +626,6 @@
114109 preempt_enable_no_resched();
114110 cond_resched();
114111 preempt_disable();
114112 - rcu_qsctr_inc((long)__bind_cpu);
114113 }
114114 preempt_enable();
114115 set_current_state(TASK_INTERRUPTIBLE);
114116 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/sys.c linux-2.6.29-rc3.owrt/kernel/sys.c
114117 --- linux-2.6.29.owrt/kernel/sys.c 2009-05-10 22:04:41.000000000 +0200
114118 +++ linux-2.6.29-rc3.owrt/kernel/sys.c 2009-05-10 23:48:29.000000000 +0200
114119 @@ -559,7 +559,7 @@
114120 abort_creds(new);
114121 return retval;
114122 }
114123 -
114124 +
114125 /*
114126 * change the user struct in a credentials set to match the new UID
114127 */
114128 @@ -571,11 +571,6 @@
114129 if (!new_user)
114130 return -EAGAIN;
114131
114132 - if (!task_can_switch_user(new_user, current)) {
114133 - free_uid(new_user);
114134 - return -EINVAL;
114135 - }
114136 -
114137 if (atomic_read(&new_user->processes) >=
114138 current->signal->rlim[RLIMIT_NPROC].rlim_cur &&
114139 new_user != INIT_USER) {
114140 @@ -636,11 +631,10 @@
114141 goto error;
114142 }
114143
114144 - if (new->uid != old->uid) {
114145 - retval = set_user(new);
114146 - if (retval < 0)
114147 - goto error;
114148 - }
114149 + retval = -EAGAIN;
114150 + if (new->uid != old->uid && set_user(new) < 0)
114151 + goto error;
114152 +
114153 if (ruid != (uid_t) -1 ||
114154 (euid != (uid_t) -1 && euid != old->uid))
114155 new->suid = new->euid;
114156 @@ -686,10 +680,9 @@
114157 retval = -EPERM;
114158 if (capable(CAP_SETUID)) {
114159 new->suid = new->uid = uid;
114160 - if (uid != old->uid) {
114161 - retval = set_user(new);
114162 - if (retval < 0)
114163 - goto error;
114164 + if (uid != old->uid && set_user(new) < 0) {
114165 + retval = -EAGAIN;
114166 + goto error;
114167 }
114168 } else if (uid != old->uid && uid != new->suid) {
114169 goto error;
114170 @@ -741,13 +734,11 @@
114171 goto error;
114172 }
114173
114174 + retval = -EAGAIN;
114175 if (ruid != (uid_t) -1) {
114176 new->uid = ruid;
114177 - if (ruid != old->uid) {
114178 - retval = set_user(new);
114179 - if (retval < 0)
114180 - goto error;
114181 - }
114182 + if (ruid != old->uid && set_user(new) < 0)
114183 + goto error;
114184 }
114185 if (euid != (uid_t) -1)
114186 new->euid = euid;
114187 @@ -1534,14 +1525,22 @@
114188 return -EINVAL;
114189 if (copy_from_user(&new_rlim, rlim, sizeof(*rlim)))
114190 return -EFAULT;
114191 - if (new_rlim.rlim_cur > new_rlim.rlim_max)
114192 - return -EINVAL;
114193 old_rlim = current->signal->rlim + resource;
114194 if ((new_rlim.rlim_max > old_rlim->rlim_max) &&
114195 !capable(CAP_SYS_RESOURCE))
114196 return -EPERM;
114197 - if (resource == RLIMIT_NOFILE && new_rlim.rlim_max > sysctl_nr_open)
114198 - return -EPERM;
114199 +
114200 + if (resource == RLIMIT_NOFILE) {
114201 + if (new_rlim.rlim_max == RLIM_INFINITY)
114202 + new_rlim.rlim_max = sysctl_nr_open;
114203 + if (new_rlim.rlim_cur == RLIM_INFINITY)
114204 + new_rlim.rlim_cur = sysctl_nr_open;
114205 + if (new_rlim.rlim_max > sysctl_nr_open)
114206 + return -EPERM;
114207 + }
114208 +
114209 + if (new_rlim.rlim_cur > new_rlim.rlim_max)
114210 + return -EINVAL;
114211
114212 retval = security_task_setrlimit(resource, &new_rlim);
114213 if (retval)
114214 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/sysctl.c linux-2.6.29-rc3.owrt/kernel/sysctl.c
114215 --- linux-2.6.29.owrt/kernel/sysctl.c 2009-05-10 22:04:41.000000000 +0200
114216 +++ linux-2.6.29-rc3.owrt/kernel/sysctl.c 2009-05-10 23:48:29.000000000 +0200
114217 @@ -101,7 +101,6 @@
114218
114219 static int zero;
114220 static int one = 1;
114221 -static unsigned long one_ul = 1;
114222 static int one_hundred = 100;
114223
114224 /* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */
114225 @@ -975,7 +974,7 @@
114226 .mode = 0644,
114227 .proc_handler = &dirty_background_bytes_handler,
114228 .strategy = &sysctl_intvec,
114229 - .extra1 = &one_ul,
114230 + .extra1 = &one,
114231 },
114232 {
114233 .ctl_name = VM_DIRTY_RATIO,
114234 @@ -996,7 +995,7 @@
114235 .mode = 0644,
114236 .proc_handler = &dirty_bytes_handler,
114237 .strategy = &sysctl_intvec,
114238 - .extra1 = &one_ul,
114239 + .extra1 = &one,
114240 },
114241 {
114242 .procname = "dirty_writeback_centisecs",
114243 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/time/tick-common.c linux-2.6.29-rc3.owrt/kernel/time/tick-common.c
114244 --- linux-2.6.29.owrt/kernel/time/tick-common.c 2009-05-10 22:04:41.000000000 +0200
114245 +++ linux-2.6.29-rc3.owrt/kernel/time/tick-common.c 2009-05-10 23:48:29.000000000 +0200
114246 @@ -274,21 +274,6 @@
114247 }
114248
114249 /*
114250 - * Transfer the do_timer job away from a dying cpu.
114251 - *
114252 - * Called with interrupts disabled.
114253 - */
114254 -static void tick_handover_do_timer(int *cpup)
114255 -{
114256 - if (*cpup == tick_do_timer_cpu) {
114257 - int cpu = cpumask_first(cpu_online_mask);
114258 -
114259 - tick_do_timer_cpu = (cpu < nr_cpu_ids) ? cpu :
114260 - TICK_DO_TIMER_NONE;
114261 - }
114262 -}
114263 -
114264 -/*
114265 * Shutdown an event device on a given cpu:
114266 *
114267 * This is called on a life CPU, when a CPU is dead. So we cannot
114268 @@ -312,6 +297,13 @@
114269 clockevents_exchange_device(dev, NULL);
114270 td->evtdev = NULL;
114271 }
114272 + /* Transfer the do_timer job away from this cpu */
114273 + if (*cpup == tick_do_timer_cpu) {
114274 + int cpu = cpumask_first(cpu_online_mask);
114275 +
114276 + tick_do_timer_cpu = (cpu < nr_cpu_ids) ? cpu :
114277 + TICK_DO_TIMER_NONE;
114278 + }
114279 spin_unlock_irqrestore(&tick_device_lock, flags);
114280 }
114281
114282 @@ -365,10 +357,6 @@
114283 tick_broadcast_oneshot_control(reason);
114284 break;
114285
114286 - case CLOCK_EVT_NOTIFY_CPU_DYING:
114287 - tick_handover_do_timer(dev);
114288 - break;
114289 -
114290 case CLOCK_EVT_NOTIFY_CPU_DEAD:
114291 tick_shutdown_broadcast_oneshot(dev);
114292 tick_shutdown_broadcast(dev);
114293 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/trace/ftrace.c linux-2.6.29-rc3.owrt/kernel/trace/ftrace.c
114294 --- linux-2.6.29.owrt/kernel/trace/ftrace.c 2009-05-10 22:04:41.000000000 +0200
114295 +++ linux-2.6.29-rc3.owrt/kernel/trace/ftrace.c 2009-05-10 23:48:29.000000000 +0200
114296 @@ -17,7 +17,6 @@
114297 #include <linux/clocksource.h>
114298 #include <linux/kallsyms.h>
114299 #include <linux/seq_file.h>
114300 -#include <linux/suspend.h>
114301 #include <linux/debugfs.h>
114302 #include <linux/hardirq.h>
114303 #include <linux/kthread.h>
114304 @@ -1737,12 +1736,9 @@
114305 {
114306 struct task_struct *p;
114307
114308 - rcu_read_lock();
114309 do_each_pid_task(pid, PIDTYPE_PID, p) {
114310 clear_tsk_trace_trace(p);
114311 } while_each_pid_task(pid, PIDTYPE_PID, p);
114312 - rcu_read_unlock();
114313 -
114314 put_pid(pid);
114315 }
114316
114317 @@ -1750,11 +1746,9 @@
114318 {
114319 struct task_struct *p;
114320
114321 - rcu_read_lock();
114322 do_each_pid_task(pid, PIDTYPE_PID, p) {
114323 set_tsk_trace_trace(p);
114324 } while_each_pid_task(pid, PIDTYPE_PID, p);
114325 - rcu_read_unlock();
114326 }
114327
114328 static void clear_ftrace_pid_task(struct pid **pid)
114329 @@ -1971,7 +1965,6 @@
114330 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
114331
114332 static atomic_t ftrace_graph_active;
114333 -static struct notifier_block ftrace_suspend_notifier;
114334
114335 int ftrace_graph_entry_stub(struct ftrace_graph_ent *trace)
114336 {
114337 @@ -2033,7 +2026,7 @@
114338 static int start_graph_tracing(void)
114339 {
114340 struct ftrace_ret_stack **ret_stack_list;
114341 - int ret, cpu;
114342 + int ret;
114343
114344 ret_stack_list = kmalloc(FTRACE_RETSTACK_ALLOC_SIZE *
114345 sizeof(struct ftrace_ret_stack *),
114346 @@ -2042,10 +2035,6 @@
114347 if (!ret_stack_list)
114348 return -ENOMEM;
114349
114350 - /* The cpu_boot init_task->ret_stack will never be freed */
114351 - for_each_online_cpu(cpu)
114352 - ftrace_graph_init_task(idle_task(cpu));
114353 -
114354 do {
114355 ret = alloc_retstack_tasklist(ret_stack_list);
114356 } while (ret == -EAGAIN);
114357 @@ -2054,27 +2043,6 @@
114358 return ret;
114359 }
114360
114361 -/*
114362 - * Hibernation protection.
114363 - * The state of the current task is too much unstable during
114364 - * suspend/restore to disk. We want to protect against that.
114365 - */
114366 -static int
114367 -ftrace_suspend_notifier_call(struct notifier_block *bl, unsigned long state,
114368 - void *unused)
114369 -{
114370 - switch (state) {
114371 - case PM_HIBERNATION_PREPARE:
114372 - pause_graph_tracing();
114373 - break;
114374 -
114375 - case PM_POST_HIBERNATION:
114376 - unpause_graph_tracing();
114377 - break;
114378 - }
114379 - return NOTIFY_DONE;
114380 -}
114381 -
114382 int register_ftrace_graph(trace_func_graph_ret_t retfunc,
114383 trace_func_graph_ent_t entryfunc)
114384 {
114385 @@ -2082,9 +2050,6 @@
114386
114387 mutex_lock(&ftrace_sysctl_lock);
114388
114389 - ftrace_suspend_notifier.notifier_call = ftrace_suspend_notifier_call;
114390 - register_pm_notifier(&ftrace_suspend_notifier);
114391 -
114392 atomic_inc(&ftrace_graph_active);
114393 ret = start_graph_tracing();
114394 if (ret) {
114395 @@ -2110,7 +2075,6 @@
114396 ftrace_graph_return = (trace_func_graph_ret_t)ftrace_stub;
114397 ftrace_graph_entry = ftrace_graph_entry_stub;
114398 ftrace_shutdown(FTRACE_STOP_FUNC_RET);
114399 - unregister_pm_notifier(&ftrace_suspend_notifier);
114400
114401 mutex_unlock(&ftrace_sysctl_lock);
114402 }
114403 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/trace/Kconfig linux-2.6.29-rc3.owrt/kernel/trace/Kconfig
114404 --- linux-2.6.29.owrt/kernel/trace/Kconfig 2009-05-10 22:04:41.000000000 +0200
114405 +++ linux-2.6.29-rc3.owrt/kernel/trace/Kconfig 2009-05-10 23:48:29.000000000 +0200
114406 @@ -52,7 +52,6 @@
114407 depends on HAVE_FUNCTION_TRACER
114408 depends on DEBUG_KERNEL
114409 select FRAME_POINTER
114410 - select KALLSYMS
114411 select TRACING
114412 select CONTEXT_SWITCH_TRACER
114413 help
114414 @@ -239,7 +238,6 @@
114415 depends on DEBUG_KERNEL
114416 select FUNCTION_TRACER
114417 select STACKTRACE
114418 - select KALLSYMS
114419 help
114420 This special tracer records the maximum stack footprint of the
114421 kernel and displays it in debugfs/tracing/stack_trace.
114422 @@ -304,27 +302,4 @@
114423 functioning properly. It will do tests on all the configured
114424 tracers of ftrace.
114425
114426 -config MMIOTRACE
114427 - bool "Memory mapped IO tracing"
114428 - depends on HAVE_MMIOTRACE_SUPPORT && DEBUG_KERNEL && PCI
114429 - select TRACING
114430 - help
114431 - Mmiotrace traces Memory Mapped I/O access and is meant for
114432 - debugging and reverse engineering. It is called from the ioremap
114433 - implementation and works via page faults. Tracing is disabled by
114434 - default and can be enabled at run-time.
114435 -
114436 - See Documentation/tracers/mmiotrace.txt.
114437 - If you are not helping to develop drivers, say N.
114438 -
114439 -config MMIOTRACE_TEST
114440 - tristate "Test module for mmiotrace"
114441 - depends on MMIOTRACE && m
114442 - help
114443 - This is a dumb module for testing mmiotrace. It is very dangerous
114444 - as it will write garbage to IO memory starting at a given address.
114445 - However, it should be safe to use on e.g. unused portion of VRAM.
114446 -
114447 - Say N, unless you absolutely know what you are doing.
114448 -
114449 endmenu
114450 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/trace/ring_buffer.c linux-2.6.29-rc3.owrt/kernel/trace/ring_buffer.c
114451 --- linux-2.6.29.owrt/kernel/trace/ring_buffer.c 2009-05-10 22:04:41.000000000 +0200
114452 +++ linux-2.6.29-rc3.owrt/kernel/trace/ring_buffer.c 2009-05-10 23:48:29.000000000 +0200
114453 @@ -246,7 +246,7 @@
114454 return 0;
114455 }
114456
114457 -#define BUF_PAGE_SIZE (PAGE_SIZE - offsetof(struct buffer_data_page, data))
114458 +#define BUF_PAGE_SIZE (PAGE_SIZE - sizeof(struct buffer_data_page))
114459
114460 /*
114461 * head_page == tail_page && head == tail then buffer is empty.
114462 @@ -1025,8 +1025,12 @@
114463 }
114464
114465 if (next_page == head_page) {
114466 - if (!(buffer->flags & RB_FL_OVERWRITE))
114467 + if (!(buffer->flags & RB_FL_OVERWRITE)) {
114468 + /* reset write */
114469 + if (tail <= BUF_PAGE_SIZE)
114470 + local_set(&tail_page->write, tail);
114471 goto out_unlock;
114472 + }
114473
114474 /* tail_page has not moved yet? */
114475 if (tail_page == cpu_buffer->tail_page) {
114476 @@ -1101,10 +1105,6 @@
114477 return event;
114478
114479 out_unlock:
114480 - /* reset write */
114481 - if (tail <= BUF_PAGE_SIZE)
114482 - local_set(&tail_page->write, tail);
114483 -
114484 __raw_spin_unlock(&cpu_buffer->lock);
114485 local_irq_restore(flags);
114486 return NULL;
114487 @@ -2174,9 +2174,6 @@
114488
114489 cpu_buffer->overrun = 0;
114490 cpu_buffer->entries = 0;
114491 -
114492 - cpu_buffer->write_stamp = 0;
114493 - cpu_buffer->read_stamp = 0;
114494 }
114495
114496 /**
114497 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/trace/trace.c linux-2.6.29-rc3.owrt/kernel/trace/trace.c
114498 --- linux-2.6.29.owrt/kernel/trace/trace.c 2009-05-10 22:04:41.000000000 +0200
114499 +++ linux-2.6.29-rc3.owrt/kernel/trace/trace.c 2009-05-10 23:48:29.000000000 +0200
114500 @@ -40,7 +40,7 @@
114501
114502 #define TRACE_BUFFER_FLAGS (RB_FL_OVERWRITE)
114503
114504 -unsigned long __read_mostly tracing_max_latency;
114505 +unsigned long __read_mostly tracing_max_latency = (cycle_t)ULONG_MAX;
114506 unsigned long __read_mostly tracing_thresh;
114507
114508 /*
114509 @@ -3736,7 +3736,7 @@
114510 * it if we decide to change what log level the ftrace dump
114511 * should be at.
114512 */
114513 -#define KERN_TRACE KERN_EMERG
114514 +#define KERN_TRACE KERN_INFO
114515
114516 static void
114517 trace_printk_seq(struct trace_seq *s)
114518 @@ -3770,7 +3770,6 @@
114519 dump_ran = 1;
114520
114521 /* No turning back! */
114522 - tracing_off();
114523 ftrace_kill();
114524
114525 for_each_tracing_cpu(cpu) {
114526 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/trace/trace_irqsoff.c linux-2.6.29-rc3.owrt/kernel/trace/trace_irqsoff.c
114527 --- linux-2.6.29.owrt/kernel/trace/trace_irqsoff.c 2009-05-10 22:04:41.000000000 +0200
114528 +++ linux-2.6.29-rc3.owrt/kernel/trace/trace_irqsoff.c 2009-05-10 23:48:29.000000000 +0200
114529 @@ -380,7 +380,6 @@
114530
114531 static void __irqsoff_tracer_init(struct trace_array *tr)
114532 {
114533 - tracing_max_latency = 0;
114534 irqsoff_trace = tr;
114535 /* make sure that the tracer is visible */
114536 smp_wmb();
114537 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/trace/trace_mmiotrace.c linux-2.6.29-rc3.owrt/kernel/trace/trace_mmiotrace.c
114538 --- linux-2.6.29.owrt/kernel/trace/trace_mmiotrace.c 2009-05-10 22:04:41.000000000 +0200
114539 +++ linux-2.6.29-rc3.owrt/kernel/trace/trace_mmiotrace.c 2009-05-10 23:48:29.000000000 +0200
114540 @@ -9,7 +9,6 @@
114541 #include <linux/kernel.h>
114542 #include <linux/mmiotrace.h>
114543 #include <linux/pci.h>
114544 -#include <asm/atomic.h>
114545
114546 #include "trace.h"
114547
114548 @@ -20,7 +19,6 @@
114549 static struct trace_array *mmio_trace_array;
114550 static bool overrun_detected;
114551 static unsigned long prev_overruns;
114552 -static atomic_t dropped_count;
114553
114554 static void mmio_reset_data(struct trace_array *tr)
114555 {
114556 @@ -123,11 +121,11 @@
114557
114558 static unsigned long count_overruns(struct trace_iterator *iter)
114559 {
114560 - unsigned long cnt = atomic_xchg(&dropped_count, 0);
114561 + unsigned long cnt = 0;
114562 unsigned long over = ring_buffer_overruns(iter->tr->buffer);
114563
114564 if (over > prev_overruns)
114565 - cnt += over - prev_overruns;
114566 + cnt = over - prev_overruns;
114567 prev_overruns = over;
114568 return cnt;
114569 }
114570 @@ -312,10 +310,8 @@
114571
114572 event = ring_buffer_lock_reserve(tr->buffer, sizeof(*entry),
114573 &irq_flags);
114574 - if (!event) {
114575 - atomic_inc(&dropped_count);
114576 + if (!event)
114577 return;
114578 - }
114579 entry = ring_buffer_event_data(event);
114580 tracing_generic_entry_update(&entry->ent, 0, preempt_count());
114581 entry->ent.type = TRACE_MMIO_RW;
114582 @@ -342,10 +338,8 @@
114583
114584 event = ring_buffer_lock_reserve(tr->buffer, sizeof(*entry),
114585 &irq_flags);
114586 - if (!event) {
114587 - atomic_inc(&dropped_count);
114588 + if (!event)
114589 return;
114590 - }
114591 entry = ring_buffer_event_data(event);
114592 tracing_generic_entry_update(&entry->ent, 0, preempt_count());
114593 entry->ent.type = TRACE_MMIO_MAP;
114594 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/trace/trace_sched_wakeup.c linux-2.6.29-rc3.owrt/kernel/trace/trace_sched_wakeup.c
114595 --- linux-2.6.29.owrt/kernel/trace/trace_sched_wakeup.c 2009-05-10 22:04:41.000000000 +0200
114596 +++ linux-2.6.29-rc3.owrt/kernel/trace/trace_sched_wakeup.c 2009-05-10 23:48:29.000000000 +0200
114597 @@ -333,7 +333,6 @@
114598
114599 static int wakeup_tracer_init(struct trace_array *tr)
114600 {
114601 - tracing_max_latency = 0;
114602 wakeup_trace = tr;
114603 start_wakeup_tracer(tr);
114604 return 0;
114605 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/trace/trace_selftest.c linux-2.6.29-rc3.owrt/kernel/trace/trace_selftest.c
114606 --- linux-2.6.29.owrt/kernel/trace/trace_selftest.c 2009-05-10 22:04:41.000000000 +0200
114607 +++ linux-2.6.29-rc3.owrt/kernel/trace/trace_selftest.c 2009-05-10 23:48:29.000000000 +0200
114608 @@ -23,20 +23,10 @@
114609 {
114610 struct ring_buffer_event *event;
114611 struct trace_entry *entry;
114612 - unsigned int loops = 0;
114613
114614 while ((event = ring_buffer_consume(tr->buffer, cpu, NULL))) {
114615 entry = ring_buffer_event_data(event);
114616
114617 - /*
114618 - * The ring buffer is a size of trace_buf_size, if
114619 - * we loop more than the size, there's something wrong
114620 - * with the ring buffer.
114621 - */
114622 - if (loops++ > trace_buf_size) {
114623 - printk(KERN_CONT ".. bad ring buffer ");
114624 - goto failed;
114625 - }
114626 if (!trace_valid_entry(entry)) {
114627 printk(KERN_CONT ".. invalid entry %d ",
114628 entry->type);
114629 @@ -67,20 +57,11 @@
114630
114631 cnt = ring_buffer_entries(tr->buffer);
114632
114633 - /*
114634 - * The trace_test_buffer_cpu runs a while loop to consume all data.
114635 - * If the calling tracer is broken, and is constantly filling
114636 - * the buffer, this will run forever, and hard lock the box.
114637 - * We disable the ring buffer while we do this test to prevent
114638 - * a hard lock up.
114639 - */
114640 - tracing_off();
114641 for_each_possible_cpu(cpu) {
114642 ret = trace_test_buffer_cpu(tr, cpu);
114643 if (ret)
114644 break;
114645 }
114646 - tracing_on();
114647 __raw_spin_unlock(&ftrace_max_lock);
114648 local_irq_restore(flags);
114649
114650 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/tsacct.c linux-2.6.29-rc3.owrt/kernel/tsacct.c
114651 --- linux-2.6.29.owrt/kernel/tsacct.c 2009-05-10 22:04:41.000000000 +0200
114652 +++ linux-2.6.29-rc3.owrt/kernel/tsacct.c 2009-05-10 23:48:29.000000000 +0200
114653 @@ -122,10 +122,8 @@
114654 if (likely(tsk->mm)) {
114655 cputime_t time, dtime;
114656 struct timeval value;
114657 - unsigned long flags;
114658 u64 delta;
114659
114660 - local_irq_save(flags);
114661 time = tsk->stime + tsk->utime;
114662 dtime = cputime_sub(time, tsk->acct_timexpd);
114663 jiffies_to_timeval(cputime_to_jiffies(dtime), &value);
114664 @@ -133,12 +131,10 @@
114665 delta = delta * USEC_PER_SEC + value.tv_usec;
114666
114667 if (delta == 0)
114668 - goto out;
114669 + return;
114670 tsk->acct_timexpd = time;
114671 tsk->acct_rss_mem1 += delta * get_mm_rss(tsk->mm);
114672 tsk->acct_vm_mem1 += delta * tsk->mm->total_vm;
114673 - out:
114674 - local_irq_restore(flags);
114675 }
114676 }
114677
114678 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/user.c linux-2.6.29-rc3.owrt/kernel/user.c
114679 --- linux-2.6.29.owrt/kernel/user.c 2009-05-10 22:04:41.000000000 +0200
114680 +++ linux-2.6.29-rc3.owrt/kernel/user.c 2009-05-10 23:48:29.000000000 +0200
114681 @@ -72,7 +72,6 @@
114682 static void uid_hash_remove(struct user_struct *up)
114683 {
114684 hlist_del_init(&up->uidhash_node);
114685 - put_user_ns(up->user_ns);
114686 }
114687
114688 static struct user_struct *uid_hash_find(uid_t uid, struct hlist_head *hashent)
114689 @@ -286,12 +285,14 @@
114690 /* work function to remove sysfs directory for a user and free up
114691 * corresponding structures.
114692 */
114693 -static void cleanup_user_struct(struct work_struct *w)
114694 +static void remove_user_sysfs_dir(struct work_struct *w)
114695 {
114696 struct user_struct *up = container_of(w, struct user_struct, work);
114697 unsigned long flags;
114698 int remove_user = 0;
114699
114700 + if (up->user_ns != &init_user_ns)
114701 + return;
114702 /* Make uid_hash_remove() + sysfs_remove_file() + kobject_del()
114703 * atomic.
114704 */
114705 @@ -310,11 +311,9 @@
114706 if (!remove_user)
114707 goto done;
114708
114709 - if (up->user_ns == &init_user_ns) {
114710 - kobject_uevent(&up->kobj, KOBJ_REMOVE);
114711 - kobject_del(&up->kobj);
114712 - kobject_put(&up->kobj);
114713 - }
114714 + kobject_uevent(&up->kobj, KOBJ_REMOVE);
114715 + kobject_del(&up->kobj);
114716 + kobject_put(&up->kobj);
114717
114718 sched_destroy_user(up);
114719 key_put(up->uid_keyring);
114720 @@ -335,7 +334,8 @@
114721 atomic_inc(&up->__count);
114722 spin_unlock_irqrestore(&uidhash_lock, flags);
114723
114724 - INIT_WORK(&up->work, cleanup_user_struct);
114725 + put_user_ns(up->user_ns);
114726 + INIT_WORK(&up->work, remove_user_sysfs_dir);
114727 schedule_work(&up->work);
114728 }
114729
114730 @@ -357,29 +357,12 @@
114731 sched_destroy_user(up);
114732 key_put(up->uid_keyring);
114733 key_put(up->session_keyring);
114734 + put_user_ns(up->user_ns);
114735 kmem_cache_free(uid_cachep, up);
114736 }
114737
114738 #endif
114739
114740 -#if defined(CONFIG_RT_GROUP_SCHED) && defined(CONFIG_USER_SCHED)
114741 -/*
114742 - * We need to check if a setuid can take place. This function should be called
114743 - * before successfully completing the setuid.
114744 - */
114745 -int task_can_switch_user(struct user_struct *up, struct task_struct *tsk)
114746 -{
114747 -
114748 - return sched_rt_can_attach(up->tg, tsk);
114749 -
114750 -}
114751 -#else
114752 -int task_can_switch_user(struct user_struct *up, struct task_struct *tsk)
114753 -{
114754 - return 1;
114755 -}
114756 -#endif
114757 -
114758 /*
114759 * Locate the user_struct for the passed UID. If found, take a ref on it. The
114760 * caller must undo that ref with free_uid().
114761 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/user_namespace.c linux-2.6.29-rc3.owrt/kernel/user_namespace.c
114762 --- linux-2.6.29.owrt/kernel/user_namespace.c 2009-05-10 22:04:41.000000000 +0200
114763 +++ linux-2.6.29-rc3.owrt/kernel/user_namespace.c 2009-05-10 23:48:29.000000000 +0200
114764 @@ -60,25 +60,12 @@
114765 return 0;
114766 }
114767
114768 -/*
114769 - * Deferred destructor for a user namespace. This is required because
114770 - * free_user_ns() may be called with uidhash_lock held, but we need to call
114771 - * back to free_uid() which will want to take the lock again.
114772 - */
114773 -static void free_user_ns_work(struct work_struct *work)
114774 -{
114775 - struct user_namespace *ns =
114776 - container_of(work, struct user_namespace, destroyer);
114777 - free_uid(ns->creator);
114778 - kfree(ns);
114779 -}
114780 -
114781 void free_user_ns(struct kref *kref)
114782 {
114783 - struct user_namespace *ns =
114784 - container_of(kref, struct user_namespace, kref);
114785 + struct user_namespace *ns;
114786
114787 - INIT_WORK(&ns->destroyer, free_user_ns_work);
114788 - schedule_work(&ns->destroyer);
114789 + ns = container_of(kref, struct user_namespace, kref);
114790 + free_uid(ns->creator);
114791 + kfree(ns);
114792 }
114793 EXPORT_SYMBOL(free_user_ns);
114794 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/kernel/wait.c linux-2.6.29-rc3.owrt/kernel/wait.c
114795 --- linux-2.6.29.owrt/kernel/wait.c 2009-05-10 22:04:41.000000000 +0200
114796 +++ linux-2.6.29-rc3.owrt/kernel/wait.c 2009-05-10 23:48:29.000000000 +0200
114797 @@ -91,15 +91,6 @@
114798 }
114799 EXPORT_SYMBOL(prepare_to_wait_exclusive);
114800
114801 -/*
114802 - * finish_wait - clean up after waiting in a queue
114803 - * @q: waitqueue waited on
114804 - * @wait: wait descriptor
114805 - *
114806 - * Sets current thread back to running state and removes
114807 - * the wait descriptor from the given waitqueue if still
114808 - * queued.
114809 - */
114810 void finish_wait(wait_queue_head_t *q, wait_queue_t *wait)
114811 {
114812 unsigned long flags;
114813 @@ -126,39 +117,6 @@
114814 }
114815 EXPORT_SYMBOL(finish_wait);
114816
114817 -/*
114818 - * abort_exclusive_wait - abort exclusive waiting in a queue
114819 - * @q: waitqueue waited on
114820 - * @wait: wait descriptor
114821 - * @state: runstate of the waiter to be woken
114822 - * @key: key to identify a wait bit queue or %NULL
114823 - *
114824 - * Sets current thread back to running state and removes
114825 - * the wait descriptor from the given waitqueue if still
114826 - * queued.
114827 - *
114828 - * Wakes up the next waiter if the caller is concurrently
114829 - * woken up through the queue.
114830 - *
114831 - * This prevents waiter starvation where an exclusive waiter
114832 - * aborts and is woken up concurrently and noone wakes up
114833 - * the next waiter.
114834 - */
114835 -void abort_exclusive_wait(wait_queue_head_t *q, wait_queue_t *wait,
114836 - unsigned int mode, void *key)
114837 -{
114838 - unsigned long flags;
114839 -
114840 - __set_current_state(TASK_RUNNING);
114841 - spin_lock_irqsave(&q->lock, flags);
114842 - if (!list_empty(&wait->task_list))
114843 - list_del_init(&wait->task_list);
114844 - else if (waitqueue_active(q))
114845 - __wake_up_common(q, mode, 1, 0, key);
114846 - spin_unlock_irqrestore(&q->lock, flags);
114847 -}
114848 -EXPORT_SYMBOL(abort_exclusive_wait);
114849 -
114850 int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key)
114851 {
114852 int ret = default_wake_function(wait, mode, sync, key);
114853 @@ -219,20 +177,17 @@
114854 __wait_on_bit_lock(wait_queue_head_t *wq, struct wait_bit_queue *q,
114855 int (*action)(void *), unsigned mode)
114856 {
114857 - do {
114858 - int ret;
114859 + int ret = 0;
114860
114861 + do {
114862 prepare_to_wait_exclusive(wq, &q->wait, mode);
114863 - if (!test_bit(q->key.bit_nr, q->key.flags))
114864 - continue;
114865 - ret = action(q->key.flags);
114866 - if (!ret)
114867 - continue;
114868 - abort_exclusive_wait(wq, &q->wait, mode, &q->key);
114869 - return ret;
114870 + if (test_bit(q->key.bit_nr, q->key.flags)) {
114871 + if ((ret = (*action)(q->key.flags)))
114872 + break;
114873 + }
114874 } while (test_and_set_bit(q->key.bit_nr, q->key.flags));
114875 finish_wait(wq, &q->wait);
114876 - return 0;
114877 + return ret;
114878 }
114879 EXPORT_SYMBOL(__wait_on_bit_lock);
114880
114881 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/lib/bitmap.c linux-2.6.29-rc3.owrt/lib/bitmap.c
114882 --- linux-2.6.29.owrt/lib/bitmap.c 2009-05-10 22:04:41.000000000 +0200
114883 +++ linux-2.6.29-rc3.owrt/lib/bitmap.c 2009-05-10 23:48:29.000000000 +0200
114884 @@ -948,15 +948,15 @@
114885 */
114886 int bitmap_find_free_region(unsigned long *bitmap, int bits, int order)
114887 {
114888 - int pos, end; /* scans bitmap by regions of size order */
114889 + int pos; /* scans bitmap by regions of size order */
114890
114891 - for (pos = 0 ; (end = pos + (1 << order)) <= bits; pos = end) {
114892 - if (!__reg_op(bitmap, pos, order, REG_OP_ISFREE))
114893 - continue;
114894 - __reg_op(bitmap, pos, order, REG_OP_ALLOC);
114895 - return pos;
114896 - }
114897 - return -ENOMEM;
114898 + for (pos = 0; pos < bits; pos += (1 << order))
114899 + if (__reg_op(bitmap, pos, order, REG_OP_ISFREE))
114900 + break;
114901 + if (pos == bits)
114902 + return -ENOMEM;
114903 + __reg_op(bitmap, pos, order, REG_OP_ALLOC);
114904 + return pos;
114905 }
114906 EXPORT_SYMBOL(bitmap_find_free_region);
114907
114908 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/lib/idr.c linux-2.6.29-rc3.owrt/lib/idr.c
114909 --- linux-2.6.29.owrt/lib/idr.c 2009-05-10 22:04:41.000000000 +0200
114910 +++ linux-2.6.29-rc3.owrt/lib/idr.c 2009-05-10 23:48:29.000000000 +0200
114911 @@ -449,7 +449,6 @@
114912
114913 n = idp->layers * IDR_BITS;
114914 p = idp->top;
114915 - rcu_assign_pointer(idp->top, NULL);
114916 max = 1 << n;
114917
114918 id = 0;
114919 @@ -468,6 +467,7 @@
114920 p = *--paa;
114921 }
114922 }
114923 + rcu_assign_pointer(idp->top, NULL);
114924 idp->layers = 0;
114925 }
114926 EXPORT_SYMBOL(idr_remove_all);
114927 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/lib/Kconfig.debug linux-2.6.29-rc3.owrt/lib/Kconfig.debug
114928 --- linux-2.6.29.owrt/lib/Kconfig.debug 2009-05-10 22:04:41.000000000 +0200
114929 +++ linux-2.6.29-rc3.owrt/lib/Kconfig.debug 2009-05-10 23:48:29.000000000 +0200
114930 @@ -838,7 +838,7 @@
114931
114932 If unsure, say N.
114933
114934 -config BUILD_DOCSRC
114935 +menuconfig BUILD_DOCSRC
114936 bool "Build targets in Documentation/ tree"
114937 depends on HEADERS_CHECK
114938 help
114939 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/lib/smp_processor_id.c linux-2.6.29-rc3.owrt/lib/smp_processor_id.c
114940 --- linux-2.6.29.owrt/lib/smp_processor_id.c 2009-05-10 22:04:41.000000000 +0200
114941 +++ linux-2.6.29-rc3.owrt/lib/smp_processor_id.c 2009-05-10 23:48:29.000000000 +0200
114942 @@ -22,7 +22,7 @@
114943 * Kernel threads bound to a single CPU can safely use
114944 * smp_processor_id():
114945 */
114946 - if (cpumask_equal(&current->cpus_allowed, cpumask_of(this_cpu)))
114947 + if (cpus_equal(current->cpus_allowed, cpumask_of_cpu(this_cpu)))
114948 goto out;
114949
114950 /*
114951 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/.mailmap linux-2.6.29-rc3.owrt/.mailmap
114952 --- linux-2.6.29.owrt/.mailmap 2009-05-10 22:04:41.000000000 +0200
114953 +++ linux-2.6.29-rc3.owrt/.mailmap 2009-05-10 23:48:29.000000000 +0200
114954 @@ -92,7 +92,6 @@
114955 Rui Saraiva <rmps@joel.ist.utl.pt>
114956 Sachin P Sant <ssant@in.ibm.com>
114957 Sam Ravnborg <sam@mars.ravnborg.org>
114958 -Sascha Hauer <s.hauer@pengutronix.de>
114959 S.Çağlar Onur <caglar@pardus.org.tr>
114960 Simon Kelley <simon@thekelleys.org.uk>
114961 Stéphane Witzmann <stephane.witzmann@ubpmes.univ-bpclermont.fr>
114962 @@ -101,7 +100,6 @@
114963 Thomas Graf <tgraf@suug.ch>
114964 Tony Luck <tony.luck@intel.com>
114965 Tsuneo Yoshioka <Tsuneo.Yoshioka@f-secure.com>
114966 -Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
114967 -Uwe Kleine-König <ukl@pengutronix.de>
114968 Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
114969 +Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
114970 Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
114971 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/MAINTAINERS linux-2.6.29-rc3.owrt/MAINTAINERS
114972 --- linux-2.6.29.owrt/MAINTAINERS 2009-05-10 22:04:39.000000000 +0200
114973 +++ linux-2.6.29-rc3.owrt/MAINTAINERS 2009-05-10 23:48:33.000000000 +0200
114974 @@ -692,13 +692,6 @@
114975 L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
114976 S: Maintained
114977
114978 -ARM/NUVOTON W90X900 ARM ARCHITECTURE
114979 -P: Wan ZongShun
114980 -M: mcuos.com@gmail.com
114981 -L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
114982 -W: http://www.mcuos.com
114983 -S: Maintained
114984 -
114985 ARPD SUPPORT
114986 P: Jonathan Layes
114987 L: netdev@vger.kernel.org
114988 @@ -918,7 +911,7 @@
114989 BLACKFIN ARCHITECTURE
114990 P: Bryan Wu
114991 M: cooloney@kernel.org
114992 -L: uclinux-dist-devel@blackfin.uclinux.org
114993 +L: uclinux-dist-devel@blackfin.uclinux.org (subscribers-only)
114994 W: http://blackfin.uclinux.org
114995 S: Supported
114996
114997 @@ -1028,14 +1021,6 @@
114998 W: http://bu3sch.de/btgpio.php
114999 S: Maintained
115000
115001 -BTRFS FILE SYSTEM
115002 -P: Chris Mason
115003 -M: chris.mason@oracle.com
115004 -L: linux-btrfs@vger.kernel.org
115005 -W: http://btrfs.wiki.kernel.org/
115006 -T: git kernel.org:/pub/scm/linux/kernel/git/mason/btrfs-unstable.git
115007 -S: Maintained
115008 -
115009 BTTV VIDEO4LINUX DRIVER
115010 P: Mauro Carvalho Chehab
115011 M: mchehab@infradead.org
115012 @@ -1209,8 +1194,6 @@
115013 CONTROL GROUPS (CGROUPS)
115014 P: Paul Menage
115015 M: menage@google.com
115016 -P: Li Zefan
115017 -M: lizf@cn.fujitsu.com
115018 L: containers@lists.linux-foundation.org
115019 S: Maintained
115020
115021 @@ -1469,6 +1452,8 @@
115022 S: Supported
115023
115024 DOCUMENTATION (/Documentation directory)
115025 +P: Michael Kerrisk
115026 +M: mtk.manpages@gmail.com
115027 P: Randy Dunlap
115028 M: rdunlap@xenotime.net
115029 L: linux-doc@vger.kernel.org
115030 @@ -1910,10 +1895,10 @@
115031 S: Maintained
115032
115033 HARD DRIVE ACTIVE PROTECTION SYSTEM (HDAPS) DRIVER
115034 -P: Frank Seidel
115035 -M: frank@f-seidel.de
115036 -L: lm-sensors@lm-sensors.org
115037 -W: http://www.kernel.org/pub/linux/kernel/people/fseidel/hdaps/
115038 +P: Robert Love
115039 +M: rlove@rlove.org
115040 +M: linux-kernel@vger.kernel.org
115041 +W: http://www.kernel.org/pub/linux/kernel/people/rml/hdaps/
115042 S: Maintained
115043
115044 GSPCA FINEPIX SUBDRIVER
115045 @@ -2011,7 +1996,7 @@
115046
115047 HIBERNATION (aka Software Suspend, aka swsusp)
115048 P: Pavel Machek
115049 -M: pavel@ucw.cz
115050 +M: pavel@suse.cz
115051 P: Rafael J. Wysocki
115052 M: rjw@sisk.pl
115053 L: linux-pm@lists.linux-foundation.org
115054 @@ -2232,7 +2217,7 @@
115055 M: sean.hefty@intel.com
115056 P: Hal Rosenstock
115057 M: hal.rosenstock@gmail.com
115058 -L: general@lists.openfabrics.org (moderated for non-subscribers)
115059 +L: general@lists.openfabrics.org
115060 W: http://www.openib.org/
115061 T: git kernel.org:/pub/scm/linux/kernel/git/roland/infiniband.git
115062 S: Supported
115063 @@ -2467,7 +2452,7 @@
115064
115065 ISDN SUBSYSTEM
115066 P: Karsten Keil
115067 -M: isdn@linux-pingi.de
115068 +M: kkeil@suse.de
115069 L: isdn4linux@listserv.isdn4linux.de (subscribers-only)
115070 W: http://www.isdn4linux.de
115071 T: git kernel.org:/pub/scm/linux/kernel/kkeil/isdn-2.6.git
115072 @@ -2856,6 +2841,8 @@
115073 MAC80211
115074 P: Johannes Berg
115075 M: johannes@sipsolutions.net
115076 +P: Michael Wu
115077 +M: flamingice@sourmilk.net
115078 L: linux-wireless@vger.kernel.org
115079 W: http://linuxwireless.org/
115080 T: git kernel.org:/pub/scm/linux/kernel/git/linville/wireless-2.6.git
115081 @@ -2882,7 +2869,7 @@
115082 M: mtk.manpages@gmail.com
115083 W: http://www.kernel.org/doc/man-pages
115084 L: linux-man@vger.kernel.org
115085 -S: Maintained
115086 +S: Supported
115087
115088 MARVELL LIBERTAS WIRELESS DRIVER
115089 P: Dan Williams
115090 @@ -3337,8 +3324,8 @@
115091 M: jeremy@xensource.com
115092 P: Chris Wright
115093 M: chrisw@sous-sol.org
115094 -P: Alok Kataria
115095 -M: akataria@vmware.com
115096 +P: Zachary Amsden
115097 +M: zach@vmware.com
115098 P: Rusty Russell
115099 M: rusty@rustcorp.com.au
115100 L: virtualization@lists.osdl.org
115101 @@ -3355,8 +3342,10 @@
115102 PARISC ARCHITECTURE
115103 P: Kyle McMartin
115104 M: kyle@mcmartin.ca
115105 -P: Helge Deller
115106 -M: deller@gmx.de
115107 +P: Matthew Wilcox
115108 +M: matthew@wil.cx
115109 +P: Grant Grundler
115110 +M: grundler@parisc-linux.org
115111 L: linux-parisc@vger.kernel.org
115112 W: http://www.parisc-linux.org/
115113 T: git kernel.org:/pub/scm/linux/kernel/git/kyle/parisc-2.6.git
115114 @@ -3547,12 +3536,6 @@
115115 PXA MMCI DRIVER
115116 S: Orphan
115117
115118 -PXA RTC DRIVER
115119 -P: Robert Jarzmik
115120 -M: robert.jarzmik@free.fr
115121 -L: rtc-linux@googlegroups.com
115122 -S: Maintained
115123 -
115124 QLOGIC QLA2XXX FC-SCSI DRIVER
115125 P: Andrew Vasquez
115126 M: linux-driver@qlogic.com
115127 @@ -3881,15 +3864,6 @@
115128 T: git kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git
115129 S: Supported
115130
115131 -SERVER ENGINES 10Gbps NIC - BladeEngine 2 DRIVER
115132 -P: Sathya Perla
115133 -M: sathyap@serverengines.com
115134 -P: Subbu Seetharaman
115135 -M: subbus@serverengines.com
115136 -L: netdev@vger.kernel.org
115137 -W: http://www.serverengines.com
115138 -S: Supported
115139 -
115140 SFC NETWORK DRIVER
115141 P: Steve Hodgson
115142 P: Ben Hutchings
115143 @@ -4189,7 +4163,7 @@
115144 P: Len Brown
115145 M: len.brown@intel.com
115146 P: Pavel Machek
115147 -M: pavel@ucw.cz
115148 +M: pavel@suse.cz
115149 P: Rafael J. Wysocki
115150 M: rjw@sisk.pl
115151 L: linux-pm@lists.linux-foundation.org
115152 @@ -4310,8 +4284,8 @@
115153 M: srajiv@linux.vnet.ibm.com
115154 W: http://tpmdd.sourceforge.net
115155 P: Marcel Selhorst
115156 -M: m.selhorst@sirrix.com
115157 -W: http://www.sirrix.com
115158 +M: tpm@selhorst.net
115159 +W: http://www.prosec.rub.de/tpm/
115160 L: tpmdd-devel@lists.sourceforge.net (moderated for non-subscribers)
115161 S: Maintained
115162
115163 @@ -4874,7 +4848,6 @@
115164 M: mingo@redhat.com
115165 P: H. Peter Anvin
115166 M: hpa@zytor.com
115167 -M: x86@kernel.org
115168 L: linux-kernel@vger.kernel.org
115169 T: git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git
115170 S: Maintained
115171 @@ -4941,11 +4914,11 @@
115172 S: Maintained
115173
115174 ZR36067 VIDEO FOR LINUX DRIVER
115175 +P: Ronald Bultje
115176 +M: rbultje@ronald.bitfreak.net
115177 L: mjpeg-users@lists.sourceforge.net
115178 -L: linux-media@vger.kernel.org
115179 W: http://mjpeg.sourceforge.net/driver-zoran/
115180 -T: Mercurial http://linuxtv.org/hg/v4l-dvb
115181 -S: Odd Fixes
115182 +S: Maintained
115183
115184 ZS DECSTATION Z85C30 SERIAL DRIVER
115185 P: Maciej W. Rozycki
115186 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/Makefile linux-2.6.29-rc3.owrt/Makefile
115187 --- linux-2.6.29.owrt/Makefile 2009-05-11 01:33:47.000000000 +0200
115188 +++ linux-2.6.29-rc3.owrt/Makefile 2009-05-11 01:34:47.000000000 +0200
115189 @@ -2,7 +2,7 @@
115190 PATCHLEVEL = 6
115191 SUBLEVEL = 29
115192 EXTRAVERSION =
115193 -NAME = Temporary Tasmanian Devil
115194 +NAME = Erotic Pickled Herring
115195
115196 # *DOCUMENTATION*
115197 # To see a list of typical targets execute "make help"
115198 @@ -389,7 +389,6 @@
115199 # output directory.
115200 outputmakefile:
115201 ifneq ($(KBUILD_SRC),)
115202 - $(Q)ln -fsn $(srctree) source
115203 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile \
115204 $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL)
115205 endif
115206 @@ -569,12 +568,6 @@
115207 # disable pointer signed / unsigned warnings in gcc 4.0
115208 KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,)
115209
115210 -# disable invalid "can't wrap" optimzations for signed / pointers
115211 -KBUILD_CFLAGS += $(call cc-option,-fwrapv)
115212 -
115213 -# revert to pre-gcc-4.4 behaviour of .eh_frame
115214 -KBUILD_CFLAGS += $(call cc-option,-fno-dwarf2-cfi-asm)
115215 -
115216 # Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments
115217 # But warn user when we do so
115218 warn-assign = \
115219 @@ -913,18 +906,12 @@
115220 # and if the SCM is know a tag from the SCM is appended.
115221 # The appended tag is determined by the SCM used.
115222 #
115223 -# .scmversion is used when generating rpm packages so we do not loose
115224 -# the version information from the SCM when we do the build of the kernel
115225 -# from the copied source
115226 +# Currently, only git is supported.
115227 +# Other SCMs can edit scripts/setlocalversion and add the appropriate
115228 +# checks as needed.
115229 ifdef CONFIG_LOCALVERSION_AUTO
115230 -
115231 -ifeq ($(wildcard .scmversion),)
115232 - _localver-auto = $(shell $(CONFIG_SHELL) \
115233 - $(srctree)/scripts/setlocalversion $(srctree))
115234 -else
115235 - _localver-auto = $(shell cat .scmversion 2> /dev/null)
115236 -endif
115237 -
115238 + _localver-auto = $(shell $(CONFIG_SHELL) \
115239 + $(srctree)/scripts/setlocalversion $(srctree))
115240 localver-auto = $(LOCALVERSION)$(_localver-auto)
115241 endif
115242
115243 @@ -962,6 +949,7 @@
115244 mkdir -p include2; \
115245 ln -fsn $(srctree)/include/asm-$(SRCARCH) include2/asm; \
115246 fi
115247 + ln -fsn $(srctree) source
115248 endif
115249
115250 # prepare2 creates a makefile if using a separate output directory
115251 @@ -1552,7 +1540,7 @@
115252 cmd_depmod = \
115253 if [ -r System.map -a -x $(DEPMOD) ]; then \
115254 $(DEPMOD) -ae -F System.map \
115255 - $(if $(strip $(INSTALL_MOD_PATH)), -b $(INSTALL_MOD_PATH) ) \
115256 + $(if $(strip $(INSTALL_MOD_PATH)), -b $(INSTALL_MOD_PATH) -r) \
115257 $(KERNELRELEASE); \
115258 fi
115259
115260 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/mm/fremap.c linux-2.6.29-rc3.owrt/mm/fremap.c
115261 --- linux-2.6.29.owrt/mm/fremap.c 2009-05-10 22:04:39.000000000 +0200
115262 +++ linux-2.6.29-rc3.owrt/mm/fremap.c 2009-05-10 23:48:33.000000000 +0200
115263 @@ -198,7 +198,7 @@
115264 flags &= MAP_NONBLOCK;
115265 get_file(file);
115266 addr = mmap_region(file, start, size,
115267 - flags, vma->vm_flags, pgoff);
115268 + flags, vma->vm_flags, pgoff, 1);
115269 fput(file);
115270 if (IS_ERR_VALUE(addr)) {
115271 err = addr;
115272 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/mm/hugetlb.c linux-2.6.29-rc3.owrt/mm/hugetlb.c
115273 --- linux-2.6.29.owrt/mm/hugetlb.c 2009-05-10 22:04:39.000000000 +0200
115274 +++ linux-2.6.29-rc3.owrt/mm/hugetlb.c 2009-05-10 23:48:33.000000000 +0200
115275 @@ -2269,18 +2269,12 @@
115276
115277 int hugetlb_reserve_pages(struct inode *inode,
115278 long from, long to,
115279 - struct vm_area_struct *vma,
115280 - int acctflag)
115281 + struct vm_area_struct *vma)
115282 {
115283 long ret, chg;
115284 struct hstate *h = hstate_inode(inode);
115285
115286 - /*
115287 - * Only apply hugepage reservation if asked. At fault time, an
115288 - * attempt will be made for VM_NORESERVE to allocate a page
115289 - * and filesystem quota without using reserves
115290 - */
115291 - if (acctflag & VM_NORESERVE)
115292 + if (vma && vma->vm_flags & VM_NORESERVE)
115293 return 0;
115294
115295 /*
115296 @@ -2305,31 +2299,13 @@
115297 if (chg < 0)
115298 return chg;
115299
115300 - /* There must be enough filesystem quota for the mapping */
115301 if (hugetlb_get_quota(inode->i_mapping, chg))
115302 return -ENOSPC;
115303 -
115304 - /*
115305 - * Check enough hugepages are available for the reservation.
115306 - * Hand back the quota if there are not
115307 - */
115308 ret = hugetlb_acct_memory(h, chg);
115309 if (ret < 0) {
115310 hugetlb_put_quota(inode->i_mapping, chg);
115311 return ret;
115312 }
115313 -
115314 - /*
115315 - * Account for the reservations made. Shared mappings record regions
115316 - * that have reservations as they are shared by multiple VMAs.
115317 - * When the last VMA disappears, the region map says how much
115318 - * the reservation was and the page cache tells how much of
115319 - * the reservation was consumed. Private mappings are per-VMA and
115320 - * only the consumed reservations are tracked. When the VMA
115321 - * disappears, the original reservation is the VMA size and the
115322 - * consumed reservations are stored in the map. Hence, nothing
115323 - * else has to be done for private mappings here
115324 - */
115325 if (!vma || vma->vm_flags & VM_SHARED)
115326 region_add(&inode->i_mapping->private_list, from, to);
115327 return 0;
115328 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/mm/memcontrol.c linux-2.6.29-rc3.owrt/mm/memcontrol.c
115329 --- linux-2.6.29.owrt/mm/memcontrol.c 2009-05-10 22:04:39.000000000 +0200
115330 +++ linux-2.6.29-rc3.owrt/mm/memcontrol.c 2009-05-10 23:48:33.000000000 +0200
115331 @@ -202,7 +202,6 @@
115332
115333 static void mem_cgroup_get(struct mem_cgroup *mem);
115334 static void mem_cgroup_put(struct mem_cgroup *mem);
115335 -static struct mem_cgroup *parent_mem_cgroup(struct mem_cgroup *mem);
115336
115337 static void mem_cgroup_charge_statistics(struct mem_cgroup *mem,
115338 struct page_cgroup *pc,
115339 @@ -1685,7 +1684,7 @@
115340 /* This is for making all *used* pages to be on LRU. */
115341 lru_add_drain_all();
115342 ret = 0;
115343 - for_each_node_state(node, N_HIGH_MEMORY) {
115344 + for_each_node_state(node, N_POSSIBLE) {
115345 for (zid = 0; !ret && zid < MAX_NR_ZONES; zid++) {
115346 enum lru_list l;
115347 for_each_lru(l) {
115348 @@ -2194,23 +2193,10 @@
115349
115350 static void mem_cgroup_put(struct mem_cgroup *mem)
115351 {
115352 - if (atomic_dec_and_test(&mem->refcnt)) {
115353 - struct mem_cgroup *parent = parent_mem_cgroup(mem);
115354 + if (atomic_dec_and_test(&mem->refcnt))
115355 __mem_cgroup_free(mem);
115356 - if (parent)
115357 - mem_cgroup_put(parent);
115358 - }
115359 }
115360
115361 -/*
115362 - * Returns the parent mem_cgroup in memcgroup hierarchy with hierarchy enabled.
115363 - */
115364 -static struct mem_cgroup *parent_mem_cgroup(struct mem_cgroup *mem)
115365 -{
115366 - if (!mem->res.parent)
115367 - return NULL;
115368 - return mem_cgroup_from_res_counter(mem->res.parent, res);
115369 -}
115370
115371 #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP
115372 static void __init enable_swap_cgroup(void)
115373 @@ -2249,13 +2235,6 @@
115374 if (parent && parent->use_hierarchy) {
115375 res_counter_init(&mem->res, &parent->res);
115376 res_counter_init(&mem->memsw, &parent->memsw);
115377 - /*
115378 - * We increment refcnt of the parent to ensure that we can
115379 - * safely access it on res_counter_charge/uncharge.
115380 - * This refcnt will be decremented when freeing this
115381 - * mem_cgroup(see mem_cgroup_put).
115382 - */
115383 - mem_cgroup_get(parent);
115384 } else {
115385 res_counter_init(&mem->res, NULL);
115386 res_counter_init(&mem->memsw, NULL);
115387 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/mm/memory.c linux-2.6.29-rc3.owrt/mm/memory.c
115388 --- linux-2.6.29.owrt/mm/memory.c 2009-05-10 22:04:39.000000000 +0200
115389 +++ linux-2.6.29-rc3.owrt/mm/memory.c 2009-05-10 23:48:33.000000000 +0200
115390 @@ -2000,7 +2000,7 @@
115391 * Don't let another task, with possibly unlocked vma,
115392 * keep the mlocked page.
115393 */
115394 - if ((vma->vm_flags & VM_LOCKED) && old_page) {
115395 + if (vma->vm_flags & VM_LOCKED) {
115396 lock_page(old_page); /* for LRU manipulation */
115397 clear_page_mlock(old_page);
115398 unlock_page(old_page);
115399 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/mm/migrate.c linux-2.6.29-rc3.owrt/mm/migrate.c
115400 --- linux-2.6.29.owrt/mm/migrate.c 2009-05-10 22:04:39.000000000 +0200
115401 +++ linux-2.6.29-rc3.owrt/mm/migrate.c 2009-05-10 23:48:33.000000000 +0200
115402 @@ -1129,7 +1129,7 @@
115403 struct vm_area_struct *vma;
115404 int err = 0;
115405
115406 - for (vma = mm->mmap; vma && !err; vma = vma->vm_next) {
115407 + for(vma = mm->mmap; vma->vm_next && !err; vma = vma->vm_next) {
115408 if (vma->vm_ops && vma->vm_ops->migrate) {
115409 err = vma->vm_ops->migrate(vma, to, from, flags);
115410 if (err)
115411 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/mm/mlock.c linux-2.6.29-rc3.owrt/mm/mlock.c
115412 --- linux-2.6.29.owrt/mm/mlock.c 2009-05-10 22:04:39.000000000 +0200
115413 +++ linux-2.6.29-rc3.owrt/mm/mlock.c 2009-05-10 23:48:33.000000000 +0200
115414 @@ -294,10 +294,14 @@
115415 *
115416 * return number of pages [> 0] to be removed from locked_vm on success
115417 * of "special" vmas.
115418 + *
115419 + * return negative error if vma spanning @start-@range disappears while
115420 + * mmap semaphore is dropped. Unlikely?
115421 */
115422 long mlock_vma_pages_range(struct vm_area_struct *vma,
115423 unsigned long start, unsigned long end)
115424 {
115425 + struct mm_struct *mm = vma->vm_mm;
115426 int nr_pages = (end - start) / PAGE_SIZE;
115427 BUG_ON(!(vma->vm_flags & VM_LOCKED));
115428
115429 @@ -310,11 +314,20 @@
115430 if (!((vma->vm_flags & (VM_DONTEXPAND | VM_RESERVED)) ||
115431 is_vm_hugetlb_page(vma) ||
115432 vma == get_gate_vma(current))) {
115433 + long error;
115434 + downgrade_write(&mm->mmap_sem);
115435
115436 - __mlock_vma_pages_range(vma, start, end, 1);
115437 + error = __mlock_vma_pages_range(vma, start, end, 1);
115438
115439 - /* Hide errors from mmap() and other callers */
115440 - return 0;
115441 + up_read(&mm->mmap_sem);
115442 + /* vma can change or disappear */
115443 + down_write(&mm->mmap_sem);
115444 + vma = find_vma(mm, start);
115445 + /* non-NULL vma must contain @start, but need to check @end */
115446 + if (!vma || end > vma->vm_end)
115447 + return -ENOMEM;
115448 +
115449 + return 0; /* hide other errors from mmap(), et al */
115450 }
115451
115452 /*
115453 @@ -425,14 +438,41 @@
115454 vma->vm_flags = newflags;
115455
115456 if (lock) {
115457 + /*
115458 + * mmap_sem is currently held for write. Downgrade the write
115459 + * lock to a read lock so that other faults, mmap scans, ...
115460 + * while we fault in all pages.
115461 + */
115462 + downgrade_write(&mm->mmap_sem);
115463 +
115464 ret = __mlock_vma_pages_range(vma, start, end, 1);
115465
115466 - if (ret > 0) {
115467 + /*
115468 + * Need to reacquire mmap sem in write mode, as our callers
115469 + * expect this. We have no support for atomically upgrading
115470 + * a sem to write, so we need to check for ranges while sem
115471 + * is unlocked.
115472 + */
115473 + up_read(&mm->mmap_sem);
115474 + /* vma can change or disappear */
115475 + down_write(&mm->mmap_sem);
115476 + *prev = find_vma(mm, start);
115477 + /* non-NULL *prev must contain @start, but need to check @end */
115478 + if (!(*prev) || end > (*prev)->vm_end)
115479 + ret = -ENOMEM;
115480 + else if (ret > 0) {
115481 mm->locked_vm -= ret;
115482 ret = 0;
115483 } else
115484 ret = __mlock_posix_error_return(ret); /* translate if needed */
115485 } else {
115486 + /*
115487 + * TODO: for unlocking, pages will already be resident, so
115488 + * we don't need to wait for allocations/reclaim/pagein, ...
115489 + * However, unlocking a very large region can still take a
115490 + * while. Should we downgrade the semaphore for both lock
115491 + * AND unlock ?
115492 + */
115493 __mlock_vma_pages_range(vma, start, end, 0);
115494 }
115495
115496 @@ -660,7 +700,7 @@
115497 return buffer;
115498 }
115499
115500 -void release_locked_buffer(void *buffer, size_t size)
115501 +void free_locked_buffer(void *buffer, size_t size)
115502 {
115503 unsigned long pgsz = PAGE_ALIGN(size) >> PAGE_SHIFT;
115504
115505 @@ -670,11 +710,6 @@
115506 current->mm->locked_vm -= pgsz;
115507
115508 up_write(&current->mm->mmap_sem);
115509 -}
115510 -
115511 -void free_locked_buffer(void *buffer, size_t size)
115512 -{
115513 - release_locked_buffer(buffer, size);
115514
115515 kfree(buffer);
115516 }
115517 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/mm/mmap.c linux-2.6.29-rc3.owrt/mm/mmap.c
115518 --- linux-2.6.29.owrt/mm/mmap.c 2009-05-10 22:04:39.000000000 +0200
115519 +++ linux-2.6.29-rc3.owrt/mm/mmap.c 2009-05-10 23:48:33.000000000 +0200
115520 @@ -658,9 +658,6 @@
115521 validate_mm(mm);
115522 }
115523
115524 -/* Flags that can be inherited from an existing mapping when merging */
115525 -#define VM_MERGEABLE_FLAGS (VM_CAN_NONLINEAR)
115526 -
115527 /*
115528 * If the vma has a ->close operation then the driver probably needs to release
115529 * per-vma resources, so we don't attempt to merge those.
115530 @@ -668,7 +665,7 @@
115531 static inline int is_mergeable_vma(struct vm_area_struct *vma,
115532 struct file *file, unsigned long vm_flags)
115533 {
115534 - if ((vma->vm_flags ^ vm_flags) & ~VM_MERGEABLE_FLAGS)
115535 + if (vma->vm_flags != vm_flags)
115536 return 0;
115537 if (vma->vm_file != file)
115538 return 0;
115539 @@ -918,6 +915,7 @@
115540 struct inode *inode;
115541 unsigned int vm_flags;
115542 int error;
115543 + int accountable = 1;
115544 unsigned long reqprot = prot;
115545
115546 /*
115547 @@ -1018,6 +1016,8 @@
115548 return -EPERM;
115549 vm_flags &= ~VM_MAYEXEC;
115550 }
115551 + if (is_file_hugepages(file))
115552 + accountable = 0;
115553
115554 if (!file->f_op || !file->f_op->mmap)
115555 return -ENODEV;
115556 @@ -1050,7 +1050,8 @@
115557 if (error)
115558 return error;
115559
115560 - return mmap_region(file, addr, len, flags, vm_flags, pgoff);
115561 + return mmap_region(file, addr, len, flags, vm_flags, pgoff,
115562 + accountable);
115563 }
115564 EXPORT_SYMBOL(do_mmap_pgoff);
115565
115566 @@ -1086,25 +1087,10 @@
115567 mapping_cap_account_dirty(vma->vm_file->f_mapping);
115568 }
115569
115570 -/*
115571 - * We account for memory if it's a private writeable mapping,
115572 - * not hugepages and VM_NORESERVE wasn't set.
115573 - */
115574 -static inline int accountable_mapping(struct file *file, unsigned int vm_flags)
115575 -{
115576 - /*
115577 - * hugetlb has its own accounting separate from the core VM
115578 - * VM_HUGETLB may not be set yet so we cannot check for that flag.
115579 - */
115580 - if (file && is_file_hugepages(file))
115581 - return 0;
115582 -
115583 - return (vm_flags & (VM_NORESERVE | VM_SHARED | VM_WRITE)) == VM_WRITE;
115584 -}
115585 -
115586 unsigned long mmap_region(struct file *file, unsigned long addr,
115587 unsigned long len, unsigned long flags,
115588 - unsigned int vm_flags, unsigned long pgoff)
115589 + unsigned int vm_flags, unsigned long pgoff,
115590 + int accountable)
115591 {
115592 struct mm_struct *mm = current->mm;
115593 struct vm_area_struct *vma, *prev;
115594 @@ -1128,38 +1114,38 @@
115595 if (!may_expand_vm(mm, len >> PAGE_SHIFT))
115596 return -ENOMEM;
115597
115598 - /*
115599 - * Set 'VM_NORESERVE' if we should not account for the
115600 - * memory use of this mapping.
115601 - */
115602 - if ((flags & MAP_NORESERVE)) {
115603 - /* We honor MAP_NORESERVE if allowed to overcommit */
115604 - if (sysctl_overcommit_memory != OVERCOMMIT_NEVER)
115605 - vm_flags |= VM_NORESERVE;
115606 + if (flags & MAP_NORESERVE)
115607 + vm_flags |= VM_NORESERVE;
115608
115609 - /* hugetlb applies strict overcommit unless MAP_NORESERVE */
115610 - if (file && is_file_hugepages(file))
115611 - vm_flags |= VM_NORESERVE;
115612 + if (accountable && (!(flags & MAP_NORESERVE) ||
115613 + sysctl_overcommit_memory == OVERCOMMIT_NEVER)) {
115614 + if (vm_flags & VM_SHARED) {
115615 + /* Check memory availability in shmem_file_setup? */
115616 + vm_flags |= VM_ACCOUNT;
115617 + } else if (vm_flags & VM_WRITE) {
115618 + /*
115619 + * Private writable mapping: check memory availability
115620 + */
115621 + charged = len >> PAGE_SHIFT;
115622 + if (security_vm_enough_memory(charged))
115623 + return -ENOMEM;
115624 + vm_flags |= VM_ACCOUNT;
115625 + }
115626 }
115627
115628 /*
115629 - * Private writable mapping: check memory availability
115630 + * Can we just expand an old private anonymous mapping?
115631 + * The VM_SHARED test is necessary because shmem_zero_setup
115632 + * will create the file object for a shared anonymous map below.
115633 */
115634 - if (accountable_mapping(file, vm_flags)) {
115635 - charged = len >> PAGE_SHIFT;
115636 - if (security_vm_enough_memory(charged))
115637 - return -ENOMEM;
115638 - vm_flags |= VM_ACCOUNT;
115639 + if (!file && !(vm_flags & VM_SHARED)) {
115640 + vma = vma_merge(mm, prev, addr, addr + len, vm_flags,
115641 + NULL, NULL, pgoff, NULL);
115642 + if (vma)
115643 + goto out;
115644 }
115645
115646 /*
115647 - * Can we just expand an old mapping?
115648 - */
115649 - vma = vma_merge(mm, prev, addr, addr + len, vm_flags, NULL, file, pgoff, NULL);
115650 - if (vma)
115651 - goto out;
115652 -
115653 - /*
115654 * Determine the object being mapped and call the appropriate
115655 * specific mapper. the address has already been validated, but
115656 * not unmapped, but the maps are removed from the list.
115657 @@ -1200,6 +1186,14 @@
115658 goto free_vma;
115659 }
115660
115661 + /* We set VM_ACCOUNT in a shared mapping's vm_flags, to inform
115662 + * shmem_zero_setup (perhaps called through /dev/zero's ->mmap)
115663 + * that memory reservation must be checked; but that reservation
115664 + * belongs to shared memory object, not to vma: so now clear it.
115665 + */
115666 + if ((vm_flags & (VM_SHARED|VM_ACCOUNT)) == (VM_SHARED|VM_ACCOUNT))
115667 + vma->vm_flags &= ~VM_ACCOUNT;
115668 +
115669 /* Can addr have changed??
115670 *
115671 * Answer: Yes, several device drivers can do it in their
115672 @@ -1212,8 +1206,17 @@
115673 if (vma_wants_writenotify(vma))
115674 vma->vm_page_prot = vm_get_page_prot(vm_flags & ~VM_SHARED);
115675
115676 - vma_link(mm, vma, prev, rb_link, rb_parent);
115677 - file = vma->vm_file;
115678 + if (file && vma_merge(mm, prev, addr, vma->vm_end,
115679 + vma->vm_flags, NULL, file, pgoff, vma_policy(vma))) {
115680 + mpol_put(vma_policy(vma));
115681 + kmem_cache_free(vm_area_cachep, vma);
115682 + fput(file);
115683 + if (vm_flags & VM_EXECUTABLE)
115684 + removed_exe_file_vma(mm);
115685 + } else {
115686 + vma_link(mm, vma, prev, rb_link, rb_parent);
115687 + file = vma->vm_file;
115688 + }
115689
115690 /* Once vma denies write, undo our temporary denial count */
115691 if (correct_wcount)
115692 @@ -2084,8 +2087,12 @@
115693 unsigned long end;
115694
115695 /* mm's last user has gone, and its about to be pulled down */
115696 + arch_exit_mmap(mm);
115697 mmu_notifier_release(mm);
115698
115699 + if (!mm->mmap) /* Can happen if dup_mmap() received an OOM */
115700 + return;
115701 +
115702 if (mm->locked_vm) {
115703 vma = mm->mmap;
115704 while (vma) {
115705 @@ -2094,13 +2101,7 @@
115706 vma = vma->vm_next;
115707 }
115708 }
115709 -
115710 - arch_exit_mmap(mm);
115711 -
115712 vma = mm->mmap;
115713 - if (!vma) /* Can happen if dup_mmap() received an OOM */
115714 - return;
115715 -
115716 lru_add_drain();
115717 flush_cache_mm(mm);
115718 tlb = tlb_gather_mmu(mm, 1);
115719 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/mm/mprotect.c linux-2.6.29-rc3.owrt/mm/mprotect.c
115720 --- linux-2.6.29.owrt/mm/mprotect.c 2009-05-10 22:04:39.000000000 +0200
115721 +++ linux-2.6.29-rc3.owrt/mm/mprotect.c 2009-05-10 23:48:33.000000000 +0200
115722 @@ -151,11 +151,10 @@
115723 /*
115724 * If we make a private mapping writable we increase our commit;
115725 * but (without finer accounting) cannot reduce our commit if we
115726 - * make it unwritable again. hugetlb mapping were accounted for
115727 - * even if read-only so there is no need to account for them here
115728 + * make it unwritable again.
115729 */
115730 if (newflags & VM_WRITE) {
115731 - if (!(oldflags & (VM_ACCOUNT|VM_WRITE|VM_HUGETLB|
115732 + if (!(oldflags & (VM_ACCOUNT|VM_WRITE|
115733 VM_SHARED|VM_NORESERVE))) {
115734 charged = nrpages;
115735 if (security_vm_enough_memory(charged))
115736 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/mm/page_alloc.c linux-2.6.29-rc3.owrt/mm/page_alloc.c
115737 --- linux-2.6.29.owrt/mm/page_alloc.c 2009-05-10 22:04:39.000000000 +0200
115738 +++ linux-2.6.29-rc3.owrt/mm/page_alloc.c 2009-05-10 23:48:33.000000000 +0200
115739 @@ -2989,7 +2989,7 @@
115740 * was used and there are no special requirements, this is a convenient
115741 * alternative
115742 */
115743 -int __meminit __early_pfn_to_nid(unsigned long pfn)
115744 +int __meminit early_pfn_to_nid(unsigned long pfn)
115745 {
115746 int i;
115747
115748 @@ -3000,33 +3000,10 @@
115749 if (start_pfn <= pfn && pfn < end_pfn)
115750 return early_node_map[i].nid;
115751 }
115752 - /* This is a memory hole */
115753 - return -1;
115754 -}
115755 -#endif /* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */
115756 -
115757 -int __meminit early_pfn_to_nid(unsigned long pfn)
115758 -{
115759 - int nid;
115760
115761 - nid = __early_pfn_to_nid(pfn);
115762 - if (nid >= 0)
115763 - return nid;
115764 - /* just returns 0 */
115765 return 0;
115766 }
115767 -
115768 -#ifdef CONFIG_NODES_SPAN_OTHER_NODES
115769 -bool __meminit early_pfn_in_nid(unsigned long pfn, int node)
115770 -{
115771 - int nid;
115772 -
115773 - nid = __early_pfn_to_nid(pfn);
115774 - if (nid >= 0 && nid != node)
115775 - return false;
115776 - return true;
115777 -}
115778 -#endif
115779 +#endif /* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */
115780
115781 /* Basic iterator support to walk early_node_map[] */
115782 #define for_each_active_range_index_in_nid(i, nid) \
115783 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/mm/page_cgroup.c linux-2.6.29-rc3.owrt/mm/page_cgroup.c
115784 --- linux-2.6.29.owrt/mm/page_cgroup.c 2009-05-10 22:04:39.000000000 +0200
115785 +++ linux-2.6.29-rc3.owrt/mm/page_cgroup.c 2009-05-10 23:48:33.000000000 +0200
115786 @@ -114,8 +114,7 @@
115787 nid = page_to_nid(pfn_to_page(pfn));
115788 table_size = sizeof(struct page_cgroup) * PAGES_PER_SECTION;
115789 if (slab_is_available()) {
115790 - base = kmalloc_node(table_size,
115791 - GFP_KERNEL | __GFP_NOWARN, nid);
115792 + base = kmalloc_node(table_size, GFP_KERNEL, nid);
115793 if (!base)
115794 base = vmalloc_node(table_size, nid);
115795 } else {
115796 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/mm/page_io.c linux-2.6.29-rc3.owrt/mm/page_io.c
115797 --- linux-2.6.29.owrt/mm/page_io.c 2009-05-10 22:04:39.000000000 +0200
115798 +++ linux-2.6.29-rc3.owrt/mm/page_io.c 2009-05-10 23:48:33.000000000 +0200
115799 @@ -111,7 +111,7 @@
115800 goto out;
115801 }
115802 if (wbc->sync_mode == WB_SYNC_ALL)
115803 - rw |= (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG);
115804 + rw |= (1 << BIO_RW_SYNC);
115805 count_vm_event(PSWPOUT);
115806 set_page_writeback(page);
115807 unlock_page(page);
115808 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/mm/page-writeback.c linux-2.6.29-rc3.owrt/mm/page-writeback.c
115809 --- linux-2.6.29.owrt/mm/page-writeback.c 2009-05-10 22:04:39.000000000 +0200
115810 +++ linux-2.6.29-rc3.owrt/mm/page-writeback.c 2009-05-10 23:48:33.000000000 +0200
115811 @@ -209,7 +209,7 @@
115812 struct file *filp, void __user *buffer, size_t *lenp,
115813 loff_t *ppos)
115814 {
115815 - unsigned long old_bytes = vm_dirty_bytes;
115816 + int old_bytes = vm_dirty_bytes;
115817 int ret;
115818
115819 ret = proc_doulongvec_minmax(table, write, filp, buffer, lenp, ppos);
115820 @@ -240,7 +240,7 @@
115821 }
115822 EXPORT_SYMBOL_GPL(bdi_writeout_inc);
115823
115824 -void task_dirty_inc(struct task_struct *tsk)
115825 +static inline void task_dirty_inc(struct task_struct *tsk)
115826 {
115827 prop_inc_single(&vm_dirties, &tsk->dirties);
115828 }
115829 @@ -1051,25 +1051,13 @@
115830 }
115831 }
115832
115833 - if (nr_to_write > 0) {
115834 - nr_to_write--;
115835 - if (nr_to_write == 0 &&
115836 - wbc->sync_mode == WB_SYNC_NONE) {
115837 - /*
115838 - * We stop writing back only if we are
115839 - * not doing integrity sync. In case of
115840 - * integrity sync we have to keep going
115841 - * because someone may be concurrently
115842 - * dirtying pages, and we might have
115843 - * synced a lot of newly appeared dirty
115844 - * pages, but have not synced all of the
115845 - * old dirty pages.
115846 - */
115847 + if (wbc->sync_mode == WB_SYNC_NONE) {
115848 + wbc->nr_to_write--;
115849 + if (wbc->nr_to_write <= 0) {
115850 done = 1;
115851 break;
115852 }
115853 }
115854 -
115855 if (wbc->nonblocking && bdi_write_congested(bdi)) {
115856 wbc->encountered_congestion = 1;
115857 done = 1;
115858 @@ -1079,7 +1067,7 @@
115859 pagevec_release(&pvec);
115860 cond_resched();
115861 }
115862 - if (!cycled && !done) {
115863 + if (!cycled) {
115864 /*
115865 * range_cyclic:
115866 * We hit the last page and there is more work to be done: wrap
115867 @@ -1230,7 +1218,6 @@
115868 __inc_zone_page_state(page, NR_FILE_DIRTY);
115869 __inc_bdi_stat(mapping->backing_dev_info,
115870 BDI_RECLAIMABLE);
115871 - task_dirty_inc(current);
115872 task_io_account_write(PAGE_CACHE_SIZE);
115873 }
115874 radix_tree_tag_set(&mapping->page_tree,
115875 @@ -1263,7 +1250,7 @@
115876 * If the mapping doesn't provide a set_page_dirty a_op, then
115877 * just fall through and assume that it wants buffer_heads.
115878 */
115879 -int set_page_dirty(struct page *page)
115880 +static int __set_page_dirty(struct page *page)
115881 {
115882 struct address_space *mapping = page_mapping(page);
115883
115884 @@ -1281,6 +1268,14 @@
115885 }
115886 return 0;
115887 }
115888 +
115889 +int set_page_dirty(struct page *page)
115890 +{
115891 + int ret = __set_page_dirty(page);
115892 + if (ret)
115893 + task_dirty_inc(current);
115894 + return ret;
115895 +}
115896 EXPORT_SYMBOL(set_page_dirty);
115897
115898 /*
115899 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/mm/rmap.c linux-2.6.29-rc3.owrt/mm/rmap.c
115900 --- linux-2.6.29.owrt/mm/rmap.c 2009-05-10 22:04:39.000000000 +0200
115901 +++ linux-2.6.29-rc3.owrt/mm/rmap.c 2009-05-10 23:48:33.000000000 +0200
115902 @@ -1072,8 +1072,7 @@
115903 spin_lock(&mapping->i_mmap_lock);
115904 vma_prio_tree_foreach(vma, &iter, &mapping->i_mmap, pgoff, pgoff) {
115905 if (MLOCK_PAGES && unlikely(unlock)) {
115906 - if (!((vma->vm_flags & VM_LOCKED) &&
115907 - page_mapped_in_vma(page, vma)))
115908 + if (!(vma->vm_flags & VM_LOCKED))
115909 continue; /* must visit all vmas */
115910 ret = SWAP_MLOCK;
115911 } else {
115912 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/mm/shmem.c linux-2.6.29-rc3.owrt/mm/shmem.c
115913 --- linux-2.6.29.owrt/mm/shmem.c 2009-05-10 22:04:39.000000000 +0200
115914 +++ linux-2.6.29-rc3.owrt/mm/shmem.c 2009-05-10 23:48:33.000000000 +0200
115915 @@ -169,13 +169,13 @@
115916 */
115917 static inline int shmem_acct_size(unsigned long flags, loff_t size)
115918 {
115919 - return (flags & VM_NORESERVE) ?
115920 - 0 : security_vm_enough_memory_kern(VM_ACCT(size));
115921 + return (flags & VM_ACCOUNT) ?
115922 + security_vm_enough_memory_kern(VM_ACCT(size)) : 0;
115923 }
115924
115925 static inline void shmem_unacct_size(unsigned long flags, loff_t size)
115926 {
115927 - if (!(flags & VM_NORESERVE))
115928 + if (flags & VM_ACCOUNT)
115929 vm_unacct_memory(VM_ACCT(size));
115930 }
115931
115932 @@ -187,13 +187,13 @@
115933 */
115934 static inline int shmem_acct_block(unsigned long flags)
115935 {
115936 - return (flags & VM_NORESERVE) ?
115937 - security_vm_enough_memory_kern(VM_ACCT(PAGE_CACHE_SIZE)) : 0;
115938 + return (flags & VM_ACCOUNT) ?
115939 + 0 : security_vm_enough_memory_kern(VM_ACCT(PAGE_CACHE_SIZE));
115940 }
115941
115942 static inline void shmem_unacct_blocks(unsigned long flags, long pages)
115943 {
115944 - if (flags & VM_NORESERVE)
115945 + if (!(flags & VM_ACCOUNT))
115946 vm_unacct_memory(pages * VM_ACCT(PAGE_CACHE_SIZE));
115947 }
115948
115949 @@ -1515,8 +1515,8 @@
115950 return 0;
115951 }
115952
115953 -static struct inode *shmem_get_inode(struct super_block *sb, int mode,
115954 - dev_t dev, unsigned long flags)
115955 +static struct inode *
115956 +shmem_get_inode(struct super_block *sb, int mode, dev_t dev)
115957 {
115958 struct inode *inode;
115959 struct shmem_inode_info *info;
115960 @@ -1537,7 +1537,6 @@
115961 info = SHMEM_I(inode);
115962 memset(info, 0, (char *)inode - (char *)info);
115963 spin_lock_init(&info->lock);
115964 - info->flags = flags & VM_NORESERVE;
115965 INIT_LIST_HEAD(&info->swaplist);
115966
115967 switch (mode & S_IFMT) {
115968 @@ -1780,10 +1779,9 @@
115969 static int
115970 shmem_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev)
115971 {
115972 - struct inode *inode;
115973 + struct inode *inode = shmem_get_inode(dir->i_sb, mode, dev);
115974 int error = -ENOSPC;
115975
115976 - inode = shmem_get_inode(dir->i_sb, mode, dev, VM_NORESERVE);
115977 if (inode) {
115978 error = security_inode_init_security(inode, dir, NULL, NULL,
115979 NULL);
115980 @@ -1922,7 +1920,7 @@
115981 if (len > PAGE_CACHE_SIZE)
115982 return -ENAMETOOLONG;
115983
115984 - inode = shmem_get_inode(dir->i_sb, S_IFLNK|S_IRWXUGO, 0, VM_NORESERVE);
115985 + inode = shmem_get_inode(dir->i_sb, S_IFLNK|S_IRWXUGO, 0);
115986 if (!inode)
115987 return -ENOSPC;
115988
115989 @@ -2334,7 +2332,7 @@
115990 sb->s_flags |= MS_POSIXACL;
115991 #endif
115992
115993 - inode = shmem_get_inode(sb, S_IFDIR | sbinfo->mode, 0, VM_NORESERVE);
115994 + inode = shmem_get_inode(sb, S_IFDIR | sbinfo->mode, 0);
115995 if (!inode)
115996 goto failed;
115997 inode->i_uid = sbinfo->uid;
115998 @@ -2576,12 +2574,12 @@
115999 return 0;
116000 }
116001
116002 -#define shmem_vm_ops generic_file_vm_ops
116003 -#define shmem_file_operations ramfs_file_operations
116004 -#define shmem_get_inode(sb, mode, dev, flags) ramfs_get_inode(sb, mode, dev)
116005 -#define shmem_acct_size(flags, size) 0
116006 -#define shmem_unacct_size(flags, size) do {} while (0)
116007 -#define SHMEM_MAX_BYTES LLONG_MAX
116008 +#define shmem_file_operations ramfs_file_operations
116009 +#define shmem_vm_ops generic_file_vm_ops
116010 +#define shmem_get_inode ramfs_get_inode
116011 +#define shmem_acct_size(a, b) 0
116012 +#define shmem_unacct_size(a, b) do {} while (0)
116013 +#define SHMEM_MAX_BYTES LLONG_MAX
116014
116015 #endif /* CONFIG_SHMEM */
116016
116017 @@ -2600,7 +2598,7 @@
116018 * shmem_file_setup - get an unlinked file living in tmpfs
116019 * @name: name for dentry (to be seen in /proc/<pid>/maps
116020 * @size: size to be set for the file
116021 - * @flags: VM_NORESERVE suppresses pre-accounting of the entire object size
116022 + * @flags: vm_flags
116023 */
116024 struct file *shmem_file_setup(char *name, loff_t size, unsigned long flags)
116025 {
116026 @@ -2634,10 +2632,13 @@
116027 goto put_dentry;
116028
116029 error = -ENOSPC;
116030 - inode = shmem_get_inode(root->d_sb, S_IFREG | S_IRWXUGO, 0, flags);
116031 + inode = shmem_get_inode(root->d_sb, S_IFREG | S_IRWXUGO, 0);
116032 if (!inode)
116033 goto close_file;
116034
116035 +#ifdef CONFIG_SHMEM
116036 + SHMEM_I(inode)->flags = flags & VM_ACCOUNT;
116037 +#endif
116038 d_instantiate(dentry, inode);
116039 inode->i_size = size;
116040 inode->i_nlink = 0; /* It is unlinked */
116041 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/mm/slab.c linux-2.6.29-rc3.owrt/mm/slab.c
116042 --- linux-2.6.29.owrt/mm/slab.c 2009-05-10 22:04:39.000000000 +0200
116043 +++ linux-2.6.29-rc3.owrt/mm/slab.c 2009-05-10 23:48:33.000000000 +0200
116044 @@ -4457,4 +4457,3 @@
116045
116046 return obj_size(virt_to_cache(objp));
116047 }
116048 -EXPORT_SYMBOL(ksize);
116049 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/mm/slob.c linux-2.6.29-rc3.owrt/mm/slob.c
116050 --- linux-2.6.29.owrt/mm/slob.c 2009-05-10 22:04:39.000000000 +0200
116051 +++ linux-2.6.29-rc3.owrt/mm/slob.c 2009-05-10 23:48:33.000000000 +0200
116052 @@ -521,7 +521,6 @@
116053 } else
116054 return sp->page.private;
116055 }
116056 -EXPORT_SYMBOL(ksize);
116057
116058 struct kmem_cache {
116059 unsigned int size, align;
116060 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/mm/slub.c linux-2.6.29-rc3.owrt/mm/slub.c
116061 --- linux-2.6.29.owrt/mm/slub.c 2009-05-10 22:04:39.000000000 +0200
116062 +++ linux-2.6.29-rc3.owrt/mm/slub.c 2009-05-10 23:48:33.000000000 +0200
116063 @@ -1996,7 +1996,7 @@
116064 static void free_kmem_cache_cpu(struct kmem_cache_cpu *c, int cpu)
116065 {
116066 if (c < per_cpu(kmem_cache_cpu, cpu) ||
116067 - c >= per_cpu(kmem_cache_cpu, cpu) + NR_KMEM_CACHE_CPU) {
116068 + c > per_cpu(kmem_cache_cpu, cpu) + NR_KMEM_CACHE_CPU) {
116069 kfree(c);
116070 return;
116071 }
116072 @@ -2736,7 +2736,6 @@
116073 */
116074 return s->size;
116075 }
116076 -EXPORT_SYMBOL(ksize);
116077
116078 void kfree(const void *x)
116079 {
116080 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/mm/swapfile.c linux-2.6.29-rc3.owrt/mm/swapfile.c
116081 --- linux-2.6.29.owrt/mm/swapfile.c 2009-05-10 22:04:39.000000000 +0200
116082 +++ linux-2.6.29-rc3.owrt/mm/swapfile.c 2009-05-10 23:48:33.000000000 +0200
116083 @@ -635,7 +635,7 @@
116084
116085 if (!bdev) {
116086 if (bdev_p)
116087 - *bdev_p = bdget(sis->bdev->bd_dev);
116088 + *bdev_p = sis->bdev;
116089
116090 spin_unlock(&swap_lock);
116091 return i;
116092 @@ -647,7 +647,7 @@
116093 struct swap_extent, list);
116094 if (se->start_block == offset) {
116095 if (bdev_p)
116096 - *bdev_p = bdget(sis->bdev->bd_dev);
116097 + *bdev_p = sis->bdev;
116098
116099 spin_unlock(&swap_lock);
116100 bdput(bdev);
116101 @@ -698,10 +698,8 @@
116102 pte_t *pte;
116103 int ret = 1;
116104
116105 - if (mem_cgroup_try_charge_swapin(vma->vm_mm, page, GFP_KERNEL, &ptr)) {
116106 + if (mem_cgroup_try_charge_swapin(vma->vm_mm, page, GFP_KERNEL, &ptr))
116107 ret = -ENOMEM;
116108 - goto out_nolock;
116109 - }
116110
116111 pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl);
116112 if (unlikely(!pte_same(*pte, swp_entry_to_pte(entry)))) {
116113 @@ -725,7 +723,6 @@
116114 activate_page(page);
116115 out:
116116 pte_unmap_unlock(pte, ptl);
116117 -out_nolock:
116118 return ret;
116119 }
116120
116121 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/mm/util.c linux-2.6.29-rc3.owrt/mm/util.c
116122 --- linux-2.6.29.owrt/mm/util.c 2009-05-10 22:04:39.000000000 +0200
116123 +++ linux-2.6.29-rc3.owrt/mm/util.c 2009-05-10 23:48:33.000000000 +0200
116124 @@ -129,26 +129,6 @@
116125 }
116126 EXPORT_SYMBOL(krealloc);
116127
116128 -/**
116129 - * kzfree - like kfree but zero memory
116130 - * @p: object to free memory of
116131 - *
116132 - * The memory of the object @p points to is zeroed before freed.
116133 - * If @p is %NULL, kzfree() does nothing.
116134 - */
116135 -void kzfree(const void *p)
116136 -{
116137 - size_t ks;
116138 - void *mem = (void *)p;
116139 -
116140 - if (unlikely(ZERO_OR_NULL_PTR(mem)))
116141 - return;
116142 - ks = ksize(mem);
116143 - memset(mem, 0, ks);
116144 - kfree(mem);
116145 -}
116146 -EXPORT_SYMBOL(kzfree);
116147 -
116148 /*
116149 * strndup_user - duplicate an existing string from user space
116150 * @s: The string to duplicate
116151 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/mm/vmalloc.c linux-2.6.29-rc3.owrt/mm/vmalloc.c
116152 --- linux-2.6.29.owrt/mm/vmalloc.c 2009-05-10 22:04:39.000000000 +0200
116153 +++ linux-2.6.29-rc3.owrt/mm/vmalloc.c 2009-05-10 23:48:33.000000000 +0200
116154 @@ -323,7 +323,6 @@
116155 unsigned long addr;
116156 int purged = 0;
116157
116158 - BUG_ON(!size);
116159 BUG_ON(size & ~PAGE_MASK);
116160
116161 va = kmalloc_node(sizeof(struct vmap_area),
116162 @@ -335,9 +334,6 @@
116163 addr = ALIGN(vstart, align);
116164
116165 spin_lock(&vmap_area_lock);
116166 - if (addr + size - 1 < addr)
116167 - goto overflow;
116168 -
116169 /* XXX: could have a last_hole cache */
116170 n = vmap_area_root.rb_node;
116171 if (n) {
116172 @@ -369,8 +365,6 @@
116173
116174 while (addr + size > first->va_start && addr + size <= vend) {
116175 addr = ALIGN(first->va_end + PAGE_SIZE, align);
116176 - if (addr + size - 1 < addr)
116177 - goto overflow;
116178
116179 n = rb_next(&first->rb_node);
116180 if (n)
116181 @@ -381,7 +375,6 @@
116182 }
116183 found:
116184 if (addr + size > vend) {
116185 -overflow:
116186 spin_unlock(&vmap_area_lock);
116187 if (!purged) {
116188 purge_vmap_area_lazy();
116189 @@ -505,7 +498,6 @@
116190 static DEFINE_SPINLOCK(purge_lock);
116191 LIST_HEAD(valist);
116192 struct vmap_area *va;
116193 - struct vmap_area *n_va;
116194 int nr = 0;
116195
116196 /*
116197 @@ -545,7 +537,7 @@
116198
116199 if (nr) {
116200 spin_lock(&vmap_area_lock);
116201 - list_for_each_entry_safe(va, n_va, &valist, purge_list)
116202 + list_for_each_entry(va, &valist, purge_list)
116203 __free_vmap_area(va);
116204 spin_unlock(&vmap_area_lock);
116205 }
116206 @@ -1020,8 +1012,6 @@
116207 void unmap_kernel_range(unsigned long addr, unsigned long size)
116208 {
116209 unsigned long end = addr + size;
116210 -
116211 - flush_cache_vunmap(addr, end);
116212 vunmap_page_range(addr, end);
116213 flush_tlb_kernel_range(addr, end);
116214 }
116215 @@ -1117,14 +1107,6 @@
116216 }
116217 EXPORT_SYMBOL_GPL(__get_vm_area);
116218
116219 -struct vm_struct *__get_vm_area_caller(unsigned long size, unsigned long flags,
116220 - unsigned long start, unsigned long end,
116221 - void *caller)
116222 -{
116223 - return __get_vm_area_node(size, flags, start, end, -1, GFP_KERNEL,
116224 - caller);
116225 -}
116226 -
116227 /**
116228 * get_vm_area - reserve a contiguous kernel virtual area
116229 * @size: size of the area
116230 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/mm/vmscan.c linux-2.6.29-rc3.owrt/mm/vmscan.c
116231 --- linux-2.6.29.owrt/mm/vmscan.c 2009-05-10 22:04:39.000000000 +0200
116232 +++ linux-2.6.29-rc3.owrt/mm/vmscan.c 2009-05-10 23:48:33.000000000 +0200
116233 @@ -1262,6 +1262,7 @@
116234 * Move the pages to the [file or anon] inactive list.
116235 */
116236 pagevec_init(&pvec, 1);
116237 + pgmoved = 0;
116238 lru = LRU_BASE + file * LRU_FILE;
116239
116240 spin_lock_irq(&zone->lru_lock);
116241 @@ -1273,7 +1274,6 @@
116242 */
116243 reclaim_stat->recent_rotated[!!file] += pgmoved;
116244
116245 - pgmoved = 0;
116246 while (!list_empty(&l_inactive)) {
116247 page = lru_to_page(&l_inactive);
116248 prefetchw_prev_lru_page(page, &l_inactive, flags);
116249 @@ -1469,7 +1469,7 @@
116250 int file = is_file_lru(l);
116251 int scan;
116252
116253 - scan = zone_nr_pages(zone, sc, l);
116254 + scan = zone_page_state(zone, NR_LRU_BASE + l);
116255 if (priority) {
116256 scan >>= priority;
116257 scan = (scan * percent[file]) / 100;
116258 @@ -2057,31 +2057,31 @@
116259 int pass, struct scan_control *sc)
116260 {
116261 struct zone *zone;
116262 - unsigned long ret = 0;
116263 + unsigned long nr_to_scan, ret = 0;
116264 + enum lru_list l;
116265
116266 for_each_zone(zone) {
116267 - enum lru_list l;
116268
116269 if (!populated_zone(zone))
116270 continue;
116271 +
116272 if (zone_is_all_unreclaimable(zone) && prio != DEF_PRIORITY)
116273 continue;
116274
116275 for_each_evictable_lru(l) {
116276 - enum zone_stat_item ls = NR_LRU_BASE + l;
116277 - unsigned long lru_pages = zone_page_state(zone, ls);
116278 -
116279 /* For pass = 0, we don't shrink the active list */
116280 - if (pass == 0 && (l == LRU_ACTIVE_ANON ||
116281 - l == LRU_ACTIVE_FILE))
116282 + if (pass == 0 &&
116283 + (l == LRU_ACTIVE || l == LRU_ACTIVE_FILE))
116284 continue;
116285
116286 - zone->lru[l].nr_scan += (lru_pages >> prio) + 1;
116287 + zone->lru[l].nr_scan +=
116288 + (zone_page_state(zone, NR_LRU_BASE + l)
116289 + >> prio) + 1;
116290 if (zone->lru[l].nr_scan >= nr_pages || pass > 3) {
116291 - unsigned long nr_to_scan;
116292 -
116293 zone->lru[l].nr_scan = 0;
116294 - nr_to_scan = min(nr_pages, lru_pages);
116295 + nr_to_scan = min(nr_pages,
116296 + zone_page_state(zone,
116297 + NR_LRU_BASE + l));
116298 ret += shrink_list(l, nr_to_scan, zone,
116299 sc, prio);
116300 if (ret >= nr_pages)
116301 @@ -2089,6 +2089,7 @@
116302 }
116303 }
116304 }
116305 +
116306 return ret;
116307 }
116308
116309 @@ -2111,6 +2112,7 @@
116310 .may_swap = 0,
116311 .swap_cluster_max = nr_pages,
116312 .may_writepage = 1,
116313 + .swappiness = vm_swappiness,
116314 .isolate_pages = isolate_pages_global,
116315 };
116316
116317 @@ -2144,8 +2146,10 @@
116318 int prio;
116319
116320 /* Force reclaiming mapped pages in the passes #3 and #4 */
116321 - if (pass > 2)
116322 + if (pass > 2) {
116323 sc.may_swap = 1;
116324 + sc.swappiness = 100;
116325 + }
116326
116327 for (prio = DEF_PRIORITY; prio >= 0; prio--) {
116328 unsigned long nr_to_scan = nr_pages - ret;
116329 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/802/tr.c linux-2.6.29-rc3.owrt/net/802/tr.c
116330 --- linux-2.6.29.owrt/net/802/tr.c 2009-05-10 22:04:39.000000000 +0200
116331 +++ linux-2.6.29-rc3.owrt/net/802/tr.c 2009-05-10 23:48:33.000000000 +0200
116332 @@ -668,5 +668,3 @@
116333
116334 EXPORT_SYMBOL(tr_type_trans);
116335 EXPORT_SYMBOL(alloc_trdev);
116336 -
116337 -MODULE_LICENSE("GPL");
116338 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/8021q/vlan_core.c linux-2.6.29-rc3.owrt/net/8021q/vlan_core.c
116339 --- linux-2.6.29.owrt/net/8021q/vlan_core.c 2009-05-10 22:04:39.000000000 +0200
116340 +++ linux-2.6.29-rc3.owrt/net/8021q/vlan_core.c 2009-05-10 23:48:33.000000000 +0200
116341 @@ -1,16 +1,12 @@
116342 #include <linux/skbuff.h>
116343 #include <linux/netdevice.h>
116344 #include <linux/if_vlan.h>
116345 -#include <linux/netpoll.h>
116346 #include "vlan.h"
116347
116348 /* VLAN rx hw acceleration helper. This acts like netif_{rx,receive_skb}(). */
116349 int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
116350 u16 vlan_tci, int polling)
116351 {
116352 - if (netpoll_rx(skb))
116353 - return NET_RX_DROP;
116354 -
116355 if (skb_bond_should_drop(skb))
116356 goto drop;
116357
116358 @@ -104,9 +100,6 @@
116359 {
116360 int err = NET_RX_SUCCESS;
116361
116362 - if (netpoll_receive_skb(skb))
116363 - return NET_RX_DROP;
116364 -
116365 switch (vlan_gro_common(napi, grp, vlan_tci, skb)) {
116366 case -1:
116367 return netif_receive_skb(skb);
116368 @@ -133,9 +126,6 @@
116369 if (!skb)
116370 goto out;
116371
116372 - if (netpoll_receive_skb(skb))
116373 - goto out;
116374 -
116375 err = NET_RX_SUCCESS;
116376
116377 switch (vlan_gro_common(napi, grp, vlan_tci, skb)) {
116378 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/8021q/vlan_dev.c linux-2.6.29-rc3.owrt/net/8021q/vlan_dev.c
116379 --- linux-2.6.29.owrt/net/8021q/vlan_dev.c 2009-05-10 22:04:39.000000000 +0200
116380 +++ linux-2.6.29-rc3.owrt/net/8021q/vlan_dev.c 2009-05-10 23:48:33.000000000 +0200
116381 @@ -553,7 +553,7 @@
116382 int err = 0;
116383
116384 if (netif_device_present(real_dev) && ops->ndo_neigh_setup)
116385 - err = ops->ndo_neigh_setup(real_dev, pa);
116386 + err = ops->ndo_neigh_setup(dev, pa);
116387
116388 return err;
116389 }
116390 @@ -639,7 +639,6 @@
116391 dev->hard_header_len = real_dev->hard_header_len + VLAN_HLEN;
116392 dev->netdev_ops = &vlan_netdev_ops;
116393 }
116394 - netdev_resync_ops(dev);
116395
116396 if (is_vlan_dev(real_dev))
116397 subclass = 1;
116398 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/9p/protocol.c linux-2.6.29-rc3.owrt/net/9p/protocol.c
116399 --- linux-2.6.29.owrt/net/9p/protocol.c 2009-05-10 22:04:39.000000000 +0200
116400 +++ linux-2.6.29-rc3.owrt/net/9p/protocol.c 2009-05-10 23:48:33.000000000 +0200
116401 @@ -29,7 +29,6 @@
116402 #include <linux/errno.h>
116403 #include <linux/uaccess.h>
116404 #include <linux/sched.h>
116405 -#include <linux/types.h>
116406 #include <net/9p/9p.h>
116407 #include <net/9p/client.h>
116408 #include "protocol.h"
116409 @@ -161,32 +160,29 @@
116410 break;
116411 case 'w':{
116412 int16_t *val = va_arg(ap, int16_t *);
116413 - __le16 le_val;
116414 - if (pdu_read(pdu, &le_val, sizeof(le_val))) {
116415 + if (pdu_read(pdu, val, sizeof(*val))) {
116416 errcode = -EFAULT;
116417 break;
116418 }
116419 - *val = le16_to_cpu(le_val);
116420 + *val = cpu_to_le16(*val);
116421 }
116422 break;
116423 case 'd':{
116424 int32_t *val = va_arg(ap, int32_t *);
116425 - __le32 le_val;
116426 - if (pdu_read(pdu, &le_val, sizeof(le_val))) {
116427 + if (pdu_read(pdu, val, sizeof(*val))) {
116428 errcode = -EFAULT;
116429 break;
116430 }
116431 - *val = le32_to_cpu(le_val);
116432 + *val = cpu_to_le32(*val);
116433 }
116434 break;
116435 case 'q':{
116436 int64_t *val = va_arg(ap, int64_t *);
116437 - __le64 le_val;
116438 - if (pdu_read(pdu, &le_val, sizeof(le_val))) {
116439 + if (pdu_read(pdu, val, sizeof(*val))) {
116440 errcode = -EFAULT;
116441 break;
116442 }
116443 - *val = le64_to_cpu(le_val);
116444 + *val = cpu_to_le64(*val);
116445 }
116446 break;
116447 case 's':{
116448 @@ -366,19 +362,19 @@
116449 }
116450 break;
116451 case 'w':{
116452 - __le16 val = cpu_to_le16(va_arg(ap, int));
116453 + int16_t val = va_arg(ap, int);
116454 if (pdu_write(pdu, &val, sizeof(val)))
116455 errcode = -EFAULT;
116456 }
116457 break;
116458 case 'd':{
116459 - __le32 val = cpu_to_le32(va_arg(ap, int32_t));
116460 + int32_t val = va_arg(ap, int32_t);
116461 if (pdu_write(pdu, &val, sizeof(val)))
116462 errcode = -EFAULT;
116463 }
116464 break;
116465 case 'q':{
116466 - __le64 val = cpu_to_le64(va_arg(ap, int64_t));
116467 + int64_t val = va_arg(ap, int64_t);
116468 if (pdu_write(pdu, &val, sizeof(val)))
116469 errcode = -EFAULT;
116470 }
116471 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/bridge/br_forward.c linux-2.6.29-rc3.owrt/net/bridge/br_forward.c
116472 --- linux-2.6.29.owrt/net/bridge/br_forward.c 2009-05-10 22:04:39.000000000 +0200
116473 +++ linux-2.6.29-rc3.owrt/net/bridge/br_forward.c 2009-05-10 23:48:33.000000000 +0200
116474 @@ -67,11 +67,6 @@
116475 {
116476 struct net_device *indev;
116477
116478 - if (skb_warn_if_lro(skb)) {
116479 - kfree_skb(skb);
116480 - return;
116481 - }
116482 -
116483 indev = skb->dev;
116484 skb->dev = to->dev;
116485 skb_forward_csum(skb);
116486 @@ -94,7 +89,7 @@
116487 /* called with rcu_read_lock */
116488 void br_forward(const struct net_bridge_port *to, struct sk_buff *skb)
116489 {
116490 - if (should_deliver(to, skb)) {
116491 + if (!skb_warn_if_lro(skb) && should_deliver(to, skb)) {
116492 __br_forward(to, skb);
116493 return;
116494 }
116495 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/core/dev.c linux-2.6.29-rc3.owrt/net/core/dev.c
116496 --- linux-2.6.29.owrt/net/core/dev.c 2009-05-10 22:04:39.000000000 +0200
116497 +++ linux-2.6.29-rc3.owrt/net/core/dev.c 2009-05-10 23:48:33.000000000 +0200
116498 @@ -1093,7 +1093,7 @@
116499 /*
116500 * Enable NET_DMA
116501 */
116502 - net_dmaengine_get();
116503 + dmaengine_get();
116504
116505 /*
116506 * Initialize multicasting status
116507 @@ -1175,7 +1175,7 @@
116508 /*
116509 * Shutdown NET_DMA
116510 */
116511 - net_dmaengine_put();
116512 + dmaengine_put();
116513
116514 return 0;
116515 }
116516 @@ -2274,6 +2274,12 @@
116517
116518 rcu_read_lock();
116519
116520 + /* Don't receive packets in an exiting network namespace */
116521 + if (!net_alive(dev_net(skb->dev))) {
116522 + kfree_skb(skb);
116523 + goto out;
116524 + }
116525 +
116526 #ifdef CONFIG_NET_CLS_ACT
116527 if (skb->tc_verd & TC_NCLS) {
116528 skb->tc_verd = CLR_TC_NCLS(skb->tc_verd);
116529 @@ -2489,9 +2495,6 @@
116530
116531 int napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb)
116532 {
116533 - if (netpoll_receive_skb(skb))
116534 - return NET_RX_DROP;
116535 -
116536 switch (__napi_gro_receive(napi, skb)) {
116537 case -1:
116538 return netif_receive_skb(skb);
116539 @@ -2562,9 +2565,6 @@
116540 if (!skb)
116541 goto out;
116542
116543 - if (netpoll_receive_skb(skb))
116544 - goto out;
116545 -
116546 err = NET_RX_SUCCESS;
116547
116548 switch (__napi_gro_receive(napi, skb)) {
116549 @@ -2595,9 +2595,9 @@
116550 local_irq_disable();
116551 skb = __skb_dequeue(&queue->input_pkt_queue);
116552 if (!skb) {
116553 + __napi_complete(napi);
116554 local_irq_enable();
116555 - napi_complete(napi);
116556 - goto out;
116557 + break;
116558 }
116559 local_irq_enable();
116560
116561 @@ -2606,7 +2606,6 @@
116562
116563 napi_gro_flush(napi);
116564
116565 -out:
116566 return work;
116567 }
116568
116569 @@ -2679,7 +2678,7 @@
116570 struct sk_buff *skb, *next;
116571
116572 list_del_init(&napi->dev_list);
116573 - kfree_skb(napi->skb);
116574 + kfree(napi->skb);
116575
116576 for (skb = napi->gro_list; skb; skb = next) {
116577 next = skb->next;
116578 @@ -4290,39 +4289,6 @@
116579 }
116580 EXPORT_SYMBOL(netdev_fix_features);
116581
116582 -/* Some devices need to (re-)set their netdev_ops inside
116583 - * ->init() or similar. If that happens, we have to setup
116584 - * the compat pointers again.
116585 - */
116586 -void netdev_resync_ops(struct net_device *dev)
116587 -{
116588 -#ifdef CONFIG_COMPAT_NET_DEV_OPS
116589 - const struct net_device_ops *ops = dev->netdev_ops;
116590 -
116591 - dev->init = ops->ndo_init;
116592 - dev->uninit = ops->ndo_uninit;
116593 - dev->open = ops->ndo_open;
116594 - dev->change_rx_flags = ops->ndo_change_rx_flags;
116595 - dev->set_rx_mode = ops->ndo_set_rx_mode;
116596 - dev->set_multicast_list = ops->ndo_set_multicast_list;
116597 - dev->set_mac_address = ops->ndo_set_mac_address;
116598 - dev->validate_addr = ops->ndo_validate_addr;
116599 - dev->do_ioctl = ops->ndo_do_ioctl;
116600 - dev->set_config = ops->ndo_set_config;
116601 - dev->change_mtu = ops->ndo_change_mtu;
116602 - dev->neigh_setup = ops->ndo_neigh_setup;
116603 - dev->tx_timeout = ops->ndo_tx_timeout;
116604 - dev->get_stats = ops->ndo_get_stats;
116605 - dev->vlan_rx_register = ops->ndo_vlan_rx_register;
116606 - dev->vlan_rx_add_vid = ops->ndo_vlan_rx_add_vid;
116607 - dev->vlan_rx_kill_vid = ops->ndo_vlan_rx_kill_vid;
116608 -#ifdef CONFIG_NET_POLL_CONTROLLER
116609 - dev->poll_controller = ops->ndo_poll_controller;
116610 -#endif
116611 -#endif
116612 -}
116613 -EXPORT_SYMBOL(netdev_resync_ops);
116614 -
116615 /**
116616 * register_netdevice - register a network device
116617 * @dev: device to register
116618 @@ -4367,7 +4333,27 @@
116619 * This is temporary until all network devices are converted.
116620 */
116621 if (dev->netdev_ops) {
116622 - netdev_resync_ops(dev);
116623 + const struct net_device_ops *ops = dev->netdev_ops;
116624 +
116625 + dev->init = ops->ndo_init;
116626 + dev->uninit = ops->ndo_uninit;
116627 + dev->open = ops->ndo_open;
116628 + dev->change_rx_flags = ops->ndo_change_rx_flags;
116629 + dev->set_rx_mode = ops->ndo_set_rx_mode;
116630 + dev->set_multicast_list = ops->ndo_set_multicast_list;
116631 + dev->set_mac_address = ops->ndo_set_mac_address;
116632 + dev->validate_addr = ops->ndo_validate_addr;
116633 + dev->do_ioctl = ops->ndo_do_ioctl;
116634 + dev->set_config = ops->ndo_set_config;
116635 + dev->change_mtu = ops->ndo_change_mtu;
116636 + dev->tx_timeout = ops->ndo_tx_timeout;
116637 + dev->get_stats = ops->ndo_get_stats;
116638 + dev->vlan_rx_register = ops->ndo_vlan_rx_register;
116639 + dev->vlan_rx_add_vid = ops->ndo_vlan_rx_add_vid;
116640 + dev->vlan_rx_kill_vid = ops->ndo_vlan_rx_kill_vid;
116641 +#ifdef CONFIG_NET_POLL_CONTROLLER
116642 + dev->poll_controller = ops->ndo_poll_controller;
116643 +#endif
116644 } else {
116645 char drivername[64];
116646 pr_info("%s (%s): not using net_device_ops yet\n",
116647 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/core/neighbour.c linux-2.6.29-rc3.owrt/net/core/neighbour.c
116648 --- linux-2.6.29.owrt/net/core/neighbour.c 2009-05-10 22:04:39.000000000 +0200
116649 +++ linux-2.6.29-rc3.owrt/net/core/neighbour.c 2009-05-10 23:48:33.000000000 +0200
116650 @@ -1994,8 +1994,8 @@
116651 if (!net_eq(neigh_parms_net(p), net))
116652 continue;
116653
116654 - if (nidx < neigh_skip)
116655 - goto next;
116656 + if (nidx++ < neigh_skip)
116657 + continue;
116658
116659 if (neightbl_fill_param_info(skb, tbl, p,
116660 NETLINK_CB(cb->skb).pid,
116661 @@ -2003,8 +2003,6 @@
116662 RTM_NEWNEIGHTBL,
116663 NLM_F_MULTI) <= 0)
116664 goto out;
116665 - next:
116666 - nidx++;
116667 }
116668
116669 neigh_skip = 0;
116670 @@ -2084,10 +2082,12 @@
116671 if (h > s_h)
116672 s_idx = 0;
116673 for (n = tbl->hash_buckets[h], idx = 0; n; n = n->next) {
116674 + int lidx;
116675 if (dev_net(n->dev) != net)
116676 continue;
116677 - if (idx < s_idx)
116678 - goto next;
116679 + lidx = idx++;
116680 + if (lidx < s_idx)
116681 + continue;
116682 if (neigh_fill_info(skb, n, NETLINK_CB(cb->skb).pid,
116683 cb->nlh->nlmsg_seq,
116684 RTM_NEWNEIGH,
116685 @@ -2096,8 +2096,6 @@
116686 rc = -1;
116687 goto out;
116688 }
116689 - next:
116690 - idx++;
116691 }
116692 }
116693 read_unlock_bh(&tbl->lock);
116694 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/core/net_namespace.c linux-2.6.29-rc3.owrt/net/core/net_namespace.c
116695 --- linux-2.6.29.owrt/net/core/net_namespace.c 2009-05-10 22:04:39.000000000 +0200
116696 +++ linux-2.6.29-rc3.owrt/net/core/net_namespace.c 2009-05-10 23:48:33.000000000 +0200
116697 @@ -32,14 +32,24 @@
116698 {
116699 /* Must be called with net_mutex held */
116700 struct pernet_operations *ops;
116701 - int error = 0;
116702 + int error;
116703 + struct net_generic *ng;
116704
116705 atomic_set(&net->count, 1);
116706 -
116707 #ifdef NETNS_REFCNT_DEBUG
116708 atomic_set(&net->use_count, 0);
116709 #endif
116710
116711 + error = -ENOMEM;
116712 + ng = kzalloc(sizeof(struct net_generic) +
116713 + INITIAL_NET_GEN_PTRS * sizeof(void *), GFP_KERNEL);
116714 + if (ng == NULL)
116715 + goto out;
116716 +
116717 + ng->len = INITIAL_NET_GEN_PTRS;
116718 + rcu_assign_pointer(net->gen, ng);
116719 +
116720 + error = 0;
116721 list_for_each_entry(ops, &pernet_list, list) {
116722 if (ops->init) {
116723 error = ops->init(net);
116724 @@ -60,50 +70,24 @@
116725 }
116726
116727 rcu_barrier();
116728 + kfree(ng);
116729 goto out;
116730 }
116731
116732 -static struct net_generic *net_alloc_generic(void)
116733 -{
116734 - struct net_generic *ng;
116735 - size_t generic_size = sizeof(struct net_generic) +
116736 - INITIAL_NET_GEN_PTRS * sizeof(void *);
116737 -
116738 - ng = kzalloc(generic_size, GFP_KERNEL);
116739 - if (ng)
116740 - ng->len = INITIAL_NET_GEN_PTRS;
116741 -
116742 - return ng;
116743 -}
116744 -
116745 #ifdef CONFIG_NET_NS
116746 static struct kmem_cache *net_cachep;
116747 static struct workqueue_struct *netns_wq;
116748
116749 static struct net *net_alloc(void)
116750 {
116751 - struct net *net = NULL;
116752 - struct net_generic *ng;
116753 -
116754 - ng = net_alloc_generic();
116755 - if (!ng)
116756 - goto out;
116757 -
116758 - net = kmem_cache_zalloc(net_cachep, GFP_KERNEL);
116759 - if (!net)
116760 - goto out_free;
116761 -
116762 - rcu_assign_pointer(net->gen, ng);
116763 -out:
116764 - return net;
116765 -
116766 -out_free:
116767 - kfree(ng);
116768 - goto out;
116769 + return kmem_cache_zalloc(net_cachep, GFP_KERNEL);
116770 }
116771
116772 static void net_free(struct net *net)
116773 {
116774 + if (!net)
116775 + return;
116776 +
116777 #ifdef NETNS_REFCNT_DEBUG
116778 if (unlikely(atomic_read(&net->use_count) != 0)) {
116779 printk(KERN_EMERG "network namespace not free! Usage: %d\n",
116780 @@ -128,28 +112,27 @@
116781 err = -ENOMEM;
116782 new_net = net_alloc();
116783 if (!new_net)
116784 - goto out_err;
116785 + goto out;
116786
116787 mutex_lock(&net_mutex);
116788 err = setup_net(new_net);
116789 - if (!err) {
116790 - rtnl_lock();
116791 - list_add_tail(&new_net->list, &net_namespace_list);
116792 - rtnl_unlock();
116793 - }
116794 - mutex_unlock(&net_mutex);
116795 -
116796 if (err)
116797 - goto out_free;
116798 + goto out_unlock;
116799 +
116800 + rtnl_lock();
116801 + list_add_tail(&new_net->list, &net_namespace_list);
116802 + rtnl_unlock();
116803 +
116804 +
116805 +out_unlock:
116806 + mutex_unlock(&net_mutex);
116807 out:
116808 put_net(old_net);
116809 + if (err) {
116810 + net_free(new_net);
116811 + new_net = ERR_PTR(err);
116812 + }
116813 return new_net;
116814 -
116815 -out_free:
116816 - net_free(new_net);
116817 -out_err:
116818 - new_net = ERR_PTR(err);
116819 - goto out;
116820 }
116821
116822 static void cleanup_net(struct work_struct *work)
116823 @@ -157,6 +140,9 @@
116824 struct pernet_operations *ops;
116825 struct net *net;
116826
116827 + /* Be very certain incoming network packets will not find us */
116828 + rcu_barrier();
116829 +
116830 net = container_of(work, struct net, work);
116831
116832 mutex_lock(&net_mutex);
116833 @@ -202,7 +188,6 @@
116834
116835 static int __init net_ns_init(void)
116836 {
116837 - struct net_generic *ng;
116838 int err;
116839
116840 printk(KERN_INFO "net_namespace: %zd bytes\n", sizeof(struct net));
116841 @@ -217,12 +202,6 @@
116842 panic("Could not create netns workq");
116843 #endif
116844
116845 - ng = net_alloc_generic();
116846 - if (!ng)
116847 - panic("Could not allocate generic netns");
116848 -
116849 - rcu_assign_pointer(init_net.gen, ng);
116850 -
116851 mutex_lock(&net_mutex);
116852 err = setup_net(&init_net);
116853
116854 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/core/net-sysfs.c linux-2.6.29-rc3.owrt/net/core/net-sysfs.c
116855 --- linux-2.6.29.owrt/net/core/net-sysfs.c 2009-05-10 22:04:39.000000000 +0200
116856 +++ linux-2.6.29-rc3.owrt/net/core/net-sysfs.c 2009-05-10 23:48:33.000000000 +0200
116857 @@ -77,9 +77,7 @@
116858 if (endp == buf)
116859 goto err;
116860
116861 - if (!rtnl_trylock())
116862 - return -ERESTARTSYS;
116863 -
116864 + rtnl_lock();
116865 if (dev_isalive(net)) {
116866 if ((ret = (*set)(net, new)) == 0)
116867 ret = len;
116868 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/core/skbuff.c linux-2.6.29-rc3.owrt/net/core/skbuff.c
116869 --- linux-2.6.29.owrt/net/core/skbuff.c 2009-05-10 22:04:39.000000000 +0200
116870 +++ linux-2.6.29-rc3.owrt/net/core/skbuff.c 2009-05-10 23:48:33.000000000 +0200
116871 @@ -220,6 +220,14 @@
116872 BUG();
116873 }
116874
116875 +void skb_truesize_bug(struct sk_buff *skb)
116876 +{
116877 + WARN(net_ratelimit(), KERN_ERR "SKB BUG: Invalid truesize (%u) "
116878 + "len=%u, sizeof(sk_buff)=%Zd\n",
116879 + skb->truesize, skb->len, sizeof(struct sk_buff));
116880 +}
116881 +EXPORT_SYMBOL(skb_truesize_bug);
116882 +
116883 /* Allocate a new skbuff. We do this ourselves so we can fill in a few
116884 * 'private' fields and also do memory statistics to find all the
116885 * [BEEP] leaks.
116886 @@ -2293,10 +2301,10 @@
116887 return 0;
116888
116889 next_skb:
116890 - block_limit = skb_headlen(st->cur_skb) + st->stepped_offset;
116891 + block_limit = skb_headlen(st->cur_skb);
116892
116893 if (abs_offset < block_limit) {
116894 - *data = st->cur_skb->data + (abs_offset - st->stepped_offset);
116895 + *data = st->cur_skb->data + abs_offset;
116896 return block_limit - abs_offset;
116897 }
116898
116899 @@ -2331,15 +2339,14 @@
116900 st->frag_data = NULL;
116901 }
116902
116903 - if (st->root_skb == st->cur_skb &&
116904 - skb_shinfo(st->root_skb)->frag_list) {
116905 - st->cur_skb = skb_shinfo(st->root_skb)->frag_list;
116906 - st->frag_idx = 0;
116907 - goto next_skb;
116908 - } else if (st->cur_skb->next) {
116909 + if (st->cur_skb->next) {
116910 st->cur_skb = st->cur_skb->next;
116911 st->frag_idx = 0;
116912 goto next_skb;
116913 + } else if (st->root_skb == st->cur_skb &&
116914 + skb_shinfo(st->root_skb)->frag_list) {
116915 + st->cur_skb = skb_shinfo(st->root_skb)->frag_list;
116916 + goto next_skb;
116917 }
116918
116919 return 0;
116920 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/core/sock.c linux-2.6.29-rc3.owrt/net/core/sock.c
116921 --- linux-2.6.29.owrt/net/core/sock.c 2009-05-10 22:04:39.000000000 +0200
116922 +++ linux-2.6.29-rc3.owrt/net/core/sock.c 2009-05-10 23:48:33.000000000 +0200
116923 @@ -696,8 +696,6 @@
116924 if (len < 0)
116925 return -EINVAL;
116926
116927 - memset(&v, 0, sizeof(v));
116928 -
116929 switch(optname) {
116930 case SO_DEBUG:
116931 v.val = sock_flag(sk, SOCK_DBG);
116932 @@ -1137,6 +1135,7 @@
116933 {
116934 struct sock *sk = skb->sk;
116935
116936 + skb_truesize_check(skb);
116937 atomic_sub(skb->truesize, &sk->sk_rmem_alloc);
116938 sk_mem_uncharge(skb->sk, skb->truesize);
116939 }
116940 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/ipv4/cipso_ipv4.c linux-2.6.29-rc3.owrt/net/ipv4/cipso_ipv4.c
116941 --- linux-2.6.29.owrt/net/ipv4/cipso_ipv4.c 2009-05-10 22:04:39.000000000 +0200
116942 +++ linux-2.6.29-rc3.owrt/net/ipv4/cipso_ipv4.c 2009-05-10 23:48:33.000000000 +0200
116943 @@ -3,16 +3,11 @@
116944 *
116945 * This is an implementation of the CIPSO 2.2 protocol as specified in
116946 * draft-ietf-cipso-ipsecurity-01.txt with additional tag types as found in
116947 - * FIPS-188. While CIPSO never became a full IETF RFC standard many vendors
116948 + * FIPS-188, copies of both documents can be found in the Documentation
116949 + * directory. While CIPSO never became a full IETF RFC standard many vendors
116950 * have chosen to adopt the protocol and over the years it has become a
116951 * de-facto standard for labeled networking.
116952 *
116953 - * The CIPSO draft specification can be found in the kernel's Documentation
116954 - * directory as well as the following URL:
116955 - * http://netlabel.sourceforge.net/files/draft-ietf-cipso-ipsecurity-01.txt
116956 - * The FIPS-188 specification can be found at the following URL:
116957 - * http://www.itl.nist.gov/fipspubs/fip188.htm
116958 - *
116959 * Author: Paul Moore <paul.moore@hp.com>
116960 *
116961 */
116962 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/ipv4/icmp.c linux-2.6.29-rc3.owrt/net/ipv4/icmp.c
116963 --- linux-2.6.29.owrt/net/ipv4/icmp.c 2009-05-10 22:04:39.000000000 +0200
116964 +++ linux-2.6.29-rc3.owrt/net/ipv4/icmp.c 2009-05-10 23:48:33.000000000 +0200
116965 @@ -1205,7 +1205,7 @@
116966
116967 int __init icmp_init(void)
116968 {
116969 - return register_pernet_subsys(&icmp_sk_ops);
116970 + return register_pernet_device(&icmp_sk_ops);
116971 }
116972
116973 EXPORT_SYMBOL(icmp_err_convert);
116974 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/ipv4/ipconfig.c linux-2.6.29-rc3.owrt/net/ipv4/ipconfig.c
116975 --- linux-2.6.29.owrt/net/ipv4/ipconfig.c 2009-05-10 22:04:39.000000000 +0200
116976 +++ linux-2.6.29-rc3.owrt/net/ipv4/ipconfig.c 2009-05-10 23:48:33.000000000 +0200
116977 @@ -1268,9 +1268,6 @@
116978 static int __init ip_auto_config(void)
116979 {
116980 __be32 addr;
116981 -#ifdef IPCONFIG_DYNAMIC
116982 - int retries = CONF_OPEN_RETRIES;
116983 -#endif
116984
116985 #ifdef CONFIG_PROC_FS
116986 proc_net_fops_create(&init_net, "pnp", S_IRUGO, &pnp_seq_fops);
116987 @@ -1307,6 +1304,9 @@
116988 #endif
116989 ic_first_dev->next) {
116990 #ifdef IPCONFIG_DYNAMIC
116991 +
116992 + int retries = CONF_OPEN_RETRIES;
116993 +
116994 if (ic_dynamic() < 0) {
116995 ic_close_devs();
116996
116997 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/ipv4/ip_fragment.c linux-2.6.29-rc3.owrt/net/ipv4/ip_fragment.c
116998 --- linux-2.6.29.owrt/net/ipv4/ip_fragment.c 2009-05-10 22:04:39.000000000 +0200
116999 +++ linux-2.6.29-rc3.owrt/net/ipv4/ip_fragment.c 2009-05-10 23:48:33.000000000 +0200
117000 @@ -463,7 +463,6 @@
117001 static int ip_frag_reasm(struct ipq *qp, struct sk_buff *prev,
117002 struct net_device *dev)
117003 {
117004 - struct net *net = container_of(qp->q.net, struct net, ipv4.frags);
117005 struct iphdr *iph;
117006 struct sk_buff *fp, *head = qp->q.fragments;
117007 int len;
117008 @@ -549,7 +548,7 @@
117009 iph = ip_hdr(head);
117010 iph->frag_off = 0;
117011 iph->tot_len = htons(len);
117012 - IP_INC_STATS_BH(net, IPSTATS_MIB_REASMOKS);
117013 + IP_INC_STATS_BH(dev_net(dev), IPSTATS_MIB_REASMOKS);
117014 qp->q.fragments = NULL;
117015 return 0;
117016
117017 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/ipv4/tcp.c linux-2.6.29-rc3.owrt/net/ipv4/tcp.c
117018 --- linux-2.6.29.owrt/net/ipv4/tcp.c 2009-05-10 22:04:39.000000000 +0200
117019 +++ linux-2.6.29-rc3.owrt/net/ipv4/tcp.c 2009-05-10 23:48:33.000000000 +0200
117020 @@ -524,8 +524,7 @@
117021 struct tcp_splice_state *tss = rd_desc->arg.data;
117022 int ret;
117023
117024 - ret = skb_splice_bits(skb, offset, tss->pipe, min(rd_desc->count, len),
117025 - tss->flags);
117026 + ret = skb_splice_bits(skb, offset, tss->pipe, rd_desc->count, tss->flags);
117027 if (ret > 0)
117028 rd_desc->count -= ret;
117029 return ret;
117030 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/ipv4/tcp_input.c linux-2.6.29-rc3.owrt/net/ipv4/tcp_input.c
117031 --- linux-2.6.29.owrt/net/ipv4/tcp_input.c 2009-05-10 22:04:39.000000000 +0200
117032 +++ linux-2.6.29-rc3.owrt/net/ipv4/tcp_input.c 2009-05-10 23:48:34.000000000 +0200
117033 @@ -1374,8 +1374,7 @@
117034
117035 static int tcp_shifted_skb(struct sock *sk, struct sk_buff *skb,
117036 struct tcp_sacktag_state *state,
117037 - unsigned int pcount, int shifted, int mss,
117038 - int dup_sack)
117039 + unsigned int pcount, int shifted, int mss)
117040 {
117041 struct tcp_sock *tp = tcp_sk(sk);
117042 struct sk_buff *prev = tcp_write_queue_prev(sk, skb);
117043 @@ -1411,7 +1410,7 @@
117044 }
117045
117046 /* We discard results */
117047 - tcp_sacktag_one(skb, sk, state, dup_sack, pcount);
117048 + tcp_sacktag_one(skb, sk, state, 0, pcount);
117049
117050 /* Difference in this won't matter, both ACKed by the same cumul. ACK */
117051 TCP_SKB_CB(prev)->sacked |= (TCP_SKB_CB(skb)->sacked & TCPCB_EVER_RETRANS);
117052 @@ -1562,7 +1561,7 @@
117053
117054 if (!skb_shift(prev, skb, len))
117055 goto fallback;
117056 - if (!tcp_shifted_skb(sk, skb, state, pcount, len, mss, dup_sack))
117057 + if (!tcp_shifted_skb(sk, skb, state, pcount, len, mss))
117058 goto out;
117059
117060 /* Hole filled allows collapsing with the next as well, this is very
117061 @@ -1581,7 +1580,7 @@
117062 len = skb->len;
117063 if (skb_shift(prev, skb, len)) {
117064 pcount += tcp_skb_pcount(skb);
117065 - tcp_shifted_skb(sk, skb, state, tcp_skb_pcount(skb), len, mss, 0);
117066 + tcp_shifted_skb(sk, skb, state, tcp_skb_pcount(skb), len, mss);
117067 }
117068
117069 out:
117070 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/ipv4/tcp_ipv4.c linux-2.6.29-rc3.owrt/net/ipv4/tcp_ipv4.c
117071 --- linux-2.6.29.owrt/net/ipv4/tcp_ipv4.c 2009-05-10 22:04:39.000000000 +0200
117072 +++ linux-2.6.29-rc3.owrt/net/ipv4/tcp_ipv4.c 2009-05-10 23:48:34.000000000 +0200
117073 @@ -2443,7 +2443,7 @@
117074 void __init tcp_v4_init(void)
117075 {
117076 inet_hashinfo_init(&tcp_hashinfo);
117077 - if (register_pernet_subsys(&tcp_sk_ops))
117078 + if (register_pernet_device(&tcp_sk_ops))
117079 panic("Failed to create the TCP control socket.\n");
117080 }
117081
117082 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/ipv4/tcp_output.c linux-2.6.29-rc3.owrt/net/ipv4/tcp_output.c
117083 --- linux-2.6.29.owrt/net/ipv4/tcp_output.c 2009-05-10 22:04:39.000000000 +0200
117084 +++ linux-2.6.29-rc3.owrt/net/ipv4/tcp_output.c 2009-05-10 23:48:34.000000000 +0200
117085 @@ -663,10 +663,14 @@
117086 th->urg_ptr = 0;
117087
117088 /* The urg_mode check is necessary during a below snd_una win probe */
117089 - if (unlikely(tcp_urg_mode(tp) &&
117090 - between(tp->snd_up, tcb->seq + 1, tcb->seq + 0xFFFF))) {
117091 - th->urg_ptr = htons(tp->snd_up - tcb->seq);
117092 - th->urg = 1;
117093 + if (unlikely(tcp_urg_mode(tp))) {
117094 + if (between(tp->snd_up, tcb->seq + 1, tcb->seq + 0xFFFF)) {
117095 + th->urg_ptr = htons(tp->snd_up - tcb->seq);
117096 + th->urg = 1;
117097 + } else if (after(tcb->seq + 0xFFFF, tp->snd_nxt)) {
117098 + th->urg_ptr = 0xFFFF;
117099 + th->urg = 1;
117100 + }
117101 }
117102
117103 tcp_options_write((__be32 *)(th + 1), tp, &opts, &md5_hash_location);
117104 @@ -2023,6 +2027,7 @@
117105 last_lost = tp->snd_una;
117106 }
117107
117108 + /* First pass: retransmit lost packets. */
117109 tcp_for_write_queue_from(skb, sk) {
117110 __u8 sacked = TCP_SKB_CB(skb)->sacked;
117111
117112 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/ipv4/tcp_scalable.c linux-2.6.29-rc3.owrt/net/ipv4/tcp_scalable.c
117113 --- linux-2.6.29.owrt/net/ipv4/tcp_scalable.c 2009-05-10 22:04:39.000000000 +0200
117114 +++ linux-2.6.29-rc3.owrt/net/ipv4/tcp_scalable.c 2009-05-10 23:48:34.000000000 +0200
117115 @@ -1,6 +1,6 @@
117116 /* Tom Kelly's Scalable TCP
117117 *
117118 - * See http://www.deneholme.net/tom/scalable/
117119 + * See htt://www-lce.eng.cam.ac.uk/~ctk21/scalable/
117120 *
117121 * John Heffner <jheffner@sc.edu>
117122 */
117123 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/ipv4/udp.c linux-2.6.29-rc3.owrt/net/ipv4/udp.c
117124 --- linux-2.6.29.owrt/net/ipv4/udp.c 2009-05-10 22:04:39.000000000 +0200
117125 +++ linux-2.6.29-rc3.owrt/net/ipv4/udp.c 2009-05-10 23:48:34.000000000 +0200
117126 @@ -120,11 +120,8 @@
117127 atomic_t udp_memory_allocated;
117128 EXPORT_SYMBOL(udp_memory_allocated);
117129
117130 -#define PORTS_PER_CHAIN (65536 / UDP_HTABLE_SIZE)
117131 -
117132 static int udp_lib_lport_inuse(struct net *net, __u16 num,
117133 const struct udp_hslot *hslot,
117134 - unsigned long *bitmap,
117135 struct sock *sk,
117136 int (*saddr_comp)(const struct sock *sk1,
117137 const struct sock *sk2))
117138 @@ -135,17 +132,12 @@
117139 sk_nulls_for_each(sk2, node, &hslot->head)
117140 if (net_eq(sock_net(sk2), net) &&
117141 sk2 != sk &&
117142 - (bitmap || sk2->sk_hash == num) &&
117143 + sk2->sk_hash == num &&
117144 (!sk2->sk_reuse || !sk->sk_reuse) &&
117145 (!sk2->sk_bound_dev_if || !sk->sk_bound_dev_if
117146 || sk2->sk_bound_dev_if == sk->sk_bound_dev_if) &&
117147 - (*saddr_comp)(sk, sk2)) {
117148 - if (bitmap)
117149 - __set_bit(sk2->sk_hash / UDP_HTABLE_SIZE,
117150 - bitmap);
117151 - else
117152 - return 1;
117153 - }
117154 + (*saddr_comp)(sk, sk2))
117155 + return 1;
117156 return 0;
117157 }
117158
117159 @@ -168,47 +160,32 @@
117160 if (!snum) {
117161 int low, high, remaining;
117162 unsigned rand;
117163 - unsigned short first, last;
117164 - DECLARE_BITMAP(bitmap, PORTS_PER_CHAIN);
117165 + unsigned short first;
117166
117167 inet_get_local_port_range(&low, &high);
117168 remaining = (high - low) + 1;
117169
117170 rand = net_random();
117171 - first = (((u64)rand * remaining) >> 32) + low;
117172 - /*
117173 - * force rand to be an odd multiple of UDP_HTABLE_SIZE
117174 - */
117175 - rand = (rand | 1) * UDP_HTABLE_SIZE;
117176 - for (last = first + UDP_HTABLE_SIZE; first != last; first++) {
117177 - hslot = &udptable->hash[udp_hashfn(net, first)];
117178 - bitmap_zero(bitmap, PORTS_PER_CHAIN);
117179 + snum = first = rand % remaining + low;
117180 + rand |= 1;
117181 + for (;;) {
117182 + hslot = &udptable->hash[udp_hashfn(net, snum)];
117183 spin_lock_bh(&hslot->lock);
117184 - udp_lib_lport_inuse(net, snum, hslot, bitmap, sk,
117185 - saddr_comp);
117186 -
117187 - snum = first;
117188 - /*
117189 - * Iterate on all possible values of snum for this hash.
117190 - * Using steps of an odd multiple of UDP_HTABLE_SIZE
117191 - * give us randomization and full range coverage.
117192 - */
117193 - do {
117194 - if (low <= snum && snum <= high &&
117195 - !test_bit(snum / UDP_HTABLE_SIZE, bitmap))
117196 - goto found;
117197 - snum += rand;
117198 - } while (snum != first);
117199 + if (!udp_lib_lport_inuse(net, snum, hslot, sk, saddr_comp))
117200 + break;
117201 spin_unlock_bh(&hslot->lock);
117202 + do {
117203 + snum = snum + rand;
117204 + } while (snum < low || snum > high);
117205 + if (snum == first)
117206 + goto fail;
117207 }
117208 - goto fail;
117209 } else {
117210 hslot = &udptable->hash[udp_hashfn(net, snum)];
117211 spin_lock_bh(&hslot->lock);
117212 - if (udp_lib_lport_inuse(net, snum, hslot, NULL, sk, saddr_comp))
117213 + if (udp_lib_lport_inuse(net, snum, hslot, sk, saddr_comp))
117214 goto fail_unlock;
117215 }
117216 -found:
117217 inet_sk(sk)->num = snum;
117218 sk->sk_hash = snum;
117219 if (sk_unhashed(sk)) {
117220 @@ -1015,11 +992,9 @@
117221
117222 if ((rc = sock_queue_rcv_skb(sk, skb)) < 0) {
117223 /* Note that an ENOMEM error is charged twice */
117224 - if (rc == -ENOMEM) {
117225 + if (rc == -ENOMEM)
117226 UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_RCVBUFERRORS,
117227 is_udplite);
117228 - atomic_inc(&sk->sk_drops);
117229 - }
117230 goto drop;
117231 }
117232
117233 @@ -1231,10 +1206,11 @@
117234 int proto)
117235 {
117236 struct sock *sk;
117237 - struct udphdr *uh;
117238 + struct udphdr *uh = udp_hdr(skb);
117239 unsigned short ulen;
117240 struct rtable *rt = (struct rtable*)skb->dst;
117241 - __be32 saddr, daddr;
117242 + __be32 saddr = ip_hdr(skb)->saddr;
117243 + __be32 daddr = ip_hdr(skb)->daddr;
117244 struct net *net = dev_net(skb->dev);
117245
117246 /*
117247 @@ -1243,7 +1219,6 @@
117248 if (!pskb_may_pull(skb, sizeof(struct udphdr)))
117249 goto drop; /* No space for header. */
117250
117251 - uh = udp_hdr(skb);
117252 ulen = ntohs(uh->len);
117253 if (ulen > skb->len)
117254 goto short_packet;
117255 @@ -1258,9 +1233,6 @@
117256 if (udp4_csum_init(skb, uh, proto))
117257 goto csum_error;
117258
117259 - saddr = ip_hdr(skb)->saddr;
117260 - daddr = ip_hdr(skb)->daddr;
117261 -
117262 if (rt->rt_flags & (RTCF_BROADCAST|RTCF_MULTICAST))
117263 return __udp4_lib_mcast_deliver(net, skb, uh,
117264 saddr, daddr, udptable);
117265 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/ipv6/addrconf.c linux-2.6.29-rc3.owrt/net/ipv6/addrconf.c
117266 --- linux-2.6.29.owrt/net/ipv6/addrconf.c 2009-05-10 22:04:39.000000000 +0200
117267 +++ linux-2.6.29-rc3.owrt/net/ipv6/addrconf.c 2009-05-10 23:48:34.000000000 +0200
117268 @@ -493,17 +493,15 @@
117269 read_unlock(&dev_base_lock);
117270 }
117271
117272 -static int addrconf_fixup_forwarding(struct ctl_table *table, int *p, int old)
117273 +static void addrconf_fixup_forwarding(struct ctl_table *table, int *p, int old)
117274 {
117275 struct net *net;
117276
117277 net = (struct net *)table->extra2;
117278 if (p == &net->ipv6.devconf_dflt->forwarding)
117279 - return 0;
117280 -
117281 - if (!rtnl_trylock())
117282 - return -ERESTARTSYS;
117283 + return;
117284
117285 + rtnl_lock();
117286 if (p == &net->ipv6.devconf_all->forwarding) {
117287 __s32 newf = net->ipv6.devconf_all->forwarding;
117288 net->ipv6.devconf_dflt->forwarding = newf;
117289 @@ -514,7 +512,6 @@
117290
117291 if (*p)
117292 rt6_purge_dflt_routers(net);
117293 - return 1;
117294 }
117295 #endif
117296
117297 @@ -2611,6 +2608,9 @@
117298
117299 ASSERT_RTNL();
117300
117301 + if ((dev->flags & IFF_LOOPBACK) && how == 1)
117302 + how = 0;
117303 +
117304 rt6_ifdown(net, dev);
117305 neigh_ifdown(&nd_tbl, dev);
117306
117307 @@ -3983,7 +3983,7 @@
117308 ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos);
117309
117310 if (write)
117311 - ret = addrconf_fixup_forwarding(ctl, valp, val);
117312 + addrconf_fixup_forwarding(ctl, valp, val);
117313 return ret;
117314 }
117315
117316 @@ -4019,7 +4019,8 @@
117317 }
117318
117319 *valp = new;
117320 - return addrconf_fixup_forwarding(table, valp, val);
117321 + addrconf_fixup_forwarding(table, valp, val);
117322 + return 1;
117323 }
117324
117325 static struct addrconf_sysctl_table
117326 @@ -4249,7 +4250,7 @@
117327 .procname = "mc_forwarding",
117328 .data = &ipv6_devconf.mc_forwarding,
117329 .maxlen = sizeof(int),
117330 - .mode = 0444,
117331 + .mode = 0644,
117332 .proc_handler = proc_dointvec,
117333 },
117334 #endif
117335 @@ -4445,6 +4446,25 @@
117336
117337 EXPORT_SYMBOL(unregister_inet6addr_notifier);
117338
117339 +static void addrconf_net_exit(struct net *net)
117340 +{
117341 + struct net_device *dev;
117342 +
117343 + rtnl_lock();
117344 + /* clean dev list */
117345 + for_each_netdev(net, dev) {
117346 + if (__in6_dev_get(dev) == NULL)
117347 + continue;
117348 + addrconf_ifdown(dev, 1);
117349 + }
117350 + addrconf_ifdown(net->loopback_dev, 2);
117351 + rtnl_unlock();
117352 +}
117353 +
117354 +static struct pernet_operations addrconf_net_ops = {
117355 + .exit = addrconf_net_exit,
117356 +};
117357 +
117358 /*
117359 * Init / cleanup code
117360 */
117361 @@ -4486,6 +4506,10 @@
117362 if (err)
117363 goto errlo;
117364
117365 + err = register_pernet_device(&addrconf_net_ops);
117366 + if (err)
117367 + return err;
117368 +
117369 register_netdevice_notifier(&ipv6_dev_notf);
117370
117371 addrconf_verify(0);
117372 @@ -4515,22 +4539,15 @@
117373 void addrconf_cleanup(void)
117374 {
117375 struct inet6_ifaddr *ifa;
117376 - struct net_device *dev;
117377 int i;
117378
117379 unregister_netdevice_notifier(&ipv6_dev_notf);
117380 + unregister_pernet_device(&addrconf_net_ops);
117381 +
117382 unregister_pernet_subsys(&addrconf_ops);
117383
117384 rtnl_lock();
117385
117386 - /* clean dev list */
117387 - for_each_netdev(&init_net, dev) {
117388 - if (__in6_dev_get(dev) == NULL)
117389 - continue;
117390 - addrconf_ifdown(dev, 1);
117391 - }
117392 - addrconf_ifdown(init_net.loopback_dev, 2);
117393 -
117394 /*
117395 * Check hash table.
117396 */
117397 @@ -4551,4 +4568,6 @@
117398
117399 del_timer(&addr_chk_timer);
117400 rtnl_unlock();
117401 +
117402 + unregister_pernet_subsys(&addrconf_net_ops);
117403 }
117404 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/ipv6/af_inet6.c linux-2.6.29-rc3.owrt/net/ipv6/af_inet6.c
117405 --- linux-2.6.29.owrt/net/ipv6/af_inet6.c 2009-05-10 22:04:39.000000000 +0200
117406 +++ linux-2.6.29-rc3.owrt/net/ipv6/af_inet6.c 2009-05-10 23:48:34.000000000 +0200
117407 @@ -72,10 +72,6 @@
117408 static struct list_head inetsw6[SOCK_MAX];
117409 static DEFINE_SPINLOCK(inetsw6_lock);
117410
117411 -static int disable_ipv6 = 0;
117412 -module_param_named(disable, disable_ipv6, int, 0);
117413 -MODULE_PARM_DESC(disable, "Disable IPv6 such that it is non-functional");
117414 -
117415 static __inline__ struct ipv6_pinfo *inet6_sk_generic(struct sock *sk)
117416 {
117417 const int offset = sk->sk_prot->obj_size - sizeof(struct ipv6_pinfo);
117418 @@ -995,21 +991,10 @@
117419 {
117420 struct sk_buff *dummy_skb;
117421 struct list_head *r;
117422 - int err = 0;
117423 + int err;
117424
117425 BUILD_BUG_ON(sizeof(struct inet6_skb_parm) > sizeof(dummy_skb->cb));
117426
117427 - /* Register the socket-side information for inet6_create. */
117428 - for(r = &inetsw6[0]; r < &inetsw6[SOCK_MAX]; ++r)
117429 - INIT_LIST_HEAD(r);
117430 -
117431 - if (disable_ipv6) {
117432 - printk(KERN_INFO
117433 - "IPv6: Loaded, but administratively disabled, "
117434 - "reboot required to enable\n");
117435 - goto out;
117436 - }
117437 -
117438 err = proto_register(&tcpv6_prot, 1);
117439 if (err)
117440 goto out;
117441 @@ -1027,6 +1012,10 @@
117442 goto out_unregister_udplite_proto;
117443
117444
117445 + /* Register the socket-side information for inet6_create. */
117446 + for(r = &inetsw6[0]; r < &inetsw6[SOCK_MAX]; ++r)
117447 + INIT_LIST_HEAD(r);
117448 +
117449 /* We MUST register RAW sockets before we create the ICMP6,
117450 * IGMP6, or NDISC control sockets.
117451 */
117452 @@ -1192,9 +1181,6 @@
117453
117454 static void __exit inet6_exit(void)
117455 {
117456 - if (disable_ipv6)
117457 - return;
117458 -
117459 /* First of all disallow new sockets creation. */
117460 sock_unregister(PF_INET6);
117461 /* Disallow any further netlink messages */
117462 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/ipv6/icmp.c linux-2.6.29-rc3.owrt/net/ipv6/icmp.c
117463 --- linux-2.6.29.owrt/net/ipv6/icmp.c 2009-05-10 22:04:39.000000000 +0200
117464 +++ linux-2.6.29-rc3.owrt/net/ipv6/icmp.c 2009-05-10 23:48:34.000000000 +0200
117465 @@ -443,10 +443,10 @@
117466 if (xfrm_decode_session_reverse(skb, &fl2, AF_INET6))
117467 goto relookup_failed;
117468
117469 - if (ip6_dst_lookup(sk, &dst2, &fl2))
117470 + if (ip6_dst_lookup(sk, &dst2, &fl))
117471 goto relookup_failed;
117472
117473 - err = xfrm_lookup(net, &dst2, &fl2, sk, XFRM_LOOKUP_ICMP);
117474 + err = xfrm_lookup(net, &dst2, &fl, sk, XFRM_LOOKUP_ICMP);
117475 switch (err) {
117476 case 0:
117477 dst_release(dst);
117478 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/ipv6/inet6_hashtables.c linux-2.6.29-rc3.owrt/net/ipv6/inet6_hashtables.c
117479 --- linux-2.6.29.owrt/net/ipv6/inet6_hashtables.c 2009-05-10 22:04:39.000000000 +0200
117480 +++ linux-2.6.29-rc3.owrt/net/ipv6/inet6_hashtables.c 2009-05-10 23:48:34.000000000 +0200
117481 @@ -258,11 +258,11 @@
117482
117483 if (twp != NULL) {
117484 *twp = tw;
117485 - NET_INC_STATS_BH(net, LINUX_MIB_TIMEWAITRECYCLED);
117486 + NET_INC_STATS_BH(twsk_net(tw), LINUX_MIB_TIMEWAITRECYCLED);
117487 } else if (tw != NULL) {
117488 /* Silly. Should hash-dance instead... */
117489 inet_twsk_deschedule(tw, death_row);
117490 - NET_INC_STATS_BH(net, LINUX_MIB_TIMEWAITRECYCLED);
117491 + NET_INC_STATS_BH(twsk_net(tw), LINUX_MIB_TIMEWAITRECYCLED);
117492
117493 inet_twsk_put(tw);
117494 }
117495 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/ipv6/ip6_flowlabel.c linux-2.6.29-rc3.owrt/net/ipv6/ip6_flowlabel.c
117496 --- linux-2.6.29.owrt/net/ipv6/ip6_flowlabel.c 2009-05-10 22:04:39.000000000 +0200
117497 +++ linux-2.6.29-rc3.owrt/net/ipv6/ip6_flowlabel.c 2009-05-10 23:48:34.000000000 +0200
117498 @@ -323,21 +323,17 @@
117499 fl_create(struct net *net, struct in6_flowlabel_req *freq, char __user *optval,
117500 int optlen, int *err_p)
117501 {
117502 - struct ip6_flowlabel *fl = NULL;
117503 + struct ip6_flowlabel *fl;
117504 int olen;
117505 int addr_type;
117506 int err;
117507
117508 - olen = optlen - CMSG_ALIGN(sizeof(*freq));
117509 - err = -EINVAL;
117510 - if (olen > 64 * 1024)
117511 - goto done;
117512 -
117513 err = -ENOMEM;
117514 fl = kzalloc(sizeof(*fl), GFP_KERNEL);
117515 if (fl == NULL)
117516 goto done;
117517
117518 + olen = optlen - CMSG_ALIGN(sizeof(*freq));
117519 if (olen > 0) {
117520 struct msghdr msg;
117521 struct flowi flowi;
117522 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/ipv6/ip6_input.c linux-2.6.29-rc3.owrt/net/ipv6/ip6_input.c
117523 --- linux-2.6.29.owrt/net/ipv6/ip6_input.c 2009-05-10 22:04:39.000000000 +0200
117524 +++ linux-2.6.29-rc3.owrt/net/ipv6/ip6_input.c 2009-05-10 23:48:34.000000000 +0200
117525 @@ -255,7 +255,6 @@
117526 * IPv6 multicast router mode is now supported ;)
117527 */
117528 if (dev_net(skb->dev)->ipv6.devconf_all->mc_forwarding &&
117529 - !(ipv6_addr_type(&hdr->daddr) & IPV6_ADDR_LINKLOCAL) &&
117530 likely(!(IP6CB(skb)->flags & IP6SKB_FORWARDED))) {
117531 /*
117532 * Okay, we try to forward - split and duplicate
117533 @@ -317,6 +316,7 @@
117534 }
117535
117536 if (skb2) {
117537 + skb2->dev = skb2->dst->dev;
117538 ip6_mr_input(skb2);
117539 }
117540 }
117541 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/ipv6/ip6mr.c linux-2.6.29-rc3.owrt/net/ipv6/ip6mr.c
117542 --- linux-2.6.29.owrt/net/ipv6/ip6mr.c 2009-05-10 22:04:39.000000000 +0200
117543 +++ linux-2.6.29-rc3.owrt/net/ipv6/ip6mr.c 2009-05-10 23:48:34.000000000 +0200
117544 @@ -48,7 +48,6 @@
117545 #include <linux/pim.h>
117546 #include <net/addrconf.h>
117547 #include <linux/netfilter_ipv6.h>
117548 -#include <net/ip6_checksum.h>
117549
117550 /* Big lock, protecting vif table, mrt cache and mroute socket state.
117551 Note that the changes are semaphored via rtnl_lock.
117552 @@ -366,9 +365,7 @@
117553 pim = (struct pimreghdr *)skb_transport_header(skb);
117554 if (pim->type != ((PIM_VERSION << 4) | PIM_REGISTER) ||
117555 (pim->flags & PIM_NULL_REGISTER) ||
117556 - (csum_ipv6_magic(&ipv6_hdr(skb)->saddr, &ipv6_hdr(skb)->daddr,
117557 - sizeof(*pim), IPPROTO_PIM,
117558 - csum_partial((void *)pim, sizeof(*pim), 0)) &&
117559 + (ip_compute_csum((void *)pim, sizeof(*pim)) != 0 &&
117560 csum_fold(skb_checksum(skb, 0, skb->len, 0))))
117561 goto drop;
117562
117563 @@ -395,7 +392,7 @@
117564 skb_pull(skb, (u8 *)encap - skb->data);
117565 skb_reset_network_header(skb);
117566 skb->dev = reg_dev;
117567 - skb->protocol = htons(ETH_P_IPV6);
117568 + skb->protocol = htons(ETH_P_IP);
117569 skb->ip_summed = 0;
117570 skb->pkt_type = PACKET_HOST;
117571 dst_release(skb->dst);
117572 @@ -484,7 +481,6 @@
117573 {
117574 struct mif_device *v;
117575 struct net_device *dev;
117576 - struct inet6_dev *in6_dev;
117577 if (vifi < 0 || vifi >= net->ipv6.maxvif)
117578 return -EADDRNOTAVAIL;
117579
117580 @@ -517,10 +513,6 @@
117581
117582 dev_set_allmulti(dev, -1);
117583
117584 - in6_dev = __in6_dev_get(dev);
117585 - if (in6_dev)
117586 - in6_dev->cnf.mc_forwarding--;
117587 -
117588 if (v->flags & MIFF_REGISTER)
117589 unregister_netdevice(dev);
117590
117591 @@ -630,7 +622,6 @@
117592 int vifi = vifc->mif6c_mifi;
117593 struct mif_device *v = &net->ipv6.vif6_table[vifi];
117594 struct net_device *dev;
117595 - struct inet6_dev *in6_dev;
117596 int err;
117597
117598 /* Is vif busy ? */
117599 @@ -671,10 +662,6 @@
117600 return -EINVAL;
117601 }
117602
117603 - in6_dev = __in6_dev_get(dev);
117604 - if (in6_dev)
117605 - in6_dev->cnf.mc_forwarding++;
117606 -
117607 /*
117608 * Fill in the VIF structures
117609 */
117610 @@ -851,6 +838,8 @@
117611
117612 skb->dst = dst_clone(pkt->dst);
117613 skb->ip_summed = CHECKSUM_UNNECESSARY;
117614 +
117615 + skb_pull(skb, sizeof(struct ipv6hdr));
117616 }
117617
117618 if (net->ipv6.mroute6_sk == NULL) {
117619 @@ -1233,10 +1222,8 @@
117620
117621 rtnl_lock();
117622 write_lock_bh(&mrt_lock);
117623 - if (likely(net->ipv6.mroute6_sk == NULL)) {
117624 + if (likely(net->ipv6.mroute6_sk == NULL))
117625 net->ipv6.mroute6_sk = sk;
117626 - net->ipv6.devconf_all->mc_forwarding++;
117627 - }
117628 else
117629 err = -EADDRINUSE;
117630 write_unlock_bh(&mrt_lock);
117631 @@ -1255,7 +1242,6 @@
117632 if (sk == net->ipv6.mroute6_sk) {
117633 write_lock_bh(&mrt_lock);
117634 net->ipv6.mroute6_sk = NULL;
117635 - net->ipv6.devconf_all->mc_forwarding--;
117636 write_unlock_bh(&mrt_lock);
117637
117638 mroute_clean_tables(net);
117639 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/ipv6/ip6_output.c linux-2.6.29-rc3.owrt/net/ipv6/ip6_output.c
117640 --- linux-2.6.29.owrt/net/ipv6/ip6_output.c 2009-05-10 22:04:39.000000000 +0200
117641 +++ linux-2.6.29-rc3.owrt/net/ipv6/ip6_output.c 2009-05-10 23:48:34.000000000 +0200
117642 @@ -1105,18 +1105,6 @@
117643 return err;
117644 }
117645
117646 -static inline struct ipv6_opt_hdr *ip6_opt_dup(struct ipv6_opt_hdr *src,
117647 - gfp_t gfp)
117648 -{
117649 - return src ? kmemdup(src, (src->hdrlen + 1) * 8, gfp) : NULL;
117650 -}
117651 -
117652 -static inline struct ipv6_rt_hdr *ip6_rthdr_dup(struct ipv6_rt_hdr *src,
117653 - gfp_t gfp)
117654 -{
117655 - return src ? kmemdup(src, (src->hdrlen + 1) * 8, gfp) : NULL;
117656 -}
117657 -
117658 int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to,
117659 int offset, int len, int odd, struct sk_buff *skb),
117660 void *from, int length, int transhdrlen,
117661 @@ -1142,37 +1130,17 @@
117662 * setup for corking
117663 */
117664 if (opt) {
117665 - if (WARN_ON(np->cork.opt))
117666 + if (np->cork.opt == NULL) {
117667 + np->cork.opt = kmalloc(opt->tot_len,
117668 + sk->sk_allocation);
117669 + if (unlikely(np->cork.opt == NULL))
117670 + return -ENOBUFS;
117671 + } else if (np->cork.opt->tot_len < opt->tot_len) {
117672 + printk(KERN_DEBUG "ip6_append_data: invalid option length\n");
117673 return -EINVAL;
117674 -
117675 - np->cork.opt = kmalloc(opt->tot_len, sk->sk_allocation);
117676 - if (unlikely(np->cork.opt == NULL))
117677 - return -ENOBUFS;
117678 -
117679 - np->cork.opt->tot_len = opt->tot_len;
117680 - np->cork.opt->opt_flen = opt->opt_flen;
117681 - np->cork.opt->opt_nflen = opt->opt_nflen;
117682 -
117683 - np->cork.opt->dst0opt = ip6_opt_dup(opt->dst0opt,
117684 - sk->sk_allocation);
117685 - if (opt->dst0opt && !np->cork.opt->dst0opt)
117686 - return -ENOBUFS;
117687 -
117688 - np->cork.opt->dst1opt = ip6_opt_dup(opt->dst1opt,
117689 - sk->sk_allocation);
117690 - if (opt->dst1opt && !np->cork.opt->dst1opt)
117691 - return -ENOBUFS;
117692 -
117693 - np->cork.opt->hopopt = ip6_opt_dup(opt->hopopt,
117694 - sk->sk_allocation);
117695 - if (opt->hopopt && !np->cork.opt->hopopt)
117696 - return -ENOBUFS;
117697 -
117698 - np->cork.opt->srcrt = ip6_rthdr_dup(opt->srcrt,
117699 - sk->sk_allocation);
117700 - if (opt->srcrt && !np->cork.opt->srcrt)
117701 - return -ENOBUFS;
117702 -
117703 + }
117704 + memcpy(np->cork.opt, opt, opt->tot_len);
117705 + inet->cork.flags |= IPCORK_OPT;
117706 /* need source address above miyazawa*/
117707 }
117708 dst_hold(&rt->u.dst);
117709 @@ -1199,7 +1167,8 @@
117710 } else {
117711 rt = (struct rt6_info *)inet->cork.dst;
117712 fl = &inet->cork.fl;
117713 - opt = np->cork.opt;
117714 + if (inet->cork.flags & IPCORK_OPT)
117715 + opt = np->cork.opt;
117716 transhdrlen = 0;
117717 exthdrlen = 0;
117718 mtu = inet->cork.fragsize;
117719 @@ -1438,15 +1407,9 @@
117720
117721 static void ip6_cork_release(struct inet_sock *inet, struct ipv6_pinfo *np)
117722 {
117723 - if (np->cork.opt) {
117724 - kfree(np->cork.opt->dst0opt);
117725 - kfree(np->cork.opt->dst1opt);
117726 - kfree(np->cork.opt->hopopt);
117727 - kfree(np->cork.opt->srcrt);
117728 - kfree(np->cork.opt);
117729 - np->cork.opt = NULL;
117730 - }
117731 -
117732 + inet->cork.flags &= ~IPCORK_OPT;
117733 + kfree(np->cork.opt);
117734 + np->cork.opt = NULL;
117735 if (inet->cork.dst) {
117736 dst_release(inet->cork.dst);
117737 inet->cork.dst = NULL;
117738 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/ipv6/ip6_tunnel.c linux-2.6.29-rc3.owrt/net/ipv6/ip6_tunnel.c
117739 --- linux-2.6.29.owrt/net/ipv6/ip6_tunnel.c 2009-05-10 22:04:39.000000000 +0200
117740 +++ linux-2.6.29-rc3.owrt/net/ipv6/ip6_tunnel.c 2009-05-10 23:48:34.000000000 +0200
117741 @@ -249,8 +249,8 @@
117742 }
117743
117744 t = netdev_priv(dev);
117745 - t->parms = *p;
117746 ip6_tnl_dev_init(dev);
117747 + t->parms = *p;
117748
117749 if ((err = register_netdevice(dev)) < 0)
117750 goto failed_free;
117751 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c linux-2.6.29-rc3.owrt/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
117752 --- linux-2.6.29.owrt/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c 2009-05-10 22:04:39.000000000 +0200
117753 +++ linux-2.6.29-rc3.owrt/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c 2009-05-10 23:48:34.000000000 +0200
117754 @@ -49,19 +49,8 @@
117755 static const u_int8_t invmap[] = {
117756 [ICMPV6_ECHO_REQUEST - 128] = ICMPV6_ECHO_REPLY + 1,
117757 [ICMPV6_ECHO_REPLY - 128] = ICMPV6_ECHO_REQUEST + 1,
117758 - [ICMPV6_NI_QUERY - 128] = ICMPV6_NI_REPLY + 1,
117759 - [ICMPV6_NI_REPLY - 128] = ICMPV6_NI_QUERY +1
117760 -};
117761 -
117762 -static const u_int8_t noct_valid_new[] = {
117763 - [ICMPV6_MGM_QUERY - 130] = 1,
117764 - [ICMPV6_MGM_REPORT -130] = 1,
117765 - [ICMPV6_MGM_REDUCTION - 130] = 1,
117766 - [NDISC_ROUTER_SOLICITATION - 130] = 1,
117767 - [NDISC_ROUTER_ADVERTISEMENT - 130] = 1,
117768 - [NDISC_NEIGHBOUR_SOLICITATION - 130] = 1,
117769 - [NDISC_NEIGHBOUR_ADVERTISEMENT - 130] = 1,
117770 - [ICMPV6_MLD2_REPORT - 130] = 1
117771 + [ICMPV6_NI_QUERY - 128] = ICMPV6_NI_QUERY + 1,
117772 + [ICMPV6_NI_REPLY - 128] = ICMPV6_NI_REPLY +1
117773 };
117774
117775 static bool icmpv6_invert_tuple(struct nf_conntrack_tuple *tuple,
117776 @@ -189,7 +178,6 @@
117777 {
117778 const struct icmp6hdr *icmp6h;
117779 struct icmp6hdr _ih;
117780 - int type;
117781
117782 icmp6h = skb_header_pointer(skb, dataoff, sizeof(_ih), &_ih);
117783 if (icmp6h == NULL) {
117784 @@ -201,21 +189,11 @@
117785
117786 if (net->ct.sysctl_checksum && hooknum == NF_INET_PRE_ROUTING &&
117787 nf_ip6_checksum(skb, hooknum, dataoff, IPPROTO_ICMPV6)) {
117788 - if (LOG_INVALID(net, IPPROTO_ICMPV6))
117789 - nf_log_packet(PF_INET6, 0, skb, NULL, NULL, NULL,
117790 - "nf_ct_icmpv6: ICMPv6 checksum failed ");
117791 + nf_log_packet(PF_INET6, 0, skb, NULL, NULL, NULL,
117792 + "nf_ct_icmpv6: ICMPv6 checksum failed\n");
117793 return -NF_ACCEPT;
117794 }
117795
117796 - type = icmp6h->icmp6_type - 130;
117797 - if (type >= 0 && type < sizeof(noct_valid_new) &&
117798 - noct_valid_new[type]) {
117799 - skb->nfct = &nf_conntrack_untracked.ct_general;
117800 - skb->nfctinfo = IP_CT_NEW;
117801 - nf_conntrack_get(skb->nfct);
117802 - return NF_ACCEPT;
117803 - }
117804 -
117805 /* is not error message ? */
117806 if (icmp6h->icmp6_type >= 128)
117807 return NF_ACCEPT;
117808 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/ipv6/netfilter/nf_conntrack_reasm.c linux-2.6.29-rc3.owrt/net/ipv6/netfilter/nf_conntrack_reasm.c
117809 --- linux-2.6.29.owrt/net/ipv6/netfilter/nf_conntrack_reasm.c 2009-05-10 22:04:39.000000000 +0200
117810 +++ linux-2.6.29-rc3.owrt/net/ipv6/netfilter/nf_conntrack_reasm.c 2009-05-10 23:48:34.000000000 +0200
117811 @@ -528,14 +528,14 @@
117812 if (!ipv6_ext_hdr(nexthdr)) {
117813 return -1;
117814 }
117815 - if (nexthdr == NEXTHDR_NONE) {
117816 - pr_debug("next header is none\n");
117817 - return -1;
117818 - }
117819 if (len < (int)sizeof(struct ipv6_opt_hdr)) {
117820 pr_debug("too short\n");
117821 return -1;
117822 }
117823 + if (nexthdr == NEXTHDR_NONE) {
117824 + pr_debug("next header is none\n");
117825 + return -1;
117826 + }
117827 if (skb_copy_bits(skb, start, &hdr, sizeof(hdr)))
117828 BUG();
117829 if (nexthdr == NEXTHDR_AUTH)
117830 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/ipv6/reassembly.c linux-2.6.29-rc3.owrt/net/ipv6/reassembly.c
117831 --- linux-2.6.29.owrt/net/ipv6/reassembly.c 2009-05-10 22:04:39.000000000 +0200
117832 +++ linux-2.6.29-rc3.owrt/net/ipv6/reassembly.c 2009-05-10 23:48:34.000000000 +0200
117833 @@ -452,7 +452,6 @@
117834 static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev,
117835 struct net_device *dev)
117836 {
117837 - struct net *net = container_of(fq->q.net, struct net, ipv6.frags);
117838 struct sk_buff *fp, *head = fq->q.fragments;
117839 int payload_len;
117840 unsigned int nhoff;
117841 @@ -552,7 +551,8 @@
117842 head->csum);
117843
117844 rcu_read_lock();
117845 - IP6_INC_STATS_BH(net, __in6_dev_get(dev), IPSTATS_MIB_REASMOKS);
117846 + IP6_INC_STATS_BH(dev_net(dev),
117847 + __in6_dev_get(dev), IPSTATS_MIB_REASMOKS);
117848 rcu_read_unlock();
117849 fq->q.fragments = NULL;
117850 return 1;
117851 @@ -566,7 +566,8 @@
117852 printk(KERN_DEBUG "ip6_frag_reasm: no memory for reassembly\n");
117853 out_fail:
117854 rcu_read_lock();
117855 - IP6_INC_STATS_BH(net, __in6_dev_get(dev), IPSTATS_MIB_REASMFAILS);
117856 + IP6_INC_STATS_BH(dev_net(dev),
117857 + __in6_dev_get(dev), IPSTATS_MIB_REASMFAILS);
117858 rcu_read_unlock();
117859 return -1;
117860 }
117861 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/ipv6/route.c linux-2.6.29-rc3.owrt/net/ipv6/route.c
117862 --- linux-2.6.29.owrt/net/ipv6/route.c 2009-05-10 22:04:39.000000000 +0200
117863 +++ linux-2.6.29-rc3.owrt/net/ipv6/route.c 2009-05-10 23:48:34.000000000 +0200
117864 @@ -794,7 +794,7 @@
117865 .proto = iph->nexthdr,
117866 };
117867
117868 - if (rt6_need_strict(&iph->daddr) && skb->dev->type != ARPHRD_PIMREG)
117869 + if (rt6_need_strict(&iph->daddr))
117870 flags |= RT6_LOOKUP_F_IFACE;
117871
117872 skb->dst = fib6_rule_lookup(net, &fl, flags, ip6_pol_route_input);
117873 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/ipv6/sit.c linux-2.6.29-rc3.owrt/net/ipv6/sit.c
117874 --- linux-2.6.29.owrt/net/ipv6/sit.c 2009-05-10 22:04:39.000000000 +0200
117875 +++ linux-2.6.29-rc3.owrt/net/ipv6/sit.c 2009-05-10 23:48:34.000000000 +0200
117876 @@ -188,9 +188,9 @@
117877 }
117878
117879 nt = netdev_priv(dev);
117880 + ipip6_tunnel_init(dev);
117881
117882 nt->parms = *parms;
117883 - ipip6_tunnel_init(dev);
117884
117885 if (parms->i_flags & SIT_ISATAP)
117886 dev->priv_flags |= IFF_ISATAP;
117887 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/mac80211/tx.c linux-2.6.29-rc3.owrt/net/mac80211/tx.c
117888 --- linux-2.6.29.owrt/net/mac80211/tx.c 2009-05-10 22:04:39.000000000 +0200
117889 +++ linux-2.6.29-rc3.owrt/net/mac80211/tx.c 2009-05-10 23:48:34.000000000 +0200
117890 @@ -752,8 +752,6 @@
117891 skb_copy_queue_mapping(frag, first);
117892
117893 frag->do_not_encrypt = first->do_not_encrypt;
117894 - frag->dev = first->dev;
117895 - frag->iif = first->iif;
117896
117897 pos += copylen;
117898 left -= copylen;
117899 @@ -1345,8 +1343,6 @@
117900 list) {
117901 if (!netif_running(sdata->dev))
117902 continue;
117903 - if (sdata->vif.type != NL80211_IFTYPE_AP)
117904 - continue;
117905 if (compare_ether_addr(sdata->dev->dev_addr,
117906 hdr->addr2)) {
117907 dev_hold(sdata->dev);
117908 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/netfilter/nf_conntrack_core.c linux-2.6.29-rc3.owrt/net/netfilter/nf_conntrack_core.c
117909 --- linux-2.6.29.owrt/net/netfilter/nf_conntrack_core.c 2009-05-10 22:04:39.000000000 +0200
117910 +++ linux-2.6.29-rc3.owrt/net/netfilter/nf_conntrack_core.c 2009-05-10 23:48:34.000000000 +0200
117911 @@ -734,7 +734,7 @@
117912 NF_CT_ASSERT(skb->nfct);
117913
117914 ret = l4proto->packet(ct, skb, dataoff, ctinfo, pf, hooknum);
117915 - if (ret <= 0) {
117916 + if (ret < 0) {
117917 /* Invalid: inverse of the return code tells
117918 * the netfilter core what to do */
117919 pr_debug("nf_conntrack_in: Can't track with proto module\n");
117920 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/netfilter/nf_conntrack_netlink.c linux-2.6.29-rc3.owrt/net/netfilter/nf_conntrack_netlink.c
117921 --- linux-2.6.29.owrt/net/netfilter/nf_conntrack_netlink.c 2009-05-10 22:04:39.000000000 +0200
117922 +++ linux-2.6.29-rc3.owrt/net/netfilter/nf_conntrack_netlink.c 2009-05-10 23:48:34.000000000 +0200
117923 @@ -434,7 +434,7 @@
117924 } else
117925 return NOTIFY_DONE;
117926
117927 - if (!item->report && !nfnetlink_has_listeners(group))
117928 + if (!nfnetlink_has_listeners(group))
117929 return NOTIFY_DONE;
117930
117931 skb = alloc_skb(NLMSG_GOODSIZE, GFP_ATOMIC);
117932 @@ -1215,16 +1215,6 @@
117933 }
117934 }
117935
117936 -#ifdef CONFIG_NF_NAT_NEEDED
117937 - if (cda[CTA_NAT_SEQ_ADJ_ORIG] || cda[CTA_NAT_SEQ_ADJ_REPLY]) {
117938 - err = ctnetlink_change_nat_seq_adj(ct, cda);
117939 - if (err < 0) {
117940 - rcu_read_unlock();
117941 - goto err;
117942 - }
117943 - }
117944 -#endif
117945 -
117946 if (cda[CTA_PROTOINFO]) {
117947 err = ctnetlink_change_protoinfo(ct, cda);
117948 if (err < 0) {
117949 @@ -1502,8 +1492,7 @@
117950 } else
117951 return NOTIFY_DONE;
117952
117953 - if (!item->report &&
117954 - !nfnetlink_has_listeners(NFNLGRP_CONNTRACK_EXP_NEW))
117955 + if (!nfnetlink_has_listeners(NFNLGRP_CONNTRACK_EXP_NEW))
117956 return NOTIFY_DONE;
117957
117958 skb = alloc_skb(NLMSG_GOODSIZE, GFP_ATOMIC);
117959 @@ -1780,7 +1769,6 @@
117960 goto out;
117961 }
117962
117963 - exp->class = 0;
117964 exp->expectfn = NULL;
117965 exp->flags = 0;
117966 exp->master = ct;
117967 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/netfilter/nf_conntrack_proto_tcp.c linux-2.6.29-rc3.owrt/net/netfilter/nf_conntrack_proto_tcp.c
117968 --- linux-2.6.29.owrt/net/netfilter/nf_conntrack_proto_tcp.c 2009-05-10 22:04:39.000000000 +0200
117969 +++ linux-2.6.29-rc3.owrt/net/netfilter/nf_conntrack_proto_tcp.c 2009-05-10 23:48:34.000000000 +0200
117970 @@ -859,7 +859,7 @@
117971 */
117972 if (nf_ct_kill(ct))
117973 return -NF_REPEAT;
117974 - return NF_DROP;
117975 + return -NF_DROP;
117976 }
117977 /* Fall through */
117978 case TCP_CONNTRACK_IGNORE:
117979 @@ -892,7 +892,7 @@
117980 nf_log_packet(pf, 0, skb, NULL, NULL, NULL,
117981 "nf_ct_tcp: killing out of sync session ");
117982 nf_ct_kill(ct);
117983 - return NF_DROP;
117984 + return -NF_DROP;
117985 }
117986 ct->proto.tcp.last_index = index;
117987 ct->proto.tcp.last_dir = dir;
117988 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/netfilter/nfnetlink_log.c linux-2.6.29-rc3.owrt/net/netfilter/nfnetlink_log.c
117989 --- linux-2.6.29.owrt/net/netfilter/nfnetlink_log.c 2009-05-10 22:04:39.000000000 +0200
117990 +++ linux-2.6.29-rc3.owrt/net/netfilter/nfnetlink_log.c 2009-05-10 23:48:34.000000000 +0200
117991 @@ -39,7 +39,7 @@
117992 #endif
117993
117994 #define NFULNL_NLBUFSIZ_DEFAULT NLMSG_GOODSIZE
117995 -#define NFULNL_TIMEOUT_DEFAULT 100 /* every second */
117996 +#define NFULNL_TIMEOUT_DEFAULT HZ /* every second */
117997 #define NFULNL_QTHRESH_DEFAULT 100 /* 100 packets */
117998 #define NFULNL_COPY_RANGE_MAX 0xFFFF /* max packet size is limited by 16-bit struct nfattr nfa_len field */
117999
118000 @@ -590,10 +590,8 @@
118001
118002 qthreshold = inst->qthreshold;
118003 /* per-rule qthreshold overrides per-instance */
118004 - if (li->u.ulog.qthreshold)
118005 - if (qthreshold > li->u.ulog.qthreshold)
118006 - qthreshold = li->u.ulog.qthreshold;
118007 -
118008 + if (qthreshold > li->u.ulog.qthreshold)
118009 + qthreshold = li->u.ulog.qthreshold;
118010
118011 switch (inst->copy_mode) {
118012 case NFULNL_COPY_META:
118013 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/netfilter/x_tables.c linux-2.6.29-rc3.owrt/net/netfilter/x_tables.c
118014 --- linux-2.6.29.owrt/net/netfilter/x_tables.c 2009-05-10 22:04:39.000000000 +0200
118015 +++ linux-2.6.29-rc3.owrt/net/netfilter/x_tables.c 2009-05-10 23:48:34.000000000 +0200
118016 @@ -827,143 +827,59 @@
118017 .release = seq_release_net,
118018 };
118019
118020 -/*
118021 - * Traverse state for ip{,6}_{tables,matches} for helping crossing
118022 - * the multi-AF mutexes.
118023 - */
118024 -struct nf_mttg_trav {
118025 - struct list_head *head, *curr;
118026 - uint8_t class, nfproto;
118027 -};
118028 -
118029 -enum {
118030 - MTTG_TRAV_INIT,
118031 - MTTG_TRAV_NFP_UNSPEC,
118032 - MTTG_TRAV_NFP_SPEC,
118033 - MTTG_TRAV_DONE,
118034 -};
118035 -
118036 -static void *xt_mttg_seq_next(struct seq_file *seq, void *v, loff_t *ppos,
118037 - bool is_target)
118038 -{
118039 - static const uint8_t next_class[] = {
118040 - [MTTG_TRAV_NFP_UNSPEC] = MTTG_TRAV_NFP_SPEC,
118041 - [MTTG_TRAV_NFP_SPEC] = MTTG_TRAV_DONE,
118042 - };
118043 - struct nf_mttg_trav *trav = seq->private;
118044 -
118045 - switch (trav->class) {
118046 - case MTTG_TRAV_INIT:
118047 - trav->class = MTTG_TRAV_NFP_UNSPEC;
118048 - mutex_lock(&xt[NFPROTO_UNSPEC].mutex);
118049 - trav->head = trav->curr = is_target ?
118050 - &xt[NFPROTO_UNSPEC].target : &xt[NFPROTO_UNSPEC].match;
118051 - break;
118052 - case MTTG_TRAV_NFP_UNSPEC:
118053 - trav->curr = trav->curr->next;
118054 - if (trav->curr != trav->head)
118055 - break;
118056 - mutex_unlock(&xt[NFPROTO_UNSPEC].mutex);
118057 - mutex_lock(&xt[trav->nfproto].mutex);
118058 - trav->head = trav->curr = is_target ?
118059 - &xt[trav->nfproto].target : &xt[trav->nfproto].match;
118060 - trav->class = next_class[trav->class];
118061 - break;
118062 - case MTTG_TRAV_NFP_SPEC:
118063 - trav->curr = trav->curr->next;
118064 - if (trav->curr != trav->head)
118065 - break;
118066 - /* fallthru, _stop will unlock */
118067 - default:
118068 - return NULL;
118069 - }
118070 -
118071 - if (ppos != NULL)
118072 - ++*ppos;
118073 - return trav;
118074 -}
118075 -
118076 -static void *xt_mttg_seq_start(struct seq_file *seq, loff_t *pos,
118077 - bool is_target)
118078 +static void *xt_match_seq_start(struct seq_file *seq, loff_t *pos)
118079 {
118080 - struct nf_mttg_trav *trav = seq->private;
118081 - unsigned int j;
118082 + struct proc_dir_entry *pde = (struct proc_dir_entry *)seq->private;
118083 + u_int16_t af = (unsigned long)pde->data;
118084
118085 - trav->class = MTTG_TRAV_INIT;
118086 - for (j = 0; j < *pos; ++j)
118087 - if (xt_mttg_seq_next(seq, NULL, NULL, is_target) == NULL)
118088 - return NULL;
118089 - return trav;
118090 + mutex_lock(&xt[af].mutex);
118091 + return seq_list_start(&xt[af].match, *pos);
118092 }
118093
118094 -static void xt_mttg_seq_stop(struct seq_file *seq, void *v)
118095 +static void *xt_match_seq_next(struct seq_file *seq, void *v, loff_t *pos)
118096 {
118097 - struct nf_mttg_trav *trav = seq->private;
118098 + struct proc_dir_entry *pde = (struct proc_dir_entry *)seq->private;
118099 + u_int16_t af = (unsigned long)pde->data;
118100
118101 - switch (trav->class) {
118102 - case MTTG_TRAV_NFP_UNSPEC:
118103 - mutex_unlock(&xt[NFPROTO_UNSPEC].mutex);
118104 - break;
118105 - case MTTG_TRAV_NFP_SPEC:
118106 - mutex_unlock(&xt[trav->nfproto].mutex);
118107 - break;
118108 - }
118109 + return seq_list_next(v, &xt[af].match, pos);
118110 }
118111
118112 -static void *xt_match_seq_start(struct seq_file *seq, loff_t *pos)
118113 +static void xt_match_seq_stop(struct seq_file *seq, void *v)
118114 {
118115 - return xt_mttg_seq_start(seq, pos, false);
118116 -}
118117 + struct proc_dir_entry *pde = seq->private;
118118 + u_int16_t af = (unsigned long)pde->data;
118119
118120 -static void *xt_match_seq_next(struct seq_file *seq, void *v, loff_t *ppos)
118121 -{
118122 - return xt_mttg_seq_next(seq, v, ppos, false);
118123 + mutex_unlock(&xt[af].mutex);
118124 }
118125
118126 static int xt_match_seq_show(struct seq_file *seq, void *v)
118127 {
118128 - const struct nf_mttg_trav *trav = seq->private;
118129 - const struct xt_match *match;
118130 + struct xt_match *match = list_entry(v, struct xt_match, list);
118131
118132 - switch (trav->class) {
118133 - case MTTG_TRAV_NFP_UNSPEC:
118134 - case MTTG_TRAV_NFP_SPEC:
118135 - if (trav->curr == trav->head)
118136 - return 0;
118137 - match = list_entry(trav->curr, struct xt_match, list);
118138 - return (*match->name == '\0') ? 0 :
118139 - seq_printf(seq, "%s\n", match->name);
118140 - }
118141 - return 0;
118142 + if (strlen(match->name))
118143 + return seq_printf(seq, "%s\n", match->name);
118144 + else
118145 + return 0;
118146 }
118147
118148 static const struct seq_operations xt_match_seq_ops = {
118149 .start = xt_match_seq_start,
118150 .next = xt_match_seq_next,
118151 - .stop = xt_mttg_seq_stop,
118152 + .stop = xt_match_seq_stop,
118153 .show = xt_match_seq_show,
118154 };
118155
118156 static int xt_match_open(struct inode *inode, struct file *file)
118157 {
118158 - struct seq_file *seq;
118159 - struct nf_mttg_trav *trav;
118160 int ret;
118161
118162 - trav = kmalloc(sizeof(*trav), GFP_KERNEL);
118163 - if (trav == NULL)
118164 - return -ENOMEM;
118165 -
118166 ret = seq_open(file, &xt_match_seq_ops);
118167 - if (ret < 0) {
118168 - kfree(trav);
118169 - return ret;
118170 - }
118171 + if (!ret) {
118172 + struct seq_file *seq = file->private_data;
118173
118174 - seq = file->private_data;
118175 - seq->private = trav;
118176 - trav->nfproto = (unsigned long)PDE(inode)->data;
118177 - return 0;
118178 + seq->private = PDE(inode);
118179 + }
118180 + return ret;
118181 }
118182
118183 static const struct file_operations xt_match_ops = {
118184 @@ -971,63 +887,62 @@
118185 .open = xt_match_open,
118186 .read = seq_read,
118187 .llseek = seq_lseek,
118188 - .release = seq_release_private,
118189 + .release = seq_release,
118190 };
118191
118192 static void *xt_target_seq_start(struct seq_file *seq, loff_t *pos)
118193 {
118194 - return xt_mttg_seq_start(seq, pos, true);
118195 + struct proc_dir_entry *pde = (struct proc_dir_entry *)seq->private;
118196 + u_int16_t af = (unsigned long)pde->data;
118197 +
118198 + mutex_lock(&xt[af].mutex);
118199 + return seq_list_start(&xt[af].target, *pos);
118200 }
118201
118202 -static void *xt_target_seq_next(struct seq_file *seq, void *v, loff_t *ppos)
118203 +static void *xt_target_seq_next(struct seq_file *seq, void *v, loff_t *pos)
118204 {
118205 - return xt_mttg_seq_next(seq, v, ppos, true);
118206 + struct proc_dir_entry *pde = (struct proc_dir_entry *)seq->private;
118207 + u_int16_t af = (unsigned long)pde->data;
118208 +
118209 + return seq_list_next(v, &xt[af].target, pos);
118210 +}
118211 +
118212 +static void xt_target_seq_stop(struct seq_file *seq, void *v)
118213 +{
118214 + struct proc_dir_entry *pde = seq->private;
118215 + u_int16_t af = (unsigned long)pde->data;
118216 +
118217 + mutex_unlock(&xt[af].mutex);
118218 }
118219
118220 static int xt_target_seq_show(struct seq_file *seq, void *v)
118221 {
118222 - const struct nf_mttg_trav *trav = seq->private;
118223 - const struct xt_target *target;
118224 + struct xt_target *target = list_entry(v, struct xt_target, list);
118225
118226 - switch (trav->class) {
118227 - case MTTG_TRAV_NFP_UNSPEC:
118228 - case MTTG_TRAV_NFP_SPEC:
118229 - if (trav->curr == trav->head)
118230 - return 0;
118231 - target = list_entry(trav->curr, struct xt_target, list);
118232 - return (*target->name == '\0') ? 0 :
118233 - seq_printf(seq, "%s\n", target->name);
118234 - }
118235 - return 0;
118236 + if (strlen(target->name))
118237 + return seq_printf(seq, "%s\n", target->name);
118238 + else
118239 + return 0;
118240 }
118241
118242 static const struct seq_operations xt_target_seq_ops = {
118243 .start = xt_target_seq_start,
118244 .next = xt_target_seq_next,
118245 - .stop = xt_mttg_seq_stop,
118246 + .stop = xt_target_seq_stop,
118247 .show = xt_target_seq_show,
118248 };
118249
118250 static int xt_target_open(struct inode *inode, struct file *file)
118251 {
118252 - struct seq_file *seq;
118253 - struct nf_mttg_trav *trav;
118254 int ret;
118255
118256 - trav = kmalloc(sizeof(*trav), GFP_KERNEL);
118257 - if (trav == NULL)
118258 - return -ENOMEM;
118259 -
118260 ret = seq_open(file, &xt_target_seq_ops);
118261 - if (ret < 0) {
118262 - kfree(trav);
118263 - return ret;
118264 - }
118265 + if (!ret) {
118266 + struct seq_file *seq = file->private_data;
118267
118268 - seq = file->private_data;
118269 - seq->private = trav;
118270 - trav->nfproto = (unsigned long)PDE(inode)->data;
118271 - return 0;
118272 + seq->private = PDE(inode);
118273 + }
118274 + return ret;
118275 }
118276
118277 static const struct file_operations xt_target_ops = {
118278 @@ -1035,7 +950,7 @@
118279 .open = xt_target_open,
118280 .read = seq_read,
118281 .llseek = seq_lseek,
118282 - .release = seq_release_private,
118283 + .release = seq_release,
118284 };
118285
118286 #define FORMAT_TABLES "_tables_names"
118287 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/netfilter/xt_recent.c linux-2.6.29-rc3.owrt/net/netfilter/xt_recent.c
118288 --- linux-2.6.29.owrt/net/netfilter/xt_recent.c 2009-05-10 22:04:39.000000000 +0200
118289 +++ linux-2.6.29-rc3.owrt/net/netfilter/xt_recent.c 2009-05-10 23:48:34.000000000 +0200
118290 @@ -542,7 +542,7 @@
118291 struct recent_entry *e;
118292 char buf[sizeof("+b335:1d35:1e55:dead:c0de:1715:5afe:c0de")];
118293 const char *c = buf;
118294 - union nf_inet_addr addr = {};
118295 + union nf_inet_addr addr;
118296 u_int16_t family;
118297 bool add, succ;
118298
118299 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/netfilter/xt_sctp.c linux-2.6.29-rc3.owrt/net/netfilter/xt_sctp.c
118300 --- linux-2.6.29.owrt/net/netfilter/xt_sctp.c 2009-05-10 22:04:39.000000000 +0200
118301 +++ linux-2.6.29-rc3.owrt/net/netfilter/xt_sctp.c 2009-05-10 23:48:34.000000000 +0200
118302 @@ -105,7 +105,7 @@
118303
118304 switch (chunk_match_type) {
118305 case SCTP_CHUNK_MATCH_ALL:
118306 - return SCTP_CHUNKMAP_IS_CLEAR(chunkmapcopy);
118307 + return SCTP_CHUNKMAP_IS_CLEAR(info->chunkmap);
118308 case SCTP_CHUNK_MATCH_ANY:
118309 return false;
118310 case SCTP_CHUNK_MATCH_ONLY:
118311 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/netlink/af_netlink.c linux-2.6.29-rc3.owrt/net/netlink/af_netlink.c
118312 --- linux-2.6.29.owrt/net/netlink/af_netlink.c 2009-05-10 22:04:39.000000000 +0200
118313 +++ linux-2.6.29-rc3.owrt/net/netlink/af_netlink.c 2009-05-10 23:48:34.000000000 +0200
118314 @@ -1084,13 +1084,6 @@
118315 return 0;
118316 }
118317
118318 -/**
118319 - * netlink_set_err - report error to broadcast listeners
118320 - * @ssk: the kernel netlink socket, as returned by netlink_kernel_create()
118321 - * @pid: the PID of a process that we want to skip (if any)
118322 - * @groups: the broadcast group that will notice the error
118323 - * @code: error code, must be negative (as usual in kernelspace)
118324 - */
118325 void netlink_set_err(struct sock *ssk, u32 pid, u32 group, int code)
118326 {
118327 struct netlink_set_err_data info;
118328 @@ -1100,8 +1093,7 @@
118329 info.exclude_sk = ssk;
118330 info.pid = pid;
118331 info.group = group;
118332 - /* sk->sk_err wants a positive error value */
118333 - info.code = -code;
118334 + info.code = code;
118335
118336 read_lock(&nl_table_lock);
118337
118338 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/packet/af_packet.c linux-2.6.29-rc3.owrt/net/packet/af_packet.c
118339 --- linux-2.6.29.owrt/net/packet/af_packet.c 2009-05-10 22:04:39.000000000 +0200
118340 +++ linux-2.6.29-rc3.owrt/net/packet/af_packet.c 2009-05-10 23:48:34.000000000 +0200
118341 @@ -77,7 +77,6 @@
118342 #include <linux/poll.h>
118343 #include <linux/module.h>
118344 #include <linux/init.h>
118345 -#include <linux/mutex.h>
118346
118347 #ifdef CONFIG_INET
118348 #include <net/inet_common.h>
118349 @@ -176,7 +175,6 @@
118350 #endif
118351 struct packet_type prot_hook;
118352 spinlock_t bind_lock;
118353 - struct mutex pg_vec_lock;
118354 unsigned int running:1, /* prot_hook is attached*/
118355 auxdata:1,
118356 origdev:1;
118357 @@ -223,13 +221,13 @@
118358 h.raw = po->pg_vec[pg_vec_pos] + (frame_offset * po->frame_size);
118359 switch (po->tp_version) {
118360 case TPACKET_V1:
118361 - if (status != (h.h1->tp_status ? TP_STATUS_USER :
118362 - TP_STATUS_KERNEL))
118363 + if (status != h.h1->tp_status ? TP_STATUS_USER :
118364 + TP_STATUS_KERNEL)
118365 return NULL;
118366 break;
118367 case TPACKET_V2:
118368 - if (status != (h.h2->tp_status ? TP_STATUS_USER :
118369 - TP_STATUS_KERNEL))
118370 + if (status != h.h2->tp_status ? TP_STATUS_USER :
118371 + TP_STATUS_KERNEL)
118372 return NULL;
118373 break;
118374 }
118375 @@ -1074,7 +1072,6 @@
118376 */
118377
118378 spin_lock_init(&po->bind_lock);
118379 - mutex_init(&po->pg_vec_lock);
118380 po->prot_hook.func = packet_rcv;
118381 po->pkt_type = PACKET_MASK_ANY & ~(1 << PACKET_LOOPBACK);
118382
118383 @@ -1889,7 +1886,6 @@
118384 synchronize_net();
118385
118386 err = -EBUSY;
118387 - mutex_lock(&po->pg_vec_lock);
118388 if (closing || atomic_read(&po->mapped) == 0) {
118389 err = 0;
118390 #define XC(a, b) ({ __typeof__ ((a)) __t; __t = (a); (a) = (b); __t; })
118391 @@ -1911,7 +1907,6 @@
118392 if (atomic_read(&po->mapped))
118393 printk(KERN_DEBUG "packet_mmap: vma is busy: %d\n", atomic_read(&po->mapped));
118394 }
118395 - mutex_unlock(&po->pg_vec_lock);
118396
118397 spin_lock(&po->bind_lock);
118398 if (was_running && !po->running) {
118399 @@ -1944,7 +1939,7 @@
118400
118401 size = vma->vm_end - vma->vm_start;
118402
118403 - mutex_lock(&po->pg_vec_lock);
118404 + lock_sock(sk);
118405 if (po->pg_vec == NULL)
118406 goto out;
118407 if (size != po->pg_vec_len*po->pg_vec_pages*PAGE_SIZE)
118408 @@ -1967,7 +1962,7 @@
118409 err = 0;
118410
118411 out:
118412 - mutex_unlock(&po->pg_vec_lock);
118413 + release_sock(sk);
118414 return err;
118415 }
118416 #endif
118417 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/phonet/pep.c linux-2.6.29-rc3.owrt/net/phonet/pep.c
118418 --- linux-2.6.29.owrt/net/phonet/pep.c 2009-05-10 22:04:39.000000000 +0200
118419 +++ linux-2.6.29-rc3.owrt/net/phonet/pep.c 2009-05-10 23:48:34.000000000 +0200
118420 @@ -553,7 +553,7 @@
118421 {
118422 struct pep_sock *pn = pep_sk(sk);
118423 struct sock *sknode;
118424 - struct pnpipehdr *hdr;
118425 + struct pnpipehdr *hdr = pnp_hdr(skb);
118426 struct sockaddr_pn dst;
118427 int err = NET_RX_SUCCESS;
118428 u8 pipe_handle;
118429 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/phonet/pep-gprs.c linux-2.6.29-rc3.owrt/net/phonet/pep-gprs.c
118430 --- linux-2.6.29.owrt/net/phonet/pep-gprs.c 2009-05-10 22:04:39.000000000 +0200
118431 +++ linux-2.6.29-rc3.owrt/net/phonet/pep-gprs.c 2009-05-10 23:48:34.000000000 +0200
118432 @@ -207,6 +207,7 @@
118433 dev->name, err);
118434 dev->stats.tx_aborted_errors++;
118435 dev->stats.tx_errors++;
118436 + dev_kfree_skb(skb);
118437 } else {
118438 dev->stats.tx_packets++;
118439 dev->stats.tx_bytes += len;
118440 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/rxrpc/af_rxrpc.c linux-2.6.29-rc3.owrt/net/rxrpc/af_rxrpc.c
118441 --- linux-2.6.29.owrt/net/rxrpc/af_rxrpc.c 2009-05-10 22:04:39.000000000 +0200
118442 +++ linux-2.6.29-rc3.owrt/net/rxrpc/af_rxrpc.c 2009-05-10 23:48:34.000000000 +0200
118443 @@ -284,13 +284,13 @@
118444 if (IS_ERR(trans)) {
118445 call = ERR_CAST(trans);
118446 trans = NULL;
118447 - goto out_notrans;
118448 + goto out;
118449 }
118450 } else {
118451 trans = rx->trans;
118452 if (!trans) {
118453 call = ERR_PTR(-ENOTCONN);
118454 - goto out_notrans;
118455 + goto out;
118456 }
118457 atomic_inc(&trans->usage);
118458 }
118459 @@ -315,7 +315,6 @@
118460 rxrpc_put_bundle(trans, bundle);
118461 out:
118462 rxrpc_put_transport(trans);
118463 -out_notrans:
118464 release_sock(&rx->sk);
118465 _leave(" = %p", call);
118466 return call;
118467 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/sched/act_police.c linux-2.6.29-rc3.owrt/net/sched/act_police.c
118468 --- linux-2.6.29.owrt/net/sched/act_police.c 2009-05-10 22:04:39.000000000 +0200
118469 +++ linux-2.6.29-rc3.owrt/net/sched/act_police.c 2009-05-10 23:48:34.000000000 +0200
118470 @@ -183,6 +183,13 @@
118471 if (R_tab == NULL)
118472 goto failure;
118473
118474 + if (!est && (ret == ACT_P_CREATED ||
118475 + !gen_estimator_active(&police->tcf_bstats,
118476 + &police->tcf_rate_est))) {
118477 + err = -EINVAL;
118478 + goto failure;
118479 + }
118480 +
118481 if (parm->peakrate.rate) {
118482 P_tab = qdisc_get_rtab(&parm->peakrate,
118483 tb[TCA_POLICE_PEAKRATE]);
118484 @@ -198,12 +205,6 @@
118485 &police->tcf_lock, est);
118486 if (err)
118487 goto failure_unlock;
118488 - } else if (tb[TCA_POLICE_AVRATE] &&
118489 - (ret == ACT_P_CREATED ||
118490 - !gen_estimator_active(&police->tcf_bstats,
118491 - &police->tcf_rate_est))) {
118492 - err = -EINVAL;
118493 - goto failure_unlock;
118494 }
118495
118496 /* No failure allowed after this point */
118497 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/sched/sch_drr.c linux-2.6.29-rc3.owrt/net/sched/sch_drr.c
118498 --- linux-2.6.29.owrt/net/sched/sch_drr.c 2009-05-10 22:04:39.000000000 +0200
118499 +++ linux-2.6.29-rc3.owrt/net/sched/sch_drr.c 2009-05-10 23:48:34.000000000 +0200
118500 @@ -66,15 +66,11 @@
118501 {
118502 struct drr_sched *q = qdisc_priv(sch);
118503 struct drr_class *cl = (struct drr_class *)*arg;
118504 - struct nlattr *opt = tca[TCA_OPTIONS];
118505 struct nlattr *tb[TCA_DRR_MAX + 1];
118506 u32 quantum;
118507 int err;
118508
118509 - if (!opt)
118510 - return -EINVAL;
118511 -
118512 - err = nla_parse_nested(tb, TCA_DRR_MAX, opt, drr_policy);
118513 + err = nla_parse_nested(tb, TCA_DRR_MAX, tca[TCA_OPTIONS], drr_policy);
118514 if (err < 0)
118515 return err;
118516
118517 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/sctp/endpointola.c linux-2.6.29-rc3.owrt/net/sctp/endpointola.c
118518 --- linux-2.6.29.owrt/net/sctp/endpointola.c 2009-05-10 22:04:39.000000000 +0200
118519 +++ linux-2.6.29-rc3.owrt/net/sctp/endpointola.c 2009-05-10 23:48:34.000000000 +0200
118520 @@ -111,8 +111,7 @@
118521 if (sctp_addip_enable) {
118522 auth_chunks->chunks[0] = SCTP_CID_ASCONF;
118523 auth_chunks->chunks[1] = SCTP_CID_ASCONF_ACK;
118524 - auth_chunks->param_hdr.length =
118525 - htons(sizeof(sctp_paramhdr_t) + 2);
118526 + auth_chunks->param_hdr.length += htons(2);
118527 }
118528 }
118529
118530 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/sctp/protocol.c linux-2.6.29-rc3.owrt/net/sctp/protocol.c
118531 --- linux-2.6.29.owrt/net/sctp/protocol.c 2009-05-10 22:04:39.000000000 +0200
118532 +++ linux-2.6.29-rc3.owrt/net/sctp/protocol.c 2009-05-10 23:48:34.000000000 +0200
118533 @@ -717,20 +717,15 @@
118534 static int sctp_ctl_sock_init(void)
118535 {
118536 int err;
118537 - sa_family_t family = PF_INET;
118538 + sa_family_t family;
118539
118540 if (sctp_get_pf_specific(PF_INET6))
118541 family = PF_INET6;
118542 + else
118543 + family = PF_INET;
118544
118545 err = inet_ctl_sock_create(&sctp_ctl_sock, family,
118546 SOCK_SEQPACKET, IPPROTO_SCTP, &init_net);
118547 -
118548 - /* If IPv6 socket could not be created, try the IPv4 socket */
118549 - if (err < 0 && family == PF_INET6)
118550 - err = inet_ctl_sock_create(&sctp_ctl_sock, AF_INET,
118551 - SOCK_SEQPACKET, IPPROTO_SCTP,
118552 - &init_net);
118553 -
118554 if (err < 0) {
118555 printk(KERN_ERR
118556 "SCTP: Failed to create the SCTP control socket.\n");
118557 @@ -1327,8 +1322,9 @@
118558 out:
118559 return status;
118560 err_v6_add_protocol:
118561 - sctp_v4_del_protocol();
118562 + sctp_v6_del_protocol();
118563 err_add_protocol:
118564 + sctp_v4_del_protocol();
118565 inet_ctl_sock_destroy(sctp_ctl_sock);
118566 err_ctl_sock_init:
118567 sctp_v6_protosw_exit();
118568 @@ -1339,6 +1335,7 @@
118569 sctp_v4_pf_exit();
118570 sctp_v6_pf_exit();
118571 sctp_sysctl_unregister();
118572 + list_del(&sctp_af_inet.list);
118573 free_pages((unsigned long)sctp_port_hashtable,
118574 get_order(sctp_port_hashsize *
118575 sizeof(struct sctp_bind_hashbucket)));
118576 @@ -1386,6 +1383,7 @@
118577 sctp_v4_pf_exit();
118578
118579 sctp_sysctl_unregister();
118580 + list_del(&sctp_af_inet.list);
118581
118582 free_pages((unsigned long)sctp_assoc_hashtable,
118583 get_order(sctp_assoc_hashsize *
118584 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/sctp/sm_sideeffect.c linux-2.6.29-rc3.owrt/net/sctp/sm_sideeffect.c
118585 --- linux-2.6.29.owrt/net/sctp/sm_sideeffect.c 2009-05-10 22:04:39.000000000 +0200
118586 +++ linux-2.6.29-rc3.owrt/net/sctp/sm_sideeffect.c 2009-05-10 23:48:34.000000000 +0200
118587 @@ -787,48 +787,36 @@
118588 struct sctp_association *asoc,
118589 struct sctp_chunk *chunk)
118590 {
118591 + struct sctp_operr_chunk *operr_chunk;
118592 struct sctp_errhdr *err_hdr;
118593 - struct sctp_ulpevent *ev;
118594 -
118595 - while (chunk->chunk_end > chunk->skb->data) {
118596 - err_hdr = (struct sctp_errhdr *)(chunk->skb->data);
118597
118598 - ev = sctp_ulpevent_make_remote_error(asoc, chunk, 0,
118599 - GFP_ATOMIC);
118600 - if (!ev)
118601 - return;
118602 -
118603 - sctp_ulpq_tail_event(&asoc->ulpq, ev);
118604 + operr_chunk = (struct sctp_operr_chunk *)chunk->chunk_hdr;
118605 + err_hdr = &operr_chunk->err_hdr;
118606
118607 - switch (err_hdr->cause) {
118608 - case SCTP_ERROR_UNKNOWN_CHUNK:
118609 - {
118610 - sctp_chunkhdr_t *unk_chunk_hdr;
118611 -
118612 - unk_chunk_hdr = (sctp_chunkhdr_t *)err_hdr->variable;
118613 - switch (unk_chunk_hdr->type) {
118614 - /* ADDIP 4.1 A9) If the peer responds to an ASCONF with
118615 - * an ERROR chunk reporting that it did not recognized
118616 - * the ASCONF chunk type, the sender of the ASCONF MUST
118617 - * NOT send any further ASCONF chunks and MUST stop its
118618 - * T-4 timer.
118619 - */
118620 - case SCTP_CID_ASCONF:
118621 - if (asoc->peer.asconf_capable == 0)
118622 - break;
118623 -
118624 - asoc->peer.asconf_capable = 0;
118625 - sctp_add_cmd_sf(cmds, SCTP_CMD_TIMER_STOP,
118626 + switch (err_hdr->cause) {
118627 + case SCTP_ERROR_UNKNOWN_CHUNK:
118628 + {
118629 + struct sctp_chunkhdr *unk_chunk_hdr;
118630 +
118631 + unk_chunk_hdr = (struct sctp_chunkhdr *)err_hdr->variable;
118632 + switch (unk_chunk_hdr->type) {
118633 + /* ADDIP 4.1 A9) If the peer responds to an ASCONF with an
118634 + * ERROR chunk reporting that it did not recognized the ASCONF
118635 + * chunk type, the sender of the ASCONF MUST NOT send any
118636 + * further ASCONF chunks and MUST stop its T-4 timer.
118637 + */
118638 + case SCTP_CID_ASCONF:
118639 + asoc->peer.asconf_capable = 0;
118640 + sctp_add_cmd_sf(cmds, SCTP_CMD_TIMER_STOP,
118641 SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO));
118642 - break;
118643 - default:
118644 - break;
118645 - }
118646 break;
118647 - }
118648 default:
118649 break;
118650 }
118651 + break;
118652 + }
118653 + default:
118654 + break;
118655 }
118656 }
118657
118658 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/sctp/sm_statefuns.c linux-2.6.29-rc3.owrt/net/sctp/sm_statefuns.c
118659 --- linux-2.6.29.owrt/net/sctp/sm_statefuns.c 2009-05-10 22:04:39.000000000 +0200
118660 +++ linux-2.6.29-rc3.owrt/net/sctp/sm_statefuns.c 2009-05-10 23:48:34.000000000 +0200
118661 @@ -3163,6 +3163,7 @@
118662 sctp_cmd_seq_t *commands)
118663 {
118664 struct sctp_chunk *chunk = arg;
118665 + struct sctp_ulpevent *ev;
118666
118667 if (!sctp_vtag_verify(chunk, asoc))
118668 return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
118669 @@ -3172,10 +3173,21 @@
118670 return sctp_sf_violation_chunklen(ep, asoc, type, arg,
118671 commands);
118672
118673 - sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_OPERR,
118674 - SCTP_CHUNK(chunk));
118675 + while (chunk->chunk_end > chunk->skb->data) {
118676 + ev = sctp_ulpevent_make_remote_error(asoc, chunk, 0,
118677 + GFP_ATOMIC);
118678 + if (!ev)
118679 + goto nomem;
118680
118681 + sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP,
118682 + SCTP_ULPEVENT(ev));
118683 + sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_OPERR,
118684 + SCTP_CHUNK(chunk));
118685 + }
118686 return SCTP_DISPOSITION_CONSUME;
118687 +
118688 +nomem:
118689 + return SCTP_DISPOSITION_NOMEM;
118690 }
118691
118692 /*
118693 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/sunrpc/Kconfig linux-2.6.29-rc3.owrt/net/sunrpc/Kconfig
118694 --- linux-2.6.29.owrt/net/sunrpc/Kconfig 2009-05-10 22:04:39.000000000 +0200
118695 +++ linux-2.6.29-rc3.owrt/net/sunrpc/Kconfig 2009-05-10 23:48:34.000000000 +0200
118696 @@ -6,7 +6,7 @@
118697
118698 config SUNRPC_XPRT_RDMA
118699 tristate
118700 - depends on SUNRPC && INFINIBAND && INFINIBAND_ADDR_TRANS && EXPERIMENTAL
118701 + depends on SUNRPC && INFINIBAND && EXPERIMENTAL
118702 default SUNRPC && INFINIBAND
118703 help
118704 This option allows the NFS client and server to support
118705 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/sunrpc/sched.c linux-2.6.29-rc3.owrt/net/sunrpc/sched.c
118706 --- linux-2.6.29.owrt/net/sunrpc/sched.c 2009-05-10 22:04:39.000000000 +0200
118707 +++ linux-2.6.29-rc3.owrt/net/sunrpc/sched.c 2009-05-10 23:48:34.000000000 +0200
118708 @@ -293,6 +293,11 @@
118709 rpc_clear_queued(task);
118710 if (rpc_test_and_set_running(task))
118711 return;
118712 + /* We might have raced */
118713 + if (RPC_IS_QUEUED(task)) {
118714 + rpc_clear_running(task);
118715 + return;
118716 + }
118717 if (RPC_IS_ASYNC(task)) {
118718 int status;
118719
118720 @@ -602,9 +607,7 @@
118721 */
118722 static void __rpc_execute(struct rpc_task *task)
118723 {
118724 - struct rpc_wait_queue *queue;
118725 - int task_is_async = RPC_IS_ASYNC(task);
118726 - int status = 0;
118727 + int status = 0;
118728
118729 dprintk("RPC: %5u __rpc_execute flags=0x%x\n",
118730 task->tk_pid, task->tk_flags);
118731 @@ -644,25 +647,15 @@
118732 */
118733 if (!RPC_IS_QUEUED(task))
118734 continue;
118735 - /*
118736 - * The queue->lock protects against races with
118737 - * rpc_make_runnable().
118738 - *
118739 - * Note that once we clear RPC_TASK_RUNNING on an asynchronous
118740 - * rpc_task, rpc_make_runnable() can assign it to a
118741 - * different workqueue. We therefore cannot assume that the
118742 - * rpc_task pointer may still be dereferenced.
118743 - */
118744 - queue = task->tk_waitqueue;
118745 - spin_lock_bh(&queue->lock);
118746 - if (!RPC_IS_QUEUED(task)) {
118747 - spin_unlock_bh(&queue->lock);
118748 + rpc_clear_running(task);
118749 + if (RPC_IS_ASYNC(task)) {
118750 + /* Careful! we may have raced... */
118751 + if (RPC_IS_QUEUED(task))
118752 + return;
118753 + if (rpc_test_and_set_running(task))
118754 + return;
118755 continue;
118756 }
118757 - rpc_clear_running(task);
118758 - spin_unlock_bh(&queue->lock);
118759 - if (task_is_async)
118760 - return;
118761
118762 /* sync task: sleep here */
118763 dprintk("RPC: %5u sync task going to sleep\n", task->tk_pid);
118764 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/sunrpc/xprt.c linux-2.6.29-rc3.owrt/net/sunrpc/xprt.c
118765 --- linux-2.6.29.owrt/net/sunrpc/xprt.c 2009-05-10 22:04:39.000000000 +0200
118766 +++ linux-2.6.29-rc3.owrt/net/sunrpc/xprt.c 2009-05-10 23:48:34.000000000 +0200
118767 @@ -663,7 +663,7 @@
118768 xprt, (xprt_connected(xprt) ? "is" : "is not"));
118769
118770 if (!xprt_bound(xprt)) {
118771 - task->tk_status = -EAGAIN;
118772 + task->tk_status = -EIO;
118773 return;
118774 }
118775 if (!xprt_lock_write(xprt, task))
118776 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/sunrpc/xprtsock.c linux-2.6.29-rc3.owrt/net/sunrpc/xprtsock.c
118777 --- linux-2.6.29.owrt/net/sunrpc/xprtsock.c 2009-05-10 22:04:39.000000000 +0200
118778 +++ linux-2.6.29-rc3.owrt/net/sunrpc/xprtsock.c 2009-05-10 23:48:34.000000000 +0200
118779 @@ -467,7 +467,7 @@
118780 int err, sent = 0;
118781
118782 if (unlikely(!sock))
118783 - return -ENOTSOCK;
118784 + return -ENOTCONN;
118785
118786 clear_bit(SOCK_ASYNC_NOSPACE, &sock->flags);
118787 if (base != 0) {
118788 @@ -577,8 +577,6 @@
118789 req->rq_svec->iov_base,
118790 req->rq_svec->iov_len);
118791
118792 - if (!xprt_bound(xprt))
118793 - return -ENOTCONN;
118794 status = xs_sendpages(transport->sock,
118795 xs_addr(xprt),
118796 xprt->addrlen, xdr,
118797 @@ -596,10 +594,6 @@
118798 }
118799
118800 switch (status) {
118801 - case -ENOTSOCK:
118802 - status = -ENOTCONN;
118803 - /* Should we call xs_close() here? */
118804 - break;
118805 case -EAGAIN:
118806 xs_nospace(task);
118807 break;
118808 @@ -699,10 +693,6 @@
118809 }
118810
118811 switch (status) {
118812 - case -ENOTSOCK:
118813 - status = -ENOTCONN;
118814 - /* Should we call xs_close() here? */
118815 - break;
118816 case -EAGAIN:
118817 xs_nospace(task);
118818 break;
118819 @@ -1533,7 +1523,7 @@
118820 struct socket *sock = transport->sock;
118821 int err, status = -EIO;
118822
118823 - if (xprt->shutdown)
118824 + if (xprt->shutdown || !xprt_bound(xprt))
118825 goto out;
118826
118827 /* Start by resetting any existing state */
118828 @@ -1574,7 +1564,7 @@
118829 struct socket *sock = transport->sock;
118830 int err, status = -EIO;
118831
118832 - if (xprt->shutdown)
118833 + if (xprt->shutdown || !xprt_bound(xprt))
118834 goto out;
118835
118836 /* Start by resetting any existing state */
118837 @@ -1658,9 +1648,6 @@
118838 write_unlock_bh(&sk->sk_callback_lock);
118839 }
118840
118841 - if (!xprt_bound(xprt))
118842 - return -ENOTCONN;
118843 -
118844 /* Tell the socket layer to start connecting... */
118845 xprt->stat.connect_count++;
118846 xprt->stat.connect_start = jiffies;
118847 @@ -1681,7 +1668,7 @@
118848 struct socket *sock = transport->sock;
118849 int err, status = -EIO;
118850
118851 - if (xprt->shutdown)
118852 + if (xprt->shutdown || !xprt_bound(xprt))
118853 goto out;
118854
118855 if (!sock) {
118856 @@ -1741,7 +1728,7 @@
118857 struct socket *sock = transport->sock;
118858 int err, status = -EIO;
118859
118860 - if (xprt->shutdown)
118861 + if (xprt->shutdown || !xprt_bound(xprt))
118862 goto out;
118863
118864 if (!sock) {
118865 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/wimax/debugfs.c linux-2.6.29-rc3.owrt/net/wimax/debugfs.c
118866 --- linux-2.6.29.owrt/net/wimax/debugfs.c 2009-05-10 22:04:39.000000000 +0200
118867 +++ linux-2.6.29-rc3.owrt/net/wimax/debugfs.c 2009-05-10 23:48:34.000000000 +0200
118868 @@ -28,6 +28,17 @@
118869 #include "debug-levels.h"
118870
118871
118872 +/* Debug framework control of debug levels */
118873 +struct d_level D_LEVEL[] = {
118874 + D_SUBMODULE_DEFINE(debugfs),
118875 + D_SUBMODULE_DEFINE(id_table),
118876 + D_SUBMODULE_DEFINE(op_msg),
118877 + D_SUBMODULE_DEFINE(op_reset),
118878 + D_SUBMODULE_DEFINE(op_rfkill),
118879 + D_SUBMODULE_DEFINE(stack),
118880 +};
118881 +size_t D_LEVEL_SIZE = ARRAY_SIZE(D_LEVEL);
118882 +
118883 #define __debugfs_register(prefix, name, parent) \
118884 do { \
118885 result = d_level_register_debugfs(prefix, name, parent); \
118886 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/wimax/id-table.c linux-2.6.29-rc3.owrt/net/wimax/id-table.c
118887 --- linux-2.6.29.owrt/net/wimax/id-table.c 2009-05-10 22:04:39.000000000 +0200
118888 +++ linux-2.6.29-rc3.owrt/net/wimax/id-table.c 2009-05-10 23:48:34.000000000 +0200
118889 @@ -94,13 +94,12 @@
118890 list_for_each_entry(wimax_dev, &wimax_id_table, id_table_node) {
118891 if (wimax_dev->net_dev->ifindex == ifindex) {
118892 dev_hold(wimax_dev->net_dev);
118893 - goto found;
118894 + break;
118895 }
118896 }
118897 - wimax_dev = NULL;
118898 - d_printf(1, NULL, "wimax: no devices found with ifindex %d\n",
118899 - ifindex);
118900 -found:
118901 + if (wimax_dev == NULL)
118902 + d_printf(1, NULL, "wimax: no devices found with ifindex %d\n",
118903 + ifindex);
118904 spin_unlock(&wimax_id_table_lock);
118905 d_fnend(3, NULL, "(info %p ifindex %d) = %p\n",
118906 info, ifindex, wimax_dev);
118907 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/wimax/stack.c linux-2.6.29-rc3.owrt/net/wimax/stack.c
118908 --- linux-2.6.29.owrt/net/wimax/stack.c 2009-05-10 22:04:39.000000000 +0200
118909 +++ linux-2.6.29-rc3.owrt/net/wimax/stack.c 2009-05-10 23:48:34.000000000 +0200
118910 @@ -516,19 +516,6 @@
118911 }
118912 EXPORT_SYMBOL_GPL(wimax_dev_rm);
118913
118914 -
118915 -/* Debug framework control of debug levels */
118916 -struct d_level D_LEVEL[] = {
118917 - D_SUBMODULE_DEFINE(debugfs),
118918 - D_SUBMODULE_DEFINE(id_table),
118919 - D_SUBMODULE_DEFINE(op_msg),
118920 - D_SUBMODULE_DEFINE(op_reset),
118921 - D_SUBMODULE_DEFINE(op_rfkill),
118922 - D_SUBMODULE_DEFINE(stack),
118923 -};
118924 -size_t D_LEVEL_SIZE = ARRAY_SIZE(D_LEVEL);
118925 -
118926 -
118927 struct genl_family wimax_gnl_family = {
118928 .id = GENL_ID_GENERATE,
118929 .name = "WiMAX",
118930 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/wireless/Kconfig linux-2.6.29-rc3.owrt/net/wireless/Kconfig
118931 --- linux-2.6.29.owrt/net/wireless/Kconfig 2009-05-10 22:04:39.000000000 +0200
118932 +++ linux-2.6.29-rc3.owrt/net/wireless/Kconfig 2009-05-10 23:48:34.000000000 +0200
118933 @@ -102,13 +102,3 @@
118934
118935 config LIB80211_CRYPT_TKIP
118936 tristate
118937 -
118938 -config LIB80211_DEBUG
118939 - bool "lib80211 debugging messages"
118940 - depends on LIB80211
118941 - default n
118942 - ---help---
118943 - You can enable this if you want verbose debugging messages
118944 - from lib80211.
118945 -
118946 - If unsure, say N.
118947 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/wireless/lib80211_crypt_ccmp.c linux-2.6.29-rc3.owrt/net/wireless/lib80211_crypt_ccmp.c
118948 --- linux-2.6.29.owrt/net/wireless/lib80211_crypt_ccmp.c 2009-05-10 22:04:39.000000000 +0200
118949 +++ linux-2.6.29-rc3.owrt/net/wireless/lib80211_crypt_ccmp.c 2009-05-10 23:48:34.000000000 +0200
118950 @@ -337,7 +337,6 @@
118951 pos += 8;
118952
118953 if (ccmp_replay_check(pn, key->rx_pn)) {
118954 -#ifdef CONFIG_LIB80211_DEBUG
118955 if (net_ratelimit()) {
118956 printk(KERN_DEBUG "CCMP: replay detected: STA=%pM "
118957 "previous PN %02x%02x%02x%02x%02x%02x "
118958 @@ -347,7 +346,6 @@
118959 key->rx_pn[3], key->rx_pn[4], key->rx_pn[5],
118960 pn[0], pn[1], pn[2], pn[3], pn[4], pn[5]);
118961 }
118962 -#endif
118963 key->dot11RSNAStatsCCMPReplays++;
118964 return -4;
118965 }
118966 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/wireless/lib80211_crypt_tkip.c linux-2.6.29-rc3.owrt/net/wireless/lib80211_crypt_tkip.c
118967 --- linux-2.6.29.owrt/net/wireless/lib80211_crypt_tkip.c 2009-05-10 22:04:39.000000000 +0200
118968 +++ linux-2.6.29-rc3.owrt/net/wireless/lib80211_crypt_tkip.c 2009-05-10 23:48:34.000000000 +0200
118969 @@ -465,14 +465,12 @@
118970 pos += 8;
118971
118972 if (tkip_replay_check(iv32, iv16, tkey->rx_iv32, tkey->rx_iv16)) {
118973 -#ifdef CONFIG_LIB80211_DEBUG
118974 if (net_ratelimit()) {
118975 printk(KERN_DEBUG "TKIP: replay detected: STA=%pM"
118976 " previous TSC %08x%04x received TSC "
118977 "%08x%04x\n", hdr->addr2,
118978 tkey->rx_iv32, tkey->rx_iv16, iv32, iv16);
118979 }
118980 -#endif
118981 tkey->dot11RSNAStatsTKIPReplays++;
118982 return -4;
118983 }
118984 @@ -507,12 +505,10 @@
118985 * it needs to be recalculated for the next packet. */
118986 tkey->rx_phase1_done = 0;
118987 }
118988 -#ifdef CONFIG_LIB80211_DEBUG
118989 if (net_ratelimit()) {
118990 printk(KERN_DEBUG "TKIP: ICV error detected: STA="
118991 "%pM\n", hdr->addr2);
118992 }
118993 -#endif
118994 tkey->dot11RSNAStatsTKIPICVErrors++;
118995 return -5;
118996 }
118997 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/wireless/nl80211.c linux-2.6.29-rc3.owrt/net/wireless/nl80211.c
118998 --- linux-2.6.29.owrt/net/wireless/nl80211.c 2009-05-10 22:04:39.000000000 +0200
118999 +++ linux-2.6.29-rc3.owrt/net/wireless/nl80211.c 2009-05-10 23:48:34.000000000 +0200
119000 @@ -1908,11 +1908,6 @@
119001 if (err)
119002 return err;
119003
119004 - if (!drv->ops->get_mesh_params) {
119005 - err = -EOPNOTSUPP;
119006 - goto out;
119007 - }
119008 -
119009 /* Get the mesh params */
119010 rtnl_lock();
119011 err = drv->ops->get_mesh_params(&drv->wiphy, dev, &cur_params);
119012 @@ -2022,11 +2017,6 @@
119013 if (err)
119014 return err;
119015
119016 - if (!drv->ops->set_mesh_params) {
119017 - err = -EOPNOTSUPP;
119018 - goto out;
119019 - }
119020 -
119021 /* This makes sure that there aren't more than 32 mesh config
119022 * parameters (otherwise our bitfield scheme would not work.) */
119023 BUILD_BUG_ON(NL80211_MESHCONF_ATTR_MAX > 32);
119024 @@ -2071,7 +2061,6 @@
119025 err = drv->ops->set_mesh_params(&drv->wiphy, dev, &cfg, mask);
119026 rtnl_unlock();
119027
119028 - out:
119029 /* cleanup */
119030 cfg80211_put_dev(drv);
119031 dev_put(dev);
119032 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/wireless/reg.c linux-2.6.29-rc3.owrt/net/wireless/reg.c
119033 --- linux-2.6.29.owrt/net/wireless/reg.c 2009-05-10 22:04:39.000000000 +0200
119034 +++ linux-2.6.29-rc3.owrt/net/wireless/reg.c 2009-05-10 23:48:34.000000000 +0200
119035 @@ -380,8 +380,7 @@
119036
119037 freq_diff = freq_range->end_freq_khz - freq_range->start_freq_khz;
119038
119039 - if (freq_range->end_freq_khz <= freq_range->start_freq_khz ||
119040 - freq_range->max_bandwidth_khz > freq_diff)
119041 + if (freq_diff <= 0 || freq_range->max_bandwidth_khz > freq_diff)
119042 return false;
119043
119044 return true;
119045 @@ -499,7 +498,6 @@
119046 * calculate the number of reg rules we will need. We will need one
119047 * for each channel subband */
119048 while (country_ie_len >= 3) {
119049 - int end_channel = 0;
119050 struct ieee80211_country_ie_triplet *triplet =
119051 (struct ieee80211_country_ie_triplet *) country_ie;
119052 int cur_sub_max_channel = 0, cur_channel = 0;
119053 @@ -511,25 +509,9 @@
119054 continue;
119055 }
119056
119057 - /* 2 GHz */
119058 - if (triplet->chans.first_channel <= 14)
119059 - end_channel = triplet->chans.first_channel +
119060 - triplet->chans.num_channels;
119061 - else
119062 - /*
119063 - * 5 GHz -- For example in country IEs if the first
119064 - * channel given is 36 and the number of channels is 4
119065 - * then the individual channel numbers defined for the
119066 - * 5 GHz PHY by these parameters are: 36, 40, 44, and 48
119067 - * and not 36, 37, 38, 39.
119068 - *
119069 - * See: http://tinyurl.com/11d-clarification
119070 - */
119071 - end_channel = triplet->chans.first_channel +
119072 - (4 * (triplet->chans.num_channels - 1));
119073 -
119074 cur_channel = triplet->chans.first_channel;
119075 - cur_sub_max_channel = end_channel;
119076 + cur_sub_max_channel = ieee80211_channel_to_frequency(
119077 + cur_channel + triplet->chans.num_channels);
119078
119079 /* Basic sanity check */
119080 if (cur_sub_max_channel < cur_channel)
119081 @@ -608,6 +590,15 @@
119082 end_channel = triplet->chans.first_channel +
119083 triplet->chans.num_channels;
119084 else
119085 + /*
119086 + * 5 GHz -- For example in country IEs if the first
119087 + * channel given is 36 and the number of channels is 4
119088 + * then the individual channel numbers defined for the
119089 + * 5 GHz PHY by these parameters are: 36, 40, 44, and 48
119090 + * and not 36, 37, 38, 39.
119091 + *
119092 + * See: http://tinyurl.com/11d-clarification
119093 + */
119094 end_channel = triplet->chans.first_channel +
119095 (4 * (triplet->chans.num_channels - 1));
119096
119097 @@ -1285,7 +1276,7 @@
119098 if (intersected_rd) {
119099 printk(KERN_DEBUG "cfg80211: We intersect both of these "
119100 "and get:\n");
119101 - print_regdomain_info(intersected_rd);
119102 + print_regdomain_info(rd);
119103 return;
119104 }
119105 printk(KERN_DEBUG "cfg80211: Intersection between both failed\n");
119106 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/net/xfrm/xfrm_state.c linux-2.6.29-rc3.owrt/net/xfrm/xfrm_state.c
119107 --- linux-2.6.29.owrt/net/xfrm/xfrm_state.c 2009-05-10 22:04:39.000000000 +0200
119108 +++ linux-2.6.29-rc3.owrt/net/xfrm/xfrm_state.c 2009-05-10 23:48:34.000000000 +0200
119109 @@ -748,51 +748,12 @@
119110 schedule_work(&net->xfrm.state_hash_work);
119111 }
119112
119113 -static void xfrm_state_look_at(struct xfrm_policy *pol, struct xfrm_state *x,
119114 - struct flowi *fl, unsigned short family,
119115 - xfrm_address_t *daddr, xfrm_address_t *saddr,
119116 - struct xfrm_state **best, int *acq_in_progress,
119117 - int *error)
119118 -{
119119 - /* Resolution logic:
119120 - * 1. There is a valid state with matching selector. Done.
119121 - * 2. Valid state with inappropriate selector. Skip.
119122 - *
119123 - * Entering area of "sysdeps".
119124 - *
119125 - * 3. If state is not valid, selector is temporary, it selects
119126 - * only session which triggered previous resolution. Key
119127 - * manager will do something to install a state with proper
119128 - * selector.
119129 - */
119130 - if (x->km.state == XFRM_STATE_VALID) {
119131 - if ((x->sel.family &&
119132 - !xfrm_selector_match(&x->sel, fl, x->sel.family)) ||
119133 - !security_xfrm_state_pol_flow_match(x, pol, fl))
119134 - return;
119135 -
119136 - if (!*best ||
119137 - (*best)->km.dying > x->km.dying ||
119138 - ((*best)->km.dying == x->km.dying &&
119139 - (*best)->curlft.add_time < x->curlft.add_time))
119140 - *best = x;
119141 - } else if (x->km.state == XFRM_STATE_ACQ) {
119142 - *acq_in_progress = 1;
119143 - } else if (x->km.state == XFRM_STATE_ERROR ||
119144 - x->km.state == XFRM_STATE_EXPIRED) {
119145 - if (xfrm_selector_match(&x->sel, fl, x->sel.family) &&
119146 - security_xfrm_state_pol_flow_match(x, pol, fl))
119147 - *error = -ESRCH;
119148 - }
119149 -}
119150 -
119151 struct xfrm_state *
119152 xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr,
119153 struct flowi *fl, struct xfrm_tmpl *tmpl,
119154 struct xfrm_policy *pol, int *err,
119155 unsigned short family)
119156 {
119157 - static xfrm_address_t saddr_wildcard = { };
119158 struct net *net = xp_net(pol);
119159 unsigned int h;
119160 struct hlist_node *entry;
119161 @@ -812,27 +773,40 @@
119162 xfrm_state_addr_check(x, daddr, saddr, family) &&
119163 tmpl->mode == x->props.mode &&
119164 tmpl->id.proto == x->id.proto &&
119165 - (tmpl->id.spi == x->id.spi || !tmpl->id.spi))
119166 - xfrm_state_look_at(pol, x, fl, family, daddr, saddr,
119167 - &best, &acquire_in_progress, &error);
119168 - }
119169 - if (best)
119170 - goto found;
119171 -
119172 - h = xfrm_dst_hash(net, daddr, &saddr_wildcard, tmpl->reqid, family);
119173 - hlist_for_each_entry(x, entry, net->xfrm.state_bydst+h, bydst) {
119174 - if (x->props.family == family &&
119175 - x->props.reqid == tmpl->reqid &&
119176 - !(x->props.flags & XFRM_STATE_WILDRECV) &&
119177 - xfrm_state_addr_check(x, daddr, saddr, family) &&
119178 - tmpl->mode == x->props.mode &&
119179 - tmpl->id.proto == x->id.proto &&
119180 - (tmpl->id.spi == x->id.spi || !tmpl->id.spi))
119181 - xfrm_state_look_at(pol, x, fl, family, daddr, saddr,
119182 - &best, &acquire_in_progress, &error);
119183 + (tmpl->id.spi == x->id.spi || !tmpl->id.spi)) {
119184 + /* Resolution logic:
119185 + 1. There is a valid state with matching selector.
119186 + Done.
119187 + 2. Valid state with inappropriate selector. Skip.
119188 +
119189 + Entering area of "sysdeps".
119190 +
119191 + 3. If state is not valid, selector is temporary,
119192 + it selects only session which triggered
119193 + previous resolution. Key manager will do
119194 + something to install a state with proper
119195 + selector.
119196 + */
119197 + if (x->km.state == XFRM_STATE_VALID) {
119198 + if ((x->sel.family && !xfrm_selector_match(&x->sel, fl, x->sel.family)) ||
119199 + !security_xfrm_state_pol_flow_match(x, pol, fl))
119200 + continue;
119201 + if (!best ||
119202 + best->km.dying > x->km.dying ||
119203 + (best->km.dying == x->km.dying &&
119204 + best->curlft.add_time < x->curlft.add_time))
119205 + best = x;
119206 + } else if (x->km.state == XFRM_STATE_ACQ) {
119207 + acquire_in_progress = 1;
119208 + } else if (x->km.state == XFRM_STATE_ERROR ||
119209 + x->km.state == XFRM_STATE_EXPIRED) {
119210 + if (xfrm_selector_match(&x->sel, fl, x->sel.family) &&
119211 + security_xfrm_state_pol_flow_match(x, pol, fl))
119212 + error = -ESRCH;
119213 + }
119214 + }
119215 }
119216
119217 -found:
119218 x = best;
119219 if (!x && !error && !acquire_in_progress) {
119220 if (tmpl->id.spi &&
119221 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/README linux-2.6.29-rc3.owrt/README
119222 --- linux-2.6.29.owrt/README 2009-05-10 22:04:37.000000000 +0200
119223 +++ linux-2.6.29-rc3.owrt/README 2009-05-10 23:48:34.000000000 +0200
119224 @@ -188,7 +188,7 @@
119225 values to random values.
119226
119227 You can find more information on using the Linux kernel config tools
119228 - in Documentation/kbuild/kconfig.txt.
119229 + in Documentation/kbuild/make-configs.txt.
119230
119231 NOTES on "make config":
119232 - having unnecessary drivers will make the kernel bigger, and can
119233 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/scripts/bootgraph.pl linux-2.6.29-rc3.owrt/scripts/bootgraph.pl
119234 --- linux-2.6.29.owrt/scripts/bootgraph.pl 2009-05-10 22:04:38.000000000 +0200
119235 +++ linux-2.6.29-rc3.owrt/scripts/bootgraph.pl 2009-05-10 23:48:34.000000000 +0200
119236 @@ -51,7 +51,7 @@
119237
119238 while (<>) {
119239 my $line = $_;
119240 - if ($line =~ /([0-9\.]+)\] calling ([a-zA-Z0-9\_\.]+)\+/) {
119241 + if ($line =~ /([0-9\.]+)\] calling ([a-zA-Z0-9\_]+)\+/) {
119242 my $func = $2;
119243 if ($done == 0) {
119244 $start{$func} = $1;
119245 @@ -87,7 +87,7 @@
119246 $count = $count + 1;
119247 }
119248
119249 - if ($line =~ /([0-9\.]+)\] initcall ([a-zA-Z0-9\_\.]+)\+.*returned/) {
119250 + if ($line =~ /([0-9\.]+)\] initcall ([a-zA-Z0-9\_]+)\+.*returned/) {
119251 if ($done == 0) {
119252 $end{$2} = $1;
119253 $maxtime = $1;
119254 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/scripts/checkpatch.pl linux-2.6.29-rc3.owrt/scripts/checkpatch.pl
119255 --- linux-2.6.29.owrt/scripts/checkpatch.pl 2009-05-10 22:04:38.000000000 +0200
119256 +++ linux-2.6.29-rc3.owrt/scripts/checkpatch.pl 2009-05-10 23:48:34.000000000 +0200
119257 @@ -10,7 +10,7 @@
119258 my $P = $0;
119259 $P =~ s@.*/@@g;
119260
119261 -my $V = '0.28';
119262 +my $V = '0.27';
119263
119264 use Getopt::Long qw(:config no_auto_abbrev);
119265
119266 @@ -110,8 +110,7 @@
119267 __iomem|
119268 __must_check|
119269 __init_refok|
119270 - __kprobes|
119271 - __ref
119272 + __kprobes
119273 }x;
119274 our $Attribute = qr{
119275 const|
119276 @@ -1241,8 +1240,7 @@
119277 $realfile =~ s@^([^/]*)/@@;
119278
119279 $p1_prefix = $1;
119280 - if (!$file && $tree && $p1_prefix ne '' &&
119281 - -e "$root/$p1_prefix") {
119282 + if ($tree && $p1_prefix ne '' && -e "$root/$p1_prefix") {
119283 WARN("patch prefix '$p1_prefix' exists, appears to be a -p0 patch\n");
119284 }
119285
119286 @@ -1585,9 +1583,9 @@
119287 }
119288 # TEST: allow direct testing of the attribute matcher.
119289 if ($dbg_attr) {
119290 - if ($line =~ /^.\s*$Modifier\s*$/) {
119291 + if ($line =~ /^.\s*$Attribute\s*$/) {
119292 ERROR("TEST: is attr\n" . $herecurr);
119293 - } elsif ($dbg_attr > 1 && $line =~ /^.+($Modifier)/) {
119294 + } elsif ($dbg_attr > 1 && $line =~ /^.+($Attribute)/) {
119295 ERROR("TEST: is not attr ($1 is)\n". $herecurr);
119296 }
119297 next;
119298 @@ -1659,7 +1657,7 @@
119299
119300 # * goes on variable not on type
119301 # (char*[ const])
119302 - if ($line =~ m{\($NonptrType(\s*(?:$Modifier\b\s*|\*\s*)+)\)}) {
119303 + if ($line =~ m{\($NonptrType(\s*\*[\s\*]*(?:$Modifier\s*)*)\)}) {
119304 my ($from, $to) = ($1, $1);
119305
119306 # Should start with a space.
119307 @@ -1674,7 +1672,7 @@
119308 if ($from ne $to) {
119309 ERROR("\"(foo$from)\" should be \"(foo$to)\"\n" . $herecurr);
119310 }
119311 - } elsif ($line =~ m{\b$NonptrType(\s*(?:$Modifier\b\s*|\*\s*)+)($Ident)}) {
119312 + } elsif ($line =~ m{\b$NonptrType(\s*\*[\s\*]*(?:$Modifier\s*)?)($Ident)}) {
119313 my ($from, $to, $ident) = ($1, $1, $2);
119314
119315 # Should start with a space.
119316 @@ -1687,8 +1685,8 @@
119317 # Modifiers should have spaces.
119318 $to =~ s/(\b$Modifier$)/$1 /;
119319
119320 - #print "from<$from> to<$to> ident<$ident>\n";
119321 - if ($from ne $to && $ident !~ /^$Modifier$/) {
119322 + #print "from<$from> to<$to>\n";
119323 + if ($from ne $to) {
119324 ERROR("\"foo${from}bar\" should be \"foo${to}bar\"\n" . $herecurr);
119325 }
119326 }
119327 @@ -1887,11 +1885,11 @@
119328 if ($ctx !~ /[WEBC]x./ && $ca !~ /(?:\)|!|~|\*|-|\&|\||\+\+|\-\-|\{)$/) {
119329 ERROR("space required before that '$op' $at\n" . $hereptr);
119330 }
119331 - if ($op eq '*' && $cc =~/\s*$Modifier\b/) {
119332 + if ($op eq '*' && $cc =~/\s*const\b/) {
119333 # A unary '*' may be const
119334
119335 } elsif ($ctx =~ /.xW/) {
119336 - ERROR("Aspace prohibited after that '$op' $at\n" . $hereptr);
119337 + ERROR("space prohibited after that '$op' $at\n" . $hereptr);
119338 }
119339
119340 # unary ++ and unary -- are allowed no space on one side.
119341 @@ -2562,7 +2560,7 @@
119342 if ($line =~ /\bin_atomic\s*\(/) {
119343 if ($realfile =~ m@^drivers/@) {
119344 ERROR("do not use in_atomic in drivers\n" . $herecurr);
119345 - } elsif ($realfile !~ m@^kernel/@) {
119346 + } else {
119347 WARN("use of in_atomic() is incorrect outside core kernel code\n" . $herecurr);
119348 }
119349 }
119350 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/scripts/kconfig/conf.c linux-2.6.29-rc3.owrt/scripts/kconfig/conf.c
119351 --- linux-2.6.29.owrt/scripts/kconfig/conf.c 2009-05-10 22:04:38.000000000 +0200
119352 +++ linux-2.6.29-rc3.owrt/scripts/kconfig/conf.c 2009-05-10 23:48:34.000000000 +0200
119353 @@ -11,7 +11,6 @@
119354 #include <time.h>
119355 #include <unistd.h>
119356 #include <sys/stat.h>
119357 -#include <sys/time.h>
119358
119359 #define LKC_DIRECT_LINK
119360 #include "lkc.h"
119361 @@ -465,22 +464,9 @@
119362 input_mode = set_yes;
119363 break;
119364 case 'r':
119365 - {
119366 - struct timeval now;
119367 - unsigned int seed;
119368 -
119369 - /*
119370 - * Use microseconds derived seed,
119371 - * compensate for systems where it may be zero
119372 - */
119373 - gettimeofday(&now, NULL);
119374 -
119375 - seed = (unsigned int)((now.tv_sec + 1) * (now.tv_usec + 1));
119376 - srand(seed);
119377 -
119378 input_mode = set_random;
119379 + srand(time(NULL));
119380 break;
119381 - }
119382 case 'h':
119383 printf(_("See README for usage info\n"));
119384 exit(0);
119385 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/scripts/kconfig/confdata.c linux-2.6.29-rc3.owrt/scripts/kconfig/confdata.c
119386 --- linux-2.6.29.owrt/scripts/kconfig/confdata.c 2009-05-10 22:04:38.000000000 +0200
119387 +++ linux-2.6.29-rc3.owrt/scripts/kconfig/confdata.c 2009-05-10 23:48:34.000000000 +0200
119388 @@ -843,7 +843,7 @@
119389 default:
119390 continue;
119391 }
119392 - if (!(sym_is_choice(sym) && mode == def_random))
119393 + if (!sym_is_choice(sym) || mode != def_random)
119394 sym->flags |= SYMBOL_DEF_USER;
119395 break;
119396 default:
119397 @@ -856,49 +856,28 @@
119398
119399 if (mode != def_random)
119400 return;
119401 - /*
119402 - * We have different type of choice blocks.
119403 - * If curr.tri equal to mod then we can select several
119404 - * choice symbols in one block.
119405 - * In this case we do nothing.
119406 - * If curr.tri equal yes then only one symbol can be
119407 - * selected in a choice block and we set it to yes,
119408 - * and the rest to no.
119409 - */
119410 +
119411 for_all_symbols(i, csym) {
119412 if (sym_has_value(csym) || !sym_is_choice(csym))
119413 continue;
119414
119415 sym_calc_value(csym);
119416 -
119417 - if (csym->curr.tri != yes)
119418 - continue;
119419 -
119420 prop = sym_get_choice_prop(csym);
119421 -
119422 - /* count entries in choice block */
119423 - cnt = 0;
119424 - expr_list_for_each_sym(prop->expr, e, sym)
119425 - cnt++;
119426 -
119427 - /*
119428 - * find a random value and set it to yes,
119429 - * set the rest to no so we have only one set
119430 - */
119431 - def = (rand() % cnt);
119432 -
119433 - cnt = 0;
119434 - expr_list_for_each_sym(prop->expr, e, sym) {
119435 - if (def == cnt++) {
119436 - sym->def[S_DEF_USER].tri = yes;
119437 - csym->def[S_DEF_USER].val = sym;
119438 - }
119439 - else {
119440 - sym->def[S_DEF_USER].tri = no;
119441 + def = -1;
119442 + while (1) {
119443 + cnt = 0;
119444 + expr_list_for_each_sym(prop->expr, e, sym) {
119445 + if (sym->visible == no)
119446 + continue;
119447 + if (def == cnt++) {
119448 + csym->def[S_DEF_USER].val = sym;
119449 + break;
119450 + }
119451 }
119452 + if (def >= 0 || cnt < 2)
119453 + break;
119454 + def = (rand() % cnt) + 1;
119455 }
119456 csym->flags |= SYMBOL_DEF_USER;
119457 - /* clear VALID to get value calculated */
119458 - csym->flags &= ~(SYMBOL_VALID);
119459 }
119460 }
119461 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/scripts/kernel-doc linux-2.6.29-rc3.owrt/scripts/kernel-doc
119462 --- linux-2.6.29.owrt/scripts/kernel-doc 2009-05-10 22:04:38.000000000 +0200
119463 +++ linux-2.6.29-rc3.owrt/scripts/kernel-doc 2009-05-10 23:48:34.000000000 +0200
119464 @@ -1827,40 +1827,6 @@
119465 $state = 0;
119466 }
119467
119468 -sub syscall_munge() {
119469 - my $void = 0;
119470 -
119471 - $prototype =~ s@[\r\n\t]+@ @gos; # strip newlines/CR's/tabs
119472 -## if ($prototype =~ m/SYSCALL_DEFINE0\s*\(\s*(a-zA-Z0-9_)*\s*\)/) {
119473 - if ($prototype =~ m/SYSCALL_DEFINE0/) {
119474 - $void = 1;
119475 -## $prototype = "long sys_$1(void)";
119476 - }
119477 -
119478 - $prototype =~ s/SYSCALL_DEFINE.*\(/long sys_/; # fix return type & func name
119479 - if ($prototype =~ m/long (sys_.*?),/) {
119480 - $prototype =~ s/,/\(/;
119481 - } elsif ($void) {
119482 - $prototype =~ s/\)/\(void\)/;
119483 - }
119484 -
119485 - # now delete all of the odd-number commas in $prototype
119486 - # so that arg types & arg names don't have a comma between them
119487 - my $count = 0;
119488 - my $len = length($prototype);
119489 - if ($void) {
119490 - $len = 0; # skip the for-loop
119491 - }
119492 - for (my $ix = 0; $ix < $len; $ix++) {
119493 - if (substr($prototype, $ix, 1) eq ',') {
119494 - $count++;
119495 - if ($count % 2 == 1) {
119496 - substr($prototype, $ix, 1) = ' ';
119497 - }
119498 - }
119499 - }
119500 -}
119501 -
119502 sub process_state3_function($$) {
119503 my $x = shift;
119504 my $file = shift;
119505 @@ -1873,15 +1839,11 @@
119506 elsif ($x =~ /([^\{]*)/) {
119507 $prototype .= $1;
119508 }
119509 -
119510 if (($x =~ /\{/) || ($x =~ /\#\s*define/) || ($x =~ /;/)) {
119511 $prototype =~ s@/\*.*?\*/@@gos; # strip comments.
119512 $prototype =~ s@[\r\n]+@ @gos; # strip newlines/cr's.
119513 $prototype =~ s@^\s+@@gos; # strip leading spaces
119514 - if ($prototype =~ /SYSCALL_DEFINE/) {
119515 - syscall_munge();
119516 - }
119517 - dump_function($prototype, $file);
119518 + dump_function($prototype,$file);
119519 reset_state();
119520 }
119521 }
119522 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/scripts/markup_oops.pl linux-2.6.29-rc3.owrt/scripts/markup_oops.pl
119523 --- linux-2.6.29.owrt/scripts/markup_oops.pl 2009-05-10 22:04:38.000000000 +0200
119524 +++ linux-2.6.29-rc3.owrt/scripts/markup_oops.pl 2009-05-10 23:48:34.000000000 +0200
119525 @@ -1,4 +1,4 @@
119526 -#!/usr/bin/perl
119527 +#!/usr/bin/perl -w
119528
119529 use File::Basename;
119530
119531 @@ -29,151 +29,27 @@
119532 my $target = "0";
119533 my $function;
119534 my $module = "";
119535 -my $func_offset = 0;
119536 +my $func_offset;
119537 my $vmaoffset = 0;
119538
119539 -my %regs;
119540 -
119541 -
119542 -sub parse_x86_regs
119543 -{
119544 - my ($line) = @_;
119545 - if ($line =~ /EAX: ([0-9a-f]+) EBX: ([0-9a-f]+) ECX: ([0-9a-f]+) EDX: ([0-9a-f]+)/) {
119546 - $regs{"%eax"} = $1;
119547 - $regs{"%ebx"} = $2;
119548 - $regs{"%ecx"} = $3;
119549 - $regs{"%edx"} = $4;
119550 - }
119551 - if ($line =~ /ESI: ([0-9a-f]+) EDI: ([0-9a-f]+) EBP: ([0-9a-f]+) ESP: ([0-9a-f]+)/) {
119552 - $regs{"%esi"} = $1;
119553 - $regs{"%edi"} = $2;
119554 - $regs{"%esp"} = $4;
119555 - }
119556 - if ($line =~ /RAX: ([0-9a-f]+) RBX: ([0-9a-f]+) RCX: ([0-9a-f]+)/) {
119557 - $regs{"%eax"} = $1;
119558 - $regs{"%ebx"} = $2;
119559 - $regs{"%ecx"} = $3;
119560 - }
119561 - if ($line =~ /RDX: ([0-9a-f]+) RSI: ([0-9a-f]+) RDI: ([0-9a-f]+)/) {
119562 - $regs{"%edx"} = $1;
119563 - $regs{"%esi"} = $2;
119564 - $regs{"%edi"} = $3;
119565 - }
119566 - if ($line =~ /RBP: ([0-9a-f]+) R08: ([0-9a-f]+) R09: ([0-9a-f]+)/) {
119567 - $regs{"%r08"} = $2;
119568 - $regs{"%r09"} = $3;
119569 - }
119570 - if ($line =~ /R10: ([0-9a-f]+) R11: ([0-9a-f]+) R12: ([0-9a-f]+)/) {
119571 - $regs{"%r10"} = $1;
119572 - $regs{"%r11"} = $2;
119573 - $regs{"%r12"} = $3;
119574 - }
119575 - if ($line =~ /R13: ([0-9a-f]+) R14: ([0-9a-f]+) R15: ([0-9a-f]+)/) {
119576 - $regs{"%r13"} = $1;
119577 - $regs{"%r14"} = $2;
119578 - $regs{"%r15"} = $3;
119579 - }
119580 -}
119581 -
119582 -sub reg_name
119583 -{
119584 - my ($reg) = @_;
119585 - $reg =~ s/r(.)x/e\1x/;
119586 - $reg =~ s/r(.)i/e\1i/;
119587 - $reg =~ s/r(.)p/e\1p/;
119588 - return $reg;
119589 -}
119590 -
119591 -sub process_x86_regs
119592 -{
119593 - my ($line, $cntr) = @_;
119594 - my $str = "";
119595 - if (length($line) < 40) {
119596 - return ""; # not an asm istruction
119597 - }
119598 -
119599 - # find the arguments to the instruction
119600 - if ($line =~ /([0-9a-zA-Z\,\%\(\)\-\+]+)$/) {
119601 - $lastword = $1;
119602 - } else {
119603 - return "";
119604 - }
119605 -
119606 - # we need to find the registers that get clobbered,
119607 - # since their value is no longer relevant for previous
119608 - # instructions in the stream.
119609 -
119610 - $clobber = $lastword;
119611 - # first, remove all memory operands, they're read only
119612 - $clobber =~ s/\([a-z0-9\%\,]+\)//g;
119613 - # then, remove everything before the comma, thats the read part
119614 - $clobber =~ s/.*\,//g;
119615 -
119616 - # if this is the instruction that faulted, we haven't actually done
119617 - # the write yet... nothing is clobbered.
119618 - if ($cntr == 0) {
119619 - $clobber = "";
119620 - }
119621 -
119622 - foreach $reg (keys(%regs)) {
119623 - my $clobberprime = reg_name($clobber);
119624 - my $lastwordprime = reg_name($lastword);
119625 - my $val = $regs{$reg};
119626 - if ($val =~ /^[0]+$/) {
119627 - $val = "0";
119628 - } else {
119629 - $val =~ s/^0*//;
119630 - }
119631 -
119632 - # first check if we're clobbering this register; if we do
119633 - # we print it with a =>, and then delete its value
119634 - if ($clobber =~ /$reg/ || $clobberprime =~ /$reg/) {
119635 - if (length($val) > 0) {
119636 - $str = $str . " $reg => $val ";
119637 - }
119638 - $regs{$reg} = "";
119639 - $val = "";
119640 - }
119641 - # now check if we're reading this register
119642 - if ($lastword =~ /$reg/ || $lastwordprime =~ /$reg/) {
119643 - if (length($val) > 0) {
119644 - $str = $str . " $reg = $val ";
119645 - }
119646 - }
119647 - }
119648 - return $str;
119649 -}
119650 -
119651 -# parse the oops
119652 while (<STDIN>) {
119653 my $line = $_;
119654 if ($line =~ /EIP: 0060:\[\<([a-z0-9]+)\>\]/) {
119655 $target = $1;
119656 }
119657 - if ($line =~ /RIP: 0010:\[\<([a-z0-9]+)\>\]/) {
119658 - $target = $1;
119659 - }
119660 if ($line =~ /EIP is at ([a-zA-Z0-9\_]+)\+(0x[0-9a-f]+)\/0x[a-f0-9]/) {
119661 $function = $1;
119662 $func_offset = $2;
119663 }
119664 - if ($line =~ /RIP: 0010:\[\<[0-9a-f]+\>\] \[\<[0-9a-f]+\>\] ([a-zA-Z0-9\_]+)\+(0x[0-9a-f]+)\/0x[a-f0-9]/) {
119665 - $function = $1;
119666 - $func_offset = $2;
119667 - }
119668
119669 # check if it's a module
119670 if ($line =~ /EIP is at ([a-zA-Z0-9\_]+)\+(0x[0-9a-f]+)\/0x[a-f0-9]+\W\[([a-zA-Z0-9\_\-]+)\]/) {
119671 $module = $3;
119672 }
119673 - if ($line =~ /RIP: 0010:\[\<[0-9a-f]+\>\] \[\<[0-9a-f]+\>\] ([a-zA-Z0-9\_]+)\+(0x[0-9a-f]+)\/0x[a-f0-9]+\W\[([a-zA-Z0-9\_\-]+)\]/) {
119674 - $module = $3;
119675 - }
119676 - parse_x86_regs($line);
119677 }
119678
119679 my $decodestart = hex($target) - hex($func_offset);
119680 -my $decodestop = hex($target) + 8192;
119681 +my $decodestop = $decodestart + 8192;
119682 if ($target eq "0") {
119683 print "No oops found!\n";
119684 print "Usage: \n";
119685 @@ -208,7 +84,6 @@
119686 my $state = 0;
119687 my $center = 0;
119688 my @lines;
119689 -my @reglines;
119690
119691 sub InRange {
119692 my ($address, $target) = @_;
119693 @@ -313,36 +188,16 @@
119694
119695 my $i;
119696
119697 -
119698 -# start annotating the registers in the asm.
119699 -# this goes from the oopsing point back, so that the annotator
119700 -# can track (opportunistically) which registers got written and
119701 -# whos value no longer is relevant.
119702 -
119703 -$i = $center;
119704 -while ($i >= $start) {
119705 - $reglines[$i] = process_x86_regs($lines[$i], $center - $i);
119706 - $i = $i - 1;
119707 -}
119708 -
119709 +my $fulltext = "";
119710 $i = $start;
119711 while ($i < $finish) {
119712 - my $line;
119713 if ($i == $center) {
119714 - $line = "*$lines[$i] ";
119715 + $fulltext = $fulltext . "*$lines[$i] <----- faulting instruction\n";
119716 } else {
119717 - $line = " $lines[$i] ";
119718 - }
119719 - print $line;
119720 - if (defined($reglines[$i]) && length($reglines[$i]) > 0) {
119721 - my $c = 60 - length($line);
119722 - while ($c > 0) { print " "; $c = $c - 1; };
119723 - print "| $reglines[$i]";
119724 + $fulltext = $fulltext . " $lines[$i]\n";
119725 }
119726 - if ($i == $center) {
119727 - print "<--- faulting instruction";
119728 - }
119729 - print "\n";
119730 $i = $i +1;
119731 }
119732
119733 +print $fulltext;
119734 +
119735 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/scripts/mod/file2alias.c linux-2.6.29-rc3.owrt/scripts/mod/file2alias.c
119736 --- linux-2.6.29.owrt/scripts/mod/file2alias.c 2009-05-10 22:04:38.000000000 +0200
119737 +++ linux-2.6.29-rc3.owrt/scripts/mod/file2alias.c 2009-05-10 23:48:34.000000000 +0200
119738 @@ -210,7 +210,6 @@
119739 static int do_hid_entry(const char *filename,
119740 struct hid_device_id *id, char *alias)
119741 {
119742 - id->bus = TO_NATIVE(id->bus);
119743 id->vendor = TO_NATIVE(id->vendor);
119744 id->product = TO_NATIVE(id->product);
119745
119746 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/scripts/package/Makefile linux-2.6.29-rc3.owrt/scripts/package/Makefile
119747 --- linux-2.6.29.owrt/scripts/package/Makefile 2009-05-10 22:04:38.000000000 +0200
119748 +++ linux-2.6.29-rc3.owrt/scripts/package/Makefile 2009-05-10 23:48:34.000000000 +0200
119749 @@ -35,10 +35,9 @@
119750 rpm-pkg rpm: $(objtree)/kernel.spec FORCE
119751 $(MAKE) clean
119752 $(PREV) ln -sf $(srctree) $(KERNELPATH)
119753 - $(CONFIG_SHELL) $(srctree)/scripts/setlocalversion > $(objtree)/.scmversion
119754 $(PREV) tar -cz $(RCS_TAR_IGNORE) -f $(KERNELPATH).tar.gz $(KERNELPATH)/.
119755 $(PREV) rm $(KERNELPATH)
119756 - rm -f $(objtree)/.scmversion
119757 +
119758 set -e; \
119759 $(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version
119760 set -e; \
119761 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/scripts/package/mkspec linux-2.6.29-rc3.owrt/scripts/package/mkspec
119762 --- linux-2.6.29.owrt/scripts/package/mkspec 2009-05-10 22:04:38.000000000 +0200
119763 +++ linux-2.6.29-rc3.owrt/scripts/package/mkspec 2009-05-10 23:48:34.000000000 +0200
119764 @@ -86,17 +86,9 @@
119765 echo 'cp System.map $RPM_BUILD_ROOT'"/boot/System.map-$KERNELRELEASE"
119766
119767 echo 'cp .config $RPM_BUILD_ROOT'"/boot/config-$KERNELRELEASE"
119768 -
119769 -echo "%ifnarch ppc64"
119770 -echo 'cp vmlinux vmlinux.orig'
119771 -echo 'bzip2 -9 vmlinux'
119772 -echo 'mv vmlinux.bz2 $RPM_BUILD_ROOT'"/boot/vmlinux-$KERNELRELEASE.bz2"
119773 -echo 'mv vmlinux.orig vmlinux'
119774 -echo "%endif"
119775 -
119776 echo ""
119777 echo "%clean"
119778 -echo 'rm -rf $RPM_BUILD_ROOT'
119779 +echo '#echo -rf $RPM_BUILD_ROOT'
119780 echo ""
119781 echo "%files"
119782 echo '%defattr (-, root, root)'
119783 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/scripts/setlocalversion linux-2.6.29-rc3.owrt/scripts/setlocalversion
119784 --- linux-2.6.29.owrt/scripts/setlocalversion 2009-05-10 22:04:38.000000000 +0200
119785 +++ linux-2.6.29-rc3.owrt/scripts/setlocalversion 2009-05-10 23:48:34.000000000 +0200
119786 @@ -58,7 +58,14 @@
119787 # Check for svn and a svn repo.
119788 if rev=`svn info 2>/dev/null | grep '^Last Changed Rev'`; then
119789 rev=`echo $rev | awk '{print $NF}'`
119790 - printf -- '-svn%s' "$rev"
119791 + changes=`svn status 2>/dev/null | grep '^[AMD]' | wc -l`
119792 +
119793 + # Are there uncommitted changes?
119794 + if [ $changes != 0 ]; then
119795 + printf -- '-svn%s%s' "$rev" -dirty
119796 + else
119797 + printf -- '-svn%s' "$rev"
119798 + fi
119799
119800 # All done with svn
119801 exit
119802 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/scripts/tags.sh linux-2.6.29-rc3.owrt/scripts/tags.sh
119803 --- linux-2.6.29.owrt/scripts/tags.sh 2009-05-10 22:04:38.000000000 +0200
119804 +++ linux-2.6.29-rc3.owrt/scripts/tags.sh 2009-05-10 23:48:34.000000000 +0200
119805 @@ -76,10 +76,7 @@
119806
119807 all_kconfigs()
119808 {
119809 - for arch in $ALLSOURCE_ARCHS; do
119810 - find_sources $arch 'Kconfig*'
119811 - done
119812 - find_other_sources 'Kconfig*'
119813 + find_sources $ALLSOURCE_ARCHS 'Kconfig*'
119814 }
119815
119816 all_defconfigs()
119817 @@ -102,8 +99,7 @@
119818 -I ____cacheline_internodealigned_in_smp \
119819 -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
119820 --extra=+f --c-kinds=+px \
119821 - --regex-asm='/^ENTRY\(([^)]*)\).*/\1/' \
119822 - --regex-c='/^SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/sys_\1/'
119823 + --regex-asm='/^ENTRY\(([^)]*)\).*/\1/'
119824
119825 all_kconfigs | xargs $1 -a \
119826 --langdef=kconfig --language-force=kconfig \
119827 @@ -121,9 +117,7 @@
119828
119829 emacs()
119830 {
119831 - all_sources | xargs $1 -a \
119832 - --regex='/^ENTRY(\([^)]*\)).*/\1/' \
119833 - --regex='/^SYSCALL_DEFINE[0-9]?(\([^,)]*\).*/sys_\1/'
119834 + all_sources | xargs $1 -a
119835
119836 all_kconfigs | xargs $1 -a \
119837 --regex='/^[ \t]*\(\(menu\)*config\)[ \t]+\([a-zA-Z0-9_]+\)/\3/'
119838 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/scripts/unifdef.c linux-2.6.29-rc3.owrt/scripts/unifdef.c
119839 --- linux-2.6.29.owrt/scripts/unifdef.c 2009-05-10 22:04:38.000000000 +0200
119840 +++ linux-2.6.29-rc3.owrt/scripts/unifdef.c 2009-05-10 23:48:34.000000000 +0200
119841 @@ -206,7 +206,7 @@
119842 static void error(const char *);
119843 static int findsym(const char *);
119844 static void flushline(bool);
119845 -static Linetype get_line(void);
119846 +static Linetype getline(void);
119847 static Linetype ifeval(const char **);
119848 static void ignoreoff(void);
119849 static void ignoreon(void);
119850 @@ -512,7 +512,7 @@
119851
119852 for (;;) {
119853 linenum++;
119854 - lineval = get_line();
119855 + lineval = getline();
119856 trans_table[ifstate[depth]][lineval]();
119857 debug("process %s -> %s depth %d",
119858 linetype_name[lineval],
119859 @@ -526,7 +526,7 @@
119860 * help from skipcomment().
119861 */
119862 static Linetype
119863 -get_line(void)
119864 +getline(void)
119865 {
119866 const char *cp;
119867 int cursym;
119868 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/security/selinux/netlabel.c linux-2.6.29-rc3.owrt/security/selinux/netlabel.c
119869 --- linux-2.6.29.owrt/security/selinux/netlabel.c 2009-05-10 22:04:39.000000000 +0200
119870 +++ linux-2.6.29-rc3.owrt/security/selinux/netlabel.c 2009-05-10 23:48:34.000000000 +0200
119871 @@ -386,12 +386,11 @@
119872 if (!S_ISSOCK(inode->i_mode) ||
119873 ((mask & (MAY_WRITE | MAY_APPEND)) == 0))
119874 return 0;
119875 +
119876 sock = SOCKET_I(inode);
119877 sk = sock->sk;
119878 - if (sk == NULL)
119879 - return 0;
119880 sksec = sk->sk_security;
119881 - if (sksec == NULL || sksec->nlbl_state != NLBL_REQUIRE)
119882 + if (sksec->nlbl_state != NLBL_REQUIRE)
119883 return 0;
119884
119885 local_bh_disable();
119886 @@ -491,10 +490,8 @@
119887 lock_sock(sk);
119888 rc = netlbl_sock_getattr(sk, &secattr);
119889 release_sock(sk);
119890 - if (rc == 0)
119891 + if (rc == 0 && secattr.flags != NETLBL_SECATTR_NONE)
119892 rc = -EACCES;
119893 - else if (rc == -ENOMSG)
119894 - rc = 0;
119895 netlbl_secattr_destroy(&secattr);
119896 }
119897
119898 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/security/smack/smackfs.c linux-2.6.29-rc3.owrt/security/smack/smackfs.c
119899 --- linux-2.6.29.owrt/security/smack/smackfs.c 2009-05-10 22:04:39.000000000 +0200
119900 +++ linux-2.6.29-rc3.owrt/security/smack/smackfs.c 2009-05-10 23:48:34.000000000 +0200
119901 @@ -650,6 +650,10 @@
119902
119903 return skp;
119904 }
119905 +/*
119906 +#define BEMASK 0x80000000
119907 +*/
119908 +#define BEMASK 0x00000001
119909 #define BEBITS (sizeof(__be32) * 8)
119910
119911 /*
119912 @@ -659,10 +663,12 @@
119913 {
119914 struct smk_netlbladdr *skp = (struct smk_netlbladdr *) v;
119915 unsigned char *hp = (char *) &skp->smk_host.sin_addr.s_addr;
119916 - int maskn;
119917 - u32 temp_mask = be32_to_cpu(skp->smk_mask.s_addr);
119918 + __be32 bebits;
119919 + int maskn = 0;
119920
119921 - for (maskn = 0; temp_mask; temp_mask <<= 1, maskn++);
119922 + for (bebits = BEMASK; bebits != 0; maskn++, bebits <<= 1)
119923 + if ((skp->smk_mask.s_addr & bebits) == 0)
119924 + break;
119925
119926 seq_printf(s, "%u.%u.%u.%u/%d %s\n",
119927 hp[0], hp[1], hp[2], hp[3], maskn, skp->smk_label);
119928 @@ -696,42 +702,6 @@
119929 }
119930
119931 /**
119932 - * smk_netlbladdr_insert
119933 - * @new : netlabel to insert
119934 - *
119935 - * This helper insert netlabel in the smack_netlbladdrs list
119936 - * sorted by netmask length (longest to smallest)
119937 - */
119938 -static void smk_netlbladdr_insert(struct smk_netlbladdr *new)
119939 -{
119940 - struct smk_netlbladdr *m;
119941 -
119942 - if (smack_netlbladdrs == NULL) {
119943 - smack_netlbladdrs = new;
119944 - return;
119945 - }
119946 -
119947 - /* the comparison '>' is a bit hacky, but works */
119948 - if (new->smk_mask.s_addr > smack_netlbladdrs->smk_mask.s_addr) {
119949 - new->smk_next = smack_netlbladdrs;
119950 - smack_netlbladdrs = new;
119951 - return;
119952 - }
119953 - for (m = smack_netlbladdrs; m != NULL; m = m->smk_next) {
119954 - if (m->smk_next == NULL) {
119955 - m->smk_next = new;
119956 - return;
119957 - }
119958 - if (new->smk_mask.s_addr > m->smk_next->smk_mask.s_addr) {
119959 - new->smk_next = m->smk_next;
119960 - m->smk_next = new;
119961 - return;
119962 - }
119963 - }
119964 -}
119965 -
119966 -
119967 -/**
119968 * smk_write_netlbladdr - write() for /smack/netlabel
119969 * @filp: file pointer, not actually used
119970 * @buf: where to get the data from
119971 @@ -754,9 +724,8 @@
119972 struct netlbl_audit audit_info;
119973 struct in_addr mask;
119974 unsigned int m;
119975 - u32 mask_bits = (1<<31);
119976 + __be32 bebits = BEMASK;
119977 __be32 nsa;
119978 - u32 temp_mask;
119979
119980 /*
119981 * Must have privilege.
119982 @@ -792,13 +761,10 @@
119983 if (sp == NULL)
119984 return -EINVAL;
119985
119986 - for (temp_mask = 0; m > 0; m--) {
119987 - temp_mask |= mask_bits;
119988 - mask_bits >>= 1;
119989 + for (mask.s_addr = 0; m > 0; m--) {
119990 + mask.s_addr |= bebits;
119991 + bebits <<= 1;
119992 }
119993 - mask.s_addr = cpu_to_be32(temp_mask);
119994 -
119995 - newname.sin_addr.s_addr &= mask.s_addr;
119996 /*
119997 * Only allow one writer at a time. Writes should be
119998 * quite rare and small in any case.
119999 @@ -806,7 +772,6 @@
120000 mutex_lock(&smk_netlbladdr_lock);
120001
120002 nsa = newname.sin_addr.s_addr;
120003 - /* try to find if the prefix is already in the list */
120004 for (skp = smack_netlbladdrs; skp != NULL; skp = skp->smk_next)
120005 if (skp->smk_host.sin_addr.s_addr == nsa &&
120006 skp->smk_mask.s_addr == mask.s_addr)
120007 @@ -822,8 +787,9 @@
120008 rc = 0;
120009 skp->smk_host.sin_addr.s_addr = newname.sin_addr.s_addr;
120010 skp->smk_mask.s_addr = mask.s_addr;
120011 + skp->smk_next = smack_netlbladdrs;
120012 skp->smk_label = sp;
120013 - smk_netlbladdr_insert(skp);
120014 + smack_netlbladdrs = skp;
120015 }
120016 } else {
120017 rc = netlbl_cfg_unlbl_static_del(&init_net, NULL,
120018 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/security/smack/smack_lsm.c linux-2.6.29-rc3.owrt/security/smack/smack_lsm.c
120019 --- linux-2.6.29.owrt/security/smack/smack_lsm.c 2009-05-10 22:04:39.000000000 +0200
120020 +++ linux-2.6.29-rc3.owrt/security/smack/smack_lsm.c 2009-05-10 23:48:34.000000000 +0200
120021 @@ -1498,31 +1498,58 @@
120022 * looks for host based access restrictions
120023 *
120024 * This version will only be appropriate for really small
120025 - * sets of single label hosts.
120026 + * sets of single label hosts. Because of the masking
120027 + * it cannot shortcut out on the first match. There are
120028 + * numerious ways to address the problem, but none of them
120029 + * have been applied here.
120030 *
120031 * Returns the label of the far end or NULL if it's not special.
120032 */
120033 static char *smack_host_label(struct sockaddr_in *sip)
120034 {
120035 struct smk_netlbladdr *snp;
120036 + char *bestlabel = NULL;
120037 struct in_addr *siap = &sip->sin_addr;
120038 + struct in_addr *liap;
120039 + struct in_addr *miap;
120040 + struct in_addr bestmask;
120041
120042 if (siap->s_addr == 0)
120043 return NULL;
120044
120045 + bestmask.s_addr = 0;
120046 +
120047 for (snp = smack_netlbladdrs; snp != NULL; snp = snp->smk_next) {
120048 + liap = &snp->smk_host.sin_addr;
120049 + miap = &snp->smk_mask;
120050 + /*
120051 + * If the addresses match after applying the list entry mask
120052 + * the entry matches the address. If it doesn't move along to
120053 + * the next entry.
120054 + */
120055 + if ((liap->s_addr & miap->s_addr) !=
120056 + (siap->s_addr & miap->s_addr))
120057 + continue;
120058 /*
120059 - * we break after finding the first match because
120060 - * the list is sorted from longest to shortest mask
120061 - * so we have found the most specific match
120062 + * If the list entry mask identifies a single address
120063 + * it can't get any more specific.
120064 */
120065 - if ((&snp->smk_host.sin_addr)->s_addr ==
120066 - (siap->s_addr & (&snp->smk_mask)->s_addr)) {
120067 + if (miap->s_addr == 0xffffffff)
120068 return snp->smk_label;
120069 - }
120070 + /*
120071 + * If the list entry mask is less specific than the best
120072 + * already found this entry is uninteresting.
120073 + */
120074 + if ((miap->s_addr | bestmask.s_addr) == bestmask.s_addr)
120075 + continue;
120076 + /*
120077 + * This is better than any entry found so far.
120078 + */
120079 + bestmask.s_addr = miap->s_addr;
120080 + bestlabel = snp->smk_label;
120081 }
120082
120083 - return NULL;
120084 + return bestlabel;
120085 }
120086
120087 /**
120088 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/arm/aaci.c linux-2.6.29-rc3.owrt/sound/arm/aaci.c
120089 --- linux-2.6.29.owrt/sound/arm/aaci.c 2009-05-10 22:04:39.000000000 +0200
120090 +++ linux-2.6.29-rc3.owrt/sound/arm/aaci.c 2009-05-10 23:48:34.000000000 +0200
120091 @@ -90,7 +90,7 @@
120092 */
120093 do {
120094 v = readl(aaci->base + AACI_SLFR);
120095 - } while ((v & (SLFR_1TXB|SLFR_2TXB)) && --timeout);
120096 + } while ((v & (SLFR_1TXB|SLFR_2TXB)) && timeout--);
120097
120098 if (!timeout)
120099 dev_err(&aaci->dev->dev,
120100 @@ -126,7 +126,7 @@
120101 */
120102 do {
120103 v = readl(aaci->base + AACI_SLFR);
120104 - } while ((v & SLFR_1TXB) && --timeout);
120105 + } while ((v & SLFR_1TXB) && timeout--);
120106
120107 if (!timeout) {
120108 dev_err(&aaci->dev->dev, "timeout on slot 1 TX busy\n");
120109 @@ -147,7 +147,7 @@
120110 do {
120111 cond_resched();
120112 v = readl(aaci->base + AACI_SLFR) & (SLFR_1RXV|SLFR_2RXV);
120113 - } while ((v != (SLFR_1RXV|SLFR_2RXV)) && --timeout);
120114 + } while ((v != (SLFR_1RXV|SLFR_2RXV)) && timeout--);
120115
120116 if (!timeout) {
120117 dev_err(&aaci->dev->dev, "timeout on RX valid\n");
120118 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/core/jack.c linux-2.6.29-rc3.owrt/sound/core/jack.c
120119 --- linux-2.6.29.owrt/sound/core/jack.c 2009-05-10 22:04:39.000000000 +0200
120120 +++ linux-2.6.29-rc3.owrt/sound/core/jack.c 2009-05-10 23:48:34.000000000 +0200
120121 @@ -47,7 +47,7 @@
120122 int err;
120123
120124 snprintf(jack->name, sizeof(jack->name), "%s %s",
120125 - card->shortname, jack->id);
120126 + card->longname, jack->id);
120127 jack->input_dev->name = jack->name;
120128
120129 /* Default to the sound card device. */
120130 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/core/oss/mixer_oss.c linux-2.6.29-rc3.owrt/sound/core/oss/mixer_oss.c
120131 --- linux-2.6.29.owrt/sound/core/oss/mixer_oss.c 2009-05-10 22:04:39.000000000 +0200
120132 +++ linux-2.6.29-rc3.owrt/sound/core/oss/mixer_oss.c 2009-05-10 23:48:34.000000000 +0200
120133 @@ -692,9 +692,6 @@
120134 snd_mixer_oss_put_volume1_vol(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PVOLUME], left, right);
120135 if (slot->present & SNDRV_MIXER_OSS_PRESENT_CVOLUME)
120136 snd_mixer_oss_put_volume1_vol(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_CVOLUME], left, right);
120137 - } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_CVOLUME) {
120138 - snd_mixer_oss_put_volume1_vol(fmixer, pslot,
120139 - slot->numid[SNDRV_MIXER_OSS_ITEM_CVOLUME], left, right);
120140 } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_GVOLUME) {
120141 snd_mixer_oss_put_volume1_vol(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_GVOLUME], left, right);
120142 } else if (slot->present & SNDRV_MIXER_OSS_PRESENT_GLOBAL) {
120143 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/core/oss/pcm_oss.c linux-2.6.29-rc3.owrt/sound/core/oss/pcm_oss.c
120144 --- linux-2.6.29.owrt/sound/core/oss/pcm_oss.c 2009-05-10 22:04:39.000000000 +0200
120145 +++ linux-2.6.29-rc3.owrt/sound/core/oss/pcm_oss.c 2009-05-10 23:48:34.000000000 +0200
120146 @@ -1767,7 +1767,7 @@
120147 AFMT_S8 | AFMT_U16_LE |
120148 AFMT_U16_BE |
120149 AFMT_S32_LE | AFMT_S32_BE |
120150 - AFMT_S24_LE | AFMT_S24_BE |
120151 + AFMT_S24_LE | AFMT_S24_LE |
120152 AFMT_S24_PACKED;
120153 params = kmalloc(sizeof(*params), GFP_KERNEL);
120154 if (!params)
120155 @@ -2872,7 +2872,7 @@
120156 setup = kmalloc(sizeof(*setup), GFP_KERNEL);
120157 if (! setup) {
120158 buffer->error = -ENOMEM;
120159 - mutex_unlock(&pstr->oss.setup_mutex);
120160 + mutex_lock(&pstr->oss.setup_mutex);
120161 return;
120162 }
120163 if (pstr->oss.setup_list == NULL)
120164 @@ -2886,7 +2886,7 @@
120165 if (! template.task_name) {
120166 kfree(setup);
120167 buffer->error = -ENOMEM;
120168 - mutex_unlock(&pstr->oss.setup_mutex);
120169 + mutex_lock(&pstr->oss.setup_mutex);
120170 return;
120171 }
120172 }
120173 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/core/oss/rate.c linux-2.6.29-rc3.owrt/sound/core/oss/rate.c
120174 --- linux-2.6.29.owrt/sound/core/oss/rate.c 2009-05-10 22:04:39.000000000 +0200
120175 +++ linux-2.6.29-rc3.owrt/sound/core/oss/rate.c 2009-05-10 23:48:34.000000000 +0200
120176 @@ -157,7 +157,7 @@
120177 while (dst_frames1 > 0) {
120178 S1 = S2;
120179 if (src_frames1-- > 0) {
120180 - S2 = *src;
120181 + S1 = *src;
120182 src += src_step;
120183 }
120184 if (pos & ~R_MASK) {
120185 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/core/sgbuf.c linux-2.6.29-rc3.owrt/sound/core/sgbuf.c
120186 --- linux-2.6.29.owrt/sound/core/sgbuf.c 2009-05-10 22:04:39.000000000 +0200
120187 +++ linux-2.6.29-rc3.owrt/sound/core/sgbuf.c 2009-05-10 23:48:34.000000000 +0200
120188 @@ -38,10 +38,6 @@
120189 if (! sgbuf)
120190 return -EINVAL;
120191
120192 - if (dmab->area)
120193 - vunmap(dmab->area);
120194 - dmab->area = NULL;
120195 -
120196 tmpb.dev.type = SNDRV_DMA_TYPE_DEV;
120197 tmpb.dev.dev = sgbuf->dev;
120198 for (i = 0; i < sgbuf->pages; i++) {
120199 @@ -52,6 +48,9 @@
120200 tmpb.bytes = (sgbuf->table[i].addr & ~PAGE_MASK) << PAGE_SHIFT;
120201 snd_dma_free_pages(&tmpb);
120202 }
120203 + if (dmab->area)
120204 + vunmap(dmab->area);
120205 + dmab->area = NULL;
120206
120207 kfree(sgbuf->table);
120208 kfree(sgbuf->page_table);
120209 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/drivers/mtpav.c linux-2.6.29-rc3.owrt/sound/drivers/mtpav.c
120210 --- linux-2.6.29.owrt/sound/drivers/mtpav.c 2009-05-10 22:04:39.000000000 +0200
120211 +++ linux-2.6.29-rc3.owrt/sound/drivers/mtpav.c 2009-05-10 23:48:34.000000000 +0200
120212 @@ -706,6 +706,7 @@
120213 mtp_card->card = card;
120214 mtp_card->irq = -1;
120215 mtp_card->share_irq = 0;
120216 + mtp_card->inmidiport = 0xffffffff;
120217 mtp_card->inmidistate = 0;
120218 mtp_card->outmidihwport = 0xffffffff;
120219 init_timer(&mtp_card->timer);
120220 @@ -718,8 +719,6 @@
120221 if (err < 0)
120222 goto __error;
120223
120224 - mtp_card->inmidiport = mtp_card->num_ports + MTPAV_PIDX_BROADCAST;
120225 -
120226 err = snd_mtpav_get_ISA(mtp_card);
120227 if (err < 0)
120228 goto __error;
120229 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/isa/opl3sa2.c linux-2.6.29-rc3.owrt/sound/isa/opl3sa2.c
120230 --- linux-2.6.29.owrt/sound/isa/opl3sa2.c 2009-05-10 22:04:39.000000000 +0200
120231 +++ linux-2.6.29-rc3.owrt/sound/isa/opl3sa2.c 2009-05-10 23:48:34.000000000 +0200
120232 @@ -550,27 +550,21 @@
120233 #ifdef CONFIG_PM
120234 static int snd_opl3sa2_suspend(struct snd_card *card, pm_message_t state)
120235 {
120236 - if (card) {
120237 - struct snd_opl3sa2 *chip = card->private_data;
120238 + struct snd_opl3sa2 *chip = card->private_data;
120239
120240 - snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
120241 - chip->wss->suspend(chip->wss);
120242 - /* power down */
120243 - snd_opl3sa2_write(chip, OPL3SA2_PM_CTRL, OPL3SA2_PM_D3);
120244 - }
120245 + snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
120246 + chip->wss->suspend(chip->wss);
120247 + /* power down */
120248 + snd_opl3sa2_write(chip, OPL3SA2_PM_CTRL, OPL3SA2_PM_D3);
120249
120250 return 0;
120251 }
120252
120253 static int snd_opl3sa2_resume(struct snd_card *card)
120254 {
120255 - struct snd_opl3sa2 *chip;
120256 + struct snd_opl3sa2 *chip = card->private_data;
120257 int i;
120258
120259 - if (!card)
120260 - return 0;
120261 -
120262 - chip = card->private_data;
120263 /* power up */
120264 snd_opl3sa2_write(chip, OPL3SA2_PM_CTRL, OPL3SA2_PM_D0);
120265
120266 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/oss/dmasound/dmasound_atari.c linux-2.6.29-rc3.owrt/sound/oss/dmasound/dmasound_atari.c
120267 --- linux-2.6.29.owrt/sound/oss/dmasound/dmasound_atari.c 2009-05-10 22:04:39.000000000 +0200
120268 +++ linux-2.6.29-rc3.owrt/sound/oss/dmasound/dmasound_atari.c 2009-05-10 23:48:34.000000000 +0200
120269 @@ -847,23 +847,23 @@
120270 of events. So all we need to keep the music playing is
120271 to provide the sound hardware with new data upon
120272 an interrupt from timer A. */
120273 - st_mfp.tim_ct_a = 0; /* ++roman: Stop timer before programming! */
120274 - st_mfp.tim_dt_a = 1; /* Cause interrupt after first event. */
120275 - st_mfp.tim_ct_a = 8; /* Turn on event counting. */
120276 + mfp.tim_ct_a = 0; /* ++roman: Stop timer before programming! */
120277 + mfp.tim_dt_a = 1; /* Cause interrupt after first event. */
120278 + mfp.tim_ct_a = 8; /* Turn on event counting. */
120279 /* Register interrupt handler. */
120280 if (request_irq(IRQ_MFP_TIMA, AtaInterrupt, IRQ_TYPE_SLOW, "DMA sound",
120281 AtaInterrupt))
120282 return 0;
120283 - st_mfp.int_en_a |= 0x20; /* Turn interrupt on. */
120284 - st_mfp.int_mk_a |= 0x20;
120285 + mfp.int_en_a |= 0x20; /* Turn interrupt on. */
120286 + mfp.int_mk_a |= 0x20;
120287 return 1;
120288 }
120289
120290 #ifdef MODULE
120291 static void AtaIrqCleanUp(void)
120292 {
120293 - st_mfp.tim_ct_a = 0; /* stop timer */
120294 - st_mfp.int_en_a &= ~0x20; /* turn interrupt off */
120295 + mfp.tim_ct_a = 0; /* stop timer */
120296 + mfp.int_en_a &= ~0x20; /* turn interrupt off */
120297 free_irq(IRQ_MFP_TIMA, AtaInterrupt);
120298 }
120299 #endif /* MODULE */
120300 @@ -1599,7 +1599,7 @@
120301 is_falcon = 0;
120302 } else
120303 return -ENODEV;
120304 - if ((st_mfp.int_en_a & st_mfp.int_mk_a & 0x20) == 0)
120305 + if ((mfp.int_en_a & mfp.int_mk_a & 0x20) == 0)
120306 return dmasound_init();
120307 else {
120308 printk("DMA sound driver: Timer A interrupt already in use\n");
120309 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/pci/aw2/aw2-alsa.c linux-2.6.29-rc3.owrt/sound/pci/aw2/aw2-alsa.c
120310 --- linux-2.6.29.owrt/sound/pci/aw2/aw2-alsa.c 2009-05-10 22:04:39.000000000 +0200
120311 +++ linux-2.6.29-rc3.owrt/sound/pci/aw2/aw2-alsa.c 2009-05-10 23:48:34.000000000 +0200
120312 @@ -165,7 +165,7 @@
120313 MODULE_PARM_DESC(enable, "Enable Audiowerk2 soundcard.");
120314
120315 static struct pci_device_id snd_aw2_ids[] = {
120316 - {PCI_VENDOR_ID_SAA7146, PCI_DEVICE_ID_SAA7146, 0, 0,
120317 + {PCI_VENDOR_ID_SAA7146, PCI_DEVICE_ID_SAA7146, PCI_ANY_ID, PCI_ANY_ID,
120318 0, 0, 0},
120319 {0}
120320 };
120321 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/pci/emu10k1/emu10k1_main.c linux-2.6.29-rc3.owrt/sound/pci/emu10k1/emu10k1_main.c
120322 --- linux-2.6.29.owrt/sound/pci/emu10k1/emu10k1_main.c 2009-05-10 22:04:39.000000000 +0200
120323 +++ linux-2.6.29-rc3.owrt/sound/pci/emu10k1/emu10k1_main.c 2009-05-10 23:48:34.000000000 +0200
120324 @@ -1528,7 +1528,6 @@
120325 .ca0151_chip = 1,
120326 .spk71 = 1,
120327 .spdif_bug = 1,
120328 - .invert_shared_spdif = 1, /* digital/analog switch swapped */
120329 .ac97_chip = 1} ,
120330 {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x10021102,
120331 .driver = "Audigy2", .name = "SB Audigy 2 Platinum [SB0240P]",
120332 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/pci/hda/hda_codec.c linux-2.6.29-rc3.owrt/sound/pci/hda/hda_codec.c
120333 --- linux-2.6.29.owrt/sound/pci/hda/hda_codec.c 2009-05-10 22:04:39.000000000 +0200
120334 +++ linux-2.6.29-rc3.owrt/sound/pci/hda/hda_codec.c 2009-05-10 23:48:34.000000000 +0200
120335 @@ -487,6 +487,7 @@
120336 {
120337 struct hda_bus *bus;
120338 int err;
120339 + char qname[8];
120340 static struct snd_device_ops dev_ops = {
120341 .dev_register = snd_hda_bus_dev_register,
120342 .dev_free = snd_hda_bus_dev_free,
120343 @@ -516,12 +517,10 @@
120344 mutex_init(&bus->cmd_mutex);
120345 INIT_LIST_HEAD(&bus->codec_list);
120346
120347 - snprintf(bus->workq_name, sizeof(bus->workq_name),
120348 - "hd-audio%d", card->number);
120349 - bus->workq = create_singlethread_workqueue(bus->workq_name);
120350 + snprintf(qname, sizeof(qname), "hda%d", card->number);
120351 + bus->workq = create_workqueue(qname);
120352 if (!bus->workq) {
120353 - snd_printk(KERN_ERR "cannot create workqueue %s\n",
120354 - bus->workq_name);
120355 + snd_printk(KERN_ERR "cannot create workqueue %s\n", qname);
120356 kfree(bus);
120357 return -ENOMEM;
120358 }
120359 @@ -3088,16 +3087,6 @@
120360 }
120361 EXPORT_SYMBOL_HDA(snd_hda_multi_out_dig_prepare);
120362
120363 -int snd_hda_multi_out_dig_cleanup(struct hda_codec *codec,
120364 - struct hda_multi_out *mout)
120365 -{
120366 - mutex_lock(&codec->spdif_mutex);
120367 - cleanup_dig_out_stream(codec, mout->dig_out_nid);
120368 - mutex_unlock(&codec->spdif_mutex);
120369 - return 0;
120370 -}
120371 -EXPORT_SYMBOL_HDA(snd_hda_multi_out_dig_cleanup);
120372 -
120373 /*
120374 * release the digital out
120375 */
120376 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/pci/hda/hda_codec.h linux-2.6.29-rc3.owrt/sound/pci/hda/hda_codec.h
120377 --- linux-2.6.29.owrt/sound/pci/hda/hda_codec.h 2009-05-10 22:04:39.000000000 +0200
120378 +++ linux-2.6.29-rc3.owrt/sound/pci/hda/hda_codec.h 2009-05-10 23:48:34.000000000 +0200
120379 @@ -614,7 +614,6 @@
120380
120381 /* unsolicited event queue */
120382 struct hda_bus_unsolicited *unsol;
120383 - char workq_name[16];
120384 struct workqueue_struct *workq; /* common workqueue for codecs */
120385
120386 /* assigned PCMs */
120387 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/pci/hda/hda_hwdep.c linux-2.6.29-rc3.owrt/sound/pci/hda/hda_hwdep.c
120388 --- linux-2.6.29.owrt/sound/pci/hda/hda_hwdep.c 2009-05-10 22:04:39.000000000 +0200
120389 +++ linux-2.6.29-rc3.owrt/sound/pci/hda/hda_hwdep.c 2009-05-10 23:48:34.000000000 +0200
120390 @@ -175,7 +175,7 @@
120391 err = snd_hda_codec_build_controls(codec);
120392 if (err < 0)
120393 return err;
120394 - return snd_card_register(codec->bus->card);
120395 + return 0;
120396 }
120397
120398 /*
120399 @@ -277,19 +277,18 @@
120400 {
120401 struct snd_hwdep *hwdep = dev_get_drvdata(dev);
120402 struct hda_codec *codec = hwdep->private_data;
120403 - struct hda_verb *v;
120404 - int nid, verb, param;
120405 + char *p;
120406 + struct hda_verb verb, *v;
120407
120408 - if (sscanf(buf, "%i %i %i", &nid, &verb, &param) != 3)
120409 - return -EINVAL;
120410 - if (!nid || !verb)
120411 + verb.nid = simple_strtoul(buf, &p, 0);
120412 + verb.verb = simple_strtoul(p, &p, 0);
120413 + verb.param = simple_strtoul(p, &p, 0);
120414 + if (!verb.nid || !verb.verb || !verb.param)
120415 return -EINVAL;
120416 v = snd_array_new(&codec->init_verbs);
120417 if (!v)
120418 return -ENOMEM;
120419 - v->nid = nid;
120420 - v->verb = verb;
120421 - v->param = param;
120422 + *v = verb;
120423 return count;
120424 }
120425
120426 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/pci/hda/hda_intel.c linux-2.6.29-rc3.owrt/sound/pci/hda/hda_intel.c
120427 --- linux-2.6.29.owrt/sound/pci/hda/hda_intel.c 2009-05-10 22:04:39.000000000 +0200
120428 +++ linux-2.6.29-rc3.owrt/sound/pci/hda/hda_intel.c 2009-05-10 23:48:34.000000000 +0200
120429 @@ -1947,13 +1947,16 @@
120430 return 0;
120431 }
120432
120433 +static int azx_resume_early(struct pci_dev *pci)
120434 +{
120435 + return pci_restore_state(pci);
120436 +}
120437 +
120438 static int azx_resume(struct pci_dev *pci)
120439 {
120440 struct snd_card *card = pci_get_drvdata(pci);
120441 struct azx *chip = card->private_data;
120442
120443 - pci_set_power_state(pci, PCI_D0);
120444 - pci_restore_state(pci);
120445 if (pci_enable_device(pci) < 0) {
120446 printk(KERN_ERR "hda-intel: pci_enable_device failed, "
120447 "disabling device\n");
120448 @@ -2059,31 +2062,26 @@
120449 {
120450 const struct snd_pci_quirk *q;
120451
120452 - switch (fix) {
120453 - case POS_FIX_LPIB:
120454 - case POS_FIX_POSBUF:
120455 - return fix;
120456 - }
120457 -
120458 - /* Check VIA/ATI HD Audio Controller exist */
120459 - switch (chip->driver_type) {
120460 - case AZX_DRIVER_VIA:
120461 - case AZX_DRIVER_ATI:
120462 + /* Check VIA HD Audio Controller exist */
120463 + if (chip->pci->vendor == PCI_VENDOR_ID_VIA &&
120464 + chip->pci->device == VIA_HDAC_DEVICE_ID) {
120465 chip->via_dmapos_patch = 1;
120466 /* Use link position directly, avoid any transfer problem. */
120467 return POS_FIX_LPIB;
120468 }
120469 chip->via_dmapos_patch = 0;
120470
120471 - q = snd_pci_quirk_lookup(chip->pci, position_fix_list);
120472 - if (q) {
120473 - printk(KERN_INFO
120474 - "hda_intel: position_fix set to %d "
120475 - "for device %04x:%04x\n",
120476 - q->value, q->subvendor, q->subdevice);
120477 - return q->value;
120478 + if (fix == POS_FIX_AUTO) {
120479 + q = snd_pci_quirk_lookup(chip->pci, position_fix_list);
120480 + if (q) {
120481 + printk(KERN_INFO
120482 + "hda_intel: position_fix set to %d "
120483 + "for device %04x:%04x\n",
120484 + q->value, q->subvendor, q->subdevice);
120485 + return q->value;
120486 + }
120487 }
120488 - return POS_FIX_AUTO;
120489 + return fix;
120490 }
120491
120492 /*
120493 @@ -2100,8 +2098,6 @@
120494 SND_PCI_QUIRK(0x1028, 0x20ac, "Dell Studio Desktop", 0x01),
120495 /* including bogus ALC268 in slot#2 that conflicts with ALC888 */
120496 SND_PCI_QUIRK(0x17c0, 0x4085, "Medion MD96630", 0x01),
120497 - /* conflict of ALC268 in slot#3 (digital I/O); a temporary fix */
120498 - SND_PCI_QUIRK(0x1179, 0xff00, "Toshiba laptop", 0x03),
120499 {}
120500 };
120501
120502 @@ -2215,17 +2211,9 @@
120503 gcap = azx_readw(chip, GCAP);
120504 snd_printdd("chipset global capabilities = 0x%x\n", gcap);
120505
120506 - /* ATI chips seems buggy about 64bit DMA addresses */
120507 - if (chip->driver_type == AZX_DRIVER_ATI)
120508 - gcap &= ~0x01;
120509 -
120510 /* allow 64bit DMA address if supported by H/W */
120511 if ((gcap & 0x01) && !pci_set_dma_mask(pci, DMA_64BIT_MASK))
120512 pci_set_consistent_dma_mask(pci, DMA_64BIT_MASK);
120513 - else {
120514 - pci_set_dma_mask(pci, DMA_32BIT_MASK);
120515 - pci_set_consistent_dma_mask(pci, DMA_32BIT_MASK);
120516 - }
120517
120518 /* read number of streams from GCAP register instead of using
120519 * hardcoded value
120520 @@ -2480,6 +2468,7 @@
120521 .remove = __devexit_p(azx_remove),
120522 #ifdef CONFIG_PM
120523 .suspend = azx_suspend,
120524 + .resume_early = azx_resume_early,
120525 .resume = azx_resume,
120526 #endif
120527 };
120528 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/pci/hda/hda_local.h linux-2.6.29-rc3.owrt/sound/pci/hda/hda_local.h
120529 --- linux-2.6.29.owrt/sound/pci/hda/hda_local.h 2009-05-10 22:04:39.000000000 +0200
120530 +++ linux-2.6.29-rc3.owrt/sound/pci/hda/hda_local.h 2009-05-10 23:48:34.000000000 +0200
120531 @@ -251,8 +251,6 @@
120532 unsigned int stream_tag,
120533 unsigned int format,
120534 struct snd_pcm_substream *substream);
120535 -int snd_hda_multi_out_dig_cleanup(struct hda_codec *codec,
120536 - struct hda_multi_out *mout);
120537 int snd_hda_multi_out_analog_open(struct hda_codec *codec,
120538 struct hda_multi_out *mout,
120539 struct snd_pcm_substream *substream,
120540 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/pci/hda/hda_proc.c linux-2.6.29-rc3.owrt/sound/pci/hda/hda_proc.c
120541 --- linux-2.6.29.owrt/sound/pci/hda/hda_proc.c 2009-05-10 22:04:39.000000000 +0200
120542 +++ linux-2.6.29-rc3.owrt/sound/pci/hda/hda_proc.c 2009-05-10 23:48:34.000000000 +0200
120543 @@ -399,8 +399,7 @@
120544 {
120545 int c, curr = -1;
120546
120547 - if (conn_len > 1 && wid_type != AC_WID_AUD_MIX &&
120548 - wid_type != AC_WID_VOL_KNB)
120549 + if (conn_len > 1 && wid_type != AC_WID_AUD_MIX)
120550 curr = snd_hda_codec_read(codec, nid, 0,
120551 AC_VERB_GET_CONNECT_SEL, 0);
120552 snd_iprintf(buffer, " Connection: %d\n", conn_len);
120553 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/pci/hda/patch_analog.c linux-2.6.29-rc3.owrt/sound/pci/hda/patch_analog.c
120554 --- linux-2.6.29.owrt/sound/pci/hda/patch_analog.c 2009-05-10 22:04:39.000000000 +0200
120555 +++ linux-2.6.29-rc3.owrt/sound/pci/hda/patch_analog.c 2009-05-10 23:48:34.000000000 +0200
120556 @@ -275,14 +275,6 @@
120557 format, substream);
120558 }
120559
120560 -static int ad198x_dig_playback_pcm_cleanup(struct hda_pcm_stream *hinfo,
120561 - struct hda_codec *codec,
120562 - struct snd_pcm_substream *substream)
120563 -{
120564 - struct ad198x_spec *spec = codec->spec;
120565 - return snd_hda_multi_out_dig_cleanup(codec, &spec->multiout);
120566 -}
120567 -
120568 /*
120569 * Analog capture
120570 */
120571 @@ -341,8 +333,7 @@
120572 .ops = {
120573 .open = ad198x_dig_playback_pcm_open,
120574 .close = ad198x_dig_playback_pcm_close,
120575 - .prepare = ad198x_dig_playback_pcm_prepare,
120576 - .cleanup = ad198x_dig_playback_pcm_cleanup
120577 + .prepare = ad198x_dig_playback_pcm_prepare
120578 },
120579 };
120580
120581 @@ -1894,8 +1885,8 @@
120582 #define AD1988_SPDIF_OUT_HDMI 0x0b
120583 #define AD1988_SPDIF_IN 0x07
120584
120585 -static hda_nid_t ad1989b_slave_dig_outs[] = {
120586 - AD1988_SPDIF_OUT, AD1988_SPDIF_OUT_HDMI, 0
120587 +static hda_nid_t ad1989b_slave_dig_outs[2] = {
120588 + AD1988_SPDIF_OUT, AD1988_SPDIF_OUT_HDMI
120589 };
120590
120591 static struct hda_input_mux ad1988_6stack_capture_source = {
120592 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/pci/hda/patch_conexant.c linux-2.6.29-rc3.owrt/sound/pci/hda/patch_conexant.c
120593 --- linux-2.6.29.owrt/sound/pci/hda/patch_conexant.c 2009-05-10 22:04:39.000000000 +0200
120594 +++ linux-2.6.29-rc3.owrt/sound/pci/hda/patch_conexant.c 2009-05-10 23:48:34.000000000 +0200
120595 @@ -347,7 +347,6 @@
120596 &spec->cur_mux[adc_idx]);
120597 }
120598
120599 -#ifdef CONFIG_SND_JACK
120600 static int conexant_add_jack(struct hda_codec *codec,
120601 hda_nid_t nid, int type)
120602 {
120603 @@ -395,6 +394,7 @@
120604
120605 static int conexant_init_jacks(struct hda_codec *codec)
120606 {
120607 +#ifdef CONFIG_SND_JACK
120608 struct conexant_spec *spec = codec->spec;
120609 int i;
120610
120611 @@ -422,19 +422,10 @@
120612 ++hv;
120613 }
120614 }
120615 +#endif
120616 return 0;
120617
120618 }
120619 -#else
120620 -static inline void conexant_report_jack(struct hda_codec *codec, hda_nid_t nid)
120621 -{
120622 -}
120623 -
120624 -static inline int conexant_init_jacks(struct hda_codec *codec)
120625 -{
120626 - return 0;
120627 -}
120628 -#endif
120629
120630 static int conexant_init(struct hda_codec *codec)
120631 {
120632 @@ -1575,7 +1566,6 @@
120633 SND_PCI_QUIRK(0x103c, 0x30a5, "HP DV5200T/DV8000T", CXT5047_LAPTOP_HP),
120634 SND_PCI_QUIRK(0x103c, 0x30b2, "HP DV2000T/DV3000T", CXT5047_LAPTOP),
120635 SND_PCI_QUIRK(0x103c, 0x30b5, "HP DV2000Z", CXT5047_LAPTOP),
120636 - SND_PCI_QUIRK(0x103c, 0x30cf, "HP DV6700", CXT5047_LAPTOP),
120637 SND_PCI_QUIRK(0x1179, 0xff31, "Toshiba P100", CXT5047_LAPTOP_EAPD),
120638 {}
120639 };
120640 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/pci/hda/patch_intelhdmi.c linux-2.6.29-rc3.owrt/sound/pci/hda/patch_intelhdmi.c
120641 --- linux-2.6.29.owrt/sound/pci/hda/patch_intelhdmi.c 2009-05-10 22:04:39.000000000 +0200
120642 +++ linux-2.6.29-rc3.owrt/sound/pci/hda/patch_intelhdmi.c 2009-05-10 23:48:34.000000000 +0200
120643 @@ -49,6 +49,11 @@
120644 {} /* terminator */
120645 };
120646
120647 +static struct hda_verb pinout_disable_verb[] = {
120648 + {PIN_NID, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x00},
120649 + {}
120650 +};
120651 +
120652 static struct hda_verb unsolicited_response_verb[] = {
120653 {PIN_NID, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN |
120654 INTEL_HDMI_EVENT_TAG},
120655 @@ -243,6 +248,10 @@
120656
120657 static void hdmi_enable_output(struct hda_codec *codec)
120658 {
120659 + /* Enable Audio InfoFrame Transmission */
120660 + hdmi_set_dip_index(codec, PIN_NID, 0x0, 0x0);
120661 + snd_hda_codec_write(codec, PIN_NID, 0, AC_VERB_SET_HDMI_DIP_XMIT,
120662 + AC_DIPXMIT_BEST);
120663 /* Unmute */
120664 if (get_wcaps(codec, PIN_NID) & AC_WCAP_OUT_AMP)
120665 snd_hda_codec_write(codec, PIN_NID, 0,
120666 @@ -251,24 +260,17 @@
120667 snd_hda_sequence_write(codec, pinout_enable_verb);
120668 }
120669
120670 -/*
120671 - * Enable Audio InfoFrame Transmission
120672 - */
120673 -static void hdmi_start_infoframe_trans(struct hda_codec *codec)
120674 +static void hdmi_disable_output(struct hda_codec *codec)
120675 {
120676 - hdmi_set_dip_index(codec, PIN_NID, 0x0, 0x0);
120677 - snd_hda_codec_write(codec, PIN_NID, 0, AC_VERB_SET_HDMI_DIP_XMIT,
120678 - AC_DIPXMIT_BEST);
120679 -}
120680 + snd_hda_sequence_write(codec, pinout_disable_verb);
120681 + if (get_wcaps(codec, PIN_NID) & AC_WCAP_OUT_AMP)
120682 + snd_hda_codec_write(codec, PIN_NID, 0,
120683 + AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
120684
120685 -/*
120686 - * Disable Audio InfoFrame Transmission
120687 - */
120688 -static void hdmi_stop_infoframe_trans(struct hda_codec *codec)
120689 -{
120690 - hdmi_set_dip_index(codec, PIN_NID, 0x0, 0x0);
120691 - snd_hda_codec_write(codec, PIN_NID, 0, AC_VERB_SET_HDMI_DIP_XMIT,
120692 - AC_DIPXMIT_DISABLE);
120693 + /*
120694 + * FIXME: noises may arise when playing music after reloading the
120695 + * kernel module, until the next X restart or monitor repower.
120696 + */
120697 }
120698
120699 static int hdmi_get_channel_count(struct hda_codec *codec)
120700 @@ -366,16 +368,11 @@
120701 struct hdmi_audio_infoframe *ai)
120702 {
120703 u8 *params = (u8 *)ai;
120704 - u8 sum = 0;
120705 int i;
120706
120707 hdmi_debug_dip_size(codec);
120708 hdmi_clear_dip_buffers(codec); /* be paranoid */
120709
120710 - for (i = 0; i < sizeof(ai); i++)
120711 - sum += params[i];
120712 - ai->checksum = - sum;
120713 -
120714 hdmi_set_dip_index(codec, PIN_NID, 0x0, 0x0);
120715 for (i = 0; i < sizeof(ai); i++)
120716 hdmi_write_dip_byte(codec, PIN_NID, params[i]);
120717 @@ -422,16 +419,12 @@
120718 /*
120719 * CA defaults to 0 for basic stereo audio
120720 */
120721 - if (channels <= 2)
120722 + if (!eld->eld_ver)
120723 return 0;
120724 -
120725 - /*
120726 - * HDMI sink's ELD info cannot always be retrieved for now, e.g.
120727 - * in console or for audio devices. Assume the highest speakers
120728 - * configuration, to _not_ prohibit multi-channel audio playback.
120729 - */
120730 if (!eld->spk_alloc)
120731 - eld->spk_alloc = 0xffff;
120732 + return 0;
120733 + if (channels <= 2)
120734 + return 0;
120735
120736 /*
120737 * expand ELD's speaker allocation mask
120738 @@ -492,7 +485,6 @@
120739 hdmi_setup_channel_mapping(codec, &ai);
120740
120741 hdmi_fill_audio_infoframe(codec, &ai);
120742 - hdmi_start_infoframe_trans(codec);
120743 }
120744
120745
120746 @@ -570,7 +562,7 @@
120747 {
120748 struct intel_hdmi_spec *spec = codec->spec;
120749
120750 - hdmi_stop_infoframe_trans(codec);
120751 + hdmi_disable_output(codec);
120752
120753 return snd_hda_multi_out_dig_close(codec, &spec->multiout);
120754 }
120755 @@ -590,6 +582,8 @@
120756
120757 hdmi_setup_audio_infoframe(codec, substream);
120758
120759 + hdmi_enable_output(codec);
120760 +
120761 return 0;
120762 }
120763
120764 @@ -634,7 +628,8 @@
120765
120766 static int intel_hdmi_init(struct hda_codec *codec)
120767 {
120768 - hdmi_enable_output(codec);
120769 + /* disable audio output as early as possible */
120770 + hdmi_disable_output(codec);
120771
120772 snd_hda_sequence_write(codec, unsolicited_response_verb);
120773
120774 @@ -684,7 +679,6 @@
120775 { .id = 0x80862801, .name = "G45 DEVBLC", .patch = patch_intel_hdmi },
120776 { .id = 0x80862802, .name = "G45 DEVCTG", .patch = patch_intel_hdmi },
120777 { .id = 0x80862803, .name = "G45 DEVELK", .patch = patch_intel_hdmi },
120778 - { .id = 0x80862804, .name = "G45 DEVIBX", .patch = patch_intel_hdmi },
120779 { .id = 0x10951392, .name = "SiI1392 HDMI", .patch = patch_intel_hdmi },
120780 {} /* terminator */
120781 };
120782 @@ -693,7 +687,6 @@
120783 MODULE_ALIAS("snd-hda-codec-id:80862801");
120784 MODULE_ALIAS("snd-hda-codec-id:80862802");
120785 MODULE_ALIAS("snd-hda-codec-id:80862803");
120786 -MODULE_ALIAS("snd-hda-codec-id:80862804");
120787 MODULE_ALIAS("snd-hda-codec-id:10951392");
120788
120789 MODULE_LICENSE("GPL");
120790 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/pci/hda/patch_realtek.c linux-2.6.29-rc3.owrt/sound/pci/hda/patch_realtek.c
120791 --- linux-2.6.29.owrt/sound/pci/hda/patch_realtek.c 2009-05-10 22:04:39.000000000 +0200
120792 +++ linux-2.6.29-rc3.owrt/sound/pci/hda/patch_realtek.c 2009-05-10 23:48:34.000000000 +0200
120793 @@ -1037,7 +1037,6 @@
120794 case 0x10ec0267:
120795 case 0x10ec0268:
120796 case 0x10ec0269:
120797 - case 0x10ec0272:
120798 case 0x10ec0660:
120799 case 0x10ec0662:
120800 case 0x10ec0663:
120801 @@ -1066,7 +1065,6 @@
120802 case 0x10ec0882:
120803 case 0x10ec0883:
120804 case 0x10ec0885:
120805 - case 0x10ec0887:
120806 case 0x10ec0889:
120807 snd_hda_codec_write(codec, 0x20, 0,
120808 AC_VERB_SET_COEF_INDEX, 7);
120809 @@ -7014,15 +7012,12 @@
120810 break;
120811 case 0x106b1000: /* iMac 24 */
120812 case 0x106b2800: /* AppleTV */
120813 - case 0x106b3e00: /* iMac 24 Aluminium */
120814 board_config = ALC885_IMAC24;
120815 break;
120816 - case 0x106b00a0: /* MacBookPro3,1 - Another revision */
120817 case 0x106b00a1: /* Macbook (might be wrong - PCI SSID?) */
120818 case 0x106b00a4: /* MacbookPro4,1 */
120819 case 0x106b2c00: /* Macbook Pro rev3 */
120820 case 0x106b3600: /* Macbook 3.1 */
120821 - case 0x106b3800: /* MacbookPro4,1 - latter revision */
120822 board_config = ALC885_MBP3;
120823 break;
120824 default:
120825 @@ -8470,8 +8465,6 @@
120826 ALC888_ACER_ASPIRE_4930G),
120827 SND_PCI_QUIRK(0x1025, 0x015e, "Acer Aspire 6930G",
120828 ALC888_ACER_ASPIRE_4930G),
120829 - SND_PCI_QUIRK(0x1025, 0x0166, "Acer Aspire 6530G",
120830 - ALC888_ACER_ASPIRE_4930G),
120831 SND_PCI_QUIRK(0x1025, 0, "Acer laptop", ALC883_ACER), /* default Acer */
120832 SND_PCI_QUIRK(0x1028, 0x020d, "Dell Inspiron 530", ALC888_6ST_DELL),
120833 SND_PCI_QUIRK(0x103c, 0x2a3d, "HP Pavillion", ALC883_6ST_DIG),
120834 @@ -8481,7 +8474,6 @@
120835 SND_PCI_QUIRK(0x103c, 0x2a66, "HP Acacia", ALC888_3ST_HP),
120836 SND_PCI_QUIRK(0x1043, 0x1873, "Asus M90V", ALC888_ASUS_M90V),
120837 SND_PCI_QUIRK(0x1043, 0x8249, "Asus M2A-VM HDMI", ALC883_3ST_6ch_DIG),
120838 - SND_PCI_QUIRK(0x1043, 0x8284, "Asus Z37E", ALC883_6ST_DIG),
120839 SND_PCI_QUIRK(0x1043, 0x82fe, "Asus P5Q-EM HDMI", ALC1200_ASUS_P5Q),
120840 SND_PCI_QUIRK(0x1043, 0x835f, "Asus Eee 1601", ALC888_ASUS_EEE1601),
120841 SND_PCI_QUIRK(0x105b, 0x0ce8, "Foxconn P35AX-S", ALC883_6ST_DIG),
120842 @@ -8521,8 +8513,6 @@
120843 SND_PCI_QUIRK(0x1558, 0, "Clevo laptop", ALC883_LAPTOP_EAPD),
120844 SND_PCI_QUIRK(0x15d9, 0x8780, "Supermicro PDSBA", ALC883_3ST_6ch),
120845 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_MEDION),
120846 - SND_PCI_QUIRK(0x1734, 0x1107, "FSC AMILO Xi2550",
120847 - ALC883_FUJITSU_PI2515),
120848 SND_PCI_QUIRK(0x1734, 0x1108, "Fujitsu AMILO Pi2515", ALC883_FUJITSU_PI2515),
120849 SND_PCI_QUIRK(0x1734, 0x113d, "Fujitsu AMILO Xa3530",
120850 ALC888_FUJITSU_XA3530),
120851 @@ -10557,7 +10547,6 @@
120852 SND_PCI_QUIRK(0x103c, 0x1309, "HP xw4*00", ALC262_HP_BPC),
120853 SND_PCI_QUIRK(0x103c, 0x130a, "HP xw6*00", ALC262_HP_BPC),
120854 SND_PCI_QUIRK(0x103c, 0x130b, "HP xw8*00", ALC262_HP_BPC),
120855 - SND_PCI_QUIRK(0x103c, 0x170b, "HP xw*", ALC262_HP_BPC),
120856 SND_PCI_QUIRK(0x103c, 0x2800, "HP D7000", ALC262_HP_BPC_D7000_WL),
120857 SND_PCI_QUIRK(0x103c, 0x2801, "HP D7000", ALC262_HP_BPC_D7000_WF),
120858 SND_PCI_QUIRK(0x103c, 0x2802, "HP D7000", ALC262_HP_BPC_D7000_WL),
120859 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/pci/hda/patch_sigmatel.c linux-2.6.29-rc3.owrt/sound/pci/hda/patch_sigmatel.c
120860 --- linux-2.6.29.owrt/sound/pci/hda/patch_sigmatel.c 2009-05-10 22:04:39.000000000 +0200
120861 +++ linux-2.6.29-rc3.owrt/sound/pci/hda/patch_sigmatel.c 2009-05-10 23:48:34.000000000 +0200
120862 @@ -1207,7 +1207,7 @@
120863 "LFE Playback Volume",
120864 "Side Playback Volume",
120865 "Headphone Playback Volume",
120866 - "Headphone2 Playback Volume",
120867 + "Headphone Playback Volume",
120868 "Speaker Playback Volume",
120869 "External Speaker Playback Volume",
120870 "Speaker2 Playback Volume",
120871 @@ -1221,7 +1221,7 @@
120872 "LFE Playback Switch",
120873 "Side Playback Switch",
120874 "Headphone Playback Switch",
120875 - "Headphone2 Playback Switch",
120876 + "Headphone Playback Switch",
120877 "Speaker Playback Switch",
120878 "External Speaker Playback Switch",
120879 "Speaker2 Playback Switch",
120880 @@ -1799,13 +1799,11 @@
120881 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30f2,
120882 "HP dv5", STAC_HP_M4),
120883 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30f4,
120884 - "HP dv7", STAC_HP_DV5),
120885 + "HP dv7", STAC_HP_M4),
120886 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30f7,
120887 "HP dv4", STAC_HP_DV5),
120888 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30fc,
120889 "HP dv7", STAC_HP_M4),
120890 - SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3600,
120891 - "HP dv5", STAC_HP_DV5),
120892 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3603,
120893 "HP dv5", STAC_HP_DV5),
120894 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x361a,
120895 @@ -2442,14 +2440,6 @@
120896 stream_tag, format, substream);
120897 }
120898
120899 -static int stac92xx_dig_playback_pcm_cleanup(struct hda_pcm_stream *hinfo,
120900 - struct hda_codec *codec,
120901 - struct snd_pcm_substream *substream)
120902 -{
120903 - struct sigmatel_spec *spec = codec->spec;
120904 - return snd_hda_multi_out_dig_cleanup(codec, &spec->multiout);
120905 -}
120906 -
120907
120908 /*
120909 * Analog capture callbacks
120910 @@ -2494,8 +2484,7 @@
120911 .ops = {
120912 .open = stac92xx_dig_playback_pcm_open,
120913 .close = stac92xx_dig_playback_pcm_close,
120914 - .prepare = stac92xx_dig_playback_pcm_prepare,
120915 - .cleanup = stac92xx_dig_playback_pcm_cleanup
120916 + .prepare = stac92xx_dig_playback_pcm_prepare
120917 },
120918 };
120919
120920 @@ -2550,8 +2539,6 @@
120921
120922 info->name = "STAC92xx Analog";
120923 info->stream[SNDRV_PCM_STREAM_PLAYBACK] = stac92xx_pcm_analog_playback;
120924 - info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid =
120925 - spec->multiout.dac_nids[0];
120926 info->stream[SNDRV_PCM_STREAM_CAPTURE] = stac92xx_pcm_analog_capture;
120927 info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->adc_nids[0];
120928 info->stream[SNDRV_PCM_STREAM_CAPTURE].substreams = spec->num_adcs;
120929 @@ -3516,7 +3503,6 @@
120930 if (! spec->autocfg.line_outs)
120931 return 0; /* can't find valid pin config */
120932
120933 -#if 0 /* FIXME: temporarily disabled */
120934 /* If we have no real line-out pin and multiple hp-outs, HPs should
120935 * be set up as multi-channel outputs.
120936 */
120937 @@ -3536,7 +3522,6 @@
120938 spec->autocfg.line_out_type = AUTO_PIN_HP_OUT;
120939 spec->autocfg.hp_outs = 0;
120940 }
120941 -#endif /* FIXME: temporarily disabled */
120942 if (spec->autocfg.mono_out_pin) {
120943 int dir = get_wcaps(codec, spec->autocfg.mono_out_pin) &
120944 (AC_WCAP_OUT_AMP | AC_WCAP_IN_AMP);
120945 @@ -4991,7 +4976,7 @@
120946 case STAC_DELL_M4_3:
120947 spec->num_dmics = 1;
120948 spec->num_smuxes = 0;
120949 - spec->num_dmuxes = 1;
120950 + spec->num_dmuxes = 0;
120951 break;
120952 default:
120953 spec->num_dmics = STAC92HD71BXX_NUM_DMICS;
120954 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/pci/intel8x0.c linux-2.6.29-rc3.owrt/sound/pci/intel8x0.c
120955 --- linux-2.6.29.owrt/sound/pci/intel8x0.c 2009-05-10 22:04:39.000000000 +0200
120956 +++ linux-2.6.29-rc3.owrt/sound/pci/intel8x0.c 2009-05-10 23:48:34.000000000 +0200
120957 @@ -617,7 +617,7 @@
120958 int time = 100;
120959 if (chip->buggy_semaphore)
120960 return 0; /* just ignore ... */
120961 - while (--time && (igetdword(chip, ICHREG(ALI_CAS)) & ALI_CAS_SEM_BUSY))
120962 + while (time-- && (igetdword(chip, ICHREG(ALI_CAS)) & ALI_CAS_SEM_BUSY))
120963 udelay(1);
120964 if (! time && ! chip->in_ac97_init)
120965 snd_printk(KERN_WARNING "ali_codec_semaphore timeout\n");
120966 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/pci/mixart/mixart.c linux-2.6.29-rc3.owrt/sound/pci/mixart/mixart.c
120967 --- linux-2.6.29.owrt/sound/pci/mixart/mixart.c 2009-05-10 22:04:39.000000000 +0200
120968 +++ linux-2.6.29-rc3.owrt/sound/pci/mixart/mixart.c 2009-05-10 23:48:34.000000000 +0200
120969 @@ -607,7 +607,6 @@
120970 /* set the format to the board */
120971 err = mixart_set_format(stream, format);
120972 if(err < 0) {
120973 - mutex_unlock(&mgr->setup_mutex);
120974 return err;
120975 }
120976
120977 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/pci/oxygen/virtuoso.c linux-2.6.29-rc3.owrt/sound/pci/oxygen/virtuoso.c
120978 --- linux-2.6.29.owrt/sound/pci/oxygen/virtuoso.c 2009-05-10 22:04:39.000000000 +0200
120979 +++ linux-2.6.29-rc3.owrt/sound/pci/oxygen/virtuoso.c 2009-05-10 23:48:34.000000000 +0200
120980 @@ -26,7 +26,7 @@
120981 * SPI 0 -> 1st PCM1796 (front)
120982 * SPI 1 -> 2nd PCM1796 (surround)
120983 * SPI 2 -> 3rd PCM1796 (center/LFE)
120984 - * SPI 4 -> 4th PCM1796 (back)
120985 + * SPI 4 -> 4th PCM1796 (back) and EEPROM self-destruct (do not use!)
120986 *
120987 * GPIO 2 -> M0 of CS5381
120988 * GPIO 3 -> M1 of CS5381
120989 @@ -207,6 +207,12 @@
120990 static inline void pcm1796_write_spi(struct oxygen *chip, unsigned int codec,
120991 u8 reg, u8 value)
120992 {
120993 + /*
120994 + * We don't want to do writes on SPI 4 because the EEPROM, which shares
120995 + * the same pin, might get confused and broken. We'd better take care
120996 + * that the driver works with the default register values ...
120997 + */
120998 +#if 0
120999 /* maps ALSA channel pair number to SPI output */
121000 static const u8 codec_map[4] = {
121001 0, 1, 2, 4
121002 @@ -217,6 +223,7 @@
121003 (codec_map[codec] << OXYGEN_SPI_CODEC_SHIFT) |
121004 OXYGEN_SPI_CEN_LATCH_CLOCK_HI,
121005 (reg << 8) | value);
121006 +#endif
121007 }
121008
121009 static inline void pcm1796_write_i2c(struct oxygen *chip, unsigned int codec,
121010 @@ -750,6 +757,9 @@
121011
121012 static int xonar_d2_control_filter(struct snd_kcontrol_new *template)
121013 {
121014 + if (!strncmp(template->name, "Master Playback ", 16))
121015 + /* disable volume/mute because they would require SPI writes */
121016 + return 1;
121017 if (!strncmp(template->name, "CD Capture ", 11))
121018 /* CD in is actually connected to the video in pin */
121019 template->private_value ^= AC97_CD ^ AC97_VIDEO;
121020 @@ -840,9 +850,8 @@
121021 .dac_volume_min = 0x0f,
121022 .dac_volume_max = 0xff,
121023 .misc_flags = OXYGEN_MISC_MIDI,
121024 - .function_flags = OXYGEN_FUNCTION_SPI |
121025 - OXYGEN_FUNCTION_ENABLE_SPI_4_5,
121026 - .dac_i2s_format = OXYGEN_I2S_FORMAT_LJUST,
121027 + .function_flags = OXYGEN_FUNCTION_SPI,
121028 + .dac_i2s_format = OXYGEN_I2S_FORMAT_I2S,
121029 .adc_i2s_format = OXYGEN_I2S_FORMAT_LJUST,
121030 };
121031
121032 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/pci/pcxhr/pcxhr.h linux-2.6.29-rc3.owrt/sound/pci/pcxhr/pcxhr.h
121033 --- linux-2.6.29.owrt/sound/pci/pcxhr/pcxhr.h 2009-05-10 22:04:39.000000000 +0200
121034 +++ linux-2.6.29-rc3.owrt/sound/pci/pcxhr/pcxhr.h 2009-05-10 23:48:34.000000000 +0200
121035 @@ -97,12 +97,12 @@
121036 int capture_chips;
121037 int fw_file_set;
121038 int firmware_num;
121039 - unsigned int is_hr_stereo:1;
121040 - unsigned int board_has_aes1:1; /* if 1 board has AES1 plug and SRC */
121041 - unsigned int board_has_analog:1; /* if 0 the board is digital only */
121042 - unsigned int board_has_mic:1; /* if 1 the board has microphone input */
121043 - unsigned int board_aes_in_192k:1;/* if 1 the aes input plugs do support 192kHz */
121044 - unsigned int mono_capture:1; /* if 1 the board does mono capture */
121045 + int is_hr_stereo:1;
121046 + int board_has_aes1:1; /* if 1 board has AES1 plug and SRC */
121047 + int board_has_analog:1; /* if 0 the board is digital only */
121048 + int board_has_mic:1; /* if 1 the board has microphone input */
121049 + int board_aes_in_192k:1;/* if 1 the aes input plugs do support 192kHz */
121050 + int mono_capture:1; /* if 1 the board does mono capture */
121051
121052 struct snd_dma_buffer hostport;
121053
121054 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/soc/atmel/atmel_ssc_dai.c linux-2.6.29-rc3.owrt/sound/soc/atmel/atmel_ssc_dai.c
121055 --- linux-2.6.29.owrt/sound/soc/atmel/atmel_ssc_dai.c 2009-05-10 22:04:39.000000000 +0200
121056 +++ linux-2.6.29-rc3.owrt/sound/soc/atmel/atmel_ssc_dai.c 2009-05-10 23:48:34.000000000 +0200
121057 @@ -10,7 +10,7 @@
121058 * Based on at91-ssc.c by
121059 * Frank Mandarino <fmandarino@endrelia.com>
121060 * Based on pxa2xx Platform drivers by
121061 - * Liam Girdwood <lrg@slimlogic.co.uk>
121062 + * Liam Girdwood <liam.girdwood@wolfsonmicro.com>
121063 *
121064 * This program is free software; you can redistribute it and/or modify
121065 * it under the terms of the GNU General Public License as published by
121066 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/soc/atmel/atmel_ssc_dai.h linux-2.6.29-rc3.owrt/sound/soc/atmel/atmel_ssc_dai.h
121067 --- linux-2.6.29.owrt/sound/soc/atmel/atmel_ssc_dai.h 2009-05-10 22:04:39.000000000 +0200
121068 +++ linux-2.6.29-rc3.owrt/sound/soc/atmel/atmel_ssc_dai.h 2009-05-10 23:48:34.000000000 +0200
121069 @@ -10,7 +10,7 @@
121070 * Based on at91-ssc.c by
121071 * Frank Mandarino <fmandarino@endrelia.com>
121072 * Based on pxa2xx Platform drivers by
121073 - * Liam Girdwood <lrg@slimlogic.co.uk>
121074 + * Liam Girdwood <liam.girdwood@wolfsonmicro.com>
121075 *
121076 * This program is free software; you can redistribute it and/or modify
121077 * it under the terms of the GNU General Public License as published by
121078 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/soc/codecs/tlv320aic3x.c linux-2.6.29-rc3.owrt/sound/soc/codecs/tlv320aic3x.c
121079 --- linux-2.6.29.owrt/sound/soc/codecs/tlv320aic3x.c 2009-05-10 22:04:39.000000000 +0200
121080 +++ linux-2.6.29-rc3.owrt/sound/soc/codecs/tlv320aic3x.c 2009-05-10 23:48:34.000000000 +0200
121081 @@ -165,13 +165,10 @@
121082 struct snd_ctl_elem_value *ucontrol)
121083 {
121084 struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol);
121085 - struct soc_mixer_control *mc =
121086 - (struct soc_mixer_control *)kcontrol->private_value;
121087 - unsigned int reg = mc->reg;
121088 - unsigned int shift = mc->shift;
121089 - int max = mc->max;
121090 - unsigned int mask = (1 << fls(max)) - 1;
121091 - unsigned int invert = mc->invert;
121092 + int reg = kcontrol->private_value & 0xff;
121093 + int shift = (kcontrol->private_value >> 8) & 0x0f;
121094 + int mask = (kcontrol->private_value >> 16) & 0xff;
121095 + int invert = (kcontrol->private_value >> 24) & 0x01;
121096 unsigned short val, val_mask;
121097 int ret;
121098 struct snd_soc_dapm_path *path;
121099 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/soc/codecs/wm8350.c linux-2.6.29-rc3.owrt/sound/soc/codecs/wm8350.c
121100 --- linux-2.6.29.owrt/sound/soc/codecs/wm8350.c 2009-05-10 22:04:39.000000000 +0200
121101 +++ linux-2.6.29-rc3.owrt/sound/soc/codecs/wm8350.c 2009-05-10 23:48:34.000000000 +0200
121102 @@ -3,7 +3,7 @@
121103 *
121104 * Copyright (C) 2007, 2008 Wolfson Microelectronics PLC.
121105 *
121106 - * Author: Liam Girdwood <lrg@slimlogic.co.uk>
121107 + * Author: Liam Girdwood <lg@opensource.wolfsonmicro.com>
121108 *
121109 * This program is free software; you can redistribute it and/or modify
121110 * it under the terms of the GNU General Public License version 2 as
121111 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/soc/codecs/wm8753.c linux-2.6.29-rc3.owrt/sound/soc/codecs/wm8753.c
121112 --- linux-2.6.29.owrt/sound/soc/codecs/wm8753.c 2009-05-10 22:04:39.000000000 +0200
121113 +++ linux-2.6.29-rc3.owrt/sound/soc/codecs/wm8753.c 2009-05-10 23:48:34.000000000 +0200
121114 @@ -1451,14 +1451,7 @@
121115 },
121116 };
121117
121118 -struct snd_soc_dai wm8753_dai[] = {
121119 - {
121120 - .name = "WM8753 DAI 0",
121121 - },
121122 - {
121123 - .name = "WM8753 DAI 1",
121124 - },
121125 -};
121126 +struct snd_soc_dai wm8753_dai[2];
121127 EXPORT_SYMBOL_GPL(wm8753_dai);
121128
121129 static void wm8753_set_dai_mode(struct snd_soc_codec *codec, unsigned int mode)
121130 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/soc/codecs/wm8990.c linux-2.6.29-rc3.owrt/sound/soc/codecs/wm8990.c
121131 --- linux-2.6.29.owrt/sound/soc/codecs/wm8990.c 2009-05-10 22:04:39.000000000 +0200
121132 +++ linux-2.6.29-rc3.owrt/sound/soc/codecs/wm8990.c 2009-05-10 23:48:34.000000000 +0200
121133 @@ -2,7 +2,8 @@
121134 * wm8990.c -- WM8990 ALSA Soc Audio driver
121135 *
121136 * Copyright 2008 Wolfson Microelectronics PLC.
121137 - * Author: Liam Girdwood <lrg@slimlogic.co.uk>
121138 + * Author: Liam Girdwood
121139 + * lg@opensource.wolfsonmicro.com or linux@wolfsonmicro.com
121140 *
121141 * This program is free software; you can redistribute it and/or modify it
121142 * under the terms of the GNU General Public License as published by the
121143 @@ -176,9 +177,7 @@
121144 struct snd_ctl_elem_value *ucontrol)
121145 {
121146 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
121147 - struct soc_mixer_control *mc =
121148 - (struct soc_mixer_control *)kcontrol->private_value;
121149 - int reg = mc->reg;
121150 + int reg = kcontrol->private_value & 0xff;
121151 int ret;
121152 u16 val;
121153
121154 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/soc/omap/omap-mcbsp.c linux-2.6.29-rc3.owrt/sound/soc/omap/omap-mcbsp.c
121155 --- linux-2.6.29.owrt/sound/soc/omap/omap-mcbsp.c 2009-05-10 22:04:39.000000000 +0200
121156 +++ linux-2.6.29-rc3.owrt/sound/soc/omap/omap-mcbsp.c 2009-05-10 23:48:34.000000000 +0200
121157 @@ -302,10 +302,6 @@
121158 regs->spcr1 |= RINTM(3);
121159 regs->rcr2 |= RFIG;
121160 regs->xcr2 |= XFIG;
121161 - if (cpu_is_omap2430() || cpu_is_omap34xx()) {
121162 - regs->xccr = DXENDLY(1) | XDMAEN;
121163 - regs->rccr = RFULL_CYCLE | RDMAEN;
121164 - }
121165
121166 switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
121167 case SND_SOC_DAIFMT_I2S:
121168 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/soc/omap/omap-pcm.c linux-2.6.29-rc3.owrt/sound/soc/omap/omap-pcm.c
121169 --- linux-2.6.29.owrt/sound/soc/omap/omap-pcm.c 2009-05-10 22:04:39.000000000 +0200
121170 +++ linux-2.6.29-rc3.owrt/sound/soc/omap/omap-pcm.c 2009-05-10 23:48:34.000000000 +0200
121171 @@ -175,10 +175,9 @@
121172 {
121173 struct snd_pcm_runtime *runtime = substream->runtime;
121174 struct omap_runtime_data *prtd = runtime->private_data;
121175 - unsigned long flags;
121176 int ret = 0;
121177
121178 - spin_lock_irqsave(&prtd->lock, flags);
121179 + spin_lock_irq(&prtd->lock);
121180 switch (cmd) {
121181 case SNDRV_PCM_TRIGGER_START:
121182 case SNDRV_PCM_TRIGGER_RESUME:
121183 @@ -196,7 +195,7 @@
121184 default:
121185 ret = -EINVAL;
121186 }
121187 - spin_unlock_irqrestore(&prtd->lock, flags);
121188 + spin_unlock_irq(&prtd->lock);
121189
121190 return ret;
121191 }
121192 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/soc/omap/sdp3430.c linux-2.6.29-rc3.owrt/sound/soc/omap/sdp3430.c
121193 --- linux-2.6.29.owrt/sound/soc/omap/sdp3430.c 2009-05-10 22:04:39.000000000 +0200
121194 +++ linux-2.6.29-rc3.owrt/sound/soc/omap/sdp3430.c 2009-05-10 23:48:34.000000000 +0200
121195 @@ -91,7 +91,7 @@
121196 };
121197
121198 /* Audio machine driver */
121199 -static struct snd_soc_card snd_soc_sdp3430 = {
121200 +static struct snd_soc_machine snd_soc_machine_sdp3430 = {
121201 .name = "SDP3430",
121202 .platform = &omap_soc_platform,
121203 .dai_link = &sdp3430_dai,
121204 @@ -100,7 +100,7 @@
121205
121206 /* Audio subsystem */
121207 static struct snd_soc_device sdp3430_snd_devdata = {
121208 - .card = &snd_soc_sdp3430,
121209 + .machine = &snd_soc_machine_sdp3430,
121210 .codec_dev = &soc_codec_dev_twl4030,
121211 };
121212
121213 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/soc/soc-core.c linux-2.6.29-rc3.owrt/sound/soc/soc-core.c
121214 --- linux-2.6.29.owrt/sound/soc/soc-core.c 2009-05-10 22:04:39.000000000 +0200
121215 +++ linux-2.6.29-rc3.owrt/sound/soc/soc-core.c 2009-05-10 23:48:34.000000000 +0200
121216 @@ -1385,10 +1385,7 @@
121217
121218 mutex_lock(&codec->mutex);
121219 #ifdef CONFIG_SND_SOC_AC97_BUS
121220 - /* Only instantiate AC97 if not already done by the adaptor
121221 - * for the generic AC97 subsystem.
121222 - */
121223 - if (ac97 && strcmp(codec->name, "AC97") != 0) {
121224 + if (ac97) {
121225 ret = soc_ac97_dev_register(codec);
121226 if (ret < 0) {
121227 printk(KERN_ERR "asoc: AC97 device register failed\n");
121228 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/usb/usbaudio.c linux-2.6.29-rc3.owrt/sound/usb/usbaudio.c
121229 --- linux-2.6.29.owrt/sound/usb/usbaudio.c 2009-05-10 22:04:39.000000000 +0200
121230 +++ linux-2.6.29-rc3.owrt/sound/usb/usbaudio.c 2009-05-10 23:48:34.000000000 +0200
121231 @@ -2524,6 +2524,7 @@
121232 * build the rate table and bitmap flags
121233 */
121234 int r, idx;
121235 + unsigned int nonzero_rates = 0;
121236
121237 fp->rate_table = kmalloc(sizeof(int) * nr_rates, GFP_KERNEL);
121238 if (fp->rate_table == NULL) {
121239 @@ -2531,27 +2532,24 @@
121240 return -1;
121241 }
121242
121243 - fp->nr_rates = 0;
121244 - fp->rate_min = fp->rate_max = 0;
121245 + fp->nr_rates = nr_rates;
121246 + fp->rate_min = fp->rate_max = combine_triple(&fmt[8]);
121247 for (r = 0, idx = offset + 1; r < nr_rates; r++, idx += 3) {
121248 unsigned int rate = combine_triple(&fmt[idx]);
121249 - if (!rate)
121250 - continue;
121251 /* C-Media CM6501 mislabels its 96 kHz altsetting */
121252 if (rate == 48000 && nr_rates == 1 &&
121253 - (chip->usb_id == USB_ID(0x0d8c, 0x0201) ||
121254 - chip->usb_id == USB_ID(0x0d8c, 0x0102)) &&
121255 + chip->usb_id == USB_ID(0x0d8c, 0x0201) &&
121256 fp->altsetting == 5 && fp->maxpacksize == 392)
121257 rate = 96000;
121258 - fp->rate_table[fp->nr_rates] = rate;
121259 - if (!fp->rate_min || rate < fp->rate_min)
121260 + fp->rate_table[r] = rate;
121261 + nonzero_rates |= rate;
121262 + if (rate < fp->rate_min)
121263 fp->rate_min = rate;
121264 - if (!fp->rate_max || rate > fp->rate_max)
121265 + else if (rate > fp->rate_max)
121266 fp->rate_max = rate;
121267 fp->rates |= snd_pcm_rate_to_rate_bit(rate);
121268 - fp->nr_rates++;
121269 }
121270 - if (!fp->nr_rates) {
121271 + if (!nonzero_rates) {
121272 hwc_debug("All rates were zero. Skipping format!\n");
121273 return -1;
121274 }
121275 @@ -2968,7 +2966,6 @@
121276 return -EINVAL;
121277 }
121278 alts = &iface->altsetting[fp->altset_idx];
121279 - fp->maxpacksize = le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize);
121280 usb_set_interface(chip->dev, fp->iface, 0);
121281 init_usb_pitch(chip->dev, fp->iface, alts, fp);
121282 init_usb_sample_rate(chip->dev, fp->iface, alts, fp, fp->rate_max);
121283 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/sound/usb/usbmidi.c linux-2.6.29-rc3.owrt/sound/usb/usbmidi.c
121284 --- linux-2.6.29.owrt/sound/usb/usbmidi.c 2009-05-10 22:04:39.000000000 +0200
121285 +++ linux-2.6.29-rc3.owrt/sound/usb/usbmidi.c 2009-05-10 23:48:34.000000000 +0200
121286 @@ -1625,7 +1625,6 @@
121287 }
121288
121289 ep_info.out_ep = get_endpoint(hostif, 2)->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
121290 - ep_info.out_interval = 0;
121291 ep_info.out_cables = endpoint->out_cables & 0x5555;
121292 err = snd_usbmidi_out_endpoint_create(umidi, &ep_info, &umidi->endpoints[0]);
121293 if (err < 0)
121294 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/virt/kvm/iommu.c linux-2.6.29-rc3.owrt/virt/kvm/iommu.c
121295 --- linux-2.6.29.owrt/virt/kvm/iommu.c 2009-05-10 22:04:39.000000000 +0200
121296 +++ linux-2.6.29-rc3.owrt/virt/kvm/iommu.c 2009-05-10 23:48:34.000000000 +0200
121297 @@ -73,13 +73,14 @@
121298 {
121299 int i, r = 0;
121300
121301 + down_read(&kvm->slots_lock);
121302 for (i = 0; i < kvm->nmemslots; i++) {
121303 r = kvm_iommu_map_pages(kvm, kvm->memslots[i].base_gfn,
121304 kvm->memslots[i].npages);
121305 if (r)
121306 break;
121307 }
121308 -
121309 + up_read(&kvm->slots_lock);
121310 return r;
121311 }
121312
121313 @@ -189,11 +190,12 @@
121314 static int kvm_iommu_unmap_memslots(struct kvm *kvm)
121315 {
121316 int i;
121317 -
121318 + down_read(&kvm->slots_lock);
121319 for (i = 0; i < kvm->nmemslots; i++) {
121320 kvm_iommu_put_pages(kvm, kvm->memslots[i].base_gfn,
121321 kvm->memslots[i].npages);
121322 }
121323 + up_read(&kvm->slots_lock);
121324
121325 return 0;
121326 }
121327 diff -ruN --exclude='*.rej' --exclude='*.orig' --exclude=Documentation --exclude='*_defconfig' --exclude='*.ppm' --exclude='*bnx2_fw*' linux-2.6.29.owrt/virt/kvm/kvm_main.c linux-2.6.29-rc3.owrt/virt/kvm/kvm_main.c
121328 --- linux-2.6.29.owrt/virt/kvm/kvm_main.c 2009-05-10 22:04:39.000000000 +0200
121329 +++ linux-2.6.29-rc3.owrt/virt/kvm/kvm_main.c 2009-05-10 23:48:34.000000000 +0200
121330 @@ -173,6 +173,7 @@
121331 assigned_dev->host_irq_disabled = false;
121332 }
121333 mutex_unlock(&assigned_dev->kvm->lock);
121334 + kvm_put_kvm(assigned_dev->kvm);
121335 }
121336
121337 static irqreturn_t kvm_assigned_dev_intr(int irq, void *dev_id)
121338 @@ -180,6 +181,8 @@
121339 struct kvm_assigned_dev_kernel *assigned_dev =
121340 (struct kvm_assigned_dev_kernel *) dev_id;
121341
121342 + kvm_get_kvm(assigned_dev->kvm);
121343 +
121344 schedule_work(&assigned_dev->interrupt_work);
121345
121346 disable_irq_nosync(irq);
121347 @@ -210,7 +213,6 @@
121348 }
121349 }
121350
121351 -/* The function implicit hold kvm->lock mutex due to cancel_work_sync() */
121352 static void kvm_free_assigned_irq(struct kvm *kvm,
121353 struct kvm_assigned_dev_kernel *assigned_dev)
121354 {
121355 @@ -226,24 +228,11 @@
121356 if (!assigned_dev->irq_requested_type)
121357 return;
121358
121359 - /*
121360 - * In kvm_free_device_irq, cancel_work_sync return true if:
121361 - * 1. work is scheduled, and then cancelled.
121362 - * 2. work callback is executed.
121363 - *
121364 - * The first one ensured that the irq is disabled and no more events
121365 - * would happen. But for the second one, the irq may be enabled (e.g.
121366 - * for MSI). So we disable irq here to prevent further events.
121367 - *
121368 - * Notice this maybe result in nested disable if the interrupt type is
121369 - * INTx, but it's OK for we are going to free it.
121370 - *
121371 - * If this function is a part of VM destroy, please ensure that till
121372 - * now, the kvm state is still legal for probably we also have to wait
121373 - * interrupt_work done.
121374 - */
121375 - disable_irq_nosync(assigned_dev->host_irq);
121376 - cancel_work_sync(&assigned_dev->interrupt_work);
121377 + if (cancel_work_sync(&assigned_dev->interrupt_work))
121378 + /* We had pending work. That means we will have to take
121379 + * care of kvm_put_kvm.
121380 + */
121381 + kvm_put_kvm(kvm);
121382
121383 free_irq(assigned_dev->host_irq, (void *)assigned_dev);
121384
121385 @@ -296,8 +285,8 @@
121386
121387 if (irqchip_in_kernel(kvm)) {
121388 if (!msi2intx &&
121389 - (adev->irq_requested_type & KVM_ASSIGNED_DEV_HOST_MSI)) {
121390 - free_irq(adev->host_irq, (void *)adev);
121391 + adev->irq_requested_type & KVM_ASSIGNED_DEV_HOST_MSI) {
121392 + free_irq(adev->host_irq, (void *)kvm);
121393 pci_disable_msi(adev->dev);
121394 }
121395
121396 @@ -466,7 +455,6 @@
121397 struct kvm_assigned_dev_kernel *match;
121398 struct pci_dev *dev;
121399
121400 - down_read(&kvm->slots_lock);
121401 mutex_lock(&kvm->lock);
121402
121403 match = kvm_find_assigned_dev(&kvm->arch.assigned_dev_head,
121404 @@ -528,7 +516,6 @@
121405
121406 out:
121407 mutex_unlock(&kvm->lock);
121408 - up_read(&kvm->slots_lock);
121409 return r;
121410 out_list_del:
121411 list_del(&match->list);
121412 @@ -540,7 +527,6 @@
121413 out_free:
121414 kfree(match);
121415 mutex_unlock(&kvm->lock);
121416 - up_read(&kvm->slots_lock);
121417 return r;
121418 }
121419 #endif
121420 @@ -803,19 +789,11 @@
121421 return young;
121422 }
121423
121424 -static void kvm_mmu_notifier_release(struct mmu_notifier *mn,
121425 - struct mm_struct *mm)
121426 -{
121427 - struct kvm *kvm = mmu_notifier_to_kvm(mn);
121428 - kvm_arch_flush_shadow(kvm);
121429 -}
121430 -
121431 static const struct mmu_notifier_ops kvm_mmu_notifier_ops = {
121432 .invalidate_page = kvm_mmu_notifier_invalidate_page,
121433 .invalidate_range_start = kvm_mmu_notifier_invalidate_range_start,
121434 .invalidate_range_end = kvm_mmu_notifier_invalidate_range_end,
121435 .clear_flush_young = kvm_mmu_notifier_clear_flush_young,
121436 - .release = kvm_mmu_notifier_release,
121437 };
121438 #endif /* CONFIG_MMU_NOTIFIER && KVM_ARCH_WANT_MMU_NOTIFIER */
121439
121440 @@ -905,7 +883,6 @@
121441 {
121442 struct mm_struct *mm = kvm->mm;
121443
121444 - kvm_arch_sync_events(kvm);
121445 spin_lock(&kvm_lock);
121446 list_del(&kvm->vm_list);
121447 spin_unlock(&kvm_lock);
This page took 5.531554 seconds and 5 git commands to generate.