/[linux-patches]/genpatches-2.6/tags/2.6.32-15/1009_linux-2.6.32.10.patch
Gentoo

Contents of /genpatches-2.6/tags/2.6.32-15/1009_linux-2.6.32.10.patch

Parent Directory Parent Directory | Revision Log Revision Log


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