Gentoo Archives: gentoo-commits

From: "Mike Pagano (mpagano)" <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] linux-patches r1689 - genpatches-2.6/trunk/2.6.32
Date: Thu, 01 Apr 2010 12:10:18
Message-Id: E1NxJDk-0005HE-S0@stork.gentoo.org
1 Author: mpagano
2 Date: 2010-04-01 12:10:00 +0000 (Thu, 01 Apr 2010)
3 New Revision: 1689
4
5 Added:
6 genpatches-2.6/trunk/2.6.32/1009_linux-2.6.32.10.patch
7 Modified:
8 genpatches-2.6/trunk/2.6.32/0000_README
9 Log:
10 Linux patch version 2.6.32.10
11
12 Modified: genpatches-2.6/trunk/2.6.32/0000_README
13 ===================================================================
14 --- genpatches-2.6/trunk/2.6.32/0000_README 2010-03-15 19:55:50 UTC (rev 1688)
15 +++ genpatches-2.6/trunk/2.6.32/0000_README 2010-04-01 12:10:00 UTC (rev 1689)
16 @@ -75,6 +75,10 @@
17 From: http://www.kernel.org
18 Desc: Linux 2.6.32.9
19
20 +Patch: 1009_linux-2.6.32.10.patch
21 +From: http://www.kernel.org
22 +Desc: Linux 2.6.32.10
23 +
24 Patch: 2400_5906-transmit-hang-fix.patch
25 From: http://bugs.gentoo.org/show_bug.cgi?id=304625
26 Desc: tg3: Fix 5906 transmit hangs
27
28 Added: genpatches-2.6/trunk/2.6.32/1009_linux-2.6.32.10.patch
29 ===================================================================
30 --- genpatches-2.6/trunk/2.6.32/1009_linux-2.6.32.10.patch (rev 0)
31 +++ genpatches-2.6/trunk/2.6.32/1009_linux-2.6.32.10.patch 2010-04-01 12:10:00 UTC (rev 1689)
32 @@ -0,0 +1,7932 @@
33 +diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
34 +index 5bc4eaa..345c399 100644
35 +--- a/Documentation/kernel-parameters.txt
36 ++++ b/Documentation/kernel-parameters.txt
37 +@@ -2668,6 +2668,13 @@ and is between 256 and 4096 characters. It is defined in the file
38 + medium is write-protected).
39 + Example: quirks=0419:aaf5:rl,0421:0433:rc
40 +
41 ++ userpte=
42 ++ [X86] Flags controlling user PTE allocations.
43 ++
44 ++ nohigh = do not allocate PTE pages in
45 ++ HIGHMEM regardless of setting
46 ++ of CONFIG_HIGHPTE.
47 ++
48 + vdso= [X86,SH]
49 + vdso=2: enable compat VDSO (default with COMPAT_VDSO)
50 + vdso=1: enable VDSO (default)
51 +diff --git a/arch/Kconfig b/arch/Kconfig
52 +index 7f418bb..90934b9 100644
53 +--- a/arch/Kconfig
54 ++++ b/arch/Kconfig
55 +@@ -6,8 +6,6 @@ config OPROFILE
56 + tristate "OProfile system profiling (EXPERIMENTAL)"
57 + depends on PROFILING
58 + depends on HAVE_OPROFILE
59 +- depends on TRACING_SUPPORT
60 +- select TRACING
61 + select RING_BUFFER
62 + select RING_BUFFER_ALLOW_SWAP
63 + help
64 +diff --git a/arch/ia64/include/asm/acpi.h b/arch/ia64/include/asm/acpi.h
65 +index 91df968..8a20b58 100644
66 +--- a/arch/ia64/include/asm/acpi.h
67 ++++ b/arch/ia64/include/asm/acpi.h
68 +@@ -94,6 +94,7 @@ ia64_acpi_release_global_lock (unsigned int *lock)
69 + #define acpi_noirq 0 /* ACPI always enabled on IA64 */
70 + #define acpi_pci_disabled 0 /* ACPI PCI always enabled on IA64 */
71 + #define acpi_strict 1 /* no ACPI spec workarounds on IA64 */
72 ++#define acpi_ht 0 /* no HT-only mode on IA64 */
73 + #endif
74 + #define acpi_processor_cstate_check(x) (x) /* no idle limits on IA64 :) */
75 + static inline void disable_acpi(void) { }
76 +diff --git a/arch/sparc/include/asm/io_32.h b/arch/sparc/include/asm/io_32.h
77 +index 93fe21e..679c750 100644
78 +--- a/arch/sparc/include/asm/io_32.h
79 ++++ b/arch/sparc/include/asm/io_32.h
80 +@@ -8,7 +8,7 @@
81 + #include <asm/page.h> /* IO address mapping routines need this */
82 + #include <asm/system.h>
83 +
84 +-#define page_to_phys(page) (((page) - mem_map) << PAGE_SHIFT)
85 ++#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
86 +
87 + static inline u32 flip_dword (u32 l)
88 + {
89 +diff --git a/arch/sparc/include/asm/page_32.h b/arch/sparc/include/asm/page_32.h
90 +index f72080b..156707b 100644
91 +--- a/arch/sparc/include/asm/page_32.h
92 ++++ b/arch/sparc/include/asm/page_32.h
93 +@@ -143,7 +143,7 @@ extern unsigned long pfn_base;
94 + #define phys_to_virt __va
95 +
96 + #define ARCH_PFN_OFFSET (pfn_base)
97 +-#define virt_to_page(kaddr) (mem_map + ((((unsigned long)(kaddr)-PAGE_OFFSET)>>PAGE_SHIFT)))
98 ++#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
99 +
100 + #define pfn_valid(pfn) (((pfn) >= (pfn_base)) && (((pfn)-(pfn_base)) < max_mapnr))
101 + #define virt_addr_valid(kaddr) ((((unsigned long)(kaddr)-PAGE_OFFSET)>>PAGE_SHIFT) < max_mapnr)
102 +diff --git a/arch/sparc/include/asm/stat.h b/arch/sparc/include/asm/stat.h
103 +index 55db5ec..39327d6 100644
104 +--- a/arch/sparc/include/asm/stat.h
105 ++++ b/arch/sparc/include/asm/stat.h
106 +@@ -53,8 +53,8 @@ struct stat {
107 + ino_t st_ino;
108 + mode_t st_mode;
109 + short st_nlink;
110 +- uid_t st_uid;
111 +- gid_t st_gid;
112 ++ uid16_t st_uid;
113 ++ gid16_t st_gid;
114 + unsigned short st_rdev;
115 + off_t st_size;
116 + time_t st_atime;
117 +diff --git a/arch/sparc/kernel/central.c b/arch/sparc/kernel/central.c
118 +index f3b5466..4589ca3 100644
119 +--- a/arch/sparc/kernel/central.c
120 ++++ b/arch/sparc/kernel/central.c
121 +@@ -99,7 +99,7 @@ static int __devinit clock_board_probe(struct of_device *op,
122 +
123 + p->leds_resource.start = (unsigned long)
124 + (p->clock_regs + CLOCK_CTRL);
125 +- p->leds_resource.end = p->leds_resource.end;
126 ++ p->leds_resource.end = p->leds_resource.start;
127 + p->leds_resource.name = "leds";
128 +
129 + p->leds_pdev.name = "sunfire-clockboard-leds";
130 +@@ -194,7 +194,7 @@ static int __devinit fhc_probe(struct of_device *op,
131 + if (!p->central) {
132 + p->leds_resource.start = (unsigned long)
133 + (p->pregs + FHC_PREGS_CTRL);
134 +- p->leds_resource.end = p->leds_resource.end;
135 ++ p->leds_resource.end = p->leds_resource.start;
136 + p->leds_resource.name = "leds";
137 +
138 + p->leds_pdev.name = "sunfire-fhc-leds";
139 +diff --git a/arch/sparc/kernel/process_32.c b/arch/sparc/kernel/process_32.c
140 +index 2830b41..c49865b 100644
141 +--- a/arch/sparc/kernel/process_32.c
142 ++++ b/arch/sparc/kernel/process_32.c
143 +@@ -526,7 +526,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
144 + * Set some valid stack frames to give to the child.
145 + */
146 + childstack = (struct sparc_stackf __user *)
147 +- (sp & ~0x7UL);
148 ++ (sp & ~0xfUL);
149 + parentstack = (struct sparc_stackf __user *)
150 + regs->u_regs[UREG_FP];
151 +
152 +diff --git a/arch/sparc/kernel/process_64.c b/arch/sparc/kernel/process_64.c
153 +index c3f1cce..cb70476 100644
154 +--- a/arch/sparc/kernel/process_64.c
155 ++++ b/arch/sparc/kernel/process_64.c
156 +@@ -398,11 +398,11 @@ static unsigned long clone_stackframe(unsigned long csp, unsigned long psp)
157 + } else
158 + __get_user(fp, &(((struct reg_window32 __user *)psp)->ins[6]));
159 +
160 +- /* Now 8-byte align the stack as this is mandatory in the
161 +- * Sparc ABI due to how register windows work. This hides
162 +- * the restriction from thread libraries etc. -DaveM
163 ++ /* Now align the stack as this is mandatory in the Sparc ABI
164 ++ * due to how register windows work. This hides the
165 ++ * restriction from thread libraries etc.
166 + */
167 +- csp &= ~7UL;
168 ++ csp &= ~15UL;
169 +
170 + distance = fp - psp;
171 + rval = (csp - distance);
172 +diff --git a/arch/sparc/kernel/signal32.c b/arch/sparc/kernel/signal32.c
173 +index ba5b09a..ea22cd3 100644
174 +--- a/arch/sparc/kernel/signal32.c
175 ++++ b/arch/sparc/kernel/signal32.c
176 +@@ -120,8 +120,8 @@ struct rt_signal_frame32 {
177 + };
178 +
179 + /* Align macros */
180 +-#define SF_ALIGNEDSZ (((sizeof(struct signal_frame32) + 7) & (~7)))
181 +-#define RT_ALIGNEDSZ (((sizeof(struct rt_signal_frame32) + 7) & (~7)))
182 ++#define SF_ALIGNEDSZ (((sizeof(struct signal_frame32) + 15) & (~15)))
183 ++#define RT_ALIGNEDSZ (((sizeof(struct rt_signal_frame32) + 15) & (~15)))
184 +
185 + int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from)
186 + {
187 +@@ -420,15 +420,17 @@ static void __user *get_sigframe(struct sigaction *sa, struct pt_regs *regs, uns
188 + sp = current->sas_ss_sp + current->sas_ss_size;
189 + }
190 +
191 ++ sp -= framesize;
192 ++
193 + /* Always align the stack frame. This handles two cases. First,
194 + * sigaltstack need not be mindful of platform specific stack
195 + * alignment. Second, if we took this signal because the stack
196 + * is not aligned properly, we'd like to take the signal cleanly
197 + * and report that.
198 + */
199 +- sp &= ~7UL;
200 ++ sp &= ~15UL;
201 +
202 +- return (void __user *)(sp - framesize);
203 ++ return (void __user *) sp;
204 + }
205 +
206 + static int save_fpu_state32(struct pt_regs *regs, __siginfo_fpu_t __user *fpu)
207 +diff --git a/arch/sparc/kernel/signal_32.c b/arch/sparc/kernel/signal_32.c
208 +index 7ce1a10..9882df9 100644
209 +--- a/arch/sparc/kernel/signal_32.c
210 ++++ b/arch/sparc/kernel/signal_32.c
211 +@@ -267,15 +267,17 @@ static inline void __user *get_sigframe(struct sigaction *sa, struct pt_regs *re
212 + sp = current->sas_ss_sp + current->sas_ss_size;
213 + }
214 +
215 ++ sp -= framesize;
216 ++
217 + /* Always align the stack frame. This handles two cases. First,
218 + * sigaltstack need not be mindful of platform specific stack
219 + * alignment. Second, if we took this signal because the stack
220 + * is not aligned properly, we'd like to take the signal cleanly
221 + * and report that.
222 + */
223 +- sp &= ~7UL;
224 ++ sp &= ~15UL;
225 +
226 +- return (void __user *)(sp - framesize);
227 ++ return (void __user *) sp;
228 + }
229 +
230 + static inline int
231 +diff --git a/arch/sparc/kernel/signal_64.c b/arch/sparc/kernel/signal_64.c
232 +index 647afbd..9fa48c3 100644
233 +--- a/arch/sparc/kernel/signal_64.c
234 ++++ b/arch/sparc/kernel/signal_64.c
235 +@@ -353,7 +353,7 @@ segv:
236 + /* Checks if the fp is valid */
237 + static int invalid_frame_pointer(void __user *fp, int fplen)
238 + {
239 +- if (((unsigned long) fp) & 7)
240 ++ if (((unsigned long) fp) & 15)
241 + return 1;
242 + return 0;
243 + }
244 +@@ -396,15 +396,17 @@ static inline void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *
245 + sp = current->sas_ss_sp + current->sas_ss_size;
246 + }
247 +
248 ++ sp -= framesize;
249 ++
250 + /* Always align the stack frame. This handles two cases. First,
251 + * sigaltstack need not be mindful of platform specific stack
252 + * alignment. Second, if we took this signal because the stack
253 + * is not aligned properly, we'd like to take the signal cleanly
254 + * and report that.
255 + */
256 +- sp &= ~7UL;
257 ++ sp &= ~15UL;
258 +
259 +- return (void __user *)(sp - framesize);
260 ++ return (void __user *) sp;
261 + }
262 +
263 + static inline void
264 +diff --git a/arch/sparc/kernel/tsb.S b/arch/sparc/kernel/tsb.S
265 +index 8c91d9b..db15d12 100644
266 +--- a/arch/sparc/kernel/tsb.S
267 ++++ b/arch/sparc/kernel/tsb.S
268 +@@ -191,10 +191,12 @@ tsb_dtlb_load:
269 +
270 + tsb_itlb_load:
271 + /* Executable bit must be set. */
272 +-661: andcc %g5, _PAGE_EXEC_4U, %g0
273 +- .section .sun4v_1insn_patch, "ax"
274 ++661: sethi %hi(_PAGE_EXEC_4U), %g4
275 ++ andcc %g5, %g4, %g0
276 ++ .section .sun4v_2insn_patch, "ax"
277 + .word 661b
278 + andcc %g5, _PAGE_EXEC_4V, %g0
279 ++ nop
280 + .previous
281 +
282 + be,pn %xcc, tsb_do_fault
283 +diff --git a/arch/x86/ia32/ia32_aout.c b/arch/x86/ia32/ia32_aout.c
284 +index f9f4724..14531ab 100644
285 +--- a/arch/x86/ia32/ia32_aout.c
286 ++++ b/arch/x86/ia32/ia32_aout.c
287 +@@ -327,7 +327,6 @@ static int load_aout_binary(struct linux_binprm *bprm, struct pt_regs *regs)
288 + current->mm->free_area_cache = TASK_UNMAPPED_BASE;
289 + current->mm->cached_hole_size = 0;
290 +
291 +- current->mm->mmap = NULL;
292 + install_exec_creds(bprm);
293 + current->flags &= ~PF_FORKNOEXEC;
294 +
295 +diff --git a/arch/x86/include/asm/io_apic.h b/arch/x86/include/asm/io_apic.h
296 +index 7c7c16c..5f61f6e 100644
297 +--- a/arch/x86/include/asm/io_apic.h
298 ++++ b/arch/x86/include/asm/io_apic.h
299 +@@ -160,6 +160,7 @@ extern int io_apic_get_redir_entries(int ioapic);
300 + struct io_apic_irq_attr;
301 + extern int io_apic_set_pci_routing(struct device *dev, int irq,
302 + struct io_apic_irq_attr *irq_attr);
303 ++void setup_IO_APIC_irq_extra(u32 gsi);
304 + extern int (*ioapic_renumber_irq)(int ioapic, int irq);
305 + extern void ioapic_init_mappings(void);
306 + extern void ioapic_insert_resources(void);
307 +diff --git a/arch/x86/include/asm/pgalloc.h b/arch/x86/include/asm/pgalloc.h
308 +index 0e8c2a0..271de94 100644
309 +--- a/arch/x86/include/asm/pgalloc.h
310 ++++ b/arch/x86/include/asm/pgalloc.h
311 +@@ -23,6 +23,11 @@ static inline void paravirt_release_pud(unsigned long pfn) {}
312 + #endif
313 +
314 + /*
315 ++ * Flags to use when allocating a user page table page.
316 ++ */
317 ++extern gfp_t __userpte_alloc_gfp;
318 ++
319 ++/*
320 + * Allocate and free page tables.
321 + */
322 + extern pgd_t *pgd_alloc(struct mm_struct *);
323 +diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
324 +index 67e929b..195e4b7 100644
325 +--- a/arch/x86/kernel/acpi/boot.c
326 ++++ b/arch/x86/kernel/acpi/boot.c
327 +@@ -446,6 +446,12 @@ void __init acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger)
328 + int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
329 + {
330 + *irq = gsi;
331 ++
332 ++#ifdef CONFIG_X86_IO_APIC
333 ++ if (acpi_irq_model == ACPI_IRQ_MODEL_IOAPIC)
334 ++ setup_IO_APIC_irq_extra(gsi);
335 ++#endif
336 ++
337 + return 0;
338 + }
339 +
340 +@@ -473,7 +479,8 @@ int acpi_register_gsi(struct device *dev, u32 gsi, int trigger, int polarity)
341 + plat_gsi = mp_register_gsi(dev, gsi, trigger, polarity);
342 + }
343 + #endif
344 +- acpi_gsi_to_irq(plat_gsi, &irq);
345 ++ irq = plat_gsi;
346 ++
347 + return irq;
348 + }
349 +
350 +@@ -1348,14 +1355,6 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = {
351 + },
352 + {
353 + .callback = force_acpi_ht,
354 +- .ident = "ASUS P2B-DS",
355 +- .matches = {
356 +- DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
357 +- DMI_MATCH(DMI_BOARD_NAME, "P2B-DS"),
358 +- },
359 +- },
360 +- {
361 +- .callback = force_acpi_ht,
362 + .ident = "ASUS CUR-DLS",
363 + .matches = {
364 + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
365 +diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
366 +index c107e83..dc4f486 100644
367 +--- a/arch/x86/kernel/apic/io_apic.c
368 ++++ b/arch/x86/kernel/apic/io_apic.c
369 +@@ -1550,6 +1550,56 @@ static void __init setup_IO_APIC_irqs(void)
370 + }
371 +
372 + /*
373 ++ * for the gsit that is not in first ioapic
374 ++ * but could not use acpi_register_gsi()
375 ++ * like some special sci in IBM x3330
376 ++ */
377 ++void setup_IO_APIC_irq_extra(u32 gsi)
378 ++{
379 ++ int apic_id = 0, pin, idx, irq;
380 ++ int node = cpu_to_node(boot_cpu_id);
381 ++ struct irq_desc *desc;
382 ++ struct irq_cfg *cfg;
383 ++
384 ++ /*
385 ++ * Convert 'gsi' to 'ioapic.pin'.
386 ++ */
387 ++ apic_id = mp_find_ioapic(gsi);
388 ++ if (apic_id < 0)
389 ++ return;
390 ++
391 ++ pin = mp_find_ioapic_pin(apic_id, gsi);
392 ++ idx = find_irq_entry(apic_id, pin, mp_INT);
393 ++ if (idx == -1)
394 ++ return;
395 ++
396 ++ irq = pin_2_irq(idx, apic_id, pin);
397 ++#ifdef CONFIG_SPARSE_IRQ
398 ++ desc = irq_to_desc(irq);
399 ++ if (desc)
400 ++ return;
401 ++#endif
402 ++ desc = irq_to_desc_alloc_node(irq, node);
403 ++ if (!desc) {
404 ++ printk(KERN_INFO "can not get irq_desc for %d\n", irq);
405 ++ return;
406 ++ }
407 ++
408 ++ cfg = desc->chip_data;
409 ++ add_pin_to_irq_node(cfg, node, apic_id, pin);
410 ++
411 ++ if (test_bit(pin, mp_ioapic_routing[apic_id].pin_programmed)) {
412 ++ pr_debug("Pin %d-%d already programmed\n",
413 ++ mp_ioapics[apic_id].apicid, pin);
414 ++ return;
415 ++ }
416 ++ set_bit(pin, mp_ioapic_routing[apic_id].pin_programmed);
417 ++
418 ++ setup_IO_APIC_irq(apic_id, pin, irq, desc,
419 ++ irq_trigger(idx), irq_polarity(idx));
420 ++}
421 ++
422 ++/*
423 + * Set up the timer pin, possibly with the 8259A-master behind.
424 + */
425 + static void __init setup_timer_IRQ0_pin(unsigned int apic_id, unsigned int pin,
426 +@@ -3165,12 +3215,9 @@ unsigned int create_irq_nr(unsigned int irq_want, int node)
427 + }
428 + spin_unlock_irqrestore(&vector_lock, flags);
429 +
430 +- if (irq > 0) {
431 +- dynamic_irq_init(irq);
432 +- /* restore it, in case dynamic_irq_init clear it */
433 +- if (desc_new)
434 +- desc_new->chip_data = cfg_new;
435 +- }
436 ++ if (irq > 0)
437 ++ dynamic_irq_init_keep_chip_data(irq);
438 ++
439 + return irq;
440 + }
441 +
442 +@@ -3193,17 +3240,12 @@ void destroy_irq(unsigned int irq)
443 + {
444 + unsigned long flags;
445 + struct irq_cfg *cfg;
446 +- struct irq_desc *desc;
447 +
448 +- /* store it, in case dynamic_irq_cleanup clear it */
449 +- desc = irq_to_desc(irq);
450 +- cfg = desc->chip_data;
451 +- dynamic_irq_cleanup(irq);
452 +- /* connect back irq_cfg */
453 +- desc->chip_data = cfg;
454 ++ dynamic_irq_cleanup_keep_chip_data(irq);
455 +
456 + free_irte(irq);
457 + spin_lock_irqsave(&vector_lock, flags);
458 ++ cfg = irq_to_desc(irq)->chip_data;
459 + __clear_irq_vector(irq, cfg);
460 + spin_unlock_irqrestore(&vector_lock, flags);
461 + }
462 +diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
463 +index bff34d6..269c2a3 100644
464 +--- a/arch/x86/kernel/reboot.c
465 ++++ b/arch/x86/kernel/reboot.c
466 +@@ -461,6 +461,14 @@ static struct dmi_system_id __initdata pci_reboot_dmi_table[] = {
467 + DMI_MATCH(DMI_PRODUCT_NAME, "Macmini3,1"),
468 + },
469 + },
470 ++ { /* Handle problems with rebooting on the iMac9,1. */
471 ++ .callback = set_pci_reboot,
472 ++ .ident = "Apple iMac9,1",
473 ++ .matches = {
474 ++ DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
475 ++ DMI_MATCH(DMI_PRODUCT_NAME, "iMac9,1"),
476 ++ },
477 ++ },
478 + { }
479 + };
480 +
481 +diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
482 +index e02dbb6..7371e65 100644
483 +--- a/arch/x86/kvm/emulate.c
484 ++++ b/arch/x86/kvm/emulate.c
485 +@@ -75,6 +75,7 @@
486 + #define Group (1<<14) /* Bits 3:5 of modrm byte extend opcode */
487 + #define GroupDual (1<<15) /* Alternate decoding of mod == 3 */
488 + #define GroupMask 0xff /* Group number stored in bits 0:7 */
489 ++#define Priv (1<<27) /* instruction generates #GP if current CPL != 0 */
490 + /* Source 2 operand type */
491 + #define Src2None (0<<29)
492 + #define Src2CL (1<<29)
493 +@@ -86,6 +87,7 @@
494 + enum {
495 + Group1_80, Group1_81, Group1_82, Group1_83,
496 + Group1A, Group3_Byte, Group3, Group4, Group5, Group7,
497 ++ Group8, Group9,
498 + };
499 +
500 + static u32 opcode_table[256] = {
501 +@@ -203,7 +205,7 @@ static u32 opcode_table[256] = {
502 + SrcNone | ByteOp | ImplicitOps, SrcNone | ImplicitOps,
503 + /* 0xF0 - 0xF7 */
504 + 0, 0, 0, 0,
505 +- ImplicitOps, ImplicitOps, Group | Group3_Byte, Group | Group3,
506 ++ ImplicitOps | Priv, ImplicitOps, Group | Group3_Byte, Group | Group3,
507 + /* 0xF8 - 0xFF */
508 + ImplicitOps, 0, ImplicitOps, ImplicitOps,
509 + ImplicitOps, ImplicitOps, Group | Group4, Group | Group5,
510 +@@ -211,16 +213,20 @@ static u32 opcode_table[256] = {
511 +
512 + static u32 twobyte_table[256] = {
513 + /* 0x00 - 0x0F */
514 +- 0, Group | GroupDual | Group7, 0, 0, 0, ImplicitOps, ImplicitOps, 0,
515 +- ImplicitOps, ImplicitOps, 0, 0, 0, ImplicitOps | ModRM, 0, 0,
516 ++ 0, Group | GroupDual | Group7, 0, 0,
517 ++ 0, ImplicitOps, ImplicitOps | Priv, 0,
518 ++ ImplicitOps | Priv, ImplicitOps | Priv, 0, 0,
519 ++ 0, ImplicitOps | ModRM, 0, 0,
520 + /* 0x10 - 0x1F */
521 + 0, 0, 0, 0, 0, 0, 0, 0, ImplicitOps | ModRM, 0, 0, 0, 0, 0, 0, 0,
522 + /* 0x20 - 0x2F */
523 +- ModRM | ImplicitOps, ModRM, ModRM | ImplicitOps, ModRM, 0, 0, 0, 0,
524 ++ ModRM | ImplicitOps | Priv, ModRM | Priv,
525 ++ ModRM | ImplicitOps | Priv, ModRM | Priv,
526 ++ 0, 0, 0, 0,
527 + 0, 0, 0, 0, 0, 0, 0, 0,
528 + /* 0x30 - 0x3F */
529 +- ImplicitOps, 0, ImplicitOps, 0,
530 +- ImplicitOps, ImplicitOps, 0, 0,
531 ++ ImplicitOps | Priv, 0, ImplicitOps | Priv, 0,
532 ++ ImplicitOps, ImplicitOps | Priv, 0, 0,
533 + 0, 0, 0, 0, 0, 0, 0, 0,
534 + /* 0x40 - 0x47 */
535 + DstReg | SrcMem | ModRM | Mov, DstReg | SrcMem | ModRM | Mov,
536 +@@ -258,11 +264,12 @@ static u32 twobyte_table[256] = {
537 + 0, 0, ByteOp | DstReg | SrcMem | ModRM | Mov,
538 + DstReg | SrcMem16 | ModRM | Mov,
539 + /* 0xB8 - 0xBF */
540 +- 0, 0, DstMem | SrcImmByte | ModRM, DstMem | SrcReg | ModRM | BitOp,
541 ++ 0, 0, Group | Group8, DstMem | SrcReg | ModRM | BitOp,
542 + 0, 0, ByteOp | DstReg | SrcMem | ModRM | Mov,
543 + DstReg | SrcMem16 | ModRM | Mov,
544 + /* 0xC0 - 0xCF */
545 +- 0, 0, 0, DstMem | SrcReg | ModRM | Mov, 0, 0, 0, ImplicitOps | ModRM,
546 ++ 0, 0, 0, DstMem | SrcReg | ModRM | Mov,
547 ++ 0, 0, 0, Group | GroupDual | Group9,
548 + 0, 0, 0, 0, 0, 0, 0, 0,
549 + /* 0xD0 - 0xDF */
550 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
551 +@@ -311,16 +318,24 @@ static u32 group_table[] = {
552 + SrcMem | ModRM | Stack, 0,
553 + SrcMem | ModRM | Stack, 0, SrcMem | ModRM | Stack, 0,
554 + [Group7*8] =
555 +- 0, 0, ModRM | SrcMem, ModRM | SrcMem,
556 ++ 0, 0, ModRM | SrcMem | Priv, ModRM | SrcMem | Priv,
557 + SrcNone | ModRM | DstMem | Mov, 0,
558 +- SrcMem16 | ModRM | Mov, SrcMem | ModRM | ByteOp,
559 ++ SrcMem16 | ModRM | Mov | Priv, SrcMem | ModRM | ByteOp | Priv,
560 ++ [Group8*8] =
561 ++ 0, 0, 0, 0,
562 ++ DstMem | SrcImmByte | ModRM, DstMem | SrcImmByte | ModRM,
563 ++ DstMem | SrcImmByte | ModRM, DstMem | SrcImmByte | ModRM,
564 ++ [Group9*8] =
565 ++ 0, ImplicitOps | ModRM, 0, 0, 0, 0, 0, 0,
566 + };
567 +
568 + static u32 group2_table[] = {
569 + [Group7*8] =
570 +- SrcNone | ModRM, 0, 0, SrcNone | ModRM,
571 ++ SrcNone | ModRM | Priv, 0, 0, SrcNone | ModRM,
572 + SrcNone | ModRM | DstMem | Mov, 0,
573 + SrcMem16 | ModRM | Mov, 0,
574 ++ [Group9*8] =
575 ++ 0, 0, 0, 0, 0, 0, 0, 0,
576 + };
577 +
578 + /* EFLAGS bit definitions. */
579 +@@ -1563,12 +1578,6 @@ emulate_sysexit(struct x86_emulate_ctxt *ctxt)
580 + return -1;
581 + }
582 +
583 +- /* sysexit must be called from CPL 0 */
584 +- if (kvm_x86_ops->get_cpl(ctxt->vcpu) != 0) {
585 +- kvm_inject_gp(ctxt->vcpu, 0);
586 +- return -1;
587 +- }
588 +-
589 + setup_syscalls_segments(ctxt, &cs, &ss);
590 +
591 + if ((c->rex_prefix & 0x8) != 0x0)
592 +@@ -1632,6 +1641,12 @@ x86_emulate_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops)
593 + memcpy(c->regs, ctxt->vcpu->arch.regs, sizeof c->regs);
594 + saved_eip = c->eip;
595 +
596 ++ /* Privileged instruction can be executed only in CPL=0 */
597 ++ if ((c->d & Priv) && kvm_x86_ops->get_cpl(ctxt->vcpu)) {
598 ++ kvm_inject_gp(ctxt->vcpu, 0);
599 ++ goto done;
600 ++ }
601 ++
602 + if (((c->d & ModRM) && (c->modrm_mod != 3)) || (c->d & MemAbs))
603 + memop = c->modrm_ea;
604 +
605 +@@ -1870,6 +1885,12 @@ special_insn:
606 + int err;
607 +
608 + sel = c->src.val;
609 ++
610 ++ if (c->modrm_reg == VCPU_SREG_CS) {
611 ++ kvm_queue_exception(ctxt->vcpu, UD_VECTOR);
612 ++ goto done;
613 ++ }
614 ++
615 + if (c->modrm_reg == VCPU_SREG_SS)
616 + toggle_interruptibility(ctxt, X86_SHADOW_INT_MOV_SS);
617 +
618 +diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
619 +index ed34f5e..c9ba9de 100644
620 +--- a/arch/x86/mm/pgtable.c
621 ++++ b/arch/x86/mm/pgtable.c
622 +@@ -6,6 +6,14 @@
623 +
624 + #define PGALLOC_GFP GFP_KERNEL | __GFP_NOTRACK | __GFP_REPEAT | __GFP_ZERO
625 +
626 ++#ifdef CONFIG_HIGHPTE
627 ++#define PGALLOC_USER_GFP __GFP_HIGHMEM
628 ++#else
629 ++#define PGALLOC_USER_GFP 0
630 ++#endif
631 ++
632 ++gfp_t __userpte_alloc_gfp = PGALLOC_GFP | PGALLOC_USER_GFP;
633 ++
634 + pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
635 + {
636 + return (pte_t *)__get_free_page(PGALLOC_GFP);
637 +@@ -15,16 +23,29 @@ pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address)
638 + {
639 + struct page *pte;
640 +
641 +-#ifdef CONFIG_HIGHPTE
642 +- pte = alloc_pages(PGALLOC_GFP | __GFP_HIGHMEM, 0);
643 +-#else
644 +- pte = alloc_pages(PGALLOC_GFP, 0);
645 +-#endif
646 ++ pte = alloc_pages(__userpte_alloc_gfp, 0);
647 + if (pte)
648 + pgtable_page_ctor(pte);
649 + return pte;
650 + }
651 +
652 ++static int __init setup_userpte(char *arg)
653 ++{
654 ++ if (!arg)
655 ++ return -EINVAL;
656 ++
657 ++ /*
658 ++ * "userpte=nohigh" disables allocation of user pagetables in
659 ++ * high memory.
660 ++ */
661 ++ if (strcmp(arg, "nohigh") == 0)
662 ++ __userpte_alloc_gfp &= ~__GFP_HIGHMEM;
663 ++ else
664 ++ return -EINVAL;
665 ++ return 0;
666 ++}
667 ++early_param("userpte", setup_userpte);
668 ++
669 + void ___pte_free_tlb(struct mmu_gather *tlb, struct page *pte)
670 + {
671 + pgtable_page_dtor(pte);
672 +diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c
673 +index 3347f69..2c505ee 100644
674 +--- a/arch/x86/oprofile/nmi_int.c
675 ++++ b/arch/x86/oprofile/nmi_int.c
676 +@@ -159,7 +159,7 @@ static int nmi_setup_mux(void)
677 +
678 + for_each_possible_cpu(i) {
679 + per_cpu(cpu_msrs, i).multiplex =
680 +- kmalloc(multiplex_size, GFP_KERNEL);
681 ++ kzalloc(multiplex_size, GFP_KERNEL);
682 + if (!per_cpu(cpu_msrs, i).multiplex)
683 + return 0;
684 + }
685 +@@ -179,7 +179,6 @@ static void nmi_cpu_setup_mux(int cpu, struct op_msrs const * const msrs)
686 + if (counter_config[i].enabled) {
687 + multiplex[i].saved = -(u64)counter_config[i].count;
688 + } else {
689 +- multiplex[i].addr = 0;
690 + multiplex[i].saved = 0;
691 + }
692 + }
693 +@@ -189,25 +188,27 @@ static void nmi_cpu_setup_mux(int cpu, struct op_msrs const * const msrs)
694 +
695 + static void nmi_cpu_save_mpx_registers(struct op_msrs *msrs)
696 + {
697 ++ struct op_msr *counters = msrs->counters;
698 + struct op_msr *multiplex = msrs->multiplex;
699 + int i;
700 +
701 + for (i = 0; i < model->num_counters; ++i) {
702 + int virt = op_x86_phys_to_virt(i);
703 +- if (multiplex[virt].addr)
704 +- rdmsrl(multiplex[virt].addr, multiplex[virt].saved);
705 ++ if (counters[i].addr)
706 ++ rdmsrl(counters[i].addr, multiplex[virt].saved);
707 + }
708 + }
709 +
710 + static void nmi_cpu_restore_mpx_registers(struct op_msrs *msrs)
711 + {
712 ++ struct op_msr *counters = msrs->counters;
713 + struct op_msr *multiplex = msrs->multiplex;
714 + int i;
715 +
716 + for (i = 0; i < model->num_counters; ++i) {
717 + int virt = op_x86_phys_to_virt(i);
718 +- if (multiplex[virt].addr)
719 +- wrmsrl(multiplex[virt].addr, multiplex[virt].saved);
720 ++ if (counters[i].addr)
721 ++ wrmsrl(counters[i].addr, multiplex[virt].saved);
722 + }
723 + }
724 +
725 +@@ -303,11 +304,11 @@ static int allocate_msrs(void)
726 +
727 + int i;
728 + for_each_possible_cpu(i) {
729 +- per_cpu(cpu_msrs, i).counters = kmalloc(counters_size,
730 ++ per_cpu(cpu_msrs, i).counters = kzalloc(counters_size,
731 + GFP_KERNEL);
732 + if (!per_cpu(cpu_msrs, i).counters)
733 + return 0;
734 +- per_cpu(cpu_msrs, i).controls = kmalloc(controls_size,
735 ++ per_cpu(cpu_msrs, i).controls = kzalloc(controls_size,
736 + GFP_KERNEL);
737 + if (!per_cpu(cpu_msrs, i).controls)
738 + return 0;
739 +diff --git a/arch/x86/oprofile/op_model_amd.c b/arch/x86/oprofile/op_model_amd.c
740 +index 39686c2..1ed963d 100644
741 +--- a/arch/x86/oprofile/op_model_amd.c
742 ++++ b/arch/x86/oprofile/op_model_amd.c
743 +@@ -76,19 +76,6 @@ static struct op_ibs_config ibs_config;
744 +
745 + #ifdef CONFIG_OPROFILE_EVENT_MULTIPLEX
746 +
747 +-static void op_mux_fill_in_addresses(struct op_msrs * const msrs)
748 +-{
749 +- int i;
750 +-
751 +- for (i = 0; i < NUM_VIRT_COUNTERS; i++) {
752 +- int hw_counter = op_x86_virt_to_phys(i);
753 +- if (reserve_perfctr_nmi(MSR_K7_PERFCTR0 + i))
754 +- msrs->multiplex[i].addr = MSR_K7_PERFCTR0 + hw_counter;
755 +- else
756 +- msrs->multiplex[i].addr = 0;
757 +- }
758 +-}
759 +-
760 + static void op_mux_switch_ctrl(struct op_x86_model_spec const *model,
761 + struct op_msrs const * const msrs)
762 + {
763 +@@ -98,7 +85,7 @@ static void op_mux_switch_ctrl(struct op_x86_model_spec const *model,
764 + /* enable active counters */
765 + for (i = 0; i < NUM_COUNTERS; ++i) {
766 + int virt = op_x86_phys_to_virt(i);
767 +- if (!counter_config[virt].enabled)
768 ++ if (!reset_value[virt])
769 + continue;
770 + rdmsrl(msrs->controls[i].addr, val);
771 + val &= model->reserved;
772 +@@ -107,10 +94,6 @@ static void op_mux_switch_ctrl(struct op_x86_model_spec const *model,
773 + }
774 + }
775 +
776 +-#else
777 +-
778 +-static inline void op_mux_fill_in_addresses(struct op_msrs * const msrs) { }
779 +-
780 + #endif
781 +
782 + /* functions for op_amd_spec */
783 +@@ -122,18 +105,12 @@ static void op_amd_fill_in_addresses(struct op_msrs * const msrs)
784 + for (i = 0; i < NUM_COUNTERS; i++) {
785 + if (reserve_perfctr_nmi(MSR_K7_PERFCTR0 + i))
786 + msrs->counters[i].addr = MSR_K7_PERFCTR0 + i;
787 +- else
788 +- msrs->counters[i].addr = 0;
789 + }
790 +
791 + for (i = 0; i < NUM_CONTROLS; i++) {
792 + if (reserve_evntsel_nmi(MSR_K7_EVNTSEL0 + i))
793 + msrs->controls[i].addr = MSR_K7_EVNTSEL0 + i;
794 +- else
795 +- msrs->controls[i].addr = 0;
796 + }
797 +-
798 +- op_mux_fill_in_addresses(msrs);
799 + }
800 +
801 + static void op_amd_setup_ctrs(struct op_x86_model_spec const *model,
802 +@@ -144,7 +121,8 @@ static void op_amd_setup_ctrs(struct op_x86_model_spec const *model,
803 +
804 + /* setup reset_value */
805 + for (i = 0; i < NUM_VIRT_COUNTERS; ++i) {
806 +- if (counter_config[i].enabled)
807 ++ if (counter_config[i].enabled
808 ++ && msrs->counters[op_x86_virt_to_phys(i)].addr)
809 + reset_value[i] = counter_config[i].count;
810 + else
811 + reset_value[i] = 0;
812 +@@ -169,9 +147,7 @@ static void op_amd_setup_ctrs(struct op_x86_model_spec const *model,
813 + /* enable active counters */
814 + for (i = 0; i < NUM_COUNTERS; ++i) {
815 + int virt = op_x86_phys_to_virt(i);
816 +- if (!counter_config[virt].enabled)
817 +- continue;
818 +- if (!msrs->counters[i].addr)
819 ++ if (!reset_value[virt])
820 + continue;
821 +
822 + /* setup counter registers */
823 +@@ -405,16 +381,6 @@ static int init_ibs_nmi(void)
824 + return 1;
825 + }
826 +
827 +-#ifdef CONFIG_NUMA
828 +- /* Sanity check */
829 +- /* Works only for 64bit with proper numa implementation. */
830 +- if (nodes != num_possible_nodes()) {
831 +- printk(KERN_DEBUG "Failed to setup CPU node(s) for IBS, "
832 +- "found: %d, expected %d",
833 +- nodes, num_possible_nodes());
834 +- return 1;
835 +- }
836 +-#endif
837 + return 0;
838 + }
839 +
840 +diff --git a/arch/x86/oprofile/op_model_p4.c b/arch/x86/oprofile/op_model_p4.c
841 +index ac6b354..e6a160a 100644
842 +--- a/arch/x86/oprofile/op_model_p4.c
843 ++++ b/arch/x86/oprofile/op_model_p4.c
844 +@@ -394,12 +394,6 @@ static void p4_fill_in_addresses(struct op_msrs * const msrs)
845 + setup_num_counters();
846 + stag = get_stagger();
847 +
848 +- /* initialize some registers */
849 +- for (i = 0; i < num_counters; ++i)
850 +- msrs->counters[i].addr = 0;
851 +- for (i = 0; i < num_controls; ++i)
852 +- msrs->controls[i].addr = 0;
853 +-
854 + /* the counter & cccr registers we pay attention to */
855 + for (i = 0; i < num_counters; ++i) {
856 + addr = p4_counters[VIRT_CTR(stag, i)].counter_address;
857 +diff --git a/arch/x86/oprofile/op_model_ppro.c b/arch/x86/oprofile/op_model_ppro.c
858 +index 8eb0587..2873c00 100644
859 +--- a/arch/x86/oprofile/op_model_ppro.c
860 ++++ b/arch/x86/oprofile/op_model_ppro.c
861 +@@ -37,15 +37,11 @@ static void ppro_fill_in_addresses(struct op_msrs * const msrs)
862 + for (i = 0; i < num_counters; i++) {
863 + if (reserve_perfctr_nmi(MSR_P6_PERFCTR0 + i))
864 + msrs->counters[i].addr = MSR_P6_PERFCTR0 + i;
865 +- else
866 +- msrs->counters[i].addr = 0;
867 + }
868 +
869 + for (i = 0; i < num_counters; i++) {
870 + if (reserve_evntsel_nmi(MSR_P6_EVNTSEL0 + i))
871 + msrs->controls[i].addr = MSR_P6_EVNTSEL0 + i;
872 +- else
873 +- msrs->controls[i].addr = 0;
874 + }
875 + }
876 +
877 +@@ -57,7 +53,7 @@ static void ppro_setup_ctrs(struct op_x86_model_spec const *model,
878 + int i;
879 +
880 + if (!reset_value) {
881 +- reset_value = kmalloc(sizeof(reset_value[0]) * num_counters,
882 ++ reset_value = kzalloc(sizeof(reset_value[0]) * num_counters,
883 + GFP_ATOMIC);
884 + if (!reset_value)
885 + return;
886 +diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
887 +index 79f9738..3578688 100644
888 +--- a/arch/x86/xen/enlighten.c
889 ++++ b/arch/x86/xen/enlighten.c
890 +@@ -48,6 +48,7 @@
891 + #include <asm/traps.h>
892 + #include <asm/setup.h>
893 + #include <asm/desc.h>
894 ++#include <asm/pgalloc.h>
895 + #include <asm/pgtable.h>
896 + #include <asm/tlbflush.h>
897 + #include <asm/reboot.h>
898 +@@ -1092,6 +1093,12 @@ asmlinkage void __init xen_start_kernel(void)
899 +
900 + __supported_pte_mask |= _PAGE_IOMAP;
901 +
902 ++ /*
903 ++ * Prevent page tables from being allocated in highmem, even
904 ++ * if CONFIG_HIGHPTE is enabled.
905 ++ */
906 ++ __userpte_alloc_gfp &= ~__GFP_HIGHMEM;
907 ++
908 + #ifdef CONFIG_X86_64
909 + /* Work out if we support NX */
910 + check_efer();
911 +diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
912 +index bf4cd6b..350a3de 100644
913 +--- a/arch/x86/xen/mmu.c
914 ++++ b/arch/x86/xen/mmu.c
915 +@@ -1432,14 +1432,15 @@ static void *xen_kmap_atomic_pte(struct page *page, enum km_type type)
916 + {
917 + pgprot_t prot = PAGE_KERNEL;
918 +
919 ++ /*
920 ++ * We disable highmem allocations for page tables so we should never
921 ++ * see any calls to kmap_atomic_pte on a highmem page.
922 ++ */
923 ++ BUG_ON(PageHighMem(page));
924 ++
925 + if (PagePinned(page))
926 + prot = PAGE_KERNEL_RO;
927 +
928 +- if (0 && PageHighMem(page))
929 +- printk("mapping highpte %lx type %d prot %s\n",
930 +- page_to_pfn(page), type,
931 +- (unsigned long)pgprot_val(prot) & _PAGE_RW ? "WRITE" : "READ");
932 +-
933 + return kmap_atomic_prot(page, type, prot);
934 + }
935 + #endif
936 +diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
937 +index d9f78f6..c8f0797 100644
938 +--- a/drivers/acpi/processor_idle.c
939 ++++ b/drivers/acpi/processor_idle.c
940 +@@ -888,12 +888,14 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
941 + return(acpi_idle_enter_c1(dev, state));
942 +
943 + local_irq_disable();
944 +- current_thread_info()->status &= ~TS_POLLING;
945 +- /*
946 +- * TS_POLLING-cleared state must be visible before we test
947 +- * NEED_RESCHED:
948 +- */
949 +- smp_mb();
950 ++ if (cx->entry_method != ACPI_CSTATE_FFH) {
951 ++ current_thread_info()->status &= ~TS_POLLING;
952 ++ /*
953 ++ * TS_POLLING-cleared state must be visible before we test
954 ++ * NEED_RESCHED:
955 ++ */
956 ++ smp_mb();
957 ++ }
958 +
959 + if (unlikely(need_resched())) {
960 + current_thread_info()->status |= TS_POLLING;
961 +@@ -973,12 +975,14 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
962 + }
963 +
964 + local_irq_disable();
965 +- current_thread_info()->status &= ~TS_POLLING;
966 +- /*
967 +- * TS_POLLING-cleared state must be visible before we test
968 +- * NEED_RESCHED:
969 +- */
970 +- smp_mb();
971 ++ if (cx->entry_method != ACPI_CSTATE_FFH) {
972 ++ current_thread_info()->status &= ~TS_POLLING;
973 ++ /*
974 ++ * TS_POLLING-cleared state must be visible before we test
975 ++ * NEED_RESCHED:
976 ++ */
977 ++ smp_mb();
978 ++ }
979 +
980 + if (unlikely(need_resched())) {
981 + current_thread_info()->status |= TS_POLLING;
982 +diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
983 +index f336bca..8a0ed28 100644
984 +--- a/drivers/acpi/tables.c
985 ++++ b/drivers/acpi/tables.c
986 +@@ -213,7 +213,7 @@ acpi_table_parse_entries(char *id,
987 + unsigned long table_end;
988 + acpi_size tbl_size;
989 +
990 +- if (acpi_disabled)
991 ++ if (acpi_disabled && !acpi_ht)
992 + return -ENODEV;
993 +
994 + if (!handler)
995 +@@ -280,7 +280,7 @@ int __init acpi_table_parse(char *id, acpi_table_handler handler)
996 + struct acpi_table_header *table = NULL;
997 + acpi_size tbl_size;
998 +
999 +- if (acpi_disabled)
1000 ++ if (acpi_disabled && !acpi_ht)
1001 + return -ENODEV;
1002 +
1003 + if (!handler)
1004 +diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
1005 +index 9b37502..a587046 100644
1006 +--- a/drivers/ata/ahci.c
1007 ++++ b/drivers/ata/ahci.c
1008 +@@ -3074,8 +3074,16 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1009 + ahci_save_initial_config(pdev, hpriv);
1010 +
1011 + /* prepare host */
1012 +- if (hpriv->cap & HOST_CAP_NCQ)
1013 +- pi.flags |= ATA_FLAG_NCQ | ATA_FLAG_FPDMA_AA;
1014 ++ if (hpriv->cap & HOST_CAP_NCQ) {
1015 ++ pi.flags |= ATA_FLAG_NCQ;
1016 ++ /* Auto-activate optimization is supposed to be supported on
1017 ++ all AHCI controllers indicating NCQ support, but it seems
1018 ++ to be broken at least on some NVIDIA MCP79 chipsets.
1019 ++ Until we get info on which NVIDIA chipsets don't have this
1020 ++ issue, if any, disable AA on all NVIDIA AHCIs. */
1021 ++ if (pdev->vendor != PCI_VENDOR_ID_NVIDIA)
1022 ++ pi.flags |= ATA_FLAG_FPDMA_AA;
1023 ++ }
1024 +
1025 + if (hpriv->cap & HOST_CAP_PMP)
1026 + pi.flags |= ATA_FLAG_PMP;
1027 +diff --git a/drivers/ata/pata_hpt3x2n.c b/drivers/ata/pata_hpt3x2n.c
1028 +index d16e87e..d9f2913 100644
1029 +--- a/drivers/ata/pata_hpt3x2n.c
1030 ++++ b/drivers/ata/pata_hpt3x2n.c
1031 +@@ -25,7 +25,7 @@
1032 + #include <linux/libata.h>
1033 +
1034 + #define DRV_NAME "pata_hpt3x2n"
1035 +-#define DRV_VERSION "0.3.8"
1036 ++#define DRV_VERSION "0.3.9"
1037 +
1038 + enum {
1039 + HPT_PCI_FAST = (1 << 31),
1040 +@@ -547,16 +547,16 @@ static int hpt3x2n_init_one(struct pci_dev *dev, const struct pci_device_id *id)
1041 + pci_mhz);
1042 + /* Set our private data up. We only need a few flags so we use
1043 + it directly */
1044 +- if (pci_mhz > 60) {
1045 ++ if (pci_mhz > 60)
1046 + hpriv = (void *)(PCI66 | USE_DPLL);
1047 +- /*
1048 +- * On HPT371N, if ATA clock is 66 MHz we must set bit 2 in
1049 +- * the MISC. register to stretch the UltraDMA Tss timing.
1050 +- * NOTE: This register is only writeable via I/O space.
1051 +- */
1052 +- if (dev->device == PCI_DEVICE_ID_TTI_HPT371)
1053 +- outb(inb(iobase + 0x9c) | 0x04, iobase + 0x9c);
1054 +- }
1055 ++
1056 ++ /*
1057 ++ * On HPT371N, if ATA clock is 66 MHz we must set bit 2 in
1058 ++ * the MISC. register to stretch the UltraDMA Tss timing.
1059 ++ * NOTE: This register is only writeable via I/O space.
1060 ++ */
1061 ++ if (dev->device == PCI_DEVICE_ID_TTI_HPT371)
1062 ++ outb(inb(iobase + 0x9c) | 0x04, iobase + 0x9c);
1063 +
1064 + /* Now kick off ATA set up */
1065 + return ata_pci_sff_init_one(dev, ppi, &hpt3x2n_sht, hpriv);
1066 +diff --git a/drivers/base/core.c b/drivers/base/core.c
1067 +index 1093179..f33d768 100644
1068 +--- a/drivers/base/core.c
1069 ++++ b/drivers/base/core.c
1070 +@@ -603,6 +603,7 @@ static struct kobject *get_device_parent(struct device *dev,
1071 + int retval;
1072 +
1073 + if (dev->class) {
1074 ++ static DEFINE_MUTEX(gdp_mutex);
1075 + struct kobject *kobj = NULL;
1076 + struct kobject *parent_kobj;
1077 + struct kobject *k;
1078 +@@ -619,6 +620,8 @@ static struct kobject *get_device_parent(struct device *dev,
1079 + else
1080 + parent_kobj = &parent->kobj;
1081 +
1082 ++ mutex_lock(&gdp_mutex);
1083 ++
1084 + /* find our class-directory at the parent and reference it */
1085 + spin_lock(&dev->class->p->class_dirs.list_lock);
1086 + list_for_each_entry(k, &dev->class->p->class_dirs.list, entry)
1087 +@@ -627,20 +630,26 @@ static struct kobject *get_device_parent(struct device *dev,
1088 + break;
1089 + }
1090 + spin_unlock(&dev->class->p->class_dirs.list_lock);
1091 +- if (kobj)
1092 ++ if (kobj) {
1093 ++ mutex_unlock(&gdp_mutex);
1094 + return kobj;
1095 ++ }
1096 +
1097 + /* or create a new class-directory at the parent device */
1098 + k = kobject_create();
1099 +- if (!k)
1100 ++ if (!k) {
1101 ++ mutex_unlock(&gdp_mutex);
1102 + return NULL;
1103 ++ }
1104 + k->kset = &dev->class->p->class_dirs;
1105 + retval = kobject_add(k, parent_kobj, "%s", dev->class->name);
1106 + if (retval < 0) {
1107 ++ mutex_unlock(&gdp_mutex);
1108 + kobject_put(k);
1109 + return NULL;
1110 + }
1111 + /* do not emit an uevent for this simple "glue" directory */
1112 ++ mutex_unlock(&gdp_mutex);
1113 + return k;
1114 + }
1115 +
1116 +diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c
1117 +index 33faaa2..4d80966 100644
1118 +--- a/drivers/base/devtmpfs.c
1119 ++++ b/drivers/base/devtmpfs.c
1120 +@@ -295,6 +295,19 @@ int devtmpfs_delete_node(struct device *dev)
1121 + if (dentry->d_inode) {
1122 + err = vfs_getattr(nd.path.mnt, dentry, &stat);
1123 + if (!err && dev_mynode(dev, dentry->d_inode, &stat)) {
1124 ++ struct iattr newattrs;
1125 ++ /*
1126 ++ * before unlinking this node, reset permissions
1127 ++ * of possible references like hardlinks
1128 ++ */
1129 ++ newattrs.ia_uid = 0;
1130 ++ newattrs.ia_gid = 0;
1131 ++ newattrs.ia_mode = stat.mode & ~0777;
1132 ++ newattrs.ia_valid =
1133 ++ ATTR_UID|ATTR_GID|ATTR_MODE;
1134 ++ mutex_lock(&dentry->d_inode->i_mutex);
1135 ++ notify_change(dentry, &newattrs);
1136 ++ mutex_unlock(&dentry->d_inode->i_mutex);
1137 + err = vfs_unlink(nd.path.dentry->d_inode,
1138 + dentry);
1139 + if (!err || err == -ENOENT)
1140 +diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
1141 +index 0b73e4e..27e8de4 100644
1142 +--- a/drivers/char/tpm/tpm_tis.c
1143 ++++ b/drivers/char/tpm/tpm_tis.c
1144 +@@ -257,6 +257,10 @@ out:
1145 + return size;
1146 + }
1147 +
1148 ++static int itpm;
1149 ++module_param(itpm, bool, 0444);
1150 ++MODULE_PARM_DESC(itpm, "Force iTPM workarounds (found on some Lenovo laptops)");
1151 ++
1152 + /*
1153 + * If interrupts are used (signaled by an irq set in the vendor structure)
1154 + * tpm.c can skip polling for the data to be available as the interrupt is
1155 +@@ -293,7 +297,7 @@ static int tpm_tis_send(struct tpm_chip *chip, u8 *buf, size_t len)
1156 + wait_for_stat(chip, TPM_STS_VALID, chip->vendor.timeout_c,
1157 + &chip->vendor.int_queue);
1158 + status = tpm_tis_status(chip);
1159 +- if ((status & TPM_STS_DATA_EXPECT) == 0) {
1160 ++ if (!itpm && (status & TPM_STS_DATA_EXPECT) == 0) {
1161 + rc = -EIO;
1162 + goto out_err;
1163 + }
1164 +@@ -467,6 +471,10 @@ static int tpm_tis_init(struct device *dev, resource_size_t start,
1165 + "1.2 TPM (device-id 0x%X, rev-id %d)\n",
1166 + vendor >> 16, ioread8(chip->vendor.iobase + TPM_RID(0)));
1167 +
1168 ++ if (itpm)
1169 ++ dev_info(dev, "Intel iTPM workaround enabled\n");
1170 ++
1171 ++
1172 + /* Figure out the capabilities */
1173 + intfcaps =
1174 + ioread32(chip->vendor.iobase +
1175 +diff --git a/drivers/char/tty_ldisc.c b/drivers/char/tty_ldisc.c
1176 +index feb5507..c6fbc27 100644
1177 +--- a/drivers/char/tty_ldisc.c
1178 ++++ b/drivers/char/tty_ldisc.c
1179 +@@ -687,12 +687,13 @@ static void tty_reset_termios(struct tty_struct *tty)
1180 + /**
1181 + * tty_ldisc_reinit - reinitialise the tty ldisc
1182 + * @tty: tty to reinit
1183 ++ * @ldisc: line discipline to reinitialize
1184 + *
1185 +- * Switch the tty back to N_TTY line discipline and leave the
1186 +- * ldisc state closed
1187 ++ * Switch the tty to a line discipline and leave the ldisc
1188 ++ * state closed
1189 + */
1190 +
1191 +-static void tty_ldisc_reinit(struct tty_struct *tty)
1192 ++static void tty_ldisc_reinit(struct tty_struct *tty, int ldisc)
1193 + {
1194 + struct tty_ldisc *ld;
1195 +
1196 +@@ -702,10 +703,10 @@ static void tty_ldisc_reinit(struct tty_struct *tty)
1197 + /*
1198 + * Switch the line discipline back
1199 + */
1200 +- ld = tty_ldisc_get(N_TTY);
1201 ++ ld = tty_ldisc_get(ldisc);
1202 + BUG_ON(IS_ERR(ld));
1203 + tty_ldisc_assign(tty, ld);
1204 +- tty_set_termios_ldisc(tty, N_TTY);
1205 ++ tty_set_termios_ldisc(tty, ldisc);
1206 + }
1207 +
1208 + /**
1209 +@@ -726,6 +727,8 @@ static void tty_ldisc_reinit(struct tty_struct *tty)
1210 + void tty_ldisc_hangup(struct tty_struct *tty)
1211 + {
1212 + struct tty_ldisc *ld;
1213 ++ int reset = tty->driver->flags & TTY_DRIVER_RESET_TERMIOS;
1214 ++ int err = 0;
1215 +
1216 + /*
1217 + * FIXME! What are the locking issues here? This may me overdoing
1218 +@@ -753,25 +756,32 @@ void tty_ldisc_hangup(struct tty_struct *tty)
1219 + wake_up_interruptible_poll(&tty->read_wait, POLLIN);
1220 + /*
1221 + * Shutdown the current line discipline, and reset it to
1222 +- * N_TTY.
1223 ++ * N_TTY if need be.
1224 ++ *
1225 ++ * Avoid racing set_ldisc or tty_ldisc_release
1226 + */
1227 +- if (tty->driver->flags & TTY_DRIVER_RESET_TERMIOS) {
1228 +- /* Avoid racing set_ldisc or tty_ldisc_release */
1229 +- mutex_lock(&tty->ldisc_mutex);
1230 +- tty_ldisc_halt(tty);
1231 +- if (tty->ldisc) { /* Not yet closed */
1232 +- /* Switch back to N_TTY */
1233 +- tty_ldisc_reinit(tty);
1234 +- /* At this point we have a closed ldisc and we want to
1235 +- reopen it. We could defer this to the next open but
1236 +- it means auditing a lot of other paths so this is
1237 +- a FIXME */
1238 ++ mutex_lock(&tty->ldisc_mutex);
1239 ++ tty_ldisc_halt(tty);
1240 ++ /* At this point we have a closed ldisc and we want to
1241 ++ reopen it. We could defer this to the next open but
1242 ++ it means auditing a lot of other paths so this is
1243 ++ a FIXME */
1244 ++ if (tty->ldisc) { /* Not yet closed */
1245 ++ if (reset == 0) {
1246 ++ tty_ldisc_reinit(tty, tty->termios->c_line);
1247 ++ err = tty_ldisc_open(tty, tty->ldisc);
1248 ++ }
1249 ++ /* If the re-open fails or we reset then go to N_TTY. The
1250 ++ N_TTY open cannot fail */
1251 ++ if (reset || err) {
1252 ++ tty_ldisc_reinit(tty, N_TTY);
1253 + WARN_ON(tty_ldisc_open(tty, tty->ldisc));
1254 +- tty_ldisc_enable(tty);
1255 + }
1256 +- mutex_unlock(&tty->ldisc_mutex);
1257 +- tty_reset_termios(tty);
1258 ++ tty_ldisc_enable(tty);
1259 + }
1260 ++ mutex_unlock(&tty->ldisc_mutex);
1261 ++ if (reset)
1262 ++ tty_reset_termios(tty);
1263 + }
1264 +
1265 + /**
1266 +diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c
1267 +index 6b3e0c2..6fe4f77 100644
1268 +--- a/drivers/clocksource/sh_cmt.c
1269 ++++ b/drivers/clocksource/sh_cmt.c
1270 +@@ -603,18 +603,13 @@ static int sh_cmt_setup(struct sh_cmt_priv *p, struct platform_device *pdev)
1271 + p->irqaction.handler = sh_cmt_interrupt;
1272 + p->irqaction.dev_id = p;
1273 + p->irqaction.flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL;
1274 +- ret = setup_irq(irq, &p->irqaction);
1275 +- if (ret) {
1276 +- pr_err("sh_cmt: failed to request irq %d\n", irq);
1277 +- goto err1;
1278 +- }
1279 +
1280 + /* get hold of clock */
1281 + p->clk = clk_get(&p->pdev->dev, cfg->clk);
1282 + if (IS_ERR(p->clk)) {
1283 + pr_err("sh_cmt: cannot get clock \"%s\"\n", cfg->clk);
1284 + ret = PTR_ERR(p->clk);
1285 +- goto err2;
1286 ++ goto err1;
1287 + }
1288 +
1289 + if (resource_size(res) == 6) {
1290 +@@ -627,14 +622,25 @@ static int sh_cmt_setup(struct sh_cmt_priv *p, struct platform_device *pdev)
1291 + p->clear_bits = ~0xc000;
1292 + }
1293 +
1294 +- return sh_cmt_register(p, cfg->name,
1295 +- cfg->clockevent_rating,
1296 +- cfg->clocksource_rating);
1297 +- err2:
1298 +- remove_irq(irq, &p->irqaction);
1299 +- err1:
1300 ++ ret = sh_cmt_register(p, cfg->name,
1301 ++ cfg->clockevent_rating,
1302 ++ cfg->clocksource_rating);
1303 ++ if (ret) {
1304 ++ pr_err("sh_cmt: registration failed\n");
1305 ++ goto err1;
1306 ++ }
1307 ++
1308 ++ ret = setup_irq(irq, &p->irqaction);
1309 ++ if (ret) {
1310 ++ pr_err("sh_cmt: failed to request irq %d\n", irq);
1311 ++ goto err1;
1312 ++ }
1313 ++
1314 ++ return 0;
1315 ++
1316 ++err1:
1317 + iounmap(p->mapbase);
1318 +- err0:
1319 ++err0:
1320 + return ret;
1321 + }
1322 +
1323 +diff --git a/drivers/clocksource/sh_mtu2.c b/drivers/clocksource/sh_mtu2.c
1324 +index 973e714..4c8a759 100644
1325 +--- a/drivers/clocksource/sh_mtu2.c
1326 ++++ b/drivers/clocksource/sh_mtu2.c
1327 +@@ -221,15 +221,15 @@ static void sh_mtu2_register_clockevent(struct sh_mtu2_priv *p,
1328 + ced->cpumask = cpumask_of(0);
1329 + ced->set_mode = sh_mtu2_clock_event_mode;
1330 +
1331 ++ pr_info("sh_mtu2: %s used for clock events\n", ced->name);
1332 ++ clockevents_register_device(ced);
1333 ++
1334 + ret = setup_irq(p->irqaction.irq, &p->irqaction);
1335 + if (ret) {
1336 + pr_err("sh_mtu2: failed to request irq %d\n",
1337 + p->irqaction.irq);
1338 + return;
1339 + }
1340 +-
1341 +- pr_info("sh_mtu2: %s used for clock events\n", ced->name);
1342 +- clockevents_register_device(ced);
1343 + }
1344 +
1345 + static int sh_mtu2_register(struct sh_mtu2_priv *p, char *name,
1346 +diff --git a/drivers/clocksource/sh_tmu.c b/drivers/clocksource/sh_tmu.c
1347 +index 93c2322..961f5b5 100644
1348 +--- a/drivers/clocksource/sh_tmu.c
1349 ++++ b/drivers/clocksource/sh_tmu.c
1350 +@@ -323,15 +323,15 @@ static void sh_tmu_register_clockevent(struct sh_tmu_priv *p,
1351 + ced->set_next_event = sh_tmu_clock_event_next;
1352 + ced->set_mode = sh_tmu_clock_event_mode;
1353 +
1354 ++ pr_info("sh_tmu: %s used for clock events\n", ced->name);
1355 ++ clockevents_register_device(ced);
1356 ++
1357 + ret = setup_irq(p->irqaction.irq, &p->irqaction);
1358 + if (ret) {
1359 + pr_err("sh_tmu: failed to request irq %d\n",
1360 + p->irqaction.irq);
1361 + return;
1362 + }
1363 +-
1364 +- pr_info("sh_tmu: %s used for clock events\n", ced->name);
1365 +- clockevents_register_device(ced);
1366 + }
1367 +
1368 + static int sh_tmu_register(struct sh_tmu_priv *p, char *name,
1369 +diff --git a/drivers/gpio/wm831x-gpio.c b/drivers/gpio/wm831x-gpio.c
1370 +index f9c09a5..9a27047 100644
1371 +--- a/drivers/gpio/wm831x-gpio.c
1372 ++++ b/drivers/gpio/wm831x-gpio.c
1373 +@@ -61,23 +61,31 @@ static int wm831x_gpio_get(struct gpio_chip *chip, unsigned offset)
1374 + return 0;
1375 + }
1376 +
1377 +-static int wm831x_gpio_direction_out(struct gpio_chip *chip,
1378 +- unsigned offset, int value)
1379 ++static void wm831x_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
1380 + {
1381 + struct wm831x_gpio *wm831x_gpio = to_wm831x_gpio(chip);
1382 + struct wm831x *wm831x = wm831x_gpio->wm831x;
1383 +
1384 +- return wm831x_set_bits(wm831x, WM831X_GPIO1_CONTROL + offset,
1385 +- WM831X_GPN_DIR | WM831X_GPN_TRI, 0);
1386 ++ wm831x_set_bits(wm831x, WM831X_GPIO_LEVEL, 1 << offset,
1387 ++ value << offset);
1388 + }
1389 +
1390 +-static void wm831x_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
1391 ++static int wm831x_gpio_direction_out(struct gpio_chip *chip,
1392 ++ unsigned offset, int value)
1393 + {
1394 + struct wm831x_gpio *wm831x_gpio = to_wm831x_gpio(chip);
1395 + struct wm831x *wm831x = wm831x_gpio->wm831x;
1396 ++ int ret;
1397 +
1398 +- wm831x_set_bits(wm831x, WM831X_GPIO_LEVEL, 1 << offset,
1399 +- value << offset);
1400 ++ ret = wm831x_set_bits(wm831x, WM831X_GPIO1_CONTROL + offset,
1401 ++ WM831X_GPN_DIR | WM831X_GPN_TRI, 0);
1402 ++ if (ret < 0)
1403 ++ return ret;
1404 ++
1405 ++ /* Can only set GPIO state once it's in output mode */
1406 ++ wm831x_gpio_set(chip, offset, value);
1407 ++
1408 ++ return 0;
1409 + }
1410 +
1411 + #ifdef CONFIG_DEBUG_FS
1412 +diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
1413 +index b00a1aa..cce453e 100644
1414 +--- a/drivers/gpu/drm/i915/intel_display.c
1415 ++++ b/drivers/gpu/drm/i915/intel_display.c
1416 +@@ -4322,7 +4322,7 @@ static void intel_init_display(struct drm_device *dev)
1417 + }
1418 +
1419 + /* Returns the core display clock speed */
1420 +- if (IS_I945G(dev))
1421 ++ if (IS_I945G(dev) || (IS_G33(dev) && ! IS_IGDGM(dev)))
1422 + dev_priv->display.get_display_clock_speed =
1423 + i945_get_display_clock_speed;
1424 + else if (IS_I915G(dev))
1425 +diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
1426 +index 952bb4e..a177b57 100644
1427 +--- a/drivers/gpu/drm/i915/intel_lvds.c
1428 ++++ b/drivers/gpu/drm/i915/intel_lvds.c
1429 +@@ -629,6 +629,13 @@ static const struct dmi_system_id bad_lid_status[] = {
1430 + DMI_MATCH(DMI_PRODUCT_NAME, "PC-81005"),
1431 + },
1432 + },
1433 ++ {
1434 ++ .ident = "Clevo M5x0N",
1435 ++ .matches = {
1436 ++ DMI_MATCH(DMI_SYS_VENDOR, "CLEVO Co."),
1437 ++ DMI_MATCH(DMI_BOARD_NAME, "M5x0N"),
1438 ++ },
1439 ++ },
1440 + { }
1441 + };
1442 +
1443 +diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
1444 +index 3f5aaf1..5d9c6a7 100644
1445 +--- a/drivers/gpu/drm/i915/intel_sdvo.c
1446 ++++ b/drivers/gpu/drm/i915/intel_sdvo.c
1447 +@@ -35,6 +35,7 @@
1448 + #include "i915_drm.h"
1449 + #include "i915_drv.h"
1450 + #include "intel_sdvo_regs.h"
1451 ++#include <linux/dmi.h>
1452 +
1453 + #undef SDVO_DEBUG
1454 +
1455 +@@ -2289,6 +2290,25 @@ intel_sdvo_get_slave_addr(struct drm_device *dev, int output_device)
1456 + return 0x72;
1457 + }
1458 +
1459 ++static int intel_sdvo_bad_tv_callback(const struct dmi_system_id *id)
1460 ++{
1461 ++ DRM_DEBUG_KMS("Ignoring bad SDVO TV connector for %s\n", id->ident);
1462 ++ return 1;
1463 ++}
1464 ++
1465 ++static struct dmi_system_id intel_sdvo_bad_tv[] = {
1466 ++ {
1467 ++ .callback = intel_sdvo_bad_tv_callback,
1468 ++ .ident = "IntelG45/ICH10R/DME1737",
1469 ++ .matches = {
1470 ++ DMI_MATCH(DMI_SYS_VENDOR, "IBM CORPORATION"),
1471 ++ DMI_MATCH(DMI_PRODUCT_NAME, "4800784"),
1472 ++ },
1473 ++ },
1474 ++
1475 ++ { } /* terminating entry */
1476 ++};
1477 ++
1478 + static bool
1479 + intel_sdvo_output_setup(struct intel_output *intel_output, uint16_t flags)
1480 + {
1481 +@@ -2329,7 +2349,8 @@ intel_sdvo_output_setup(struct intel_output *intel_output, uint16_t flags)
1482 + (1 << INTEL_SDVO_NON_TV_CLONE_BIT) |
1483 + (1 << INTEL_ANALOG_CLONE_BIT);
1484 + }
1485 +- } else if (flags & SDVO_OUTPUT_SVID0) {
1486 ++ } else if ((flags & SDVO_OUTPUT_SVID0) &&
1487 ++ !dmi_check_system(intel_sdvo_bad_tv)) {
1488 +
1489 + sdvo_priv->controlled_output = SDVO_OUTPUT_SVID0;
1490 + encoder->encoder_type = DRM_MODE_ENCODER_TVDAC;
1491 +diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
1492 +index ce026f0..5b28b4e 100644
1493 +--- a/drivers/gpu/drm/i915/intel_tv.c
1494 ++++ b/drivers/gpu/drm/i915/intel_tv.c
1495 +@@ -1801,8 +1801,6 @@ intel_tv_init(struct drm_device *dev)
1496 + drm_connector_attach_property(connector,
1497 + dev->mode_config.tv_bottom_margin_property,
1498 + tv_priv->margin[TV_MARGIN_BOTTOM]);
1499 +-
1500 +- dev_priv->hotplug_supported_mask |= TV_HOTPLUG_INT_STATUS;
1501 + out:
1502 + drm_sysfs_connector_add(connector);
1503 + }
1504 +diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
1505 +index 278f646..7310473 100644
1506 +--- a/drivers/gpu/drm/radeon/r600.c
1507 ++++ b/drivers/gpu/drm/radeon/r600.c
1508 +@@ -1686,13 +1686,14 @@ int r600_init(struct radeon_device *rdev)
1509 + if (rdev->accel_working) {
1510 + r = radeon_ib_pool_init(rdev);
1511 + if (r) {
1512 +- DRM_ERROR("radeon: failled initializing IB pool (%d).\n", r);
1513 +- rdev->accel_working = false;
1514 +- }
1515 +- r = r600_ib_test(rdev);
1516 +- if (r) {
1517 +- DRM_ERROR("radeon: failled testing IB (%d).\n", r);
1518 ++ dev_err(rdev->dev, "IB initialization failed (%d).\n", r);
1519 + rdev->accel_working = false;
1520 ++ } else {
1521 ++ r = r600_ib_test(rdev);
1522 ++ if (r) {
1523 ++ dev_err(rdev->dev, "IB test failed (%d).\n", r);
1524 ++ rdev->accel_working = false;
1525 ++ }
1526 + }
1527 + }
1528 + return 0;
1529 +diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c
1530 +index 0d82076..838b88c 100644
1531 +--- a/drivers/gpu/drm/radeon/r600_cs.c
1532 ++++ b/drivers/gpu/drm/radeon/r600_cs.c
1533 +@@ -36,6 +36,10 @@ static int r600_cs_packet_next_reloc_nomm(struct radeon_cs_parser *p,
1534 + typedef int (*next_reloc_t)(struct radeon_cs_parser*, struct radeon_cs_reloc**);
1535 + static next_reloc_t r600_cs_packet_next_reloc = &r600_cs_packet_next_reloc_mm;
1536 +
1537 ++struct r600_cs_track {
1538 ++ u32 cb_color0_base_last;
1539 ++};
1540 ++
1541 + /**
1542 + * r600_cs_packet_parse() - parse cp packet and point ib index to next packet
1543 + * @parser: parser structure holding parsing context.
1544 +@@ -177,6 +181,28 @@ static int r600_cs_packet_next_reloc_nomm(struct radeon_cs_parser *p,
1545 + }
1546 +
1547 + /**
1548 ++ * r600_cs_packet_next_is_pkt3_nop() - test if next packet is packet3 nop for reloc
1549 ++ * @parser: parser structure holding parsing context.
1550 ++ *
1551 ++ * Check next packet is relocation packet3, do bo validation and compute
1552 ++ * GPU offset using the provided start.
1553 ++ **/
1554 ++static inline int r600_cs_packet_next_is_pkt3_nop(struct radeon_cs_parser *p)
1555 ++{
1556 ++ struct radeon_cs_packet p3reloc;
1557 ++ int r;
1558 ++
1559 ++ r = r600_cs_packet_parse(p, &p3reloc, p->idx);
1560 ++ if (r) {
1561 ++ return 0;
1562 ++ }
1563 ++ if (p3reloc.type != PACKET_TYPE3 || p3reloc.opcode != PACKET3_NOP) {
1564 ++ return 0;
1565 ++ }
1566 ++ return 1;
1567 ++}
1568 ++
1569 ++/**
1570 + * r600_cs_packet_next_vline() - parse userspace VLINE packet
1571 + * @parser: parser structure holding parsing context.
1572 + *
1573 +@@ -337,6 +363,7 @@ static int r600_packet3_check(struct radeon_cs_parser *p,
1574 + struct radeon_cs_packet *pkt)
1575 + {
1576 + struct radeon_cs_reloc *reloc;
1577 ++ struct r600_cs_track *track;
1578 + volatile u32 *ib;
1579 + unsigned idx;
1580 + unsigned i;
1581 +@@ -344,6 +371,7 @@ static int r600_packet3_check(struct radeon_cs_parser *p,
1582 + int r;
1583 + u32 idx_value;
1584 +
1585 ++ track = (struct r600_cs_track *)p->track;
1586 + ib = p->ib->ptr;
1587 + idx = pkt->idx + 1;
1588 + idx_value = radeon_get_ib_value(p, idx);
1589 +@@ -503,9 +531,60 @@ static int r600_packet3_check(struct radeon_cs_parser *p,
1590 + for (i = 0; i < pkt->count; i++) {
1591 + reg = start_reg + (4 * i);
1592 + switch (reg) {
1593 ++ /* This register were added late, there is userspace
1594 ++ * which does provide relocation for those but set
1595 ++ * 0 offset. In order to avoid breaking old userspace
1596 ++ * we detect this and set address to point to last
1597 ++ * CB_COLOR0_BASE, note that if userspace doesn't set
1598 ++ * CB_COLOR0_BASE before this register we will report
1599 ++ * error. Old userspace always set CB_COLOR0_BASE
1600 ++ * before any of this.
1601 ++ */
1602 ++ case R_0280E0_CB_COLOR0_FRAG:
1603 ++ case R_0280E4_CB_COLOR1_FRAG:
1604 ++ case R_0280E8_CB_COLOR2_FRAG:
1605 ++ case R_0280EC_CB_COLOR3_FRAG:
1606 ++ case R_0280F0_CB_COLOR4_FRAG:
1607 ++ case R_0280F4_CB_COLOR5_FRAG:
1608 ++ case R_0280F8_CB_COLOR6_FRAG:
1609 ++ case R_0280FC_CB_COLOR7_FRAG:
1610 ++ case R_0280C0_CB_COLOR0_TILE:
1611 ++ case R_0280C4_CB_COLOR1_TILE:
1612 ++ case R_0280C8_CB_COLOR2_TILE:
1613 ++ case R_0280CC_CB_COLOR3_TILE:
1614 ++ case R_0280D0_CB_COLOR4_TILE:
1615 ++ case R_0280D4_CB_COLOR5_TILE:
1616 ++ case R_0280D8_CB_COLOR6_TILE:
1617 ++ case R_0280DC_CB_COLOR7_TILE:
1618 ++ if (!r600_cs_packet_next_is_pkt3_nop(p)) {
1619 ++ if (!track->cb_color0_base_last) {
1620 ++ dev_err(p->dev, "Broken old userspace ? no cb_color0_base supplied before trying to write 0x%08X\n", reg);
1621 ++ return -EINVAL;
1622 ++ }
1623 ++ ib[idx+1+i] = track->cb_color0_base_last;
1624 ++ printk_once(KERN_WARNING "You have old & broken userspace "
1625 ++ "please consider updating mesa & xf86-video-ati\n");
1626 ++ } else {
1627 ++ r = r600_cs_packet_next_reloc(p, &reloc);
1628 ++ if (r) {
1629 ++ dev_err(p->dev, "bad SET_CONTEXT_REG 0x%04X\n", reg);
1630 ++ return -EINVAL;
1631 ++ }
1632 ++ ib[idx+1+i] += (u32)((reloc->lobj.gpu_offset >> 8) & 0xffffffff);
1633 ++ }
1634 ++ break;
1635 + case DB_DEPTH_BASE:
1636 + case DB_HTILE_DATA_BASE:
1637 + case CB_COLOR0_BASE:
1638 ++ r = r600_cs_packet_next_reloc(p, &reloc);
1639 ++ if (r) {
1640 ++ DRM_ERROR("bad SET_CONTEXT_REG "
1641 ++ "0x%04X\n", reg);
1642 ++ return -EINVAL;
1643 ++ }
1644 ++ ib[idx+1+i] += (u32)((reloc->lobj.gpu_offset >> 8) & 0xffffffff);
1645 ++ track->cb_color0_base_last = ib[idx+1+i];
1646 ++ break;
1647 + case CB_COLOR1_BASE:
1648 + case CB_COLOR2_BASE:
1649 + case CB_COLOR3_BASE:
1650 +@@ -678,8 +757,11 @@ static int r600_packet3_check(struct radeon_cs_parser *p,
1651 + int r600_cs_parse(struct radeon_cs_parser *p)
1652 + {
1653 + struct radeon_cs_packet pkt;
1654 ++ struct r600_cs_track *track;
1655 + int r;
1656 +
1657 ++ track = kzalloc(sizeof(*track), GFP_KERNEL);
1658 ++ p->track = track;
1659 + do {
1660 + r = r600_cs_packet_parse(p, &pkt, p->idx);
1661 + if (r) {
1662 +@@ -757,6 +839,7 @@ int r600_cs_legacy(struct drm_device *dev, void *data, struct drm_file *filp,
1663 + /* initialize parser */
1664 + memset(&parser, 0, sizeof(struct radeon_cs_parser));
1665 + parser.filp = filp;
1666 ++ parser.dev = &dev->pdev->dev;
1667 + parser.rdev = NULL;
1668 + parser.family = family;
1669 + parser.ib = &fake_ib;
1670 +diff --git a/drivers/gpu/drm/radeon/r600d.h b/drivers/gpu/drm/radeon/r600d.h
1671 +index 27ab428..56fc658 100644
1672 +--- a/drivers/gpu/drm/radeon/r600d.h
1673 ++++ b/drivers/gpu/drm/radeon/r600d.h
1674 +@@ -674,4 +674,30 @@
1675 + #define S_000E60_SOFT_RESET_TSC(x) (((x) & 1) << 16)
1676 + #define S_000E60_SOFT_RESET_VMC(x) (((x) & 1) << 17)
1677 +
1678 ++#define R_005480_HDP_MEM_COHERENCY_FLUSH_CNTL 0x5480
1679 ++
1680 ++#define R_0280E0_CB_COLOR0_FRAG 0x0280E0
1681 ++#define S_0280E0_BASE_256B(x) (((x) & 0xFFFFFFFF) << 0)
1682 ++#define G_0280E0_BASE_256B(x) (((x) >> 0) & 0xFFFFFFFF)
1683 ++#define C_0280E0_BASE_256B 0x00000000
1684 ++#define R_0280E4_CB_COLOR1_FRAG 0x0280E4
1685 ++#define R_0280E8_CB_COLOR2_FRAG 0x0280E8
1686 ++#define R_0280EC_CB_COLOR3_FRAG 0x0280EC
1687 ++#define R_0280F0_CB_COLOR4_FRAG 0x0280F0
1688 ++#define R_0280F4_CB_COLOR5_FRAG 0x0280F4
1689 ++#define R_0280F8_CB_COLOR6_FRAG 0x0280F8
1690 ++#define R_0280FC_CB_COLOR7_FRAG 0x0280FC
1691 ++#define R_0280C0_CB_COLOR0_TILE 0x0280C0
1692 ++#define S_0280C0_BASE_256B(x) (((x) & 0xFFFFFFFF) << 0)
1693 ++#define G_0280C0_BASE_256B(x) (((x) >> 0) & 0xFFFFFFFF)
1694 ++#define C_0280C0_BASE_256B 0x00000000
1695 ++#define R_0280C4_CB_COLOR1_TILE 0x0280C4
1696 ++#define R_0280C8_CB_COLOR2_TILE 0x0280C8
1697 ++#define R_0280CC_CB_COLOR3_TILE 0x0280CC
1698 ++#define R_0280D0_CB_COLOR4_TILE 0x0280D0
1699 ++#define R_0280D4_CB_COLOR5_TILE 0x0280D4
1700 ++#define R_0280D8_CB_COLOR6_TILE 0x0280D8
1701 ++#define R_0280DC_CB_COLOR7_TILE 0x0280DC
1702 ++
1703 ++
1704 + #endif
1705 +diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
1706 +index 224506a..6735213 100644
1707 +--- a/drivers/gpu/drm/radeon/radeon.h
1708 ++++ b/drivers/gpu/drm/radeon/radeon.h
1709 +@@ -448,6 +448,7 @@ struct radeon_cs_chunk {
1710 + };
1711 +
1712 + struct radeon_cs_parser {
1713 ++ struct device *dev;
1714 + struct radeon_device *rdev;
1715 + struct drm_file *filp;
1716 + /* chunks */
1717 +diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c
1718 +index 5ab2cf9..484f791 100644
1719 +--- a/drivers/gpu/drm/radeon/radeon_cs.c
1720 ++++ b/drivers/gpu/drm/radeon/radeon_cs.c
1721 +@@ -230,6 +230,7 @@ int radeon_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
1722 + memset(&parser, 0, sizeof(struct radeon_cs_parser));
1723 + parser.filp = filp;
1724 + parser.rdev = rdev;
1725 ++ parser.dev = rdev->dev;
1726 + r = radeon_cs_parser_init(&parser, data);
1727 + if (r) {
1728 + DRM_ERROR("Failed to initialize parser !\n");
1729 +diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
1730 +index c85df4a..6f68315 100644
1731 +--- a/drivers/gpu/drm/radeon/radeon_display.c
1732 ++++ b/drivers/gpu/drm/radeon/radeon_display.c
1733 +@@ -599,7 +599,11 @@ radeon_user_framebuffer_create(struct drm_device *dev,
1734 + struct drm_gem_object *obj;
1735 +
1736 + obj = drm_gem_object_lookup(dev, file_priv, mode_cmd->handle);
1737 +-
1738 ++ if (obj == NULL) {
1739 ++ dev_err(&dev->pdev->dev, "No GEM object associated to handle 0x%08X, "
1740 ++ "can't create framebuffer\n", mode_cmd->handle);
1741 ++ return NULL;
1742 ++ }
1743 + return radeon_framebuffer_create(dev, mode_cmd, obj);
1744 + }
1745 +
1746 +diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c
1747 +index b0efd0d..c42403b 100644
1748 +--- a/drivers/gpu/drm/radeon/rv770.c
1749 ++++ b/drivers/gpu/drm/radeon/rv770.c
1750 +@@ -1034,13 +1034,14 @@ int rv770_init(struct radeon_device *rdev)
1751 + if (rdev->accel_working) {
1752 + r = radeon_ib_pool_init(rdev);
1753 + if (r) {
1754 +- DRM_ERROR("radeon: failled initializing IB pool (%d).\n", r);
1755 +- rdev->accel_working = false;
1756 +- }
1757 +- r = r600_ib_test(rdev);
1758 +- if (r) {
1759 +- DRM_ERROR("radeon: failled testing IB (%d).\n", r);
1760 ++ dev_err(rdev->dev, "IB initialization failed (%d).\n", r);
1761 + rdev->accel_working = false;
1762 ++ } else {
1763 ++ r = r600_ib_test(rdev);
1764 ++ if (r) {
1765 ++ dev_err(rdev->dev, "IB test failed (%d).\n", r);
1766 ++ rdev->accel_working = false;
1767 ++ }
1768 + }
1769 + }
1770 + return 0;
1771 +diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
1772 +index 7bcb89f..3d5b8b0 100644
1773 +--- a/drivers/gpu/drm/ttm/ttm_tt.c
1774 ++++ b/drivers/gpu/drm/ttm/ttm_tt.c
1775 +@@ -466,7 +466,7 @@ static int ttm_tt_swapin(struct ttm_tt *ttm)
1776 + void *from_virtual;
1777 + void *to_virtual;
1778 + int i;
1779 +- int ret;
1780 ++ int ret = -ENOMEM;
1781 +
1782 + if (ttm->page_flags & TTM_PAGE_FLAG_USER) {
1783 + ret = ttm_tt_set_user(ttm, ttm->tsk, ttm->start,
1784 +@@ -485,8 +485,10 @@ static int ttm_tt_swapin(struct ttm_tt *ttm)
1785 +
1786 + for (i = 0; i < ttm->num_pages; ++i) {
1787 + from_page = read_mapping_page(swap_space, i, NULL);
1788 +- if (IS_ERR(from_page))
1789 ++ if (IS_ERR(from_page)) {
1790 ++ ret = PTR_ERR(from_page);
1791 + goto out_err;
1792 ++ }
1793 + to_page = __ttm_tt_get_page(ttm, i);
1794 + if (unlikely(to_page == NULL))
1795 + goto out_err;
1796 +@@ -509,7 +511,7 @@ static int ttm_tt_swapin(struct ttm_tt *ttm)
1797 + return 0;
1798 + out_err:
1799 + ttm_tt_free_alloced_pages(ttm);
1800 +- return -ENOMEM;
1801 ++ return ret;
1802 + }
1803 +
1804 + int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistant_swap_storage)
1805 +@@ -521,6 +523,7 @@ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistant_swap_storage)
1806 + void *from_virtual;
1807 + void *to_virtual;
1808 + int i;
1809 ++ int ret = -ENOMEM;
1810 +
1811 + BUG_ON(ttm->state != tt_unbound && ttm->state != tt_unpopulated);
1812 + BUG_ON(ttm->caching_state != tt_cached);
1813 +@@ -543,7 +546,7 @@ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistant_swap_storage)
1814 + 0);
1815 + if (unlikely(IS_ERR(swap_storage))) {
1816 + printk(KERN_ERR "Failed allocating swap storage.\n");
1817 +- return -ENOMEM;
1818 ++ return PTR_ERR(swap_storage);
1819 + }
1820 + } else
1821 + swap_storage = persistant_swap_storage;
1822 +@@ -555,9 +558,10 @@ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistant_swap_storage)
1823 + if (unlikely(from_page == NULL))
1824 + continue;
1825 + to_page = read_mapping_page(swap_space, i, NULL);
1826 +- if (unlikely(to_page == NULL))
1827 ++ if (unlikely(IS_ERR(to_page))) {
1828 ++ ret = PTR_ERR(to_page);
1829 + goto out_err;
1830 +-
1831 ++ }
1832 + preempt_disable();
1833 + from_virtual = kmap_atomic(from_page, KM_USER0);
1834 + to_virtual = kmap_atomic(to_page, KM_USER1);
1835 +@@ -581,5 +585,5 @@ out_err:
1836 + if (!persistant_swap_storage)
1837 + fput(swap_storage);
1838 +
1839 +- return -ENOMEM;
1840 ++ return ret;
1841 + }
1842 +diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
1843 +index 9678354..668604b 100644
1844 +--- a/drivers/hid/hid-core.c
1845 ++++ b/drivers/hid/hid-core.c
1846 +@@ -1658,8 +1658,6 @@ static const struct hid_device_id hid_ignore_list[] = {
1847 + { HID_USB_DEVICE(USB_VENDOR_ID_PANJIT, 0x0004) },
1848 + { HID_USB_DEVICE(USB_VENDOR_ID_PHILIPS, USB_DEVICE_ID_PHILIPS_IEEE802154_DONGLE) },
1849 + { HID_USB_DEVICE(USB_VENDOR_ID_POWERCOM, USB_DEVICE_ID_POWERCOM_UPS) },
1850 +- { HID_USB_DEVICE(USB_VENDOR_ID_TENX, USB_DEVICE_ID_TENX_IBUDDY1) },
1851 +- { HID_USB_DEVICE(USB_VENDOR_ID_TENX, USB_DEVICE_ID_TENX_IBUDDY2) },
1852 + { HID_USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_LABPRO) },
1853 + { HID_USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_GOTEMP) },
1854 + { HID_USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_SKIP) },
1855 +diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
1856 +index e380e7b..9831c3a 100644
1857 +--- a/drivers/hid/hid-ids.h
1858 ++++ b/drivers/hid/hid-ids.h
1859 +@@ -349,6 +349,9 @@
1860 + #define USB_VENDOR_ID_NEC 0x073e
1861 + #define USB_DEVICE_ID_NEC_USB_GAME_PAD 0x0301
1862 +
1863 ++#define USB_VENDOR_ID_NEXTWINDOW 0x1926
1864 ++#define USB_DEVICE_ID_NEXTWINDOW_TOUCHSCREEN 0x0003
1865 ++
1866 + #define USB_VENDOR_ID_NTRIG 0x1b96
1867 + #define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN 0x0001
1868 +
1869 +@@ -392,10 +395,6 @@
1870 + #define USB_VENDOR_ID_SUNPLUS 0x04fc
1871 + #define USB_DEVICE_ID_SUNPLUS_WDESKTOP 0x05d8
1872 +
1873 +-#define USB_VENDOR_ID_TENX 0x1130
1874 +-#define USB_DEVICE_ID_TENX_IBUDDY1 0x0001
1875 +-#define USB_DEVICE_ID_TENX_IBUDDY2 0x0002
1876 +-
1877 + #define USB_VENDOR_ID_THRUSTMASTER 0x044f
1878 +
1879 + #define USB_VENDOR_ID_TOPMAX 0x0663
1880 +diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
1881 +index 5d901f6..1ca6574 100644
1882 +--- a/drivers/hid/usbhid/hid-core.c
1883 ++++ b/drivers/hid/usbhid/hid-core.c
1884 +@@ -318,6 +318,7 @@ static int hid_submit_out(struct hid_device *hid)
1885 + err_hid("usb_submit_urb(out) failed");
1886 + return -1;
1887 + }
1888 ++ usbhid->last_out = jiffies;
1889 + } else {
1890 + /*
1891 + * queue work to wake up the device.
1892 +@@ -379,6 +380,7 @@ static int hid_submit_ctrl(struct hid_device *hid)
1893 + err_hid("usb_submit_urb(ctrl) failed");
1894 + return -1;
1895 + }
1896 ++ usbhid->last_ctrl = jiffies;
1897 + } else {
1898 + /*
1899 + * queue work to wake up the device.
1900 +@@ -514,9 +516,20 @@ static void __usbhid_submit_report(struct hid_device *hid, struct hid_report *re
1901 + usbhid->out[usbhid->outhead].report = report;
1902 + usbhid->outhead = head;
1903 +
1904 +- if (!test_and_set_bit(HID_OUT_RUNNING, &usbhid->iofl))
1905 ++ if (!test_and_set_bit(HID_OUT_RUNNING, &usbhid->iofl)) {
1906 + if (hid_submit_out(hid))
1907 + clear_bit(HID_OUT_RUNNING, &usbhid->iofl);
1908 ++ } else {
1909 ++ /*
1910 ++ * the queue is known to run
1911 ++ * but an earlier request may be stuck
1912 ++ * we may need to time out
1913 ++ * no race because this is called under
1914 ++ * spinlock
1915 ++ */
1916 ++ if (time_after(jiffies, usbhid->last_out + HZ * 5))
1917 ++ usb_unlink_urb(usbhid->urbout);
1918 ++ }
1919 + return;
1920 + }
1921 +
1922 +@@ -537,9 +550,20 @@ static void __usbhid_submit_report(struct hid_device *hid, struct hid_report *re
1923 + usbhid->ctrl[usbhid->ctrlhead].dir = dir;
1924 + usbhid->ctrlhead = head;
1925 +
1926 +- if (!test_and_set_bit(HID_CTRL_RUNNING, &usbhid->iofl))
1927 ++ if (!test_and_set_bit(HID_CTRL_RUNNING, &usbhid->iofl)) {
1928 + if (hid_submit_ctrl(hid))
1929 + clear_bit(HID_CTRL_RUNNING, &usbhid->iofl);
1930 ++ } else {
1931 ++ /*
1932 ++ * the queue is known to run
1933 ++ * but an earlier request may be stuck
1934 ++ * we may need to time out
1935 ++ * no race because this is called under
1936 ++ * spinlock
1937 ++ */
1938 ++ if (time_after(jiffies, usbhid->last_ctrl + HZ * 5))
1939 ++ usb_unlink_urb(usbhid->urbctrl);
1940 ++ }
1941 + }
1942 +
1943 + void usbhid_submit_report(struct hid_device *hid, struct hid_report *report, unsigned char dir)
1944 +diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
1945 +index 5713b93..64c5dee 100644
1946 +--- a/drivers/hid/usbhid/hid-quirks.c
1947 ++++ b/drivers/hid/usbhid/hid-quirks.c
1948 +@@ -37,6 +37,7 @@ static const struct hid_blacklist {
1949 + { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FIGHTING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
1950 + { USB_VENDOR_ID_NATSU, USB_DEVICE_ID_NATSU_GAMEPAD, HID_QUIRK_BADPAD },
1951 + { USB_VENDOR_ID_NEC, USB_DEVICE_ID_NEC_USB_GAME_PAD, HID_QUIRK_BADPAD },
1952 ++ { USB_VENDOR_ID_NEXTWINDOW, USB_DEVICE_ID_NEXTWINDOW_TOUCHSCREEN, HID_QUIRK_MULTI_INPUT},
1953 + { USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_RUMBLEPAD, HID_QUIRK_BADPAD },
1954 + { USB_VENDOR_ID_TOPMAX, USB_DEVICE_ID_TOPMAX_COBRAPAD, HID_QUIRK_BADPAD },
1955 +
1956 +diff --git a/drivers/hid/usbhid/usbhid.h b/drivers/hid/usbhid/usbhid.h
1957 +index 08f505c..ec20400 100644
1958 +--- a/drivers/hid/usbhid/usbhid.h
1959 ++++ b/drivers/hid/usbhid/usbhid.h
1960 +@@ -80,12 +80,14 @@ struct usbhid_device {
1961 + unsigned char ctrlhead, ctrltail; /* Control fifo head & tail */
1962 + char *ctrlbuf; /* Control buffer */
1963 + dma_addr_t ctrlbuf_dma; /* Control buffer dma */
1964 ++ unsigned long last_ctrl; /* record of last output for timeouts */
1965 +
1966 + struct urb *urbout; /* Output URB */
1967 + struct hid_output_fifo out[HID_CONTROL_FIFO_SIZE]; /* Output pipe fifo */
1968 + unsigned char outhead, outtail; /* Output pipe fifo head & tail */
1969 + char *outbuf; /* Output buffer */
1970 + dma_addr_t outbuf_dma; /* Output buffer dma */
1971 ++ unsigned long last_out; /* record of last output for timeouts */
1972 +
1973 + spinlock_t lock; /* fifo spinlock */
1974 + unsigned long iofl; /* I/O flags (CTRL_RUNNING, OUT_RUNNING) */
1975 +diff --git a/drivers/hwmon/ams/ams-core.c b/drivers/hwmon/ams/ams-core.c
1976 +index 6c9ace1..2ad62c3 100644
1977 +--- a/drivers/hwmon/ams/ams-core.c
1978 ++++ b/drivers/hwmon/ams/ams-core.c
1979 +@@ -213,7 +213,7 @@ int __init ams_init(void)
1980 + return -ENODEV;
1981 + }
1982 +
1983 +-void ams_exit(void)
1984 ++void ams_sensor_detach(void)
1985 + {
1986 + /* Remove input device */
1987 + ams_input_exit();
1988 +@@ -221,9 +221,6 @@ void ams_exit(void)
1989 + /* Remove attributes */
1990 + device_remove_file(&ams_info.of_dev->dev, &dev_attr_current);
1991 +
1992 +- /* Shut down implementation */
1993 +- ams_info.exit();
1994 +-
1995 + /* Flush interrupt worker
1996 + *
1997 + * We do this after ams_info.exit(), because an interrupt might
1998 +@@ -239,6 +236,12 @@ void ams_exit(void)
1999 + pmf_unregister_irq_client(&ams_freefall_client);
2000 + }
2001 +
2002 ++static void __exit ams_exit(void)
2003 ++{
2004 ++ /* Shut down implementation */
2005 ++ ams_info.exit();
2006 ++}
2007 ++
2008 + MODULE_AUTHOR("Stelian Pop, Michael Hanselmann");
2009 + MODULE_DESCRIPTION("Apple Motion Sensor driver");
2010 + MODULE_LICENSE("GPL");
2011 +diff --git a/drivers/hwmon/ams/ams-i2c.c b/drivers/hwmon/ams/ams-i2c.c
2012 +index 2cbf8a6..abeecd2 100644
2013 +--- a/drivers/hwmon/ams/ams-i2c.c
2014 ++++ b/drivers/hwmon/ams/ams-i2c.c
2015 +@@ -238,6 +238,8 @@ static int ams_i2c_probe(struct i2c_client *client,
2016 + static int ams_i2c_remove(struct i2c_client *client)
2017 + {
2018 + if (ams_info.has_device) {
2019 ++ ams_sensor_detach();
2020 ++
2021 + /* Disable interrupts */
2022 + ams_i2c_set_irq(AMS_IRQ_ALL, 0);
2023 +
2024 +diff --git a/drivers/hwmon/ams/ams-pmu.c b/drivers/hwmon/ams/ams-pmu.c
2025 +index fb18b3d..4f61b3e 100644
2026 +--- a/drivers/hwmon/ams/ams-pmu.c
2027 ++++ b/drivers/hwmon/ams/ams-pmu.c
2028 +@@ -133,6 +133,8 @@ static void ams_pmu_get_xyz(s8 *x, s8 *y, s8 *z)
2029 +
2030 + static void ams_pmu_exit(void)
2031 + {
2032 ++ ams_sensor_detach();
2033 ++
2034 + /* Disable interrupts */
2035 + ams_pmu_set_irq(AMS_IRQ_ALL, 0);
2036 +
2037 +diff --git a/drivers/hwmon/ams/ams.h b/drivers/hwmon/ams/ams.h
2038 +index 5ed387b..b28d7e2 100644
2039 +--- a/drivers/hwmon/ams/ams.h
2040 ++++ b/drivers/hwmon/ams/ams.h
2041 +@@ -61,6 +61,7 @@ extern struct ams ams_info;
2042 +
2043 + extern void ams_sensors(s8 *x, s8 *y, s8 *z);
2044 + extern int ams_sensor_attach(void);
2045 ++extern void ams_sensor_detach(void);
2046 +
2047 + extern int ams_pmu_init(struct device_node *np);
2048 + extern int ams_i2c_init(struct device_node *np);
2049 +diff --git a/drivers/hwmon/tmp421.c b/drivers/hwmon/tmp421.c
2050 +index 2092434..d3a786b 100644
2051 +--- a/drivers/hwmon/tmp421.c
2052 ++++ b/drivers/hwmon/tmp421.c
2053 +@@ -62,9 +62,9 @@ static const u8 TMP421_TEMP_LSB[4] = { 0x10, 0x11, 0x12, 0x13 };
2054 + #define TMP423_DEVICE_ID 0x23
2055 +
2056 + static const struct i2c_device_id tmp421_id[] = {
2057 +- { "tmp421", tmp421 },
2058 +- { "tmp422", tmp422 },
2059 +- { "tmp423", tmp423 },
2060 ++ { "tmp421", 2 },
2061 ++ { "tmp422", 3 },
2062 ++ { "tmp423", 4 },
2063 + { }
2064 + };
2065 + MODULE_DEVICE_TABLE(i2c, tmp421_id);
2066 +@@ -74,21 +74,23 @@ struct tmp421_data {
2067 + struct mutex update_lock;
2068 + char valid;
2069 + unsigned long last_updated;
2070 +- int kind;
2071 ++ int channels;
2072 + u8 config;
2073 + s16 temp[4];
2074 + };
2075 +
2076 + static int temp_from_s16(s16 reg)
2077 + {
2078 +- int temp = reg;
2079 ++ /* Mask out status bits */
2080 ++ int temp = reg & ~0xf;
2081 +
2082 + return (temp * 1000 + 128) / 256;
2083 + }
2084 +
2085 + static int temp_from_u16(u16 reg)
2086 + {
2087 +- int temp = reg;
2088 ++ /* Mask out status bits */
2089 ++ int temp = reg & ~0xf;
2090 +
2091 + /* Add offset for extended temperature range. */
2092 + temp -= 64 * 256;
2093 +@@ -108,7 +110,7 @@ static struct tmp421_data *tmp421_update_device(struct device *dev)
2094 + data->config = i2c_smbus_read_byte_data(client,
2095 + TMP421_CONFIG_REG_1);
2096 +
2097 +- for (i = 0; i <= data->kind; i++) {
2098 ++ for (i = 0; i < data->channels; i++) {
2099 + data->temp[i] = i2c_smbus_read_byte_data(client,
2100 + TMP421_TEMP_MSB[i]) << 8;
2101 + data->temp[i] |= i2c_smbus_read_byte_data(client,
2102 +@@ -167,7 +169,7 @@ static mode_t tmp421_is_visible(struct kobject *kobj, struct attribute *a,
2103 + devattr = container_of(a, struct device_attribute, attr);
2104 + index = to_sensor_dev_attr(devattr)->index;
2105 +
2106 +- if (data->kind > index)
2107 ++ if (index < data->channels)
2108 + return a->mode;
2109 +
2110 + return 0;
2111 +@@ -275,7 +277,7 @@ static int tmp421_probe(struct i2c_client *client,
2112 +
2113 + i2c_set_clientdata(client, data);
2114 + mutex_init(&data->update_lock);
2115 +- data->kind = id->driver_data;
2116 ++ data->channels = id->driver_data;
2117 +
2118 + err = tmp421_init_client(client);
2119 + if (err)
2120 +diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c
2121 +index 386a797..a564fe2 100644
2122 +--- a/drivers/macintosh/therm_adt746x.c
2123 ++++ b/drivers/macintosh/therm_adt746x.c
2124 +@@ -90,6 +90,8 @@ static struct task_struct *thread_therm = NULL;
2125 +
2126 + static void write_both_fan_speed(struct thermostat *th, int speed);
2127 + static void write_fan_speed(struct thermostat *th, int speed, int fan);
2128 ++static void thermostat_create_files(void);
2129 ++static void thermostat_remove_files(void);
2130 +
2131 + static int
2132 + write_reg(struct thermostat* th, int reg, u8 data)
2133 +@@ -161,6 +163,8 @@ remove_thermostat(struct i2c_client *client)
2134 + struct thermostat *th = i2c_get_clientdata(client);
2135 + int i;
2136 +
2137 ++ thermostat_remove_files();
2138 ++
2139 + if (thread_therm != NULL) {
2140 + kthread_stop(thread_therm);
2141 + }
2142 +@@ -449,6 +453,8 @@ static int probe_thermostat(struct i2c_client *client,
2143 + return -ENOMEM;
2144 + }
2145 +
2146 ++ thermostat_create_files();
2147 ++
2148 + return 0;
2149 + }
2150 +
2151 +@@ -566,7 +572,6 @@ thermostat_init(void)
2152 + struct device_node* np;
2153 + const u32 *prop;
2154 + int i = 0, offset = 0;
2155 +- int err;
2156 +
2157 + np = of_find_node_by_name(NULL, "fan");
2158 + if (!np)
2159 +@@ -633,6 +638,17 @@ thermostat_init(void)
2160 + return -ENODEV;
2161 + }
2162 +
2163 ++#ifndef CONFIG_I2C_POWERMAC
2164 ++ request_module("i2c-powermac");
2165 ++#endif
2166 ++
2167 ++ return i2c_add_driver(&thermostat_driver);
2168 ++}
2169 ++
2170 ++static void thermostat_create_files(void)
2171 ++{
2172 ++ int err;
2173 ++
2174 + err = device_create_file(&of_dev->dev, &dev_attr_sensor1_temperature);
2175 + err |= device_create_file(&of_dev->dev, &dev_attr_sensor2_temperature);
2176 + err |= device_create_file(&of_dev->dev, &dev_attr_sensor1_limit);
2177 +@@ -647,16 +663,9 @@ thermostat_init(void)
2178 + if (err)
2179 + printk(KERN_WARNING
2180 + "Failed to create tempertaure attribute file(s).\n");
2181 +-
2182 +-#ifndef CONFIG_I2C_POWERMAC
2183 +- request_module("i2c-powermac");
2184 +-#endif
2185 +-
2186 +- return i2c_add_driver(&thermostat_driver);
2187 + }
2188 +
2189 +-static void __exit
2190 +-thermostat_exit(void)
2191 ++static void thermostat_remove_files(void)
2192 + {
2193 + if (of_dev) {
2194 + device_remove_file(&of_dev->dev, &dev_attr_sensor1_temperature);
2195 +@@ -673,9 +682,14 @@ thermostat_exit(void)
2196 + device_remove_file(&of_dev->dev,
2197 + &dev_attr_sensor2_fan_speed);
2198 +
2199 +- of_device_unregister(of_dev);
2200 + }
2201 ++}
2202 ++
2203 ++static void __exit
2204 ++thermostat_exit(void)
2205 ++{
2206 + i2c_del_driver(&thermostat_driver);
2207 ++ of_device_unregister(of_dev);
2208 + }
2209 +
2210 + module_init(thermostat_init);
2211 +diff --git a/drivers/md/dm.c b/drivers/md/dm.c
2212 +index 724efc6..adb3f8a 100644
2213 +--- a/drivers/md/dm.c
2214 ++++ b/drivers/md/dm.c
2215 +@@ -614,8 +614,10 @@ static void dec_pending(struct dm_io *io, int error)
2216 + if (!md->barrier_error && io_error != -EOPNOTSUPP)
2217 + md->barrier_error = io_error;
2218 + end_io_acct(io);
2219 ++ free_io(md, io);
2220 + } else {
2221 + end_io_acct(io);
2222 ++ free_io(md, io);
2223 +
2224 + if (io_error != DM_ENDIO_REQUEUE) {
2225 + trace_block_bio_complete(md->queue, bio);
2226 +@@ -623,8 +625,6 @@ static void dec_pending(struct dm_io *io, int error)
2227 + bio_endio(bio, io_error);
2228 + }
2229 + }
2230 +-
2231 +- free_io(md, io);
2232 + }
2233 + }
2234 +
2235 +diff --git a/drivers/media/dvb/dvb-core/dvb_net.c b/drivers/media/dvb/dvb-core/dvb_net.c
2236 +index 0241a7c..dddfc46 100644
2237 +--- a/drivers/media/dvb/dvb-core/dvb_net.c
2238 ++++ b/drivers/media/dvb/dvb-core/dvb_net.c
2239 +@@ -504,6 +504,7 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
2240 + "bytes left in TS. Resyncing.\n", ts_remain);
2241 + priv->ule_sndu_len = 0;
2242 + priv->need_pusi = 1;
2243 ++ ts += TS_SZ;
2244 + continue;
2245 + }
2246 +
2247 +diff --git a/drivers/media/dvb/dvb-usb/Kconfig b/drivers/media/dvb/dvb-usb/Kconfig
2248 +index 0e4b97f..690823f 100644
2249 +--- a/drivers/media/dvb/dvb-usb/Kconfig
2250 ++++ b/drivers/media/dvb/dvb-usb/Kconfig
2251 +@@ -112,8 +112,8 @@ config DVB_USB_CXUSB
2252 + select DVB_MT352 if !DVB_FE_CUSTOMISE
2253 + select DVB_ZL10353 if !DVB_FE_CUSTOMISE
2254 + select DVB_DIB7000P if !DVB_FE_CUSTOMISE
2255 +- select DVB_LGS8GL5 if !DVB_FE_CUSTOMISE
2256 + select DVB_TUNER_DIB0070 if !DVB_FE_CUSTOMISE
2257 ++ select DVB_LGS8GXX if !DVB_FE_CUSTOMISE
2258 + select MEDIA_TUNER_SIMPLE if !MEDIA_TUNER_CUSTOMISE
2259 + select MEDIA_TUNER_XC2028 if !MEDIA_TUNER_CUSTOMISE
2260 + select MEDIA_TUNER_MXL5005S if !MEDIA_TUNER_CUSTOMISE
2261 +diff --git a/drivers/media/dvb/frontends/l64781.c b/drivers/media/dvb/frontends/l64781.c
2262 +index 3051b64..445fa10 100644
2263 +--- a/drivers/media/dvb/frontends/l64781.c
2264 ++++ b/drivers/media/dvb/frontends/l64781.c
2265 +@@ -192,8 +192,8 @@ static int apply_frontend_param (struct dvb_frontend* fe, struct dvb_frontend_pa
2266 + spi_bias *= qam_tab[p->constellation];
2267 + spi_bias /= p->code_rate_HP + 1;
2268 + spi_bias /= (guard_tab[p->guard_interval] + 32);
2269 +- spi_bias *= 1000ULL;
2270 +- spi_bias /= 1000ULL + ppm/1000;
2271 ++ spi_bias *= 1000;
2272 ++ spi_bias /= 1000 + ppm/1000;
2273 + spi_bias *= p->code_rate_HP;
2274 +
2275 + val0x04 = (p->transmission_mode << 2) | p->guard_interval;
2276 +diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
2277 +index a672401..d258ed7 100644
2278 +--- a/drivers/media/video/bt8xx/bttv-driver.c
2279 ++++ b/drivers/media/video/bt8xx/bttv-driver.c
2280 +@@ -4468,6 +4468,7 @@ static int __devinit bttv_probe(struct pci_dev *dev,
2281 + request_modules(btv);
2282 + }
2283 +
2284 ++ init_bttv_i2c_ir(btv);
2285 + bttv_input_init(btv);
2286 +
2287 + /* everything is fine */
2288 +diff --git a/drivers/media/video/bt8xx/bttv-i2c.c b/drivers/media/video/bt8xx/bttv-i2c.c
2289 +index beda363..3eb7c29 100644
2290 +--- a/drivers/media/video/bt8xx/bttv-i2c.c
2291 ++++ b/drivers/media/video/bt8xx/bttv-i2c.c
2292 +@@ -388,7 +388,12 @@ int __devinit init_bttv_i2c(struct bttv *btv)
2293 + if (0 == btv->i2c_rc && i2c_scan)
2294 + do_i2c_scan(btv->c.v4l2_dev.name, &btv->i2c_client);
2295 +
2296 +- /* Instantiate the IR receiver device, if present */
2297 ++ return btv->i2c_rc;
2298 ++}
2299 ++
2300 ++/* Instantiate the I2C IR receiver device, if present */
2301 ++void __devinit init_bttv_i2c_ir(struct bttv *btv)
2302 ++{
2303 + if (0 == btv->i2c_rc) {
2304 + struct i2c_board_info info;
2305 + /* The external IR receiver is at i2c address 0x34 (0x35 for
2306 +@@ -408,7 +413,6 @@ int __devinit init_bttv_i2c(struct bttv *btv)
2307 + strlcpy(info.type, "ir_video", I2C_NAME_SIZE);
2308 + i2c_new_probed_device(&btv->c.i2c_adap, &info, addr_list);
2309 + }
2310 +- return btv->i2c_rc;
2311 + }
2312 +
2313 + int __devexit fini_bttv_i2c(struct bttv *btv)
2314 +diff --git a/drivers/media/video/bt8xx/bttvp.h b/drivers/media/video/bt8xx/bttvp.h
2315 +index a1d0e9c..6cccc2a 100644
2316 +--- a/drivers/media/video/bt8xx/bttvp.h
2317 ++++ b/drivers/media/video/bt8xx/bttvp.h
2318 +@@ -279,6 +279,7 @@ extern unsigned int bttv_debug;
2319 + extern unsigned int bttv_gpio;
2320 + extern void bttv_gpio_tracking(struct bttv *btv, char *comment);
2321 + extern int init_bttv_i2c(struct bttv *btv);
2322 ++extern void init_bttv_i2c_ir(struct bttv *btv);
2323 + extern int fini_bttv_i2c(struct bttv *btv);
2324 +
2325 + #define bttv_printk if (bttv_verbose) printk
2326 +diff --git a/drivers/media/video/gspca/mr97310a.c b/drivers/media/video/gspca/mr97310a.c
2327 +index f8328b9..d61767c 100644
2328 +--- a/drivers/media/video/gspca/mr97310a.c
2329 ++++ b/drivers/media/video/gspca/mr97310a.c
2330 +@@ -530,6 +530,12 @@ static int start_cif_cam(struct gspca_dev *gspca_dev)
2331 + {0x13, 0x00, {0x01}, 1},
2332 + {0, 0, {0}, 0}
2333 + };
2334 ++ /* Without this command the cam won't work with USB-UHCI */
2335 ++ gspca_dev->usb_buf[0] = 0x0a;
2336 ++ gspca_dev->usb_buf[1] = 0x00;
2337 ++ err_code = mr_write(gspca_dev, 2);
2338 ++ if (err_code < 0)
2339 ++ return err_code;
2340 + err_code = sensor_write_regs(gspca_dev, cif_sensor1_init_data,
2341 + ARRAY_SIZE(cif_sensor1_init_data));
2342 + }
2343 +diff --git a/drivers/media/video/pwc/pwc-ctrl.c b/drivers/media/video/pwc/pwc-ctrl.c
2344 +index 50b415e..f7f7e04 100644
2345 +--- a/drivers/media/video/pwc/pwc-ctrl.c
2346 ++++ b/drivers/media/video/pwc/pwc-ctrl.c
2347 +@@ -753,7 +753,7 @@ int pwc_set_shutter_speed(struct pwc_device *pdev, int mode, int value)
2348 + buf[0] = 0xff; /* fixed */
2349 +
2350 + ret = send_control_msg(pdev,
2351 +- SET_LUM_CTL, SHUTTER_MODE_FORMATTER, &buf, sizeof(buf));
2352 ++ SET_LUM_CTL, SHUTTER_MODE_FORMATTER, &buf, 1);
2353 +
2354 + if (!mode && ret >= 0) {
2355 + if (value < 0)
2356 +diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c
2357 +index 4a293b4..0ca39ec 100644
2358 +--- a/drivers/media/video/uvc/uvc_ctrl.c
2359 ++++ b/drivers/media/video/uvc/uvc_ctrl.c
2360 +@@ -826,6 +826,13 @@ int uvc_query_v4l2_ctrl(struct uvc_video_chain *chain,
2361 + ret = 0;
2362 + goto out;
2363 +
2364 ++ case V4L2_CTRL_TYPE_BUTTON:
2365 ++ v4l2_ctrl->minimum = 0;
2366 ++ v4l2_ctrl->maximum = 0;
2367 ++ v4l2_ctrl->step = 0;
2368 ++ ret = 0;
2369 ++ goto out;
2370 ++
2371 + default:
2372 + break;
2373 + }
2374 +diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c
2375 +index 99b74a3..f31f05a 100644
2376 +--- a/drivers/mmc/host/s3cmci.c
2377 ++++ b/drivers/mmc/host/s3cmci.c
2378 +@@ -1178,7 +1178,7 @@ static int s3cmci_card_present(struct mmc_host *mmc)
2379 + struct s3c24xx_mci_pdata *pdata = host->pdata;
2380 + int ret;
2381 +
2382 +- if (pdata->gpio_detect == 0)
2383 ++ if (pdata->no_detect)
2384 + return -ENOSYS;
2385 +
2386 + ret = gpio_get_value(pdata->gpio_detect) ? 0 : 1;
2387 +diff --git a/drivers/net/ks8851_mll.c b/drivers/net/ks8851_mll.c
2388 +index c146304..c0ceebc 100644
2389 +--- a/drivers/net/ks8851_mll.c
2390 ++++ b/drivers/net/ks8851_mll.c
2391 +@@ -854,8 +854,8 @@ static void ks_update_link_status(struct net_device *netdev, struct ks_net *ks)
2392 +
2393 + static irqreturn_t ks_irq(int irq, void *pw)
2394 + {
2395 +- struct ks_net *ks = pw;
2396 +- struct net_device *netdev = ks->netdev;
2397 ++ struct net_device *netdev = pw;
2398 ++ struct ks_net *ks = netdev_priv(netdev);
2399 + u16 status;
2400 +
2401 + /*this should be the first in IRQ handler */
2402 +diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
2403 +index f3600b3..77125b5 100644
2404 +--- a/drivers/net/sky2.c
2405 ++++ b/drivers/net/sky2.c
2406 +@@ -1008,11 +1008,8 @@ static void sky2_prefetch_init(struct sky2_hw *hw, u32 qaddr,
2407 + static inline struct sky2_tx_le *get_tx_le(struct sky2_port *sky2, u16 *slot)
2408 + {
2409 + struct sky2_tx_le *le = sky2->tx_le + *slot;
2410 +- struct tx_ring_info *re = sky2->tx_ring + *slot;
2411 +
2412 + *slot = RING_NEXT(*slot, sky2->tx_ring_size);
2413 +- re->flags = 0;
2414 +- re->skb = NULL;
2415 + le->ctrl = 0;
2416 + return le;
2417 + }
2418 +@@ -1580,8 +1577,7 @@ static unsigned tx_le_req(const struct sk_buff *skb)
2419 + return count;
2420 + }
2421 +
2422 +-static void sky2_tx_unmap(struct pci_dev *pdev,
2423 +- const struct tx_ring_info *re)
2424 ++static void sky2_tx_unmap(struct pci_dev *pdev, struct tx_ring_info *re)
2425 + {
2426 + if (re->flags & TX_MAP_SINGLE)
2427 + pci_unmap_single(pdev, pci_unmap_addr(re, mapaddr),
2428 +@@ -1591,6 +1587,7 @@ static void sky2_tx_unmap(struct pci_dev *pdev,
2429 + pci_unmap_page(pdev, pci_unmap_addr(re, mapaddr),
2430 + pci_unmap_len(re, maplen),
2431 + PCI_DMA_TODEVICE);
2432 ++ re->flags = 0;
2433 + }
2434 +
2435 + /*
2436 +@@ -1797,6 +1794,7 @@ static void sky2_tx_complete(struct sky2_port *sky2, u16 done)
2437 + dev->stats.tx_packets++;
2438 + dev->stats.tx_bytes += skb->len;
2439 +
2440 ++ re->skb = NULL;
2441 + dev_kfree_skb_any(skb);
2442 +
2443 + sky2->tx_next = RING_NEXT(idx, sky2->tx_ring_size);
2444 +diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c
2445 +index 1fd7058..31a5d3c 100644
2446 +--- a/drivers/net/via-rhine.c
2447 ++++ b/drivers/net/via-rhine.c
2448 +@@ -102,6 +102,7 @@ static const int multicast_filter_limit = 32;
2449 + #include <linux/ethtool.h>
2450 + #include <linux/crc32.h>
2451 + #include <linux/bitops.h>
2452 ++#include <linux/workqueue.h>
2453 + #include <asm/processor.h> /* Processor type for cache alignment. */
2454 + #include <asm/io.h>
2455 + #include <asm/irq.h>
2456 +@@ -389,6 +390,7 @@ struct rhine_private {
2457 + struct net_device *dev;
2458 + struct napi_struct napi;
2459 + spinlock_t lock;
2460 ++ struct work_struct reset_task;
2461 +
2462 + /* Frequently used values: keep some adjacent for cache effect. */
2463 + u32 quirks;
2464 +@@ -407,6 +409,7 @@ struct rhine_private {
2465 + static int mdio_read(struct net_device *dev, int phy_id, int location);
2466 + static void mdio_write(struct net_device *dev, int phy_id, int location, int value);
2467 + static int rhine_open(struct net_device *dev);
2468 ++static void rhine_reset_task(struct work_struct *work);
2469 + static void rhine_tx_timeout(struct net_device *dev);
2470 + static netdev_tx_t rhine_start_tx(struct sk_buff *skb,
2471 + struct net_device *dev);
2472 +@@ -775,6 +778,8 @@ static int __devinit rhine_init_one(struct pci_dev *pdev,
2473 + dev->irq = pdev->irq;
2474 +
2475 + spin_lock_init(&rp->lock);
2476 ++ INIT_WORK(&rp->reset_task, rhine_reset_task);
2477 ++
2478 + rp->mii_if.dev = dev;
2479 + rp->mii_if.mdio_read = mdio_read;
2480 + rp->mii_if.mdio_write = mdio_write;
2481 +@@ -1179,22 +1184,18 @@ static int rhine_open(struct net_device *dev)
2482 + return 0;
2483 + }
2484 +
2485 +-static void rhine_tx_timeout(struct net_device *dev)
2486 ++static void rhine_reset_task(struct work_struct *work)
2487 + {
2488 +- struct rhine_private *rp = netdev_priv(dev);
2489 +- void __iomem *ioaddr = rp->base;
2490 +-
2491 +- printk(KERN_WARNING "%s: Transmit timed out, status %4.4x, PHY status "
2492 +- "%4.4x, resetting...\n",
2493 +- dev->name, ioread16(ioaddr + IntrStatus),
2494 +- mdio_read(dev, rp->mii_if.phy_id, MII_BMSR));
2495 ++ struct rhine_private *rp = container_of(work, struct rhine_private,
2496 ++ reset_task);
2497 ++ struct net_device *dev = rp->dev;
2498 +
2499 + /* protect against concurrent rx interrupts */
2500 + disable_irq(rp->pdev->irq);
2501 +
2502 + napi_disable(&rp->napi);
2503 +
2504 +- spin_lock(&rp->lock);
2505 ++ spin_lock_bh(&rp->lock);
2506 +
2507 + /* clear all descriptors */
2508 + free_tbufs(dev);
2509 +@@ -1206,7 +1207,7 @@ static void rhine_tx_timeout(struct net_device *dev)
2510 + rhine_chip_reset(dev);
2511 + init_registers(dev);
2512 +
2513 +- spin_unlock(&rp->lock);
2514 ++ spin_unlock_bh(&rp->lock);
2515 + enable_irq(rp->pdev->irq);
2516 +
2517 + dev->trans_start = jiffies;
2518 +@@ -1214,6 +1215,19 @@ static void rhine_tx_timeout(struct net_device *dev)
2519 + netif_wake_queue(dev);
2520 + }
2521 +
2522 ++static void rhine_tx_timeout(struct net_device *dev)
2523 ++{
2524 ++ struct rhine_private *rp = netdev_priv(dev);
2525 ++ void __iomem *ioaddr = rp->base;
2526 ++
2527 ++ printk(KERN_WARNING "%s: Transmit timed out, status %4.4x, PHY status "
2528 ++ "%4.4x, resetting...\n",
2529 ++ dev->name, ioread16(ioaddr + IntrStatus),
2530 ++ mdio_read(dev, rp->mii_if.phy_id, MII_BMSR));
2531 ++
2532 ++ schedule_work(&rp->reset_task);
2533 ++}
2534 ++
2535 + static netdev_tx_t rhine_start_tx(struct sk_buff *skb,
2536 + struct net_device *dev)
2537 + {
2538 +@@ -1830,10 +1844,11 @@ static int rhine_close(struct net_device *dev)
2539 + struct rhine_private *rp = netdev_priv(dev);
2540 + void __iomem *ioaddr = rp->base;
2541 +
2542 +- spin_lock_irq(&rp->lock);
2543 +-
2544 +- netif_stop_queue(dev);
2545 + napi_disable(&rp->napi);
2546 ++ cancel_work_sync(&rp->reset_task);
2547 ++ netif_stop_queue(dev);
2548 ++
2549 ++ spin_lock_irq(&rp->lock);
2550 +
2551 + if (debug > 1)
2552 + printk(KERN_DEBUG "%s: Shutting down ethercard, "
2553 +diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
2554 +index abf896a..6c26840 100644
2555 +--- a/drivers/net/wireless/airo.c
2556 ++++ b/drivers/net/wireless/airo.c
2557 +@@ -5254,11 +5254,7 @@ static int set_wep_key(struct airo_info *ai, u16 index, const char *key,
2558 + WepKeyRid wkr;
2559 + int rc;
2560 +
2561 +- if (keylen == 0) {
2562 +- airo_print_err(ai->dev->name, "%s: key length to set was zero",
2563 +- __func__);
2564 +- return -1;
2565 +- }
2566 ++ WARN_ON(keylen == 0);
2567 +
2568 + memset(&wkr, 0, sizeof(wkr));
2569 + wkr.len = cpu_to_le16(sizeof(wkr));
2570 +@@ -6404,11 +6400,7 @@ static int airo_set_encode(struct net_device *dev,
2571 + if (dwrq->length > MIN_KEY_SIZE)
2572 + key.len = MAX_KEY_SIZE;
2573 + else
2574 +- if (dwrq->length > 0)
2575 +- key.len = MIN_KEY_SIZE;
2576 +- else
2577 +- /* Disable the key */
2578 +- key.len = 0;
2579 ++ key.len = MIN_KEY_SIZE;
2580 + /* Check if the key is not marked as invalid */
2581 + if(!(dwrq->flags & IW_ENCODE_NOKEY)) {
2582 + /* Cleanup */
2583 +@@ -6589,12 +6581,22 @@ static int airo_set_encodeext(struct net_device *dev,
2584 + default:
2585 + return -EINVAL;
2586 + }
2587 +- /* Send the key to the card */
2588 +- rc = set_wep_key(local, idx, key.key, key.len, perm, 1);
2589 +- if (rc < 0) {
2590 +- airo_print_err(local->dev->name, "failed to set WEP key"
2591 +- " at index %d: %d.", idx, rc);
2592 +- return rc;
2593 ++ if (key.len == 0) {
2594 ++ rc = set_wep_tx_idx(local, idx, perm, 1);
2595 ++ if (rc < 0) {
2596 ++ airo_print_err(local->dev->name,
2597 ++ "failed to set WEP transmit index to %d: %d.",
2598 ++ idx, rc);
2599 ++ return rc;
2600 ++ }
2601 ++ } else {
2602 ++ rc = set_wep_key(local, idx, key.key, key.len, perm, 1);
2603 ++ if (rc < 0) {
2604 ++ airo_print_err(local->dev->name,
2605 ++ "failed to set WEP key at index %d: %d.",
2606 ++ idx, rc);
2607 ++ return rc;
2608 ++ }
2609 + }
2610 + }
2611 +
2612 +diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h
2613 +index 6cd5efc..aafdc1e 100644
2614 +--- a/drivers/net/wireless/ath/ath5k/ath5k.h
2615 ++++ b/drivers/net/wireless/ath/ath5k/ath5k.h
2616 +@@ -546,7 +546,6 @@ struct ath5k_txq_info {
2617 + /*
2618 + * Transmit packet types.
2619 + * used on tx control descriptor
2620 +- * TODO: Use them inside base.c corectly
2621 + */
2622 + enum ath5k_pkt_type {
2623 + AR5K_PKT_TYPE_NORMAL = 0,
2624 +diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
2625 +index 8a82c75..46f913b 100644
2626 +--- a/drivers/net/wireless/ath/ath5k/base.c
2627 ++++ b/drivers/net/wireless/ath/ath5k/base.c
2628 +@@ -1220,6 +1220,29 @@ ath5k_rxbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf)
2629 + return 0;
2630 + }
2631 +
2632 ++static enum ath5k_pkt_type get_hw_packet_type(struct sk_buff *skb)
2633 ++{
2634 ++ struct ieee80211_hdr *hdr;
2635 ++ enum ath5k_pkt_type htype;
2636 ++ __le16 fc;
2637 ++
2638 ++ hdr = (struct ieee80211_hdr *)skb->data;
2639 ++ fc = hdr->frame_control;
2640 ++
2641 ++ if (ieee80211_is_beacon(fc))
2642 ++ htype = AR5K_PKT_TYPE_BEACON;
2643 ++ else if (ieee80211_is_probe_resp(fc))
2644 ++ htype = AR5K_PKT_TYPE_PROBE_RESP;
2645 ++ else if (ieee80211_is_atim(fc))
2646 ++ htype = AR5K_PKT_TYPE_ATIM;
2647 ++ else if (ieee80211_is_pspoll(fc))
2648 ++ htype = AR5K_PKT_TYPE_PSPOLL;
2649 ++ else
2650 ++ htype = AR5K_PKT_TYPE_NORMAL;
2651 ++
2652 ++ return htype;
2653 ++}
2654 ++
2655 + static int
2656 + ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf,
2657 + struct ath5k_txq *txq)
2658 +@@ -1274,7 +1297,8 @@ ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf,
2659 + sc->vif, pktlen, info));
2660 + }
2661 + ret = ah->ah_setup_tx_desc(ah, ds, pktlen,
2662 +- ieee80211_get_hdrlen_from_skb(skb), AR5K_PKT_TYPE_NORMAL,
2663 ++ ieee80211_get_hdrlen_from_skb(skb),
2664 ++ get_hw_packet_type(skb),
2665 + (sc->power_level * 2),
2666 + hw_rate,
2667 + info->control.rates[0].count, keyidx, ah->ah_tx_ant, flags,
2668 +diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c
2669 +index 45c4ea5..72e2455 100644
2670 +--- a/drivers/net/wireless/ath/ath9k/beacon.c
2671 ++++ b/drivers/net/wireless/ath/ath9k/beacon.c
2672 +@@ -512,16 +512,13 @@ static void ath_beacon_config_ap(struct ath_softc *sc,
2673 + {
2674 + u32 nexttbtt, intval;
2675 +
2676 +- /* Configure the timers only when the TSF has to be reset */
2677 +-
2678 +- if (!(sc->sc_flags & SC_OP_TSF_RESET))
2679 +- return;
2680 +-
2681 + /* NB: the beacon interval is kept internally in TU's */
2682 + intval = conf->beacon_interval & ATH9K_BEACON_PERIOD;
2683 + intval /= ATH_BCBUF; /* for staggered beacons */
2684 + nexttbtt = intval;
2685 +- intval |= ATH9K_BEACON_RESET_TSF;
2686 ++
2687 ++ if (sc->sc_flags & SC_OP_TSF_RESET)
2688 ++ intval |= ATH9K_BEACON_RESET_TSF;
2689 +
2690 + /*
2691 + * In AP mode we enable the beacon timers and SWBA interrupts to
2692 +diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
2693 +index 0905b38..f735a96 100644
2694 +--- a/drivers/net/wireless/ath/ath9k/hw.c
2695 ++++ b/drivers/net/wireless/ath/ath9k/hw.c
2696 +@@ -1295,6 +1295,16 @@ static void ath9k_hw_override_ini(struct ath_hw *ah,
2697 + * Necessary to avoid issues on AR5416 2.0
2698 + */
2699 + REG_WRITE(ah, 0x9800 + (651 << 2), 0x11);
2700 ++
2701 ++ /*
2702 ++ * Disable RIFS search on some chips to avoid baseband
2703 ++ * hang issues.
2704 ++ */
2705 ++ if (AR_SREV_9100(ah) || AR_SREV_9160(ah)) {
2706 ++ val = REG_READ(ah, AR_PHY_HEAVY_CLIP_FACTOR_RIFS);
2707 ++ val &= ~AR_PHY_RIFS_INIT_DELAY;
2708 ++ REG_WRITE(ah, AR_PHY_HEAVY_CLIP_FACTOR_RIFS, val);
2709 ++ }
2710 + }
2711 +
2712 + static u32 ath9k_hw_def_ini_fixup(struct ath_hw *ah,
2713 +diff --git a/drivers/net/wireless/ath/ath9k/phy.h b/drivers/net/wireless/ath/ath9k/phy.h
2714 +index dfda6f4..b36ec94 100644
2715 +--- a/drivers/net/wireless/ath/ath9k/phy.h
2716 ++++ b/drivers/net/wireless/ath/ath9k/phy.h
2717 +@@ -368,6 +368,9 @@ bool ath9k_hw_init_rf(struct ath_hw *ah,
2718 +
2719 + #define AR_PHY_HEAVY_CLIP_ENABLE 0x99E0
2720 +
2721 ++#define AR_PHY_HEAVY_CLIP_FACTOR_RIFS 0x99EC
2722 ++#define AR_PHY_RIFS_INIT_DELAY 0x03ff0000
2723 ++
2724 + #define AR_PHY_M_SLEEP 0x99f0
2725 + #define AR_PHY_REFCLKDLY 0x99f4
2726 + #define AR_PHY_REFCLKPD 0x99f8
2727 +diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
2728 +index 1895d63..fd397aa 100644
2729 +--- a/drivers/net/wireless/ath/ath9k/rc.c
2730 ++++ b/drivers/net/wireless/ath/ath9k/rc.c
2731 +@@ -757,7 +757,7 @@ static void ath_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,
2732 + struct ieee80211_tx_rate *rates = tx_info->control.rates;
2733 + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
2734 + __le16 fc = hdr->frame_control;
2735 +- u8 try_per_rate, i = 0, rix, nrix;
2736 ++ u8 try_per_rate, i = 0, rix;
2737 + int is_probe = 0;
2738 +
2739 + if (rate_control_send_low(sta, priv_sta, txrc))
2740 +@@ -777,26 +777,25 @@ static void ath_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,
2741 +
2742 + rate_table = sc->cur_rate_table;
2743 + rix = ath_rc_get_highest_rix(sc, ath_rc_priv, rate_table, &is_probe);
2744 +- nrix = rix;
2745 +
2746 + if (is_probe) {
2747 + /* set one try for probe rates. For the
2748 + * probes don't enable rts */
2749 + ath_rc_rate_set_series(rate_table, &rates[i++], txrc,
2750 +- 1, nrix, 0);
2751 ++ 1, rix, 0);
2752 +
2753 + /* Get the next tried/allowed rate. No RTS for the next series
2754 + * after the probe rate
2755 + */
2756 +- ath_rc_get_lower_rix(rate_table, ath_rc_priv, rix, &nrix);
2757 ++ ath_rc_get_lower_rix(rate_table, ath_rc_priv, rix, &rix);
2758 + ath_rc_rate_set_series(rate_table, &rates[i++], txrc,
2759 +- try_per_rate, nrix, 0);
2760 ++ try_per_rate, rix, 0);
2761 +
2762 + tx_info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE;
2763 + } else {
2764 + /* Set the choosen rate. No RTS for first series entry. */
2765 + ath_rc_rate_set_series(rate_table, &rates[i++], txrc,
2766 +- try_per_rate, nrix, 0);
2767 ++ try_per_rate, rix, 0);
2768 + }
2769 +
2770 + /* Fill in the other rates for multirate retry */
2771 +@@ -805,10 +804,10 @@ static void ath_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,
2772 + if (i + 1 == 4)
2773 + try_per_rate = 4;
2774 +
2775 +- ath_rc_get_lower_rix(rate_table, ath_rc_priv, rix, &nrix);
2776 ++ ath_rc_get_lower_rix(rate_table, ath_rc_priv, rix, &rix);
2777 + /* All other rates in the series have RTS enabled */
2778 + ath_rc_rate_set_series(rate_table, &rates[i], txrc,
2779 +- try_per_rate, nrix, 1);
2780 ++ try_per_rate, rix, 1);
2781 + }
2782 +
2783 + /*
2784 +diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
2785 +index 9ca253e..2bde1a9 100644
2786 +--- a/drivers/net/wireless/b43/main.c
2787 ++++ b/drivers/net/wireless/b43/main.c
2788 +@@ -3967,6 +3967,7 @@ static int b43_wireless_core_start(struct b43_wldev *dev)
2789 + }
2790 +
2791 + /* We are ready to run. */
2792 ++ ieee80211_wake_queues(dev->wl->hw);
2793 + b43_set_status(dev, B43_STAT_STARTED);
2794 +
2795 + /* Start data flow (TX/RX). */
2796 +@@ -4376,8 +4377,6 @@ static int b43_wireless_core_init(struct b43_wldev *dev)
2797 +
2798 + ieee80211_wake_queues(dev->wl->hw);
2799 +
2800 +- ieee80211_wake_queues(dev->wl->hw);
2801 +-
2802 + b43_set_status(dev, B43_STAT_INITIALIZED);
2803 +
2804 + out:
2805 +diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
2806 +index 4b60148..c3968fa 100644
2807 +--- a/drivers/net/wireless/b43legacy/main.c
2808 ++++ b/drivers/net/wireless/b43legacy/main.c
2809 +@@ -2921,6 +2921,7 @@ static int b43legacy_wireless_core_start(struct b43legacy_wldev *dev)
2810 + goto out;
2811 + }
2812 + /* We are ready to run. */
2813 ++ ieee80211_wake_queues(dev->wl->hw);
2814 + b43legacy_set_status(dev, B43legacy_STAT_STARTED);
2815 +
2816 + /* Start data flow (TX/RX) */
2817 +@@ -3341,6 +3342,7 @@ static int b43legacy_wireless_core_init(struct b43legacy_wldev *dev)
2818 + b43legacy_security_init(dev);
2819 + b43legacy_rng_init(wl);
2820 +
2821 ++ ieee80211_wake_queues(dev->wl->hw);
2822 + b43legacy_set_status(dev, B43legacy_STAT_INITIALIZED);
2823 +
2824 + b43legacy_leds_init(dev);
2825 +diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
2826 +index 99331ed..852753b 100644
2827 +--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
2828 ++++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
2829 +@@ -2134,7 +2134,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
2830 + IWL_DEBUG_TX_REPLY(priv, "Retry scheduler reclaim scd_ssn "
2831 + "%d index %d\n", scd_ssn , index);
2832 + freed = iwl_tx_queue_reclaim(priv, txq_id, index);
2833 +- priv->stations[sta_id].tid[tid].tfds_in_queue -= freed;
2834 ++ iwl_free_tfds_in_queue(priv, sta_id, tid, freed);
2835 +
2836 + if (priv->mac80211_registered &&
2837 + (iwl_queue_space(&txq->q) > txq->q.low_mark) &&
2838 +diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
2839 +index 133df70..2f89b62 100644
2840 +--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
2841 ++++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
2842 +@@ -1264,7 +1264,7 @@ static void iwl5000_rx_reply_tx(struct iwl_priv *priv,
2843 + scd_ssn , index, txq_id, txq->swq_id);
2844 +
2845 + freed = iwl_tx_queue_reclaim(priv, txq_id, index);
2846 +- priv->stations[sta_id].tid[tid].tfds_in_queue -= freed;
2847 ++ iwl_free_tfds_in_queue(priv, sta_id, tid, freed);
2848 +
2849 + if (priv->mac80211_registered &&
2850 + (iwl_queue_space(&txq->q) > txq->q.low_mark) &&
2851 +@@ -1293,16 +1293,14 @@ static void iwl5000_rx_reply_tx(struct iwl_priv *priv,
2852 + tx_resp->failure_frame);
2853 +
2854 + freed = iwl_tx_queue_reclaim(priv, txq_id, index);
2855 +- if (ieee80211_is_data_qos(tx_resp->frame_ctrl))
2856 +- priv->stations[sta_id].tid[tid].tfds_in_queue -= freed;
2857 ++ iwl_free_tfds_in_queue(priv, sta_id, tid, freed);
2858 +
2859 + if (priv->mac80211_registered &&
2860 + (iwl_queue_space(&txq->q) > txq->q.low_mark))
2861 + iwl_wake_queue(priv, txq_id);
2862 + }
2863 +
2864 +- if (ieee80211_is_data_qos(tx_resp->frame_ctrl))
2865 +- iwl_txq_check_empty(priv, sta_id, tid, txq_id);
2866 ++ iwl_txq_check_empty(priv, sta_id, tid, txq_id);
2867 +
2868 + if (iwl_check_bits(status, TX_ABORT_REQUIRED_MSK))
2869 + IWL_ERR(priv, "TODO: Implement Tx ABORT REQUIRED!!!\n");
2870 +diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
2871 +index 0cd4ec4..6d6235f 100644
2872 +--- a/drivers/net/wireless/iwlwifi/iwl-core.c
2873 ++++ b/drivers/net/wireless/iwlwifi/iwl-core.c
2874 +@@ -2645,8 +2645,8 @@ int iwl_mac_config(struct ieee80211_hw *hw, u32 changed)
2875 + if ((le16_to_cpu(priv->staging_rxon.channel) != ch))
2876 + priv->staging_rxon.flags = 0;
2877 +
2878 +- iwl_set_rxon_ht(priv, ht_conf);
2879 + iwl_set_rxon_channel(priv, conf->channel);
2880 ++ iwl_set_rxon_ht(priv, ht_conf);
2881 +
2882 + iwl_set_flags_for_band(priv, conf->channel->band);
2883 + spin_unlock_irqrestore(&priv->lock, flags);
2884 +diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
2885 +index 7754538..40ec0c1 100644
2886 +--- a/drivers/net/wireless/iwlwifi/iwl-core.h
2887 ++++ b/drivers/net/wireless/iwlwifi/iwl-core.h
2888 +@@ -410,6 +410,8 @@ void iwl_hw_txq_ctx_free(struct iwl_priv *priv);
2889 + int iwl_hw_tx_queue_init(struct iwl_priv *priv,
2890 + struct iwl_tx_queue *txq);
2891 + int iwl_txq_update_write_ptr(struct iwl_priv *priv, struct iwl_tx_queue *txq);
2892 ++void iwl_free_tfds_in_queue(struct iwl_priv *priv,
2893 ++ int sta_id, int tid, int freed);
2894 + int iwl_tx_queue_init(struct iwl_priv *priv, struct iwl_tx_queue *txq,
2895 + int slots_num, u32 txq_id);
2896 + void iwl_tx_queue_free(struct iwl_priv *priv, int txq_id);
2897 +diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c
2898 +index b7e196e..f449f06 100644
2899 +--- a/drivers/net/wireless/iwlwifi/iwl-tx.c
2900 ++++ b/drivers/net/wireless/iwlwifi/iwl-tx.c
2901 +@@ -119,6 +119,20 @@ int iwl_txq_update_write_ptr(struct iwl_priv *priv, struct iwl_tx_queue *txq)
2902 + EXPORT_SYMBOL(iwl_txq_update_write_ptr);
2903 +
2904 +
2905 ++void iwl_free_tfds_in_queue(struct iwl_priv *priv,
2906 ++ int sta_id, int tid, int freed)
2907 ++{
2908 ++ if (priv->stations[sta_id].tid[tid].tfds_in_queue >= freed)
2909 ++ priv->stations[sta_id].tid[tid].tfds_in_queue -= freed;
2910 ++ else {
2911 ++ IWL_ERR(priv, "free more than tfds_in_queue (%u:%d)\n",
2912 ++ priv->stations[sta_id].tid[tid].tfds_in_queue,
2913 ++ freed);
2914 ++ priv->stations[sta_id].tid[tid].tfds_in_queue = 0;
2915 ++ }
2916 ++}
2917 ++EXPORT_SYMBOL(iwl_free_tfds_in_queue);
2918 ++
2919 + /**
2920 + * iwl_tx_queue_free - Deallocate DMA queue.
2921 + * @txq: Transmit queue to deallocate.
2922 +@@ -1057,6 +1071,7 @@ int iwl_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index)
2923 + struct iwl_queue *q = &txq->q;
2924 + struct iwl_tx_info *tx_info;
2925 + int nfreed = 0;
2926 ++ struct ieee80211_hdr *hdr;
2927 +
2928 + if ((index >= q->n_bd) || (iwl_queue_used(q, index) == 0)) {
2929 + IWL_ERR(priv, "Read index for DMA queue txq id (%d), index %d, "
2930 +@@ -1071,6 +1086,10 @@ int iwl_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index)
2931 +
2932 + tx_info = &txq->txb[txq->q.read_ptr];
2933 + ieee80211_tx_status_irqsafe(priv->hw, tx_info->skb[0]);
2934 ++
2935 ++ hdr = (struct ieee80211_hdr *)tx_info->skb[0]->data;
2936 ++ if (hdr && ieee80211_is_data_qos(hdr->frame_control))
2937 ++ nfreed++;
2938 + tx_info->skb[0] = NULL;
2939 +
2940 + if (priv->cfg->ops->lib->txq_inval_byte_cnt_tbl)
2941 +@@ -1485,7 +1504,7 @@ void iwl_rx_reply_compressed_ba(struct iwl_priv *priv,
2942 + if (txq->q.read_ptr != (ba_resp_scd_ssn & 0xff)) {
2943 + /* calculate mac80211 ampdu sw queue to wake */
2944 + int freed = iwl_tx_queue_reclaim(priv, scd_flow, index);
2945 +- priv->stations[sta_id].tid[tid].tfds_in_queue -= freed;
2946 ++ iwl_free_tfds_in_queue(priv, sta_id, tid, freed);
2947 +
2948 + if ((iwl_queue_space(&txq->q) > txq->q.low_mark) &&
2949 + priv->mac80211_registered &&
2950 +diff --git a/drivers/net/wireless/p54/p54pci.c b/drivers/net/wireless/p54/p54pci.c
2951 +index d348c26..1b73733 100644
2952 +--- a/drivers/net/wireless/p54/p54pci.c
2953 ++++ b/drivers/net/wireless/p54/p54pci.c
2954 +@@ -157,6 +157,14 @@ static void p54p_refill_rx_ring(struct ieee80211_hw *dev,
2955 + skb_tail_pointer(skb),
2956 + priv->common.rx_mtu + 32,
2957 + PCI_DMA_FROMDEVICE);
2958 ++
2959 ++ if (pci_dma_mapping_error(priv->pdev, mapping)) {
2960 ++ dev_kfree_skb_any(skb);
2961 ++ dev_err(&priv->pdev->dev,
2962 ++ "RX DMA Mapping error\n");
2963 ++ break;
2964 ++ }
2965 ++
2966 + desc->host_addr = cpu_to_le32(mapping);
2967 + desc->device_addr = 0; // FIXME: necessary?
2968 + desc->len = cpu_to_le16(priv->common.rx_mtu + 32);
2969 +@@ -317,14 +325,20 @@ static void p54p_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
2970 + u32 device_idx, idx, i;
2971 +
2972 + spin_lock_irqsave(&priv->lock, flags);
2973 +-
2974 + device_idx = le32_to_cpu(ring_control->device_idx[1]);
2975 + idx = le32_to_cpu(ring_control->host_idx[1]);
2976 + i = idx % ARRAY_SIZE(ring_control->tx_data);
2977 +
2978 +- priv->tx_buf_data[i] = skb;
2979 + mapping = pci_map_single(priv->pdev, skb->data, skb->len,
2980 + PCI_DMA_TODEVICE);
2981 ++ if (pci_dma_mapping_error(priv->pdev, mapping)) {
2982 ++ spin_unlock_irqrestore(&priv->lock, flags);
2983 ++ p54_free_skb(dev, skb);
2984 ++ dev_err(&priv->pdev->dev, "TX DMA mapping error\n");
2985 ++ return ;
2986 ++ }
2987 ++ priv->tx_buf_data[i] = skb;
2988 ++
2989 + desc = &ring_control->tx_data[i];
2990 + desc->host_addr = cpu_to_le32(mapping);
2991 + desc->device_addr = ((struct p54_hdr *)skb->data)->req_id;
2992 +diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
2993 +index 92af9b9..8742640 100644
2994 +--- a/drivers/net/wireless/p54/p54usb.c
2995 ++++ b/drivers/net/wireless/p54/p54usb.c
2996 +@@ -60,6 +60,7 @@ static struct usb_device_id p54u_table[] __devinitdata = {
2997 + {USB_DEVICE(0x06b9, 0x0121)}, /* Thomson SpeedTouch 121g */
2998 + {USB_DEVICE(0x0707, 0xee13)}, /* SMC 2862W-G version 2 */
2999 + {USB_DEVICE(0x083a, 0x4521)}, /* Siemens Gigaset USB Adapter 54 version 2 */
3000 ++ {USB_DEVICE(0x083a, 0xf503)}, /* Accton FD7050E ver 1010ec */
3001 + {USB_DEVICE(0x0846, 0x4240)}, /* Netgear WG111 (v2) */
3002 + {USB_DEVICE(0x0915, 0x2000)}, /* Cohiba Proto board */
3003 + {USB_DEVICE(0x0915, 0x2002)}, /* Cohiba Proto board */
3004 +diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
3005 +index 54175b6..2ecbedb 100644
3006 +--- a/drivers/net/wireless/rndis_wlan.c
3007 ++++ b/drivers/net/wireless/rndis_wlan.c
3008 +@@ -83,11 +83,11 @@ MODULE_PARM_DESC(roamdelta,
3009 + "set roaming tendency: 0=aggressive, 1=moderate, "
3010 + "2=conservative (default: moderate)");
3011 +
3012 +-static int modparam_workaround_interval = 500;
3013 ++static int modparam_workaround_interval;
3014 + module_param_named(workaround_interval, modparam_workaround_interval,
3015 + int, 0444);
3016 + MODULE_PARM_DESC(workaround_interval,
3017 +- "set stall workaround interval in msecs (default: 500)");
3018 ++ "set stall workaround interval in msecs (0=disabled) (default: 0)");
3019 +
3020 +
3021 + /* various RNDIS OID defs */
3022 +@@ -733,12 +733,13 @@ static int rndis_query_oid(struct usbnet *dev, __le32 oid, void *data, int *len)
3023 + le32_to_cpu(u.get_c->status));
3024 +
3025 + if (ret == 0) {
3026 ++ memcpy(data, u.buf + le32_to_cpu(u.get_c->offset) + 8, *len);
3027 ++
3028 + ret = le32_to_cpu(u.get_c->len);
3029 + if (ret > *len)
3030 + *len = ret;
3031 +- memcpy(data, u.buf + le32_to_cpu(u.get_c->offset) + 8, *len);
3032 +- ret = rndis_error_status(u.get_c->status);
3033 +
3034 ++ ret = rndis_error_status(u.get_c->status);
3035 + if (ret < 0)
3036 + devdbg(dev, "rndis_query_oid(%s): device returned "
3037 + "error, 0x%08x (%d)", oid_to_string(oid),
3038 +@@ -1072,6 +1073,8 @@ static int set_auth_mode(struct usbnet *usbdev, u32 wpa_version,
3039 + auth_mode = NDIS_80211_AUTH_SHARED;
3040 + else if (auth_type == NL80211_AUTHTYPE_OPEN_SYSTEM)
3041 + auth_mode = NDIS_80211_AUTH_OPEN;
3042 ++ else if (auth_type == NL80211_AUTHTYPE_AUTOMATIC)
3043 ++ auth_mode = NDIS_80211_AUTH_AUTO_SWITCH;
3044 + else
3045 + return -ENOTSUPP;
3046 +
3047 +@@ -2547,7 +2550,7 @@ static void rndis_device_poller(struct work_struct *work)
3048 + /* Workaround transfer stalls on poor quality links.
3049 + * TODO: find right way to fix these stalls (as stalls do not happen
3050 + * with ndiswrapper/windows driver). */
3051 +- if (priv->last_qual <= 25) {
3052 ++ if (priv->param_workaround_interval > 0 && priv->last_qual <= 25) {
3053 + /* Decrease stats worker interval to catch stalls.
3054 + * faster. Faster than 400-500ms causes packet loss,
3055 + * Slower doesn't catch stalls fast enough.
3056 +diff --git a/drivers/pci/hotplug/ibmphp_ebda.c b/drivers/pci/hotplug/ibmphp_ebda.c
3057 +index c1abac8..5becbde 100644
3058 +--- a/drivers/pci/hotplug/ibmphp_ebda.c
3059 ++++ b/drivers/pci/hotplug/ibmphp_ebda.c
3060 +@@ -245,7 +245,7 @@ static void __init print_ebda_hpc (void)
3061 +
3062 + int __init ibmphp_access_ebda (void)
3063 + {
3064 +- u8 format, num_ctlrs, rio_complete, hs_complete;
3065 ++ u8 format, num_ctlrs, rio_complete, hs_complete, ebda_sz;
3066 + u16 ebda_seg, num_entries, next_offset, offset, blk_id, sub_addr, re, rc_id, re_id, base;
3067 + int rc = 0;
3068 +
3069 +@@ -260,7 +260,16 @@ int __init ibmphp_access_ebda (void)
3070 + iounmap (io_mem);
3071 + debug ("returned ebda segment: %x\n", ebda_seg);
3072 +
3073 +- io_mem = ioremap(ebda_seg<<4, 1024);
3074 ++ io_mem = ioremap(ebda_seg<<4, 1);
3075 ++ if (!io_mem)
3076 ++ return -ENOMEM;
3077 ++ ebda_sz = readb(io_mem);
3078 ++ iounmap(io_mem);
3079 ++ debug("ebda size: %d(KiB)\n", ebda_sz);
3080 ++ if (ebda_sz == 0)
3081 ++ return -ENOMEM;
3082 ++
3083 ++ io_mem = ioremap(ebda_seg<<4, (ebda_sz * 1024));
3084 + if (!io_mem )
3085 + return -ENOMEM;
3086 + next_offset = 0x180;
3087 +diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
3088 +index 1ee734c..fa0a0d3 100644
3089 +--- a/drivers/platform/x86/thinkpad_acpi.c
3090 ++++ b/drivers/platform/x86/thinkpad_acpi.c
3091 +@@ -2073,6 +2073,7 @@ static struct attribute_set *hotkey_dev_attributes;
3092 +
3093 + static void tpacpi_driver_event(const unsigned int hkey_event);
3094 + static void hotkey_driver_event(const unsigned int scancode);
3095 ++static void hotkey_poll_setup(const bool may_warn);
3096 +
3097 + /* HKEY.MHKG() return bits */
3098 + #define TP_HOTKEY_TABLET_MASK (1 << 3)
3099 +@@ -2254,6 +2255,8 @@ static int tpacpi_hotkey_driver_mask_set(const u32 mask)
3100 +
3101 + rc = hotkey_mask_set((hotkey_acpi_mask | hotkey_driver_mask) &
3102 + ~hotkey_source_mask);
3103 ++ hotkey_poll_setup(true);
3104 ++
3105 + mutex_unlock(&hotkey_mutex);
3106 +
3107 + return rc;
3108 +@@ -2538,7 +2541,7 @@ static void hotkey_poll_stop_sync(void)
3109 + }
3110 +
3111 + /* call with hotkey_mutex held */
3112 +-static void hotkey_poll_setup(bool may_warn)
3113 ++static void hotkey_poll_setup(const bool may_warn)
3114 + {
3115 + const u32 poll_driver_mask = hotkey_driver_mask & hotkey_source_mask;
3116 + const u32 poll_user_mask = hotkey_user_mask & hotkey_source_mask;
3117 +@@ -2569,7 +2572,7 @@ static void hotkey_poll_setup(bool may_warn)
3118 + }
3119 + }
3120 +
3121 +-static void hotkey_poll_setup_safe(bool may_warn)
3122 ++static void hotkey_poll_setup_safe(const bool may_warn)
3123 + {
3124 + mutex_lock(&hotkey_mutex);
3125 + hotkey_poll_setup(may_warn);
3126 +@@ -2587,7 +2590,11 @@ static void hotkey_poll_set_freq(unsigned int freq)
3127 +
3128 + #else /* CONFIG_THINKPAD_ACPI_HOTKEY_POLL */
3129 +
3130 +-static void hotkey_poll_setup_safe(bool __unused)
3131 ++static void hotkey_poll_setup(const bool __unused)
3132 ++{
3133 ++}
3134 ++
3135 ++static void hotkey_poll_setup_safe(const bool __unused)
3136 + {
3137 + }
3138 +
3139 +@@ -2597,16 +2604,11 @@ static int hotkey_inputdev_open(struct input_dev *dev)
3140 + {
3141 + switch (tpacpi_lifecycle) {
3142 + case TPACPI_LIFE_INIT:
3143 +- /*
3144 +- * hotkey_init will call hotkey_poll_setup_safe
3145 +- * at the appropriate moment
3146 +- */
3147 +- return 0;
3148 +- case TPACPI_LIFE_EXITING:
3149 +- return -EBUSY;
3150 + case TPACPI_LIFE_RUNNING:
3151 + hotkey_poll_setup_safe(false);
3152 + return 0;
3153 ++ case TPACPI_LIFE_EXITING:
3154 ++ return -EBUSY;
3155 + }
3156 +
3157 + /* Should only happen if tpacpi_lifecycle is corrupt */
3158 +@@ -2617,7 +2619,7 @@ static int hotkey_inputdev_open(struct input_dev *dev)
3159 + static void hotkey_inputdev_close(struct input_dev *dev)
3160 + {
3161 + /* disable hotkey polling when possible */
3162 +- if (tpacpi_lifecycle == TPACPI_LIFE_RUNNING &&
3163 ++ if (tpacpi_lifecycle != TPACPI_LIFE_EXITING &&
3164 + !(hotkey_source_mask & hotkey_driver_mask))
3165 + hotkey_poll_setup_safe(false);
3166 + }
3167 +@@ -3635,13 +3637,19 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
3168 + break;
3169 + case 3:
3170 + /* 0x3000-0x3FFF: bay-related wakeups */
3171 +- if (hkey == TP_HKEY_EV_BAYEJ_ACK) {
3172 ++ switch (hkey) {
3173 ++ case TP_HKEY_EV_BAYEJ_ACK:
3174 + hotkey_autosleep_ack = 1;
3175 + printk(TPACPI_INFO
3176 + "bay ejected\n");
3177 + hotkey_wakeup_hotunplug_complete_notify_change();
3178 + known_ev = true;
3179 +- } else {
3180 ++ break;
3181 ++ case TP_HKEY_EV_OPTDRV_EJ:
3182 ++ /* FIXME: kick libata if SATA link offline */
3183 ++ known_ev = true;
3184 ++ break;
3185 ++ default:
3186 + known_ev = false;
3187 + }
3188 + break;
3189 +@@ -3852,7 +3860,7 @@ enum {
3190 + TP_ACPI_BLUETOOTH_HWPRESENT = 0x01, /* Bluetooth hw available */
3191 + TP_ACPI_BLUETOOTH_RADIOSSW = 0x02, /* Bluetooth radio enabled */
3192 + TP_ACPI_BLUETOOTH_RESUMECTRL = 0x04, /* Bluetooth state at resume:
3193 +- off / last state */
3194 ++ 0 = disable, 1 = enable */
3195 + };
3196 +
3197 + enum {
3198 +@@ -3898,10 +3906,11 @@ static int bluetooth_set_status(enum tpacpi_rfkill_state state)
3199 + }
3200 + #endif
3201 +
3202 +- /* We make sure to keep TP_ACPI_BLUETOOTH_RESUMECTRL off */
3203 +- status = TP_ACPI_BLUETOOTH_RESUMECTRL;
3204 + if (state == TPACPI_RFK_RADIO_ON)
3205 +- status |= TP_ACPI_BLUETOOTH_RADIOSSW;
3206 ++ status = TP_ACPI_BLUETOOTH_RADIOSSW
3207 ++ | TP_ACPI_BLUETOOTH_RESUMECTRL;
3208 ++ else
3209 ++ status = 0;
3210 +
3211 + if (!acpi_evalf(hkey_handle, NULL, "SBDC", "vd", status))
3212 + return -EIO;
3213 +@@ -4052,7 +4061,7 @@ enum {
3214 + TP_ACPI_WANCARD_HWPRESENT = 0x01, /* Wan hw available */
3215 + TP_ACPI_WANCARD_RADIOSSW = 0x02, /* Wan radio enabled */
3216 + TP_ACPI_WANCARD_RESUMECTRL = 0x04, /* Wan state at resume:
3217 +- off / last state */
3218 ++ 0 = disable, 1 = enable */
3219 + };
3220 +
3221 + #define TPACPI_RFK_WWAN_SW_NAME "tpacpi_wwan_sw"
3222 +@@ -4089,10 +4098,11 @@ static int wan_set_status(enum tpacpi_rfkill_state state)
3223 + }
3224 + #endif
3225 +
3226 +- /* We make sure to set TP_ACPI_WANCARD_RESUMECTRL */
3227 +- status = TP_ACPI_WANCARD_RESUMECTRL;
3228 + if (state == TPACPI_RFK_RADIO_ON)
3229 +- status |= TP_ACPI_WANCARD_RADIOSSW;
3230 ++ status = TP_ACPI_WANCARD_RADIOSSW
3231 ++ | TP_ACPI_WANCARD_RESUMECTRL;
3232 ++ else
3233 ++ status = 0;
3234 +
3235 + if (!acpi_evalf(hkey_handle, NULL, "SWAN", "vd", status))
3236 + return -EIO;
3237 +@@ -5736,7 +5746,7 @@ static void thermal_exit(void)
3238 + case TPACPI_THERMAL_ACPI_TMP07:
3239 + case TPACPI_THERMAL_ACPI_UPDT:
3240 + sysfs_remove_group(&tpacpi_sensors_pdev->dev.kobj,
3241 +- &thermal_temp_input16_group);
3242 ++ &thermal_temp_input8_group);
3243 + break;
3244 + case TPACPI_THERMAL_NONE:
3245 + default:
3246 +@@ -6094,13 +6104,13 @@ static const struct tpacpi_quirk brightness_quirk_table[] __initconst = {
3247 + TPACPI_Q_IBM('1', 'Y', TPACPI_BRGHT_Q_EC), /* T43/p ATI */
3248 +
3249 + /* Models with ATI GPUs that can use ECNVRAM */
3250 +- TPACPI_Q_IBM('1', 'R', TPACPI_BRGHT_Q_EC),
3251 ++ TPACPI_Q_IBM('1', 'R', TPACPI_BRGHT_Q_EC), /* R50,51 T40-42 */
3252 + TPACPI_Q_IBM('1', 'Q', TPACPI_BRGHT_Q_ASK|TPACPI_BRGHT_Q_EC),
3253 +- TPACPI_Q_IBM('7', '6', TPACPI_BRGHT_Q_ASK|TPACPI_BRGHT_Q_EC),
3254 ++ TPACPI_Q_IBM('7', '6', TPACPI_BRGHT_Q_EC), /* R52 */
3255 + TPACPI_Q_IBM('7', '8', TPACPI_BRGHT_Q_ASK|TPACPI_BRGHT_Q_EC),
3256 +
3257 + /* Models with Intel Extreme Graphics 2 */
3258 +- TPACPI_Q_IBM('1', 'U', TPACPI_BRGHT_Q_NOEC),
3259 ++ TPACPI_Q_IBM('1', 'U', TPACPI_BRGHT_Q_NOEC), /* X40 */
3260 + TPACPI_Q_IBM('1', 'V', TPACPI_BRGHT_Q_ASK|TPACPI_BRGHT_Q_EC),
3261 + TPACPI_Q_IBM('1', 'W', TPACPI_BRGHT_Q_ASK|TPACPI_BRGHT_Q_EC),
3262 +
3263 +@@ -8362,6 +8372,9 @@ static int __init thinkpad_acpi_module_init(void)
3264 + return ret;
3265 + }
3266 + }
3267 ++
3268 ++ tpacpi_lifecycle = TPACPI_LIFE_RUNNING;
3269 ++
3270 + ret = input_register_device(tpacpi_inputdev);
3271 + if (ret < 0) {
3272 + printk(TPACPI_ERR "unable to register input device\n");
3273 +@@ -8371,7 +8384,6 @@ static int __init thinkpad_acpi_module_init(void)
3274 + tp_features.input_device_registered = 1;
3275 + }
3276 +
3277 +- tpacpi_lifecycle = TPACPI_LIFE_RUNNING;
3278 + return 0;
3279 + }
3280 +
3281 +diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c
3282 +index be5a6b7..40845c7 100644
3283 +--- a/drivers/rtc/class.c
3284 ++++ b/drivers/rtc/class.c
3285 +@@ -226,6 +226,7 @@ static void __exit rtc_exit(void)
3286 + {
3287 + rtc_dev_exit();
3288 + class_destroy(rtc_class);
3289 ++ idr_destroy(&rtc_idr);
3290 + }
3291 +
3292 + subsys_initcall(rtc_init);
3293 +diff --git a/drivers/rtc/rtc-coh901331.c b/drivers/rtc/rtc-coh901331.c
3294 +index 03ea530..44c4399 100644
3295 +--- a/drivers/rtc/rtc-coh901331.c
3296 ++++ b/drivers/rtc/rtc-coh901331.c
3297 +@@ -271,12 +271,13 @@ static int coh901331_resume(struct platform_device *pdev)
3298 + {
3299 + struct coh901331_port *rtap = dev_get_drvdata(&pdev->dev);
3300 +
3301 +- if (device_may_wakeup(&pdev->dev))
3302 ++ if (device_may_wakeup(&pdev->dev)) {
3303 + disable_irq_wake(rtap->irq);
3304 +- else
3305 ++ } else {
3306 + clk_enable(rtap->clk);
3307 + writel(rtap->irqmaskstore, rtap->virtbase + COH901331_IRQ_MASK);
3308 + clk_disable(rtap->clk);
3309 ++ }
3310 + return 0;
3311 + }
3312 + #else
3313 +diff --git a/drivers/scsi/arm/fas216.c b/drivers/scsi/arm/fas216.c
3314 +index 4775426..9e71ac6 100644
3315 +--- a/drivers/scsi/arm/fas216.c
3316 ++++ b/drivers/scsi/arm/fas216.c
3317 +@@ -2516,7 +2516,7 @@ int fas216_eh_device_reset(struct scsi_cmnd *SCpnt)
3318 + if (info->scsi.phase == PHASE_IDLE)
3319 + fas216_kick(info);
3320 +
3321 +- mod_timer(&info->eh_timer, 30 * HZ);
3322 ++ mod_timer(&info->eh_timer, jiffies + 30 * HZ);
3323 + spin_unlock_irqrestore(&info->host_lock, flags);
3324 +
3325 + /*
3326 +diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
3327 +index 1743640..f10bf70 100644
3328 +--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
3329 ++++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
3330 +@@ -5721,6 +5721,8 @@ _scsih_remove(struct pci_dev *pdev)
3331 + struct _sas_port *mpt2sas_port;
3332 + struct _sas_device *sas_device;
3333 + struct _sas_node *expander_sibling;
3334 ++ struct _raid_device *raid_device, *next;
3335 ++ struct MPT2SAS_TARGET *sas_target_priv_data;
3336 + struct workqueue_struct *wq;
3337 + unsigned long flags;
3338 +
3339 +@@ -5734,6 +5736,21 @@ _scsih_remove(struct pci_dev *pdev)
3340 + if (wq)
3341 + destroy_workqueue(wq);
3342 +
3343 ++ /* release all the volumes */
3344 ++ list_for_each_entry_safe(raid_device, next, &ioc->raid_device_list,
3345 ++ list) {
3346 ++ if (raid_device->starget) {
3347 ++ sas_target_priv_data =
3348 ++ raid_device->starget->hostdata;
3349 ++ sas_target_priv_data->deleted = 1;
3350 ++ scsi_remove_target(&raid_device->starget->dev);
3351 ++ }
3352 ++ printk(MPT2SAS_INFO_FMT "removing handle(0x%04x), wwid"
3353 ++ "(0x%016llx)\n", ioc->name, raid_device->handle,
3354 ++ (unsigned long long) raid_device->wwid);
3355 ++ _scsih_raid_device_remove(ioc, raid_device);
3356 ++ }
3357 ++
3358 + /* free ports attached to the sas_host */
3359 + retry_again:
3360 + list_for_each_entry(mpt2sas_port,
3361 +diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
3362 +index 8371d91..49ac414 100644
3363 +--- a/drivers/scsi/qla1280.c
3364 ++++ b/drivers/scsi/qla1280.c
3365 +@@ -1640,8 +1640,10 @@ qla1280_load_firmware_pio(struct scsi_qla_host *ha)
3366 + uint16_t mb[MAILBOX_REGISTER_COUNT], i;
3367 + int err;
3368 +
3369 ++ spin_unlock_irq(ha->host->host_lock);
3370 + err = request_firmware(&fw, ql1280_board_tbl[ha->devnum].fwname,
3371 + &ha->pdev->dev);
3372 ++ spin_lock_irq(ha->host->host_lock);
3373 + if (err) {
3374 + printk(KERN_ERR "Failed to load image \"%s\" err %d\n",
3375 + ql1280_board_tbl[ha->devnum].fwname, err);
3376 +@@ -1699,8 +1701,10 @@ qla1280_load_firmware_dma(struct scsi_qla_host *ha)
3377 + return -ENOMEM;
3378 + #endif
3379 +
3380 ++ spin_unlock_irq(ha->host->host_lock);
3381 + err = request_firmware(&fw, ql1280_board_tbl[ha->devnum].fwname,
3382 + &ha->pdev->dev);
3383 ++ spin_lock_irq(ha->host->host_lock);
3384 + if (err) {
3385 + printk(KERN_ERR "Failed to load image \"%s\" err %d\n",
3386 + ql1280_board_tbl[ha->devnum].fwname, err);
3387 +diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
3388 +index f3d1d1a..65ef03c 100644
3389 +--- a/drivers/scsi/qla2xxx/qla_gbl.h
3390 ++++ b/drivers/scsi/qla2xxx/qla_gbl.h
3391 +@@ -453,6 +453,5 @@ extern void qla24xx_wrt_req_reg(struct qla_hw_data *, uint16_t, uint16_t);
3392 + extern void qla25xx_wrt_req_reg(struct qla_hw_data *, uint16_t, uint16_t);
3393 + extern void qla25xx_wrt_rsp_reg(struct qla_hw_data *, uint16_t, uint16_t);
3394 + extern void qla24xx_wrt_rsp_reg(struct qla_hw_data *, uint16_t, uint16_t);
3395 +-extern struct scsi_qla_host * qla25xx_get_host(struct rsp_que *);
3396 +
3397 + #endif /* _QLA_GBL_H */
3398 +diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
3399 +index b20a716..b79481e 100644
3400 +--- a/drivers/scsi/qla2xxx/qla_isr.c
3401 ++++ b/drivers/scsi/qla2xxx/qla_isr.c
3402 +@@ -2018,7 +2018,7 @@ qla24xx_msix_rsp_q(int irq, void *dev_id)
3403 +
3404 + spin_lock_irq(&ha->hardware_lock);
3405 +
3406 +- vha = qla25xx_get_host(rsp);
3407 ++ vha = pci_get_drvdata(ha->pdev);
3408 + qla24xx_process_response_queue(vha, rsp);
3409 + if (!ha->mqenable) {
3410 + WRT_REG_DWORD(&reg->hccr, HCCRX_CLR_RISC_INT);
3411 +@@ -2357,30 +2357,3 @@ int qla25xx_request_irq(struct rsp_que *rsp)
3412 + msix->rsp = rsp;
3413 + return ret;
3414 + }
3415 +-
3416 +-struct scsi_qla_host *
3417 +-qla25xx_get_host(struct rsp_que *rsp)
3418 +-{
3419 +- srb_t *sp;
3420 +- struct qla_hw_data *ha = rsp->hw;
3421 +- struct scsi_qla_host *vha = NULL;
3422 +- struct sts_entry_24xx *pkt;
3423 +- struct req_que *req;
3424 +- uint16_t que;
3425 +- uint32_t handle;
3426 +-
3427 +- pkt = (struct sts_entry_24xx *) rsp->ring_ptr;
3428 +- que = MSW(pkt->handle);
3429 +- handle = (uint32_t) LSW(pkt->handle);
3430 +- req = ha->req_q_map[que];
3431 +- if (handle < MAX_OUTSTANDING_COMMANDS) {
3432 +- sp = req->outstanding_cmds[handle];
3433 +- if (sp)
3434 +- return sp->fcport->vha;
3435 +- else
3436 +- goto base_que;
3437 +- }
3438 +-base_que:
3439 +- vha = pci_get_drvdata(ha->pdev);
3440 +- return vha;
3441 +-}
3442 +diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c
3443 +index e07b361..4a69cc8 100644
3444 +--- a/drivers/scsi/qla2xxx/qla_mid.c
3445 ++++ b/drivers/scsi/qla2xxx/qla_mid.c
3446 +@@ -638,11 +638,15 @@ failed:
3447 +
3448 + static void qla_do_work(struct work_struct *work)
3449 + {
3450 ++ unsigned long flags;
3451 + struct rsp_que *rsp = container_of(work, struct rsp_que, q_work);
3452 + struct scsi_qla_host *vha;
3453 ++ struct qla_hw_data *ha = rsp->hw;
3454 +
3455 +- vha = qla25xx_get_host(rsp);
3456 ++ spin_lock_irqsave(&rsp->hw->hardware_lock, flags);
3457 ++ vha = pci_get_drvdata(ha->pdev);
3458 + qla24xx_process_response_queue(vha, rsp);
3459 ++ spin_unlock_irqrestore(&rsp->hw->hardware_lock, flags);
3460 + }
3461 +
3462 + /* create response queue */
3463 +diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c
3464 +index 18130f1..8c0dd13 100644
3465 +--- a/drivers/serial/imx.c
3466 ++++ b/drivers/serial/imx.c
3467 +@@ -1279,7 +1279,7 @@ static int serial_imx_probe(struct platform_device *pdev)
3468 + sport->use_irda = 1;
3469 + #endif
3470 +
3471 +- if (pdata->init) {
3472 ++ if (pdata && pdata->init) {
3473 + ret = pdata->init(pdev);
3474 + if (ret)
3475 + goto clkput;
3476 +@@ -1292,7 +1292,7 @@ static int serial_imx_probe(struct platform_device *pdev)
3477 +
3478 + return 0;
3479 + deinit:
3480 +- if (pdata->exit)
3481 ++ if (pdata && pdata->exit)
3482 + pdata->exit(pdev);
3483 + clkput:
3484 + clk_put(sport->clk);
3485 +@@ -1321,7 +1321,7 @@ static int serial_imx_remove(struct platform_device *pdev)
3486 +
3487 + clk_disable(sport->clk);
3488 +
3489 +- if (pdata->exit)
3490 ++ if (pdata && pdata->exit)
3491 + pdata->exit(pdev);
3492 +
3493 + iounmap(sport->port.membase);
3494 +diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig
3495 +index d21b346..b926b00 100644
3496 +--- a/drivers/staging/Kconfig
3497 ++++ b/drivers/staging/Kconfig
3498 +@@ -81,8 +81,6 @@ source "drivers/staging/rtl8192su/Kconfig"
3499 +
3500 + source "drivers/staging/rtl8192e/Kconfig"
3501 +
3502 +-source "drivers/staging/mimio/Kconfig"
3503 +-
3504 + source "drivers/staging/frontier/Kconfig"
3505 +
3506 + source "drivers/staging/android/Kconfig"
3507 +diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile
3508 +index 8cbf1ae..030d8f8 100644
3509 +--- a/drivers/staging/Makefile
3510 ++++ b/drivers/staging/Makefile
3511 +@@ -23,7 +23,6 @@ obj-$(CONFIG_ALTERA_PCIE_CHDMA) += altpciechdma/
3512 + obj-$(CONFIG_RTL8187SE) += rtl8187se/
3513 + obj-$(CONFIG_RTL8192SU) += rtl8192su/
3514 + obj-$(CONFIG_RTL8192E) += rtl8192e/
3515 +-obj-$(CONFIG_INPUT_MIMIO) += mimio/
3516 + obj-$(CONFIG_TRANZPORT) += frontier/
3517 + obj-$(CONFIG_ANDROID) += android/
3518 + obj-$(CONFIG_ANDROID) += dream/
3519 +diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
3520 +index 894eecf..6acc49a 100644
3521 +--- a/drivers/staging/hv/vmbus_drv.c
3522 ++++ b/drivers/staging/hv/vmbus_drv.c
3523 +@@ -24,6 +24,8 @@
3524 + #include <linux/irq.h>
3525 + #include <linux/interrupt.h>
3526 + #include <linux/sysctl.h>
3527 ++#include <linux/pci.h>
3528 ++#include <linux/dmi.h>
3529 + #include "osd.h"
3530 + #include "logging.h"
3531 + #include "vmbus.h"
3532 +@@ -946,6 +948,19 @@ static irqreturn_t vmbus_isr(int irq, void *dev_id)
3533 + }
3534 + }
3535 +
3536 ++static struct dmi_system_id __initdata microsoft_hv_dmi_table[] = {
3537 ++ {
3538 ++ .ident = "Hyper-V",
3539 ++ .matches = {
3540 ++ DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
3541 ++ DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
3542 ++ DMI_MATCH(DMI_BOARD_NAME, "Virtual Machine"),
3543 ++ },
3544 ++ },
3545 ++ { },
3546 ++};
3547 ++MODULE_DEVICE_TABLE(dmi, microsoft_hv_dmi_table);
3548 ++
3549 + static int __init vmbus_init(void)
3550 + {
3551 + int ret = 0;
3552 +@@ -957,6 +972,9 @@ static int __init vmbus_init(void)
3553 + vmbus_loglevel, HIWORD(vmbus_loglevel), LOWORD(vmbus_loglevel));
3554 + /* Todo: it is used for loglevel, to be ported to new kernel. */
3555 +
3556 ++ if (!dmi_check_system(microsoft_hv_dmi_table))
3557 ++ return -ENODEV;
3558 ++
3559 + ret = vmbus_bus_init(VmbusInitialize);
3560 +
3561 + DPRINT_EXIT(VMBUS_DRV);
3562 +@@ -973,6 +991,18 @@ static void __exit vmbus_exit(void)
3563 + return;
3564 + }
3565 +
3566 ++/*
3567 ++ * We use a PCI table to determine if we should autoload this driver This is
3568 ++ * needed by distro tools to determine if the hyperv drivers should be
3569 ++ * installed and/or configured. We don't do anything else with the table, but
3570 ++ * it needs to be present.
3571 ++ */
3572 ++const static struct pci_device_id microsoft_hv_pci_table[] = {
3573 ++ { PCI_DEVICE(0x1414, 0x5353) }, /* VGA compatible controller */
3574 ++ { 0 }
3575 ++};
3576 ++MODULE_DEVICE_TABLE(pci, microsoft_hv_pci_table);
3577 ++
3578 + MODULE_LICENSE("GPL");
3579 + module_param(vmbus_irq, int, S_IRUGO);
3580 + module_param(vmbus_loglevel, int, S_IRUGO);
3581 +diff --git a/drivers/staging/mimio/Kconfig b/drivers/staging/mimio/Kconfig
3582 +deleted file mode 100644
3583 +index 505dcb2..0000000
3584 +--- a/drivers/staging/mimio/Kconfig
3585 ++++ /dev/null
3586 +@@ -1,10 +0,0 @@
3587 +-config INPUT_MIMIO
3588 +- tristate "Mimio Xi interactive whiteboard support"
3589 +- depends on USB && INPUT
3590 +- default N
3591 +- help
3592 +- Say Y here if you want to use a Mimio Xi interactive
3593 +- whiteboard device.
3594 +-
3595 +- To compile this driver as a module, choose M here: the
3596 +- module will be called mimio.
3597 +diff --git a/drivers/staging/mimio/Makefile b/drivers/staging/mimio/Makefile
3598 +deleted file mode 100644
3599 +index 77807ee..0000000
3600 +--- a/drivers/staging/mimio/Makefile
3601 ++++ /dev/null
3602 +@@ -1 +0,0 @@
3603 +-obj-$(CONFIG_INPUT_MIMIO) += mimio.o
3604 +diff --git a/drivers/staging/mimio/mimio.c b/drivers/staging/mimio/mimio.c
3605 +deleted file mode 100644
3606 +index 1ba8103..0000000
3607 +--- a/drivers/staging/mimio/mimio.c
3608 ++++ /dev/null
3609 +@@ -1,914 +0,0 @@
3610 +-/*
3611 +- * Hardware event => input event mapping:
3612 +- *
3613 +- *
3614 +- *
3615 +- input.h:#define BTN_TOOL_PEN 0x140 black
3616 +- input.h:#define BTN_TOOL_RUBBER 0x141 blue
3617 +- input.h:#define BTN_TOOL_BRUSH 0x142 green
3618 +- input.h:#define BTN_TOOL_PENCIL 0x143 red
3619 +- input.h:#define BTN_TOOL_AIRBRUSH 0x144 eraser
3620 +- input.h:#define BTN_TOOL_FINGER 0x145 small eraser
3621 +- input.h:#define BTN_TOOL_MOUSE 0x146 mimio interactive
3622 +- input.h:#define BTN_TOOL_LENS 0x147 mimio interactive but1
3623 +- input.h:#define LOCALBTN_TOOL_EXTRA1 0x14a mimio interactive but2 == BTN_TOUCH
3624 +- input.h:#define LOCALBTN_TOOL_EXTRA2 0x14b mimio extra pens (orange, brown, yellow, purple) == BTN_STYLUS
3625 +- input.h:#define LOCALBTN_TOOL_EXTRA3 0x14c unused == BTN_STYLUS2
3626 +- input.h:#define BTN_TOOL_DOUBLETAP 0x14d unused
3627 +- input.h:#define BTN_TOOL_TRIPLETAP 0x14e unused
3628 +- *
3629 +- * MIMIO_EV_PENDOWN(MIMIO_PEN_K) => EV_KEY BIT(BTN_TOOL_PEN)
3630 +- * MIMIO_EV_PENDOWN(MIMIO_PEN_B) => EV_KEY BIT(BTN_TOOL_RUBBER)
3631 +- * MIMIO_EV_PENDOWN(MIMIO_PEN_G) => EV_KEY BIT(BTN_TOOL_BRUSH)
3632 +- * MIMIO_EV_PENDOWN(MIMIO_PEN_R) => EV_KEY BIT(BTN_TOOL_PENCIL)
3633 +- * MIMIO_EV_PENDOWN(MIMIO_PEN_E) => EV_KEY BIT(BTN_TOOL_AIRBRUSH)
3634 +- * MIMIO_EV_PENDOWN(MIMIO_PEN_ES) => EV_KEY BIT(BTN_TOOL_FINGER)
3635 +- * MIMIO_EV_PENDOWN(MIMIO_PEN_I) => EV_KEY BIT(BTN_TOOL_MOUSE)
3636 +- * MIMIO_EV_PENDOWN(MIMIO_PEN_IL) => EV_KEY BIT(BTN_TOOL_LENS)
3637 +- * MIMIO_EV_PENDOWN(MIMIO_PEN_IR) => EV_KEY BIT(BTN_TOOL_DOUBLETAP)
3638 +- * MIMIO_EV_PENDOWN(MIMIO_PEN_EX) => EV_KEY BIT(BTN_TOOL_TRIPLETAP)
3639 +- * MIMIO_EV_PENDATA => EV_ABS BIT(ABS_X), BIT(ABS_Y)
3640 +- * MIMIO_EV_MEMRESET => EV_KEY BIT(BTN_0)
3641 +- * MIMIO_EV_ACC(ACC_NEWPAGE) => EV_KEY BIT(BTN_1)
3642 +- * MIMIO_EV_ACC(ACC_TAGPAGE) => EV_KEY BIT(BTN_2)
3643 +- * MIMIO_EV_ACC(ACC_PRINTPAGE) => EV_KEY BIT(BTN_3)
3644 +- * MIMIO_EV_ACC(ACC_MAXIMIZE) => EV_KEY BIT(BTN_4)
3645 +- * MIMIO_EV_ACC(ACC_FINDCTLPNL) => EV_KEY BIT(BTN_5)
3646 +- *
3647 +- *
3648 +- * open issues:
3649 +- * - cold-load of data captured when mimio in standalone mode not yet
3650 +- * supported; need to snoop Win32 box to see datastream for this.
3651 +- * - mimio mouse not yet supported; need to snoop Win32 box to see the
3652 +- * datastream for this.
3653 +- */
3654 +-#include <linux/kernel.h>
3655 +-#include <linux/init.h>
3656 +-#include <linux/slab.h>
3657 +-#include <linux/spinlock.h>
3658 +-#include <linux/input.h>
3659 +-#include <linux/usb.h>
3660 +-
3661 +-#define DRIVER_VERSION "v0.031"
3662 +-#define DRIVER_AUTHOR "mwilder@×××××××.edu"
3663 +-#define DRIVER_DESC "USB mimio-xi driver"
3664 +-
3665 +-enum {UPVALUE, DOWNVALUE, MOVEVALUE};
3666 +-
3667 +-#define MIMIO_XRANGE_MAX 9600
3668 +-#define MIMIO_YRANGE_MAX 4800
3669 +-
3670 +-#define LOCALBTN_TOOL_EXTRA1 BTN_TOUCH
3671 +-#define LOCALBTN_TOOL_EXTRA2 BTN_STYLUS
3672 +-#define LOCALBTN_TOOL_EXTRA3 BTN_STYLUS2
3673 +-
3674 +-#define MIMIO_VENDOR_ID 0x08d3
3675 +-#define MIMIO_PRODUCT_ID 0x0001
3676 +-#define MIMIO_MAXPAYLOAD (8)
3677 +-#define MIMIO_MAXNAMELEN (64)
3678 +-#define MIMIO_TXWAIT (1)
3679 +-#define MIMIO_TXDONE (2)
3680 +-
3681 +-#define MIMIO_EV_PENDOWN (0x22)
3682 +-#define MIMIO_EV_PENDATA (0x24)
3683 +-#define MIMIO_EV_PENUP (0x51)
3684 +-#define MIMIO_EV_MEMRESET (0x45)
3685 +-#define MIMIO_EV_ACC (0xb2)
3686 +-
3687 +-#define MIMIO_PEN_K (1) /* black pen */
3688 +-#define MIMIO_PEN_B (2) /* blue pen */
3689 +-#define MIMIO_PEN_G (3) /* green pen */
3690 +-#define MIMIO_PEN_R (4) /* red pen */
3691 +-/* 5, 6, 7, 8 are extra pens */
3692 +-#define MIMIO_PEN_E (9) /* big eraser */
3693 +-#define MIMIO_PEN_ES (10) /* lil eraser */
3694 +-#define MIMIO_PENJUMP_START (10)
3695 +-#define MIMIO_PENJUMP (6)
3696 +-#define MIMIO_PEN_I (17) /* mimio interactive */
3697 +-#define MIMIO_PEN_IL (18) /* mimio interactive button 1 */
3698 +-#define MIMIO_PEN_IR (19) /* mimio interactive button 2 */
3699 +-
3700 +-#define MIMIO_PEN_MAX (MIMIO_PEN_IR)
3701 +-
3702 +-#define ACC_DONE (0)
3703 +-#define ACC_NEWPAGE (1)
3704 +-#define ACC_TAGPAGE (2)
3705 +-#define ACC_PRINTPAGE (4)
3706 +-#define ACC_MAXIMIZE (8)
3707 +-#define ACC_FINDCTLPNL (16)
3708 +-
3709 +-#define isvalidtxsize(n) ((n) > 0 && (n) <= MIMIO_MAXPAYLOAD)
3710 +-
3711 +-
3712 +-struct pktbuf {
3713 +- unsigned char instr;
3714 +- unsigned char buf[16];
3715 +- unsigned char *p;
3716 +- unsigned char *q;
3717 +-};
3718 +-
3719 +-struct usbintendpt {
3720 +- dma_addr_t dma;
3721 +- struct urb *urb;
3722 +- unsigned char *buf;
3723 +- struct usb_endpoint_descriptor *desc;
3724 +-};
3725 +-
3726 +-struct mimio {
3727 +- struct input_dev *idev;
3728 +- struct usb_device *udev;
3729 +- struct usb_interface *uifc;
3730 +- int open;
3731 +- int present;
3732 +- int greeted;
3733 +- int txflags;
3734 +- char phys[MIMIO_MAXNAMELEN];
3735 +- struct usbintendpt in;
3736 +- struct usbintendpt out;
3737 +- struct pktbuf pktbuf;
3738 +- unsigned char minor;
3739 +- wait_queue_head_t waitq;
3740 +- spinlock_t txlock;
3741 +- void (*rxhandler)(struct mimio *, unsigned char *, unsigned int);
3742 +- int last_pen_down;
3743 +-};
3744 +-
3745 +-static void mimio_close(struct input_dev *);
3746 +-static void mimio_dealloc(struct mimio *);
3747 +-static void mimio_disconnect(struct usb_interface *);
3748 +-static int mimio_greet(struct mimio *);
3749 +-static void mimio_irq_in(struct urb *);
3750 +-static void mimio_irq_out(struct urb *);
3751 +-static int mimio_open(struct input_dev *);
3752 +-static int mimio_probe(struct usb_interface *, const struct usb_device_id *);
3753 +-static void mimio_rx_handler(struct mimio *, unsigned char *, unsigned int);
3754 +-static int mimio_tx(struct mimio *, const char *, int);
3755 +-
3756 +-static char mimio_name[] = "VirtualInk mimio-Xi";
3757 +-static struct usb_device_id mimio_table [] = {
3758 +- { USB_DEVICE(MIMIO_VENDOR_ID, MIMIO_PRODUCT_ID) },
3759 +- { USB_DEVICE(0x0525, 0xa4a0) }, /* gadget zero firmware */
3760 +- { }
3761 +-};
3762 +-
3763 +-MODULE_DEVICE_TABLE(usb, mimio_table);
3764 +-
3765 +-static struct usb_driver mimio_driver = {
3766 +- .name = "mimio",
3767 +- .probe = mimio_probe,
3768 +- .disconnect = mimio_disconnect,
3769 +- .id_table = mimio_table,
3770 +-};
3771 +-
3772 +-static DECLARE_MUTEX(disconnect_sem);
3773 +-
3774 +-static void mimio_close(struct input_dev *idev)
3775 +-{
3776 +- struct mimio *mimio;
3777 +-
3778 +- mimio = input_get_drvdata(idev);
3779 +- if (!mimio) {
3780 +- dev_err(&idev->dev, "null mimio attached to input device\n");
3781 +- return;
3782 +- }
3783 +-
3784 +- if (mimio->open <= 0)
3785 +- dev_err(&idev->dev, "mimio not open.\n");
3786 +- else
3787 +- mimio->open--;
3788 +-
3789 +- if (mimio->present == 0 && mimio->open == 0)
3790 +- mimio_dealloc(mimio);
3791 +-}
3792 +-
3793 +-static void mimio_dealloc(struct mimio *mimio)
3794 +-{
3795 +- if (mimio == NULL)
3796 +- return;
3797 +-
3798 +- usb_kill_urb(mimio->in.urb);
3799 +-
3800 +- usb_kill_urb(mimio->out.urb);
3801 +-
3802 +- if (mimio->idev) {
3803 +- input_unregister_device(mimio->idev);
3804 +- if (mimio->idev->grab)
3805 +- input_close_device(mimio->idev->grab);
3806 +- else
3807 +- dev_dbg(&mimio->idev->dev, "mimio->idev->grab == NULL"
3808 +- " -- didn't call input_close_device\n");
3809 +- }
3810 +-
3811 +- usb_free_urb(mimio->in.urb);
3812 +-
3813 +- usb_free_urb(mimio->out.urb);
3814 +-
3815 +- if (mimio->in.buf) {
3816 +- usb_buffer_free(mimio->udev, MIMIO_MAXPAYLOAD, mimio->in.buf,
3817 +- mimio->in.dma);
3818 +- }
3819 +-
3820 +- if (mimio->out.buf)
3821 +- usb_buffer_free(mimio->udev, MIMIO_MAXPAYLOAD, mimio->out.buf,
3822 +- mimio->out.dma);
3823 +-
3824 +- if (mimio->idev)
3825 +- input_free_device(mimio->idev);
3826 +-
3827 +- kfree(mimio);
3828 +-}
3829 +-
3830 +-static void mimio_disconnect(struct usb_interface *ifc)
3831 +-{
3832 +- struct mimio *mimio;
3833 +-
3834 +- down(&disconnect_sem);
3835 +-
3836 +- mimio = usb_get_intfdata(ifc);
3837 +- usb_set_intfdata(ifc, NULL);
3838 +- dev_dbg(&mimio->idev->dev, "disconnect\n");
3839 +-
3840 +- if (mimio) {
3841 +- mimio->present = 0;
3842 +-
3843 +- if (mimio->open <= 0)
3844 +- mimio_dealloc(mimio);
3845 +- }
3846 +-
3847 +- up(&disconnect_sem);
3848 +-}
3849 +-
3850 +-static int mimio_greet(struct mimio *mimio)
3851 +-{
3852 +- const struct grtpkt {
3853 +- int nbytes;
3854 +- unsigned delay;
3855 +- char data[8];
3856 +- } grtpkts[] = {
3857 +- { 3, 0, { 0x11, 0x55, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00 } },
3858 +- { 5, 0, { 0x53, 0x55, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00 } },
3859 +- { 5, 0, { 0x43, 0x55, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00 } },
3860 +- { 5, 0, { 0x33, 0x55, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00 } },
3861 +- { 5, 0, { 0x13, 0x00, 0x5e, 0x02, 0x4f, 0x00, 0x00, 0x00 } },
3862 +- { 5, 0, { 0x13, 0x00, 0x04, 0x03, 0x14, 0x00, 0x00, 0x00 } },
3863 +- { 5, 2, { 0x13, 0x00, 0x00, 0x04, 0x17, 0x00, 0x00, 0x00 } },
3864 +- { 5, 0, { 0x13, 0x00, 0x0d, 0x08, 0x16, 0x00, 0x00, 0x00 } },
3865 +- { 5, 0, { 0x13, 0x00, 0x4d, 0x01, 0x5f, 0x00, 0x00, 0x00 } },
3866 +- { 3, 0, { 0xf1, 0x55, 0xa4, 0x00, 0x00, 0x00, 0x00, 0x00 } },
3867 +- { 7, 2, { 0x52, 0x55, 0x00, 0x07, 0x31, 0x55, 0x64, 0x00 } },
3868 +- { 0, 0, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
3869 +- };
3870 +- int rslt;
3871 +- const struct grtpkt *pkt;
3872 +-
3873 +- for (pkt = grtpkts; pkt->nbytes; pkt++) {
3874 +- rslt = mimio_tx(mimio, pkt->data, pkt->nbytes);
3875 +- if (rslt)
3876 +- return rslt;
3877 +- if (pkt->delay)
3878 +- msleep(pkt->delay);
3879 +- }
3880 +-
3881 +- return 0;
3882 +-}
3883 +-
3884 +-static void mimio_irq_in(struct urb *urb)
3885 +-{
3886 +- int rslt;
3887 +- char *data;
3888 +- const char *reason = "going down";
3889 +- struct mimio *mimio;
3890 +-
3891 +- mimio = urb->context;
3892 +-
3893 +- if (mimio == NULL)
3894 +- /* paranoia */
3895 +- return;
3896 +-
3897 +- switch (urb->status) {
3898 +- case 0:
3899 +- /* success */
3900 +- break;
3901 +- case -ETIMEDOUT:
3902 +- reason = "timeout -- unplugged?";
3903 +- case -ECONNRESET:
3904 +- case -ENOENT:
3905 +- case -ESHUTDOWN:
3906 +- dev_dbg(&mimio->idev->dev, "%s.\n", reason);
3907 +- return;
3908 +- default:
3909 +- dev_dbg(&mimio->idev->dev, "unknown urb-status: %d.\n",
3910 +- urb->status);
3911 +- goto exit;
3912 +- }
3913 +- data = mimio->in.buf;
3914 +-
3915 +- if (mimio->rxhandler)
3916 +- mimio->rxhandler(mimio, data, urb->actual_length);
3917 +-exit:
3918 +- /*
3919 +- * Keep listening to device on same urb.
3920 +- */
3921 +- rslt = usb_submit_urb(urb, GFP_ATOMIC);
3922 +- if (rslt)
3923 +- dev_err(&mimio->idev->dev, "usb_submit_urb failure: %d.\n",
3924 +- rslt);
3925 +-}
3926 +-
3927 +-static void mimio_irq_out(struct urb *urb)
3928 +-{
3929 +- unsigned long flags;
3930 +- struct mimio *mimio;
3931 +-
3932 +- mimio = urb->context;
3933 +-
3934 +- if (urb->status)
3935 +- dev_dbg(&mimio->idev->dev, "urb-status: %d.\n", urb->status);
3936 +-
3937 +- spin_lock_irqsave(&mimio->txlock, flags);
3938 +- mimio->txflags |= MIMIO_TXDONE;
3939 +- spin_unlock_irqrestore(&mimio->txlock, flags);
3940 +- wmb();
3941 +- wake_up(&mimio->waitq);
3942 +-}
3943 +-
3944 +-static int mimio_open(struct input_dev *idev)
3945 +-{
3946 +- int rslt;
3947 +- struct mimio *mimio;
3948 +-
3949 +- rslt = 0;
3950 +- down(&disconnect_sem);
3951 +- mimio = input_get_drvdata(idev);
3952 +- dev_dbg(&idev->dev, "mimio_open\n");
3953 +-
3954 +- if (mimio == NULL) {
3955 +- dev_err(&idev->dev, "null mimio.\n");
3956 +- rslt = -ENODEV;
3957 +- goto exit;
3958 +- }
3959 +-
3960 +- if (mimio->open++)
3961 +- goto exit;
3962 +-
3963 +- if (mimio->present && !mimio->greeted) {
3964 +- struct urb *urb = mimio->in.urb;
3965 +- mimio->in.urb->dev = mimio->udev;
3966 +- rslt = usb_submit_urb(mimio->in.urb, GFP_KERNEL);
3967 +- if (rslt) {
3968 +- dev_err(&idev->dev, "usb_submit_urb failure "
3969 +- "(res = %d: %s). Not greeting.\n",
3970 +- rslt,
3971 +- (!urb ? "urb is NULL" :
3972 +- (urb->hcpriv ? "urb->hcpriv is non-NULL" :
3973 +- (!urb->complete ? "urb is not complete" :
3974 +- (urb->number_of_packets <= 0 ? "urb has no packets" :
3975 +- (urb->interval <= 0 ? "urb interval too small" :
3976 +- "urb interval too large or some other error"))))));
3977 +- rslt = -EIO;
3978 +- goto exit;
3979 +- }
3980 +- rslt = mimio_greet(mimio);
3981 +- if (rslt == 0) {
3982 +- dev_dbg(&idev->dev, "Mimio greeted OK.\n");
3983 +- mimio->greeted = 1;
3984 +- } else {
3985 +- dev_dbg(&idev->dev, "Mimio greet Failure (%d)\n",
3986 +- rslt);
3987 +- }
3988 +- }
3989 +-
3990 +-exit:
3991 +- up(&disconnect_sem);
3992 +- return rslt;
3993 +-}
3994 +-
3995 +-static int mimio_probe(struct usb_interface *ifc,
3996 +- const struct usb_device_id *id)
3997 +-{
3998 +- char path[64];
3999 +- int pipe, maxp;
4000 +- struct mimio *mimio;
4001 +- struct usb_device *udev;
4002 +- struct usb_host_interface *hostifc;
4003 +- struct input_dev *input_dev;
4004 +- int res = 0;
4005 +- int i;
4006 +-
4007 +- udev = interface_to_usbdev(ifc);
4008 +-
4009 +- mimio = kzalloc(sizeof(struct mimio), GFP_KERNEL);
4010 +- if (!mimio)
4011 +- return -ENOMEM;
4012 +-
4013 +- input_dev = input_allocate_device();
4014 +- if (!input_dev) {
4015 +- mimio_dealloc(mimio);
4016 +- return -ENOMEM;
4017 +- }
4018 +-
4019 +- mimio->uifc = ifc;
4020 +- mimio->udev = udev;
4021 +- mimio->pktbuf.p = mimio->pktbuf.buf;
4022 +- mimio->pktbuf.q = mimio->pktbuf.buf;
4023 +- /* init_input_dev(mimio->idev); */
4024 +- mimio->idev = input_dev;
4025 +- init_waitqueue_head(&mimio->waitq);
4026 +- spin_lock_init(&mimio->txlock);
4027 +- hostifc = ifc->cur_altsetting;
4028 +-
4029 +- if (hostifc->desc.bNumEndpoints != 2) {
4030 +- dev_err(&udev->dev, "Unexpected endpoint count: %d.\n",
4031 +- hostifc->desc.bNumEndpoints);
4032 +- mimio_dealloc(mimio);
4033 +- return -ENODEV;
4034 +- }
4035 +-
4036 +- mimio->in.desc = &(hostifc->endpoint[0].desc);
4037 +- mimio->out.desc = &(hostifc->endpoint[1].desc);
4038 +-
4039 +- mimio->in.buf = usb_buffer_alloc(udev, MIMIO_MAXPAYLOAD, GFP_KERNEL,
4040 +- &mimio->in.dma);
4041 +- mimio->out.buf = usb_buffer_alloc(udev, MIMIO_MAXPAYLOAD, GFP_KERNEL,
4042 +- &mimio->out.dma);
4043 +-
4044 +- if (mimio->in.buf == NULL || mimio->out.buf == NULL) {
4045 +- dev_err(&udev->dev, "usb_buffer_alloc failure.\n");
4046 +- mimio_dealloc(mimio);
4047 +- return -ENOMEM;
4048 +- }
4049 +-
4050 +- mimio->in.urb = usb_alloc_urb(0, GFP_KERNEL);
4051 +- mimio->out.urb = usb_alloc_urb(0, GFP_KERNEL);
4052 +-
4053 +- if (mimio->in.urb == NULL || mimio->out.urb == NULL) {
4054 +- dev_err(&udev->dev, "usb_alloc_urb failure.\n");
4055 +- mimio_dealloc(mimio);
4056 +- return -ENOMEM;
4057 +- }
4058 +-
4059 +- /*
4060 +- * Build the input urb.
4061 +- */
4062 +- pipe = usb_rcvintpipe(udev, mimio->in.desc->bEndpointAddress);
4063 +- maxp = usb_maxpacket(udev, pipe, usb_pipeout(pipe));
4064 +- if (maxp > MIMIO_MAXPAYLOAD)
4065 +- maxp = MIMIO_MAXPAYLOAD;
4066 +- usb_fill_int_urb(mimio->in.urb, udev, pipe, mimio->in.buf, maxp,
4067 +- mimio_irq_in, mimio, mimio->in.desc->bInterval);
4068 +- mimio->in.urb->transfer_dma = mimio->in.dma;
4069 +- mimio->in.urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
4070 +-
4071 +- /*
4072 +- * Build the output urb.
4073 +- */
4074 +- pipe = usb_sndintpipe(udev, mimio->out.desc->bEndpointAddress);
4075 +- maxp = usb_maxpacket(udev, pipe, usb_pipeout(pipe));
4076 +- if (maxp > MIMIO_MAXPAYLOAD)
4077 +- maxp = MIMIO_MAXPAYLOAD;
4078 +- usb_fill_int_urb(mimio->out.urb, udev, pipe, mimio->out.buf, maxp,
4079 +- mimio_irq_out, mimio, mimio->out.desc->bInterval);
4080 +- mimio->out.urb->transfer_dma = mimio->out.dma;
4081 +- mimio->out.urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
4082 +-
4083 +- /*
4084 +- * Build input device info
4085 +- */
4086 +- usb_make_path(udev, path, 64);
4087 +- snprintf(mimio->phys, MIMIO_MAXNAMELEN, "%s/input0", path);
4088 +- input_set_drvdata(input_dev, mimio);
4089 +- /* input_dev->dev = &ifc->dev; */
4090 +- input_dev->open = mimio_open;
4091 +- input_dev->close = mimio_close;
4092 +- input_dev->name = mimio_name;
4093 +- input_dev->phys = mimio->phys;
4094 +- input_dev->dev.parent = &ifc->dev;
4095 +-
4096 +- input_dev->id.bustype = BUS_USB;
4097 +- input_dev->id.vendor = le16_to_cpu(udev->descriptor.idVendor);
4098 +- input_dev->id.product = le16_to_cpu(udev->descriptor.idProduct);
4099 +- input_dev->id.version = le16_to_cpu(udev->descriptor.bcdDevice);
4100 +-
4101 +- input_dev->evbit[0] |= BIT(EV_KEY) | BIT(EV_ABS);
4102 +- for (i = BTN_TOOL_PEN; i <= LOCALBTN_TOOL_EXTRA2; ++i)
4103 +- set_bit(i, input_dev->keybit);
4104 +-
4105 +- input_dev->keybit[BIT_WORD(BTN_MISC)] |= BIT_MASK(BTN_0) |
4106 +- BIT_MASK(BTN_1) |
4107 +- BIT_MASK(BTN_2) |
4108 +- BIT_MASK(BTN_3) |
4109 +- BIT_MASK(BTN_4) |
4110 +- BIT_MASK(BTN_5);
4111 +- /* input_dev->keybit[BTN_MOUSE] |= BIT(BTN_LEFT); */
4112 +- input_dev->absbit[0] |= BIT_MASK(ABS_X) | BIT_MASK(ABS_Y);
4113 +- input_set_abs_params(input_dev, ABS_X, 0, MIMIO_XRANGE_MAX, 0, 0);
4114 +- input_set_abs_params(input_dev, ABS_Y, 0, MIMIO_YRANGE_MAX, 0, 0);
4115 +- input_dev->absbit[BIT_WORD(ABS_MISC)] |= BIT_MASK(ABS_MISC);
4116 +-
4117 +-#if 0
4118 +- input_dev->absmin[ABS_X] = 0;
4119 +- input_dev->absmin[ABS_Y] = 0;
4120 +- input_dev->absmax[ABS_X] = 9600;
4121 +- input_dev->absmax[ABS_Y] = 4800;
4122 +- input_dev->absfuzz[ABS_X] = 0;
4123 +- input_dev->absfuzz[ABS_Y] = 0;
4124 +- input_dev->absflat[ABS_X] = 0;
4125 +- input_dev->absflat[ABS_Y] = 0;
4126 +-#endif
4127 +-
4128 +-#if 0
4129 +- /* this will just reduce the precision */
4130 +- input_dev->absfuzz[ABS_X] = 8; /* experimental; may need to change */
4131 +- input_dev->absfuzz[ABS_Y] = 8; /* experimental; may need to change */
4132 +-#endif
4133 +-
4134 +- /*
4135 +- * Register the input device.
4136 +- */
4137 +- res = input_register_device(mimio->idev);
4138 +- if (res) {
4139 +- dev_err(&udev->dev, "input_register_device failure (%d)\n",
4140 +- res);
4141 +- mimio_dealloc(mimio);
4142 +- return -EIO;
4143 +- }
4144 +- dev_dbg(&mimio->idev->dev, "input: %s on %s (res = %d).\n",
4145 +- input_dev->name, input_dev->phys, res);
4146 +-
4147 +- usb_set_intfdata(ifc, mimio);
4148 +- mimio->present = 1;
4149 +-
4150 +- /*
4151 +- * Submit the input urb to the usb subsystem.
4152 +- */
4153 +- mimio->in.urb->dev = mimio->udev;
4154 +- res = usb_submit_urb(mimio->in.urb, GFP_KERNEL);
4155 +- if (res) {
4156 +- dev_err(&mimio->idev->dev, "usb_submit_urb failure (%d)\n",
4157 +- res);
4158 +- mimio_dealloc(mimio);
4159 +- return -EIO;
4160 +- }
4161 +-
4162 +- /*
4163 +- * Attempt to greet the mimio after giving
4164 +- * it some post-init settling time.
4165 +- *
4166 +- * note: sometimes this sleep interval isn't
4167 +- * long enough to permit the device to re-init
4168 +- * after a hot-swap; maybe need to bump it up.
4169 +- *
4170 +- * As it is, this probably breaks module unloading support!
4171 +- */
4172 +- msleep(1024);
4173 +-
4174 +- res = mimio_greet(mimio);
4175 +- if (res == 0) {
4176 +- dev_dbg(&mimio->idev->dev, "Mimio greeted OK.\n");
4177 +- mimio->greeted = 1;
4178 +- mimio->rxhandler = mimio_rx_handler;
4179 +- } else {
4180 +- dev_dbg(&mimio->idev->dev, "Mimio greet Failure (%d)\n", res);
4181 +- }
4182 +-
4183 +- return 0;
4184 +-}
4185 +-
4186 +-static int handle_mimio_rx_penupdown(struct mimio *mimio,
4187 +- int down,
4188 +- const char *const instr[],
4189 +- const int instr_ofst[])
4190 +-{
4191 +- int penid, x;
4192 +- if (mimio->pktbuf.q - mimio->pktbuf.p < (down ? 4 : 3))
4193 +- return 1; /* partial pkt */
4194 +-
4195 +- if (down) {
4196 +- x = *mimio->pktbuf.p ^ *(mimio->pktbuf.p + 1) ^
4197 +- *(mimio->pktbuf.p + 2);
4198 +- if (x != *(mimio->pktbuf.p + 3)) {
4199 +- dev_dbg(&mimio->idev->dev, "EV_PEN%s: bad xsum.\n",
4200 +- down ? "DOWN":"UP");
4201 +- /* skip this event data */
4202 +- mimio->pktbuf.p += 4;
4203 +- /* decode any remaining events */
4204 +- return 0;
4205 +- }
4206 +- penid = mimio->pktbuf.instr = *(mimio->pktbuf.p + 2);
4207 +- if (penid > MIMIO_PEN_MAX) {
4208 +- dev_dbg(&mimio->idev->dev,
4209 +- "Unmapped penID (not in [0, %d]): %d\n",
4210 +- MIMIO_PEN_MAX, (int)mimio->pktbuf.instr);
4211 +- penid = mimio->pktbuf.instr = 0;
4212 +- }
4213 +- mimio->last_pen_down = penid;
4214 +- } else {
4215 +- penid = mimio->last_pen_down;
4216 +- }
4217 +- dev_dbg(&mimio->idev->dev, "%s (id %d, code %d) %s.\n", instr[penid],
4218 +- instr_ofst[penid], penid, down ? "down" : "up");
4219 +-
4220 +- if (instr_ofst[penid] >= 0) {
4221 +- int code = BTN_TOOL_PEN + instr_ofst[penid];
4222 +- int value = down ? DOWNVALUE : UPVALUE;
4223 +- if (code > KEY_MAX)
4224 +- dev_dbg(&mimio->idev->dev, "input_event will ignore "
4225 +- "-- code (%d) > KEY_MAX\n", code);
4226 +- if (!test_bit(code, mimio->idev->keybit))
4227 +- dev_dbg(&mimio->idev->dev, "input_event will ignore "
4228 +- "-- bit for code (%d) not enabled\n", code);
4229 +- if (!!test_bit(code, mimio->idev->key) == value)
4230 +- dev_dbg(&mimio->idev->dev, "input_event will ignore "
4231 +- "-- bit for code (%d) already set to %d\n",
4232 +- code, value);
4233 +- if (value != DOWNVALUE) {
4234 +- /* input_regs(mimio->idev, regs); */
4235 +- input_report_key(mimio->idev, code, value);
4236 +- input_sync(mimio->idev);
4237 +- } else {
4238 +- /* wait until we get some coordinates */
4239 +- }
4240 +- } else {
4241 +- dev_dbg(&mimio->idev->dev, "penID offset[%d] == %d is < 0 "
4242 +- "- not sending\n", penid, instr_ofst[penid]);
4243 +- }
4244 +- mimio->pktbuf.p += down ? 4 : 3; /* 3 for up, 4 for down */
4245 +- return 0;
4246 +-}
4247 +-
4248 +-/*
4249 +- * Stay tuned for partial-packet excitement.
4250 +- *
4251 +- * This routine buffers data packets received from the mimio device
4252 +- * in the mimio's data space. This buffering is necessary because
4253 +- * the mimio's in endpoint can serve us partial packets of data, and
4254 +- * we want the driver to support the servicing of multiple mimios.
4255 +- * Empirical evidence gathered so far suggests that the method of
4256 +- * buffering packet data in the mimio's data space works. Previous
4257 +- * versions of this driver did not buffer packet data in each mimio's
4258 +- * data-space, and were therefore not able to service multiple mimios.
4259 +- * Note that since the caller of this routine is running in interrupt
4260 +- * context, care needs to be taken to ensure that this routine does not
4261 +- * become bloated, and it may be that another spinlock is needed in each
4262 +- * mimio to guard the buffered packet data properly.
4263 +- */
4264 +-static void mimio_rx_handler(struct mimio *mimio,
4265 +- unsigned char *data,
4266 +- unsigned int nbytes)
4267 +-{
4268 +- struct device *dev = &mimio->idev->dev;
4269 +- unsigned int x;
4270 +- unsigned int y;
4271 +- static const char * const instr[] = {
4272 +- "?0",
4273 +- "black pen", "blue pen", "green pen", "red pen",
4274 +- "brown pen", "orange pen", "purple pen", "yellow pen",
4275 +- "big eraser", "lil eraser",
4276 +- "?11", "?12", "?13", "?14", "?15", "?16",
4277 +- "mimio interactive", "interactive button1",
4278 +- "interactive button2"
4279 +- };
4280 +-
4281 +- /* Mimio Interactive gives:
4282 +- * down: [0x22 0x01 0x11 0x32 0x24]
4283 +- * b1 : [0x22 0x01 0x12 0x31 0x24]
4284 +- * b2 : [0x22 0x01 0x13 0x30 0x24]
4285 +- */
4286 +- static const int instr_ofst[] = {
4287 +- -1,
4288 +- 0, 1, 2, 3,
4289 +- 9, 9, 9, 9,
4290 +- 4, 5,
4291 +- -1, -1, -1, -1, -1, -1,
4292 +- 6, 7, 8,
4293 +- };
4294 +-
4295 +- memcpy(mimio->pktbuf.q, data, nbytes);
4296 +- mimio->pktbuf.q += nbytes;
4297 +-
4298 +- while (mimio->pktbuf.p < mimio->pktbuf.q) {
4299 +- int t = *mimio->pktbuf.p;
4300 +- switch (t) {
4301 +- case MIMIO_EV_PENUP:
4302 +- case MIMIO_EV_PENDOWN:
4303 +- if (handle_mimio_rx_penupdown(mimio,
4304 +- t == MIMIO_EV_PENDOWN,
4305 +- instr, instr_ofst))
4306 +- return; /* partial packet */
4307 +- break;
4308 +-
4309 +- case MIMIO_EV_PENDATA:
4310 +- if (mimio->pktbuf.q - mimio->pktbuf.p < 6)
4311 +- /* partial pkt */
4312 +- return;
4313 +- x = *mimio->pktbuf.p ^ *(mimio->pktbuf.p + 1) ^
4314 +- *(mimio->pktbuf.p + 2) ^
4315 +- *(mimio->pktbuf.p + 3) ^
4316 +- *(mimio->pktbuf.p + 4);
4317 +- if (x != *(mimio->pktbuf.p + 5)) {
4318 +- dev_dbg(dev, "EV_PENDATA: bad xsum.\n");
4319 +- mimio->pktbuf.p += 6; /* skip this event data */
4320 +- break; /* decode any remaining events */
4321 +- }
4322 +- x = *(mimio->pktbuf.p + 1);
4323 +- x <<= 8;
4324 +- x |= *(mimio->pktbuf.p + 2);
4325 +- y = *(mimio->pktbuf.p + 3);
4326 +- y <<= 8;
4327 +- y |= *(mimio->pktbuf.p + 4);
4328 +- dev_dbg(dev, "coord: (%d, %d)\n", x, y);
4329 +- if (instr_ofst[mimio->pktbuf.instr] >= 0) {
4330 +- int code = BTN_TOOL_PEN +
4331 +- instr_ofst[mimio->last_pen_down];
4332 +-#if 0
4333 +- /* Utter hack to ensure we get forwarded _AND_
4334 +- * so we can identify when a complete signal is
4335 +- * received */
4336 +- mimio->idev->abs[ABS_Y] = -1;
4337 +- mimio->idev->abs[ABS_X] = -1;
4338 +-#endif
4339 +- /* input_regs(mimio->idev, regs); */
4340 +- input_report_abs(mimio->idev, ABS_X, x);
4341 +- input_report_abs(mimio->idev, ABS_Y, y);
4342 +- /* fake a penup */
4343 +- change_bit(code, mimio->idev->key);
4344 +- input_report_key(mimio->idev,
4345 +- code,
4346 +- DOWNVALUE);
4347 +- /* always sync here */
4348 +- mimio->idev->sync = 0;
4349 +- input_sync(mimio->idev);
4350 +- }
4351 +- mimio->pktbuf.p += 6;
4352 +- break;
4353 +- case MIMIO_EV_MEMRESET:
4354 +- if (mimio->pktbuf.q - mimio->pktbuf.p < 7)
4355 +- /* partial pkt */
4356 +- return;
4357 +- dev_dbg(dev, "mem-reset.\n");
4358 +- /* input_regs(mimio->idev, regs); */
4359 +- input_event(mimio->idev, EV_KEY, BTN_0, 1);
4360 +- input_event(mimio->idev, EV_KEY, BTN_0, 0);
4361 +- input_sync(mimio->idev);
4362 +- mimio->pktbuf.p += 7;
4363 +- break;
4364 +- case MIMIO_EV_ACC:
4365 +- if (mimio->pktbuf.q - mimio->pktbuf.p < 4)
4366 +- /* partial pkt */
4367 +- return;
4368 +- x = *mimio->pktbuf.p ^ *(mimio->pktbuf.p + 1) ^
4369 +- *(mimio->pktbuf.p + 2);
4370 +- if (x != *(mimio->pktbuf.p + 3)) {
4371 +- dev_dbg(dev, "EV_ACC: bad xsum.\n");
4372 +- mimio->pktbuf.p += 4; /* skip this event data */
4373 +- break; /* decode any remaining events */
4374 +- }
4375 +- switch (*(mimio->pktbuf.p + 2)) {
4376 +- case ACC_NEWPAGE:
4377 +- dev_dbg(&mimio->idev->dev, "new-page.\n");
4378 +- /* input_regs(mimio->idev, regs); */
4379 +- input_event(mimio->idev, EV_KEY, BTN_1, 1);
4380 +- input_event(mimio->idev, EV_KEY, BTN_1, 0);
4381 +- input_sync(mimio->idev);
4382 +- break;
4383 +- case ACC_TAGPAGE:
4384 +- dev_dbg(&mimio->idev->dev, "tag-page.\n");
4385 +- /* input_regs(mimio->idev, regs); */
4386 +- input_event(mimio->idev, EV_KEY, BTN_2, 1);
4387 +- input_event(mimio->idev, EV_KEY, BTN_2, 0);
4388 +- input_sync(mimio->idev);
4389 +- break;
4390 +- case ACC_PRINTPAGE:
4391 +- dev_dbg(&mimio->idev->dev, "print-page.\n");
4392 +- /* input_regs(mimio->idev, regs);*/
4393 +- input_event(mimio->idev, EV_KEY, BTN_3, 1);
4394 +- input_event(mimio->idev, EV_KEY, BTN_3, 0);
4395 +- input_sync(mimio->idev);
4396 +- break;
4397 +- case ACC_MAXIMIZE:
4398 +- dev_dbg(&mimio->idev->dev,
4399 +- "maximize-window.\n");
4400 +- /* input_regs(mimio->idev, regs); */
4401 +- input_event(mimio->idev, EV_KEY, BTN_4, 1);
4402 +- input_event(mimio->idev, EV_KEY, BTN_4, 0);
4403 +- input_sync(mimio->idev);
4404 +- break;
4405 +- case ACC_FINDCTLPNL:
4406 +- dev_dbg(&mimio->idev->dev, "find-ctl-panel.\n");
4407 +- /* input_regs(mimio->idev, regs); */
4408 +- input_event(mimio->idev, EV_KEY, BTN_5, 1);
4409 +- input_event(mimio->idev, EV_KEY, BTN_5, 0);
4410 +- input_sync(mimio->idev);
4411 +- break;
4412 +- case ACC_DONE:
4413 +- dev_dbg(&mimio->idev->dev, "acc-done.\n");
4414 +- /* no event is dispatched to the input
4415 +- * subsystem for this device event.
4416 +- */
4417 +- break;
4418 +- default:
4419 +- dev_dbg(dev, "unknown acc event.\n");
4420 +- break;
4421 +- }
4422 +- mimio->pktbuf.p += 4;
4423 +- break;
4424 +- default:
4425 +- mimio->pktbuf.p++;
4426 +- break;
4427 +- }
4428 +- }
4429 +-
4430 +- /*
4431 +- * No partial event was received, so reset mimio's pktbuf ptrs.
4432 +- */
4433 +- mimio->pktbuf.p = mimio->pktbuf.q = mimio->pktbuf.buf;
4434 +-}
4435 +-
4436 +-static int mimio_tx(struct mimio *mimio, const char *buf, int nbytes)
4437 +-{
4438 +- int rslt;
4439 +- int timeout;
4440 +- unsigned long flags;
4441 +- DECLARE_WAITQUEUE(wait, current);
4442 +-
4443 +- if (!(isvalidtxsize(nbytes))) {
4444 +- dev_err(&mimio->idev->dev, "invalid arg: nbytes: %d.\n",
4445 +- nbytes);
4446 +- return -EINVAL;
4447 +- }
4448 +-
4449 +- /*
4450 +- * Init the out urb and copy the data to send.
4451 +- */
4452 +- mimio->out.urb->dev = mimio->udev;
4453 +- mimio->out.urb->transfer_buffer_length = nbytes;
4454 +- memcpy(mimio->out.urb->transfer_buffer, buf, nbytes);
4455 +-
4456 +- /*
4457 +- * Send the data.
4458 +- */
4459 +- spin_lock_irqsave(&mimio->txlock, flags);
4460 +- mimio->txflags = MIMIO_TXWAIT;
4461 +- rslt = usb_submit_urb(mimio->out.urb, GFP_ATOMIC);
4462 +- spin_unlock_irqrestore(&mimio->txlock, flags);
4463 +- dev_dbg(&mimio->idev->dev, "rslt: %d.\n", rslt);
4464 +-
4465 +- if (rslt) {
4466 +- dev_err(&mimio->idev->dev, "usb_submit_urb failure: %d.\n",
4467 +- rslt);
4468 +- return rslt;
4469 +- }
4470 +-
4471 +- /*
4472 +- * Wait for completion to be signalled (the mimio_irq_out
4473 +- * completion routine will or MIMIO_TXDONE in with txflags).
4474 +- */
4475 +- timeout = HZ;
4476 +- set_current_state(TASK_INTERRUPTIBLE);
4477 +- add_wait_queue(&mimio->waitq, &wait);
4478 +-
4479 +- while (timeout && ((mimio->txflags & MIMIO_TXDONE) == 0)) {
4480 +- timeout = schedule_timeout(timeout);
4481 +- rmb();
4482 +- }
4483 +-
4484 +- if ((mimio->txflags & MIMIO_TXDONE) == 0)
4485 +- dev_dbg(&mimio->idev->dev, "tx timed out.\n");
4486 +-
4487 +- /*
4488 +- * Now that completion has been signalled,
4489 +- * unlink the urb so that it can be recycled.
4490 +- */
4491 +- set_current_state(TASK_RUNNING);
4492 +- remove_wait_queue(&mimio->waitq, &wait);
4493 +- usb_unlink_urb(mimio->out.urb);
4494 +-
4495 +- return rslt;
4496 +-}
4497 +-
4498 +-static int __init mimio_init(void)
4499 +-{
4500 +- int rslt;
4501 +-
4502 +- rslt = usb_register(&mimio_driver);
4503 +- if (rslt != 0) {
4504 +- err("%s: usb_register failure: %d", __func__, rslt);
4505 +- return rslt;
4506 +- }
4507 +-
4508 +- printk(KERN_INFO KBUILD_MODNAME ":"
4509 +- DRIVER_DESC " " DRIVER_VERSION "\n");
4510 +- return rslt;
4511 +-}
4512 +-
4513 +-static void __exit mimio_exit(void)
4514 +-{
4515 +- usb_deregister(&mimio_driver);
4516 +-}
4517 +-
4518 +-module_init(mimio_init);
4519 +-module_exit(mimio_exit);
4520 +-
4521 +-MODULE_AUTHOR(DRIVER_AUTHOR);
4522 +-MODULE_DESCRIPTION(DRIVER_DESC);
4523 +-MODULE_LICENSE("GPL");
4524 +diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
4525 +index 4f86447..5d80d5e 100644
4526 +--- a/drivers/usb/core/driver.c
4527 ++++ b/drivers/usb/core/driver.c
4528 +@@ -625,9 +625,6 @@ static int usb_uevent(struct device *dev, struct kobj_uevent_env *env)
4529 + {
4530 + struct usb_device *usb_dev;
4531 +
4532 +- /* driver is often null here; dev_dbg() would oops */
4533 +- pr_debug("usb %s: uevent\n", dev_name(dev));
4534 +-
4535 + if (is_usb_device(dev)) {
4536 + usb_dev = to_usb_device(dev);
4537 + } else if (is_usb_interface(dev)) {
4538 +@@ -639,6 +636,7 @@ static int usb_uevent(struct device *dev, struct kobj_uevent_env *env)
4539 + }
4540 +
4541 + if (usb_dev->devnum < 0) {
4542 ++ /* driver is often null here; dev_dbg() would oops */
4543 + pr_debug("usb %s: already deleted?\n", dev_name(dev));
4544 + return -ENODEV;
4545 + }
4546 +diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
4547 +index 34de475..24e6205 100644
4548 +--- a/drivers/usb/core/hcd.c
4549 ++++ b/drivers/usb/core/hcd.c
4550 +@@ -140,7 +140,7 @@ static const u8 usb3_rh_dev_descriptor[18] = {
4551 + 0x09, /* __u8 bMaxPacketSize0; 2^9 = 512 Bytes */
4552 +
4553 + 0x6b, 0x1d, /* __le16 idVendor; Linux Foundation */
4554 +- 0x02, 0x00, /* __le16 idProduct; device 0x0002 */
4555 ++ 0x03, 0x00, /* __le16 idProduct; device 0x0003 */
4556 + KERNEL_VER, KERNEL_REL, /* __le16 bcdDevice */
4557 +
4558 + 0x03, /* __u8 iManufacturer; */
4559 +diff --git a/drivers/usb/core/hcd.h b/drivers/usb/core/hcd.h
4560 +index 79782a1..bcbe104 100644
4561 +--- a/drivers/usb/core/hcd.h
4562 ++++ b/drivers/usb/core/hcd.h
4563 +@@ -234,7 +234,7 @@ struct hc_driver {
4564 + /* xHCI specific functions */
4565 + /* Called by usb_alloc_dev to alloc HC device structures */
4566 + int (*alloc_dev)(struct usb_hcd *, struct usb_device *);
4567 +- /* Called by usb_release_dev to free HC device structures */
4568 ++ /* Called by usb_disconnect to free HC device structures */
4569 + void (*free_dev)(struct usb_hcd *, struct usb_device *);
4570 +
4571 + /* Bandwidth computation functions */
4572 +diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
4573 +index 1a7d54b..ed3aa7a 100644
4574 +--- a/drivers/usb/core/hub.c
4575 ++++ b/drivers/usb/core/hub.c
4576 +@@ -1508,6 +1508,15 @@ static inline void usb_stop_pm(struct usb_device *udev)
4577 +
4578 + #endif
4579 +
4580 ++static void hub_free_dev(struct usb_device *udev)
4581 ++{
4582 ++ struct usb_hcd *hcd = bus_to_hcd(udev->bus);
4583 ++
4584 ++ /* Root hubs aren't real devices, so don't free HCD resources */
4585 ++ if (hcd->driver->free_dev && udev->parent)
4586 ++ hcd->driver->free_dev(hcd, udev);
4587 ++}
4588 ++
4589 + /**
4590 + * usb_disconnect - disconnect a device (usbcore-internal)
4591 + * @pdev: pointer to device being disconnected
4592 +@@ -1578,6 +1587,8 @@ void usb_disconnect(struct usb_device **pdev)
4593 +
4594 + usb_stop_pm(udev);
4595 +
4596 ++ hub_free_dev(udev);
4597 ++
4598 + put_device(&udev->dev);
4599 + }
4600 +
4601 +@@ -3130,6 +3141,7 @@ loop_disable:
4602 + loop:
4603 + usb_ep0_reinit(udev);
4604 + release_address(udev);
4605 ++ hub_free_dev(udev);
4606 + usb_put_dev(udev);
4607 + if ((status == -ENOTCONN) || (status == -ENOTSUPP))
4608 + break;
4609 +diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
4610 +index 52e5e31..ab2d3e7 100644
4611 +--- a/drivers/usb/core/usb.c
4612 ++++ b/drivers/usb/core/usb.c
4613 +@@ -191,9 +191,6 @@ static void usb_release_dev(struct device *dev)
4614 + hcd = bus_to_hcd(udev->bus);
4615 +
4616 + usb_destroy_configuration(udev);
4617 +- /* Root hubs aren't real devices, so don't free HCD resources */
4618 +- if (hcd->driver->free_dev && udev->parent)
4619 +- hcd->driver->free_dev(hcd, udev);
4620 + usb_put_hcd(hcd);
4621 + kfree(udev->product);
4622 + kfree(udev->manufacturer);
4623 +diff --git a/drivers/usb/host/ohci-pnx4008.c b/drivers/usb/host/ohci-pnx4008.c
4624 +index 100bf3d..1f1d4fa 100644
4625 +--- a/drivers/usb/host/ohci-pnx4008.c
4626 ++++ b/drivers/usb/host/ohci-pnx4008.c
4627 +@@ -327,7 +327,7 @@ static int __devinit usb_hcd_pnx4008_probe(struct platform_device *pdev)
4628 + }
4629 + i2c_adap = i2c_get_adapter(2);
4630 + memset(&i2c_info, 0, sizeof(struct i2c_board_info));
4631 +- strlcpy(i2c_info.name, "isp1301_pnx", I2C_NAME_SIZE);
4632 ++ strlcpy(i2c_info.type, "isp1301_pnx", I2C_NAME_SIZE);
4633 + isp1301_i2c_client = i2c_new_probed_device(i2c_adap, &i2c_info,
4634 + normal_i2c);
4635 + i2c_put_adapter(i2c_adap);
4636 +@@ -411,7 +411,7 @@ out3:
4637 + out2:
4638 + clk_put(usb_clk);
4639 + out1:
4640 +- i2c_unregister_client(isp1301_i2c_client);
4641 ++ i2c_unregister_device(isp1301_i2c_client);
4642 + isp1301_i2c_client = NULL;
4643 + out_i2c_driver:
4644 + i2c_del_driver(&isp1301_driver);
4645 +@@ -430,7 +430,7 @@ static int usb_hcd_pnx4008_remove(struct platform_device *pdev)
4646 + pnx4008_unset_usb_bits();
4647 + clk_disable(usb_clk);
4648 + clk_put(usb_clk);
4649 +- i2c_unregister_client(isp1301_i2c_client);
4650 ++ i2c_unregister_device(isp1301_i2c_client);
4651 + isp1301_i2c_client = NULL;
4652 + i2c_del_driver(&isp1301_driver);
4653 +
4654 +diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c
4655 +index 99cd00f..0919706 100644
4656 +--- a/drivers/usb/host/uhci-hcd.c
4657 ++++ b/drivers/usb/host/uhci-hcd.c
4658 +@@ -735,6 +735,7 @@ static void uhci_stop(struct usb_hcd *hcd)
4659 + uhci_hc_died(uhci);
4660 + uhci_scan_schedule(uhci);
4661 + spin_unlock_irq(&uhci->lock);
4662 ++ synchronize_irq(hcd->irq);
4663 +
4664 + del_timer_sync(&uhci->fsbr_timer);
4665 + release_uhci(uhci);
4666 +diff --git a/drivers/usb/host/xhci-ext-caps.h b/drivers/usb/host/xhci-ext-caps.h
4667 +index ecc131c..78c4eda 100644
4668 +--- a/drivers/usb/host/xhci-ext-caps.h
4669 ++++ b/drivers/usb/host/xhci-ext-caps.h
4670 +@@ -101,12 +101,15 @@ static inline int xhci_find_next_cap_offset(void __iomem *base, int ext_offset)
4671 +
4672 + next = readl(base + ext_offset);
4673 +
4674 +- if (ext_offset == XHCI_HCC_PARAMS_OFFSET)
4675 ++ if (ext_offset == XHCI_HCC_PARAMS_OFFSET) {
4676 + /* Find the first extended capability */
4677 + next = XHCI_HCC_EXT_CAPS(next);
4678 +- else
4679 ++ ext_offset = 0;
4680 ++ } else {
4681 + /* Find the next extended capability */
4682 + next = XHCI_EXT_CAPS_NEXT(next);
4683 ++ }
4684 ++
4685 + if (!next)
4686 + return 0;
4687 + /*
4688 +diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c
4689 +index 0025847..8b37a4b 100644
4690 +--- a/drivers/usb/misc/sisusbvga/sisusb.c
4691 ++++ b/drivers/usb/misc/sisusbvga/sisusb.c
4692 +@@ -3245,6 +3245,7 @@ static struct usb_device_id sisusb_table [] = {
4693 + { USB_DEVICE(0x0711, 0x0902) },
4694 + { USB_DEVICE(0x0711, 0x0903) },
4695 + { USB_DEVICE(0x0711, 0x0918) },
4696 ++ { USB_DEVICE(0x0711, 0x0920) },
4697 + { USB_DEVICE(0x182d, 0x021c) },
4698 + { USB_DEVICE(0x182d, 0x0269) },
4699 + { }
4700 +diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
4701 +index bd254ec..7d920f2 100644
4702 +--- a/drivers/usb/serial/cp210x.c
4703 ++++ b/drivers/usb/serial/cp210x.c
4704 +@@ -91,11 +91,12 @@ static struct usb_device_id id_table [] = {
4705 + { USB_DEVICE(0x10C4, 0x81C8) }, /* Lipowsky Industrie Elektronik GmbH, Baby-JTAG */
4706 + { USB_DEVICE(0x10C4, 0x81E2) }, /* Lipowsky Industrie Elektronik GmbH, Baby-LIN */
4707 + { USB_DEVICE(0x10C4, 0x81E7) }, /* Aerocomm Radio */
4708 ++ { USB_DEVICE(0x10C4, 0x81E8) }, /* Zephyr Bioharness */
4709 + { USB_DEVICE(0x10C4, 0x81F2) }, /* C1007 HF band RFID controller */
4710 + { USB_DEVICE(0x10C4, 0x8218) }, /* Lipowsky Industrie Elektronik GmbH, HARP-1 */
4711 + { USB_DEVICE(0x10C4, 0x822B) }, /* Modem EDGE(GSM) Comander 2 */
4712 + { USB_DEVICE(0x10C4, 0x826B) }, /* Cygnal Integrated Products, Inc., Fasttrax GPS demostration module */
4713 +- { USB_DEVICE(0x10c4, 0x8293) }, /* Telegesys ETRX2USB */
4714 ++ { USB_DEVICE(0x10C4, 0x8293) }, /* Telegesys ETRX2USB */
4715 + { USB_DEVICE(0x10C4, 0x82F9) }, /* Procyon AVS */
4716 + { USB_DEVICE(0x10C4, 0x8341) }, /* Siemens MC35PU GPRS Modem */
4717 + { USB_DEVICE(0x10C4, 0x8382) }, /* Cygnal Integrated Products, Inc. */
4718 +diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
4719 +index 13a1b39..ce937e7 100644
4720 +--- a/drivers/usb/serial/ftdi_sio.c
4721 ++++ b/drivers/usb/serial/ftdi_sio.c
4722 +@@ -44,12 +44,13 @@
4723 + #include <linux/serial.h>
4724 + #include <linux/usb/serial.h>
4725 + #include "ftdi_sio.h"
4726 ++#include "ftdi_sio_ids.h"
4727 +
4728 + /*
4729 + * Version Information
4730 + */
4731 + #define DRIVER_VERSION "v1.5.0"
4732 +-#define DRIVER_AUTHOR "Greg Kroah-Hartman <greg@×××××.com>, Bill Ryder <bryder@×××.com>, Kuba Ober <kuba@×××××××××××.org>"
4733 ++#define DRIVER_AUTHOR "Greg Kroah-Hartman <greg@×××××.com>, Bill Ryder <bryder@×××.com>, Kuba Ober <kuba@×××××××××××.org>, Andreas Mohr"
4734 + #define DRIVER_DESC "USB FTDI Serial Converters Driver"
4735 +
4736 + static int debug;
4737 +@@ -144,10 +145,15 @@ static struct ftdi_sio_quirk ftdi_HE_TIRA1_quirk = {
4738 +
4739 +
4740 +
4741 ++/*
4742 ++ * Device ID not listed? Test via module params product/vendor or
4743 ++ * /sys/bus/usb/ftdi_sio/new_id, then send patch/report!
4744 ++ */
4745 + static struct usb_device_id id_table_combined [] = {
4746 + { USB_DEVICE(FTDI_VID, FTDI_AMC232_PID) },
4747 + { USB_DEVICE(FTDI_VID, FTDI_CANUSB_PID) },
4748 + { USB_DEVICE(FTDI_VID, FTDI_CANDAPTER_PID) },
4749 ++ { USB_DEVICE(FTDI_VID, FTDI_NXTCAM_PID) },
4750 + { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_0_PID) },
4751 + { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_1_PID) },
4752 + { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_2_PID) },
4753 +@@ -551,9 +557,16 @@ static struct usb_device_id id_table_combined [] = {
4754 + { USB_DEVICE(FTDI_VID, FTDI_IBS_PEDO_PID) },
4755 + { USB_DEVICE(FTDI_VID, FTDI_IBS_PROD_PID) },
4756 + /*
4757 +- * Due to many user requests for multiple ELV devices we enable
4758 +- * them by default.
4759 ++ * ELV devices:
4760 + */
4761 ++ { USB_DEVICE(FTDI_VID, FTDI_ELV_USR_PID) },
4762 ++ { USB_DEVICE(FTDI_VID, FTDI_ELV_MSM1_PID) },
4763 ++ { USB_DEVICE(FTDI_VID, FTDI_ELV_KL100_PID) },
4764 ++ { USB_DEVICE(FTDI_VID, FTDI_ELV_WS550_PID) },
4765 ++ { USB_DEVICE(FTDI_VID, FTDI_ELV_EC3000_PID) },
4766 ++ { USB_DEVICE(FTDI_VID, FTDI_ELV_WS888_PID) },
4767 ++ { USB_DEVICE(FTDI_VID, FTDI_ELV_TWS550_PID) },
4768 ++ { USB_DEVICE(FTDI_VID, FTDI_ELV_FEM_PID) },
4769 + { USB_DEVICE(FTDI_VID, FTDI_ELV_CLI7000_PID) },
4770 + { USB_DEVICE(FTDI_VID, FTDI_ELV_PPS7330_PID) },
4771 + { USB_DEVICE(FTDI_VID, FTDI_ELV_TFM100_PID) },
4772 +@@ -570,11 +583,17 @@ static struct usb_device_id id_table_combined [] = {
4773 + { USB_DEVICE(FTDI_VID, FTDI_ELV_PCK100_PID) },
4774 + { USB_DEVICE(FTDI_VID, FTDI_ELV_RFP500_PID) },
4775 + { USB_DEVICE(FTDI_VID, FTDI_ELV_FS20SIG_PID) },
4776 ++ { USB_DEVICE(FTDI_VID, FTDI_ELV_UTP8_PID) },
4777 + { USB_DEVICE(FTDI_VID, FTDI_ELV_WS300PC_PID) },
4778 ++ { USB_DEVICE(FTDI_VID, FTDI_ELV_WS444PC_PID) },
4779 + { USB_DEVICE(FTDI_VID, FTDI_ELV_FHZ1300PC_PID) },
4780 + { USB_DEVICE(FTDI_VID, FTDI_ELV_EM1010PC_PID) },
4781 + { USB_DEVICE(FTDI_VID, FTDI_ELV_WS500_PID) },
4782 + { USB_DEVICE(FTDI_VID, FTDI_ELV_HS485_PID) },
4783 ++ { USB_DEVICE(FTDI_VID, FTDI_ELV_UMS100_PID) },
4784 ++ { USB_DEVICE(FTDI_VID, FTDI_ELV_TFD128_PID) },
4785 ++ { USB_DEVICE(FTDI_VID, FTDI_ELV_FM3RX_PID) },
4786 ++ { USB_DEVICE(FTDI_VID, FTDI_ELV_WS777_PID) },
4787 + { USB_DEVICE(FTDI_VID, LINX_SDMUSBQSS_PID) },
4788 + { USB_DEVICE(FTDI_VID, LINX_MASTERDEVEL2_PID) },
4789 + { USB_DEVICE(FTDI_VID, LINX_FUTURE_0_PID) },
4790 +@@ -595,6 +614,7 @@ static struct usb_device_id id_table_combined [] = {
4791 + { USB_DEVICE(FTDI_VID, FTDI_OCEANIC_PID) },
4792 + { USB_DEVICE(TTI_VID, TTI_QL355P_PID) },
4793 + { USB_DEVICE(FTDI_VID, FTDI_RM_CANVIEW_PID) },
4794 ++ { USB_DEVICE(CONTEC_VID, CONTEC_COM1USBH_PID) },
4795 + { USB_DEVICE(BANDB_VID, BANDB_USOTL4_PID) },
4796 + { USB_DEVICE(BANDB_VID, BANDB_USTL4_PID) },
4797 + { USB_DEVICE(BANDB_VID, BANDB_USO9ML2_PID) },
4798 +@@ -696,6 +716,7 @@ static struct usb_device_id id_table_combined [] = {
4799 + { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_USB60F) },
4800 + { USB_DEVICE(FTDI_VID, FTDI_REU_TINY_PID) },
4801 + { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO4x4_PID) },
4802 ++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_AD4USB_PID) },
4803 + { USB_DEVICE(FTDI_VID, FTDI_DOMINTELL_DGQG_PID) },
4804 + { USB_DEVICE(FTDI_VID, FTDI_DOMINTELL_DUSB_PID) },
4805 + { USB_DEVICE(ALTI2_VID, ALTI2_N3_PID) },
4806 +@@ -717,6 +738,10 @@ static struct usb_device_id id_table_combined [] = {
4807 + .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
4808 + { USB_DEVICE(FTDI_VID, HAMEG_HO820_PID) },
4809 + { USB_DEVICE(FTDI_VID, HAMEG_HO870_PID) },
4810 ++ { USB_DEVICE(FTDI_VID, MJSG_GENERIC_PID) },
4811 ++ { USB_DEVICE(FTDI_VID, MJSG_SR_RADIO_PID) },
4812 ++ { USB_DEVICE(FTDI_VID, MJSG_HD_RADIO_PID) },
4813 ++ { USB_DEVICE(FTDI_VID, MJSG_XM_RADIO_PID) },
4814 + { }, /* Optional parameter entry */
4815 + { } /* Terminating entry */
4816 + };
4817 +diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h
4818 +index 4586a24..b0e0d64 100644
4819 +--- a/drivers/usb/serial/ftdi_sio.h
4820 ++++ b/drivers/usb/serial/ftdi_sio.h
4821 +@@ -1,7 +1,10 @@
4822 + /*
4823 +- * Definitions for the FTDI USB Single Port Serial Converter -
4824 ++ * Driver definitions for the FTDI USB Single Port Serial Converter -
4825 + * known as FTDI_SIO (Serial Input/Output application of the chipset)
4826 + *
4827 ++ * For USB vendor/product IDs (VID/PID), please see ftdi_sio_ids.h
4828 ++ *
4829 ++ *
4830 + * The example I have is known as the USC-1000 which is available from
4831 + * http://www.dse.co.nz - cat no XH4214 It looks similar to this:
4832 + * http://www.dansdata.com/usbser.htm but I can't be sure There are other
4833 +@@ -17,880 +20,7 @@
4834 + * Bill Ryder - bryder@×××.com formerly of Silicon Graphics, Inc.- wrote the
4835 + * FTDI_SIO implementation.
4836 + *
4837 +- * Philipp Gühring - pg@××××××××××.at - added the Device ID of the USB relais
4838 +- * from Rudolf Gugler
4839 +- *
4840 +- */
4841 +-
4842 +-#define FTDI_VID 0x0403 /* Vendor Id */
4843 +-#define FTDI_SIO_PID 0x8372 /* Product Id SIO application of 8U100AX */
4844 +-#define FTDI_8U232AM_PID 0x6001 /* Similar device to SIO above */
4845 +-#define FTDI_8U232AM_ALT_PID 0x6006 /* FTDI's alternate PID for above */
4846 +-#define FTDI_8U2232C_PID 0x6010 /* Dual channel device */
4847 +-#define FTDI_232RL_PID 0xFBFA /* Product ID for FT232RL */
4848 +-#define FTDI_4232H_PID 0x6011 /* Quad channel hi-speed device */
4849 +-#define FTDI_RELAIS_PID 0xFA10 /* Relais device from Rudolf Gugler */
4850 +-#define FTDI_NF_RIC_VID 0x0DCD /* Vendor Id */
4851 +-#define FTDI_NF_RIC_PID 0x0001 /* Product Id */
4852 +-#define FTDI_USBX_707_PID 0xF857 /* ADSTech IR Blaster USBX-707 */
4853 +-
4854 +-/* Larsen and Brusgaard AltiTrack/USBtrack */
4855 +-#define LARSENBRUSGAARD_VID 0x0FD8
4856 +-#define LB_ALTITRACK_PID 0x0001
4857 +-
4858 +-/* www.canusb.com Lawicel CANUSB device */
4859 +-#define FTDI_CANUSB_PID 0xFFA8 /* Product Id */
4860 +-
4861 +-/* AlphaMicro Components AMC-232USB01 device */
4862 +-#define FTDI_AMC232_PID 0xFF00 /* Product Id */
4863 +-
4864 +-/* www.candapter.com Ewert Energy Systems CANdapter device */
4865 +-#define FTDI_CANDAPTER_PID 0x9F80 /* Product Id */
4866 +-
4867 +-/* SCS HF Radio Modems PID's (http://www.scs-ptc.com) */
4868 +-/* the VID is the standard ftdi vid (FTDI_VID) */
4869 +-#define FTDI_SCS_DEVICE_0_PID 0xD010 /* SCS PTC-IIusb */
4870 +-#define FTDI_SCS_DEVICE_1_PID 0xD011 /* SCS Tracker / DSP TNC */
4871 +-#define FTDI_SCS_DEVICE_2_PID 0xD012
4872 +-#define FTDI_SCS_DEVICE_3_PID 0xD013
4873 +-#define FTDI_SCS_DEVICE_4_PID 0xD014
4874 +-#define FTDI_SCS_DEVICE_5_PID 0xD015
4875 +-#define FTDI_SCS_DEVICE_6_PID 0xD016
4876 +-#define FTDI_SCS_DEVICE_7_PID 0xD017
4877 +-
4878 +-/* ACT Solutions HomePro ZWave interface (http://www.act-solutions.com/HomePro.htm) */
4879 +-#define FTDI_ACTZWAVE_PID 0xF2D0
4880 +-
4881 +-
4882 +-/* www.starting-point-systems.com µChameleon device */
4883 +-#define FTDI_MICRO_CHAMELEON_PID 0xCAA0 /* Product Id */
4884 +-
4885 +-/* www.irtrans.de device */
4886 +-#define FTDI_IRTRANS_PID 0xFC60 /* Product Id */
4887 +-
4888 +-
4889 +-/* www.thoughttechnology.com/ TT-USB provide with procomp use ftdi_sio */
4890 +-#define FTDI_TTUSB_PID 0xFF20 /* Product Id */
4891 +-
4892 +-/* iPlus device */
4893 +-#define FTDI_IPLUS_PID 0xD070 /* Product Id */
4894 +-#define FTDI_IPLUS2_PID 0xD071 /* Product Id */
4895 +-
4896 +-/* DMX4ALL DMX Interfaces */
4897 +-#define FTDI_DMX4ALL 0xC850
4898 +-
4899 +-/* OpenDCC (www.opendcc.de) product id */
4900 +-#define FTDI_OPENDCC_PID 0xBFD8
4901 +-#define FTDI_OPENDCC_SNIFFER_PID 0xBFD9
4902 +-#define FTDI_OPENDCC_THROTTLE_PID 0xBFDA
4903 +-#define FTDI_OPENDCC_GATEWAY_PID 0xBFDB
4904 +-
4905 +-/* Sprog II (Andrew Crosland's SprogII DCC interface) */
4906 +-#define FTDI_SPROG_II 0xF0C8
4907 +-
4908 +-/* www.crystalfontz.com devices - thanx for providing free devices for evaluation ! */
4909 +-/* they use the ftdi chipset for the USB interface and the vendor id is the same */
4910 +-#define FTDI_XF_632_PID 0xFC08 /* 632: 16x2 Character Display */
4911 +-#define FTDI_XF_634_PID 0xFC09 /* 634: 20x4 Character Display */
4912 +-#define FTDI_XF_547_PID 0xFC0A /* 547: Two line Display */
4913 +-#define FTDI_XF_633_PID 0xFC0B /* 633: 16x2 Character Display with Keys */
4914 +-#define FTDI_XF_631_PID 0xFC0C /* 631: 20x2 Character Display */
4915 +-#define FTDI_XF_635_PID 0xFC0D /* 635: 20x4 Character Display */
4916 +-#define FTDI_XF_640_PID 0xFC0E /* 640: Two line Display */
4917 +-#define FTDI_XF_642_PID 0xFC0F /* 642: Two line Display */
4918 +-
4919 +-/* Video Networks Limited / Homechoice in the UK use an ftdi-based device for their 1Mb */
4920 +-/* broadband internet service. The following PID is exhibited by the usb device supplied */
4921 +-/* (the VID is the standard ftdi vid (FTDI_VID) */
4922 +-#define FTDI_VNHCPCUSB_D_PID 0xfe38 /* Product Id */
4923 +-
4924 +-/*
4925 +- * PCDJ use ftdi based dj-controllers. The following PID is for their DAC-2 device
4926 +- * http://www.pcdjhardware.com/DAC2.asp (PID sent by Wouter Paesen)
4927 +- * (the VID is the standard ftdi vid (FTDI_VID) */
4928 +-#define FTDI_PCDJ_DAC2_PID 0xFA88
4929 +-
4930 +-/*
4931 +- * The following are the values for the Matrix Orbital LCD displays,
4932 +- * which are the FT232BM ( similar to the 8U232AM )
4933 +- */
4934 +-#define FTDI_MTXORB_0_PID 0xFA00 /* Matrix Orbital Product Id */
4935 +-#define FTDI_MTXORB_1_PID 0xFA01 /* Matrix Orbital Product Id */
4936 +-#define FTDI_MTXORB_2_PID 0xFA02 /* Matrix Orbital Product Id */
4937 +-#define FTDI_MTXORB_3_PID 0xFA03 /* Matrix Orbital Product Id */
4938 +-#define FTDI_MTXORB_4_PID 0xFA04 /* Matrix Orbital Product Id */
4939 +-#define FTDI_MTXORB_5_PID 0xFA05 /* Matrix Orbital Product Id */
4940 +-#define FTDI_MTXORB_6_PID 0xFA06 /* Matrix Orbital Product Id */
4941 +-
4942 +-/* OOCDlink by Joern Kaipf <joernk@×××.de>
4943 +- * (http://www.joernonline.de/dw/doku.php?id=start&idx=projects:oocdlink) */
4944 +-#define FTDI_OOCDLINK_PID 0xbaf8 /* Amontec JTAGkey */
4945 +-
4946 +-/*
4947 +- * The following are the values for the Matrix Orbital FTDI Range
4948 +- * Anything in this range will use an FT232RL.
4949 +- */
4950 +-#define MTXORB_VID 0x1B3D
4951 +-#define MTXORB_FTDI_RANGE_0100_PID 0x0100
4952 +-#define MTXORB_FTDI_RANGE_0101_PID 0x0101
4953 +-#define MTXORB_FTDI_RANGE_0102_PID 0x0102
4954 +-#define MTXORB_FTDI_RANGE_0103_PID 0x0103
4955 +-#define MTXORB_FTDI_RANGE_0104_PID 0x0104
4956 +-#define MTXORB_FTDI_RANGE_0105_PID 0x0105
4957 +-#define MTXORB_FTDI_RANGE_0106_PID 0x0106
4958 +-#define MTXORB_FTDI_RANGE_0107_PID 0x0107
4959 +-#define MTXORB_FTDI_RANGE_0108_PID 0x0108
4960 +-#define MTXORB_FTDI_RANGE_0109_PID 0x0109
4961 +-#define MTXORB_FTDI_RANGE_010A_PID 0x010A
4962 +-#define MTXORB_FTDI_RANGE_010B_PID 0x010B
4963 +-#define MTXORB_FTDI_RANGE_010C_PID 0x010C
4964 +-#define MTXORB_FTDI_RANGE_010D_PID 0x010D
4965 +-#define MTXORB_FTDI_RANGE_010E_PID 0x010E
4966 +-#define MTXORB_FTDI_RANGE_010F_PID 0x010F
4967 +-#define MTXORB_FTDI_RANGE_0110_PID 0x0110
4968 +-#define MTXORB_FTDI_RANGE_0111_PID 0x0111
4969 +-#define MTXORB_FTDI_RANGE_0112_PID 0x0112
4970 +-#define MTXORB_FTDI_RANGE_0113_PID 0x0113
4971 +-#define MTXORB_FTDI_RANGE_0114_PID 0x0114
4972 +-#define MTXORB_FTDI_RANGE_0115_PID 0x0115
4973 +-#define MTXORB_FTDI_RANGE_0116_PID 0x0116
4974 +-#define MTXORB_FTDI_RANGE_0117_PID 0x0117
4975 +-#define MTXORB_FTDI_RANGE_0118_PID 0x0118
4976 +-#define MTXORB_FTDI_RANGE_0119_PID 0x0119
4977 +-#define MTXORB_FTDI_RANGE_011A_PID 0x011A
4978 +-#define MTXORB_FTDI_RANGE_011B_PID 0x011B
4979 +-#define MTXORB_FTDI_RANGE_011C_PID 0x011C
4980 +-#define MTXORB_FTDI_RANGE_011D_PID 0x011D
4981 +-#define MTXORB_FTDI_RANGE_011E_PID 0x011E
4982 +-#define MTXORB_FTDI_RANGE_011F_PID 0x011F
4983 +-#define MTXORB_FTDI_RANGE_0120_PID 0x0120
4984 +-#define MTXORB_FTDI_RANGE_0121_PID 0x0121
4985 +-#define MTXORB_FTDI_RANGE_0122_PID 0x0122
4986 +-#define MTXORB_FTDI_RANGE_0123_PID 0x0123
4987 +-#define MTXORB_FTDI_RANGE_0124_PID 0x0124
4988 +-#define MTXORB_FTDI_RANGE_0125_PID 0x0125
4989 +-#define MTXORB_FTDI_RANGE_0126_PID 0x0126
4990 +-#define MTXORB_FTDI_RANGE_0127_PID 0x0127
4991 +-#define MTXORB_FTDI_RANGE_0128_PID 0x0128
4992 +-#define MTXORB_FTDI_RANGE_0129_PID 0x0129
4993 +-#define MTXORB_FTDI_RANGE_012A_PID 0x012A
4994 +-#define MTXORB_FTDI_RANGE_012B_PID 0x012B
4995 +-#define MTXORB_FTDI_RANGE_012C_PID 0x012C
4996 +-#define MTXORB_FTDI_RANGE_012D_PID 0x012D
4997 +-#define MTXORB_FTDI_RANGE_012E_PID 0x012E
4998 +-#define MTXORB_FTDI_RANGE_012F_PID 0x012F
4999 +-#define MTXORB_FTDI_RANGE_0130_PID 0x0130
5000 +-#define MTXORB_FTDI_RANGE_0131_PID 0x0131
5001 +-#define MTXORB_FTDI_RANGE_0132_PID 0x0132
5002 +-#define MTXORB_FTDI_RANGE_0133_PID 0x0133
5003 +-#define MTXORB_FTDI_RANGE_0134_PID 0x0134
5004 +-#define MTXORB_FTDI_RANGE_0135_PID 0x0135
5005 +-#define MTXORB_FTDI_RANGE_0136_PID 0x0136
5006 +-#define MTXORB_FTDI_RANGE_0137_PID 0x0137
5007 +-#define MTXORB_FTDI_RANGE_0138_PID 0x0138
5008 +-#define MTXORB_FTDI_RANGE_0139_PID 0x0139
5009 +-#define MTXORB_FTDI_RANGE_013A_PID 0x013A
5010 +-#define MTXORB_FTDI_RANGE_013B_PID 0x013B
5011 +-#define MTXORB_FTDI_RANGE_013C_PID 0x013C
5012 +-#define MTXORB_FTDI_RANGE_013D_PID 0x013D
5013 +-#define MTXORB_FTDI_RANGE_013E_PID 0x013E
5014 +-#define MTXORB_FTDI_RANGE_013F_PID 0x013F
5015 +-#define MTXORB_FTDI_RANGE_0140_PID 0x0140
5016 +-#define MTXORB_FTDI_RANGE_0141_PID 0x0141
5017 +-#define MTXORB_FTDI_RANGE_0142_PID 0x0142
5018 +-#define MTXORB_FTDI_RANGE_0143_PID 0x0143
5019 +-#define MTXORB_FTDI_RANGE_0144_PID 0x0144
5020 +-#define MTXORB_FTDI_RANGE_0145_PID 0x0145
5021 +-#define MTXORB_FTDI_RANGE_0146_PID 0x0146
5022 +-#define MTXORB_FTDI_RANGE_0147_PID 0x0147
5023 +-#define MTXORB_FTDI_RANGE_0148_PID 0x0148
5024 +-#define MTXORB_FTDI_RANGE_0149_PID 0x0149
5025 +-#define MTXORB_FTDI_RANGE_014A_PID 0x014A
5026 +-#define MTXORB_FTDI_RANGE_014B_PID 0x014B
5027 +-#define MTXORB_FTDI_RANGE_014C_PID 0x014C
5028 +-#define MTXORB_FTDI_RANGE_014D_PID 0x014D
5029 +-#define MTXORB_FTDI_RANGE_014E_PID 0x014E
5030 +-#define MTXORB_FTDI_RANGE_014F_PID 0x014F
5031 +-#define MTXORB_FTDI_RANGE_0150_PID 0x0150
5032 +-#define MTXORB_FTDI_RANGE_0151_PID 0x0151
5033 +-#define MTXORB_FTDI_RANGE_0152_PID 0x0152
5034 +-#define MTXORB_FTDI_RANGE_0153_PID 0x0153
5035 +-#define MTXORB_FTDI_RANGE_0154_PID 0x0154
5036 +-#define MTXORB_FTDI_RANGE_0155_PID 0x0155
5037 +-#define MTXORB_FTDI_RANGE_0156_PID 0x0156
5038 +-#define MTXORB_FTDI_RANGE_0157_PID 0x0157
5039 +-#define MTXORB_FTDI_RANGE_0158_PID 0x0158
5040 +-#define MTXORB_FTDI_RANGE_0159_PID 0x0159
5041 +-#define MTXORB_FTDI_RANGE_015A_PID 0x015A
5042 +-#define MTXORB_FTDI_RANGE_015B_PID 0x015B
5043 +-#define MTXORB_FTDI_RANGE_015C_PID 0x015C
5044 +-#define MTXORB_FTDI_RANGE_015D_PID 0x015D
5045 +-#define MTXORB_FTDI_RANGE_015E_PID 0x015E
5046 +-#define MTXORB_FTDI_RANGE_015F_PID 0x015F
5047 +-#define MTXORB_FTDI_RANGE_0160_PID 0x0160
5048 +-#define MTXORB_FTDI_RANGE_0161_PID 0x0161
5049 +-#define MTXORB_FTDI_RANGE_0162_PID 0x0162
5050 +-#define MTXORB_FTDI_RANGE_0163_PID 0x0163
5051 +-#define MTXORB_FTDI_RANGE_0164_PID 0x0164
5052 +-#define MTXORB_FTDI_RANGE_0165_PID 0x0165
5053 +-#define MTXORB_FTDI_RANGE_0166_PID 0x0166
5054 +-#define MTXORB_FTDI_RANGE_0167_PID 0x0167
5055 +-#define MTXORB_FTDI_RANGE_0168_PID 0x0168
5056 +-#define MTXORB_FTDI_RANGE_0169_PID 0x0169
5057 +-#define MTXORB_FTDI_RANGE_016A_PID 0x016A
5058 +-#define MTXORB_FTDI_RANGE_016B_PID 0x016B
5059 +-#define MTXORB_FTDI_RANGE_016C_PID 0x016C
5060 +-#define MTXORB_FTDI_RANGE_016D_PID 0x016D
5061 +-#define MTXORB_FTDI_RANGE_016E_PID 0x016E
5062 +-#define MTXORB_FTDI_RANGE_016F_PID 0x016F
5063 +-#define MTXORB_FTDI_RANGE_0170_PID 0x0170
5064 +-#define MTXORB_FTDI_RANGE_0171_PID 0x0171
5065 +-#define MTXORB_FTDI_RANGE_0172_PID 0x0172
5066 +-#define MTXORB_FTDI_RANGE_0173_PID 0x0173
5067 +-#define MTXORB_FTDI_RANGE_0174_PID 0x0174
5068 +-#define MTXORB_FTDI_RANGE_0175_PID 0x0175
5069 +-#define MTXORB_FTDI_RANGE_0176_PID 0x0176
5070 +-#define MTXORB_FTDI_RANGE_0177_PID 0x0177
5071 +-#define MTXORB_FTDI_RANGE_0178_PID 0x0178
5072 +-#define MTXORB_FTDI_RANGE_0179_PID 0x0179
5073 +-#define MTXORB_FTDI_RANGE_017A_PID 0x017A
5074 +-#define MTXORB_FTDI_RANGE_017B_PID 0x017B
5075 +-#define MTXORB_FTDI_RANGE_017C_PID 0x017C
5076 +-#define MTXORB_FTDI_RANGE_017D_PID 0x017D
5077 +-#define MTXORB_FTDI_RANGE_017E_PID 0x017E
5078 +-#define MTXORB_FTDI_RANGE_017F_PID 0x017F
5079 +-#define MTXORB_FTDI_RANGE_0180_PID 0x0180
5080 +-#define MTXORB_FTDI_RANGE_0181_PID 0x0181
5081 +-#define MTXORB_FTDI_RANGE_0182_PID 0x0182
5082 +-#define MTXORB_FTDI_RANGE_0183_PID 0x0183
5083 +-#define MTXORB_FTDI_RANGE_0184_PID 0x0184
5084 +-#define MTXORB_FTDI_RANGE_0185_PID 0x0185
5085 +-#define MTXORB_FTDI_RANGE_0186_PID 0x0186
5086 +-#define MTXORB_FTDI_RANGE_0187_PID 0x0187
5087 +-#define MTXORB_FTDI_RANGE_0188_PID 0x0188
5088 +-#define MTXORB_FTDI_RANGE_0189_PID 0x0189
5089 +-#define MTXORB_FTDI_RANGE_018A_PID 0x018A
5090 +-#define MTXORB_FTDI_RANGE_018B_PID 0x018B
5091 +-#define MTXORB_FTDI_RANGE_018C_PID 0x018C
5092 +-#define MTXORB_FTDI_RANGE_018D_PID 0x018D
5093 +-#define MTXORB_FTDI_RANGE_018E_PID 0x018E
5094 +-#define MTXORB_FTDI_RANGE_018F_PID 0x018F
5095 +-#define MTXORB_FTDI_RANGE_0190_PID 0x0190
5096 +-#define MTXORB_FTDI_RANGE_0191_PID 0x0191
5097 +-#define MTXORB_FTDI_RANGE_0192_PID 0x0192
5098 +-#define MTXORB_FTDI_RANGE_0193_PID 0x0193
5099 +-#define MTXORB_FTDI_RANGE_0194_PID 0x0194
5100 +-#define MTXORB_FTDI_RANGE_0195_PID 0x0195
5101 +-#define MTXORB_FTDI_RANGE_0196_PID 0x0196
5102 +-#define MTXORB_FTDI_RANGE_0197_PID 0x0197
5103 +-#define MTXORB_FTDI_RANGE_0198_PID 0x0198
5104 +-#define MTXORB_FTDI_RANGE_0199_PID 0x0199
5105 +-#define MTXORB_FTDI_RANGE_019A_PID 0x019A
5106 +-#define MTXORB_FTDI_RANGE_019B_PID 0x019B
5107 +-#define MTXORB_FTDI_RANGE_019C_PID 0x019C
5108 +-#define MTXORB_FTDI_RANGE_019D_PID 0x019D
5109 +-#define MTXORB_FTDI_RANGE_019E_PID 0x019E
5110 +-#define MTXORB_FTDI_RANGE_019F_PID 0x019F
5111 +-#define MTXORB_FTDI_RANGE_01A0_PID 0x01A0
5112 +-#define MTXORB_FTDI_RANGE_01A1_PID 0x01A1
5113 +-#define MTXORB_FTDI_RANGE_01A2_PID 0x01A2
5114 +-#define MTXORB_FTDI_RANGE_01A3_PID 0x01A3
5115 +-#define MTXORB_FTDI_RANGE_01A4_PID 0x01A4
5116 +-#define MTXORB_FTDI_RANGE_01A5_PID 0x01A5
5117 +-#define MTXORB_FTDI_RANGE_01A6_PID 0x01A6
5118 +-#define MTXORB_FTDI_RANGE_01A7_PID 0x01A7
5119 +-#define MTXORB_FTDI_RANGE_01A8_PID 0x01A8
5120 +-#define MTXORB_FTDI_RANGE_01A9_PID 0x01A9
5121 +-#define MTXORB_FTDI_RANGE_01AA_PID 0x01AA
5122 +-#define MTXORB_FTDI_RANGE_01AB_PID 0x01AB
5123 +-#define MTXORB_FTDI_RANGE_01AC_PID 0x01AC
5124 +-#define MTXORB_FTDI_RANGE_01AD_PID 0x01AD
5125 +-#define MTXORB_FTDI_RANGE_01AE_PID 0x01AE
5126 +-#define MTXORB_FTDI_RANGE_01AF_PID 0x01AF
5127 +-#define MTXORB_FTDI_RANGE_01B0_PID 0x01B0
5128 +-#define MTXORB_FTDI_RANGE_01B1_PID 0x01B1
5129 +-#define MTXORB_FTDI_RANGE_01B2_PID 0x01B2
5130 +-#define MTXORB_FTDI_RANGE_01B3_PID 0x01B3
5131 +-#define MTXORB_FTDI_RANGE_01B4_PID 0x01B4
5132 +-#define MTXORB_FTDI_RANGE_01B5_PID 0x01B5
5133 +-#define MTXORB_FTDI_RANGE_01B6_PID 0x01B6
5134 +-#define MTXORB_FTDI_RANGE_01B7_PID 0x01B7
5135 +-#define MTXORB_FTDI_RANGE_01B8_PID 0x01B8
5136 +-#define MTXORB_FTDI_RANGE_01B9_PID 0x01B9
5137 +-#define MTXORB_FTDI_RANGE_01BA_PID 0x01BA
5138 +-#define MTXORB_FTDI_RANGE_01BB_PID 0x01BB
5139 +-#define MTXORB_FTDI_RANGE_01BC_PID 0x01BC
5140 +-#define MTXORB_FTDI_RANGE_01BD_PID 0x01BD
5141 +-#define MTXORB_FTDI_RANGE_01BE_PID 0x01BE
5142 +-#define MTXORB_FTDI_RANGE_01BF_PID 0x01BF
5143 +-#define MTXORB_FTDI_RANGE_01C0_PID 0x01C0
5144 +-#define MTXORB_FTDI_RANGE_01C1_PID 0x01C1
5145 +-#define MTXORB_FTDI_RANGE_01C2_PID 0x01C2
5146 +-#define MTXORB_FTDI_RANGE_01C3_PID 0x01C3
5147 +-#define MTXORB_FTDI_RANGE_01C4_PID 0x01C4
5148 +-#define MTXORB_FTDI_RANGE_01C5_PID 0x01C5
5149 +-#define MTXORB_FTDI_RANGE_01C6_PID 0x01C6
5150 +-#define MTXORB_FTDI_RANGE_01C7_PID 0x01C7
5151 +-#define MTXORB_FTDI_RANGE_01C8_PID 0x01C8
5152 +-#define MTXORB_FTDI_RANGE_01C9_PID 0x01C9
5153 +-#define MTXORB_FTDI_RANGE_01CA_PID 0x01CA
5154 +-#define MTXORB_FTDI_RANGE_01CB_PID 0x01CB
5155 +-#define MTXORB_FTDI_RANGE_01CC_PID 0x01CC
5156 +-#define MTXORB_FTDI_RANGE_01CD_PID 0x01CD
5157 +-#define MTXORB_FTDI_RANGE_01CE_PID 0x01CE
5158 +-#define MTXORB_FTDI_RANGE_01CF_PID 0x01CF
5159 +-#define MTXORB_FTDI_RANGE_01D0_PID 0x01D0
5160 +-#define MTXORB_FTDI_RANGE_01D1_PID 0x01D1
5161 +-#define MTXORB_FTDI_RANGE_01D2_PID 0x01D2
5162 +-#define MTXORB_FTDI_RANGE_01D3_PID 0x01D3
5163 +-#define MTXORB_FTDI_RANGE_01D4_PID 0x01D4
5164 +-#define MTXORB_FTDI_RANGE_01D5_PID 0x01D5
5165 +-#define MTXORB_FTDI_RANGE_01D6_PID 0x01D6
5166 +-#define MTXORB_FTDI_RANGE_01D7_PID 0x01D7
5167 +-#define MTXORB_FTDI_RANGE_01D8_PID 0x01D8
5168 +-#define MTXORB_FTDI_RANGE_01D9_PID 0x01D9
5169 +-#define MTXORB_FTDI_RANGE_01DA_PID 0x01DA
5170 +-#define MTXORB_FTDI_RANGE_01DB_PID 0x01DB
5171 +-#define MTXORB_FTDI_RANGE_01DC_PID 0x01DC
5172 +-#define MTXORB_FTDI_RANGE_01DD_PID 0x01DD
5173 +-#define MTXORB_FTDI_RANGE_01DE_PID 0x01DE
5174 +-#define MTXORB_FTDI_RANGE_01DF_PID 0x01DF
5175 +-#define MTXORB_FTDI_RANGE_01E0_PID 0x01E0
5176 +-#define MTXORB_FTDI_RANGE_01E1_PID 0x01E1
5177 +-#define MTXORB_FTDI_RANGE_01E2_PID 0x01E2
5178 +-#define MTXORB_FTDI_RANGE_01E3_PID 0x01E3
5179 +-#define MTXORB_FTDI_RANGE_01E4_PID 0x01E4
5180 +-#define MTXORB_FTDI_RANGE_01E5_PID 0x01E5
5181 +-#define MTXORB_FTDI_RANGE_01E6_PID 0x01E6
5182 +-#define MTXORB_FTDI_RANGE_01E7_PID 0x01E7
5183 +-#define MTXORB_FTDI_RANGE_01E8_PID 0x01E8
5184 +-#define MTXORB_FTDI_RANGE_01E9_PID 0x01E9
5185 +-#define MTXORB_FTDI_RANGE_01EA_PID 0x01EA
5186 +-#define MTXORB_FTDI_RANGE_01EB_PID 0x01EB
5187 +-#define MTXORB_FTDI_RANGE_01EC_PID 0x01EC
5188 +-#define MTXORB_FTDI_RANGE_01ED_PID 0x01ED
5189 +-#define MTXORB_FTDI_RANGE_01EE_PID 0x01EE
5190 +-#define MTXORB_FTDI_RANGE_01EF_PID 0x01EF
5191 +-#define MTXORB_FTDI_RANGE_01F0_PID 0x01F0
5192 +-#define MTXORB_FTDI_RANGE_01F1_PID 0x01F1
5193 +-#define MTXORB_FTDI_RANGE_01F2_PID 0x01F2
5194 +-#define MTXORB_FTDI_RANGE_01F3_PID 0x01F3
5195 +-#define MTXORB_FTDI_RANGE_01F4_PID 0x01F4
5196 +-#define MTXORB_FTDI_RANGE_01F5_PID 0x01F5
5197 +-#define MTXORB_FTDI_RANGE_01F6_PID 0x01F6
5198 +-#define MTXORB_FTDI_RANGE_01F7_PID 0x01F7
5199 +-#define MTXORB_FTDI_RANGE_01F8_PID 0x01F8
5200 +-#define MTXORB_FTDI_RANGE_01F9_PID 0x01F9
5201 +-#define MTXORB_FTDI_RANGE_01FA_PID 0x01FA
5202 +-#define MTXORB_FTDI_RANGE_01FB_PID 0x01FB
5203 +-#define MTXORB_FTDI_RANGE_01FC_PID 0x01FC
5204 +-#define MTXORB_FTDI_RANGE_01FD_PID 0x01FD
5205 +-#define MTXORB_FTDI_RANGE_01FE_PID 0x01FE
5206 +-#define MTXORB_FTDI_RANGE_01FF_PID 0x01FF
5207 +-
5208 +-
5209 +-
5210 +-/* Interbiometrics USB I/O Board */
5211 +-/* Developed for Interbiometrics by Rudolf Gugler */
5212 +-#define INTERBIOMETRICS_VID 0x1209
5213 +-#define INTERBIOMETRICS_IOBOARD_PID 0x1002
5214 +-#define INTERBIOMETRICS_MINI_IOBOARD_PID 0x1006
5215 +-
5216 +-/*
5217 +- * The following are the values for the Perle Systems
5218 +- * UltraPort USB serial converters
5219 +- */
5220 +-#define FTDI_PERLE_ULTRAPORT_PID 0xF0C0 /* Perle UltraPort Product Id */
5221 +-
5222 +-/*
5223 +- * The following are the values for the Sealevel SeaLINK+ adapters.
5224 +- * (Original list sent by Tuan Hoang. Ian Abbott renamed the macros and
5225 +- * removed some PIDs that don't seem to match any existing products.)
5226 +- */
5227 +-#define SEALEVEL_VID 0x0c52 /* Sealevel Vendor ID */
5228 +-#define SEALEVEL_2101_PID 0x2101 /* SeaLINK+232 (2101/2105) */
5229 +-#define SEALEVEL_2102_PID 0x2102 /* SeaLINK+485 (2102) */
5230 +-#define SEALEVEL_2103_PID 0x2103 /* SeaLINK+232I (2103) */
5231 +-#define SEALEVEL_2104_PID 0x2104 /* SeaLINK+485I (2104) */
5232 +-#define SEALEVEL_2106_PID 0x9020 /* SeaLINK+422 (2106) */
5233 +-#define SEALEVEL_2201_1_PID 0x2211 /* SeaPORT+2/232 (2201) Port 1 */
5234 +-#define SEALEVEL_2201_2_PID 0x2221 /* SeaPORT+2/232 (2201) Port 2 */
5235 +-#define SEALEVEL_2202_1_PID 0x2212 /* SeaPORT+2/485 (2202) Port 1 */
5236 +-#define SEALEVEL_2202_2_PID 0x2222 /* SeaPORT+2/485 (2202) Port 2 */
5237 +-#define SEALEVEL_2203_1_PID 0x2213 /* SeaPORT+2 (2203) Port 1 */
5238 +-#define SEALEVEL_2203_2_PID 0x2223 /* SeaPORT+2 (2203) Port 2 */
5239 +-#define SEALEVEL_2401_1_PID 0x2411 /* SeaPORT+4/232 (2401) Port 1 */
5240 +-#define SEALEVEL_2401_2_PID 0x2421 /* SeaPORT+4/232 (2401) Port 2 */
5241 +-#define SEALEVEL_2401_3_PID 0x2431 /* SeaPORT+4/232 (2401) Port 3 */
5242 +-#define SEALEVEL_2401_4_PID 0x2441 /* SeaPORT+4/232 (2401) Port 4 */
5243 +-#define SEALEVEL_2402_1_PID 0x2412 /* SeaPORT+4/485 (2402) Port 1 */
5244 +-#define SEALEVEL_2402_2_PID 0x2422 /* SeaPORT+4/485 (2402) Port 2 */
5245 +-#define SEALEVEL_2402_3_PID 0x2432 /* SeaPORT+4/485 (2402) Port 3 */
5246 +-#define SEALEVEL_2402_4_PID 0x2442 /* SeaPORT+4/485 (2402) Port 4 */
5247 +-#define SEALEVEL_2403_1_PID 0x2413 /* SeaPORT+4 (2403) Port 1 */
5248 +-#define SEALEVEL_2403_2_PID 0x2423 /* SeaPORT+4 (2403) Port 2 */
5249 +-#define SEALEVEL_2403_3_PID 0x2433 /* SeaPORT+4 (2403) Port 3 */
5250 +-#define SEALEVEL_2403_4_PID 0x2443 /* SeaPORT+4 (2403) Port 4 */
5251 +-#define SEALEVEL_2801_1_PID 0X2811 /* SeaLINK+8/232 (2801) Port 1 */
5252 +-#define SEALEVEL_2801_2_PID 0X2821 /* SeaLINK+8/232 (2801) Port 2 */
5253 +-#define SEALEVEL_2801_3_PID 0X2831 /* SeaLINK+8/232 (2801) Port 3 */
5254 +-#define SEALEVEL_2801_4_PID 0X2841 /* SeaLINK+8/232 (2801) Port 4 */
5255 +-#define SEALEVEL_2801_5_PID 0X2851 /* SeaLINK+8/232 (2801) Port 5 */
5256 +-#define SEALEVEL_2801_6_PID 0X2861 /* SeaLINK+8/232 (2801) Port 6 */
5257 +-#define SEALEVEL_2801_7_PID 0X2871 /* SeaLINK+8/232 (2801) Port 7 */
5258 +-#define SEALEVEL_2801_8_PID 0X2881 /* SeaLINK+8/232 (2801) Port 8 */
5259 +-#define SEALEVEL_2802_1_PID 0X2812 /* SeaLINK+8/485 (2802) Port 1 */
5260 +-#define SEALEVEL_2802_2_PID 0X2822 /* SeaLINK+8/485 (2802) Port 2 */
5261 +-#define SEALEVEL_2802_3_PID 0X2832 /* SeaLINK+8/485 (2802) Port 3 */
5262 +-#define SEALEVEL_2802_4_PID 0X2842 /* SeaLINK+8/485 (2802) Port 4 */
5263 +-#define SEALEVEL_2802_5_PID 0X2852 /* SeaLINK+8/485 (2802) Port 5 */
5264 +-#define SEALEVEL_2802_6_PID 0X2862 /* SeaLINK+8/485 (2802) Port 6 */
5265 +-#define SEALEVEL_2802_7_PID 0X2872 /* SeaLINK+8/485 (2802) Port 7 */
5266 +-#define SEALEVEL_2802_8_PID 0X2882 /* SeaLINK+8/485 (2802) Port 8 */
5267 +-#define SEALEVEL_2803_1_PID 0X2813 /* SeaLINK+8 (2803) Port 1 */
5268 +-#define SEALEVEL_2803_2_PID 0X2823 /* SeaLINK+8 (2803) Port 2 */
5269 +-#define SEALEVEL_2803_3_PID 0X2833 /* SeaLINK+8 (2803) Port 3 */
5270 +-#define SEALEVEL_2803_4_PID 0X2843 /* SeaLINK+8 (2803) Port 4 */
5271 +-#define SEALEVEL_2803_5_PID 0X2853 /* SeaLINK+8 (2803) Port 5 */
5272 +-#define SEALEVEL_2803_6_PID 0X2863 /* SeaLINK+8 (2803) Port 6 */
5273 +-#define SEALEVEL_2803_7_PID 0X2873 /* SeaLINK+8 (2803) Port 7 */
5274 +-#define SEALEVEL_2803_8_PID 0X2883 /* SeaLINK+8 (2803) Port 8 */
5275 +-
5276 +-/*
5277 +- * The following are the values for two KOBIL chipcard terminals.
5278 +- */
5279 +-#define KOBIL_VID 0x0d46 /* KOBIL Vendor ID */
5280 +-#define KOBIL_CONV_B1_PID 0x2020 /* KOBIL Konverter for B1 */
5281 +-#define KOBIL_CONV_KAAN_PID 0x2021 /* KOBIL_Konverter for KAAN */
5282 +-
5283 +-/*
5284 +- * Icom ID-1 digital transceiver
5285 +- */
5286 +-
5287 +-#define ICOM_ID1_VID 0x0C26
5288 +-#define ICOM_ID1_PID 0x0004
5289 +-
5290 +-/*
5291 +- * ASK.fr devices
5292 +- */
5293 +-#define FTDI_ASK_RDR400_PID 0xC991 /* ASK RDR 400 series card reader */
5294 +-
5295 +-/*
5296 +- * FTDI USB UART chips used in construction projects from the
5297 +- * Elektor Electronics magazine (http://elektor-electronics.co.uk)
5298 +- */
5299 +-#define ELEKTOR_VID 0x0C7D
5300 +-#define ELEKTOR_FT323R_PID 0x0005 /* RFID-Reader, issue 09-2006 */
5301 +-
5302 +-/*
5303 +- * DSS-20 Sync Station for Sony Ericsson P800
5304 +- */
5305 +-#define FTDI_DSS20_PID 0xFC82
5306 +-
5307 +-/*
5308 +- * Home Electronics (www.home-electro.com) USB gadgets
5309 +- */
5310 +-#define FTDI_HE_TIRA1_PID 0xFA78 /* Tira-1 IR transceiver */
5311 +-
5312 +-/* USB-UIRT - An infrared receiver and transmitter using the 8U232AM chip */
5313 +-/* http://home.earthlink.net/~jrhees/USBUIRT/index.htm */
5314 +-#define FTDI_USB_UIRT_PID 0xF850 /* Product Id */
5315 +-
5316 +-/* TNC-X USB-to-packet-radio adapter, versions prior to 3.0 (DLP module) */
5317 +-
5318 +-#define FTDI_TNC_X_PID 0xEBE0
5319 +-
5320 +-/*
5321 +- * ELV USB devices submitted by Christian Abt of ELV (www.elv.de).
5322 +- * All of these devices use FTDI's vendor ID (0x0403).
5323 +- *
5324 +- * The previously included PID for the UO 100 module was incorrect.
5325 +- * In fact, that PID was for ELV's UR 100 USB-RS232 converter (0xFB58).
5326 +- *
5327 +- * Armin Laeuger originally sent the PID for the UM 100 module.
5328 +- */
5329 +-#define FTDI_R2000KU_TRUE_RNG 0xFB80 /* R2000KU TRUE RNG */
5330 +-#define FTDI_ELV_UR100_PID 0xFB58 /* USB-RS232-Umsetzer (UR 100) */
5331 +-#define FTDI_ELV_UM100_PID 0xFB5A /* USB-Modul UM 100 */
5332 +-#define FTDI_ELV_UO100_PID 0xFB5B /* USB-Modul UO 100 */
5333 +-#define FTDI_ELV_ALC8500_PID 0xF06E /* ALC 8500 Expert */
5334 +-/* Additional ELV PIDs that default to using the FTDI D2XX drivers on
5335 +- * MS Windows, rather than the FTDI Virtual Com Port drivers.
5336 +- * Maybe these will be easier to use with the libftdi/libusb user-space
5337 +- * drivers, or possibly the Comedi drivers in some cases. */
5338 +-#define FTDI_ELV_CLI7000_PID 0xFB59 /* Computer-Light-Interface (CLI 7000) */
5339 +-#define FTDI_ELV_PPS7330_PID 0xFB5C /* Processor-Power-Supply (PPS 7330) */
5340 +-#define FTDI_ELV_TFM100_PID 0xFB5D /* Temperartur-Feuchte Messgeraet (TFM 100) */
5341 +-#define FTDI_ELV_UDF77_PID 0xFB5E /* USB DCF Funkurh (UDF 77) */
5342 +-#define FTDI_ELV_UIO88_PID 0xFB5F /* USB-I/O Interface (UIO 88) */
5343 +-#define FTDI_ELV_UAD8_PID 0xF068 /* USB-AD-Wandler (UAD 8) */
5344 +-#define FTDI_ELV_UDA7_PID 0xF069 /* USB-DA-Wandler (UDA 7) */
5345 +-#define FTDI_ELV_USI2_PID 0xF06A /* USB-Schrittmotoren-Interface (USI 2) */
5346 +-#define FTDI_ELV_T1100_PID 0xF06B /* Thermometer (T 1100) */
5347 +-#define FTDI_ELV_PCD200_PID 0xF06C /* PC-Datenlogger (PCD 200) */
5348 +-#define FTDI_ELV_ULA200_PID 0xF06D /* USB-LCD-Ansteuerung (ULA 200) */
5349 +-#define FTDI_ELV_FHZ1000PC_PID 0xF06F /* FHZ 1000 PC */
5350 +-#define FTDI_ELV_CSI8_PID 0xE0F0 /* Computer-Schalt-Interface (CSI 8) */
5351 +-#define FTDI_ELV_EM1000DL_PID 0xE0F1 /* PC-Datenlogger fuer Energiemonitor (EM 1000 DL) */
5352 +-#define FTDI_ELV_PCK100_PID 0xE0F2 /* PC-Kabeltester (PCK 100) */
5353 +-#define FTDI_ELV_RFP500_PID 0xE0F3 /* HF-Leistungsmesser (RFP 500) */
5354 +-#define FTDI_ELV_FS20SIG_PID 0xE0F4 /* Signalgeber (FS 20 SIG) */
5355 +-#define FTDI_ELV_WS300PC_PID 0xE0F6 /* PC-Wetterstation (WS 300 PC) */
5356 +-#define FTDI_ELV_FHZ1300PC_PID 0xE0E8 /* FHZ 1300 PC */
5357 +-#define FTDI_ELV_WS500_PID 0xE0E9 /* PC-Wetterstation (WS 500) */
5358 +-#define FTDI_ELV_HS485_PID 0xE0EA /* USB to RS-485 adapter */
5359 +-#define FTDI_ELV_EM1010PC_PID 0xE0EF /* Engery monitor EM 1010 PC */
5360 +-#define FTDI_PHI_FISCO_PID 0xE40B /* PHI Fisco USB to Serial cable */
5361 +-
5362 +-/*
5363 +- * Definitions for ID TECH (www.idt-net.com) devices
5364 +- */
5365 +-#define IDTECH_VID 0x0ACD /* ID TECH Vendor ID */
5366 +-#define IDTECH_IDT1221U_PID 0x0300 /* IDT1221U USB to RS-232 adapter */
5367 +-
5368 +-/*
5369 +- * Definitions for Omnidirectional Control Technology, Inc. devices
5370 +- */
5371 +-#define OCT_VID 0x0B39 /* OCT vendor ID */
5372 +-/* Note: OCT US101 is also rebadged as Dick Smith Electronics (NZ) XH6381 */
5373 +-/* Also rebadged as Dick Smith Electronics (Aus) XH6451 */
5374 +-/* Also rebadged as SIIG Inc. model US2308 hardware version 1 */
5375 +-#define OCT_US101_PID 0x0421 /* OCT US101 USB to RS-232 */
5376 +-
5377 +-/* an infrared receiver for user access control with IR tags */
5378 +-#define FTDI_PIEGROUP_PID 0xF208 /* Product Id */
5379 +-
5380 +-/*
5381 +- * Definitions for Artemis astronomical USB based cameras
5382 +- * Check it at http://www.artemisccd.co.uk/
5383 +- */
5384 +-#define FTDI_ARTEMIS_PID 0xDF28 /* All Artemis Cameras */
5385 +-
5386 +-/*
5387 +- * Definitions for ATIK Instruments astronomical USB based cameras
5388 +- * Check it at http://www.atik-instruments.com/
5389 +- */
5390 +-#define FTDI_ATIK_ATK16_PID 0xDF30 /* ATIK ATK-16 Grayscale Camera */
5391 +-#define FTDI_ATIK_ATK16C_PID 0xDF32 /* ATIK ATK-16C Colour Camera */
5392 +-#define FTDI_ATIK_ATK16HR_PID 0xDF31 /* ATIK ATK-16HR Grayscale Camera */
5393 +-#define FTDI_ATIK_ATK16HRC_PID 0xDF33 /* ATIK ATK-16HRC Colour Camera */
5394 +-#define FTDI_ATIK_ATK16IC_PID 0xDF35 /* ATIK ATK-16IC Grayscale Camera */
5395 +-
5396 +-/*
5397 +- * Protego product ids
5398 +- */
5399 +-#define PROTEGO_SPECIAL_1 0xFC70 /* special/unknown device */
5400 +-#define PROTEGO_R2X0 0xFC71 /* R200-USB TRNG unit (R210, R220, and R230) */
5401 +-#define PROTEGO_SPECIAL_3 0xFC72 /* special/unknown device */
5402 +-#define PROTEGO_SPECIAL_4 0xFC73 /* special/unknown device */
5403 +-
5404 +-/*
5405 +- * Gude Analog- und Digitalsysteme GmbH
5406 +- */
5407 +-#define FTDI_GUDEADS_E808_PID 0xE808
5408 +-#define FTDI_GUDEADS_E809_PID 0xE809
5409 +-#define FTDI_GUDEADS_E80A_PID 0xE80A
5410 +-#define FTDI_GUDEADS_E80B_PID 0xE80B
5411 +-#define FTDI_GUDEADS_E80C_PID 0xE80C
5412 +-#define FTDI_GUDEADS_E80D_PID 0xE80D
5413 +-#define FTDI_GUDEADS_E80E_PID 0xE80E
5414 +-#define FTDI_GUDEADS_E80F_PID 0xE80F
5415 +-#define FTDI_GUDEADS_E888_PID 0xE888 /* Expert ISDN Control USB */
5416 +-#define FTDI_GUDEADS_E889_PID 0xE889 /* USB RS-232 OptoBridge */
5417 +-#define FTDI_GUDEADS_E88A_PID 0xE88A
5418 +-#define FTDI_GUDEADS_E88B_PID 0xE88B
5419 +-#define FTDI_GUDEADS_E88C_PID 0xE88C
5420 +-#define FTDI_GUDEADS_E88D_PID 0xE88D
5421 +-#define FTDI_GUDEADS_E88E_PID 0xE88E
5422 +-#define FTDI_GUDEADS_E88F_PID 0xE88F
5423 +-
5424 +-/*
5425 +- * Linx Technologies product ids
5426 +- */
5427 +-#define LINX_SDMUSBQSS_PID 0xF448 /* Linx SDM-USB-QS-S */
5428 +-#define LINX_MASTERDEVEL2_PID 0xF449 /* Linx Master Development 2.0 */
5429 +-#define LINX_FUTURE_0_PID 0xF44A /* Linx future device */
5430 +-#define LINX_FUTURE_1_PID 0xF44B /* Linx future device */
5431 +-#define LINX_FUTURE_2_PID 0xF44C /* Linx future device */
5432 +-
5433 +-/* CCS Inc. ICDU/ICDU40 product ID - the FT232BM is used in an in-circuit-debugger */
5434 +-/* unit for PIC16's/PIC18's */
5435 +-#define FTDI_CCSICDU20_0_PID 0xF9D0
5436 +-#define FTDI_CCSICDU40_1_PID 0xF9D1
5437 +-#define FTDI_CCSMACHX_2_PID 0xF9D2
5438 +-#define FTDI_CCSLOAD_N_GO_3_PID 0xF9D3
5439 +-#define FTDI_CCSICDU64_4_PID 0xF9D4
5440 +-#define FTDI_CCSPRIME8_5_PID 0xF9D5
5441 +-
5442 +-/* Inside Accesso contactless reader (http://www.insidefr.com) */
5443 +-#define INSIDE_ACCESSO 0xFAD0
5444 +-
5445 +-/*
5446 +- * Intrepid Control Systems (http://www.intrepidcs.com/) ValueCAN and NeoVI
5447 +- */
5448 +-#define INTREPID_VID 0x093C
5449 +-#define INTREPID_VALUECAN_PID 0x0601
5450 +-#define INTREPID_NEOVI_PID 0x0701
5451 +-
5452 +-/*
5453 +- * Falcom Wireless Communications GmbH
5454 +- */
5455 +-#define FALCOM_VID 0x0F94 /* Vendor Id */
5456 +-#define FALCOM_TWIST_PID 0x0001 /* Falcom Twist USB GPRS modem */
5457 +-#define FALCOM_SAMBA_PID 0x0005 /* Falcom Samba USB GPRS modem */
5458 +-
5459 +-/*
5460 +- * SUUNTO product ids
5461 +- */
5462 +-#define FTDI_SUUNTO_SPORTS_PID 0xF680 /* Suunto Sports instrument */
5463 +-
5464 +-/*
5465 +- * Oceanic product ids
5466 +- */
5467 +-#define FTDI_OCEANIC_PID 0xF460 /* Oceanic dive instrument */
5468 +-
5469 +-/*
5470 +- * TTi (Thurlby Thandar Instruments)
5471 +- */
5472 +-#define TTI_VID 0x103E /* Vendor Id */
5473 +-#define TTI_QL355P_PID 0x03E8 /* TTi QL355P power supply */
5474 +-
5475 +-/*
5476 +- * Definitions for B&B Electronics products.
5477 +- */
5478 +-#define BANDB_VID 0x0856 /* B&B Electronics Vendor ID */
5479 +-#define BANDB_USOTL4_PID 0xAC01 /* USOTL4 Isolated RS-485 Converter */
5480 +-#define BANDB_USTL4_PID 0xAC02 /* USTL4 RS-485 Converter */
5481 +-#define BANDB_USO9ML2_PID 0xAC03 /* USO9ML2 Isolated RS-232 Converter */
5482 +-#define BANDB_USOPTL4_PID 0xAC11
5483 +-#define BANDB_USPTL4_PID 0xAC12
5484 +-#define BANDB_USO9ML2DR_2_PID 0xAC16
5485 +-#define BANDB_USO9ML2DR_PID 0xAC17
5486 +-#define BANDB_USOPTL4DR2_PID 0xAC18 /* USOPTL4R-2 2-port Isolated RS-232 Converter */
5487 +-#define BANDB_USOPTL4DR_PID 0xAC19
5488 +-#define BANDB_485USB9F_2W_PID 0xAC25
5489 +-#define BANDB_485USB9F_4W_PID 0xAC26
5490 +-#define BANDB_232USB9M_PID 0xAC27
5491 +-#define BANDB_485USBTB_2W_PID 0xAC33
5492 +-#define BANDB_485USBTB_4W_PID 0xAC34
5493 +-#define BANDB_TTL5USB9M_PID 0xAC49
5494 +-#define BANDB_TTL3USB9M_PID 0xAC50
5495 +-#define BANDB_ZZ_PROG1_USB_PID 0xBA02
5496 +-
5497 +-/*
5498 +- * RM Michaelides CANview USB (http://www.rmcan.com)
5499 +- * CAN fieldbus interface adapter, added by port GmbH www.port.de)
5500 +- * Ian Abbott changed the macro names for consistency.
5501 +- */
5502 +-#define FTDI_RM_CANVIEW_PID 0xfd60 /* Product Id */
5503 +-
5504 +-/*
5505 +- * EVER Eco Pro UPS (http://www.ever.com.pl/)
5506 +- */
5507 +-
5508 +-#define EVER_ECO_PRO_CDS 0xe520 /* RS-232 converter */
5509 +-
5510 +-/*
5511 +- * 4N-GALAXY.DE PIDs for CAN-USB, USB-RS232, USB-RS422, USB-RS485,
5512 +- * USB-TTY activ, USB-TTY passiv. Some PIDs are used by several devices
5513 +- * and I'm not entirely sure which are used by which.
5514 +- */
5515 +-#define FTDI_4N_GALAXY_DE_1_PID 0xF3C0
5516 +-#define FTDI_4N_GALAXY_DE_2_PID 0xF3C1
5517 +-
5518 +-/*
5519 +- * Mobility Electronics products.
5520 +- */
5521 +-#define MOBILITY_VID 0x1342
5522 +-#define MOBILITY_USB_SERIAL_PID 0x0202 /* EasiDock USB 200 serial */
5523 +-
5524 +-/*
5525 +- * microHAM product IDs (http://www.microham.com).
5526 +- * Submitted by Justin Burket (KL1RL) <zorton@××××.com>
5527 +- * and Mike Studer (K6EEP) <k6eep@×××××××××××.org>.
5528 +- * Ian Abbott <abbotti@××××××.uk> added a few more from the driver INF file.
5529 +- */
5530 +-#define FTDI_MHAM_KW_PID 0xEEE8 /* USB-KW interface */
5531 +-#define FTDI_MHAM_YS_PID 0xEEE9 /* USB-YS interface */
5532 +-#define FTDI_MHAM_Y6_PID 0xEEEA /* USB-Y6 interface */
5533 +-#define FTDI_MHAM_Y8_PID 0xEEEB /* USB-Y8 interface */
5534 +-#define FTDI_MHAM_IC_PID 0xEEEC /* USB-IC interface */
5535 +-#define FTDI_MHAM_DB9_PID 0xEEED /* USB-DB9 interface */
5536 +-#define FTDI_MHAM_RS232_PID 0xEEEE /* USB-RS232 interface */
5537 +-#define FTDI_MHAM_Y9_PID 0xEEEF /* USB-Y9 interface */
5538 +-
5539 +-/*
5540 +- * Active Robots product ids.
5541 +- */
5542 +-#define FTDI_ACTIVE_ROBOTS_PID 0xE548 /* USB comms board */
5543 +-
5544 +-/*
5545 +- * Xsens Technologies BV products (http://www.xsens.com).
5546 +- */
5547 +-#define XSENS_CONVERTER_0_PID 0xD388
5548 +-#define XSENS_CONVERTER_1_PID 0xD389
5549 +-#define XSENS_CONVERTER_2_PID 0xD38A
5550 +-#define XSENS_CONVERTER_3_PID 0xD38B
5551 +-#define XSENS_CONVERTER_4_PID 0xD38C
5552 +-#define XSENS_CONVERTER_5_PID 0xD38D
5553 +-#define XSENS_CONVERTER_6_PID 0xD38E
5554 +-#define XSENS_CONVERTER_7_PID 0xD38F
5555 +-
5556 +-/*
5557 +- * Teratronik product ids.
5558 +- * Submitted by O. Wölfelschneider.
5559 +- */
5560 +-#define FTDI_TERATRONIK_VCP_PID 0xEC88 /* Teratronik device (preferring VCP driver on windows) */
5561 +-#define FTDI_TERATRONIK_D2XX_PID 0xEC89 /* Teratronik device (preferring D2XX driver on windows) */
5562 +-
5563 +-/*
5564 +- * Evolution Robotics products (http://www.evolution.com/).
5565 +- * Submitted by Shawn M. Lavelle.
5566 +- */
5567 +-#define EVOLUTION_VID 0xDEEE /* Vendor ID */
5568 +-#define EVOLUTION_ER1_PID 0x0300 /* ER1 Control Module */
5569 +-#define EVO_8U232AM_PID 0x02FF /* Evolution robotics RCM2 (FT232AM)*/
5570 +-#define EVO_HYBRID_PID 0x0302 /* Evolution robotics RCM4 PID (FT232BM)*/
5571 +-#define EVO_RCM4_PID 0x0303 /* Evolution robotics RCM4 PID */
5572 +-
5573 +-/* Pyramid Computer GmbH */
5574 +-#define FTDI_PYRAMID_PID 0xE6C8 /* Pyramid Appliance Display */
5575 +-
5576 +-/*
5577 +- * NDI (www.ndigital.com) product ids
5578 +- */
5579 +-#define FTDI_NDI_HUC_PID 0xDA70 /* NDI Host USB Converter */
5580 +-#define FTDI_NDI_SPECTRA_SCU_PID 0xDA71 /* NDI Spectra SCU */
5581 +-#define FTDI_NDI_FUTURE_2_PID 0xDA72 /* NDI future device #2 */
5582 +-#define FTDI_NDI_FUTURE_3_PID 0xDA73 /* NDI future device #3 */
5583 +-#define FTDI_NDI_AURORA_SCU_PID 0xDA74 /* NDI Aurora SCU */
5584 +-
5585 +-/*
5586 +- * Posiflex inc retail equipment (http://www.posiflex.com.tw)
5587 +- */
5588 +-#define POSIFLEX_VID 0x0d3a /* Vendor ID */
5589 +-#define POSIFLEX_PP7000_PID 0x0300 /* PP-7000II thermal printer */
5590 +-
5591 +-/*
5592 +- * Westrex International devices submitted by Cory Lee
5593 +- */
5594 +-#define FTDI_WESTREX_MODEL_777_PID 0xDC00 /* Model 777 */
5595 +-#define FTDI_WESTREX_MODEL_8900F_PID 0xDC01 /* Model 8900F */
5596 +-
5597 +-/*
5598 +- * RR-CirKits LocoBuffer USB (http://www.rr-cirkits.com)
5599 +- */
5600 +-#define FTDI_RRCIRKITS_LOCOBUFFER_PID 0xc7d0 /* LocoBuffer USB */
5601 +-
5602 +-/*
5603 +- * Eclo (http://www.eclo.pt/) product IDs.
5604 +- * PID 0xEA90 submitted by Martin Grill.
5605 +- */
5606 +-#define FTDI_ECLO_COM_1WIRE_PID 0xEA90 /* COM to 1-Wire USB adaptor */
5607 +-
5608 +-/*
5609 +- * Papouch products (http://www.papouch.com/)
5610 +- * Submitted by Folkert van Heusden
5611 +- */
5612 +-
5613 +-#define PAPOUCH_VID 0x5050 /* Vendor ID */
5614 +-#define PAPOUCH_TMU_PID 0x0400 /* TMU USB Thermometer */
5615 +-#define PAPOUCH_QUIDO4x4_PID 0x0900 /* Quido 4/4 Module */
5616 +-
5617 +-/*
5618 +- * ACG Identification Technologies GmbH products (http://www.acg.de/).
5619 +- * Submitted by anton -at- goto10 -dot- org.
5620 + */
5621 +-#define FTDI_ACG_HFDUAL_PID 0xDD20 /* HF Dual ISO Reader (RFID) */
5622 +-
5623 +-/*
5624 +- * Yost Engineering, Inc. products (www.yostengineering.com).
5625 +- * PID 0xE050 submitted by Aaron Prose.
5626 +- */
5627 +-#define FTDI_YEI_SERVOCENTER31_PID 0xE050 /* YEI ServoCenter3.1 USB */
5628 +-
5629 +-/*
5630 +- * ThorLabs USB motor drivers
5631 +- */
5632 +-#define FTDI_THORLABS_PID 0xfaf0 /* ThorLabs USB motor drivers */
5633 +-
5634 +-/*
5635 +- * Testo products (http://www.testo.com/)
5636 +- * Submitted by Colin Leroy
5637 +- */
5638 +-#define TESTO_VID 0x128D
5639 +-#define TESTO_USB_INTERFACE_PID 0x0001
5640 +-
5641 +-/*
5642 +- * Gamma Scout (http://gamma-scout.com/). Submitted by rsc@××××××.com.
5643 +- */
5644 +-#define FTDI_GAMMA_SCOUT_PID 0xD678 /* Gamma Scout online */
5645 +-
5646 +-/*
5647 +- * Tactrix OpenPort (ECU) devices.
5648 +- * OpenPort 1.3M submitted by Donour Sizemore.
5649 +- * OpenPort 1.3S and 1.3U submitted by Ian Abbott.
5650 +- */
5651 +-#define FTDI_TACTRIX_OPENPORT_13M_PID 0xCC48 /* OpenPort 1.3 Mitsubishi */
5652 +-#define FTDI_TACTRIX_OPENPORT_13S_PID 0xCC49 /* OpenPort 1.3 Subaru */
5653 +-#define FTDI_TACTRIX_OPENPORT_13U_PID 0xCC4A /* OpenPort 1.3 Universal */
5654 +-
5655 +-/*
5656 +- * Telldus Technologies
5657 +- */
5658 +-#define TELLDUS_VID 0x1781 /* Vendor ID */
5659 +-#define TELLDUS_TELLSTICK_PID 0x0C30 /* RF control dongle 433 MHz using FT232RL */
5660 +-
5661 +-/*
5662 +- * IBS elektronik product ids
5663 +- * Submitted by Thomas Schleusener
5664 +- */
5665 +-#define FTDI_IBS_US485_PID 0xff38 /* IBS US485 (USB<-->RS422/485 interface) */
5666 +-#define FTDI_IBS_PICPRO_PID 0xff39 /* IBS PIC-Programmer */
5667 +-#define FTDI_IBS_PCMCIA_PID 0xff3a /* IBS Card reader for PCMCIA SRAM-cards */
5668 +-#define FTDI_IBS_PK1_PID 0xff3b /* IBS PK1 - Particel counter */
5669 +-#define FTDI_IBS_RS232MON_PID 0xff3c /* IBS RS232 - Monitor */
5670 +-#define FTDI_IBS_APP70_PID 0xff3d /* APP 70 (dust monitoring system) */
5671 +-#define FTDI_IBS_PEDO_PID 0xff3e /* IBS PEDO-Modem (RF modem 868.35 MHz) */
5672 +-#define FTDI_IBS_PROD_PID 0xff3f /* future device */
5673 +-
5674 +-/*
5675 +- * MaxStream devices www.maxstream.net
5676 +- */
5677 +-#define FTDI_MAXSTREAM_PID 0xEE18 /* Xbee PKG-U Module */
5678 +-
5679 +-/* Olimex */
5680 +-#define OLIMEX_VID 0x15BA
5681 +-#define OLIMEX_ARM_USB_OCD_PID 0x0003
5682 +-
5683 +-/* Luminary Micro Stellaris Boards, VID = FTDI_VID */
5684 +-/* FTDI 2332C Dual channel device, side A=245 FIFO (JTAG), Side B=RS232 UART */
5685 +-#define LMI_LM3S_DEVEL_BOARD_PID 0xbcd8
5686 +-#define LMI_LM3S_EVAL_BOARD_PID 0xbcd9
5687 +-
5688 +-/* www.elsterelectricity.com Elster Unicom III Optical Probe */
5689 +-#define FTDI_ELSTER_UNICOM_PID 0xE700 /* Product Id */
5690 +-
5691 +-/*
5692 +- * The Mobility Lab (TML)
5693 +- * Submitted by Pierre Castella
5694 +- */
5695 +-#define TML_VID 0x1B91 /* Vendor ID */
5696 +-#define TML_USB_SERIAL_PID 0x0064 /* USB - Serial Converter */
5697 +-
5698 +-/* Propox devices */
5699 +-#define FTDI_PROPOX_JTAGCABLEII_PID 0xD738
5700 +-
5701 +-/* Rig Expert Ukraine devices */
5702 +-#define FTDI_REU_TINY_PID 0xED22 /* RigExpert Tiny */
5703 +-
5704 +-/* Domintell products http://www.domintell.com */
5705 +-#define FTDI_DOMINTELL_DGQG_PID 0xEF50 /* Master */
5706 +-#define FTDI_DOMINTELL_DUSB_PID 0xEF51 /* DUSB01 module */
5707 +-
5708 +-/* Alti-2 products http://www.alti-2.com */
5709 +-#define ALTI2_VID 0x1BC9
5710 +-#define ALTI2_N3_PID 0x6001 /* Neptune 3 */
5711 +
5712 + /* Commands */
5713 + #define FTDI_SIO_RESET 0 /* Reset the port */
5714 +@@ -910,86 +40,6 @@
5715 + #define INTERFACE_C 3
5716 + #define INTERFACE_D 4
5717 +
5718 +-/*
5719 +- * FIC / OpenMoko, Inc. http://wiki.openmoko.org/wiki/Neo1973_Debug_Board_v3
5720 +- * Submitted by Harald Welte <laforge@××××××××.org>
5721 +- */
5722 +-#define FIC_VID 0x1457
5723 +-#define FIC_NEO1973_DEBUG_PID 0x5118
5724 +-
5725 +-/*
5726 +- * RATOC REX-USB60F
5727 +- */
5728 +-#define RATOC_VENDOR_ID 0x0584
5729 +-#define RATOC_PRODUCT_ID_USB60F 0xb020
5730 +-
5731 +-/*
5732 +- * DIEBOLD BCS SE923
5733 +- */
5734 +-#define DIEBOLD_BCS_SE923_PID 0xfb99
5735 +-
5736 +-/*
5737 +- * Atmel STK541
5738 +- */
5739 +-#define ATMEL_VID 0x03eb /* Vendor ID */
5740 +-#define STK541_PID 0x2109 /* Zigbee Controller */
5741 +-
5742 +-/*
5743 +- * Dresden Elektronic Sensor Terminal Board
5744 +- */
5745 +-#define DE_VID 0x1cf1 /* Vendor ID */
5746 +-#define STB_PID 0x0001 /* Sensor Terminal Board */
5747 +-#define WHT_PID 0x0004 /* Wireless Handheld Terminal */
5748 +-
5749 +-/*
5750 +- * Blackfin gnICE JTAG
5751 +- * http://docs.blackfin.uclinux.org/doku.php?id=hw:jtag:gnice
5752 +- */
5753 +-#define ADI_VID 0x0456
5754 +-#define ADI_GNICE_PID 0xF000
5755 +-#define ADI_GNICEPLUS_PID 0xF001
5756 +-
5757 +-/*
5758 +- * JETI SPECTROMETER SPECBOS 1201
5759 +- * http://www.jeti.com/products/sys/scb/scb1201.php
5760 +- */
5761 +-#define JETI_VID 0x0c6c
5762 +-#define JETI_SPC1201_PID 0x04b2
5763 +-
5764 +-/*
5765 +- * Marvell SheevaPlug
5766 +- */
5767 +-#define MARVELL_VID 0x9e88
5768 +-#define MARVELL_SHEEVAPLUG_PID 0x9e8f
5769 +-
5770 +-#define FTDI_TURTELIZER_PID 0xBDC8 /* JTAG/RS-232 adapter by egnite GmBH */
5771 +-
5772 +-/*
5773 +- * GN Otometrics (http://www.otometrics.com)
5774 +- * Submitted by Ville Sundberg.
5775 +- */
5776 +-#define GN_OTOMETRICS_VID 0x0c33 /* Vendor ID */
5777 +-#define AURICAL_USB_PID 0x0010 /* Aurical USB Audiometer */
5778 +-
5779 +-/*
5780 +- * Bayer Ascensia Contour blood glucose meter USB-converter cable.
5781 +- * http://winglucofacts.com/cables/
5782 +- */
5783 +-#define BAYER_VID 0x1A79
5784 +-#define BAYER_CONTOUR_CABLE_PID 0x6001
5785 +-
5786 +-/*
5787 +- * Marvell OpenRD Base, Client
5788 +- * http://www.open-rd.org
5789 +- * OpenRD Base, Client use VID 0x0403
5790 +- */
5791 +-#define MARVELL_OPENRD_PID 0x9e90
5792 +-
5793 +-/*
5794 +- * Hameg HO820 and HO870 interface (using VID 0x0403)
5795 +- */
5796 +-#define HAMEG_HO820_PID 0xed74
5797 +-#define HAMEG_HO870_PID 0xed71
5798 +
5799 + /*
5800 + * BmRequestType: 1100 0000b
5801 +@@ -1504,4 +554,3 @@ typedef enum {
5802 + * B2..7 Length of message - (not including Byte 0)
5803 + *
5804 + */
5805 +-
5806 +diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
5807 +new file mode 100644
5808 +index 0000000..d10b5a8
5809 +--- /dev/null
5810 ++++ b/drivers/usb/serial/ftdi_sio_ids.h
5811 +@@ -0,0 +1,1019 @@
5812 ++/*
5813 ++ * vendor/product IDs (VID/PID) of devices using FTDI USB serial converters.
5814 ++ * Please keep numerically sorted within individual areas, thanks!
5815 ++ *
5816 ++ * Philipp Gühring - pg@××××××××××.at - added the Device ID of the USB relais
5817 ++ * from Rudolf Gugler
5818 ++ *
5819 ++ */
5820 ++
5821 ++
5822 ++/**********************************/
5823 ++/***** devices using FTDI VID *****/
5824 ++/**********************************/
5825 ++
5826 ++
5827 ++#define FTDI_VID 0x0403 /* Vendor Id */
5828 ++
5829 ++
5830 ++/*** "original" FTDI device PIDs ***/
5831 ++
5832 ++#define FTDI_8U232AM_PID 0x6001 /* Similar device to SIO above */
5833 ++#define FTDI_8U232AM_ALT_PID 0x6006 /* FTDI's alternate PID for above */
5834 ++#define FTDI_8U2232C_PID 0x6010 /* Dual channel device */
5835 ++#define FTDI_4232H_PID 0x6011 /* Quad channel hi-speed device */
5836 ++#define FTDI_SIO_PID 0x8372 /* Product Id SIO application of 8U100AX */
5837 ++#define FTDI_232RL_PID 0xFBFA /* Product ID for FT232RL */
5838 ++
5839 ++
5840 ++/*** third-party PIDs (using FTDI_VID) ***/
5841 ++
5842 ++/*
5843 ++ * Marvell OpenRD Base, Client
5844 ++ * http://www.open-rd.org
5845 ++ * OpenRD Base, Client use VID 0x0403
5846 ++ */
5847 ++#define MARVELL_OPENRD_PID 0x9e90
5848 ++
5849 ++/* www.candapter.com Ewert Energy Systems CANdapter device */
5850 ++#define FTDI_CANDAPTER_PID 0x9F80 /* Product Id */
5851 ++
5852 ++#define FTDI_NXTCAM_PID 0xABB8 /* NXTCam for Mindstorms NXT */
5853 ++
5854 ++/* OOCDlink by Joern Kaipf <joernk@×××.de>
5855 ++ * (http://www.joernonline.de/dw/doku.php?id=start&idx=projects:oocdlink) */
5856 ++#define FTDI_OOCDLINK_PID 0xbaf8 /* Amontec JTAGkey */
5857 ++
5858 ++/* Luminary Micro Stellaris Boards, VID = FTDI_VID */
5859 ++/* FTDI 2332C Dual channel device, side A=245 FIFO (JTAG), Side B=RS232 UART */
5860 ++#define LMI_LM3S_DEVEL_BOARD_PID 0xbcd8
5861 ++#define LMI_LM3S_EVAL_BOARD_PID 0xbcd9
5862 ++
5863 ++#define FTDI_TURTELIZER_PID 0xBDC8 /* JTAG/RS-232 adapter by egnite GmBH */
5864 ++
5865 ++/* OpenDCC (www.opendcc.de) product id */
5866 ++#define FTDI_OPENDCC_PID 0xBFD8
5867 ++#define FTDI_OPENDCC_SNIFFER_PID 0xBFD9
5868 ++#define FTDI_OPENDCC_THROTTLE_PID 0xBFDA
5869 ++#define FTDI_OPENDCC_GATEWAY_PID 0xBFDB
5870 ++
5871 ++/*
5872 ++ * RR-CirKits LocoBuffer USB (http://www.rr-cirkits.com)
5873 ++ */
5874 ++#define FTDI_RRCIRKITS_LOCOBUFFER_PID 0xc7d0 /* LocoBuffer USB */
5875 ++
5876 ++/* DMX4ALL DMX Interfaces */
5877 ++#define FTDI_DMX4ALL 0xC850
5878 ++
5879 ++/*
5880 ++ * ASK.fr devices
5881 ++ */
5882 ++#define FTDI_ASK_RDR400_PID 0xC991 /* ASK RDR 400 series card reader */
5883 ++
5884 ++/* www.starting-point-systems.com µChameleon device */
5885 ++#define FTDI_MICRO_CHAMELEON_PID 0xCAA0 /* Product Id */
5886 ++
5887 ++/*
5888 ++ * Tactrix OpenPort (ECU) devices.
5889 ++ * OpenPort 1.3M submitted by Donour Sizemore.
5890 ++ * OpenPort 1.3S and 1.3U submitted by Ian Abbott.
5891 ++ */
5892 ++#define FTDI_TACTRIX_OPENPORT_13M_PID 0xCC48 /* OpenPort 1.3 Mitsubishi */
5893 ++#define FTDI_TACTRIX_OPENPORT_13S_PID 0xCC49 /* OpenPort 1.3 Subaru */
5894 ++#define FTDI_TACTRIX_OPENPORT_13U_PID 0xCC4A /* OpenPort 1.3 Universal */
5895 ++
5896 ++/* SCS HF Radio Modems PID's (http://www.scs-ptc.com) */
5897 ++/* the VID is the standard ftdi vid (FTDI_VID) */
5898 ++#define FTDI_SCS_DEVICE_0_PID 0xD010 /* SCS PTC-IIusb */
5899 ++#define FTDI_SCS_DEVICE_1_PID 0xD011 /* SCS Tracker / DSP TNC */
5900 ++#define FTDI_SCS_DEVICE_2_PID 0xD012
5901 ++#define FTDI_SCS_DEVICE_3_PID 0xD013
5902 ++#define FTDI_SCS_DEVICE_4_PID 0xD014
5903 ++#define FTDI_SCS_DEVICE_5_PID 0xD015
5904 ++#define FTDI_SCS_DEVICE_6_PID 0xD016
5905 ++#define FTDI_SCS_DEVICE_7_PID 0xD017
5906 ++
5907 ++/* iPlus device */
5908 ++#define FTDI_IPLUS_PID 0xD070 /* Product Id */
5909 ++#define FTDI_IPLUS2_PID 0xD071 /* Product Id */
5910 ++
5911 ++/*
5912 ++ * Gamma Scout (http://gamma-scout.com/). Submitted by rsc@××××××.com.
5913 ++ */
5914 ++#define FTDI_GAMMA_SCOUT_PID 0xD678 /* Gamma Scout online */
5915 ++
5916 ++/* Propox devices */
5917 ++#define FTDI_PROPOX_JTAGCABLEII_PID 0xD738
5918 ++
5919 ++/*
5920 ++ * Xsens Technologies BV products (http://www.xsens.com).
5921 ++ */
5922 ++#define XSENS_CONVERTER_0_PID 0xD388
5923 ++#define XSENS_CONVERTER_1_PID 0xD389
5924 ++#define XSENS_CONVERTER_2_PID 0xD38A
5925 ++#define XSENS_CONVERTER_3_PID 0xD38B
5926 ++#define XSENS_CONVERTER_4_PID 0xD38C
5927 ++#define XSENS_CONVERTER_5_PID 0xD38D
5928 ++#define XSENS_CONVERTER_6_PID 0xD38E
5929 ++#define XSENS_CONVERTER_7_PID 0xD38F
5930 ++
5931 ++/*
5932 ++ * NDI (www.ndigital.com) product ids
5933 ++ */
5934 ++#define FTDI_NDI_HUC_PID 0xDA70 /* NDI Host USB Converter */
5935 ++#define FTDI_NDI_SPECTRA_SCU_PID 0xDA71 /* NDI Spectra SCU */
5936 ++#define FTDI_NDI_FUTURE_2_PID 0xDA72 /* NDI future device #2 */
5937 ++#define FTDI_NDI_FUTURE_3_PID 0xDA73 /* NDI future device #3 */
5938 ++#define FTDI_NDI_AURORA_SCU_PID 0xDA74 /* NDI Aurora SCU */
5939 ++
5940 ++/*
5941 ++ * Westrex International devices submitted by Cory Lee
5942 ++ */
5943 ++#define FTDI_WESTREX_MODEL_777_PID 0xDC00 /* Model 777 */
5944 ++#define FTDI_WESTREX_MODEL_8900F_PID 0xDC01 /* Model 8900F */
5945 ++
5946 ++/*
5947 ++ * ACG Identification Technologies GmbH products (http://www.acg.de/).
5948 ++ * Submitted by anton -at- goto10 -dot- org.
5949 ++ */
5950 ++#define FTDI_ACG_HFDUAL_PID 0xDD20 /* HF Dual ISO Reader (RFID) */
5951 ++
5952 ++/*
5953 ++ * Definitions for Artemis astronomical USB based cameras
5954 ++ * Check it at http://www.artemisccd.co.uk/
5955 ++ */
5956 ++#define FTDI_ARTEMIS_PID 0xDF28 /* All Artemis Cameras */
5957 ++
5958 ++/*
5959 ++ * Definitions for ATIK Instruments astronomical USB based cameras
5960 ++ * Check it at http://www.atik-instruments.com/
5961 ++ */
5962 ++#define FTDI_ATIK_ATK16_PID 0xDF30 /* ATIK ATK-16 Grayscale Camera */
5963 ++#define FTDI_ATIK_ATK16C_PID 0xDF32 /* ATIK ATK-16C Colour Camera */
5964 ++#define FTDI_ATIK_ATK16HR_PID 0xDF31 /* ATIK ATK-16HR Grayscale Camera */
5965 ++#define FTDI_ATIK_ATK16HRC_PID 0xDF33 /* ATIK ATK-16HRC Colour Camera */
5966 ++#define FTDI_ATIK_ATK16IC_PID 0xDF35 /* ATIK ATK-16IC Grayscale Camera */
5967 ++
5968 ++/*
5969 ++ * Yost Engineering, Inc. products (www.yostengineering.com).
5970 ++ * PID 0xE050 submitted by Aaron Prose.
5971 ++ */
5972 ++#define FTDI_YEI_SERVOCENTER31_PID 0xE050 /* YEI ServoCenter3.1 USB */
5973 ++
5974 ++/*
5975 ++ * ELV USB devices submitted by Christian Abt of ELV (www.elv.de).
5976 ++ * All of these devices use FTDI's vendor ID (0x0403).
5977 ++ * Further IDs taken from ELV Windows .inf file.
5978 ++ *
5979 ++ * The previously included PID for the UO 100 module was incorrect.
5980 ++ * In fact, that PID was for ELV's UR 100 USB-RS232 converter (0xFB58).
5981 ++ *
5982 ++ * Armin Laeuger originally sent the PID for the UM 100 module.
5983 ++ */
5984 ++#define FTDI_ELV_USR_PID 0xE000 /* ELV Universal-Sound-Recorder */
5985 ++#define FTDI_ELV_MSM1_PID 0xE001 /* ELV Mini-Sound-Modul */
5986 ++#define FTDI_ELV_KL100_PID 0xE002 /* ELV Kfz-Leistungsmesser KL 100 */
5987 ++#define FTDI_ELV_WS550_PID 0xE004 /* WS 550 */
5988 ++#define FTDI_ELV_EC3000_PID 0xE006 /* ENERGY CONTROL 3000 USB */
5989 ++#define FTDI_ELV_WS888_PID 0xE008 /* WS 888 */
5990 ++#define FTDI_ELV_TWS550_PID 0xE009 /* Technoline WS 550 */
5991 ++#define FTDI_ELV_FEM_PID 0xE00A /* Funk Energie Monitor */
5992 ++#define FTDI_ELV_FHZ1300PC_PID 0xE0E8 /* FHZ 1300 PC */
5993 ++#define FTDI_ELV_WS500_PID 0xE0E9 /* PC-Wetterstation (WS 500) */
5994 ++#define FTDI_ELV_HS485_PID 0xE0EA /* USB to RS-485 adapter */
5995 ++#define FTDI_ELV_UMS100_PID 0xE0EB /* ELV USB Master-Slave Schaltsteckdose UMS 100 */
5996 ++#define FTDI_ELV_TFD128_PID 0xE0EC /* ELV Temperatur-Feuchte-Datenlogger TFD 128 */
5997 ++#define FTDI_ELV_FM3RX_PID 0xE0ED /* ELV Messwertuebertragung FM3 RX */
5998 ++#define FTDI_ELV_WS777_PID 0xE0EE /* Conrad WS 777 */
5999 ++#define FTDI_ELV_EM1010PC_PID 0xE0EF /* Engery monitor EM 1010 PC */
6000 ++#define FTDI_ELV_CSI8_PID 0xE0F0 /* Computer-Schalt-Interface (CSI 8) */
6001 ++#define FTDI_ELV_EM1000DL_PID 0xE0F1 /* PC-Datenlogger fuer Energiemonitor (EM 1000 DL) */
6002 ++#define FTDI_ELV_PCK100_PID 0xE0F2 /* PC-Kabeltester (PCK 100) */
6003 ++#define FTDI_ELV_RFP500_PID 0xE0F3 /* HF-Leistungsmesser (RFP 500) */
6004 ++#define FTDI_ELV_FS20SIG_PID 0xE0F4 /* Signalgeber (FS 20 SIG) */
6005 ++#define FTDI_ELV_UTP8_PID 0xE0F5 /* ELV UTP 8 */
6006 ++#define FTDI_ELV_WS300PC_PID 0xE0F6 /* PC-Wetterstation (WS 300 PC) */
6007 ++#define FTDI_ELV_WS444PC_PID 0xE0F7 /* Conrad WS 444 PC */
6008 ++#define FTDI_PHI_FISCO_PID 0xE40B /* PHI Fisco USB to Serial cable */
6009 ++#define FTDI_ELV_UAD8_PID 0xF068 /* USB-AD-Wandler (UAD 8) */
6010 ++#define FTDI_ELV_UDA7_PID 0xF069 /* USB-DA-Wandler (UDA 7) */
6011 ++#define FTDI_ELV_USI2_PID 0xF06A /* USB-Schrittmotoren-Interface (USI 2) */
6012 ++#define FTDI_ELV_T1100_PID 0xF06B /* Thermometer (T 1100) */
6013 ++#define FTDI_ELV_PCD200_PID 0xF06C /* PC-Datenlogger (PCD 200) */
6014 ++#define FTDI_ELV_ULA200_PID 0xF06D /* USB-LCD-Ansteuerung (ULA 200) */
6015 ++#define FTDI_ELV_ALC8500_PID 0xF06E /* ALC 8500 Expert */
6016 ++#define FTDI_ELV_FHZ1000PC_PID 0xF06F /* FHZ 1000 PC */
6017 ++#define FTDI_ELV_UR100_PID 0xFB58 /* USB-RS232-Umsetzer (UR 100) */
6018 ++#define FTDI_ELV_UM100_PID 0xFB5A /* USB-Modul UM 100 */
6019 ++#define FTDI_ELV_UO100_PID 0xFB5B /* USB-Modul UO 100 */
6020 ++/* Additional ELV PIDs that default to using the FTDI D2XX drivers on
6021 ++ * MS Windows, rather than the FTDI Virtual Com Port drivers.
6022 ++ * Maybe these will be easier to use with the libftdi/libusb user-space
6023 ++ * drivers, or possibly the Comedi drivers in some cases. */
6024 ++#define FTDI_ELV_CLI7000_PID 0xFB59 /* Computer-Light-Interface (CLI 7000) */
6025 ++#define FTDI_ELV_PPS7330_PID 0xFB5C /* Processor-Power-Supply (PPS 7330) */
6026 ++#define FTDI_ELV_TFM100_PID 0xFB5D /* Temperartur-Feuchte Messgeraet (TFM 100) */
6027 ++#define FTDI_ELV_UDF77_PID 0xFB5E /* USB DCF Funkurh (UDF 77) */
6028 ++#define FTDI_ELV_UIO88_PID 0xFB5F /* USB-I/O Interface (UIO 88) */
6029 ++
6030 ++/*
6031 ++ * EVER Eco Pro UPS (http://www.ever.com.pl/)
6032 ++ */
6033 ++
6034 ++#define EVER_ECO_PRO_CDS 0xe520 /* RS-232 converter */
6035 ++
6036 ++/*
6037 ++ * Active Robots product ids.
6038 ++ */
6039 ++#define FTDI_ACTIVE_ROBOTS_PID 0xE548 /* USB comms board */
6040 ++
6041 ++/* Pyramid Computer GmbH */
6042 ++#define FTDI_PYRAMID_PID 0xE6C8 /* Pyramid Appliance Display */
6043 ++
6044 ++/* www.elsterelectricity.com Elster Unicom III Optical Probe */
6045 ++#define FTDI_ELSTER_UNICOM_PID 0xE700 /* Product Id */
6046 ++
6047 ++/*
6048 ++ * Gude Analog- und Digitalsysteme GmbH
6049 ++ */
6050 ++#define FTDI_GUDEADS_E808_PID 0xE808
6051 ++#define FTDI_GUDEADS_E809_PID 0xE809
6052 ++#define FTDI_GUDEADS_E80A_PID 0xE80A
6053 ++#define FTDI_GUDEADS_E80B_PID 0xE80B
6054 ++#define FTDI_GUDEADS_E80C_PID 0xE80C
6055 ++#define FTDI_GUDEADS_E80D_PID 0xE80D
6056 ++#define FTDI_GUDEADS_E80E_PID 0xE80E
6057 ++#define FTDI_GUDEADS_E80F_PID 0xE80F
6058 ++#define FTDI_GUDEADS_E888_PID 0xE888 /* Expert ISDN Control USB */
6059 ++#define FTDI_GUDEADS_E889_PID 0xE889 /* USB RS-232 OptoBridge */
6060 ++#define FTDI_GUDEADS_E88A_PID 0xE88A
6061 ++#define FTDI_GUDEADS_E88B_PID 0xE88B
6062 ++#define FTDI_GUDEADS_E88C_PID 0xE88C
6063 ++#define FTDI_GUDEADS_E88D_PID 0xE88D
6064 ++#define FTDI_GUDEADS_E88E_PID 0xE88E
6065 ++#define FTDI_GUDEADS_E88F_PID 0xE88F
6066 ++
6067 ++/*
6068 ++ * Eclo (http://www.eclo.pt/) product IDs.
6069 ++ * PID 0xEA90 submitted by Martin Grill.
6070 ++ */
6071 ++#define FTDI_ECLO_COM_1WIRE_PID 0xEA90 /* COM to 1-Wire USB adaptor */
6072 ++
6073 ++/* TNC-X USB-to-packet-radio adapter, versions prior to 3.0 (DLP module) */
6074 ++#define FTDI_TNC_X_PID 0xEBE0
6075 ++
6076 ++/*
6077 ++ * Teratronik product ids.
6078 ++ * Submitted by O. Wölfelschneider.
6079 ++ */
6080 ++#define FTDI_TERATRONIK_VCP_PID 0xEC88 /* Teratronik device (preferring VCP driver on windows) */
6081 ++#define FTDI_TERATRONIK_D2XX_PID 0xEC89 /* Teratronik device (preferring D2XX driver on windows) */
6082 ++
6083 ++/* Rig Expert Ukraine devices */
6084 ++#define FTDI_REU_TINY_PID 0xED22 /* RigExpert Tiny */
6085 ++
6086 ++/*
6087 ++ * Hameg HO820 and HO870 interface (using VID 0x0403)
6088 ++ */
6089 ++#define HAMEG_HO820_PID 0xed74
6090 ++#define HAMEG_HO870_PID 0xed71
6091 ++
6092 ++/*
6093 ++ * MaxStream devices www.maxstream.net
6094 ++ */
6095 ++#define FTDI_MAXSTREAM_PID 0xEE18 /* Xbee PKG-U Module */
6096 ++
6097 ++/*
6098 ++ * microHAM product IDs (http://www.microham.com).
6099 ++ * Submitted by Justin Burket (KL1RL) <zorton@××××.com>
6100 ++ * and Mike Studer (K6EEP) <k6eep@×××××××××××.org>.
6101 ++ * Ian Abbott <abbotti@××××××.uk> added a few more from the driver INF file.
6102 ++ */
6103 ++#define FTDI_MHAM_KW_PID 0xEEE8 /* USB-KW interface */
6104 ++#define FTDI_MHAM_YS_PID 0xEEE9 /* USB-YS interface */
6105 ++#define FTDI_MHAM_Y6_PID 0xEEEA /* USB-Y6 interface */
6106 ++#define FTDI_MHAM_Y8_PID 0xEEEB /* USB-Y8 interface */
6107 ++#define FTDI_MHAM_IC_PID 0xEEEC /* USB-IC interface */
6108 ++#define FTDI_MHAM_DB9_PID 0xEEED /* USB-DB9 interface */
6109 ++#define FTDI_MHAM_RS232_PID 0xEEEE /* USB-RS232 interface */
6110 ++#define FTDI_MHAM_Y9_PID 0xEEEF /* USB-Y9 interface */
6111 ++
6112 ++/* Domintell products http://www.domintell.com */
6113 ++#define FTDI_DOMINTELL_DGQG_PID 0xEF50 /* Master */
6114 ++#define FTDI_DOMINTELL_DUSB_PID 0xEF51 /* DUSB01 module */
6115 ++
6116 ++/*
6117 ++ * The following are the values for the Perle Systems
6118 ++ * UltraPort USB serial converters
6119 ++ */
6120 ++#define FTDI_PERLE_ULTRAPORT_PID 0xF0C0 /* Perle UltraPort Product Id */
6121 ++
6122 ++/* Sprog II (Andrew Crosland's SprogII DCC interface) */
6123 ++#define FTDI_SPROG_II 0xF0C8
6124 ++
6125 ++/* an infrared receiver for user access control with IR tags */
6126 ++#define FTDI_PIEGROUP_PID 0xF208 /* Product Id */
6127 ++
6128 ++/* ACT Solutions HomePro ZWave interface
6129 ++ (http://www.act-solutions.com/HomePro.htm) */
6130 ++#define FTDI_ACTZWAVE_PID 0xF2D0
6131 ++
6132 ++/*
6133 ++ * 4N-GALAXY.DE PIDs for CAN-USB, USB-RS232, USB-RS422, USB-RS485,
6134 ++ * USB-TTY activ, USB-TTY passiv. Some PIDs are used by several devices
6135 ++ * and I'm not entirely sure which are used by which.
6136 ++ */
6137 ++#define FTDI_4N_GALAXY_DE_1_PID 0xF3C0
6138 ++#define FTDI_4N_GALAXY_DE_2_PID 0xF3C1
6139 ++
6140 ++/*
6141 ++ * Linx Technologies product ids
6142 ++ */
6143 ++#define LINX_SDMUSBQSS_PID 0xF448 /* Linx SDM-USB-QS-S */
6144 ++#define LINX_MASTERDEVEL2_PID 0xF449 /* Linx Master Development 2.0 */
6145 ++#define LINX_FUTURE_0_PID 0xF44A /* Linx future device */
6146 ++#define LINX_FUTURE_1_PID 0xF44B /* Linx future device */
6147 ++#define LINX_FUTURE_2_PID 0xF44C /* Linx future device */
6148 ++
6149 ++/*
6150 ++ * Oceanic product ids
6151 ++ */
6152 ++#define FTDI_OCEANIC_PID 0xF460 /* Oceanic dive instrument */
6153 ++
6154 ++/*
6155 ++ * SUUNTO product ids
6156 ++ */
6157 ++#define FTDI_SUUNTO_SPORTS_PID 0xF680 /* Suunto Sports instrument */
6158 ++
6159 ++/* USB-UIRT - An infrared receiver and transmitter using the 8U232AM chip */
6160 ++/* http://home.earthlink.net/~jrhees/USBUIRT/index.htm */
6161 ++#define FTDI_USB_UIRT_PID 0xF850 /* Product Id */
6162 ++
6163 ++/* CCS Inc. ICDU/ICDU40 product ID -
6164 ++ * the FT232BM is used in an in-circuit-debugger unit for PIC16's/PIC18's */
6165 ++#define FTDI_CCSICDU20_0_PID 0xF9D0
6166 ++#define FTDI_CCSICDU40_1_PID 0xF9D1
6167 ++#define FTDI_CCSMACHX_2_PID 0xF9D2
6168 ++#define FTDI_CCSLOAD_N_GO_3_PID 0xF9D3
6169 ++#define FTDI_CCSICDU64_4_PID 0xF9D4
6170 ++#define FTDI_CCSPRIME8_5_PID 0xF9D5
6171 ++
6172 ++/*
6173 ++ * The following are the values for the Matrix Orbital LCD displays,
6174 ++ * which are the FT232BM ( similar to the 8U232AM )
6175 ++ */
6176 ++#define FTDI_MTXORB_0_PID 0xFA00 /* Matrix Orbital Product Id */
6177 ++#define FTDI_MTXORB_1_PID 0xFA01 /* Matrix Orbital Product Id */
6178 ++#define FTDI_MTXORB_2_PID 0xFA02 /* Matrix Orbital Product Id */
6179 ++#define FTDI_MTXORB_3_PID 0xFA03 /* Matrix Orbital Product Id */
6180 ++#define FTDI_MTXORB_4_PID 0xFA04 /* Matrix Orbital Product Id */
6181 ++#define FTDI_MTXORB_5_PID 0xFA05 /* Matrix Orbital Product Id */
6182 ++#define FTDI_MTXORB_6_PID 0xFA06 /* Matrix Orbital Product Id */
6183 ++
6184 ++/*
6185 ++ * Home Electronics (www.home-electro.com) USB gadgets
6186 ++ */
6187 ++#define FTDI_HE_TIRA1_PID 0xFA78 /* Tira-1 IR transceiver */
6188 ++
6189 ++/* Inside Accesso contactless reader (http://www.insidefr.com) */
6190 ++#define INSIDE_ACCESSO 0xFAD0
6191 ++
6192 ++/*
6193 ++ * ThorLabs USB motor drivers
6194 ++ */
6195 ++#define FTDI_THORLABS_PID 0xfaf0 /* ThorLabs USB motor drivers */
6196 ++
6197 ++/*
6198 ++ * Protego product ids
6199 ++ */
6200 ++#define PROTEGO_SPECIAL_1 0xFC70 /* special/unknown device */
6201 ++#define PROTEGO_R2X0 0xFC71 /* R200-USB TRNG unit (R210, R220, and R230) */
6202 ++#define PROTEGO_SPECIAL_3 0xFC72 /* special/unknown device */
6203 ++#define PROTEGO_SPECIAL_4 0xFC73 /* special/unknown device */
6204 ++
6205 ++/*
6206 ++ * DSS-20 Sync Station for Sony Ericsson P800
6207 ++ */
6208 ++#define FTDI_DSS20_PID 0xFC82
6209 ++
6210 ++/* www.irtrans.de device */
6211 ++#define FTDI_IRTRANS_PID 0xFC60 /* Product Id */
6212 ++
6213 ++/*
6214 ++ * RM Michaelides CANview USB (http://www.rmcan.com) (FTDI_VID)
6215 ++ * CAN fieldbus interface adapter, added by port GmbH www.port.de)
6216 ++ * Ian Abbott changed the macro names for consistency.
6217 ++ */
6218 ++#define FTDI_RM_CANVIEW_PID 0xfd60 /* Product Id */
6219 ++/* www.thoughttechnology.com/ TT-USB provide with procomp use ftdi_sio */
6220 ++#define FTDI_TTUSB_PID 0xFF20 /* Product Id */
6221 ++
6222 ++#define FTDI_USBX_707_PID 0xF857 /* ADSTech IR Blaster USBX-707 (FTDI_VID) */
6223 ++
6224 ++#define FTDI_RELAIS_PID 0xFA10 /* Relais device from Rudolf Gugler */
6225 ++
6226 ++/*
6227 ++ * PCDJ use ftdi based dj-controllers. The following PID is
6228 ++ * for their DAC-2 device http://www.pcdjhardware.com/DAC2.asp
6229 ++ * (the VID is the standard ftdi vid (FTDI_VID), PID sent by Wouter Paesen)
6230 ++ */
6231 ++#define FTDI_PCDJ_DAC2_PID 0xFA88
6232 ++
6233 ++#define FTDI_R2000KU_TRUE_RNG 0xFB80 /* R2000KU TRUE RNG (FTDI_VID) */
6234 ++
6235 ++/*
6236 ++ * DIEBOLD BCS SE923 (FTDI_VID)
6237 ++ */
6238 ++#define DIEBOLD_BCS_SE923_PID 0xfb99
6239 ++
6240 ++/* www.crystalfontz.com devices
6241 ++ * - thanx for providing free devices for evaluation !
6242 ++ * they use the ftdi chipset for the USB interface
6243 ++ * and the vendor id is the same
6244 ++ */
6245 ++#define FTDI_XF_632_PID 0xFC08 /* 632: 16x2 Character Display */
6246 ++#define FTDI_XF_634_PID 0xFC09 /* 634: 20x4 Character Display */
6247 ++#define FTDI_XF_547_PID 0xFC0A /* 547: Two line Display */
6248 ++#define FTDI_XF_633_PID 0xFC0B /* 633: 16x2 Character Display with Keys */
6249 ++#define FTDI_XF_631_PID 0xFC0C /* 631: 20x2 Character Display */
6250 ++#define FTDI_XF_635_PID 0xFC0D /* 635: 20x4 Character Display */
6251 ++#define FTDI_XF_640_PID 0xFC0E /* 640: Two line Display */
6252 ++#define FTDI_XF_642_PID 0xFC0F /* 642: Two line Display */
6253 ++
6254 ++/*
6255 ++ * Video Networks Limited / Homechoice in the UK use an ftdi-based device
6256 ++ * for their 1Mb broadband internet service. The following PID is exhibited
6257 ++ * by the usb device supplied (the VID is the standard ftdi vid (FTDI_VID)
6258 ++ */
6259 ++#define FTDI_VNHCPCUSB_D_PID 0xfe38 /* Product Id */
6260 ++
6261 ++/* AlphaMicro Components AMC-232USB01 device (FTDI_VID) */
6262 ++#define FTDI_AMC232_PID 0xFF00 /* Product Id */
6263 ++
6264 ++/*
6265 ++ * IBS elektronik product ids (FTDI_VID)
6266 ++ * Submitted by Thomas Schleusener
6267 ++ */
6268 ++#define FTDI_IBS_US485_PID 0xff38 /* IBS US485 (USB<-->RS422/485 interface) */
6269 ++#define FTDI_IBS_PICPRO_PID 0xff39 /* IBS PIC-Programmer */
6270 ++#define FTDI_IBS_PCMCIA_PID 0xff3a /* IBS Card reader for PCMCIA SRAM-cards */
6271 ++#define FTDI_IBS_PK1_PID 0xff3b /* IBS PK1 - Particel counter */
6272 ++#define FTDI_IBS_RS232MON_PID 0xff3c /* IBS RS232 - Monitor */
6273 ++#define FTDI_IBS_APP70_PID 0xff3d /* APP 70 (dust monitoring system) */
6274 ++#define FTDI_IBS_PEDO_PID 0xff3e /* IBS PEDO-Modem (RF modem 868.35 MHz) */
6275 ++#define FTDI_IBS_PROD_PID 0xff3f /* future device */
6276 ++/* www.canusb.com Lawicel CANUSB device (FTDI_VID) */
6277 ++#define FTDI_CANUSB_PID 0xFFA8 /* Product Id */
6278 ++
6279 ++
6280 ++
6281 ++/********************************/
6282 ++/** third-party VID/PID combos **/
6283 ++/********************************/
6284 ++
6285 ++
6286 ++
6287 ++/*
6288 ++ * Atmel STK541
6289 ++ */
6290 ++#define ATMEL_VID 0x03eb /* Vendor ID */
6291 ++#define STK541_PID 0x2109 /* Zigbee Controller */
6292 ++
6293 ++/*
6294 ++ * Blackfin gnICE JTAG
6295 ++ * http://docs.blackfin.uclinux.org/doku.php?id=hw:jtag:gnice
6296 ++ */
6297 ++#define ADI_VID 0x0456
6298 ++#define ADI_GNICE_PID 0xF000
6299 ++#define ADI_GNICEPLUS_PID 0xF001
6300 ++
6301 ++/*
6302 ++ * RATOC REX-USB60F
6303 ++ */
6304 ++#define RATOC_VENDOR_ID 0x0584
6305 ++#define RATOC_PRODUCT_ID_USB60F 0xb020
6306 ++
6307 ++/*
6308 ++ * Contec products (http://www.contec.com)
6309 ++ * Submitted by Daniel Sangorrin
6310 ++ */
6311 ++#define CONTEC_VID 0x06CE /* Vendor ID */
6312 ++#define CONTEC_COM1USBH_PID 0x8311 /* COM-1(USB)H */
6313 ++
6314 ++/*
6315 ++ * Definitions for B&B Electronics products.
6316 ++ */
6317 ++#define BANDB_VID 0x0856 /* B&B Electronics Vendor ID */
6318 ++#define BANDB_USOTL4_PID 0xAC01 /* USOTL4 Isolated RS-485 Converter */
6319 ++#define BANDB_USTL4_PID 0xAC02 /* USTL4 RS-485 Converter */
6320 ++#define BANDB_USO9ML2_PID 0xAC03 /* USO9ML2 Isolated RS-232 Converter */
6321 ++#define BANDB_USOPTL4_PID 0xAC11
6322 ++#define BANDB_USPTL4_PID 0xAC12
6323 ++#define BANDB_USO9ML2DR_2_PID 0xAC16
6324 ++#define BANDB_USO9ML2DR_PID 0xAC17
6325 ++#define BANDB_USOPTL4DR2_PID 0xAC18 /* USOPTL4R-2 2-port Isolated RS-232 Converter */
6326 ++#define BANDB_USOPTL4DR_PID 0xAC19
6327 ++#define BANDB_485USB9F_2W_PID 0xAC25
6328 ++#define BANDB_485USB9F_4W_PID 0xAC26
6329 ++#define BANDB_232USB9M_PID 0xAC27
6330 ++#define BANDB_485USBTB_2W_PID 0xAC33
6331 ++#define BANDB_485USBTB_4W_PID 0xAC34
6332 ++#define BANDB_TTL5USB9M_PID 0xAC49
6333 ++#define BANDB_TTL3USB9M_PID 0xAC50
6334 ++#define BANDB_ZZ_PROG1_USB_PID 0xBA02
6335 ++
6336 ++/*
6337 ++ * Intrepid Control Systems (http://www.intrepidcs.com/) ValueCAN and NeoVI
6338 ++ */
6339 ++#define INTREPID_VID 0x093C
6340 ++#define INTREPID_VALUECAN_PID 0x0601
6341 ++#define INTREPID_NEOVI_PID 0x0701
6342 ++
6343 ++/*
6344 ++ * Definitions for ID TECH (www.idt-net.com) devices
6345 ++ */
6346 ++#define IDTECH_VID 0x0ACD /* ID TECH Vendor ID */
6347 ++#define IDTECH_IDT1221U_PID 0x0300 /* IDT1221U USB to RS-232 adapter */
6348 ++
6349 ++/*
6350 ++ * Definitions for Omnidirectional Control Technology, Inc. devices
6351 ++ */
6352 ++#define OCT_VID 0x0B39 /* OCT vendor ID */
6353 ++/* Note: OCT US101 is also rebadged as Dick Smith Electronics (NZ) XH6381 */
6354 ++/* Also rebadged as Dick Smith Electronics (Aus) XH6451 */
6355 ++/* Also rebadged as SIIG Inc. model US2308 hardware version 1 */
6356 ++#define OCT_US101_PID 0x0421 /* OCT US101 USB to RS-232 */
6357 ++
6358 ++/*
6359 ++ * Icom ID-1 digital transceiver
6360 ++ */
6361 ++
6362 ++#define ICOM_ID1_VID 0x0C26
6363 ++#define ICOM_ID1_PID 0x0004
6364 ++
6365 ++/*
6366 ++ * GN Otometrics (http://www.otometrics.com)
6367 ++ * Submitted by Ville Sundberg.
6368 ++ */
6369 ++#define GN_OTOMETRICS_VID 0x0c33 /* Vendor ID */
6370 ++#define AURICAL_USB_PID 0x0010 /* Aurical USB Audiometer */
6371 ++
6372 ++/*
6373 ++ * The following are the values for the Sealevel SeaLINK+ adapters.
6374 ++ * (Original list sent by Tuan Hoang. Ian Abbott renamed the macros and
6375 ++ * removed some PIDs that don't seem to match any existing products.)
6376 ++ */
6377 ++#define SEALEVEL_VID 0x0c52 /* Sealevel Vendor ID */
6378 ++#define SEALEVEL_2101_PID 0x2101 /* SeaLINK+232 (2101/2105) */
6379 ++#define SEALEVEL_2102_PID 0x2102 /* SeaLINK+485 (2102) */
6380 ++#define SEALEVEL_2103_PID 0x2103 /* SeaLINK+232I (2103) */
6381 ++#define SEALEVEL_2104_PID 0x2104 /* SeaLINK+485I (2104) */
6382 ++#define SEALEVEL_2106_PID 0x9020 /* SeaLINK+422 (2106) */
6383 ++#define SEALEVEL_2201_1_PID 0x2211 /* SeaPORT+2/232 (2201) Port 1 */
6384 ++#define SEALEVEL_2201_2_PID 0x2221 /* SeaPORT+2/232 (2201) Port 2 */
6385 ++#define SEALEVEL_2202_1_PID 0x2212 /* SeaPORT+2/485 (2202) Port 1 */
6386 ++#define SEALEVEL_2202_2_PID 0x2222 /* SeaPORT+2/485 (2202) Port 2 */
6387 ++#define SEALEVEL_2203_1_PID 0x2213 /* SeaPORT+2 (2203) Port 1 */
6388 ++#define SEALEVEL_2203_2_PID 0x2223 /* SeaPORT+2 (2203) Port 2 */
6389 ++#define SEALEVEL_2401_1_PID 0x2411 /* SeaPORT+4/232 (2401) Port 1 */
6390 ++#define SEALEVEL_2401_2_PID 0x2421 /* SeaPORT+4/232 (2401) Port 2 */
6391 ++#define SEALEVEL_2401_3_PID 0x2431 /* SeaPORT+4/232 (2401) Port 3 */
6392 ++#define SEALEVEL_2401_4_PID 0x2441 /* SeaPORT+4/232 (2401) Port 4 */
6393 ++#define SEALEVEL_2402_1_PID 0x2412 /* SeaPORT+4/485 (2402) Port 1 */
6394 ++#define SEALEVEL_2402_2_PID 0x2422 /* SeaPORT+4/485 (2402) Port 2 */
6395 ++#define SEALEVEL_2402_3_PID 0x2432 /* SeaPORT+4/485 (2402) Port 3 */
6396 ++#define SEALEVEL_2402_4_PID 0x2442 /* SeaPORT+4/485 (2402) Port 4 */
6397 ++#define SEALEVEL_2403_1_PID 0x2413 /* SeaPORT+4 (2403) Port 1 */
6398 ++#define SEALEVEL_2403_2_PID 0x2423 /* SeaPORT+4 (2403) Port 2 */
6399 ++#define SEALEVEL_2403_3_PID 0x2433 /* SeaPORT+4 (2403) Port 3 */
6400 ++#define SEALEVEL_2403_4_PID 0x2443 /* SeaPORT+4 (2403) Port 4 */
6401 ++#define SEALEVEL_2801_1_PID 0X2811 /* SeaLINK+8/232 (2801) Port 1 */
6402 ++#define SEALEVEL_2801_2_PID 0X2821 /* SeaLINK+8/232 (2801) Port 2 */
6403 ++#define SEALEVEL_2801_3_PID 0X2831 /* SeaLINK+8/232 (2801) Port 3 */
6404 ++#define SEALEVEL_2801_4_PID 0X2841 /* SeaLINK+8/232 (2801) Port 4 */
6405 ++#define SEALEVEL_2801_5_PID 0X2851 /* SeaLINK+8/232 (2801) Port 5 */
6406 ++#define SEALEVEL_2801_6_PID 0X2861 /* SeaLINK+8/232 (2801) Port 6 */
6407 ++#define SEALEVEL_2801_7_PID 0X2871 /* SeaLINK+8/232 (2801) Port 7 */
6408 ++#define SEALEVEL_2801_8_PID 0X2881 /* SeaLINK+8/232 (2801) Port 8 */
6409 ++#define SEALEVEL_2802_1_PID 0X2812 /* SeaLINK+8/485 (2802) Port 1 */
6410 ++#define SEALEVEL_2802_2_PID 0X2822 /* SeaLINK+8/485 (2802) Port 2 */
6411 ++#define SEALEVEL_2802_3_PID 0X2832 /* SeaLINK+8/485 (2802) Port 3 */
6412 ++#define SEALEVEL_2802_4_PID 0X2842 /* SeaLINK+8/485 (2802) Port 4 */
6413 ++#define SEALEVEL_2802_5_PID 0X2852 /* SeaLINK+8/485 (2802) Port 5 */
6414 ++#define SEALEVEL_2802_6_PID 0X2862 /* SeaLINK+8/485 (2802) Port 6 */
6415 ++#define SEALEVEL_2802_7_PID 0X2872 /* SeaLINK+8/485 (2802) Port 7 */
6416 ++#define SEALEVEL_2802_8_PID 0X2882 /* SeaLINK+8/485 (2802) Port 8 */
6417 ++#define SEALEVEL_2803_1_PID 0X2813 /* SeaLINK+8 (2803) Port 1 */
6418 ++#define SEALEVEL_2803_2_PID 0X2823 /* SeaLINK+8 (2803) Port 2 */
6419 ++#define SEALEVEL_2803_3_PID 0X2833 /* SeaLINK+8 (2803) Port 3 */
6420 ++#define SEALEVEL_2803_4_PID 0X2843 /* SeaLINK+8 (2803) Port 4 */
6421 ++#define SEALEVEL_2803_5_PID 0X2853 /* SeaLINK+8 (2803) Port 5 */
6422 ++#define SEALEVEL_2803_6_PID 0X2863 /* SeaLINK+8 (2803) Port 6 */
6423 ++#define SEALEVEL_2803_7_PID 0X2873 /* SeaLINK+8 (2803) Port 7 */
6424 ++#define SEALEVEL_2803_8_PID 0X2883 /* SeaLINK+8 (2803) Port 8 */
6425 ++
6426 ++/*
6427 ++ * JETI SPECTROMETER SPECBOS 1201
6428 ++ * http://www.jeti.com/products/sys/scb/scb1201.php
6429 ++ */
6430 ++#define JETI_VID 0x0c6c
6431 ++#define JETI_SPC1201_PID 0x04b2
6432 ++
6433 ++/*
6434 ++ * FTDI USB UART chips used in construction projects from the
6435 ++ * Elektor Electronics magazine (http://elektor-electronics.co.uk)
6436 ++ */
6437 ++#define ELEKTOR_VID 0x0C7D
6438 ++#define ELEKTOR_FT323R_PID 0x0005 /* RFID-Reader, issue 09-2006 */
6439 ++
6440 ++/*
6441 ++ * Posiflex inc retail equipment (http://www.posiflex.com.tw)
6442 ++ */
6443 ++#define POSIFLEX_VID 0x0d3a /* Vendor ID */
6444 ++#define POSIFLEX_PP7000_PID 0x0300 /* PP-7000II thermal printer */
6445 ++
6446 ++/*
6447 ++ * The following are the values for two KOBIL chipcard terminals.
6448 ++ */
6449 ++#define KOBIL_VID 0x0d46 /* KOBIL Vendor ID */
6450 ++#define KOBIL_CONV_B1_PID 0x2020 /* KOBIL Konverter for B1 */
6451 ++#define KOBIL_CONV_KAAN_PID 0x2021 /* KOBIL_Konverter for KAAN */
6452 ++
6453 ++#define FTDI_NF_RIC_VID 0x0DCD /* Vendor Id */
6454 ++#define FTDI_NF_RIC_PID 0x0001 /* Product Id */
6455 ++
6456 ++/*
6457 ++ * Falcom Wireless Communications GmbH
6458 ++ */
6459 ++#define FALCOM_VID 0x0F94 /* Vendor Id */
6460 ++#define FALCOM_TWIST_PID 0x0001 /* Falcom Twist USB GPRS modem */
6461 ++#define FALCOM_SAMBA_PID 0x0005 /* Falcom Samba USB GPRS modem */
6462 ++
6463 ++/* Larsen and Brusgaard AltiTrack/USBtrack */
6464 ++#define LARSENBRUSGAARD_VID 0x0FD8
6465 ++#define LB_ALTITRACK_PID 0x0001
6466 ++
6467 ++/*
6468 ++ * TTi (Thurlby Thandar Instruments)
6469 ++ */
6470 ++#define TTI_VID 0x103E /* Vendor Id */
6471 ++#define TTI_QL355P_PID 0x03E8 /* TTi QL355P power supply */
6472 ++
6473 ++/* Interbiometrics USB I/O Board */
6474 ++/* Developed for Interbiometrics by Rudolf Gugler */
6475 ++#define INTERBIOMETRICS_VID 0x1209
6476 ++#define INTERBIOMETRICS_IOBOARD_PID 0x1002
6477 ++#define INTERBIOMETRICS_MINI_IOBOARD_PID 0x1006
6478 ++
6479 ++/*
6480 ++ * Testo products (http://www.testo.com/)
6481 ++ * Submitted by Colin Leroy
6482 ++ */
6483 ++#define TESTO_VID 0x128D
6484 ++#define TESTO_USB_INTERFACE_PID 0x0001
6485 ++
6486 ++/*
6487 ++ * Mobility Electronics products.
6488 ++ */
6489 ++#define MOBILITY_VID 0x1342
6490 ++#define MOBILITY_USB_SERIAL_PID 0x0202 /* EasiDock USB 200 serial */
6491 ++
6492 ++/*
6493 ++ * FIC / OpenMoko, Inc. http://wiki.openmoko.org/wiki/Neo1973_Debug_Board_v3
6494 ++ * Submitted by Harald Welte <laforge@××××××××.org>
6495 ++ */
6496 ++#define FIC_VID 0x1457
6497 ++#define FIC_NEO1973_DEBUG_PID 0x5118
6498 ++
6499 ++/* Olimex */
6500 ++#define OLIMEX_VID 0x15BA
6501 ++#define OLIMEX_ARM_USB_OCD_PID 0x0003
6502 ++
6503 ++/*
6504 ++ * Telldus Technologies
6505 ++ */
6506 ++#define TELLDUS_VID 0x1781 /* Vendor ID */
6507 ++#define TELLDUS_TELLSTICK_PID 0x0C30 /* RF control dongle 433 MHz using FT232RL */
6508 ++
6509 ++/*
6510 ++ * Bayer Ascensia Contour blood glucose meter USB-converter cable.
6511 ++ * http://winglucofacts.com/cables/
6512 ++ */
6513 ++#define BAYER_VID 0x1A79
6514 ++#define BAYER_CONTOUR_CABLE_PID 0x6001
6515 ++
6516 ++/*
6517 ++ * The following are the values for the Matrix Orbital FTDI Range
6518 ++ * Anything in this range will use an FT232RL.
6519 ++ */
6520 ++#define MTXORB_VID 0x1B3D
6521 ++#define MTXORB_FTDI_RANGE_0100_PID 0x0100
6522 ++#define MTXORB_FTDI_RANGE_0101_PID 0x0101
6523 ++#define MTXORB_FTDI_RANGE_0102_PID 0x0102
6524 ++#define MTXORB_FTDI_RANGE_0103_PID 0x0103
6525 ++#define MTXORB_FTDI_RANGE_0104_PID 0x0104
6526 ++#define MTXORB_FTDI_RANGE_0105_PID 0x0105
6527 ++#define MTXORB_FTDI_RANGE_0106_PID 0x0106
6528 ++#define MTXORB_FTDI_RANGE_0107_PID 0x0107
6529 ++#define MTXORB_FTDI_RANGE_0108_PID 0x0108
6530 ++#define MTXORB_FTDI_RANGE_0109_PID 0x0109
6531 ++#define MTXORB_FTDI_RANGE_010A_PID 0x010A
6532 ++#define MTXORB_FTDI_RANGE_010B_PID 0x010B
6533 ++#define MTXORB_FTDI_RANGE_010C_PID 0x010C
6534 ++#define MTXORB_FTDI_RANGE_010D_PID 0x010D
6535 ++#define MTXORB_FTDI_RANGE_010E_PID 0x010E
6536 ++#define MTXORB_FTDI_RANGE_010F_PID 0x010F
6537 ++#define MTXORB_FTDI_RANGE_0110_PID 0x0110
6538 ++#define MTXORB_FTDI_RANGE_0111_PID 0x0111
6539 ++#define MTXORB_FTDI_RANGE_0112_PID 0x0112
6540 ++#define MTXORB_FTDI_RANGE_0113_PID 0x0113
6541 ++#define MTXORB_FTDI_RANGE_0114_PID 0x0114
6542 ++#define MTXORB_FTDI_RANGE_0115_PID 0x0115
6543 ++#define MTXORB_FTDI_RANGE_0116_PID 0x0116
6544 ++#define MTXORB_FTDI_RANGE_0117_PID 0x0117
6545 ++#define MTXORB_FTDI_RANGE_0118_PID 0x0118
6546 ++#define MTXORB_FTDI_RANGE_0119_PID 0x0119
6547 ++#define MTXORB_FTDI_RANGE_011A_PID 0x011A
6548 ++#define MTXORB_FTDI_RANGE_011B_PID 0x011B
6549 ++#define MTXORB_FTDI_RANGE_011C_PID 0x011C
6550 ++#define MTXORB_FTDI_RANGE_011D_PID 0x011D
6551 ++#define MTXORB_FTDI_RANGE_011E_PID 0x011E
6552 ++#define MTXORB_FTDI_RANGE_011F_PID 0x011F
6553 ++#define MTXORB_FTDI_RANGE_0120_PID 0x0120
6554 ++#define MTXORB_FTDI_RANGE_0121_PID 0x0121
6555 ++#define MTXORB_FTDI_RANGE_0122_PID 0x0122
6556 ++#define MTXORB_FTDI_RANGE_0123_PID 0x0123
6557 ++#define MTXORB_FTDI_RANGE_0124_PID 0x0124
6558 ++#define MTXORB_FTDI_RANGE_0125_PID 0x0125
6559 ++#define MTXORB_FTDI_RANGE_0126_PID 0x0126
6560 ++#define MTXORB_FTDI_RANGE_0127_PID 0x0127
6561 ++#define MTXORB_FTDI_RANGE_0128_PID 0x0128
6562 ++#define MTXORB_FTDI_RANGE_0129_PID 0x0129
6563 ++#define MTXORB_FTDI_RANGE_012A_PID 0x012A
6564 ++#define MTXORB_FTDI_RANGE_012B_PID 0x012B
6565 ++#define MTXORB_FTDI_RANGE_012C_PID 0x012C
6566 ++#define MTXORB_FTDI_RANGE_012D_PID 0x012D
6567 ++#define MTXORB_FTDI_RANGE_012E_PID 0x012E
6568 ++#define MTXORB_FTDI_RANGE_012F_PID 0x012F
6569 ++#define MTXORB_FTDI_RANGE_0130_PID 0x0130
6570 ++#define MTXORB_FTDI_RANGE_0131_PID 0x0131
6571 ++#define MTXORB_FTDI_RANGE_0132_PID 0x0132
6572 ++#define MTXORB_FTDI_RANGE_0133_PID 0x0133
6573 ++#define MTXORB_FTDI_RANGE_0134_PID 0x0134
6574 ++#define MTXORB_FTDI_RANGE_0135_PID 0x0135
6575 ++#define MTXORB_FTDI_RANGE_0136_PID 0x0136
6576 ++#define MTXORB_FTDI_RANGE_0137_PID 0x0137
6577 ++#define MTXORB_FTDI_RANGE_0138_PID 0x0138
6578 ++#define MTXORB_FTDI_RANGE_0139_PID 0x0139
6579 ++#define MTXORB_FTDI_RANGE_013A_PID 0x013A
6580 ++#define MTXORB_FTDI_RANGE_013B_PID 0x013B
6581 ++#define MTXORB_FTDI_RANGE_013C_PID 0x013C
6582 ++#define MTXORB_FTDI_RANGE_013D_PID 0x013D
6583 ++#define MTXORB_FTDI_RANGE_013E_PID 0x013E
6584 ++#define MTXORB_FTDI_RANGE_013F_PID 0x013F
6585 ++#define MTXORB_FTDI_RANGE_0140_PID 0x0140
6586 ++#define MTXORB_FTDI_RANGE_0141_PID 0x0141
6587 ++#define MTXORB_FTDI_RANGE_0142_PID 0x0142
6588 ++#define MTXORB_FTDI_RANGE_0143_PID 0x0143
6589 ++#define MTXORB_FTDI_RANGE_0144_PID 0x0144
6590 ++#define MTXORB_FTDI_RANGE_0145_PID 0x0145
6591 ++#define MTXORB_FTDI_RANGE_0146_PID 0x0146
6592 ++#define MTXORB_FTDI_RANGE_0147_PID 0x0147
6593 ++#define MTXORB_FTDI_RANGE_0148_PID 0x0148
6594 ++#define MTXORB_FTDI_RANGE_0149_PID 0x0149
6595 ++#define MTXORB_FTDI_RANGE_014A_PID 0x014A
6596 ++#define MTXORB_FTDI_RANGE_014B_PID 0x014B
6597 ++#define MTXORB_FTDI_RANGE_014C_PID 0x014C
6598 ++#define MTXORB_FTDI_RANGE_014D_PID 0x014D
6599 ++#define MTXORB_FTDI_RANGE_014E_PID 0x014E
6600 ++#define MTXORB_FTDI_RANGE_014F_PID 0x014F
6601 ++#define MTXORB_FTDI_RANGE_0150_PID 0x0150
6602 ++#define MTXORB_FTDI_RANGE_0151_PID 0x0151
6603 ++#define MTXORB_FTDI_RANGE_0152_PID 0x0152
6604 ++#define MTXORB_FTDI_RANGE_0153_PID 0x0153
6605 ++#define MTXORB_FTDI_RANGE_0154_PID 0x0154
6606 ++#define MTXORB_FTDI_RANGE_0155_PID 0x0155
6607 ++#define MTXORB_FTDI_RANGE_0156_PID 0x0156
6608 ++#define MTXORB_FTDI_RANGE_0157_PID 0x0157
6609 ++#define MTXORB_FTDI_RANGE_0158_PID 0x0158
6610 ++#define MTXORB_FTDI_RANGE_0159_PID 0x0159
6611 ++#define MTXORB_FTDI_RANGE_015A_PID 0x015A
6612 ++#define MTXORB_FTDI_RANGE_015B_PID 0x015B
6613 ++#define MTXORB_FTDI_RANGE_015C_PID 0x015C
6614 ++#define MTXORB_FTDI_RANGE_015D_PID 0x015D
6615 ++#define MTXORB_FTDI_RANGE_015E_PID 0x015E
6616 ++#define MTXORB_FTDI_RANGE_015F_PID 0x015F
6617 ++#define MTXORB_FTDI_RANGE_0160_PID 0x0160
6618 ++#define MTXORB_FTDI_RANGE_0161_PID 0x0161
6619 ++#define MTXORB_FTDI_RANGE_0162_PID 0x0162
6620 ++#define MTXORB_FTDI_RANGE_0163_PID 0x0163
6621 ++#define MTXORB_FTDI_RANGE_0164_PID 0x0164
6622 ++#define MTXORB_FTDI_RANGE_0165_PID 0x0165
6623 ++#define MTXORB_FTDI_RANGE_0166_PID 0x0166
6624 ++#define MTXORB_FTDI_RANGE_0167_PID 0x0167
6625 ++#define MTXORB_FTDI_RANGE_0168_PID 0x0168
6626 ++#define MTXORB_FTDI_RANGE_0169_PID 0x0169
6627 ++#define MTXORB_FTDI_RANGE_016A_PID 0x016A
6628 ++#define MTXORB_FTDI_RANGE_016B_PID 0x016B
6629 ++#define MTXORB_FTDI_RANGE_016C_PID 0x016C
6630 ++#define MTXORB_FTDI_RANGE_016D_PID 0x016D
6631 ++#define MTXORB_FTDI_RANGE_016E_PID 0x016E
6632 ++#define MTXORB_FTDI_RANGE_016F_PID 0x016F
6633 ++#define MTXORB_FTDI_RANGE_0170_PID 0x0170
6634 ++#define MTXORB_FTDI_RANGE_0171_PID 0x0171
6635 ++#define MTXORB_FTDI_RANGE_0172_PID 0x0172
6636 ++#define MTXORB_FTDI_RANGE_0173_PID 0x0173
6637 ++#define MTXORB_FTDI_RANGE_0174_PID 0x0174
6638 ++#define MTXORB_FTDI_RANGE_0175_PID 0x0175
6639 ++#define MTXORB_FTDI_RANGE_0176_PID 0x0176
6640 ++#define MTXORB_FTDI_RANGE_0177_PID 0x0177
6641 ++#define MTXORB_FTDI_RANGE_0178_PID 0x0178
6642 ++#define MTXORB_FTDI_RANGE_0179_PID 0x0179
6643 ++#define MTXORB_FTDI_RANGE_017A_PID 0x017A
6644 ++#define MTXORB_FTDI_RANGE_017B_PID 0x017B
6645 ++#define MTXORB_FTDI_RANGE_017C_PID 0x017C
6646 ++#define MTXORB_FTDI_RANGE_017D_PID 0x017D
6647 ++#define MTXORB_FTDI_RANGE_017E_PID 0x017E
6648 ++#define MTXORB_FTDI_RANGE_017F_PID 0x017F
6649 ++#define MTXORB_FTDI_RANGE_0180_PID 0x0180
6650 ++#define MTXORB_FTDI_RANGE_0181_PID 0x0181
6651 ++#define MTXORB_FTDI_RANGE_0182_PID 0x0182
6652 ++#define MTXORB_FTDI_RANGE_0183_PID 0x0183
6653 ++#define MTXORB_FTDI_RANGE_0184_PID 0x0184
6654 ++#define MTXORB_FTDI_RANGE_0185_PID 0x0185
6655 ++#define MTXORB_FTDI_RANGE_0186_PID 0x0186
6656 ++#define MTXORB_FTDI_RANGE_0187_PID 0x0187
6657 ++#define MTXORB_FTDI_RANGE_0188_PID 0x0188
6658 ++#define MTXORB_FTDI_RANGE_0189_PID 0x0189
6659 ++#define MTXORB_FTDI_RANGE_018A_PID 0x018A
6660 ++#define MTXORB_FTDI_RANGE_018B_PID 0x018B
6661 ++#define MTXORB_FTDI_RANGE_018C_PID 0x018C
6662 ++#define MTXORB_FTDI_RANGE_018D_PID 0x018D
6663 ++#define MTXORB_FTDI_RANGE_018E_PID 0x018E
6664 ++#define MTXORB_FTDI_RANGE_018F_PID 0x018F
6665 ++#define MTXORB_FTDI_RANGE_0190_PID 0x0190
6666 ++#define MTXORB_FTDI_RANGE_0191_PID 0x0191
6667 ++#define MTXORB_FTDI_RANGE_0192_PID 0x0192
6668 ++#define MTXORB_FTDI_RANGE_0193_PID 0x0193
6669 ++#define MTXORB_FTDI_RANGE_0194_PID 0x0194
6670 ++#define MTXORB_FTDI_RANGE_0195_PID 0x0195
6671 ++#define MTXORB_FTDI_RANGE_0196_PID 0x0196
6672 ++#define MTXORB_FTDI_RANGE_0197_PID 0x0197
6673 ++#define MTXORB_FTDI_RANGE_0198_PID 0x0198
6674 ++#define MTXORB_FTDI_RANGE_0199_PID 0x0199
6675 ++#define MTXORB_FTDI_RANGE_019A_PID 0x019A
6676 ++#define MTXORB_FTDI_RANGE_019B_PID 0x019B
6677 ++#define MTXORB_FTDI_RANGE_019C_PID 0x019C
6678 ++#define MTXORB_FTDI_RANGE_019D_PID 0x019D
6679 ++#define MTXORB_FTDI_RANGE_019E_PID 0x019E
6680 ++#define MTXORB_FTDI_RANGE_019F_PID 0x019F
6681 ++#define MTXORB_FTDI_RANGE_01A0_PID 0x01A0
6682 ++#define MTXORB_FTDI_RANGE_01A1_PID 0x01A1
6683 ++#define MTXORB_FTDI_RANGE_01A2_PID 0x01A2
6684 ++#define MTXORB_FTDI_RANGE_01A3_PID 0x01A3
6685 ++#define MTXORB_FTDI_RANGE_01A4_PID 0x01A4
6686 ++#define MTXORB_FTDI_RANGE_01A5_PID 0x01A5
6687 ++#define MTXORB_FTDI_RANGE_01A6_PID 0x01A6
6688 ++#define MTXORB_FTDI_RANGE_01A7_PID 0x01A7
6689 ++#define MTXORB_FTDI_RANGE_01A8_PID 0x01A8
6690 ++#define MTXORB_FTDI_RANGE_01A9_PID 0x01A9
6691 ++#define MTXORB_FTDI_RANGE_01AA_PID 0x01AA
6692 ++#define MTXORB_FTDI_RANGE_01AB_PID 0x01AB
6693 ++#define MTXORB_FTDI_RANGE_01AC_PID 0x01AC
6694 ++#define MTXORB_FTDI_RANGE_01AD_PID 0x01AD
6695 ++#define MTXORB_FTDI_RANGE_01AE_PID 0x01AE
6696 ++#define MTXORB_FTDI_RANGE_01AF_PID 0x01AF
6697 ++#define MTXORB_FTDI_RANGE_01B0_PID 0x01B0
6698 ++#define MTXORB_FTDI_RANGE_01B1_PID 0x01B1
6699 ++#define MTXORB_FTDI_RANGE_01B2_PID 0x01B2
6700 ++#define MTXORB_FTDI_RANGE_01B3_PID 0x01B3
6701 ++#define MTXORB_FTDI_RANGE_01B4_PID 0x01B4
6702 ++#define MTXORB_FTDI_RANGE_01B5_PID 0x01B5
6703 ++#define MTXORB_FTDI_RANGE_01B6_PID 0x01B6
6704 ++#define MTXORB_FTDI_RANGE_01B7_PID 0x01B7
6705 ++#define MTXORB_FTDI_RANGE_01B8_PID 0x01B8
6706 ++#define MTXORB_FTDI_RANGE_01B9_PID 0x01B9
6707 ++#define MTXORB_FTDI_RANGE_01BA_PID 0x01BA
6708 ++#define MTXORB_FTDI_RANGE_01BB_PID 0x01BB
6709 ++#define MTXORB_FTDI_RANGE_01BC_PID 0x01BC
6710 ++#define MTXORB_FTDI_RANGE_01BD_PID 0x01BD
6711 ++#define MTXORB_FTDI_RANGE_01BE_PID 0x01BE
6712 ++#define MTXORB_FTDI_RANGE_01BF_PID 0x01BF
6713 ++#define MTXORB_FTDI_RANGE_01C0_PID 0x01C0
6714 ++#define MTXORB_FTDI_RANGE_01C1_PID 0x01C1
6715 ++#define MTXORB_FTDI_RANGE_01C2_PID 0x01C2
6716 ++#define MTXORB_FTDI_RANGE_01C3_PID 0x01C3
6717 ++#define MTXORB_FTDI_RANGE_01C4_PID 0x01C4
6718 ++#define MTXORB_FTDI_RANGE_01C5_PID 0x01C5
6719 ++#define MTXORB_FTDI_RANGE_01C6_PID 0x01C6
6720 ++#define MTXORB_FTDI_RANGE_01C7_PID 0x01C7
6721 ++#define MTXORB_FTDI_RANGE_01C8_PID 0x01C8
6722 ++#define MTXORB_FTDI_RANGE_01C9_PID 0x01C9
6723 ++#define MTXORB_FTDI_RANGE_01CA_PID 0x01CA
6724 ++#define MTXORB_FTDI_RANGE_01CB_PID 0x01CB
6725 ++#define MTXORB_FTDI_RANGE_01CC_PID 0x01CC
6726 ++#define MTXORB_FTDI_RANGE_01CD_PID 0x01CD
6727 ++#define MTXORB_FTDI_RANGE_01CE_PID 0x01CE
6728 ++#define MTXORB_FTDI_RANGE_01CF_PID 0x01CF
6729 ++#define MTXORB_FTDI_RANGE_01D0_PID 0x01D0
6730 ++#define MTXORB_FTDI_RANGE_01D1_PID 0x01D1
6731 ++#define MTXORB_FTDI_RANGE_01D2_PID 0x01D2
6732 ++#define MTXORB_FTDI_RANGE_01D3_PID 0x01D3
6733 ++#define MTXORB_FTDI_RANGE_01D4_PID 0x01D4
6734 ++#define MTXORB_FTDI_RANGE_01D5_PID 0x01D5
6735 ++#define MTXORB_FTDI_RANGE_01D6_PID 0x01D6
6736 ++#define MTXORB_FTDI_RANGE_01D7_PID 0x01D7
6737 ++#define MTXORB_FTDI_RANGE_01D8_PID 0x01D8
6738 ++#define MTXORB_FTDI_RANGE_01D9_PID 0x01D9
6739 ++#define MTXORB_FTDI_RANGE_01DA_PID 0x01DA
6740 ++#define MTXORB_FTDI_RANGE_01DB_PID 0x01DB
6741 ++#define MTXORB_FTDI_RANGE_01DC_PID 0x01DC
6742 ++#define MTXORB_FTDI_RANGE_01DD_PID 0x01DD
6743 ++#define MTXORB_FTDI_RANGE_01DE_PID 0x01DE
6744 ++#define MTXORB_FTDI_RANGE_01DF_PID 0x01DF
6745 ++#define MTXORB_FTDI_RANGE_01E0_PID 0x01E0
6746 ++#define MTXORB_FTDI_RANGE_01E1_PID 0x01E1
6747 ++#define MTXORB_FTDI_RANGE_01E2_PID 0x01E2
6748 ++#define MTXORB_FTDI_RANGE_01E3_PID 0x01E3
6749 ++#define MTXORB_FTDI_RANGE_01E4_PID 0x01E4
6750 ++#define MTXORB_FTDI_RANGE_01E5_PID 0x01E5
6751 ++#define MTXORB_FTDI_RANGE_01E6_PID 0x01E6
6752 ++#define MTXORB_FTDI_RANGE_01E7_PID 0x01E7
6753 ++#define MTXORB_FTDI_RANGE_01E8_PID 0x01E8
6754 ++#define MTXORB_FTDI_RANGE_01E9_PID 0x01E9
6755 ++#define MTXORB_FTDI_RANGE_01EA_PID 0x01EA
6756 ++#define MTXORB_FTDI_RANGE_01EB_PID 0x01EB
6757 ++#define MTXORB_FTDI_RANGE_01EC_PID 0x01EC
6758 ++#define MTXORB_FTDI_RANGE_01ED_PID 0x01ED
6759 ++#define MTXORB_FTDI_RANGE_01EE_PID 0x01EE
6760 ++#define MTXORB_FTDI_RANGE_01EF_PID 0x01EF
6761 ++#define MTXORB_FTDI_RANGE_01F0_PID 0x01F0
6762 ++#define MTXORB_FTDI_RANGE_01F1_PID 0x01F1
6763 ++#define MTXORB_FTDI_RANGE_01F2_PID 0x01F2
6764 ++#define MTXORB_FTDI_RANGE_01F3_PID 0x01F3
6765 ++#define MTXORB_FTDI_RANGE_01F4_PID 0x01F4
6766 ++#define MTXORB_FTDI_RANGE_01F5_PID 0x01F5
6767 ++#define MTXORB_FTDI_RANGE_01F6_PID 0x01F6
6768 ++#define MTXORB_FTDI_RANGE_01F7_PID 0x01F7
6769 ++#define MTXORB_FTDI_RANGE_01F8_PID 0x01F8
6770 ++#define MTXORB_FTDI_RANGE_01F9_PID 0x01F9
6771 ++#define MTXORB_FTDI_RANGE_01FA_PID 0x01FA
6772 ++#define MTXORB_FTDI_RANGE_01FB_PID 0x01FB
6773 ++#define MTXORB_FTDI_RANGE_01FC_PID 0x01FC
6774 ++#define MTXORB_FTDI_RANGE_01FD_PID 0x01FD
6775 ++#define MTXORB_FTDI_RANGE_01FE_PID 0x01FE
6776 ++#define MTXORB_FTDI_RANGE_01FF_PID 0x01FF
6777 ++
6778 ++
6779 ++
6780 ++/*
6781 ++ * The Mobility Lab (TML)
6782 ++ * Submitted by Pierre Castella
6783 ++ */
6784 ++#define TML_VID 0x1B91 /* Vendor ID */
6785 ++#define TML_USB_SERIAL_PID 0x0064 /* USB - Serial Converter */
6786 ++
6787 ++/* Alti-2 products http://www.alti-2.com */
6788 ++#define ALTI2_VID 0x1BC9
6789 ++#define ALTI2_N3_PID 0x6001 /* Neptune 3 */
6790 ++
6791 ++/*
6792 ++ * Dresden Elektronic Sensor Terminal Board
6793 ++ */
6794 ++#define DE_VID 0x1cf1 /* Vendor ID */
6795 ++#define STB_PID 0x0001 /* Sensor Terminal Board */
6796 ++#define WHT_PID 0x0004 /* Wireless Handheld Terminal */
6797 ++
6798 ++/*
6799 ++ * Papouch products (http://www.papouch.com/)
6800 ++ * Submitted by Folkert van Heusden
6801 ++ */
6802 ++
6803 ++#define PAPOUCH_VID 0x5050 /* Vendor ID */
6804 ++#define PAPOUCH_TMU_PID 0x0400 /* TMU USB Thermometer */
6805 ++#define PAPOUCH_QUIDO4x4_PID 0x0900 /* Quido 4/4 Module */
6806 ++#define PAPOUCH_AD4USB_PID 0x8003 /* AD4USB Measurement Module */
6807 ++
6808 ++/*
6809 ++ * Marvell SheevaPlug
6810 ++ */
6811 ++#define MARVELL_VID 0x9e88
6812 ++#define MARVELL_SHEEVAPLUG_PID 0x9e8f
6813 ++
6814 ++/*
6815 ++ * Evolution Robotics products (http://www.evolution.com/).
6816 ++ * Submitted by Shawn M. Lavelle.
6817 ++ */
6818 ++#define EVOLUTION_VID 0xDEEE /* Vendor ID */
6819 ++#define EVOLUTION_ER1_PID 0x0300 /* ER1 Control Module */
6820 ++#define EVO_8U232AM_PID 0x02FF /* Evolution robotics RCM2 (FT232AM)*/
6821 ++#define EVO_HYBRID_PID 0x0302 /* Evolution robotics RCM4 PID (FT232BM)*/
6822 ++#define EVO_RCM4_PID 0x0303 /* Evolution robotics RCM4 PID */
6823 ++
6824 ++/*
6825 ++ * MJS Gadgets HD Radio / XM Radio / Sirius Radio interfaces (using VID 0x0403)
6826 ++ */
6827 ++#define MJSG_GENERIC_PID 0x9378
6828 ++#define MJSG_SR_RADIO_PID 0x9379
6829 ++#define MJSG_XM_RADIO_PID 0x937A
6830 ++#define MJSG_HD_RADIO_PID 0x937C
6831 +diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
6832 +index 5019325..3689077 100644
6833 +--- a/drivers/usb/serial/sierra.c
6834 ++++ b/drivers/usb/serial/sierra.c
6835 +@@ -567,14 +567,17 @@ static void sierra_indat_callback(struct urb *urb)
6836 + } else {
6837 + if (urb->actual_length) {
6838 + tty = tty_port_tty_get(&port->port);
6839 +-
6840 +- tty_buffer_request_room(tty, urb->actual_length);
6841 +- tty_insert_flip_string(tty, data, urb->actual_length);
6842 +- tty_flip_buffer_push(tty);
6843 +-
6844 +- tty_kref_put(tty);
6845 +- usb_serial_debug_data(debug, &port->dev, __func__,
6846 +- urb->actual_length, data);
6847 ++ if (tty) {
6848 ++ tty_buffer_request_room(tty,
6849 ++ urb->actual_length);
6850 ++ tty_insert_flip_string(tty, data,
6851 ++ urb->actual_length);
6852 ++ tty_flip_buffer_push(tty);
6853 ++
6854 ++ tty_kref_put(tty);
6855 ++ usb_serial_debug_data(debug, &port->dev,
6856 ++ __func__, urb->actual_length, data);
6857 ++ }
6858 + } else {
6859 + dev_dbg(&port->dev, "%s: empty read urb"
6860 + " received\n", __func__);
6861 +diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
6862 +index c932f90..4d0a208 100644
6863 +--- a/drivers/usb/storage/unusual_devs.h
6864 ++++ b/drivers/usb/storage/unusual_devs.h
6865 +@@ -1147,8 +1147,8 @@ UNUSUAL_DEV( 0x0af0, 0x7401, 0x0000, 0x0000,
6866 + 0 ),
6867 +
6868 + /* Reported by Jan Dumon <j.dumon@××××××.com>
6869 +- * This device (wrongly) has a vendor-specific device descriptor.
6870 +- * The entry is needed so usb-storage can bind to it's mass-storage
6871 ++ * These devices (wrongly) have a vendor-specific device descriptor.
6872 ++ * These entries are needed so usb-storage can bind to their mass-storage
6873 + * interface as an interface driver */
6874 + UNUSUAL_DEV( 0x0af0, 0x7501, 0x0000, 0x0000,
6875 + "Option",
6876 +@@ -1156,6 +1156,90 @@ UNUSUAL_DEV( 0x0af0, 0x7501, 0x0000, 0x0000,
6877 + US_SC_DEVICE, US_PR_DEVICE, NULL,
6878 + 0 ),
6879 +
6880 ++UNUSUAL_DEV( 0x0af0, 0x7701, 0x0000, 0x0000,
6881 ++ "Option",
6882 ++ "GI 0451 SD-Card",
6883 ++ US_SC_DEVICE, US_PR_DEVICE, NULL,
6884 ++ 0 ),
6885 ++
6886 ++UNUSUAL_DEV( 0x0af0, 0x7706, 0x0000, 0x0000,
6887 ++ "Option",
6888 ++ "GI 0451 SD-Card",
6889 ++ US_SC_DEVICE, US_PR_DEVICE, NULL,
6890 ++ 0 ),
6891 ++
6892 ++UNUSUAL_DEV( 0x0af0, 0x7901, 0x0000, 0x0000,
6893 ++ "Option",
6894 ++ "GI 0452 SD-Card",
6895 ++ US_SC_DEVICE, US_PR_DEVICE, NULL,
6896 ++ 0 ),
6897 ++
6898 ++UNUSUAL_DEV( 0x0af0, 0x7A01, 0x0000, 0x0000,
6899 ++ "Option",
6900 ++ "GI 0461 SD-Card",
6901 ++ US_SC_DEVICE, US_PR_DEVICE, NULL,
6902 ++ 0 ),
6903 ++
6904 ++UNUSUAL_DEV( 0x0af0, 0x7A05, 0x0000, 0x0000,
6905 ++ "Option",
6906 ++ "GI 0461 SD-Card",
6907 ++ US_SC_DEVICE, US_PR_DEVICE, NULL,
6908 ++ 0 ),
6909 ++
6910 ++UNUSUAL_DEV( 0x0af0, 0x8300, 0x0000, 0x0000,
6911 ++ "Option",
6912 ++ "GI 033x SD-Card",
6913 ++ US_SC_DEVICE, US_PR_DEVICE, NULL,
6914 ++ 0 ),
6915 ++
6916 ++UNUSUAL_DEV( 0x0af0, 0x8302, 0x0000, 0x0000,
6917 ++ "Option",
6918 ++ "GI 033x SD-Card",
6919 ++ US_SC_DEVICE, US_PR_DEVICE, NULL,
6920 ++ 0 ),
6921 ++
6922 ++UNUSUAL_DEV( 0x0af0, 0x8304, 0x0000, 0x0000,
6923 ++ "Option",
6924 ++ "GI 033x SD-Card",
6925 ++ US_SC_DEVICE, US_PR_DEVICE, NULL,
6926 ++ 0 ),
6927 ++
6928 ++UNUSUAL_DEV( 0x0af0, 0xc100, 0x0000, 0x0000,
6929 ++ "Option",
6930 ++ "GI 070x SD-Card",
6931 ++ US_SC_DEVICE, US_PR_DEVICE, NULL,
6932 ++ 0 ),
6933 ++
6934 ++UNUSUAL_DEV( 0x0af0, 0xd057, 0x0000, 0x0000,
6935 ++ "Option",
6936 ++ "GI 1505 SD-Card",
6937 ++ US_SC_DEVICE, US_PR_DEVICE, NULL,
6938 ++ 0 ),
6939 ++
6940 ++UNUSUAL_DEV( 0x0af0, 0xd058, 0x0000, 0x0000,
6941 ++ "Option",
6942 ++ "GI 1509 SD-Card",
6943 ++ US_SC_DEVICE, US_PR_DEVICE, NULL,
6944 ++ 0 ),
6945 ++
6946 ++UNUSUAL_DEV( 0x0af0, 0xd157, 0x0000, 0x0000,
6947 ++ "Option",
6948 ++ "GI 1515 SD-Card",
6949 ++ US_SC_DEVICE, US_PR_DEVICE, NULL,
6950 ++ 0 ),
6951 ++
6952 ++UNUSUAL_DEV( 0x0af0, 0xd257, 0x0000, 0x0000,
6953 ++ "Option",
6954 ++ "GI 1215 SD-Card",
6955 ++ US_SC_DEVICE, US_PR_DEVICE, NULL,
6956 ++ 0 ),
6957 ++
6958 ++UNUSUAL_DEV( 0x0af0, 0xd357, 0x0000, 0x0000,
6959 ++ "Option",
6960 ++ "GI 1505 SD-Card",
6961 ++ US_SC_DEVICE, US_PR_DEVICE, NULL,
6962 ++ 0 ),
6963 ++
6964 + /* Reported by Ben Efros <ben@×××××××××.com> */
6965 + UNUSUAL_DEV( 0x0bc2, 0x3010, 0x0000, 0x0000,
6966 + "Seagate",
6967 +diff --git a/drivers/video/offb.c b/drivers/video/offb.c
6968 +index 4d8c54c..b043ac8 100644
6969 +--- a/drivers/video/offb.c
6970 ++++ b/drivers/video/offb.c
6971 +@@ -282,8 +282,17 @@ static int offb_set_par(struct fb_info *info)
6972 + return 0;
6973 + }
6974 +
6975 ++static void offb_destroy(struct fb_info *info)
6976 ++{
6977 ++ if (info->screen_base)
6978 ++ iounmap(info->screen_base);
6979 ++ release_mem_region(info->aperture_base, info->aperture_size);
6980 ++ framebuffer_release(info);
6981 ++}
6982 ++
6983 + static struct fb_ops offb_ops = {
6984 + .owner = THIS_MODULE,
6985 ++ .fb_destroy = offb_destroy,
6986 + .fb_setcolreg = offb_setcolreg,
6987 + .fb_set_par = offb_set_par,
6988 + .fb_blank = offb_blank,
6989 +@@ -482,10 +491,14 @@ static void __init offb_init_fb(const char *name, const char *full_name,
6990 + var->sync = 0;
6991 + var->vmode = FB_VMODE_NONINTERLACED;
6992 +
6993 ++ /* set offb aperture size for generic probing */
6994 ++ info->aperture_base = address;
6995 ++ info->aperture_size = fix->smem_len;
6996 ++
6997 + info->fbops = &offb_ops;
6998 + info->screen_base = ioremap(address, fix->smem_len);
6999 + info->pseudo_palette = (void *) (info + 1);
7000 +- info->flags = FBINFO_DEFAULT | foreign_endian;
7001 ++ info->flags = FBINFO_DEFAULT | FBINFO_MISC_FIRMWARE | foreign_endian;
7002 +
7003 + fb_alloc_cmap(&info->cmap, 256, 0);
7004 +
7005 +diff --git a/drivers/video/sunxvr500.c b/drivers/video/sunxvr500.c
7006 +index 18b9507..4cd5049 100644
7007 +--- a/drivers/video/sunxvr500.c
7008 ++++ b/drivers/video/sunxvr500.c
7009 +@@ -400,6 +400,7 @@ static void __devexit e3d_pci_unregister(struct pci_dev *pdev)
7010 +
7011 + static struct pci_device_id e3d_pci_table[] = {
7012 + { PCI_DEVICE(PCI_VENDOR_ID_3DLABS, 0x7a0), },
7013 ++ { PCI_DEVICE(0x1091, 0x7a0), },
7014 + { PCI_DEVICE(PCI_VENDOR_ID_3DLABS, 0x7a2), },
7015 + { .vendor = PCI_VENDOR_ID_3DLABS,
7016 + .device = PCI_ANY_ID,
7017 +diff --git a/drivers/watchdog/bfin_wdt.c b/drivers/watchdog/bfin_wdt.c
7018 +index c7b3f9d..2159e66 100644
7019 +--- a/drivers/watchdog/bfin_wdt.c
7020 ++++ b/drivers/watchdog/bfin_wdt.c
7021 +@@ -1,9 +1,8 @@
7022 + /*
7023 + * Blackfin On-Chip Watchdog Driver
7024 +- * Supports BF53[123]/BF53[467]/BF54[2489]/BF561
7025 + *
7026 + * Originally based on softdog.c
7027 +- * Copyright 2006-2007 Analog Devices Inc.
7028 ++ * Copyright 2006-2010 Analog Devices Inc.
7029 + * Copyright 2006-2007 Michele d'Amico
7030 + * Copyright 1996 Alan Cox <alan@××××××××××××××××.uk>
7031 + *
7032 +@@ -137,13 +136,15 @@ static int bfin_wdt_running(void)
7033 + */
7034 + static int bfin_wdt_set_timeout(unsigned long t)
7035 + {
7036 +- u32 cnt;
7037 ++ u32 cnt, max_t, sclk;
7038 + unsigned long flags;
7039 +
7040 +- stampit();
7041 ++ sclk = get_sclk();
7042 ++ max_t = -1 / sclk;
7043 ++ cnt = t * sclk;
7044 ++ stamp("maxtimeout=%us newtimeout=%lus (cnt=%#x)", max_t, t, cnt);
7045 +
7046 +- cnt = t * get_sclk();
7047 +- if (cnt < get_sclk()) {
7048 ++ if (t > max_t) {
7049 + printk(KERN_WARNING PFX "timeout value is too large\n");
7050 + return -EINVAL;
7051 + }
7052 +diff --git a/fs/exec.c b/fs/exec.c
7053 +index da36c20..9b88366 100644
7054 +--- a/fs/exec.c
7055 ++++ b/fs/exec.c
7056 +@@ -638,7 +638,6 @@ int setup_arg_pages(struct linux_binprm *bprm,
7057 + * will align it up.
7058 + */
7059 + rlim_stack = rlimit(RLIMIT_STACK) & PAGE_MASK;
7060 +- rlim_stack = min(rlim_stack, stack_size);
7061 + #ifdef CONFIG_STACK_GROWSUP
7062 + if (stack_size + stack_expand > rlim_stack)
7063 + stack_base = vma->vm_start + rlim_stack;
7064 +diff --git a/fs/file_table.c b/fs/file_table.c
7065 +index 8eb4404..666c7ce 100644
7066 +--- a/fs/file_table.c
7067 ++++ b/fs/file_table.c
7068 +@@ -420,7 +420,9 @@ retry:
7069 + continue;
7070 + if (!(f->f_mode & FMODE_WRITE))
7071 + continue;
7072 ++ spin_lock(&f->f_lock);
7073 + f->f_mode &= ~FMODE_WRITE;
7074 ++ spin_unlock(&f->f_lock);
7075 + if (file_check_writeable(f) != 0)
7076 + continue;
7077 + file_release_write(f);
7078 +diff --git a/fs/namei.c b/fs/namei.c
7079 +index a2b3c28..b0afbd4 100644
7080 +--- a/fs/namei.c
7081 ++++ b/fs/namei.c
7082 +@@ -829,6 +829,17 @@ fail:
7083 + }
7084 +
7085 + /*
7086 ++ * This is a temporary kludge to deal with "automount" symlinks; proper
7087 ++ * solution is to trigger them on follow_mount(), so that do_lookup()
7088 ++ * would DTRT. To be killed before 2.6.34-final.
7089 ++ */
7090 ++static inline int follow_on_final(struct inode *inode, unsigned lookup_flags)
7091 ++{
7092 ++ return inode && unlikely(inode->i_op->follow_link) &&
7093 ++ ((lookup_flags & LOOKUP_FOLLOW) || S_ISDIR(inode->i_mode));
7094 ++}
7095 ++
7096 ++/*
7097 + * Name resolution.
7098 + * This is the basic name resolution function, turning a pathname into
7099 + * the final dentry. We expect 'base' to be positive and a directory.
7100 +@@ -964,8 +975,7 @@ last_component:
7101 + if (err)
7102 + break;
7103 + inode = next.dentry->d_inode;
7104 +- if ((lookup_flags & LOOKUP_FOLLOW)
7105 +- && inode && inode->i_op->follow_link) {
7106 ++ if (follow_on_final(inode, lookup_flags)) {
7107 + err = do_follow_link(&next, nd);
7108 + if (err)
7109 + goto return_err;
7110 +diff --git a/fs/nfs/dns_resolve.c b/fs/nfs/dns_resolve.c
7111 +index f4d54ba..c1fd68b 100644
7112 +--- a/fs/nfs/dns_resolve.c
7113 ++++ b/fs/nfs/dns_resolve.c
7114 +@@ -36,6 +36,19 @@ struct nfs_dns_ent {
7115 + };
7116 +
7117 +
7118 ++static void nfs_dns_ent_update(struct cache_head *cnew,
7119 ++ struct cache_head *ckey)
7120 ++{
7121 ++ struct nfs_dns_ent *new;
7122 ++ struct nfs_dns_ent *key;
7123 ++
7124 ++ new = container_of(cnew, struct nfs_dns_ent, h);
7125 ++ key = container_of(ckey, struct nfs_dns_ent, h);
7126 ++
7127 ++ memcpy(&new->addr, &key->addr, key->addrlen);
7128 ++ new->addrlen = key->addrlen;
7129 ++}
7130 ++
7131 + static void nfs_dns_ent_init(struct cache_head *cnew,
7132 + struct cache_head *ckey)
7133 + {
7134 +@@ -49,8 +62,7 @@ static void nfs_dns_ent_init(struct cache_head *cnew,
7135 + new->hostname = kstrndup(key->hostname, key->namelen, GFP_KERNEL);
7136 + if (new->hostname) {
7137 + new->namelen = key->namelen;
7138 +- memcpy(&new->addr, &key->addr, key->addrlen);
7139 +- new->addrlen = key->addrlen;
7140 ++ nfs_dns_ent_update(cnew, ckey);
7141 + } else {
7142 + new->namelen = 0;
7143 + new->addrlen = 0;
7144 +@@ -234,7 +246,7 @@ static struct cache_detail nfs_dns_resolve = {
7145 + .cache_show = nfs_dns_show,
7146 + .match = nfs_dns_match,
7147 + .init = nfs_dns_ent_init,
7148 +- .update = nfs_dns_ent_init,
7149 ++ .update = nfs_dns_ent_update,
7150 + .alloc = nfs_dns_ent_alloc,
7151 + };
7152 +
7153 +diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
7154 +index 2153f9b..6ad6282 100644
7155 +--- a/fs/nfsd/nfs4state.c
7156 ++++ b/fs/nfsd/nfs4state.c
7157 +@@ -2002,7 +2002,9 @@ nfs4_file_downgrade(struct file *filp, unsigned int share_access)
7158 + {
7159 + if (share_access & NFS4_SHARE_ACCESS_WRITE) {
7160 + drop_file_write_access(filp);
7161 ++ spin_lock(&filp->f_lock);
7162 + filp->f_mode = (filp->f_mode | FMODE_READ) & ~FMODE_WRITE;
7163 ++ spin_unlock(&filp->f_lock);
7164 + }
7165 + }
7166 +
7167 +diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
7168 +index deb2b13..5fc918c 100644
7169 +--- a/fs/ocfs2/aops.c
7170 ++++ b/fs/ocfs2/aops.c
7171 +@@ -591,8 +591,9 @@ static int ocfs2_direct_IO_get_blocks(struct inode *inode, sector_t iblock,
7172 + goto bail;
7173 + }
7174 +
7175 +- /* We should already CoW the refcounted extent. */
7176 +- BUG_ON(ext_flags & OCFS2_EXT_REFCOUNTED);
7177 ++ /* We should already CoW the refcounted extent in case of create. */
7178 ++ BUG_ON(create && (ext_flags & OCFS2_EXT_REFCOUNTED));
7179 ++
7180 + /*
7181 + * get_more_blocks() expects us to describe a hole by clearing
7182 + * the mapped bit on bh_result().
7183 +diff --git a/fs/proc/base.c b/fs/proc/base.c
7184 +index af643b5..6d71c67 100644
7185 +--- a/fs/proc/base.c
7186 ++++ b/fs/proc/base.c
7187 +@@ -2304,16 +2304,30 @@ static void *proc_self_follow_link(struct dentry *dentry, struct nameidata *nd)
7188 + {
7189 + struct pid_namespace *ns = dentry->d_sb->s_fs_info;
7190 + pid_t tgid = task_tgid_nr_ns(current, ns);
7191 +- char tmp[PROC_NUMBUF];
7192 +- if (!tgid)
7193 +- return ERR_PTR(-ENOENT);
7194 +- sprintf(tmp, "%d", task_tgid_nr_ns(current, ns));
7195 +- return ERR_PTR(vfs_follow_link(nd,tmp));
7196 ++ char *name = ERR_PTR(-ENOENT);
7197 ++ if (tgid) {
7198 ++ name = __getname();
7199 ++ if (!name)
7200 ++ name = ERR_PTR(-ENOMEM);
7201 ++ else
7202 ++ sprintf(name, "%d", tgid);
7203 ++ }
7204 ++ nd_set_link(nd, name);
7205 ++ return NULL;
7206 ++}
7207 ++
7208 ++static void proc_self_put_link(struct dentry *dentry, struct nameidata *nd,
7209 ++ void *cookie)
7210 ++{
7211 ++ char *s = nd_get_link(nd);
7212 ++ if (!IS_ERR(s))
7213 ++ __putname(s);
7214 + }
7215 +
7216 + static const struct inode_operations proc_self_inode_operations = {
7217 + .readlink = proc_self_readlink,
7218 + .follow_link = proc_self_follow_link,
7219 ++ .put_link = proc_self_put_link,
7220 + };
7221 +
7222 + /*
7223 +diff --git a/include/linux/fs.h b/include/linux/fs.h
7224 +index 98ea200..692a3ee 100644
7225 +--- a/include/linux/fs.h
7226 ++++ b/include/linux/fs.h
7227 +@@ -87,6 +87,9 @@ struct inodes_stat_t {
7228 + */
7229 + #define FMODE_NOCMTIME ((__force fmode_t)2048)
7230 +
7231 ++/* Expect random access pattern */
7232 ++#define FMODE_RANDOM ((__force fmode_t)4096)
7233 ++
7234 + /*
7235 + * The below are the various read and write types that we support. Some of
7236 + * them include behavioral modifiers that send information down to the
7237 +diff --git a/include/linux/irq.h b/include/linux/irq.h
7238 +index ae9653d..9e5f45a 100644
7239 +--- a/include/linux/irq.h
7240 ++++ b/include/linux/irq.h
7241 +@@ -400,7 +400,9 @@ static inline int irq_has_action(unsigned int irq)
7242 +
7243 + /* Dynamic irq helper functions */
7244 + extern void dynamic_irq_init(unsigned int irq);
7245 ++void dynamic_irq_init_keep_chip_data(unsigned int irq);
7246 + extern void dynamic_irq_cleanup(unsigned int irq);
7247 ++void dynamic_irq_cleanup_keep_chip_data(unsigned int irq);
7248 +
7249 + /* Set/get chip/data for an IRQ: */
7250 + extern int set_irq_chip(unsigned int irq, struct irq_chip *chip);
7251 +diff --git a/include/linux/sched.h b/include/linux/sched.h
7252 +index e48311e..70abfd3 100644
7253 +--- a/include/linux/sched.h
7254 ++++ b/include/linux/sched.h
7255 +@@ -864,7 +864,10 @@ static inline int sd_balance_for_mc_power(void)
7256 + if (sched_smt_power_savings)
7257 + return SD_POWERSAVINGS_BALANCE;
7258 +
7259 +- return SD_PREFER_SIBLING;
7260 ++ if (!sched_mc_power_savings)
7261 ++ return SD_PREFER_SIBLING;
7262 ++
7263 ++ return 0;
7264 + }
7265 +
7266 + static inline int sd_balance_for_package_power(void)
7267 +diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
7268 +index c166019..e570d19 100644
7269 +--- a/kernel/irq/chip.c
7270 ++++ b/kernel/irq/chip.c
7271 +@@ -18,11 +18,7 @@
7272 +
7273 + #include "internals.h"
7274 +
7275 +-/**
7276 +- * dynamic_irq_init - initialize a dynamically allocated irq
7277 +- * @irq: irq number to initialize
7278 +- */
7279 +-void dynamic_irq_init(unsigned int irq)
7280 ++static void dynamic_irq_init_x(unsigned int irq, bool keep_chip_data)
7281 + {
7282 + struct irq_desc *desc;
7283 + unsigned long flags;
7284 +@@ -41,7 +37,8 @@ void dynamic_irq_init(unsigned int irq)
7285 + desc->depth = 1;
7286 + desc->msi_desc = NULL;
7287 + desc->handler_data = NULL;
7288 +- desc->chip_data = NULL;
7289 ++ if (!keep_chip_data)
7290 ++ desc->chip_data = NULL;
7291 + desc->action = NULL;
7292 + desc->irq_count = 0;
7293 + desc->irqs_unhandled = 0;
7294 +@@ -55,10 +52,26 @@ void dynamic_irq_init(unsigned int irq)
7295 + }
7296 +
7297 + /**
7298 +- * dynamic_irq_cleanup - cleanup a dynamically allocated irq
7299 ++ * dynamic_irq_init - initialize a dynamically allocated irq
7300 + * @irq: irq number to initialize
7301 + */
7302 +-void dynamic_irq_cleanup(unsigned int irq)
7303 ++void dynamic_irq_init(unsigned int irq)
7304 ++{
7305 ++ dynamic_irq_init_x(irq, false);
7306 ++}
7307 ++
7308 ++/**
7309 ++ * dynamic_irq_init_keep_chip_data - initialize a dynamically allocated irq
7310 ++ * @irq: irq number to initialize
7311 ++ *
7312 ++ * does not set irq_to_desc(irq)->chip_data to NULL
7313 ++ */
7314 ++void dynamic_irq_init_keep_chip_data(unsigned int irq)
7315 ++{
7316 ++ dynamic_irq_init_x(irq, true);
7317 ++}
7318 ++
7319 ++static void dynamic_irq_cleanup_x(unsigned int irq, bool keep_chip_data)
7320 + {
7321 + struct irq_desc *desc = irq_to_desc(irq);
7322 + unsigned long flags;
7323 +@@ -77,7 +90,8 @@ void dynamic_irq_cleanup(unsigned int irq)
7324 + }
7325 + desc->msi_desc = NULL;
7326 + desc->handler_data = NULL;
7327 +- desc->chip_data = NULL;
7328 ++ if (!keep_chip_data)
7329 ++ desc->chip_data = NULL;
7330 + desc->handle_irq = handle_bad_irq;
7331 + desc->chip = &no_irq_chip;
7332 + desc->name = NULL;
7333 +@@ -85,6 +99,26 @@ void dynamic_irq_cleanup(unsigned int irq)
7334 + spin_unlock_irqrestore(&desc->lock, flags);
7335 + }
7336 +
7337 ++/**
7338 ++ * dynamic_irq_cleanup - cleanup a dynamically allocated irq
7339 ++ * @irq: irq number to initialize
7340 ++ */
7341 ++void dynamic_irq_cleanup(unsigned int irq)
7342 ++{
7343 ++ dynamic_irq_cleanup_x(irq, false);
7344 ++}
7345 ++
7346 ++/**
7347 ++ * dynamic_irq_cleanup_keep_chip_data - cleanup a dynamically allocated irq
7348 ++ * @irq: irq number to initialize
7349 ++ *
7350 ++ * does not set irq_to_desc(irq)->chip_data to NULL
7351 ++ */
7352 ++void dynamic_irq_cleanup_keep_chip_data(unsigned int irq)
7353 ++{
7354 ++ dynamic_irq_cleanup_x(irq, true);
7355 ++}
7356 ++
7357 +
7358 + /**
7359 + * set_irq_chip - set the irq chip for an irq
7360 +diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
7361 +index 36cb168..fc9ed15 100644
7362 +--- a/kernel/power/snapshot.c
7363 ++++ b/kernel/power/snapshot.c
7364 +@@ -1181,7 +1181,7 @@ static void free_unnecessary_pages(void)
7365 +
7366 + memory_bm_position_reset(&copy_bm);
7367 +
7368 +- while (to_free_normal > 0 && to_free_highmem > 0) {
7369 ++ while (to_free_normal > 0 || to_free_highmem > 0) {
7370 + unsigned long pfn = memory_bm_next_pfn(&copy_bm);
7371 + struct page *page = pfn_to_page(pfn);
7372 +
7373 +diff --git a/kernel/sched.c b/kernel/sched.c
7374 +index 60d74cc..380e1fa 100644
7375 +--- a/kernel/sched.c
7376 ++++ b/kernel/sched.c
7377 +@@ -4098,12 +4098,23 @@ find_busiest_queue(struct sched_group *group, enum cpu_idle_type idle,
7378 + continue;
7379 +
7380 + rq = cpu_rq(i);
7381 +- wl = weighted_cpuload(i) * SCHED_LOAD_SCALE;
7382 +- wl /= power;
7383 ++ wl = weighted_cpuload(i);
7384 +
7385 ++ /*
7386 ++ * When comparing with imbalance, use weighted_cpuload()
7387 ++ * which is not scaled with the cpu power.
7388 ++ */
7389 + if (capacity && rq->nr_running == 1 && wl > imbalance)
7390 + continue;
7391 +
7392 ++ /*
7393 ++ * For the load comparisons with the other cpu's, consider
7394 ++ * the weighted_cpuload() scaled with the cpu power, so that
7395 ++ * the load can be moved away from the cpu that is potentially
7396 ++ * running at a lower capacity.
7397 ++ */
7398 ++ wl = (wl * SCHED_LOAD_SCALE) / power;
7399 ++
7400 + if (wl > max_load) {
7401 + max_load = wl;
7402 + busiest = rq;
7403 +@@ -5998,7 +6009,7 @@ void rt_mutex_setprio(struct task_struct *p, int prio)
7404 + unsigned long flags;
7405 + int oldprio, on_rq, running;
7406 + struct rq *rq;
7407 +- const struct sched_class *prev_class = p->sched_class;
7408 ++ const struct sched_class *prev_class;
7409 +
7410 + BUG_ON(prio < 0 || prio > MAX_PRIO);
7411 +
7412 +@@ -6006,6 +6017,7 @@ void rt_mutex_setprio(struct task_struct *p, int prio)
7413 + update_rq_clock(rq);
7414 +
7415 + oldprio = p->prio;
7416 ++ prev_class = p->sched_class;
7417 + on_rq = p->se.on_rq;
7418 + running = task_current(rq, p);
7419 + if (on_rq)
7420 +@@ -6233,7 +6245,7 @@ static int __sched_setscheduler(struct task_struct *p, int policy,
7421 + {
7422 + int retval, oldprio, oldpolicy = -1, on_rq, running;
7423 + unsigned long flags;
7424 +- const struct sched_class *prev_class = p->sched_class;
7425 ++ const struct sched_class *prev_class;
7426 + struct rq *rq;
7427 + int reset_on_fork;
7428 +
7429 +@@ -6347,6 +6359,7 @@ recheck:
7430 + p->sched_reset_on_fork = reset_on_fork;
7431 +
7432 + oldprio = p->prio;
7433 ++ prev_class = p->sched_class;
7434 + __setscheduler(rq, p, policy, param->sched_priority);
7435 +
7436 + if (running)
7437 +diff --git a/lib/idr.c b/lib/idr.c
7438 +index 80ca9ac..eda7ba3 100644
7439 +--- a/lib/idr.c
7440 ++++ b/lib/idr.c
7441 +@@ -156,10 +156,12 @@ static int sub_alloc(struct idr *idp, int *starting_id, struct idr_layer **pa)
7442 + id = (id | ((1 << (IDR_BITS * l)) - 1)) + 1;
7443 +
7444 + /* if already at the top layer, we need to grow */
7445 +- if (!(p = pa[l])) {
7446 ++ if (id >= 1 << (idp->layers * IDR_BITS)) {
7447 + *starting_id = id;
7448 + return IDR_NEED_TO_GROW;
7449 + }
7450 ++ p = pa[l];
7451 ++ BUG_ON(!p);
7452 +
7453 + /* If we need to go up one layer, continue the
7454 + * loop; otherwise, restart from the top.
7455 +diff --git a/mm/fadvise.c b/mm/fadvise.c
7456 +index e433592..8d723c9 100644
7457 +--- a/mm/fadvise.c
7458 ++++ b/mm/fadvise.c
7459 +@@ -77,12 +77,20 @@ SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice)
7460 + switch (advice) {
7461 + case POSIX_FADV_NORMAL:
7462 + file->f_ra.ra_pages = bdi->ra_pages;
7463 ++ spin_lock(&file->f_lock);
7464 ++ file->f_mode &= ~FMODE_RANDOM;
7465 ++ spin_unlock(&file->f_lock);
7466 + break;
7467 + case POSIX_FADV_RANDOM:
7468 +- file->f_ra.ra_pages = 0;
7469 ++ spin_lock(&file->f_lock);
7470 ++ file->f_mode |= FMODE_RANDOM;
7471 ++ spin_unlock(&file->f_lock);
7472 + break;
7473 + case POSIX_FADV_SEQUENTIAL:
7474 + file->f_ra.ra_pages = bdi->ra_pages * 2;
7475 ++ spin_lock(&file->f_lock);
7476 ++ file->f_mode &= ~FMODE_RANDOM;
7477 ++ spin_unlock(&file->f_lock);
7478 + break;
7479 + case POSIX_FADV_WILLNEED:
7480 + if (!mapping->a_ops->readpage) {
7481 +diff --git a/mm/oom_kill.c b/mm/oom_kill.c
7482 +index 9092b43..83cd9bb 100644
7483 +--- a/mm/oom_kill.c
7484 ++++ b/mm/oom_kill.c
7485 +@@ -426,6 +426,8 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
7486 + list_for_each_entry(c, &p->children, sibling) {
7487 + if (c->mm == p->mm)
7488 + continue;
7489 ++ if (mem && !task_in_mem_cgroup(c, mem))
7490 ++ continue;
7491 + if (!oom_kill_task(c))
7492 + return 0;
7493 + }
7494 +diff --git a/mm/readahead.c b/mm/readahead.c
7495 +index aa1aa23..8f40b47 100644
7496 +--- a/mm/readahead.c
7497 ++++ b/mm/readahead.c
7498 +@@ -501,6 +501,12 @@ void page_cache_sync_readahead(struct address_space *mapping,
7499 + if (!ra->ra_pages)
7500 + return;
7501 +
7502 ++ /* be dumb */
7503 ++ if (filp->f_mode & FMODE_RANDOM) {
7504 ++ force_page_cache_readahead(mapping, filp, offset, req_size);
7505 ++ return;
7506 ++ }
7507 ++
7508 + /* do read-ahead */
7509 + ondemand_readahead(mapping, ra, filp, false, offset, req_size);
7510 + }
7511 +diff --git a/mm/slab.c b/mm/slab.c
7512 +index 7dfa481..5d1a782 100644
7513 +--- a/mm/slab.c
7514 ++++ b/mm/slab.c
7515 +@@ -971,13 +971,11 @@ static struct array_cache **alloc_alien_cache(int node, int limit, gfp_t gfp)
7516 +
7517 + if (limit > 1)
7518 + limit = 12;
7519 +- ac_ptr = kmalloc_node(memsize, gfp, node);
7520 ++ ac_ptr = kzalloc_node(memsize, gfp, node);
7521 + if (ac_ptr) {
7522 + for_each_node(i) {
7523 +- if (i == node || !node_online(i)) {
7524 +- ac_ptr[i] = NULL;
7525 ++ if (i == node || !node_online(i))
7526 + continue;
7527 +- }
7528 + ac_ptr[i] = alloc_arraycache(node, limit, 0xbaadf00d, gfp);
7529 + if (!ac_ptr[i]) {
7530 + for (i--; i >= 0; i--)
7531 +diff --git a/net/core/dev.c b/net/core/dev.c
7532 +index 584046e..74d0cce 100644
7533 +--- a/net/core/dev.c
7534 ++++ b/net/core/dev.c
7535 +@@ -2630,7 +2630,7 @@ int napi_frags_finish(struct napi_struct *napi, struct sk_buff *skb, int ret)
7536 + switch (ret) {
7537 + case GRO_NORMAL:
7538 + case GRO_HELD:
7539 +- skb->protocol = eth_type_trans(skb, napi->dev);
7540 ++ skb->protocol = eth_type_trans(skb, skb->dev);
7541 +
7542 + if (ret == GRO_NORMAL)
7543 + return netif_receive_skb(skb);
7544 +diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
7545 +index 427ded8..d5617d4 100644
7546 +--- a/net/core/net-sysfs.c
7547 ++++ b/net/core/net-sysfs.c
7548 +@@ -366,7 +366,8 @@ static ssize_t wireless_show(struct device *d, char *buf,
7549 + const struct iw_statistics *iw;
7550 + ssize_t ret = -EINVAL;
7551 +
7552 +- rtnl_lock();
7553 ++ if (!rtnl_trylock())
7554 ++ return restart_syscall();
7555 + if (dev_isalive(dev)) {
7556 + iw = get_wireless_stats(dev);
7557 + if (iw)
7558 +diff --git a/net/core/scm.c b/net/core/scm.c
7559 +index b7ba91b..9b26463 100644
7560 +--- a/net/core/scm.c
7561 ++++ b/net/core/scm.c
7562 +@@ -156,6 +156,8 @@ int __scm_send(struct socket *sock, struct msghdr *msg, struct scm_cookie *p)
7563 + switch (cmsg->cmsg_type)
7564 + {
7565 + case SCM_RIGHTS:
7566 ++ if (!sock->ops || sock->ops->family != PF_UNIX)
7567 ++ goto error;
7568 + err=scm_fp_copy(cmsg, &p->fp);
7569 + if (err<0)
7570 + goto error;
7571 +diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
7572 +index 0030e73..cc35645 100644
7573 +--- a/net/ipv4/devinet.c
7574 ++++ b/net/ipv4/devinet.c
7575 +@@ -1351,14 +1351,19 @@ static int devinet_sysctl_forward(ctl_table *ctl, int write,
7576 + {
7577 + int *valp = ctl->data;
7578 + int val = *valp;
7579 ++ loff_t pos = *ppos;
7580 + int ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
7581 +
7582 + if (write && *valp != val) {
7583 + struct net *net = ctl->extra2;
7584 +
7585 + if (valp != &IPV4_DEVCONF_DFLT(net, FORWARDING)) {
7586 +- if (!rtnl_trylock())
7587 ++ if (!rtnl_trylock()) {
7588 ++ /* Restore the original values before restarting */
7589 ++ *valp = val;
7590 ++ *ppos = pos;
7591 + return restart_syscall();
7592 ++ }
7593 + if (valp == &IPV4_DEVCONF_ALL(net, FORWARDING)) {
7594 + inet_forward_change(net);
7595 + } else if (*valp) {
7596 +diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
7597 +index d41e5de..169da93 100644
7598 +--- a/net/ipv4/igmp.c
7599 ++++ b/net/ipv4/igmp.c
7600 +@@ -946,7 +946,6 @@ int igmp_rcv(struct sk_buff *skb)
7601 + break;
7602 + case IGMP_HOST_MEMBERSHIP_REPORT:
7603 + case IGMPV2_HOST_MEMBERSHIP_REPORT:
7604 +- case IGMPV3_HOST_MEMBERSHIP_REPORT:
7605 + /* Is it our report looped back? */
7606 + if (skb_rtable(skb)->fl.iif == 0)
7607 + break;
7608 +@@ -960,6 +959,7 @@ int igmp_rcv(struct sk_buff *skb)
7609 + in_dev_put(in_dev);
7610 + return pim_rcv_v1(skb);
7611 + #endif
7612 ++ case IGMPV3_HOST_MEMBERSHIP_REPORT:
7613 + case IGMP_DVMRP:
7614 + case IGMP_TRACE:
7615 + case IGMP_HOST_LEAVE_MESSAGE:
7616 +diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
7617 +index 1fd0a3d..d1f77cc 100644
7618 +--- a/net/ipv6/addrconf.c
7619 ++++ b/net/ipv6/addrconf.c
7620 +@@ -504,8 +504,11 @@ static int addrconf_fixup_forwarding(struct ctl_table *table, int *p, int old)
7621 + if (p == &net->ipv6.devconf_dflt->forwarding)
7622 + return 0;
7623 +
7624 +- if (!rtnl_trylock())
7625 ++ if (!rtnl_trylock()) {
7626 ++ /* Restore the original values before restarting */
7627 ++ *p = old;
7628 + return restart_syscall();
7629 ++ }
7630 +
7631 + if (p == &net->ipv6.devconf_all->forwarding) {
7632 + __s32 newf = net->ipv6.devconf_all->forwarding;
7633 +@@ -3991,12 +3994,15 @@ int addrconf_sysctl_forward(ctl_table *ctl, int write,
7634 + {
7635 + int *valp = ctl->data;
7636 + int val = *valp;
7637 ++ loff_t pos = *ppos;
7638 + int ret;
7639 +
7640 + ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
7641 +
7642 + if (write)
7643 + ret = addrconf_fixup_forwarding(ctl, valp, val);
7644 ++ if (ret)
7645 ++ *ppos = pos;
7646 + return ret;
7647 + }
7648 +
7649 +@@ -4075,8 +4081,11 @@ static int addrconf_disable_ipv6(struct ctl_table *table, int *p, int old)
7650 + if (p == &net->ipv6.devconf_dflt->disable_ipv6)
7651 + return 0;
7652 +
7653 +- if (!rtnl_trylock())
7654 ++ if (!rtnl_trylock()) {
7655 ++ /* Restore the original values before restarting */
7656 ++ *p = old;
7657 + return restart_syscall();
7658 ++ }
7659 +
7660 + if (p == &net->ipv6.devconf_all->disable_ipv6) {
7661 + __s32 newf = net->ipv6.devconf_all->disable_ipv6;
7662 +@@ -4095,12 +4104,15 @@ int addrconf_sysctl_disable(ctl_table *ctl, int write,
7663 + {
7664 + int *valp = ctl->data;
7665 + int val = *valp;
7666 ++ loff_t pos = *ppos;
7667 + int ret;
7668 +
7669 + ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
7670 +
7671 + if (write)
7672 + ret = addrconf_disable_ipv6(ctl, valp, val);
7673 ++ if (ret)
7674 ++ *ppos = pos;
7675 + return ret;
7676 + }
7677 +
7678 +diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
7679 +index 4b6a539..bfc8737 100644
7680 +--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
7681 ++++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
7682 +@@ -63,6 +63,7 @@ struct nf_ct_frag6_queue
7683 + struct inet_frag_queue q;
7684 +
7685 + __be32 id; /* fragment id */
7686 ++ u32 user;
7687 + struct in6_addr saddr;
7688 + struct in6_addr daddr;
7689 +
7690 +diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
7691 +index 89e238b..9144ef0 100644
7692 +--- a/net/mac80211/agg-tx.c
7693 ++++ b/net/mac80211/agg-tx.c
7694 +@@ -177,7 +177,8 @@ static void sta_addba_resp_timer_expired(unsigned long data)
7695 +
7696 + /* check if the TID waits for addBA response */
7697 + spin_lock_bh(&sta->lock);
7698 +- if ((*state & (HT_ADDBA_REQUESTED_MSK | HT_ADDBA_RECEIVED_MSK)) !=
7699 ++ if ((*state & (HT_ADDBA_REQUESTED_MSK | HT_ADDBA_RECEIVED_MSK |
7700 ++ HT_AGG_STATE_REQ_STOP_BA_MSK)) !=
7701 + HT_ADDBA_REQUESTED_MSK) {
7702 + spin_unlock_bh(&sta->lock);
7703 + *state = HT_AGG_STATE_IDLE;
7704 +diff --git a/net/netfilter/xt_recent.c b/net/netfilter/xt_recent.c
7705 +index eb0ceb8..1a3b650 100644
7706 +--- a/net/netfilter/xt_recent.c
7707 ++++ b/net/netfilter/xt_recent.c
7708 +@@ -173,10 +173,10 @@ recent_entry_init(struct recent_table *t, const union nf_inet_addr *addr,
7709 +
7710 + static void recent_entry_update(struct recent_table *t, struct recent_entry *e)
7711 + {
7712 ++ e->index %= ip_pkt_list_tot;
7713 + e->stamps[e->index++] = jiffies;
7714 + if (e->index > e->nstamps)
7715 + e->nstamps = e->index;
7716 +- e->index %= ip_pkt_list_tot;
7717 + list_move_tail(&e->lru_list, &t->lru_list);
7718 + }
7719 +
7720 +@@ -260,7 +260,7 @@ recent_mt(const struct sk_buff *skb, const struct xt_match_param *par)
7721 + for (i = 0; i < e->nstamps; i++) {
7722 + if (info->seconds && time_after(time, e->stamps[i]))
7723 + continue;
7724 +- if (++hits >= info->hit_count) {
7725 ++ if (info->hit_count && ++hits >= info->hit_count) {
7726 + ret = !ret;
7727 + break;
7728 + }
7729 +diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
7730 +index 0266cca..dafd341 100644
7731 +--- a/net/sunrpc/svc_xprt.c
7732 ++++ b/net/sunrpc/svc_xprt.c
7733 +@@ -901,11 +901,8 @@ void svc_delete_xprt(struct svc_xprt *xprt)
7734 + if (test_bit(XPT_TEMP, &xprt->xpt_flags))
7735 + serv->sv_tmpcnt--;
7736 +
7737 +- for (dr = svc_deferred_dequeue(xprt); dr;
7738 +- dr = svc_deferred_dequeue(xprt)) {
7739 +- svc_xprt_put(xprt);
7740 ++ while ((dr = svc_deferred_dequeue(xprt)) != NULL)
7741 + kfree(dr);
7742 +- }
7743 +
7744 + svc_xprt_put(xprt);
7745 + spin_unlock_bh(&serv->sv_lock);
7746 +diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
7747 +index 37c5475..5cdbf7c 100644
7748 +--- a/net/sunrpc/xprtsock.c
7749 ++++ b/net/sunrpc/xprtsock.c
7750 +@@ -1926,6 +1926,11 @@ static void xs_tcp_setup_socket(struct rpc_xprt *xprt,
7751 + case -EALREADY:
7752 + xprt_clear_connecting(xprt);
7753 + return;
7754 ++ case -EINVAL:
7755 ++ /* Happens, for instance, if the user specified a link
7756 ++ * local IPv6 address without a scope-id.
7757 ++ */
7758 ++ goto out;
7759 + }
7760 + out_eagain:
7761 + status = -EAGAIN;
7762 +diff --git a/security/selinux/ss/ebitmap.c b/security/selinux/ss/ebitmap.c
7763 +index 68c7348..04b6145 100644
7764 +--- a/security/selinux/ss/ebitmap.c
7765 ++++ b/security/selinux/ss/ebitmap.c
7766 +@@ -128,7 +128,7 @@ int ebitmap_netlbl_export(struct ebitmap *ebmap,
7767 + cmap_idx = delta / NETLBL_CATMAP_MAPSIZE;
7768 + cmap_sft = delta % NETLBL_CATMAP_MAPSIZE;
7769 + c_iter->bitmap[cmap_idx]
7770 +- |= e_iter->maps[cmap_idx] << cmap_sft;
7771 ++ |= e_iter->maps[i] << cmap_sft;
7772 + }
7773 + e_iter = e_iter->next;
7774 + }
7775 +diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
7776 +index ab73edf..7ba779d 100644
7777 +--- a/sound/core/pcm_native.c
7778 ++++ b/sound/core/pcm_native.c
7779 +@@ -314,10 +314,10 @@ int snd_pcm_hw_refine(struct snd_pcm_substream *substream,
7780 + if (!params->info)
7781 + params->info = hw->info & ~SNDRV_PCM_INFO_FIFO_IN_FRAMES;
7782 + if (!params->fifo_size) {
7783 +- if (snd_mask_min(&params->masks[SNDRV_PCM_HW_PARAM_FORMAT]) ==
7784 +- snd_mask_max(&params->masks[SNDRV_PCM_HW_PARAM_FORMAT]) &&
7785 +- snd_mask_min(&params->masks[SNDRV_PCM_HW_PARAM_CHANNELS]) ==
7786 +- snd_mask_max(&params->masks[SNDRV_PCM_HW_PARAM_CHANNELS])) {
7787 ++ m = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);
7788 ++ i = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
7789 ++ if (snd_mask_min(m) == snd_mask_max(m) &&
7790 ++ snd_interval_min(i) == snd_interval_max(i)) {
7791 + changed = substream->ops->ioctl(substream,
7792 + SNDRV_PCM_IOCTL1_FIFO_SIZE, params);
7793 + if (changed < 0)
7794 +diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
7795 +index fec8724..673cec3 100644
7796 +--- a/sound/pci/hda/hda_intel.c
7797 ++++ b/sound/pci/hda/hda_intel.c
7798 +@@ -2224,7 +2224,12 @@ static int azx_dev_free(struct snd_device *device)
7799 + static struct snd_pci_quirk position_fix_list[] __devinitdata = {
7800 + SND_PCI_QUIRK(0x1028, 0x01cc, "Dell D820", POS_FIX_LPIB),
7801 + SND_PCI_QUIRK(0x1028, 0x01de, "Dell Precision 390", POS_FIX_LPIB),
7802 ++ SND_PCI_QUIRK(0x103c, 0x306d, "HP dv3", POS_FIX_LPIB),
7803 ++ SND_PCI_QUIRK(0x1106, 0x3288, "ASUS M2V-MX SE", POS_FIX_LPIB),
7804 + SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB),
7805 ++ SND_PCI_QUIRK(0x1028, 0x01f6, "Dell Latitude 131L", POS_FIX_LPIB),
7806 ++ SND_PCI_QUIRK(0x1462, 0x1002, "MSI Wind U115", POS_FIX_LPIB),
7807 ++ SND_PCI_QUIRK(0x1565, 0x820f, "Biostar Microtech", POS_FIX_LPIB),
7808 + {}
7809 + };
7810 +
7811 +diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
7812 +index 2d603f6..2377e75 100644
7813 +--- a/sound/pci/hda/patch_analog.c
7814 ++++ b/sound/pci/hda/patch_analog.c
7815 +@@ -1003,7 +1003,7 @@ static struct snd_pci_quirk ad1986a_cfg_tbl[] = {
7816 + SND_PCI_QUIRK(0x1043, 0x81cb, "ASUS M2N", AD1986A_3STACK),
7817 + SND_PCI_QUIRK(0x1043, 0x8234, "ASUS M2N", AD1986A_3STACK),
7818 + SND_PCI_QUIRK(0x10de, 0xcb84, "ASUS A8N-VM", AD1986A_3STACK),
7819 +- SND_PCI_QUIRK(0x1179, 0xff40, "Toshiba", AD1986A_LAPTOP_EAPD),
7820 ++ SND_PCI_QUIRK(0x1179, 0xff40, "Toshiba Satellite L40-10Q", AD1986A_3STACK),
7821 + SND_PCI_QUIRK(0x144d, 0xb03c, "Samsung R55", AD1986A_3STACK),
7822 + SND_PCI_QUIRK(0x144d, 0xc01e, "FSC V2060", AD1986A_LAPTOP),
7823 + SND_PCI_QUIRK(0x144d, 0xc024, "Samsung P50", AD1986A_SAMSUNG_P50),
7824 +diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c
7825 +index 8a332d2..03d6aea 100644
7826 +--- a/sound/pci/via82xx.c
7827 ++++ b/sound/pci/via82xx.c
7828 +@@ -1791,6 +1791,12 @@ static struct ac97_quirk ac97_quirks[] = {
7829 + .type = AC97_TUNE_HP_ONLY
7830 + },
7831 + {
7832 ++ .subvendor = 0x110a,
7833 ++ .subdevice = 0x0079,
7834 ++ .name = "Fujitsu Siemens D1289",
7835 ++ .type = AC97_TUNE_HP_ONLY
7836 ++ },
7837 ++ {
7838 + .subvendor = 0x1019,
7839 + .subdevice = 0x0a81,
7840 + .name = "ECS K7VTA3",
7841 +diff --git a/sound/soc/codecs/ak4104.c b/sound/soc/codecs/ak4104.c
7842 +index 4d47bc4..10c7550 100644
7843 +--- a/sound/soc/codecs/ak4104.c
7844 ++++ b/sound/soc/codecs/ak4104.c
7845 +@@ -90,12 +90,10 @@ static int ak4104_spi_write(struct snd_soc_codec *codec, unsigned int reg,
7846 + if (reg >= codec->reg_cache_size)
7847 + return -EINVAL;
7848 +
7849 +- reg &= AK4104_REG_MASK;
7850 +- reg |= AK4104_WRITE;
7851 +-
7852 + /* only write to the hardware if value has changed */
7853 + if (cache[reg] != value) {
7854 +- u8 tmp[2] = { reg, value };
7855 ++ u8 tmp[2] = { (reg & AK4104_REG_MASK) | AK4104_WRITE, value };
7856 ++
7857 + if (spi_write(spi, tmp, sizeof(tmp))) {
7858 + dev_err(&spi->dev, "SPI write failed\n");
7859 + return -EIO;
7860 +diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
7861 +index f26a125..79633ea 100644
7862 +--- a/sound/usb/usbaudio.c
7863 ++++ b/sound/usb/usbaudio.c
7864 +@@ -3326,6 +3326,32 @@ static int snd_usb_cm6206_boot_quirk(struct usb_device *dev)
7865 + }
7866 +
7867 + /*
7868 ++ * This call will put the synth in "USB send" mode, i.e it will send MIDI
7869 ++ * messages through USB (this is disabled at startup). The synth will
7870 ++ * acknowledge by sending a sysex on endpoint 0x85 and by displaying a USB
7871 ++ * sign on its LCD. Values here are chosen based on sniffing USB traffic
7872 ++ * under Windows.
7873 ++ */
7874 ++static int snd_usb_accessmusic_boot_quirk(struct usb_device *dev)
7875 ++{
7876 ++ int err, actual_length;
7877 ++
7878 ++ /* "midi send" enable */
7879 ++ static const u8 seq[] = { 0x4e, 0x73, 0x52, 0x01 };
7880 ++
7881 ++ void *buf = kmemdup(seq, ARRAY_SIZE(seq), GFP_KERNEL);
7882 ++ if (!buf)
7883 ++ return -ENOMEM;
7884 ++ err = usb_interrupt_msg(dev, usb_sndintpipe(dev, 0x05), buf,
7885 ++ ARRAY_SIZE(seq), &actual_length, 1000);
7886 ++ kfree(buf);
7887 ++ if (err < 0)
7888 ++ return err;
7889 ++
7890 ++ return 0;
7891 ++}
7892 ++
7893 ++/*
7894 + * Setup quirks
7895 + */
7896 + #define AUDIOPHILE_SET 0x01 /* if set, parse device_setup */
7897 +@@ -3616,6 +3642,12 @@ static void *snd_usb_audio_probe(struct usb_device *dev,
7898 + goto __err_val;
7899 + }
7900 +
7901 ++ /* Access Music VirusTI Desktop */
7902 ++ if (id == USB_ID(0x133e, 0x0815)) {
7903 ++ if (snd_usb_accessmusic_boot_quirk(dev) < 0)
7904 ++ goto __err_val;
7905 ++ }
7906 ++
7907 + /*
7908 + * found a config. now register to ALSA
7909 + */
7910 +diff --git a/sound/usb/usbmidi.c b/sound/usb/usbmidi.c
7911 +index 0eff19c..b8958f9 100644
7912 +--- a/sound/usb/usbmidi.c
7913 ++++ b/sound/usb/usbmidi.c
7914 +@@ -1360,6 +1360,12 @@ static struct port_info {
7915 + EXTERNAL_PORT(0x086a, 0x0001, 8, "%s Broadcast"),
7916 + EXTERNAL_PORT(0x086a, 0x0002, 8, "%s Broadcast"),
7917 + EXTERNAL_PORT(0x086a, 0x0003, 4, "%s Broadcast"),
7918 ++ /* Access Music Virus TI */
7919 ++ EXTERNAL_PORT(0x133e, 0x0815, 0, "%s MIDI"),
7920 ++ PORT_INFO(0x133e, 0x0815, 1, "%s Synth", 0,
7921 ++ SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC |
7922 ++ SNDRV_SEQ_PORT_TYPE_HARDWARE |
7923 ++ SNDRV_SEQ_PORT_TYPE_SYNTHESIZER),
7924 + };
7925 +
7926 + static struct port_info *find_port_info(struct snd_usb_midi* umidi, int number)
7927 +diff --git a/sound/usb/usbquirks.h b/sound/usb/usbquirks.h
7928 +index f6f201e..391e02f 100644
7929 +--- a/sound/usb/usbquirks.h
7930 ++++ b/sound/usb/usbquirks.h
7931 +@@ -2050,6 +2050,33 @@ YAMAHA_DEVICE(0x7010, "UB99"),
7932 + }
7933 + },
7934 +
7935 ++/* Access Music devices */
7936 ++{
7937 ++ /* VirusTI Desktop */
7938 ++ USB_DEVICE_VENDOR_SPEC(0x133e, 0x0815),
7939 ++ .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) {
7940 ++ .ifnum = QUIRK_ANY_INTERFACE,
7941 ++ .type = QUIRK_COMPOSITE,
7942 ++ .data = &(const struct snd_usb_audio_quirk[]) {
7943 ++ {
7944 ++ .ifnum = 3,
7945 ++ .type = QUIRK_MIDI_FIXED_ENDPOINT,
7946 ++ .data = &(const struct snd_usb_midi_endpoint_info) {
7947 ++ .out_cables = 0x0003,
7948 ++ .in_cables = 0x0003
7949 ++ }
7950 ++ },
7951 ++ {
7952 ++ .ifnum = 4,
7953 ++ .type = QUIRK_IGNORE_INTERFACE
7954 ++ },
7955 ++ {
7956 ++ .ifnum = -1
7957 ++ }
7958 ++ }
7959 ++ }
7960 ++},
7961 ++
7962 + /* */
7963 + {
7964 + /* aka. Serato Scratch Live DJ Box */